solid-panes 3.5.27 → 3.5.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -2
- package/lib/RDFXMLPane.js +6 -8
- package/lib/RDFXMLPane.js.map +1 -1
- package/lib/argument/argumentPane.js +10 -11
- package/lib/argument/argumentPane.js.map +1 -1
- package/lib/attach/attachPane.js +47 -85
- package/lib/attach/attachPane.js.map +1 -1
- package/lib/audio/audioPane.js +11 -36
- package/lib/audio/audioPane.js.map +1 -1
- package/lib/classInstancePane.js +11 -20
- package/lib/classInstancePane.js.map +1 -1
- package/lib/dashboard/basicPreferences.js +3 -53
- package/lib/dashboard/basicPreferences.js.map +1 -1
- package/lib/dashboard/dashboardPane.js +2 -18
- package/lib/dashboard/dashboardPane.js.map +1 -1
- package/lib/dashboard/homepage.js +1 -19
- package/lib/dashboard/homepage.js.map +1 -1
- package/lib/dataContentPane.js +15 -58
- package/lib/dataContentPane.js.map +1 -1
- package/lib/defaultPane.js +13 -21
- package/lib/defaultPane.js.map +1 -1
- package/lib/dokieli/dokieliPane.js +19 -28
- package/lib/dokieli/dokieliPane.js.map +1 -1
- package/lib/dokieli/new.js.map +1 -1
- package/lib/form/pane.js +26 -40
- package/lib/form/pane.js.map +1 -1
- package/lib/home/homePane.js +7 -23
- package/lib/home/homePane.js.map +1 -1
- package/lib/humanReadablePane.js +14 -28
- package/lib/humanReadablePane.js.map +1 -1
- package/lib/imagePane.js +9 -13
- package/lib/imagePane.js.map +1 -1
- package/lib/index.js +4 -18
- package/lib/index.js.map +1 -1
- package/lib/internal/internalPane.js +10 -41
- package/lib/internal/internalPane.js.map +1 -1
- package/lib/mainPage/footer.js +0 -4
- package/lib/mainPage/footer.js.map +1 -1
- package/lib/mainPage/header.js +2 -28
- package/lib/mainPage/header.js.map +1 -1
- package/lib/mainPage/index.js +1 -12
- package/lib/mainPage/index.js.map +1 -1
- package/lib/microblogPane/microblogPane.js +100 -237
- package/lib/microblogPane/microblogPane.js.map +1 -1
- package/lib/n3Pane.js +2 -7
- package/lib/n3Pane.js.map +1 -1
- package/lib/outline/context.js +0 -2
- package/lib/outline/context.js.map +1 -1
- package/lib/outline/licenseOptions.js +9 -25
- package/lib/outline/licenseOptions.js.map +1 -1
- package/lib/outline/manager.js +178 -580
- package/lib/outline/manager.js.map +1 -1
- package/lib/outline/manager.test.js +1 -11
- package/lib/outline/manager.test.js.map +1 -1
- package/lib/outline/outlineIcons.js +30 -25
- package/lib/outline/outlineIcons.js.map +1 -1
- package/lib/outline/propertyViews.js +0 -10
- package/lib/outline/propertyViews.js.map +1 -1
- package/lib/outline/propertyViews.test.js +1 -3
- package/lib/outline/propertyViews.test.js.map +1 -1
- package/lib/outline/queryByExample.js +24 -76
- package/lib/outline/queryByExample.js.map +1 -1
- package/lib/outline/userInput.js +214 -454
- package/lib/outline/userInput.js.map +1 -1
- package/lib/outline/viewAsImage.js +0 -6
- package/lib/outline/viewAsImage.js.map +1 -1
- package/lib/outline/viewAsMbox.js +3 -4
- package/lib/outline/viewAsMbox.js.map +1 -1
- package/lib/pad/padPane.js +45 -93
- package/lib/pad/padPane.js.map +1 -1
- package/lib/playlist/playlistPane.js +3 -20
- package/lib/playlist/playlistPane.js.map +1 -1
- package/lib/profile/editProfile.view.js +7 -24
- package/lib/profile/editProfile.view.js.map +1 -1
- package/lib/profile/profile.dom.js +0 -3
- package/lib/profile/profile.dom.js.map +1 -1
- package/lib/registerPanes.js +29 -27
- package/lib/registerPanes.js.map +1 -1
- package/lib/schedule/formsForSchedule.js.map +1 -1
- package/lib/schedule/schedulePane.js +62 -122
- package/lib/schedule/schedulePane.js.map +1 -1
- package/lib/sharing/sharingPane.js +2 -10
- package/lib/sharing/sharingPane.js.map +1 -1
- package/lib/slideshow/slideshowPane.js +9 -14
- package/lib/slideshow/slideshowPane.js.map +1 -1
- package/lib/socialPane.js +43 -124
- package/lib/socialPane.js.map +1 -1
- package/lib/tabbed/tabbedPane.js +1 -15
- package/lib/tabbed/tabbedPane.js.map +1 -1
- package/lib/tableViewPane.js +4 -7
- package/lib/tableViewPane.js.map +1 -1
- package/lib/test-import-export/common.js +2 -1
- package/lib/test-import-export/common.js.map +1 -1
- package/lib/test-import-export/edit-importer.js +7 -9
- package/lib/test-import-export/edit-importer.js.map +1 -1
- package/lib/transaction/pane.js +31 -90
- package/lib/transaction/pane.js.map +1 -1
- package/lib/transaction/period.js +20 -71
- package/lib/transaction/period.js.map +1 -1
- package/lib/trip/tripPane.js +30 -34
- package/lib/trip/tripPane.js.map +1 -1
- package/lib/trustedApplications/__snapshots__/trustedApplications.test.js.snap +176 -0
- package/lib/trustedApplications/trustedApplications.dom.js +8 -34
- package/lib/trustedApplications/trustedApplications.dom.js.map +1 -1
- package/lib/trustedApplications/trustedApplications.test.js +3 -8
- package/lib/trustedApplications/trustedApplications.test.js.map +1 -1
- package/lib/trustedApplications/trustedApplications.utils.js +0 -10
- package/lib/trustedApplications/trustedApplications.utils.js.map +1 -1
- package/lib/trustedApplications/trustedApplications.view.js +1 -22
- package/lib/trustedApplications/trustedApplications.view.js.map +1 -1
- package/lib/ui/pane.js +22 -28
- package/lib/ui/pane.js.map +1 -1
- package/lib/versionInfo.js +4 -4
- package/lib/versionInfo.js.map +1 -1
- package/lib/video/videoPane.js +2 -5
- package/lib/video/videoPane.js.map +1 -1
- package/package.json +24 -24
- package/src/versionInfo.ts +4 -4
|
@@ -6,29 +6,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.createApplicationTable = createApplicationTable;
|
|
7
7
|
exports.createContainer = createContainer;
|
|
8
8
|
exports.createText = createText;
|
|
9
|
-
|
|
10
9
|
var _rdflib = require("rdflib");
|
|
11
|
-
|
|
12
10
|
var _solidUi = require("solid-ui");
|
|
13
|
-
|
|
14
11
|
var _solidLogic = require("solid-logic");
|
|
15
|
-
|
|
16
12
|
var _trustedApplications = require("./trustedApplications.utils");
|
|
17
|
-
|
|
18
13
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
19
|
-
|
|
20
14
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
21
|
-
|
|
22
15
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23
|
-
|
|
24
16
|
function createApplicationTable(subject) {
|
|
25
17
|
var applicationsTable = createElement('table', {
|
|
26
18
|
"class": 'results'
|
|
27
|
-
});
|
|
19
|
+
});
|
|
28
20
|
|
|
21
|
+
// creating headers
|
|
29
22
|
var header = createContainer('tr', [createText('th', 'Application URL'), createText('th', 'Access modes'), createText('th', 'Actions')]);
|
|
30
|
-
applicationsTable.appendChild(header);
|
|
23
|
+
applicationsTable.appendChild(header);
|
|
31
24
|
|
|
25
|
+
// creating rows
|
|
32
26
|
_solidLogic.store.each(subject, _solidUi.ns.acl('trustedApp'), undefined, undefined).flatMap(function (app) {
|
|
33
27
|
return _solidLogic.store.each(app, _solidUi.ns.acl('origin'), undefined, undefined).map(function (origin) {
|
|
34
28
|
return {
|
|
@@ -40,19 +34,17 @@ function createApplicationTable(subject) {
|
|
|
40
34
|
return a.origin.value < b.origin.value ? -1 : 1;
|
|
41
35
|
}).forEach(function (_ref) {
|
|
42
36
|
var appModes = _ref.appModes,
|
|
43
|
-
|
|
37
|
+
origin = _ref.origin;
|
|
44
38
|
return applicationsTable.appendChild(createApplicationEntry(subject, origin, appModes, updateTable));
|
|
45
|
-
});
|
|
46
|
-
|
|
39
|
+
});
|
|
47
40
|
|
|
41
|
+
// adding a row for new applications
|
|
48
42
|
applicationsTable.appendChild(createApplicationEntry(subject, null, [_solidUi.ns.acl('Read')], updateTable));
|
|
49
43
|
return applicationsTable;
|
|
50
|
-
|
|
51
44
|
function updateTable() {
|
|
52
45
|
applicationsTable.parentElement.replaceChild(createApplicationTable(subject), applicationsTable);
|
|
53
46
|
}
|
|
54
47
|
}
|
|
55
|
-
|
|
56
48
|
function createApplicationEntry(subject, origin, appModes, updateTable) {
|
|
57
49
|
var trustedApplicationState = {
|
|
58
50
|
origin: origin,
|
|
@@ -86,17 +78,14 @@ function createApplicationEntry(subject, origin, appModes, updateTable) {
|
|
|
86
78
|
})], {}, {
|
|
87
79
|
submit: addOrEditApplication
|
|
88
80
|
})])]);
|
|
89
|
-
|
|
90
81
|
function addOrEditApplication(event) {
|
|
91
82
|
event.preventDefault();
|
|
92
83
|
var origin;
|
|
93
|
-
|
|
94
84
|
try {
|
|
95
85
|
origin = (0, _rdflib.sym)(trustedApplicationState.formElements.origin.value);
|
|
96
86
|
} catch (err) {
|
|
97
87
|
return alert('Please provide an application URL you want to trust');
|
|
98
88
|
}
|
|
99
|
-
|
|
100
89
|
var modes = trustedApplicationState.formElements.modes.filter(function (checkbox) {
|
|
101
90
|
return checkbox.checked;
|
|
102
91
|
}).map(function (checkbox) {
|
|
@@ -104,52 +93,40 @@ function createApplicationEntry(subject, origin, appModes, updateTable) {
|
|
|
104
93
|
});
|
|
105
94
|
var deletions = (0, _trustedApplications.getStatementsToDelete)(trustedApplicationState.origin || origin, subject, _solidLogic.store, _solidUi.ns);
|
|
106
95
|
var additions = (0, _trustedApplications.getStatementsToAdd)(origin, (0, _trustedApplications.generateRandomString)(), modes, subject, _solidUi.ns);
|
|
107
|
-
|
|
108
96
|
if (!_solidLogic.store.updater) {
|
|
109
97
|
throw new Error('Store has no updater');
|
|
110
98
|
}
|
|
111
|
-
|
|
112
99
|
_solidLogic.store.updater.update(deletions, additions, handleUpdateResponse);
|
|
113
100
|
}
|
|
114
|
-
|
|
115
101
|
function removeApplication(event) {
|
|
116
102
|
event.preventDefault();
|
|
117
103
|
var origin;
|
|
118
|
-
|
|
119
104
|
try {
|
|
120
105
|
origin = (0, _rdflib.sym)(trustedApplicationState.formElements.origin.value);
|
|
121
106
|
} catch (err) {
|
|
122
107
|
return alert('Please provide an application URL you want to remove trust from');
|
|
123
108
|
}
|
|
124
|
-
|
|
125
109
|
var deletions = (0, _trustedApplications.getStatementsToDelete)(origin, subject, _solidLogic.store, _solidUi.ns);
|
|
126
|
-
|
|
127
110
|
if (!_solidLogic.store.updater) {
|
|
128
111
|
throw new Error('Store has no updater');
|
|
129
112
|
}
|
|
130
|
-
|
|
131
113
|
_solidLogic.store.updater.update(deletions, [], handleUpdateResponse);
|
|
132
114
|
}
|
|
133
|
-
|
|
134
115
|
function handleUpdateResponse(uri, success, errorBody) {
|
|
135
116
|
if (success) {
|
|
136
117
|
return updateTable();
|
|
137
118
|
}
|
|
138
|
-
|
|
139
119
|
console.error(uri, errorBody);
|
|
140
120
|
}
|
|
141
121
|
}
|
|
142
|
-
|
|
143
122
|
function createElement(elementName) {
|
|
144
123
|
var attributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
145
124
|
var eventListeners = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
146
125
|
var onCreated = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
|
147
126
|
var element = document.createElement(elementName);
|
|
148
|
-
|
|
149
127
|
if (onCreated) {
|
|
150
128
|
onCreated(element);
|
|
151
129
|
}
|
|
152
|
-
|
|
153
130
|
Object.keys(attributes).forEach(function (attName) {
|
|
154
131
|
element.setAttribute(attName, attributes[attName]);
|
|
155
132
|
});
|
|
@@ -158,7 +135,6 @@ function createElement(elementName) {
|
|
|
158
135
|
});
|
|
159
136
|
return element;
|
|
160
137
|
}
|
|
161
|
-
|
|
162
138
|
function createContainer(elementName, children) {
|
|
163
139
|
var attributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
164
140
|
var eventListeners = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
@@ -169,7 +145,6 @@ function createContainer(elementName, children) {
|
|
|
169
145
|
});
|
|
170
146
|
return element;
|
|
171
147
|
}
|
|
172
|
-
|
|
173
148
|
function createText(elementName, textContent) {
|
|
174
149
|
var attributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
175
150
|
var eventListeners = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
@@ -178,10 +153,9 @@ function createText(elementName, textContent) {
|
|
|
178
153
|
element.textContent = textContent;
|
|
179
154
|
return element;
|
|
180
155
|
}
|
|
181
|
-
|
|
182
156
|
function createModesInput(_ref2) {
|
|
183
157
|
var appModes = _ref2.appModes,
|
|
184
|
-
|
|
158
|
+
formElements = _ref2.formElements;
|
|
185
159
|
return ['Read', 'Write', 'Append', 'Control'].map(function (mode) {
|
|
186
160
|
var isChecked = appModes.some(function (appMode) {
|
|
187
161
|
return appMode.value === _solidUi.ns.acl(mode).value;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trustedApplications.dom.js","names":["createApplicationTable","subject","applicationsTable","createElement","header","createContainer","createText","appendChild","store","each","ns","acl","undefined","flatMap","app","map","origin","appModes","sort","a","b","value","forEach","createApplicationEntry","updateTable","parentElement","replaceChild","trustedApplicationState","formElements","modes","placeholder","element","submit","addOrEditApplication","createModesInput","style","click","removeApplication","event","preventDefault","sym","err","alert","filter","checkbox","checked","deletions","getStatementsToDelete","additions","getStatementsToAdd","generateRandomString","updater","Error","update","handleUpdateResponse","uri","success","errorBody","console","error","elementName","attributes","eventListeners","onCreated","document","Object","keys","attName","setAttribute","eventName","addEventListener","children","child","textContent","mode","isChecked","some","appMode","type","push"],"sources":["../../src/trustedApplications/trustedApplications.dom.ts"],"sourcesContent":["import { NamedNode, Statement, sym } from 'rdflib'\nimport { ns } from 'solid-ui'\nimport { store } from 'solid-logic'\nimport { generateRandomString, getStatementsToAdd, getStatementsToDelete } from './trustedApplications.utils'\n\ninterface FormElements {\n modes: HTMLInputElement[]\n // This appears to be used to store either a node from the store,\n // or a reference to the input (checkbox) element for a particular mode.\n // These typings were created post-hoc, so I'm not sure if that was intentional.\n // Thus, this union type should be considered as descriptive rather than prescriptive.\n origin: undefined | NamedNode | HTMLInputElement\n}\n\nexport function createApplicationTable (subject: NamedNode) {\n const applicationsTable = createElement('table', {\n class: 'results'\n })\n\n // creating headers\n const header = createContainer('tr', [\n createText('th', 'Application URL'),\n createText('th', 'Access modes'),\n createText('th', 'Actions')\n ])\n applicationsTable.appendChild(header);\n\n // creating rows\n (store.each(subject, ns.acl('trustedApp'), undefined, undefined) as unknown as Statement[])\n .flatMap(app => store\n .each(app as any, ns.acl('origin'), undefined, undefined)\n .map(origin => ({\n appModes: store.each(app as any, ns.acl('mode'), undefined, undefined) as NamedNode[],\n origin: origin as NamedNode\n })))\n .sort((a: any, b: any) => (a.origin.value < b.origin.value ? -1 : 1))\n .forEach(\n ({ appModes, origin }: { appModes: NamedNode[]; origin: NamedNode }) =>\n applicationsTable.appendChild(\n createApplicationEntry(subject, origin, appModes, updateTable)\n )\n )\n\n // adding a row for new applications\n applicationsTable.appendChild(\n createApplicationEntry(subject, null, [ns.acl('Read')], updateTable)\n )\n\n return applicationsTable\n\n function updateTable () {\n applicationsTable.parentElement!.replaceChild(\n createApplicationTable(subject),\n applicationsTable\n )\n }\n}\n\nfunction createApplicationEntry (\n subject: NamedNode,\n origin: NamedNode | null,\n appModes: NamedNode[],\n updateTable: () => void\n): HTMLTableRowElement {\n const trustedApplicationState = {\n origin,\n appModes,\n formElements: {\n modes: [],\n origin: undefined\n } as FormElements\n }\n return createContainer('tr', [\n createContainer('td', [\n createContainer(\n 'form',\n [\n createElement(\n 'input',\n {\n class: 'textinput',\n placeholder: 'Write new URL here',\n value: origin ? origin.value : ''\n },\n {},\n element => {\n trustedApplicationState.formElements.origin = element\n }\n )\n ],\n {},\n {\n submit: addOrEditApplication\n }\n )\n ]),\n createContainer('td', [\n createContainer(\n 'form',\n createModesInput(trustedApplicationState),\n {},\n {\n submit: addOrEditApplication\n }\n )\n ]),\n createContainer('td', [\n createContainer(\n 'form',\n origin\n ? [\n createText('button', 'Update', {\n class: 'controlButton',\n style: 'background: LightGreen;'\n }),\n createText(\n 'button',\n 'Delete',\n {\n class: 'controlButton',\n style: 'background: LightCoral;'\n },\n {\n click: removeApplication\n }\n )\n ]\n : [\n createText('button', 'Add', {\n class: 'controlButton',\n style: 'background: LightGreen;'\n })\n ],\n {},\n {\n submit: addOrEditApplication\n }\n )\n ])\n ])\n\n function addOrEditApplication (event: Event) {\n event.preventDefault()\n let origin\n try {\n origin = sym(trustedApplicationState.formElements.origin!.value)\n } catch (err) {\n return alert('Please provide an application URL you want to trust')\n }\n\n const modes = trustedApplicationState.formElements.modes\n .filter(checkbox => checkbox.checked)\n .map(checkbox => checkbox.value)\n\n const deletions = getStatementsToDelete(\n trustedApplicationState.origin || origin,\n subject,\n store,\n ns\n )\n const additions = getStatementsToAdd(\n origin,\n generateRandomString(),\n modes,\n subject,\n ns\n )\n if (!store.updater) {\n throw new Error('Store has no updater')\n }\n store.updater.update(deletions, additions, handleUpdateResponse)\n }\n\n function removeApplication (event: Event) {\n event.preventDefault()\n let origin\n try {\n origin = sym(trustedApplicationState.formElements.origin!.value)\n } catch (err) {\n return alert(\n 'Please provide an application URL you want to remove trust from'\n )\n }\n\n const deletions = getStatementsToDelete(origin, subject, store, ns)\n if (!store.updater) {\n throw new Error('Store has no updater')\n }\n store.updater.update(deletions, [], handleUpdateResponse)\n }\n\n function handleUpdateResponse (uri: any, success: boolean, errorBody: any) {\n if (success) {\n return updateTable()\n }\n console.error(uri, errorBody)\n }\n}\n\nfunction createElement<K extends keyof globalThis.HTMLElementTagNameMap> (\n elementName: K,\n attributes: { [name: string]: string } = {},\n eventListeners: { [eventName: string]: globalThis.EventListener } = {},\n // eslint-disable-next-line no-unused-vars\n onCreated: null | ((createdElement: globalThis.HTMLElementTagNameMap[K]) => void) = null\n) {\n const element = document.createElement(elementName)\n if (onCreated) {\n onCreated(element)\n }\n Object.keys(attributes).forEach(attName => {\n element.setAttribute(attName, attributes[attName])\n })\n Object.keys(eventListeners).forEach(eventName => {\n element.addEventListener(eventName, eventListeners[eventName])\n })\n return element\n}\n\nexport function createContainer<K extends keyof globalThis.HTMLElementTagNameMap> (\n elementName: K,\n children: HTMLElement[],\n attributes = {},\n eventListeners = {},\n onCreated = null\n) {\n const element = createElement(\n elementName,\n attributes,\n eventListeners,\n onCreated\n )\n children.forEach(child => element.appendChild(child))\n return element\n}\n\nexport function createText<K extends keyof globalThis.HTMLElementTagNameMap> (\n elementName: K,\n textContent: string | null,\n attributes = {},\n eventListeners = {},\n onCreated = null\n) {\n const element = createElement(\n elementName,\n attributes,\n eventListeners,\n onCreated\n )\n element.textContent = textContent\n return element\n}\n\nfunction createModesInput ({ appModes, formElements }: {\n appModes: NamedNode[]\n formElements: FormElements\n}) {\n return ['Read', 'Write', 'Append', 'Control'].map(mode => {\n const isChecked = appModes.some(\n appMode => appMode.value === ns.acl(mode).value\n )\n return createContainer('label', [\n createElement(\n 'input',\n {\n type: 'checkbox',\n ...(isChecked ? { checked: '' } : {}),\n value: ns.acl(mode).uri\n },\n {},\n element => formElements.modes.push(element)\n ),\n createText('span', mode)\n ])\n })\n}\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;AAWO,SAASA,sBAAT,CAAiCC,OAAjC,EAAqD;EAC1D,IAAMC,iBAAiB,GAAGC,aAAa,CAAC,OAAD,EAAU;IAC/C,SAAO;EADwC,CAAV,CAAvC,CAD0D,CAK1D;;EACA,IAAMC,MAAM,GAAGC,eAAe,CAAC,IAAD,EAAO,CACnCC,UAAU,CA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AAT,CAChB,UAAAC,OAAO;MAAA,OAAIA,OAAO,CAACxD,KAAR,KAAkBX,WAAA,CAAGC,GAAH,CAAO+D,IAAP,EAAarD,KAAnC;IAAA,CADS,CAAlB;IAGA,OAAOhB,eAAe,CAAC,OAAD,EAAU,CAC9BF,aAAa,CACX,OADW;MAGT2E,IAAI,EAAE;IAHG,GAILH,SAAS,GAAG;MAAE9B,OAAO,EAAE;IAAX,CAAH,GAAqB,EAJzB;MAKTxB,KAAK,EAAEX,WAAA,CAAGC,GAAH,CAAO+D,IAAP,EAAanB;IALX,IAOX,EAPW,EAQX,UAAAxB,OAAO;MAAA,OAAIH,YAAY,CAACC,KAAb,CAAmBkD,IAAnB,CAAwBhD,OAAxB,CAAJ;IAAA,CARI,CADiB,EAW9BzB,UAAU,CAAC,MAAD,EAASoE,IAAT,CAXoB,CAAV,CAAtB;EAaD,CAjBM,CAAP;AAkBD"}
|
|
1
|
+
{"version":3,"file":"trustedApplications.dom.js","names":["createApplicationTable","subject","applicationsTable","createElement","header","createContainer","createText","appendChild","store","each","ns","acl","undefined","flatMap","app","map","origin","appModes","sort","a","b","value","forEach","createApplicationEntry","updateTable","parentElement","replaceChild","trustedApplicationState","formElements","modes","placeholder","element","submit","addOrEditApplication","createModesInput","style","click","removeApplication","event","preventDefault","sym","err","alert","filter","checkbox","checked","deletions","getStatementsToDelete","additions","getStatementsToAdd","generateRandomString","updater","Error","update","handleUpdateResponse","uri","success","errorBody","console","error","elementName","attributes","eventListeners","onCreated","document","Object","keys","attName","setAttribute","eventName","addEventListener","children","child","textContent","mode","isChecked","some","appMode","type","push"],"sources":["../../src/trustedApplications/trustedApplications.dom.ts"],"sourcesContent":["import { NamedNode, Statement, sym } from 'rdflib'\nimport { ns } from 'solid-ui'\nimport { store } from 'solid-logic'\nimport { generateRandomString, getStatementsToAdd, getStatementsToDelete } from './trustedApplications.utils'\n\ninterface FormElements {\n modes: HTMLInputElement[]\n // This appears to be used to store either a node from the store,\n // or a reference to the input (checkbox) element for a particular mode.\n // These typings were created post-hoc, so I'm not sure if that was intentional.\n // Thus, this union type should be considered as descriptive rather than prescriptive.\n origin: undefined | NamedNode | HTMLInputElement\n}\n\nexport function createApplicationTable (subject: NamedNode) {\n const applicationsTable = createElement('table', {\n class: 'results'\n })\n\n // creating headers\n const header = createContainer('tr', [\n createText('th', 'Application URL'),\n createText('th', 'Access modes'),\n createText('th', 'Actions')\n ])\n applicationsTable.appendChild(header);\n\n // creating rows\n (store.each(subject, ns.acl('trustedApp'), undefined, undefined) as unknown as Statement[])\n .flatMap(app => store\n .each(app as any, ns.acl('origin'), undefined, undefined)\n .map(origin => ({\n appModes: store.each(app as any, ns.acl('mode'), undefined, undefined) as NamedNode[],\n origin: origin as NamedNode\n })))\n .sort((a: any, b: any) => (a.origin.value < b.origin.value ? -1 : 1))\n .forEach(\n ({ appModes, origin }: { appModes: NamedNode[]; origin: NamedNode }) =>\n applicationsTable.appendChild(\n createApplicationEntry(subject, origin, appModes, updateTable)\n )\n )\n\n // adding a row for new applications\n applicationsTable.appendChild(\n createApplicationEntry(subject, null, [ns.acl('Read')], updateTable)\n )\n\n return applicationsTable\n\n function updateTable () {\n applicationsTable.parentElement!.replaceChild(\n createApplicationTable(subject),\n applicationsTable\n )\n }\n}\n\nfunction createApplicationEntry (\n subject: NamedNode,\n origin: NamedNode | null,\n appModes: NamedNode[],\n updateTable: () => void\n): HTMLTableRowElement {\n const trustedApplicationState = {\n origin,\n appModes,\n formElements: {\n modes: [],\n origin: undefined\n } as FormElements\n }\n return createContainer('tr', [\n createContainer('td', [\n createContainer(\n 'form',\n [\n createElement(\n 'input',\n {\n class: 'textinput',\n placeholder: 'Write new URL here',\n value: origin ? origin.value : ''\n },\n {},\n element => {\n trustedApplicationState.formElements.origin = element\n }\n )\n ],\n {},\n {\n submit: addOrEditApplication\n }\n )\n ]),\n createContainer('td', [\n createContainer(\n 'form',\n createModesInput(trustedApplicationState),\n {},\n {\n submit: addOrEditApplication\n }\n )\n ]),\n createContainer('td', [\n createContainer(\n 'form',\n origin\n ? [\n createText('button', 'Update', {\n class: 'controlButton',\n style: 'background: LightGreen;'\n }),\n createText(\n 'button',\n 'Delete',\n {\n class: 'controlButton',\n style: 'background: LightCoral;'\n },\n {\n click: removeApplication\n }\n )\n ]\n : [\n createText('button', 'Add', {\n class: 'controlButton',\n style: 'background: LightGreen;'\n })\n ],\n {},\n {\n submit: addOrEditApplication\n }\n )\n ])\n ])\n\n function addOrEditApplication (event: Event) {\n event.preventDefault()\n let origin\n try {\n origin = sym(trustedApplicationState.formElements.origin!.value)\n } catch (err) {\n return alert('Please provide an application URL you want to trust')\n }\n\n const modes = trustedApplicationState.formElements.modes\n .filter(checkbox => checkbox.checked)\n .map(checkbox => checkbox.value)\n\n const deletions = getStatementsToDelete(\n trustedApplicationState.origin || origin,\n subject,\n store,\n ns\n )\n const additions = getStatementsToAdd(\n origin,\n generateRandomString(),\n modes,\n subject,\n ns\n )\n if (!store.updater) {\n throw new Error('Store has no updater')\n }\n store.updater.update(deletions, additions, handleUpdateResponse)\n }\n\n function removeApplication (event: Event) {\n event.preventDefault()\n let origin\n try {\n origin = sym(trustedApplicationState.formElements.origin!.value)\n } catch (err) {\n return alert(\n 'Please provide an application URL you want to remove trust from'\n )\n }\n\n const deletions = getStatementsToDelete(origin, subject, store, ns)\n if (!store.updater) {\n throw new Error('Store has no updater')\n }\n store.updater.update(deletions, [], handleUpdateResponse)\n }\n\n function handleUpdateResponse (uri: any, success: boolean, errorBody: any) {\n if (success) {\n return updateTable()\n }\n console.error(uri, errorBody)\n }\n}\n\nfunction createElement<K extends keyof globalThis.HTMLElementTagNameMap> (\n elementName: K,\n attributes: { [name: string]: string } = {},\n eventListeners: { [eventName: string]: globalThis.EventListener } = {},\n // eslint-disable-next-line no-unused-vars\n onCreated: null | ((createdElement: globalThis.HTMLElementTagNameMap[K]) => void) = null\n) {\n const element = document.createElement(elementName)\n if (onCreated) {\n onCreated(element)\n }\n Object.keys(attributes).forEach(attName => {\n element.setAttribute(attName, attributes[attName])\n })\n Object.keys(eventListeners).forEach(eventName => {\n element.addEventListener(eventName, eventListeners[eventName])\n })\n return element\n}\n\nexport function createContainer<K extends keyof globalThis.HTMLElementTagNameMap> (\n elementName: K,\n children: HTMLElement[],\n attributes = {},\n eventListeners = {},\n onCreated = null\n) {\n const element = createElement(\n elementName,\n attributes,\n eventListeners,\n onCreated\n )\n children.forEach(child => element.appendChild(child))\n return element\n}\n\nexport function createText<K extends keyof globalThis.HTMLElementTagNameMap> (\n elementName: K,\n textContent: string | null,\n attributes = {},\n eventListeners = {},\n onCreated = null\n) {\n const element = createElement(\n elementName,\n attributes,\n eventListeners,\n onCreated\n )\n element.textContent = textContent\n return element\n}\n\nfunction createModesInput ({ appModes, formElements }: {\n appModes: NamedNode[]\n formElements: FormElements\n}) {\n return ['Read', 'Write', 'Append', 'Control'].map(mode => {\n const isChecked = appModes.some(\n appMode => appMode.value === ns.acl(mode).value\n )\n return createContainer('label', [\n createElement(\n 'input',\n {\n type: 'checkbox',\n ...(isChecked ? { checked: '' } : {}),\n value: ns.acl(mode).uri\n },\n {},\n element => formElements.modes.push(element)\n ),\n createText('span', mode)\n ])\n })\n}\n"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AAA6G;AAAA;AAAA;AAWtG,SAASA,sBAAsB,CAAEC,OAAkB,EAAE;EAC1D,IAAMC,iBAAiB,GAAGC,aAAa,CAAC,OAAO,EAAE;IAC/C,SAAO;EACT,CAAC,CAAC;;EAEF;EACA,IAAMC,MAAM,GAAGC,eAAe,CAAC,IAAI,EAAE,CACnCC,UAAU,CAAC,IAAI,EAAE,iBAAiB,CAAC,EACnCA,UAAU,CAAC,IAAI,EAAE,cAAc,CAAC,EAChCA,UAAU,CAAC,IAAI,EAAE,SAAS,CAAC,CAC5B,CAAC;EACFJ,iBAAiB,CAACK,WAAW,CAACH,MAAM,CAAC;;EAErC;EACCI,iBAAK,CAACC,IAAI,CAACR,OAAO,EAAES,WAAE,CAACC,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ACnB;IAAG,IAEzB,CAAC,CAAC,EACF,UAAAxB,OAAO;MAAA,OAAIH,YAAY,CAACC,KAAK,CAACkD,IAAI,CAAChD,OAAO,CAAC;IAAA,EAC5C,EACDzB,UAAU,CAAC,MAAM,EAAEoE,IAAI,CAAC,CACzB,CAAC;EACJ,CAAC,CAAC;AACJ"}
|
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
4
|
var $rdf = _interopRequireWildcard(require("rdflib"));
|
|
6
|
-
|
|
7
5
|
var _solidNamespace = _interopRequireDefault(require("solid-namespace"));
|
|
8
|
-
|
|
9
6
|
var _trustedApplications = require("./trustedApplications.utils");
|
|
10
|
-
|
|
11
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
12
|
-
|
|
13
8
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
|
-
|
|
15
9
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
|
-
|
|
17
10
|
/* eslint-env jest */
|
|
11
|
+
|
|
18
12
|
var ns = (0, _solidNamespace["default"])($rdf);
|
|
19
13
|
describe('generateRandomString', function () {
|
|
20
14
|
it('generates a random string five characters long', function () {
|
|
@@ -48,7 +42,8 @@ describe('getStatementsToDelete', function () {
|
|
|
48
42
|
mockStore.add(mockApplication, ns.acl('origin'), mockOrigin);
|
|
49
43
|
mockStore.add(mockApplication, ns.acl('mode'), ns.acl('Read'));
|
|
50
44
|
mockStore.add(mockProfile, ns.acl('trustedApp'), mockApplication);
|
|
51
|
-
var statementsToDelete = (0, _trustedApplications.getStatementsToDelete)($rdf.lit('A different origin'),
|
|
45
|
+
var statementsToDelete = (0, _trustedApplications.getStatementsToDelete)($rdf.lit('A different origin'),
|
|
46
|
+
// @@ TODO Remove casting
|
|
52
47
|
mockProfile, mockStore, ns);
|
|
53
48
|
expect(statementsToDelete.length).toBe(0);
|
|
54
49
|
expect(statementsToDelete).toEqual([]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trustedApplications.test.js","names":["ns","solidNamespace","$rdf","describe","it","expect","generateRandomString","length","toBe","mockStore","graph","mockOrigin","sym","mockProfile","getStatementsToDelete","toEqual","mockApplication","add","acl","statementsToDelete","toMatchSnapshot","lit","modes","value","statementsToAdd","getStatementsToAdd"],"sources":["../../src/trustedApplications/trustedApplications.test.ts"],"sourcesContent":["/* eslint-env jest */\nimport * as $rdf from 'rdflib'\nimport solidNamespace from 'solid-namespace'\nimport { generateRandomString, getStatementsToDelete, getStatementsToAdd } from './trustedApplications.utils'\n\nconst ns = solidNamespace($rdf)\n\ndescribe('generateRandomString', () => {\n it('generates a random string five characters long', () => {\n expect(generateRandomString().length).toBe(5)\n })\n})\n\ndescribe('getStatementsToDelete', () => {\n it('should return an empty array when there are no statements', () => {\n const mockStore = $rdf.graph()\n const mockOrigin = $rdf.sym('https://origin.example')\n const mockProfile = $rdf.sym('https://profile.example#me')\n expect(\n getStatementsToDelete(mockOrigin, mockProfile, mockStore, ns)\n ).toEqual([])\n })\n\n it('should return all statements for the given origin', () => {\n const mockStore = $rdf.graph()\n const mockApplication = $rdf.sym('https://app.example')\n const mockOrigin = $rdf.sym('https://origin.example')\n const mockProfile = $rdf.sym('https://profile.example#me')\n mockStore.add(mockApplication, ns.acl('origin'), mockOrigin)\n mockStore.add(mockApplication, ns.acl('mode'), ns.acl('Read'))\n mockStore.add(mockProfile, ns.acl('trustedApp'), mockApplication)\n const statementsToDelete = getStatementsToDelete(\n mockOrigin,\n mockProfile,\n mockStore,\n ns\n )\n expect(statementsToDelete.length).toBe(3)\n expect(statementsToDelete).toMatchSnapshot()\n })\n\n it('should not return statements for a different origin', () => {\n const mockStore = $rdf.graph()\n const mockApplication = $rdf.sym('https://app.example')\n const mockOrigin = $rdf.sym('https://origin.example')\n const mockProfile = $rdf.sym('https://profile.example#me')\n mockStore.add(mockApplication, ns.acl('origin'), mockOrigin)\n mockStore.add(mockApplication, ns.acl('mode'), ns.acl('Read'))\n mockStore.add(mockProfile, ns.acl('trustedApp'), mockApplication)\n\n const statementsToDelete = getStatementsToDelete(\n $rdf.lit('A different origin'), // @@ TODO Remove casting\n mockProfile,\n mockStore,\n ns\n )\n expect(statementsToDelete.length).toBe(0)\n expect(statementsToDelete).toEqual([])\n })\n})\n\ndescribe('getStatementsToAdd', () => {\n it('should return all required statements to add the given permissions for a given origin', () => {\n const mockOrigin = $rdf.sym('https://origin.example')\n const mockProfile = $rdf.sym('https://profile.example#me')\n const modes = [ns.acl('Read').value, ns.acl('Write').value]\n\n const statementsToAdd = getStatementsToAdd(\n mockOrigin,\n 'mock_app_id',\n modes,\n mockProfile,\n ns\n )\n expect(statementsToAdd.length).toBe(4)\n expect(statementsToAdd).toMatchSnapshot()\n })\n})\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"trustedApplications.test.js","names":["ns","solidNamespace","$rdf","describe","it","expect","generateRandomString","length","toBe","mockStore","graph","mockOrigin","sym","mockProfile","getStatementsToDelete","toEqual","mockApplication","add","acl","statementsToDelete","toMatchSnapshot","lit","modes","value","statementsToAdd","getStatementsToAdd"],"sources":["../../src/trustedApplications/trustedApplications.test.ts"],"sourcesContent":["/* eslint-env jest */\nimport * as $rdf from 'rdflib'\nimport solidNamespace from 'solid-namespace'\nimport { generateRandomString, getStatementsToDelete, getStatementsToAdd } from './trustedApplications.utils'\n\nconst ns = solidNamespace($rdf)\n\ndescribe('generateRandomString', () => {\n it('generates a random string five characters long', () => {\n expect(generateRandomString().length).toBe(5)\n })\n})\n\ndescribe('getStatementsToDelete', () => {\n it('should return an empty array when there are no statements', () => {\n const mockStore = $rdf.graph()\n const mockOrigin = $rdf.sym('https://origin.example')\n const mockProfile = $rdf.sym('https://profile.example#me')\n expect(\n getStatementsToDelete(mockOrigin, mockProfile, mockStore, ns)\n ).toEqual([])\n })\n\n it('should return all statements for the given origin', () => {\n const mockStore = $rdf.graph()\n const mockApplication = $rdf.sym('https://app.example')\n const mockOrigin = $rdf.sym('https://origin.example')\n const mockProfile = $rdf.sym('https://profile.example#me')\n mockStore.add(mockApplication, ns.acl('origin'), mockOrigin)\n mockStore.add(mockApplication, ns.acl('mode'), ns.acl('Read'))\n mockStore.add(mockProfile, ns.acl('trustedApp'), mockApplication)\n const statementsToDelete = getStatementsToDelete(\n mockOrigin,\n mockProfile,\n mockStore,\n ns\n )\n expect(statementsToDelete.length).toBe(3)\n expect(statementsToDelete).toMatchSnapshot()\n })\n\n it('should not return statements for a different origin', () => {\n const mockStore = $rdf.graph()\n const mockApplication = $rdf.sym('https://app.example')\n const mockOrigin = $rdf.sym('https://origin.example')\n const mockProfile = $rdf.sym('https://profile.example#me')\n mockStore.add(mockApplication, ns.acl('origin'), mockOrigin)\n mockStore.add(mockApplication, ns.acl('mode'), ns.acl('Read'))\n mockStore.add(mockProfile, ns.acl('trustedApp'), mockApplication)\n\n const statementsToDelete = getStatementsToDelete(\n $rdf.lit('A different origin'), // @@ TODO Remove casting\n mockProfile,\n mockStore,\n ns\n )\n expect(statementsToDelete.length).toBe(0)\n expect(statementsToDelete).toEqual([])\n })\n})\n\ndescribe('getStatementsToAdd', () => {\n it('should return all required statements to add the given permissions for a given origin', () => {\n const mockOrigin = $rdf.sym('https://origin.example')\n const mockProfile = $rdf.sym('https://profile.example#me')\n const modes = [ns.acl('Read').value, ns.acl('Write').value]\n\n const statementsToAdd = getStatementsToAdd(\n mockOrigin,\n 'mock_app_id',\n modes,\n mockProfile,\n ns\n )\n expect(statementsToAdd.length).toBe(4)\n expect(statementsToAdd).toMatchSnapshot()\n })\n})\n"],"mappings":";;;AACA;AACA;AACA;AAA6G;AAAA;AAAA;AAH7G;;AAKA,IAAMA,EAAE,GAAG,IAAAC,0BAAc,EAACC,IAAI,CAAC;AAE/BC,QAAQ,CAAC,sBAAsB,EAAE,YAAM;EACrCC,EAAE,CAAC,gDAAgD,EAAE,YAAM;IACzDC,MAAM,CAAC,IAAAC,yCAAoB,GAAE,CAACC,MAAM,CAAC,CAACC,IAAI,CAAC,CAAC,CAAC;EAC/C,CAAC,CAAC;AACJ,CAAC,CAAC;AAEFL,QAAQ,CAAC,uBAAuB,EAAE,YAAM;EACtCC,EAAE,CAAC,2DAA2D,EAAE,YAAM;IACpE,IAAMK,SAAS,GAAGP,IAAI,CAACQ,KAAK,EAAE;IAC9B,IAAMC,UAAU,GAAGT,IAAI,CAACU,GAAG,CAAC,wBAAwB,CAAC;IACrD,IAAMC,WAAW,GAAGX,IAAI,CAACU,GAAG,CAAC,4BAA4B,CAAC;IAC1DP,MAAM,CACJ,IAAAS,0CAAqB,EAACH,UAAU,EAAEE,WAAW,EAAEJ,SAAS,EAAET,EAAE,CAAC,CAC9D,CAACe,OAAO,CAAC,EAAE,CAAC;EACf,CAAC,CAAC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AAC"}
|
|
@@ -6,21 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.generateRandomString = generateRandomString;
|
|
7
7
|
exports.getStatementsToAdd = getStatementsToAdd;
|
|
8
8
|
exports.getStatementsToDelete = getStatementsToDelete;
|
|
9
|
-
|
|
10
9
|
var _rdflib = require("rdflib");
|
|
11
|
-
|
|
12
10
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
13
|
-
|
|
14
11
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
15
|
-
|
|
16
12
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
17
|
-
|
|
18
13
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
19
|
-
|
|
20
14
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
21
|
-
|
|
22
15
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
23
|
-
|
|
24
16
|
function getStatementsToDelete(origin, person, kb, ns) {
|
|
25
17
|
var applicationStatements = kb.statementsMatching(null, ns.acl('origin'), origin);
|
|
26
18
|
var statementsToDelete = applicationStatements.reduce(function (memo, st) {
|
|
@@ -28,7 +20,6 @@ function getStatementsToDelete(origin, person, kb, ns) {
|
|
|
28
20
|
}, []);
|
|
29
21
|
return statementsToDelete;
|
|
30
22
|
}
|
|
31
|
-
|
|
32
23
|
function getStatementsToAdd(origin, nodeName, modes, person, ns) {
|
|
33
24
|
var application = new _rdflib.BlankNode("bn_".concat(nodeName));
|
|
34
25
|
return [(0, _rdflib.st)(person, ns.acl('trustedApp'), application, person.doc()), (0, _rdflib.st)(application, ns.acl('origin'), origin, person.doc())].concat(_toConsumableArray(modes.map(function (mode) {
|
|
@@ -37,7 +28,6 @@ function getStatementsToAdd(origin, nodeName, modes, person, ns) {
|
|
|
37
28
|
return (0, _rdflib.st)(application, ns.acl('mode'), mode, person.doc());
|
|
38
29
|
})));
|
|
39
30
|
}
|
|
40
|
-
|
|
41
31
|
function generateRandomString() {
|
|
42
32
|
return Math.random().toString(36).substr(2, 5);
|
|
43
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trustedApplications.utils.js","names":["getStatementsToDelete","origin","person","kb","ns","applicationStatements","statementsMatching","acl","statementsToDelete","reduce","memo","st","concat","subject","getStatementsToAdd","nodeName","modes","application","BlankNode","doc","map","mode","sym","generateRandomString","Math","random","toString","substr"],"sources":["../../src/trustedApplications/trustedApplications.utils.ts"],"sourcesContent":["import { BlankNode, IndexedFormula, NamedNode, st, Literal, sym, Statement } from 'rdflib'\nimport { Namespaces } from 'solid-namespace'\n\nexport function getStatementsToDelete (\n origin: NamedNode | Literal,\n person: NamedNode,\n kb: IndexedFormula,\n ns: Namespaces\n): any {\n const applicationStatements = kb.statementsMatching(\n null,\n ns.acl('origin'),\n origin\n )\n const statementsToDelete = applicationStatements.reduce(\n (memo, st) => {\n return memo\n .concat(\n kb.statementsMatching(\n person,\n ns.acl('trustedApp'),\n st.subject as NamedNode\n )\n )\n .concat(kb.statementsMatching(st.subject))\n },\n [] as Array<Statement>\n )\n return statementsToDelete\n}\n\nexport function getStatementsToAdd (\n origin: NamedNode,\n nodeName: string,\n modes: string[],\n person: NamedNode,\n ns: Namespaces\n): any {\n const application = new BlankNode(`bn_${nodeName}`)\n return [\n st(person, ns.acl('trustedApp'), application, person.doc()),\n st(application, ns.acl('origin'), origin, person.doc()),\n ...modes\n .map(mode => sym(mode))\n .map(mode => st(application, ns.acl('mode'), mode, person.doc()))\n ]\n}\n\nexport function generateRandomString () {\n return Math.random().toString(36).substr(2, 5)\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"trustedApplications.utils.js","names":["getStatementsToDelete","origin","person","kb","ns","applicationStatements","statementsMatching","acl","statementsToDelete","reduce","memo","st","concat","subject","getStatementsToAdd","nodeName","modes","application","BlankNode","doc","map","mode","sym","generateRandomString","Math","random","toString","substr"],"sources":["../../src/trustedApplications/trustedApplications.utils.ts"],"sourcesContent":["import { BlankNode, IndexedFormula, NamedNode, st, Literal, sym, Statement } from 'rdflib'\nimport { Namespaces } from 'solid-namespace'\n\nexport function getStatementsToDelete (\n origin: NamedNode | Literal,\n person: NamedNode,\n kb: IndexedFormula,\n ns: Namespaces\n): any {\n const applicationStatements = kb.statementsMatching(\n null,\n ns.acl('origin'),\n origin\n )\n const statementsToDelete = applicationStatements.reduce(\n (memo, st) => {\n return memo\n .concat(\n kb.statementsMatching(\n person,\n ns.acl('trustedApp'),\n st.subject as NamedNode\n )\n )\n .concat(kb.statementsMatching(st.subject))\n },\n [] as Array<Statement>\n )\n return statementsToDelete\n}\n\nexport function getStatementsToAdd (\n origin: NamedNode,\n nodeName: string,\n modes: string[],\n person: NamedNode,\n ns: Namespaces\n): any {\n const application = new BlankNode(`bn_${nodeName}`)\n return [\n st(person, ns.acl('trustedApp'), application, person.doc()),\n st(application, ns.acl('origin'), origin, person.doc()),\n ...modes\n .map(mode => sym(mode))\n .map(mode => st(application, ns.acl('mode'), mode, person.doc()))\n ]\n}\n\nexport function generateRandomString () {\n return Math.random().toString(36).substr(2, 5)\n}\n"],"mappings":";;;;;;;;AAAA;AAA0F;AAAA;AAAA;AAAA;AAAA;AAAA;AAGnF,SAASA,qBAAqB,CAC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A,EAAC;AAEvE;AAEO,SAASI,oBAAoB,GAAI;EACtC,OAAOC,IAAI,CAACC,MAAM,EAAE,CAACC,QAAQ,CAAC,EAAE,CAAC,CAACC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;AAChD"}
|
|
@@ -4,21 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _solidUi = require("solid-ui");
|
|
9
|
-
|
|
10
8
|
var _solidLogic = require("solid-logic");
|
|
11
|
-
|
|
12
9
|
var _trustedApplications = require("./trustedApplications.dom");
|
|
13
|
-
|
|
14
10
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
15
|
-
|
|
16
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
17
|
-
|
|
11
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
18
12
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
19
|
-
|
|
20
13
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
21
|
-
|
|
22
14
|
var thisColor = '#418d99';
|
|
23
15
|
var trustedApplicationView = {
|
|
24
16
|
global: true,
|
|
@@ -37,19 +29,15 @@ var trustedApplicationView = {
|
|
|
37
29
|
var bottom = table.appendChild(dom.createElement('tr'));
|
|
38
30
|
var statusArea = bottom.appendChild(dom.createElement('div'));
|
|
39
31
|
statusArea.setAttribute('style', 'padding: 0.7em;');
|
|
40
|
-
|
|
41
32
|
_render(dom, main, statusArea)["catch"](function (err) {
|
|
42
33
|
return statusArea.appendChild(_solidUi.widgets.errorMessageBlock(dom, err));
|
|
43
34
|
});
|
|
44
|
-
|
|
45
35
|
return div;
|
|
46
36
|
}
|
|
47
37
|
};
|
|
48
|
-
|
|
49
38
|
function _render(_x, _x2, _x3) {
|
|
50
39
|
return _render2.apply(this, arguments);
|
|
51
40
|
}
|
|
52
|
-
|
|
53
41
|
function _render2() {
|
|
54
42
|
_render2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(dom, main, statusArea) {
|
|
55
43
|
var authContext, subject, profile, editable, applicationsTable;
|
|
@@ -64,31 +52,24 @@ function _render2() {
|
|
|
64
52
|
statusArea: statusArea,
|
|
65
53
|
me: null
|
|
66
54
|
});
|
|
67
|
-
|
|
68
55
|
case 2:
|
|
69
56
|
authContext = _context.sent;
|
|
70
57
|
subject = authContext.me;
|
|
71
58
|
profile = subject.doc();
|
|
72
|
-
|
|
73
59
|
if (_solidLogic.store.updater) {
|
|
74
60
|
_context.next = 7;
|
|
75
61
|
break;
|
|
76
62
|
}
|
|
77
|
-
|
|
78
63
|
throw new Error('Store has no updater');
|
|
79
|
-
|
|
80
64
|
case 7:
|
|
81
65
|
editable = _solidLogic.store.updater.editable(profile.uri, _solidLogic.store);
|
|
82
66
|
main.appendChild((0, _trustedApplications.createText)('h3', 'Manage your trusted applications'));
|
|
83
|
-
|
|
84
67
|
if (editable) {
|
|
85
68
|
_context.next = 12;
|
|
86
69
|
break;
|
|
87
70
|
}
|
|
88
|
-
|
|
89
71
|
main.appendChild(_solidUi.widgets.errorMessageBlock(dom, "Your profile ".concat(subject.doc().uri, " is not editable, so we cannot do much here.")));
|
|
90
72
|
return _context.abrupt("return");
|
|
91
|
-
|
|
92
73
|
case 12:
|
|
93
74
|
main.appendChild((0, _trustedApplications.createText)('p', 'Here you can manage the applications you trust.'));
|
|
94
75
|
applicationsTable = (0, _trustedApplications.createApplicationTable)(subject);
|
|
@@ -96,7 +77,6 @@ function _render2() {
|
|
|
96
77
|
main.appendChild((0, _trustedApplications.createText)('h4', 'Notes'));
|
|
97
78
|
main.appendChild((0, _trustedApplications.createContainer)('ol', [main.appendChild((0, _trustedApplications.createText)('li', 'Trusted applications will get access to all resources that you have access to.')), main.appendChild((0, _trustedApplications.createText)('li', 'You can limit which modes they have by default.')), main.appendChild((0, _trustedApplications.createText)('li', 'They will not gain more access than you have.'))]));
|
|
98
79
|
main.appendChild((0, _trustedApplications.createText)('p', 'Application URLs must be valid URL. Examples are http://localhost:3000, https://trusted.app, and https://sub.trusted.app.'));
|
|
99
|
-
|
|
100
80
|
case 18:
|
|
101
81
|
case "end":
|
|
102
82
|
return _context.stop();
|
|
@@ -106,7 +86,6 @@ function _render2() {
|
|
|
106
86
|
}));
|
|
107
87
|
return _render2.apply(this, arguments);
|
|
108
88
|
}
|
|
109
|
-
|
|
110
89
|
var _default = trustedApplicationView;
|
|
111
90
|
exports["default"] = _default;
|
|
112
91
|
//# sourceMappingURL=trustedApplications.view.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trustedApplications.view.js","names":["thisColor","trustedApplicationView","global","icon","icons","iconBase","name","label","render","subject","context","dom","div","createElement","classList","add","setAttribute","table","appendChild","main","bottom","statusArea","err","widgets","errorMessageBlock","login","ensureLoadedProfile","me","authContext","profile","doc","store","updater","Error","editable","uri","createText","applicationsTable","createApplicationTable","createContainer"],"sources":["../../src/trustedApplications/trustedApplications.view.ts"],"sourcesContent":["import { PaneDefinition } from 'pane-registry'\nimport { NamedNode } from 'rdflib'\nimport { icons, login, widgets } from 'solid-ui'\nimport { store } from 'solid-logic'\nimport { createApplicationTable, createContainer, createText } from './trustedApplications.dom'\n\nconst thisColor = '#418d99'\n\nconst trustedApplicationView: PaneDefinition = {\n global: true,\n icon: `${icons.iconBase}noun_15177.svg`,\n name: 'trustedApplications',\n label: () => null,\n render: (subject, context) => {\n const dom = context.dom\n const div = dom.createElement('div')\n div.classList.add('trusted-applications-pane')\n div.setAttribute(\n 'style',\n 'border: 0.3em solid ' +\n thisColor +\n '; border-radius: 0.5em; padding: 0.7em; margin-top:0.7em;'\n )\n const table = div.appendChild(dom.createElement('table'))\n const main = table.appendChild(dom.createElement('tr'))\n const bottom = table.appendChild(dom.createElement('tr'))\n const statusArea = bottom.appendChild(dom.createElement('div'))\n statusArea.setAttribute('style', 'padding: 0.7em;')\n render(dom, main, statusArea).catch(err => statusArea.appendChild(widgets.errorMessageBlock(dom, err)))\n return div\n }\n}\n\nasync function render (dom, main, statusArea): Promise<void> {\n const authContext = await login.ensureLoadedProfile({ dom: dom, div: main, statusArea: statusArea, me: null })\n const subject = authContext.me as NamedNode\n\n const profile = subject.doc()\n if (!store.updater) {\n throw new Error('Store has no updater')\n }\n const editable = store.updater.editable(profile.uri, store)\n\n main.appendChild(createText('h3', 'Manage your trusted applications'))\n\n if (!editable) {\n main.appendChild(\n widgets.errorMessageBlock(dom, `Your profile ${subject.doc().uri} is not editable, so we cannot do much here.`)\n )\n return\n }\n\n main.appendChild(createText('p', 'Here you can manage the applications you trust.'))\n\n const applicationsTable = createApplicationTable(subject)\n main.appendChild(applicationsTable)\n\n main.appendChild(createText('h4', 'Notes'))\n main.appendChild(\n createContainer('ol', [\n main.appendChild(\n createText(\n 'li',\n 'Trusted applications will get access to all resources that you have access to.'\n )\n ),\n main.appendChild(\n createText('li', 'You can limit which modes they have by default.')\n ),\n main.appendChild(\n createText('li', 'They will not gain more access than you have.')\n )\n ])\n )\n main.appendChild(\n createText('p', 'Application URLs must be valid URL. Examples are http://localhost:3000, https://trusted.app, and https://sub.trusted.app.')\n )\n}\n\nexport default trustedApplicationView\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"trustedApplications.view.js","names":["thisColor","trustedApplicationView","global","icon","icons","iconBase","name","label","render","subject","context","dom","div","createElement","classList","add","setAttribute","table","appendChild","main","bottom","statusArea","err","widgets","errorMessageBlock","login","ensureLoadedProfile","me","authContext","profile","doc","store","updater","Error","editable","uri","createText","applicationsTable","createApplicationTable","createContainer"],"sources":["../../src/trustedApplications/trustedApplications.view.ts"],"sourcesContent":["import { PaneDefinition } from 'pane-registry'\nimport { NamedNode } from 'rdflib'\nimport { icons, login, widgets } from 'solid-ui'\nimport { store } from 'solid-logic'\nimport { createApplicationTable, createContainer, createText } from './trustedApplications.dom'\n\nconst thisColor = '#418d99'\n\nconst trustedApplicationView: PaneDefinition = {\n global: true,\n icon: `${icons.iconBase}noun_15177.svg`,\n name: 'trustedApplications',\n label: () => null,\n render: (subject, context) => {\n const dom = context.dom\n const div = dom.createElement('div')\n div.classList.add('trusted-applications-pane')\n div.setAttribute(\n 'style',\n 'border: 0.3em solid ' +\n thisColor +\n '; border-radius: 0.5em; padding: 0.7em; margin-top:0.7em;'\n )\n const table = div.appendChild(dom.createElement('table'))\n const main = table.appendChild(dom.createElement('tr'))\n const bottom = table.appendChild(dom.createElement('tr'))\n const statusArea = bottom.appendChild(dom.createElement('div'))\n statusArea.setAttribute('style', 'padding: 0.7em;')\n render(dom, main, statusArea).catch(err => statusArea.appendChild(widgets.errorMessageBlock(dom, err)))\n return div\n }\n}\n\nasync function render (dom, main, statusArea): Promise<void> {\n const authContext = await login.ensureLoadedProfile({ dom: dom, div: main, statusArea: statusArea, me: null })\n const subject = authContext.me as NamedNode\n\n const profile = subject.doc()\n if (!store.updater) {\n throw new Error('Store has no updater')\n }\n const editable = store.updater.editable(profile.uri, store)\n\n main.appendChild(createText('h3', 'Manage your trusted applications'))\n\n if (!editable) {\n main.appendChild(\n widgets.errorMessageBlock(dom, `Your profile ${subject.doc().uri} is not editable, so we cannot do much here.`)\n )\n return\n }\n\n main.appendChild(createText('p', 'Here you can manage the applications you trust.'))\n\n const applicationsTable = createApplicationTable(subject)\n main.appendChild(applicationsTable)\n\n main.appendChild(createText('h4', 'Notes'))\n main.appendChild(\n createContainer('ol', [\n main.appendChild(\n createText(\n 'li',\n 'Trusted applications will get access to all resources that you have access to.'\n )\n ),\n main.appendChild(\n createText('li', 'You can limit which modes they have by default.')\n ),\n main.appendChild(\n createText('li', 'They will not gain more access than you have.')\n )\n ])\n )\n main.appendChild(\n createText('p', 'Application URLs must be valid URL. Examples are http://localhost:3000, https://trusted.app, and https://sub.trusted.app.')\n )\n}\n\nexport default trustedApplicationView\n"],"mappings":";;;;;;AAEA;AACA;AACA;AAA+F;AAAA,+CAH/F;AAAA;AAAA;AAKA,IAAMA,SAAS,GAAG,SAAS;AAE3B,IAAMC,sBAAsC,GAAG;EAC7CC,MAAM,EAAE,IAAI;EACZC,IAAI,YAAKC,cAAK,CAACC,QAAQ,mBAAgB;EACvCC,IAAI,EAAE,qBAAqB;EAC3BC,KAAK,EAA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