solid-logic 1.3.17-64c8b7a5 → 1.3.17-7b8c254b
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 -48
- package/lib/logic/SolidLogic.d.ts.map +0 -1
- package/lib/logic/SolidLogic.js +0 -321
- 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 -33
- package/lib/util/UtilityLogic.d.ts.map +0 -1
- package/lib/util/UtilityLogic.js +0 -240
- 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 -262
- package/src/profile/ProfileLogic.ts +0 -44
- package/src/util/UtilityLogic.ts +0 -161
- package/src/util/uri.ts +0 -5
- package/test/discoveryLogic.test.ts +0 -712
|
@@ -47,76 +47,65 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
-
exports.
|
|
50
|
+
exports.createChatLogic = void 0;
|
|
51
51
|
var rdflib_1 = require("rdflib");
|
|
52
|
-
var
|
|
53
|
-
var
|
|
52
|
+
var ns_1 = require("../util/ns");
|
|
53
|
+
var utils_1 = require("../util/utils");
|
|
54
54
|
var CHAT_LOCATION_IN_CONTAINER = "index.ttl#this";
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
var ChatLogic = /** @class */ (function () {
|
|
59
|
-
function ChatLogic(store, ns, profile) {
|
|
60
|
-
this.store = store;
|
|
61
|
-
this.ns = ns;
|
|
62
|
-
this.profile = profile;
|
|
63
|
-
}
|
|
64
|
-
ChatLogic.prototype.setAcl = function (chatContainer, me, invitee) {
|
|
65
|
-
var _a, _b;
|
|
55
|
+
function createChatLogic(store, profileLogic) {
|
|
56
|
+
var ns = ns_1.ns;
|
|
57
|
+
function setAcl(chatContainer, me, invitee) {
|
|
66
58
|
return __awaiter(this, void 0, void 0, function () {
|
|
67
59
|
var chatAclDoc, aclBody;
|
|
68
|
-
return __generator(this, function (
|
|
69
|
-
switch (
|
|
60
|
+
return __generator(this, function (_a) {
|
|
61
|
+
switch (_a.label) {
|
|
70
62
|
case 0:
|
|
71
63
|
// Some servers don't present a Link http response header
|
|
72
64
|
// if the container doesn't exist yet, so refetch the container
|
|
73
65
|
// now that it has been created:
|
|
74
|
-
return [4 /*yield*/,
|
|
66
|
+
return [4 /*yield*/, store.fetcher.load(chatContainer)];
|
|
75
67
|
case 1:
|
|
76
68
|
// Some servers don't present a Link http response header
|
|
77
69
|
// if the container doesn't exist yet, so refetch the container
|
|
78
70
|
// now that it has been created:
|
|
79
|
-
|
|
80
|
-
chatAclDoc =
|
|
71
|
+
_a.sent();
|
|
72
|
+
chatAclDoc = store.any(chatContainer, new rdflib_1.NamedNode("http://www.iana.org/assignments/link-relations/acl"));
|
|
81
73
|
if (!chatAclDoc) {
|
|
82
74
|
throw new Error("Chat ACL doc not found!");
|
|
83
75
|
}
|
|
84
|
-
aclBody = "\n@prefix acl: <http://www.w3.org/ns/auth/acl#>.\n<#owner>\n
|
|
85
|
-
return [4 /*yield*/,
|
|
76
|
+
aclBody = "\n @prefix acl: <http://www.w3.org/ns/auth/acl#>.\n <#owner>\n a acl:Authorization;\n acl:agent <".concat(me.value, ">;\n acl:accessTo <.>;\n acl:default <.>;\n acl:mode\n acl:Read, acl:Write, acl:Control.\n <#invitee>\n a acl:Authorization;\n acl:agent <").concat(invitee.value, ">;\n acl:accessTo <.>;\n acl:default <.>;\n acl:mode\n acl:Read, acl:Append.\n ");
|
|
77
|
+
return [4 /*yield*/, store.fetcher.webOperation("PUT", chatAclDoc.value, {
|
|
86
78
|
data: aclBody,
|
|
87
79
|
contentType: "text/turtle",
|
|
88
|
-
})
|
|
80
|
+
})];
|
|
89
81
|
case 2:
|
|
90
|
-
|
|
82
|
+
_a.sent();
|
|
91
83
|
return [2 /*return*/];
|
|
92
84
|
}
|
|
93
85
|
});
|
|
94
86
|
});
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
var _a;
|
|
87
|
+
}
|
|
88
|
+
function addToPrivateTypeIndex(chatThing, me) {
|
|
98
89
|
return __awaiter(this, void 0, void 0, function () {
|
|
99
90
|
var privateTypeIndex, reg, ins;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
switch (_b.label) {
|
|
91
|
+
return __generator(this, function (_a) {
|
|
92
|
+
switch (_a.label) {
|
|
103
93
|
case 0:
|
|
104
|
-
privateTypeIndex =
|
|
94
|
+
privateTypeIndex = store.any(me, ns.solid("privateTypeIndex"));
|
|
105
95
|
if (!privateTypeIndex) {
|
|
106
96
|
throw new Error("Private type index not found!");
|
|
107
97
|
}
|
|
108
|
-
return [4 /*yield*/,
|
|
98
|
+
return [4 /*yield*/, store.fetcher.load(privateTypeIndex)];
|
|
109
99
|
case 1:
|
|
110
|
-
|
|
111
|
-
reg = (0,
|
|
100
|
+
_a.sent();
|
|
101
|
+
reg = (0, utils_1.newThing)(privateTypeIndex);
|
|
112
102
|
ins = [
|
|
113
|
-
(0, rdflib_1.st)(reg,
|
|
114
|
-
(0, rdflib_1.st)(reg,
|
|
115
|
-
(0, rdflib_1.st)(reg,
|
|
103
|
+
(0, rdflib_1.st)(reg, ns.rdf("type"), ns.solid("TypeRegistration"), privateTypeIndex.doc()),
|
|
104
|
+
(0, rdflib_1.st)(reg, ns.solid("forClass"), ns.meeting("LongChat"), privateTypeIndex.doc()),
|
|
105
|
+
(0, rdflib_1.st)(reg, ns.solid("instance"), chatThing, privateTypeIndex.doc()),
|
|
116
106
|
];
|
|
117
107
|
return [4 /*yield*/, new Promise(function (resolve, reject) {
|
|
118
|
-
|
|
119
|
-
(_a = _this.store.updater) === null || _a === void 0 ? void 0 : _a.update([], ins, function (_uri, ok, errm) {
|
|
108
|
+
store.updater.update([], ins, function (_uri, ok, errm) {
|
|
120
109
|
if (!ok) {
|
|
121
110
|
reject(new Error(errm));
|
|
122
111
|
}
|
|
@@ -126,48 +115,47 @@ var ChatLogic = /** @class */ (function () {
|
|
|
126
115
|
});
|
|
127
116
|
})];
|
|
128
117
|
case 2:
|
|
129
|
-
|
|
118
|
+
_a.sent();
|
|
130
119
|
return [2 /*return*/];
|
|
131
120
|
}
|
|
132
121
|
});
|
|
133
122
|
});
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
var _a;
|
|
123
|
+
}
|
|
124
|
+
function findChat(invitee) {
|
|
137
125
|
return __awaiter(this, void 0, void 0, function () {
|
|
138
126
|
var me, podRoot, chatContainer, exists, e_1;
|
|
139
|
-
return __generator(this, function (
|
|
140
|
-
switch (
|
|
141
|
-
case 0: return [4 /*yield*/,
|
|
127
|
+
return __generator(this, function (_a) {
|
|
128
|
+
switch (_a.label) {
|
|
129
|
+
case 0: return [4 /*yield*/, profileLogic.loadMe()];
|
|
142
130
|
case 1:
|
|
143
|
-
me =
|
|
144
|
-
return [4 /*yield*/,
|
|
131
|
+
me = _a.sent();
|
|
132
|
+
return [4 /*yield*/, profileLogic.getPodRoot(me)];
|
|
145
133
|
case 2:
|
|
146
|
-
podRoot =
|
|
147
|
-
chatContainer = (0,
|
|
134
|
+
podRoot = _a.sent();
|
|
135
|
+
chatContainer = (0, utils_1.determineChatContainer)(invitee, podRoot);
|
|
148
136
|
exists = true;
|
|
149
|
-
|
|
137
|
+
_a.label = 3;
|
|
150
138
|
case 3:
|
|
151
|
-
|
|
152
|
-
return [4 /*yield*/,
|
|
139
|
+
_a.trys.push([3, 5, , 6]);
|
|
140
|
+
return [4 /*yield*/, store.fetcher.load(new rdflib_1.NamedNode(chatContainer.value + "index.ttl#this"))];
|
|
153
141
|
case 4:
|
|
154
|
-
|
|
142
|
+
_a.sent();
|
|
155
143
|
return [3 /*break*/, 6];
|
|
156
144
|
case 5:
|
|
157
|
-
e_1 =
|
|
145
|
+
e_1 = _a.sent();
|
|
158
146
|
exists = false;
|
|
159
147
|
return [3 /*break*/, 6];
|
|
160
148
|
case 6: return [2 /*return*/, { me: me, chatContainer: chatContainer, exists: exists }];
|
|
161
149
|
}
|
|
162
150
|
});
|
|
163
151
|
});
|
|
164
|
-
}
|
|
165
|
-
|
|
152
|
+
}
|
|
153
|
+
function createChatThing(chatContainer, me) {
|
|
166
154
|
return __awaiter(this, void 0, void 0, function () {
|
|
167
155
|
var created;
|
|
168
156
|
return __generator(this, function (_a) {
|
|
169
157
|
switch (_a.label) {
|
|
170
|
-
case 0: return [4 /*yield*/,
|
|
158
|
+
case 0: return [4 /*yield*/, mintNew({
|
|
171
159
|
me: me,
|
|
172
160
|
newBase: chatContainer.value,
|
|
173
161
|
})];
|
|
@@ -177,9 +165,9 @@ var ChatLogic = /** @class */ (function () {
|
|
|
177
165
|
}
|
|
178
166
|
});
|
|
179
167
|
});
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
var kb =
|
|
168
|
+
}
|
|
169
|
+
function mintNew(newPaneOptions) {
|
|
170
|
+
var kb = store;
|
|
183
171
|
var updater = kb.updater;
|
|
184
172
|
if (newPaneOptions.me && !newPaneOptions.me.uri) {
|
|
185
173
|
throw new Error("chat mintNew: Invalid userid " + newPaneOptions.me);
|
|
@@ -188,11 +176,11 @@ var ChatLogic = /** @class */ (function () {
|
|
|
188
176
|
newPaneOptions.newInstance ||
|
|
189
177
|
kb.sym(newPaneOptions.newBase + CHAT_LOCATION_IN_CONTAINER));
|
|
190
178
|
var newChatDoc = newInstance.doc();
|
|
191
|
-
kb.add(newInstance,
|
|
192
|
-
kb.add(newInstance,
|
|
193
|
-
kb.add(newInstance,
|
|
179
|
+
kb.add(newInstance, ns.rdf("type"), ns.meeting("LongChat"), newChatDoc);
|
|
180
|
+
kb.add(newInstance, ns.dc("title"), "Chat channel", newChatDoc);
|
|
181
|
+
kb.add(newInstance, ns.dc("created"), (0, rdflib_1.term)(new Date(Date.now())), newChatDoc);
|
|
194
182
|
if (newPaneOptions.me) {
|
|
195
|
-
kb.add(newInstance,
|
|
183
|
+
kb.add(newInstance, ns.dc("author"), newPaneOptions.me, newChatDoc);
|
|
196
184
|
}
|
|
197
185
|
return new Promise(function (resolve, reject) {
|
|
198
186
|
updater === null || updater === void 0 ? void 0 : updater.put(newChatDoc, kb.statementsMatching(undefined, undefined, undefined, newChatDoc), "text/turtle", function (uri2, ok, message) {
|
|
@@ -204,36 +192,36 @@ var ChatLogic = /** @class */ (function () {
|
|
|
204
192
|
}
|
|
205
193
|
});
|
|
206
194
|
});
|
|
207
|
-
}
|
|
195
|
+
}
|
|
208
196
|
/**
|
|
209
197
|
* Find (and optionally create) an individual chat between the current user and the given invitee
|
|
210
198
|
* @param invitee - The person to chat with
|
|
211
199
|
* @param createIfMissing - Whether the chat should be created, if missing
|
|
212
200
|
* @returns null if missing, or a node referring to an already existing chat, or the newly created chat
|
|
213
201
|
*/
|
|
214
|
-
|
|
202
|
+
function getChat(invitee, createIfMissing) {
|
|
215
203
|
if (createIfMissing === void 0) { createIfMissing = true; }
|
|
216
204
|
return __awaiter(this, void 0, void 0, function () {
|
|
217
205
|
var _a, me, chatContainer, exists, chatThing;
|
|
218
206
|
return __generator(this, function (_b) {
|
|
219
207
|
switch (_b.label) {
|
|
220
|
-
case 0: return [4 /*yield*/,
|
|
208
|
+
case 0: return [4 /*yield*/, findChat(invitee)];
|
|
221
209
|
case 1:
|
|
222
210
|
_a = _b.sent(), me = _a.me, chatContainer = _a.chatContainer, exists = _a.exists;
|
|
223
211
|
if (exists) {
|
|
224
212
|
return [2 /*return*/, new rdflib_1.NamedNode(chatContainer.value + CHAT_LOCATION_IN_CONTAINER)];
|
|
225
213
|
}
|
|
226
214
|
if (!createIfMissing) return [3 /*break*/, 6];
|
|
227
|
-
return [4 /*yield*/,
|
|
215
|
+
return [4 /*yield*/, createChatThing(chatContainer, me)];
|
|
228
216
|
case 2:
|
|
229
217
|
chatThing = _b.sent();
|
|
230
|
-
return [4 /*yield*/,
|
|
218
|
+
return [4 /*yield*/, sendInvite(invitee, chatThing)];
|
|
231
219
|
case 3:
|
|
232
220
|
_b.sent();
|
|
233
|
-
return [4 /*yield*/,
|
|
221
|
+
return [4 /*yield*/, setAcl(chatContainer, me, invitee)];
|
|
234
222
|
case 4:
|
|
235
223
|
_b.sent();
|
|
236
|
-
return [4 /*yield*/,
|
|
224
|
+
return [4 /*yield*/, addToPrivateTypeIndex(chatThing, me)];
|
|
237
225
|
case 5:
|
|
238
226
|
_b.sent();
|
|
239
227
|
return [2 /*return*/, chatThing];
|
|
@@ -241,27 +229,27 @@ var ChatLogic = /** @class */ (function () {
|
|
|
241
229
|
}
|
|
242
230
|
});
|
|
243
231
|
});
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
var _a
|
|
232
|
+
}
|
|
233
|
+
function sendInvite(invitee, chatThing) {
|
|
234
|
+
var _a;
|
|
247
235
|
return __awaiter(this, void 0, void 0, function () {
|
|
248
236
|
var inviteeInbox, inviteBody, inviteResponse, locationStr;
|
|
249
|
-
return __generator(this, function (
|
|
250
|
-
switch (
|
|
251
|
-
case 0: return [4 /*yield*/,
|
|
237
|
+
return __generator(this, function (_b) {
|
|
238
|
+
switch (_b.label) {
|
|
239
|
+
case 0: return [4 /*yield*/, store.fetcher.load(invitee.doc())];
|
|
252
240
|
case 1:
|
|
253
|
-
|
|
254
|
-
inviteeInbox =
|
|
241
|
+
_b.sent();
|
|
242
|
+
inviteeInbox = store.any(invitee, ns.ldp("inbox"), undefined, invitee.doc());
|
|
255
243
|
if (!inviteeInbox) {
|
|
256
244
|
throw new Error("Invitee inbox not found! ".concat(invitee.value));
|
|
257
245
|
}
|
|
258
|
-
inviteBody = "\n<> a <http://www.w3.org/ns/pim/meeting#LongChatInvite> ;\n".concat(
|
|
259
|
-
return [4 /*yield*/, ((
|
|
246
|
+
inviteBody = "\n <> a <http://www.w3.org/ns/pim/meeting#LongChatInvite> ;\n ".concat(ns.rdf("seeAlso"), " <").concat(chatThing.value, "> .\n ");
|
|
247
|
+
return [4 /*yield*/, ((_a = store.fetcher) === null || _a === void 0 ? void 0 : _a.webOperation("POST", inviteeInbox.value, {
|
|
260
248
|
data: inviteBody,
|
|
261
249
|
contentType: "text/turtle",
|
|
262
250
|
}))];
|
|
263
251
|
case 2:
|
|
264
|
-
inviteResponse =
|
|
252
|
+
inviteResponse = _b.sent();
|
|
265
253
|
locationStr = inviteResponse === null || inviteResponse === void 0 ? void 0 : inviteResponse.headers.get("location");
|
|
266
254
|
if (!locationStr) {
|
|
267
255
|
throw new Error("Invite sending returned a ".concat(inviteResponse === null || inviteResponse === void 0 ? void 0 : inviteResponse.status));
|
|
@@ -270,8 +258,16 @@ var ChatLogic = /** @class */ (function () {
|
|
|
270
258
|
}
|
|
271
259
|
});
|
|
272
260
|
});
|
|
261
|
+
}
|
|
262
|
+
return {
|
|
263
|
+
setAcl: setAcl,
|
|
264
|
+
addToPrivateTypeIndex: addToPrivateTypeIndex,
|
|
265
|
+
findChat: findChat,
|
|
266
|
+
createChatThing: createChatThing,
|
|
267
|
+
getChat: getChat,
|
|
268
|
+
sendInvite: sendInvite,
|
|
269
|
+
mintNew: mintNew
|
|
273
270
|
};
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
//# sourceMappingURL=ChatLogic.js.map
|
|
271
|
+
}
|
|
272
|
+
exports.createChatLogic = createChatLogic;
|
|
273
|
+
//# sourceMappingURL=chatLogic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatLogic.js","sourceRoot":"","sources":["../../src/chat/chatLogic.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAkD;AAElD,iCAA6C;AAC7C,uCAAgE;AAEhE,IAAM,0BAA0B,GAAG,gBAAgB,CAAA;AAEnD,SAAgB,eAAe,CAAC,KAAK,EAAE,YAAY;IAC/C,IAAM,EAAE,GAAG,OAAS,CAAA;IAEpB,SAAe,MAAM,CACjB,aAAwB,EACxB,EAAa,EACb,OAAkB;;;;;;oBAElB,yDAAyD;oBACzD,+DAA+D;oBAC/D,gCAAgC;oBAChC,qBAAM,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,EAAA;;wBAHvC,yDAAyD;wBACzD,+DAA+D;wBAC/D,gCAAgC;wBAChC,SAAuC,CAAC;wBAGlC,UAAU,GAAG,KAAK,CAAC,GAAG,CACxB,aAAa,EACb,IAAI,kBAAS,CAAC,oDAAoD,CAAC,CACtE,CAAC;wBACF,IAAI,CAAC,UAAU,EAAE;4BACb,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;yBAC9C;wBAEK,OAAO,GAAG,uJAIC,EAAE,CAAC,KAAK,wOAOR,OAAO,CAAC,KAAK,+IAKzB,CAAC;wBACN,qBAAM,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,EAAE,UAAU,CAAC,KAAK,EA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AE,CAAC,GAAG,CAAC,SAAS,CAAC,eAAK,SAAS,CAAC,KAAK,kBACtC,CAAC;wBAEqB,qBAAM,CAAA,MAAA,KAAK,CAAC,OAAO,0CAAE,YAAY,CACpD,MAAM,EACN,YAAY,CAAC,KAAK,EAClB;gCACI,IAAI,EAAE,UAAU;gCAChB,WAAW,EAAE,aAAa;6BAC7B,CACJ,CAAA,EAAA;;wBAPK,cAAc,GAAG,SAOtB;wBACK,WAAW,GAAG,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;wBAC5D,IAAI,CAAC,WAAW,EAAE;4BACd,MAAM,IAAI,KAAK,CAAC,oCAA6B,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,MAAM,CAAE,CAAC,CAAC;yBAC1E;;;;;KACJ;IACD,OAAO;QACH,MAAM,QAAA;QAAE,qBAAqB,uBAAA;QAAE,QAAQ,UAAA;QAAE,eAAe,iBAAA;QAAE,OAAO,SAAA;QAAE,UAAU,YAAA;QAAE,OAAO,SAAA;KACzF,CAAA;AACL,CAAC;AAzND,0CAyNC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inboxLogic.d.ts","sourceRoot":"","sources":["../../src/inbox/inboxLogic.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGtC,wBAAgB,gBAAgB,CAAC,KAAK,KAAA,EAAE,YAAY,KAAA,EAAE,YAAY,KAAA,EAAE,cAAc,KAAA,EAAE,QAAQ,KAAA,GAAG,UAAU,CAqDxG"}
|
|
@@ -36,59 +36,29 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
function InboxLogic(store, ns, profile, util) {
|
|
45
|
-
this.store = store;
|
|
46
|
-
this.ns = ns;
|
|
47
|
-
this.profile = profile;
|
|
48
|
-
this.util = util;
|
|
49
|
-
}
|
|
50
|
-
InboxLogic.prototype.getNewMessages = function (user) {
|
|
51
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
52
|
-
var inbox, urls;
|
|
53
|
-
var _this = this;
|
|
54
|
-
return __generator(this, function (_a) {
|
|
55
|
-
switch (_a.label) {
|
|
56
|
-
case 0:
|
|
57
|
-
if (!!user) return [3 /*break*/, 2];
|
|
58
|
-
return [4 /*yield*/, this.profile.loadMe()];
|
|
59
|
-
case 1:
|
|
60
|
-
user = _a.sent();
|
|
61
|
-
_a.label = 2;
|
|
62
|
-
case 2: return [4 /*yield*/, this.profile.getMainInbox(user)];
|
|
63
|
-
case 3:
|
|
64
|
-
inbox = _a.sent();
|
|
65
|
-
return [4 /*yield*/, this.util.getContainerMembers(inbox.value)];
|
|
66
|
-
case 4:
|
|
67
|
-
urls = _a.sent();
|
|
68
|
-
return [2 /*return*/, urls.filter(function (url) { return !_this.util.isContainer(url); })];
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
|
-
InboxLogic.prototype.createInboxFor = function (peerWebId, nick) {
|
|
39
|
+
exports.createInboxLogic = void 0;
|
|
40
|
+
var rdflib_1 = require("rdflib");
|
|
41
|
+
var utils_1 = require("../util/utils");
|
|
42
|
+
function createInboxLogic(store, profileLogic, utilityLogic, containerLogic, aclLogic) {
|
|
43
|
+
function createInboxFor(peerWebId, nick) {
|
|
74
44
|
return __awaiter(this, void 0, void 0, function () {
|
|
75
45
|
var myWebId, podRoot, ourInbox, aclDocUrl;
|
|
76
46
|
return __generator(this, function (_a) {
|
|
77
47
|
switch (_a.label) {
|
|
78
|
-
case 0: return [4 /*yield*/,
|
|
48
|
+
case 0: return [4 /*yield*/, profileLogic.loadMe()];
|
|
79
49
|
case 1:
|
|
80
|
-
myWebId =
|
|
81
|
-
return [4 /*yield*/,
|
|
50
|
+
myWebId = _a.sent();
|
|
51
|
+
return [4 /*yield*/, profileLogic.getPodRoot(myWebId)];
|
|
82
52
|
case 2:
|
|
83
53
|
podRoot = _a.sent();
|
|
84
54
|
ourInbox = "".concat(podRoot.value, "p2p-inboxes/").concat(encodeURIComponent(nick), "/");
|
|
85
|
-
return [4 /*yield*/,
|
|
55
|
+
return [4 /*yield*/, containerLogic.createContainer(ourInbox)];
|
|
86
56
|
case 3:
|
|
87
57
|
_a.sent();
|
|
88
|
-
return [4 /*yield*/,
|
|
58
|
+
return [4 /*yield*/, aclLogic.findAclDocUrl((0, rdflib_1.sym)(ourInbox))];
|
|
89
59
|
case 4:
|
|
90
60
|
aclDocUrl = _a.sent();
|
|
91
|
-
return [4 /*yield*/,
|
|
61
|
+
return [4 /*yield*/, utilityLogic.setSinglePeerAccess({
|
|
92
62
|
ownerWebId: myWebId.value,
|
|
93
63
|
peerWebId: peerWebId,
|
|
94
64
|
accessToModes: 'acl:Append',
|
|
@@ -100,47 +70,72 @@ var InboxLogic = /** @class */ (function () {
|
|
|
100
70
|
}
|
|
101
71
|
});
|
|
102
72
|
});
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
73
|
+
}
|
|
74
|
+
function getNewMessages(user) {
|
|
75
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
76
|
+
var inbox, urls;
|
|
77
|
+
return __generator(this, function (_a) {
|
|
78
|
+
switch (_a.label) {
|
|
79
|
+
case 0:
|
|
80
|
+
if (!!user) return [3 /*break*/, 2];
|
|
81
|
+
return [4 /*yield*/, profileLogic.loadMe()];
|
|
82
|
+
case 1:
|
|
83
|
+
user = _a.sent();
|
|
84
|
+
_a.label = 2;
|
|
85
|
+
case 2: return [4 /*yield*/, profileLogic.getMainInbox(user)];
|
|
86
|
+
case 3:
|
|
87
|
+
inbox = _a.sent();
|
|
88
|
+
return [4 /*yield*/, containerLogic.getContainerMembers(inbox)];
|
|
89
|
+
case 4:
|
|
90
|
+
urls = _a.sent();
|
|
91
|
+
return [2 /*return*/, urls.filter(function (url) { return !containerLogic.isContainer(url); })];
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
function markAsRead(url, date) {
|
|
106
97
|
return __awaiter(this, void 0, void 0, function () {
|
|
107
98
|
var downloaded, archiveUrl, options, uploaded;
|
|
108
|
-
var
|
|
109
|
-
return __generator(this, function (
|
|
110
|
-
switch (
|
|
111
|
-
case 0: return [4 /*yield*/,
|
|
99
|
+
var _a;
|
|
100
|
+
return __generator(this, function (_b) {
|
|
101
|
+
switch (_b.label) {
|
|
102
|
+
case 0: return [4 /*yield*/, store.fetcher._fetch(url)];
|
|
112
103
|
case 1:
|
|
113
|
-
downloaded =
|
|
104
|
+
downloaded = _b.sent();
|
|
114
105
|
if (downloaded.status !== 200) {
|
|
115
106
|
throw new Error("Not OK! ".concat(url));
|
|
116
107
|
}
|
|
117
|
-
archiveUrl =
|
|
118
|
-
|
|
108
|
+
archiveUrl = (0, utils_1.getArchiveUrl)(url, date);
|
|
109
|
+
_a = {
|
|
119
110
|
method: 'PUT'
|
|
120
111
|
};
|
|
121
112
|
return [4 /*yield*/, downloaded.text()];
|
|
122
113
|
case 2:
|
|
123
|
-
options = (
|
|
124
|
-
|
|
114
|
+
options = (_a.body = _b.sent(),
|
|
115
|
+
_a.headers = [
|
|
125
116
|
['Content-Type', downloaded.headers.get('Content-Type') || 'application/octet-stream']
|
|
126
117
|
],
|
|
127
|
-
|
|
128
|
-
return [4 /*yield*/,
|
|
118
|
+
_a);
|
|
119
|
+
return [4 /*yield*/, store.fetcher._fetch(archiveUrl, options)];
|
|
129
120
|
case 3:
|
|
130
|
-
uploaded =
|
|
121
|
+
uploaded = _b.sent();
|
|
131
122
|
if (!(uploaded.status.toString()[0] === '2')) return [3 /*break*/, 5];
|
|
132
|
-
return [4 /*yield*/,
|
|
123
|
+
return [4 /*yield*/, store.fetcher._fetch(url, {
|
|
133
124
|
method: 'DELETE'
|
|
134
|
-
})
|
|
125
|
+
})];
|
|
135
126
|
case 4:
|
|
136
|
-
|
|
137
|
-
|
|
127
|
+
_b.sent();
|
|
128
|
+
_b.label = 5;
|
|
138
129
|
case 5: return [2 /*return*/];
|
|
139
130
|
}
|
|
140
131
|
});
|
|
141
132
|
});
|
|
133
|
+
}
|
|
134
|
+
return {
|
|
135
|
+
createInboxFor: createInboxFor,
|
|
136
|
+
getNewMessages: getNewMessages,
|
|
137
|
+
markAsRead: markAsRead
|
|
142
138
|
};
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
//# sourceMappingURL=InboxLogic.js.map
|
|
139
|
+
}
|
|
140
|
+
exports.createInboxLogic = createInboxLogic;
|
|
141
|
+
//# sourceMappingURL=inboxLogic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inboxLogic.js","sourceRoot":"","sources":["../../src/inbox/inboxLogic.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAwC;AAExC,uCAA8C;AAE9C,SAAgB,gBAAgB,CAAC,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ;IAExF,SAAe,cAAc,CAAC,SAAiB,EAAE,IAAY;;;;;4BAChC,qBAAM,YAAY,CAAC,MAAM,EAAE,EAAA;;wBAAhD,OAAO,GAAc,SAA2B;wBAC3B,qBAAM,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,EAAA;;wBAA3D,OAAO,GAAc,SAAsC;wBAC3D,QAAQ,GAAG,UAAG,OAAO,CAAC,KAAK,yBAAe,kBAAkB,CAAC,IAAI,CAAC,MAAG,CAAC;wBAC5E,qBAAM,cAAc,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAA;;wBAA9C,SAA8C,CAAC;wBAC7B,qBAAM,QAAQ,CAAC,aAAa,CAAC,IAAA,YAAG,EAAC,QAAQ,CAAC,CAAC,EA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,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,0BAA0B,CAAC;6BACvF;+BACF;wBACgB,qBAAM,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,EAAA;;wBAA1D,QAAQ,GAAG,SAA+C;6BAC5D,CAAA,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAA,EAArC,wBAAqC;wBACvC,qBAAM,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE;gCAC9B,MAAM,EAAE,QAAQ;6BACjB,CAAC,EAAA;;wBAFF,SAEE,CAAC;;;;;;KAEN;IACD,OAAO;QACL,cAAc,gBAAA;QACd,cAAc,gBAAA;QACd,UAAU,YAAA;KACX,CAAA;AACH,CAAC;AArDD,4CAqDC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
|
+
import { solidLogicSingleton } from './logic/solidLogicSingleton';
|
|
1
2
|
declare const authn: import("./types").AuthnLogic;
|
|
2
3
|
declare const authSession: import("@inrupt/solid-client-authn-browser").Session;
|
|
3
4
|
declare const store: import("rdflib").LiveStore;
|
|
4
|
-
|
|
5
|
-
declare const profile: import("./profile/ProfileLogic").ProfileLogic;
|
|
6
|
-
export { setACLUserPublic, genACLText } from './acl/aclLogic';
|
|
7
|
-
export { ensureTypeIndexes, loadTypeIndexes, registerInTypeIndex, loadIndex } from './typeIndex/typeIndexLogic';
|
|
8
|
-
export { deleteTypeIndexRegistration, followOrCreateLink, getAppInstances, getScopedAppInstances, getScopedAppsFromIndex, loadAllTypeIndexes, loadCommunityTypeIndexes, loadOrCreateIfNotExists, loadPreferences, loadProfile, loadTypeIndexesFor, registerInstanceInTypeIndex, suggestPreferencesFile, suggestPrivateTypeIndex, suggestPublicTypeIndex, uniqueNodes } from './discovery/discoveryLogic';
|
|
9
|
-
export { SolidLogic } from './logic/SolidLogic';
|
|
5
|
+
export { ACL_LINK } from './acl/aclLogic';
|
|
10
6
|
export { offlineTestID, appContext } from './authn/authUtil';
|
|
11
|
-
export { ACL_LINK } from './util/UtilityLogic';
|
|
12
7
|
export { getSuggestedIssuers } from './issuer/issuerLogic';
|
|
13
|
-
export { AppDetails, SolidNamespace, AuthenticationContext } from './types';
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
|
|
8
|
+
export { AppDetails, SolidNamespace, AuthenticationContext, SolidLogic } from './types';
|
|
9
|
+
export { UnauthorizedError, CrossOriginForbiddenError, SameOriginForbiddenError, NotFoundError, FetchError, NotEditableError, WebOperationError } from './logic/CustomError';
|
|
10
|
+
export { solidLogicSingleton, // solidLogicSingleton is exported entirely because it is used in solid-panes
|
|
11
|
+
store, authn, authSession };
|
|
17
12
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAEjE,QAAA,MAAM,KAAK,8BAA4B,CAAA;AACvC,QAAA,MAAM,WAAW,sDAAwC,CAAA;AACzD,QAAA,MAAM,KAAK,4BAA4B,CAAA;AAEvC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACvF,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,aAAa,EAAE,UAAU,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAE5K,OAAO,EACL,mBAAmB,EAAE,6EAA6E;AAClG,KAAK,EACL,KAAK,EACL,WAAW,EACZ,CAAA"}
|
package/lib/index.js
CHANGED
|
@@ -1,62 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.authSession = exports.authn = exports.store = exports.solidLogicSingleton = exports.WebOperationError = exports.NotEditableError = exports.FetchError = exports.NotFoundError = exports.SameOriginForbiddenError = exports.CrossOriginForbiddenError = exports.UnauthorizedError = exports.getSuggestedIssuers = exports.appContext = exports.offlineTestID = exports.ACL_LINK = void 0;
|
|
4
4
|
// Make these variables directly accessible as it is what you need most of the time
|
|
5
5
|
// This also makes these variable globaly accesible in mashlib
|
|
6
6
|
var solidLogicSingleton_1 = require("./logic/solidLogicSingleton");
|
|
7
|
+
Object.defineProperty(exports, "solidLogicSingleton", { enumerable: true, get: function () { return solidLogicSingleton_1.solidLogicSingleton; } });
|
|
7
8
|
var authn = solidLogicSingleton_1.solidLogicSingleton.authn;
|
|
8
9
|
exports.authn = authn;
|
|
9
10
|
var authSession = solidLogicSingleton_1.solidLogicSingleton.authn.authSession;
|
|
10
11
|
exports.authSession = authSession;
|
|
11
12
|
var store = solidLogicSingleton_1.solidLogicSingleton.store;
|
|
12
13
|
exports.store = store;
|
|
13
|
-
var chat = solidLogicSingleton_1.solidLogicSingleton.chat;
|
|
14
|
-
exports.chat = chat;
|
|
15
|
-
var profile = solidLogicSingleton_1.solidLogicSingleton.profile;
|
|
16
|
-
exports.profile = profile;
|
|
17
14
|
var aclLogic_1 = require("./acl/aclLogic");
|
|
18
|
-
Object.defineProperty(exports, "
|
|
19
|
-
Object.defineProperty(exports, "genACLText", { enumerable: true, get: function () { return aclLogic_1.genACLText; } });
|
|
20
|
-
var typeIndexLogic_1 = require("./typeIndex/typeIndexLogic");
|
|
21
|
-
Object.defineProperty(exports, "ensureTypeIndexes", { enumerable: true, get: function () { return typeIndexLogic_1.ensureTypeIndexes; } });
|
|
22
|
-
Object.defineProperty(exports, "loadTypeIndexes", { enumerable: true, get: function () { return typeIndexLogic_1.loadTypeIndexes; } });
|
|
23
|
-
Object.defineProperty(exports, "registerInTypeIndex", { enumerable: true, get: function () { return typeIndexLogic_1.registerInTypeIndex; } });
|
|
24
|
-
Object.defineProperty(exports, "loadIndex", { enumerable: true, get: function () { return typeIndexLogic_1.loadIndex; } });
|
|
25
|
-
// Generate by
|
|
26
|
-
// grep export src/discovery/discoveryLogic.ts | sed -e 's/export //g' | sed -e 's/async //g'| sed -e 's/function //g' | sed -e 's/ .*/,/g' | sort
|
|
27
|
-
var discoveryLogic_1 = require("./discovery/discoveryLogic");
|
|
28
|
-
Object.defineProperty(exports, "deleteTypeIndexRegistration", { enumerable: true, get: function () { return discoveryLogic_1.deleteTypeIndexRegistration; } });
|
|
29
|
-
Object.defineProperty(exports, "followOrCreateLink", { enumerable: true, get: function () { return discoveryLogic_1.followOrCreateLink; } });
|
|
30
|
-
Object.defineProperty(exports, "getAppInstances", { enumerable: true, get: function () { return discoveryLogic_1.getAppInstances; } });
|
|
31
|
-
Object.defineProperty(exports, "getScopedAppInstances", { enumerable: true, get: function () { return discoveryLogic_1.getScopedAppInstances; } });
|
|
32
|
-
Object.defineProperty(exports, "getScopedAppsFromIndex", { enumerable: true, get: function () { return discoveryLogic_1.getScopedAppsFromIndex; } });
|
|
33
|
-
Object.defineProperty(exports, "loadAllTypeIndexes", { enumerable: true, get: function () { return discoveryLogic_1.loadAllTypeIndexes; } });
|
|
34
|
-
Object.defineProperty(exports, "loadCommunityTypeIndexes", { enumerable: true, get: function () { return discoveryLogic_1.loadCommunityTypeIndexes; } });
|
|
35
|
-
Object.defineProperty(exports, "loadOrCreateIfNotExists", { enumerable: true, get: function () { return discoveryLogic_1.loadOrCreateIfNotExists; } });
|
|
36
|
-
Object.defineProperty(exports, "loadPreferences", { enumerable: true, get: function () { return discoveryLogic_1.loadPreferences; } });
|
|
37
|
-
Object.defineProperty(exports, "loadProfile", { enumerable: true, get: function () { return discoveryLogic_1.loadProfile; } });
|
|
38
|
-
Object.defineProperty(exports, "loadTypeIndexesFor", { enumerable: true, get: function () { return discoveryLogic_1.loadTypeIndexesFor; } });
|
|
39
|
-
Object.defineProperty(exports, "registerInstanceInTypeIndex", { enumerable: true, get: function () { return discoveryLogic_1.registerInstanceInTypeIndex; } });
|
|
40
|
-
Object.defineProperty(exports, "suggestPreferencesFile", { enumerable: true, get: function () { return discoveryLogic_1.suggestPreferencesFile; } });
|
|
41
|
-
Object.defineProperty(exports, "suggestPrivateTypeIndex", { enumerable: true, get: function () { return discoveryLogic_1.suggestPrivateTypeIndex; } });
|
|
42
|
-
Object.defineProperty(exports, "suggestPublicTypeIndex", { enumerable: true, get: function () { return discoveryLogic_1.suggestPublicTypeIndex; } });
|
|
43
|
-
Object.defineProperty(exports, "uniqueNodes", { enumerable: true, get: function () { return discoveryLogic_1.uniqueNodes; } });
|
|
44
|
-
var SolidLogic_1 = require("./logic/SolidLogic");
|
|
45
|
-
Object.defineProperty(exports, "SolidLogic", { enumerable: true, get: function () { return SolidLogic_1.SolidLogic; } });
|
|
15
|
+
Object.defineProperty(exports, "ACL_LINK", { enumerable: true, get: function () { return aclLogic_1.ACL_LINK; } });
|
|
46
16
|
var authUtil_1 = require("./authn/authUtil");
|
|
47
17
|
Object.defineProperty(exports, "offlineTestID", { enumerable: true, get: function () { return authUtil_1.offlineTestID; } });
|
|
48
18
|
Object.defineProperty(exports, "appContext", { enumerable: true, get: function () { return authUtil_1.appContext; } });
|
|
49
|
-
var UtilityLogic_1 = require("./util/UtilityLogic");
|
|
50
|
-
Object.defineProperty(exports, "ACL_LINK", { enumerable: true, get: function () { return UtilityLogic_1.ACL_LINK; } });
|
|
51
19
|
var issuerLogic_1 = require("./issuer/issuerLogic");
|
|
52
20
|
Object.defineProperty(exports, "getSuggestedIssuers", { enumerable: true, get: function () { return issuerLogic_1.getSuggestedIssuers; } });
|
|
53
|
-
// solidLogicSingleton is exported entirely because it is used in solid-panes
|
|
54
|
-
var solidLogicSingleton_2 = require("./logic/solidLogicSingleton");
|
|
55
|
-
Object.defineProperty(exports, "solidLogicSingleton", { enumerable: true, get: function () { return solidLogicSingleton_2.solidLogicSingleton; } });
|
|
56
21
|
var CustomError_1 = require("./logic/CustomError");
|
|
57
22
|
Object.defineProperty(exports, "UnauthorizedError", { enumerable: true, get: function () { return CustomError_1.UnauthorizedError; } });
|
|
58
23
|
Object.defineProperty(exports, "CrossOriginForbiddenError", { enumerable: true, get: function () { return CustomError_1.CrossOriginForbiddenError; } });
|
|
59
24
|
Object.defineProperty(exports, "SameOriginForbiddenError", { enumerable: true, get: function () { return CustomError_1.SameOriginForbiddenError; } });
|
|
60
25
|
Object.defineProperty(exports, "NotFoundError", { enumerable: true, get: function () { return CustomError_1.NotFoundError; } });
|
|
61
26
|
Object.defineProperty(exports, "FetchError", { enumerable: true, get: function () { return CustomError_1.FetchError; } });
|
|
27
|
+
Object.defineProperty(exports, "NotEditableError", { enumerable: true, get: function () { return CustomError_1.NotEditableError; } });
|
|
28
|
+
Object.defineProperty(exports, "WebOperationError", { enumerable: true, get: function () { return CustomError_1.WebOperationError; } });
|
|
62
29
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mFAAmF;AACnF,8DAA8D;AAC9D,mEAAiE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mFAAmF;AACnF,8DAA8D;AAC9D,mEAAiE;AAa/D,oGAbO,yCAAmB,OAaP;AAXrB,IAAM,KAAK,GAAG,yCAAmB,CAAC,KAAK,CAAA;AAarC,sBAAK;AAZP,IAAM,WAAW,GAAG,yCAAmB,CAAC,KAAK,CAAC,WAAW,CAAA;AAavD,kCAAW;AAZb,IAAM,KAAK,GAAG,yCAAmB,CAAC,KAAK,CAAA;AAUrC,sBAAK;AARP,2CAAyC;AAAhC,oGAAA,QAAQ,OAAA;AACjB,6CAA4D;AAAnD,yGAAA,aAAa,OAAA;AAAE,sGAAA,UAAU,OAAA;AAClC,oDAA0D;AAAjD,kHAAA,mBAAmB,OAAA;AAE5B,mDAA4K;AAAnK,gHAAA,iBAAiB,OAAA;AAAE,wHAAA,yBAAyB,OAAA;AAAE,uHAAA,wBAAwB,OAAA;AAAE,4GAAA,aAAa,OAAA;AAAE,yGAAA,UAAU,OAAA;AAAE,+GAAA,gBAAgB,OAAA;AAAE,gHAAA,iBAAiB,OAAA"}
|