solid-logic 1.3.17-6a574cd0 → 1.3.17-6e0634d8
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 +2 -2
- package/lib/acl/aclLogic.d.ts +3 -30
- package/lib/acl/aclLogic.d.ts.map +1 -1
- package/lib/acl/aclLogic.js +150 -119
- package/lib/acl/aclLogic.js.map +1 -1
- package/lib/authn/SolidAuthnLogic.d.ts.map +1 -1
- package/lib/authn/SolidAuthnLogic.js +2 -2
- package/lib/authn/SolidAuthnLogic.js.map +1 -1
- package/lib/chat/chatLogic.d.ts +3 -0
- package/lib/chat/chatLogic.d.ts.map +1 -0
- package/lib/chat/{ChatLogic.js → chatLogic.js} +82 -86
- package/lib/chat/chatLogic.js.map +1 -0
- package/lib/inbox/inboxLogic.d.ts +3 -0
- package/lib/inbox/inboxLogic.d.ts.map +1 -0
- package/lib/inbox/{InboxLogic.js → inboxLogic.js} +59 -64
- package/lib/inbox/inboxLogic.js.map +1 -0
- package/lib/index.d.ts +6 -11
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -38
- package/lib/index.js.map +1 -1
- package/lib/logic/CustomError.d.ts +4 -0
- package/lib/logic/CustomError.d.ts.map +1 -1
- package/lib/logic/CustomError.js +17 -1
- package/lib/logic/CustomError.js.map +1 -1
- package/lib/logic/solidLogic.d.ts +6 -0
- package/lib/logic/solidLogic.d.ts.map +1 -0
- package/lib/logic/solidLogic.js +92 -0
- package/lib/logic/solidLogic.js.map +1 -0
- package/lib/logic/solidLogicSingleton.d.ts +1 -2
- package/lib/logic/solidLogicSingleton.d.ts.map +1 -1
- package/lib/logic/solidLogicSingleton.js +3 -3
- package/lib/logic/solidLogicSingleton.js.map +1 -1
- package/lib/profile/profileLogic.d.ts +3 -0
- package/lib/profile/profileLogic.d.ts.map +1 -0
- package/lib/profile/profileLogic.js +246 -0
- package/lib/profile/profileLogic.js.map +1 -0
- package/lib/typeIndex/typeIndexLogic.d.ts +2 -21
- package/lib/typeIndex/typeIndexLogic.d.ts.map +1 -1
- package/lib/typeIndex/typeIndexLogic.js +304 -296
- package/lib/typeIndex/typeIndexLogic.js.map +1 -1
- package/lib/types.d.ts +82 -1
- package/lib/types.d.ts.map +1 -1
- package/lib/util/containerLogic.d.ts +11 -0
- package/lib/util/containerLogic.d.ts.map +1 -0
- package/lib/{profile/ProfileLogic.js → util/containerLogic.js} +51 -44
- package/lib/util/containerLogic.js.map +1 -0
- package/lib/util/ns.d.ts +2 -0
- package/lib/util/ns.d.ts.map +1 -0
- package/lib/util/ns.js +34 -0
- package/lib/util/ns.js.map +1 -0
- package/lib/util/utilityLogic.d.ts +15 -0
- package/lib/util/utilityLogic.d.ts.map +1 -0
- package/lib/util/utilityLogic.js +274 -0
- package/lib/util/utilityLogic.js.map +1 -0
- package/lib/util/utils.d.ts +8 -0
- package/lib/util/utils.d.ts.map +1 -0
- package/lib/util/utils.js +48 -0
- package/lib/util/utils.js.map +1 -0
- package/package.json +3 -1
- package/src/acl/aclLogic.ts +136 -118
- package/src/authn/SolidAuthnLogic.ts +3 -2
- package/src/chat/chatLogic.ts +225 -0
- package/src/inbox/inboxLogic.ts +58 -0
- package/src/index.ts +11 -42
- package/src/logic/CustomError.ts +5 -1
- package/src/logic/solidLogic.ts +75 -0
- package/src/logic/solidLogicSingleton.ts +3 -3
- package/src/profile/profileLogic.ts +126 -0
- package/src/typeIndex/typeIndexLogic.ts +175 -182
- package/src/types.ts +83 -4
- package/src/util/containerLogic.ts +53 -0
- package/src/util/ns.ts +5 -0
- package/src/util/utilityLogic.ts +156 -0
- package/src/util/utils.ts +52 -0
- package/test/aclLogic.test.ts +13 -4
- package/test/chatLogic.test.ts +70 -71
- package/test/container.test.ts +57 -0
- package/test/helpers/dataSetup.ts +134 -0
- package/test/helpers/setup.ts +4 -0
- package/test/inboxLogic.test.ts +40 -38
- package/test/logic.test.ts +10 -9
- package/test/profileLogic.test.ts +246 -0
- package/test/typeIndexLogic.test.ts +487 -30
- package/test/utilityLogic.test.ts +172 -126
- package/test/utils.test.ts +32 -0
- package/lib/chat/ChatLogic.d.ts +0 -26
- package/lib/chat/ChatLogic.d.ts.map +0 -1
- package/lib/chat/ChatLogic.js.map +0 -1
- package/lib/chat/determineChatContainer.d.ts +0 -3
- package/lib/chat/determineChatContainer.d.ts.map +0 -1
- package/lib/chat/determineChatContainer.js +0 -12
- package/lib/chat/determineChatContainer.js.map +0 -1
- package/lib/discovery/discoveryLogic.d.ts +0 -37
- package/lib/discovery/discoveryLogic.d.ts.map +0 -1
- package/lib/discovery/discoveryLogic.js +0 -502
- package/lib/discovery/discoveryLogic.js.map +0 -1
- package/lib/inbox/InboxLogic.d.ts +0 -18
- package/lib/inbox/InboxLogic.d.ts.map +0 -1
- package/lib/inbox/InboxLogic.js.map +0 -1
- package/lib/logic/SolidLogic.d.ts +0 -45
- package/lib/logic/SolidLogic.d.ts.map +0 -1
- package/lib/logic/SolidLogic.js +0 -320
- package/lib/logic/SolidLogic.js.map +0 -1
- package/lib/profile/ProfileLogic.d.ts +0 -13
- package/lib/profile/ProfileLogic.d.ts.map +0 -1
- package/lib/profile/ProfileLogic.js.map +0 -1
- package/lib/util/UtilityLogic.d.ts +0 -27
- package/lib/util/UtilityLogic.d.ts.map +0 -1
- package/lib/util/UtilityLogic.js +0 -216
- package/lib/util/UtilityLogic.js.map +0 -1
- package/lib/util/uri.d.ts +0 -3
- package/lib/util/uri.d.ts.map +0 -1
- package/lib/util/uri.js +0 -9
- package/lib/util/uri.js.map +0 -1
- package/src/chat/ChatLogic.ts +0 -244
- package/src/chat/determineChatContainer.ts +0 -14
- package/src/discovery/discoveryLogic.ts +0 -269
- package/src/inbox/InboxLogic.ts +0 -66
- package/src/logic/SolidLogic.ts +0 -259
- package/src/profile/ProfileLogic.ts +0 -44
- package/src/util/UtilityLogic.ts +0 -144
- package/src/util/uri.ts +0 -5
- package/test/discoveryLogic.test.ts +0 -712
package/lib/logic/SolidLogic.js
DELETED
|
@@ -1,320 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
35
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
36
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
37
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
|
-
function step(op) {
|
|
39
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
-
while (_) try {
|
|
41
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
42
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
|
-
switch (op[0]) {
|
|
44
|
-
case 0: case 1: t = op; break;
|
|
45
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
46
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
47
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
48
|
-
default:
|
|
49
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
50
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
51
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
52
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
53
|
-
if (t[2]) _.ops.pop();
|
|
54
|
-
_.trys.pop(); continue;
|
|
55
|
-
}
|
|
56
|
-
op = body.call(thisArg, _);
|
|
57
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
58
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
62
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
63
|
-
};
|
|
64
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65
|
-
exports.SolidLogic = void 0;
|
|
66
|
-
var rdf = __importStar(require("rdflib"));
|
|
67
|
-
var solid_namespace_1 = __importDefault(require("solid-namespace"));
|
|
68
|
-
var SolidAuthnLogic_1 = require("../authn/SolidAuthnLogic");
|
|
69
|
-
var ChatLogic_1 = require("../chat/ChatLogic");
|
|
70
|
-
var ProfileLogic_1 = require("../profile/ProfileLogic");
|
|
71
|
-
var debug = __importStar(require("../util/debug"));
|
|
72
|
-
var UtilityLogic_1 = require("../util/UtilityLogic");
|
|
73
|
-
var CustomError_1 = require("./CustomError");
|
|
74
|
-
/*
|
|
75
|
-
** It is important to distinquish `fetch`, a function provided by the browser
|
|
76
|
-
** and `Fetcher`, a helper object for the rdflib Store which turns it
|
|
77
|
-
** into a `ConnectedStore` or a `LiveStore`. A Fetcher object is
|
|
78
|
-
** available at store.fetcher, and `fetch` function at `store.fetcher._fetch`,
|
|
79
|
-
*/
|
|
80
|
-
var ns = (0, solid_namespace_1.default)(rdf);
|
|
81
|
-
var SolidLogic = /** @class */ (function () {
|
|
82
|
-
function SolidLogic(specialFetch, session) {
|
|
83
|
-
// would xpect to be able to do it this way: but get TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation status: 999
|
|
84
|
-
// this.store = new rdf.LiveStore({})
|
|
85
|
-
// this.store.fetcher._fetch = fetch
|
|
86
|
-
console.log("SolidLogic: Unique instance created. There should only be one of these.");
|
|
87
|
-
this.store = rdf.graph(); // Make a Quad store
|
|
88
|
-
rdf.fetcher(this.store, { fetch: specialFetch.fetch }); // Attach a web I/O module, store.fetcher
|
|
89
|
-
this.store.updater = new rdf.UpdateManager(this.store); // Add real-time live updates store.updater
|
|
90
|
-
this.store.features = []; // disable automatic node merging on store load
|
|
91
|
-
this.cache = {
|
|
92
|
-
profileDocument: {},
|
|
93
|
-
preferencesFile: {},
|
|
94
|
-
};
|
|
95
|
-
this.authn = new SolidAuthnLogic_1.SolidAuthnLogic(session);
|
|
96
|
-
debug.log('SolidAuthnLogic initialized');
|
|
97
|
-
this.profile = new ProfileLogic_1.ProfileLogic(this.store, ns, this.authn);
|
|
98
|
-
this.chat = new ChatLogic_1.ChatLogic(this.store, ns, this.profile);
|
|
99
|
-
this.util = new UtilityLogic_1.UtilityLogic(this.store, ns);
|
|
100
|
-
}
|
|
101
|
-
SolidLogic.prototype.findAclDocUrl = function (url) {
|
|
102
|
-
return this.util.findAclDocUrl(url);
|
|
103
|
-
};
|
|
104
|
-
SolidLogic.prototype.loadProfile = function (me) {
|
|
105
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
106
|
-
var profileDocument, err_1, message;
|
|
107
|
-
return __generator(this, function (_a) {
|
|
108
|
-
switch (_a.label) {
|
|
109
|
-
case 0:
|
|
110
|
-
/*
|
|
111
|
-
// console.log('loadProfile cache ', this.cache)
|
|
112
|
-
if (this.cache.profileDocument[me.value]) {
|
|
113
|
-
return this.cache.profileDocument[me.value];
|
|
114
|
-
} @@ just use the cache in the store
|
|
115
|
-
*/
|
|
116
|
-
console.log('loadProfile me ', me);
|
|
117
|
-
profileDocument = me.doc();
|
|
118
|
-
_a.label = 1;
|
|
119
|
-
case 1:
|
|
120
|
-
_a.trys.push([1, 3, , 4]);
|
|
121
|
-
return [4 /*yield*/, this.store.fetcher.load(profileDocument)];
|
|
122
|
-
case 2:
|
|
123
|
-
_a.sent();
|
|
124
|
-
return [2 /*return*/, profileDocument];
|
|
125
|
-
case 3:
|
|
126
|
-
err_1 = _a.sent();
|
|
127
|
-
message = "Cannot load profile ".concat(profileDocument, " : ").concat(err_1);
|
|
128
|
-
throw new Error(message);
|
|
129
|
-
case 4: return [2 /*return*/];
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
});
|
|
133
|
-
};
|
|
134
|
-
SolidLogic.prototype.loadPreferences = function (me) {
|
|
135
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
136
|
-
// console.log('this.store.any()', this.store.any())
|
|
137
|
-
/**
|
|
138
|
-
* Are we working cross-origin?
|
|
139
|
-
* Returns True if we are in a webapp at an origin, and the file origin is different
|
|
140
|
-
*/
|
|
141
|
-
function differentOrigin() {
|
|
142
|
-
if (!preferencesFile) {
|
|
143
|
-
return true;
|
|
144
|
-
}
|
|
145
|
-
return ("".concat(window.location.origin, "/") !== new URL(preferencesFile.value).origin);
|
|
146
|
-
}
|
|
147
|
-
var preferencesFile, err_2, status_1;
|
|
148
|
-
return __generator(this, function (_a) {
|
|
149
|
-
switch (_a.label) {
|
|
150
|
-
case 0:
|
|
151
|
-
console.log('loadPreferences cache ', this.cache);
|
|
152
|
-
if (this.cache.preferencesFile[me.value]) {
|
|
153
|
-
return [2 /*return*/, this.cache.preferencesFile[me.value]];
|
|
154
|
-
}
|
|
155
|
-
return [4 /*yield*/, this.loadProfile(me)]; // Load pointer to pref file
|
|
156
|
-
case 1:
|
|
157
|
-
_a.sent(); // Load pointer to pref file
|
|
158
|
-
preferencesFile = this.store.any(me, ns.space('preferencesFile'), null, me.doc());
|
|
159
|
-
if (!preferencesFile) {
|
|
160
|
-
throw new Error("Can't find a preference file pointer in profile ".concat(me.doc()));
|
|
161
|
-
}
|
|
162
|
-
_a.label = 2;
|
|
163
|
-
case 2:
|
|
164
|
-
_a.trys.push([2, 4, , 5]);
|
|
165
|
-
return [4 /*yield*/, this.store.fetcher.load(preferencesFile, {
|
|
166
|
-
withCredentials: true,
|
|
167
|
-
})];
|
|
168
|
-
case 3:
|
|
169
|
-
_a.sent();
|
|
170
|
-
return [3 /*break*/, 5];
|
|
171
|
-
case 4:
|
|
172
|
-
err_2 = _a.sent();
|
|
173
|
-
status_1 = err_2.status;
|
|
174
|
-
debug.log("HTTP status ".concat(status_1, " for preference file ").concat(preferencesFile));
|
|
175
|
-
if (status_1 === 401) {
|
|
176
|
-
throw new CustomError_1.UnauthorizedError();
|
|
177
|
-
}
|
|
178
|
-
if (status_1 === 403) {
|
|
179
|
-
if (differentOrigin()) {
|
|
180
|
-
throw new CustomError_1.CrossOriginForbiddenError();
|
|
181
|
-
}
|
|
182
|
-
throw new CustomError_1.SameOriginForbiddenError();
|
|
183
|
-
}
|
|
184
|
-
if (status_1 === 404) {
|
|
185
|
-
throw new CustomError_1.NotFoundError(preferencesFile.value);
|
|
186
|
-
}
|
|
187
|
-
throw new CustomError_1.FetchError(err_2.status, err_2.message);
|
|
188
|
-
case 5: return [2 /*return*/, preferencesFile];
|
|
189
|
-
}
|
|
190
|
-
});
|
|
191
|
-
});
|
|
192
|
-
};
|
|
193
|
-
SolidLogic.prototype.getTypeIndex = function (me, preferencesFile, isPublic) {
|
|
194
|
-
// console.log('getTypeIndex', this.store.each(me, undefined, undefined, preferencesFile), isPublic, preferencesFile)
|
|
195
|
-
return this.store.each(me, isPublic ? ns.solid("publicTypeIndex") : ns.solid("privateTypeIndex"), undefined, preferencesFile);
|
|
196
|
-
};
|
|
197
|
-
SolidLogic.prototype.getRegistrations = function (instance, theClass) {
|
|
198
|
-
var _this = this;
|
|
199
|
-
return this.store
|
|
200
|
-
.each(undefined, ns.solid("instance"), instance)
|
|
201
|
-
.filter(function (r) {
|
|
202
|
-
return _this.store.holds(r, ns.solid("forClass"), theClass);
|
|
203
|
-
});
|
|
204
|
-
};
|
|
205
|
-
SolidLogic.prototype.load = function (doc) {
|
|
206
|
-
return this.store.fetcher.load(doc);
|
|
207
|
-
};
|
|
208
|
-
SolidLogic.prototype.loadIndexes = function (me, publicProfile, preferencesFile, onWarning) {
|
|
209
|
-
var _this = this;
|
|
210
|
-
if (onWarning === void 0) { onWarning = function (_err) { return __awaiter(_this, void 0, void 0, function () {
|
|
211
|
-
return __generator(this, function (_a) {
|
|
212
|
-
return [2 /*return*/, undefined];
|
|
213
|
-
});
|
|
214
|
-
}); }; }
|
|
215
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
216
|
-
var privateIndexes, publicIndexes, err_3, err_4;
|
|
217
|
-
return __generator(this, function (_a) {
|
|
218
|
-
switch (_a.label) {
|
|
219
|
-
case 0:
|
|
220
|
-
privateIndexes = [];
|
|
221
|
-
publicIndexes = [];
|
|
222
|
-
if (!publicProfile) return [3 /*break*/, 4];
|
|
223
|
-
publicIndexes = this.getTypeIndex(me, publicProfile, true);
|
|
224
|
-
_a.label = 1;
|
|
225
|
-
case 1:
|
|
226
|
-
_a.trys.push([1, 3, , 4]);
|
|
227
|
-
return [4 /*yield*/, this.load(publicIndexes)];
|
|
228
|
-
case 2:
|
|
229
|
-
_a.sent();
|
|
230
|
-
return [3 /*break*/, 4];
|
|
231
|
-
case 3:
|
|
232
|
-
err_3 = _a.sent();
|
|
233
|
-
onWarning(new Error("loadIndex: loading public type index(es) ".concat(err_3)));
|
|
234
|
-
return [3 /*break*/, 4];
|
|
235
|
-
case 4:
|
|
236
|
-
if (!preferencesFile) return [3 /*break*/, 9];
|
|
237
|
-
privateIndexes = this.getTypeIndex(me, preferencesFile, false);
|
|
238
|
-
if (!(privateIndexes.length === 0)) return [3 /*break*/, 6];
|
|
239
|
-
return [4 /*yield*/, onWarning(new Error("Your preference file ".concat(preferencesFile, " does not point to a private type index.")))];
|
|
240
|
-
case 5:
|
|
241
|
-
_a.sent();
|
|
242
|
-
return [3 /*break*/, 9];
|
|
243
|
-
case 6:
|
|
244
|
-
_a.trys.push([6, 8, , 9]);
|
|
245
|
-
return [4 /*yield*/, this.load(privateIndexes)];
|
|
246
|
-
case 7:
|
|
247
|
-
_a.sent();
|
|
248
|
-
return [3 /*break*/, 9];
|
|
249
|
-
case 8:
|
|
250
|
-
err_4 = _a.sent();
|
|
251
|
-
onWarning(new Error("loadIndex: loading private type index(es) ".concat(err_4)));
|
|
252
|
-
return [3 /*break*/, 9];
|
|
253
|
-
case 9: return [2 /*return*/, {
|
|
254
|
-
private: privateIndexes,
|
|
255
|
-
public: publicIndexes,
|
|
256
|
-
}];
|
|
257
|
-
}
|
|
258
|
-
});
|
|
259
|
-
});
|
|
260
|
-
};
|
|
261
|
-
SolidLogic.prototype.createEmptyRdfDoc = function (doc, comment) {
|
|
262
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
263
|
-
return __generator(this, function (_a) {
|
|
264
|
-
switch (_a.label) {
|
|
265
|
-
case 0: return [4 /*yield*/, this.store.fetcher.webOperation("PUT", doc.uri, {
|
|
266
|
-
data: "# ".concat(new Date(), " ").concat(comment, "\n "),
|
|
267
|
-
contentType: "text/turtle",
|
|
268
|
-
})];
|
|
269
|
-
case 1:
|
|
270
|
-
_a.sent();
|
|
271
|
-
return [2 /*return*/];
|
|
272
|
-
}
|
|
273
|
-
});
|
|
274
|
-
});
|
|
275
|
-
};
|
|
276
|
-
// @@@@ use the one in rdflib.js when it is available and delete this
|
|
277
|
-
SolidLogic.prototype.updatePromise = function (del, ins) {
|
|
278
|
-
var _this = this;
|
|
279
|
-
if (ins === void 0) { ins = []; }
|
|
280
|
-
return new Promise(function (resolve, reject) {
|
|
281
|
-
_this.store.updater.update(del, ins, function (_uri, ok, errorBody) {
|
|
282
|
-
if (!ok) {
|
|
283
|
-
reject(new Error(errorBody));
|
|
284
|
-
}
|
|
285
|
-
else {
|
|
286
|
-
resolve();
|
|
287
|
-
}
|
|
288
|
-
}); // callback
|
|
289
|
-
}); // promise
|
|
290
|
-
};
|
|
291
|
-
SolidLogic.prototype.isContainer = function (url) {
|
|
292
|
-
return this.util.isContainer(url);
|
|
293
|
-
};
|
|
294
|
-
SolidLogic.prototype.getContainerElements = function (containerNode) {
|
|
295
|
-
return this.util.getContainerElements(containerNode);
|
|
296
|
-
};
|
|
297
|
-
SolidLogic.prototype.getContainerMembers = function (containerUrl) {
|
|
298
|
-
return this.util.getContainerMembers(containerUrl);
|
|
299
|
-
};
|
|
300
|
-
SolidLogic.prototype.recursiveDelete = function (url) {
|
|
301
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
302
|
-
return __generator(this, function (_a) {
|
|
303
|
-
return [2 /*return*/, this.util.recursiveDelete(url)];
|
|
304
|
-
});
|
|
305
|
-
});
|
|
306
|
-
};
|
|
307
|
-
SolidLogic.prototype.clearStore = function () {
|
|
308
|
-
return this.util.clearStore();
|
|
309
|
-
};
|
|
310
|
-
SolidLogic.prototype.fetch = function (url, options) {
|
|
311
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
312
|
-
return __generator(this, function (_a) {
|
|
313
|
-
return [2 /*return*/, this.store.fetcher._fetch(url, options)];
|
|
314
|
-
});
|
|
315
|
-
});
|
|
316
|
-
};
|
|
317
|
-
return SolidLogic;
|
|
318
|
-
}());
|
|
319
|
-
exports.SolidLogic = SolidLogic;
|
|
320
|
-
//# sourceMappingURL=SolidLogic.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SolidLogic.js","sourceRoot":"","sources":["../../src/logic/SolidLogic.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0CAA8B;AAE9B,oEAA6C;AAC7C,4DAA2D;AAC3D,+CAA8C;AAC9C,wDAAuD;AAEvD,mDAAuC;AACvC,qDAAoD;AACpD,6CAAkI;AAClI;;;;;EAKE;AAEF,IAAM,EAAE,GAAmB,IAAA,yBAAc,EAAC,GAAG,CAAC,CAAC;AAE/C;IAiBI,oBAAY,YAA4D,EAAE,OAAgB;QAC5F,sIAAsI;QAChI,qCAAqC;QACrC,oCAAoC;QACpC,OAAO,CAAC,GAAG,CAAC,0EAA0E,CAAC,CAAA;QACvF,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,EAAe,CAAC,CAAC,oBAAoB;QAC3D,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,YAAY,CAAC,KAAK,EAAC,CAAC,CAAC,CAAC,yCAAyC;QAChG,IAAI,CAAC,KAAK,CAA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,OAAO,CAAC,EAAC;;;KAClD;IACL,iBAAC;AAAD,CAAC,AA9OD,IA8OC;AA9OY,gCAAU"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { NamedNode, LiveStore } from "rdflib";
|
|
2
|
-
import { AuthnLogic, SolidNamespace } from "../types";
|
|
3
|
-
export declare class ProfileLogic {
|
|
4
|
-
store: LiveStore;
|
|
5
|
-
ns: SolidNamespace;
|
|
6
|
-
authn: AuthnLogic;
|
|
7
|
-
constructor(store: LiveStore, ns: SolidNamespace, authn: AuthnLogic);
|
|
8
|
-
loadMe(): Promise<NamedNode>;
|
|
9
|
-
getPodRoot(user: NamedNode): NamedNode;
|
|
10
|
-
getMainInbox(user: NamedNode): Promise<NamedNode>;
|
|
11
|
-
private findStorage;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=ProfileLogic.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileLogic.d.ts","sourceRoot":"","sources":["../../src/profile/ProfileLogic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEtD,qBAAa,YAAY;IACvB,KAAK,EAAE,SAAS,CAAC;IACjB,EAAE,EAAE,cAAc,CAAC;IACnB,KAAK,EAAE,UAAU,CAAC;gBAEN,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,UAAU;IAM7D,MAAM,IAAI,OAAO,CAAC,SAAS,CAAC;IASlC,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS;IAQhC,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IASvD,OAAO,CAAC,WAAW;CAGpB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileLogic.js","sourceRoot":"","sources":["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I,KAAK,CAAC,4BAA4B,CAAC,CAAC;yBAC/C;wBACD,sBAAO,SAAsB,EAAC;;;;KAC/B;IAEO,kCAAW,GAAnB,UAAoB,EAAa;QAC/B,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;IAC3E,CAAC;IACH,mBAAC;AAAD,CAAC,AAxCD,IAwCC;AAxCY,oCAAY"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { NamedNode, LiveStore } from "rdflib";
|
|
2
|
-
import { SolidNamespace } from "../types";
|
|
3
|
-
export declare const ACL_LINK: NamedNode;
|
|
4
|
-
/**
|
|
5
|
-
* Utility-related logic
|
|
6
|
-
*/
|
|
7
|
-
export declare class UtilityLogic {
|
|
8
|
-
store: LiveStore;
|
|
9
|
-
ns: SolidNamespace;
|
|
10
|
-
constructor(store: LiveStore, ns: SolidNamespace);
|
|
11
|
-
findAclDocUrl(url: string): Promise<string>;
|
|
12
|
-
setSinglePeerAccess(options: {
|
|
13
|
-
ownerWebId: string;
|
|
14
|
-
peerWebId: string;
|
|
15
|
-
accessToModes?: string;
|
|
16
|
-
defaultModes?: string;
|
|
17
|
-
target: string;
|
|
18
|
-
}): Promise<import("rdflib").ExtendedResponse>;
|
|
19
|
-
isContainer(url: string): boolean;
|
|
20
|
-
createContainer(url: string): Promise<void>;
|
|
21
|
-
getContainerElements(containerNode: NamedNode): NamedNode[];
|
|
22
|
-
getContainerMembers(containerUrl: string): Promise<string[]>;
|
|
23
|
-
recursiveDelete(url: string): Promise<import("rdflib").ExtendedResponse | undefined>;
|
|
24
|
-
clearStore(): void;
|
|
25
|
-
getArchiveUrl(baseUrl: string, date: Date): string;
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=UtilityLogic.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UtilityLogic.d.ts","sourceRoot":"","sources":["../../src/util/UtilityLogic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAkB,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,eAAO,MAAM,QAAQ,WAEpB,CAAC;AAEF;;GAEG;AACH,qBAAa,YAAY;IACvB,KAAK,EAAE,SAAS,CAAC;IACjB,EAAE,EAAE,cAAc,CAAC;gBAEP,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,cAAc;IAK1C,aAAa,CAAC,GAAG,EAAE,MAAM;IAWzB,mBAAmB,CAAC,OAAO,EAAE;QACjC,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,MAAM,EAAE,MAAM,CAAA;KACf;IAsCD,WAAW,CAAC,GAAG,EAAE,MAAM;IAIjB,eAAe,CAAC,GAAG,EAAE,MAAM;IAmBjC,oBAAoB,CAAC,aAAa,EAAE,SAAS,GAAG,SAAS,EAAE;IAWrD,mBAAmB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAO5D,eAAe,CAAC,GAAG,EAAE,MAAM;IAgBjC,UAAU;IAIV,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI;CAQ1C"}
|
package/lib/util/UtilityLogic.js
DELETED
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.UtilityLogic = exports.ACL_LINK = void 0;
|
|
40
|
-
var rdflib_1 = require("rdflib");
|
|
41
|
-
exports.ACL_LINK = (0, rdflib_1.sym)("http://www.iana.org/assignments/link-relations/acl");
|
|
42
|
-
/**
|
|
43
|
-
* Utility-related logic
|
|
44
|
-
*/
|
|
45
|
-
var UtilityLogic = /** @class */ (function () {
|
|
46
|
-
function UtilityLogic(store, ns) {
|
|
47
|
-
this.store = store;
|
|
48
|
-
this.ns = ns;
|
|
49
|
-
}
|
|
50
|
-
UtilityLogic.prototype.findAclDocUrl = function (url) {
|
|
51
|
-
var _a;
|
|
52
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
53
|
-
var doc, docNode;
|
|
54
|
-
return __generator(this, function (_b) {
|
|
55
|
-
switch (_b.label) {
|
|
56
|
-
case 0:
|
|
57
|
-
doc = this.store.sym(url);
|
|
58
|
-
return [4 /*yield*/, ((_a = this.store.fetcher) === null || _a === void 0 ? void 0 : _a.load(doc))];
|
|
59
|
-
case 1:
|
|
60
|
-
_b.sent();
|
|
61
|
-
docNode = this.store.any(doc, exports.ACL_LINK);
|
|
62
|
-
if (!docNode) {
|
|
63
|
-
throw new Error("No ACL link discovered for ".concat(url));
|
|
64
|
-
}
|
|
65
|
-
return [2 /*return*/, docNode.value];
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
// Copied from https://github.com/solidos/web-access-control-tests/blob/v3.0.0/test/surface/delete.test.ts#L5
|
|
71
|
-
UtilityLogic.prototype.setSinglePeerAccess = function (options) {
|
|
72
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
73
|
-
var str, aclDocUrl;
|
|
74
|
-
return __generator(this, function (_a) {
|
|
75
|
-
switch (_a.label) {
|
|
76
|
-
case 0:
|
|
77
|
-
str = [
|
|
78
|
-
'@prefix acl: <http://www.w3.org/ns/auth/acl#>.',
|
|
79
|
-
'',
|
|
80
|
-
"<#alice> a acl:Authorization;\n acl:agent <".concat(options.ownerWebId, ">;"),
|
|
81
|
-
" acl:accessTo <".concat(options.target, ">;"),
|
|
82
|
-
" acl:default <".concat(options.target, ">;"),
|
|
83
|
-
' acl:mode acl:Read, acl:Write, acl:Control.',
|
|
84
|
-
''
|
|
85
|
-
].join('\n');
|
|
86
|
-
if (options.accessToModes) {
|
|
87
|
-
str += [
|
|
88
|
-
'<#bobAccessTo> a acl:Authorization;',
|
|
89
|
-
" acl:agent <".concat(options.peerWebId, ">;"),
|
|
90
|
-
" acl:accessTo <".concat(options.target, ">;"),
|
|
91
|
-
" acl:mode ".concat(options.accessToModes, "."),
|
|
92
|
-
''
|
|
93
|
-
].join('\n');
|
|
94
|
-
}
|
|
95
|
-
if (options.defaultModes) {
|
|
96
|
-
str += [
|
|
97
|
-
'<#bobDefault> a acl:Authorization;',
|
|
98
|
-
" acl:agent <".concat(options.peerWebId, ">;"),
|
|
99
|
-
" acl:default <".concat(options.target, ">;"),
|
|
100
|
-
" acl:mode ".concat(options.defaultModes, "."),
|
|
101
|
-
''
|
|
102
|
-
].join('\n');
|
|
103
|
-
}
|
|
104
|
-
return [4 /*yield*/, this.findAclDocUrl(options.target)];
|
|
105
|
-
case 1:
|
|
106
|
-
aclDocUrl = _a.sent();
|
|
107
|
-
return [2 /*return*/, this.store.fetcher._fetch(aclDocUrl, {
|
|
108
|
-
method: 'PUT',
|
|
109
|
-
body: str,
|
|
110
|
-
headers: [
|
|
111
|
-
['Content-Type', 'text/turtle']
|
|
112
|
-
]
|
|
113
|
-
})];
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
});
|
|
117
|
-
};
|
|
118
|
-
UtilityLogic.prototype.isContainer = function (url) {
|
|
119
|
-
return url.charAt(url.length - 1) === "/";
|
|
120
|
-
};
|
|
121
|
-
UtilityLogic.prototype.createContainer = function (url) {
|
|
122
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
123
|
-
var result;
|
|
124
|
-
return __generator(this, function (_a) {
|
|
125
|
-
switch (_a.label) {
|
|
126
|
-
case 0:
|
|
127
|
-
if (!this.isContainer(url)) {
|
|
128
|
-
throw new Error("Not a container URL ".concat(url));
|
|
129
|
-
}
|
|
130
|
-
return [4 /*yield*/, this.store.fetcher._fetch(url, {
|
|
131
|
-
method: "PUT",
|
|
132
|
-
headers: {
|
|
133
|
-
"Content-Type": "text/turtle",
|
|
134
|
-
"If-None-Match": "*",
|
|
135
|
-
Link: '<http://www.w3.org/ns/ldp#BasicContainer>; rel="type"', // See https://github.com/solidos/node-solid-server/issues/1465
|
|
136
|
-
},
|
|
137
|
-
body: " ", // work around https://github.com/michielbdejong/community-server/issues/4#issuecomment-776222863
|
|
138
|
-
})];
|
|
139
|
-
case 1:
|
|
140
|
-
result = _a.sent();
|
|
141
|
-
if (result.status.toString()[0] !== '2') {
|
|
142
|
-
throw new Error("Not OK: got ".concat(result.status, " response while creating container at ").concat(url));
|
|
143
|
-
}
|
|
144
|
-
return [2 /*return*/];
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
});
|
|
148
|
-
};
|
|
149
|
-
UtilityLogic.prototype.getContainerElements = function (containerNode) {
|
|
150
|
-
return this.store
|
|
151
|
-
.statementsMatching(containerNode, this.store.sym("http://www.w3.org/ns/ldp#contains"), undefined, containerNode.doc())
|
|
152
|
-
.map(function (st) { return st.object; });
|
|
153
|
-
};
|
|
154
|
-
UtilityLogic.prototype.getContainerMembers = function (containerUrl) {
|
|
155
|
-
var _a;
|
|
156
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
157
|
-
var containerNode, nodes;
|
|
158
|
-
return __generator(this, function (_b) {
|
|
159
|
-
switch (_b.label) {
|
|
160
|
-
case 0:
|
|
161
|
-
containerNode = this.store.sym(containerUrl);
|
|
162
|
-
return [4 /*yield*/, ((_a = this.store.fetcher) === null || _a === void 0 ? void 0 : _a.load(containerNode))];
|
|
163
|
-
case 1:
|
|
164
|
-
_b.sent();
|
|
165
|
-
nodes = this.getContainerElements(containerNode);
|
|
166
|
-
return [2 /*return*/, nodes.map(function (node) { return node.value; })];
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
});
|
|
170
|
-
};
|
|
171
|
-
UtilityLogic.prototype.recursiveDelete = function (url) {
|
|
172
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
173
|
-
var aclDocUrl, containerMembers, e_1;
|
|
174
|
-
var _this = this;
|
|
175
|
-
return __generator(this, function (_a) {
|
|
176
|
-
switch (_a.label) {
|
|
177
|
-
case 0:
|
|
178
|
-
_a.trys.push([0, 6, , 7]);
|
|
179
|
-
if (!this.isContainer(url)) return [3 /*break*/, 5];
|
|
180
|
-
return [4 /*yield*/, this.findAclDocUrl(url)];
|
|
181
|
-
case 1:
|
|
182
|
-
aclDocUrl = _a.sent();
|
|
183
|
-
return [4 /*yield*/, this.store.fetcher._fetch(aclDocUrl, { method: "DELETE" })];
|
|
184
|
-
case 2:
|
|
185
|
-
_a.sent();
|
|
186
|
-
return [4 /*yield*/, this.getContainerMembers(url)];
|
|
187
|
-
case 3:
|
|
188
|
-
containerMembers = _a.sent();
|
|
189
|
-
return [4 /*yield*/, Promise.all(containerMembers.map(function (url) { return _this.recursiveDelete(url); }))];
|
|
190
|
-
case 4:
|
|
191
|
-
_a.sent();
|
|
192
|
-
_a.label = 5;
|
|
193
|
-
case 5: return [2 /*return*/, this.store.fetcher._fetch(url, { method: "DELETE" })];
|
|
194
|
-
case 6:
|
|
195
|
-
e_1 = _a.sent();
|
|
196
|
-
return [3 /*break*/, 7];
|
|
197
|
-
case 7: return [2 /*return*/];
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
});
|
|
201
|
-
};
|
|
202
|
-
UtilityLogic.prototype.clearStore = function () {
|
|
203
|
-
this.store.statements.slice().forEach(this.store.remove.bind(this.store));
|
|
204
|
-
};
|
|
205
|
-
UtilityLogic.prototype.getArchiveUrl = function (baseUrl, date) {
|
|
206
|
-
var year = date.getUTCFullYear();
|
|
207
|
-
var month = ('0' + (date.getUTCMonth() + 1)).slice(-2);
|
|
208
|
-
var day = ('0' + (date.getUTCDate())).slice(-2);
|
|
209
|
-
var parts = baseUrl.split('/');
|
|
210
|
-
var filename = parts[parts.length - 1];
|
|
211
|
-
return new URL("./archive/".concat(year, "/").concat(month, "/").concat(day, "/").concat(filename), baseUrl).toString();
|
|
212
|
-
};
|
|
213
|
-
return UtilityLogic;
|
|
214
|
-
}());
|
|
215
|
-
exports.UtilityLogic = UtilityLogic;
|
|
216
|
-
//# sourceMappingURL=UtilityLogic.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UtilityLogic.js","sourceRoot":"","sources":["../../src/util/UtilityLogic.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAA8D;AAGjD,QAAA,QAAQ,GAAG,IAAA,YAAG,EACzB,oDAAoD,CACrD,CAAC;AAEF;;GAEG;AACH;IAIE,sBAAY,KAAgB,EAAE,EAAkB;QAC9C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACf,CAAC;IAEK,oCAAa,GAAnB,UAAoB,GAAW;;;;;;;wBACvB,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;wBAChC,qBAAM,CAAA,MAAA,IAAI,CAAC,KAAK,CAAC,OAAO,0CAAE,IAAI,CAAC,GAAG,CAAC,CAAA,EAAA;;wBAAnC,SAAmC,CAAC;wBAC9B,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,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AC5E,CAAC;IAED,oCAAa,GAAb,UAAc,OAAe,EAAE,IAAU;QACvC,IAAM,IAAI,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QACnC,IAAM,KAAK,GAAG,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,GAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACvD,IAAM,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAClD,IAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACjC,IAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAE,CAAC,CAAE,CAAC;QACzC,OAAO,IAAI,GAAG,CAAC,oBAAa,IAAI,cAAI,KAAK,cAAI,GAAG,cAAI,QAAQ,CAAE,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC;IACtF,CAAC;IACH,mBAAC;AAAD,CAAC,AArID,IAqIC;AArIY,oCAAY"}
|
package/lib/util/uri.d.ts
DELETED
package/lib/util/uri.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uri.d.ts","sourceRoot":"","sources":["../../src/util/uri.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAO,MAAM,QAAQ,CAAC;AAExC,wBAAgB,QAAQ,CAAC,GAAG,EAAE,SAAS,GAAG,SAAS,CAElD"}
|
package/lib/util/uri.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.newThing = void 0;
|
|
4
|
-
var rdflib_1 = require("rdflib");
|
|
5
|
-
function newThing(doc) {
|
|
6
|
-
return (0, rdflib_1.sym)(doc.uri + "#" + "id" + ("" + Date.now()));
|
|
7
|
-
}
|
|
8
|
-
exports.newThing = newThing;
|
|
9
|
-
//# sourceMappingURL=uri.js.map
|
package/lib/util/uri.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uri.js","sourceRoot":"","sources":["../../src/util/uri.ts"],"names":[],"mappings":";;;AAAA,iCAAwC;AAExC,SAAgB,QAAQ,CAAC,GAAc;IACrC,OAAO,IAAA,YAAG,EAAC,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AACvD,CAAC;AAFD,4BAEC"}
|