solid-logic 1.3.13-0e650512 → 1.3.13-ef4be651
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/.github/workflows/ci.yml +18 -19
- package/jest.config.js +1 -4
- package/jest.setup.ts +2 -0
- package/lib/authn/NoAuthnLogic.d.ts +9 -0
- package/lib/authn/NoAuthnLogic.d.ts.map +1 -0
- package/lib/authn/NoAuthnLogic.js +17 -0
- package/lib/authn/NoAuthnLogic.js.map +1 -0
- package/lib/authn/SolidAuthnLogic.d.ts +6 -26
- package/lib/authn/SolidAuthnLogic.d.ts.map +1 -1
- package/lib/authn/SolidAuthnLogic.js +5 -161
- package/lib/authn/SolidAuthnLogic.js.map +1 -1
- package/lib/authn/index.d.ts +5 -0
- package/lib/authn/index.d.ts.map +1 -0
- package/lib/{types.js → authn/index.js} +1 -1
- package/lib/authn/index.js.map +1 -0
- package/lib/chat/ChatLogic.d.ts +2 -2
- package/lib/chat/ChatLogic.d.ts.map +1 -1
- package/lib/chat/ChatLogic.js +1 -1
- package/lib/chat/ChatLogic.js.map +1 -1
- package/lib/chat/integration.test.d.ts +2 -0
- package/lib/chat/integration.test.d.ts.map +1 -0
- package/lib/chat/integration.test.js +318 -0
- package/lib/chat/integration.test.js.map +1 -0
- package/lib/{util/debug.d.ts → debug.d.ts} +0 -0
- package/lib/debug.d.ts.map +1 -0
- package/lib/{util/debug.js → debug.js} +0 -0
- package/lib/debug.js.map +1 -0
- package/lib/inbox/InboxLogic.d.ts +2 -2
- package/lib/inbox/InboxLogic.d.ts.map +1 -1
- package/lib/inbox/InboxLogic.js.map +1 -1
- package/lib/inbox/unit.test.d.ts +2 -0
- package/lib/inbox/unit.test.d.ts.map +1 -0
- package/lib/inbox/unit.test.js +264 -0
- package/lib/inbox/unit.test.js.map +1 -0
- package/lib/index.d.ts +67 -9
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +384 -31
- package/lib/index.js.map +1 -1
- package/lib/profile/ProfileLogic.d.ts +3 -2
- package/lib/profile/ProfileLogic.d.ts.map +1 -1
- package/lib/profile/ProfileLogic.js.map +1 -1
- package/lib/{util/uri.d.ts → uri.d.ts} +0 -0
- package/lib/uri.d.ts.map +1 -0
- package/lib/{util/uri.js → uri.js} +0 -0
- package/lib/uri.js.map +1 -0
- package/lib/util/UtilityLogic.d.ts +2 -2
- package/lib/util/UtilityLogic.d.ts.map +1 -1
- package/lib/util/UtilityLogic.js.map +1 -1
- package/lib/util/unit.test.d.ts +2 -0
- package/lib/util/unit.test.d.ts.map +1 -0
- package/lib/util/unit.test.js +200 -0
- package/lib/util/unit.test.js.map +1 -0
- package/package.json +1 -3
- package/src/authn/NoAuthnLogic.ts +16 -0
- package/src/authn/SolidAuthnLogic.ts +10 -112
- package/src/authn/index.ts +5 -0
- package/src/chat/ChatLogic.ts +3 -3
- package/{test/chatLogic.test.ts → src/chat/integration.test.ts} +5 -4
- package/src/{util/debug.ts → debug.ts} +0 -0
- package/src/inbox/InboxLogic.ts +14 -2
- package/{test/inboxLogic.test.ts → src/inbox/unit.test.ts} +6 -5
- package/src/index.ts +308 -18
- package/src/profile/ProfileLogic.ts +3 -2
- package/src/{util/uri.ts → uri.ts} +0 -0
- package/src/util/UtilityLogic.ts +14 -2
- package/{test/utilityLogic.test.ts → src/util/unit.test.ts} +4 -3
- package/lib/acl/aclLogic.d.ts +0 -32
- package/lib/acl/aclLogic.d.ts.map +0 -1
- package/lib/acl/aclLogic.js +0 -132
- package/lib/acl/aclLogic.js.map +0 -1
- package/lib/authSession/authSession.d.ts +0 -4
- package/lib/authSession/authSession.d.ts.map +0 -1
- package/lib/authSession/authSession.js +0 -18
- package/lib/authSession/authSession.js.map +0 -1
- package/lib/authn/authUtil.d.ts +0 -17
- package/lib/authn/authUtil.d.ts.map +0 -1
- package/lib/authn/authUtil.js +0 -88
- package/lib/authn/authUtil.js.map +0 -1
- package/lib/issuer/issuerLogic.d.ts +0 -8
- package/lib/issuer/issuerLogic.d.ts.map +0 -1
- package/lib/issuer/issuerLogic.js +0 -53
- package/lib/issuer/issuerLogic.js.map +0 -1
- package/lib/logic/CustomError.d.ts +0 -17
- package/lib/logic/CustomError.d.ts.map +0 -1
- package/lib/logic/CustomError.js +0 -73
- package/lib/logic/CustomError.js.map +0 -1
- package/lib/logic/SolidLogic.d.ts +0 -49
- package/lib/logic/SolidLogic.d.ts.map +0 -1
- package/lib/logic/SolidLogic.js +0 -316
- package/lib/logic/SolidLogic.js.map +0 -1
- package/lib/logic/solidLogicSingleton.d.ts +0 -8
- package/lib/logic/solidLogicSingleton.d.ts.map +0 -1
- package/lib/logic/solidLogicSingleton.js +0 -88
- package/lib/logic/solidLogicSingleton.js.map +0 -1
- package/lib/typeIndex/typeIndexLogic.d.ts +0 -22
- package/lib/typeIndex/typeIndexLogic.d.ts.map +0 -1
- package/lib/typeIndex/typeIndexLogic.js +0 -302
- package/lib/typeIndex/typeIndexLogic.js.map +0 -1
- package/lib/types.d.ts +0 -29
- package/lib/types.d.ts.map +0 -1
- package/lib/types.js.map +0 -1
- package/lib/util/debug.d.ts.map +0 -1
- package/lib/util/debug.js.map +0 -1
- package/lib/util/uri.d.ts.map +0 -1
- package/lib/util/uri.js.map +0 -1
- package/src/acl/aclLogic.ts +0 -137
- package/src/authSession/authSession.ts +0 -22
- package/src/authn/authUtil.ts +0 -67
- package/src/issuer/issuerLogic.ts +0 -40
- package/src/logic/CustomError.ts +0 -25
- package/src/logic/SolidLogic.ts +0 -264
- package/src/logic/solidLogicSingleton.ts +0 -24
- package/src/typeIndex/typeIndexLogic.ts +0 -170
- package/src/types.ts +0 -41
- package/test/aclLogic.test.ts +0 -15
- package/test/authUtil.test.ts +0 -19
- package/test/helpers/setup.ts +0 -13
- package/test/logic.test.ts +0 -28
- package/test/solidAuthLogic.test.ts +0 -45
- package/test/typeIndexLogic.test.ts +0 -26
package/.github/workflows/ci.yml
CHANGED
|
@@ -44,23 +44,22 @@ jobs:
|
|
|
44
44
|
.
|
|
45
45
|
!node_modules
|
|
46
46
|
retention-days: 1
|
|
47
|
-
|
|
48
47
|
npm-publish-build:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
48
|
+
needs: build
|
|
49
|
+
runs-on: ubuntu-latest
|
|
50
|
+
steps:
|
|
51
|
+
- uses: actions/download-artifact@v2
|
|
52
|
+
with:
|
|
53
|
+
name: build
|
|
54
|
+
- uses: actions/setup-node@v1
|
|
55
|
+
with:
|
|
56
|
+
node-version: 14.x
|
|
57
|
+
- uses: rlespinasse/github-slug-action@v3.x
|
|
58
|
+
- name: Append commit hash to package version
|
|
59
|
+
run: 'sed -i -E "s/(\"version\": *\"[^\"]+)/\1-${GITHUB_SHA_SHORT}/" package.json'
|
|
60
|
+
- name: Disable pre- and post-publish actions
|
|
61
|
+
run: 'sed -i -E "s/\"((pre|post)publish)/\"ignore:\1/" package.json'
|
|
62
|
+
- uses: JS-DevTools/npm-publish@v1
|
|
63
|
+
with:
|
|
64
|
+
token: ${{ secrets.NPM_TOKEN }}
|
|
65
|
+
tag: ${{ env.GITHUB_REF_SLUG }}
|
package/jest.config.js
CHANGED
package/jest.setup.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoAuthnLogic.d.ts","sourceRoot":"","sources":["../../src/authn/NoAuthnLogic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC;;GAEG;AACH,qBAAa,YAAa,YAAW,UAAU;;IAO7C,WAAW,IAAI,IAAI;CAGpB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NoAuthnLogic = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Fallback, if no auth client has been provided to solid-logic
|
|
6
|
+
*/
|
|
7
|
+
var NoAuthnLogic = /** @class */ (function () {
|
|
8
|
+
function NoAuthnLogic() {
|
|
9
|
+
console.warn("no auth client passed to solid-logic, logic that relies on auth is not available");
|
|
10
|
+
}
|
|
11
|
+
NoAuthnLogic.prototype.currentUser = function () {
|
|
12
|
+
return null;
|
|
13
|
+
};
|
|
14
|
+
return NoAuthnLogic;
|
|
15
|
+
}());
|
|
16
|
+
exports.NoAuthnLogic = NoAuthnLogic;
|
|
17
|
+
//# sourceMappingURL=NoAuthnLogic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoAuthnLogic.js","sourceRoot":"","sources":["../../src/authn/NoAuthnLogic.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH;IACE;QACE,OAAO,CAAC,IAAI,CACV,kFAAkF,CACnF,CAAC;IACJ,CAAC;IAED,kCAAW,GAAX;QACE,OAAO,IAAI,CAAC;IACd,CAAC;IACH,mBAAC;AAAD,CAAC,AAVD,IAUC;AAVY,oCAAY"}
|
|
@@ -1,32 +1,12 @@
|
|
|
1
1
|
import { NamedNode } from "rdflib";
|
|
2
|
+
import { AuthnLogic } from "./index";
|
|
2
3
|
import { Session } from "@inrupt/solid-client-authn-browser";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Implements AuthnLogic relying on solid-auth-client
|
|
6
|
+
*/
|
|
7
|
+
export declare class SolidAuthnLogic implements AuthnLogic {
|
|
8
|
+
private session?;
|
|
6
9
|
constructor(solidAuthSession: Session);
|
|
7
10
|
currentUser(): NamedNode | null;
|
|
8
|
-
/**
|
|
9
|
-
* Retrieves currently logged in webId from either
|
|
10
|
-
* defaultTestUser or SolidAuth
|
|
11
|
-
* Also activates a session after login
|
|
12
|
-
* @param [setUserCallback] Optional callback
|
|
13
|
-
* @returns Resolves with webId uri, if no callback provided
|
|
14
|
-
*/
|
|
15
|
-
checkUser<T>(setUserCallback?: (me: NamedNode | null) => T): Promise<NamedNode | T | null>;
|
|
16
|
-
/**
|
|
17
|
-
* Saves `webId` in `context.me`
|
|
18
|
-
* @param webId
|
|
19
|
-
* @param context
|
|
20
|
-
*
|
|
21
|
-
* @returns Returns the WebID, after setting it
|
|
22
|
-
*/
|
|
23
|
-
saveUser(webId: NamedNode | string | null, context?: AuthenticationContext): NamedNode | null;
|
|
24
|
-
/**
|
|
25
|
-
* @returns {Promise<string|null>} Resolves with WebID URI or null
|
|
26
|
-
*/
|
|
27
|
-
webIdFromSession(session?: {
|
|
28
|
-
webId?: string;
|
|
29
|
-
isLoggedIn: boolean;
|
|
30
|
-
}): string | null;
|
|
31
11
|
}
|
|
32
12
|
//# sourceMappingURL=SolidAuthnLogic.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidAuthnLogic.d.ts","sourceRoot":"","sources":["../../src/authn/SolidAuthnLogic.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"SolidAuthnLogic.d.ts","sourceRoot":"","sources":["../../src/authn/SolidAuthnLogic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAO,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAE7D;;GAEG;AACH,qBAAa,eAAgB,YAAW,UAAU;IAChD,OAAO,CAAC,OAAO,CAAC,CAAU;gBAEd,gBAAgB,EAAE,OAAO;IAIrC,WAAW,IAAI,SAAS,GAAG,IAAI;CAGhC"}
|
|
@@ -1,173 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
31
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
32
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
33
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
34
|
-
function step(op) {
|
|
35
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
36
|
-
while (_) try {
|
|
37
|
-
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;
|
|
38
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
39
|
-
switch (op[0]) {
|
|
40
|
-
case 0: case 1: t = op; break;
|
|
41
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
42
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
43
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
44
|
-
default:
|
|
45
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
46
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
47
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
48
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
49
|
-
if (t[2]) _.ops.pop();
|
|
50
|
-
_.trys.pop(); continue;
|
|
51
|
-
}
|
|
52
|
-
op = body.call(thisArg, _);
|
|
53
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
54
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58
3
|
exports.SolidAuthnLogic = void 0;
|
|
59
4
|
var rdflib_1 = require("rdflib");
|
|
60
|
-
|
|
61
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Implements AuthnLogic relying on solid-auth-client
|
|
7
|
+
*/
|
|
62
8
|
var SolidAuthnLogic = /** @class */ (function () {
|
|
63
9
|
function SolidAuthnLogic(solidAuthSession) {
|
|
64
10
|
this.session = solidAuthSession;
|
|
65
11
|
}
|
|
66
12
|
SolidAuthnLogic.prototype.currentUser = function () {
|
|
67
|
-
var
|
|
68
|
-
|
|
69
|
-
return (0, rdflib_1.sym)(app.webId);
|
|
70
|
-
}
|
|
71
|
-
if (this.session.info.webId && this.session.info.isLoggedIn) {
|
|
72
|
-
return (0, rdflib_1.sym)(this.session.info.webId);
|
|
73
|
-
}
|
|
74
|
-
return (0, authUtil_1.offlineTestID)(); // null unless testing
|
|
75
|
-
};
|
|
76
|
-
/**
|
|
77
|
-
* Retrieves currently logged in webId from either
|
|
78
|
-
* defaultTestUser or SolidAuth
|
|
79
|
-
* Also activates a session after login
|
|
80
|
-
* @param [setUserCallback] Optional callback
|
|
81
|
-
* @returns Resolves with webId uri, if no callback provided
|
|
82
|
-
*/
|
|
83
|
-
SolidAuthnLogic.prototype.checkUser = function (setUserCallback) {
|
|
84
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
85
|
-
var preLoginRedirectHash, postLoginRedirectHash, curUrl, me, webId;
|
|
86
|
-
return __generator(this, function (_a) {
|
|
87
|
-
switch (_a.label) {
|
|
88
|
-
case 0:
|
|
89
|
-
preLoginRedirectHash = new URL(window.location.href).hash;
|
|
90
|
-
if (preLoginRedirectHash) {
|
|
91
|
-
window.localStorage.setItem('preLoginRedirectHash', preLoginRedirectHash);
|
|
92
|
-
}
|
|
93
|
-
this.session.onSessionRestore(function (url) {
|
|
94
|
-
if (document.location.toString() !== url)
|
|
95
|
-
history.replaceState(null, '', url);
|
|
96
|
-
});
|
|
97
|
-
/**
|
|
98
|
-
* Handle a successful authentication redirect
|
|
99
|
-
*/
|
|
100
|
-
return [4 /*yield*/, this.session
|
|
101
|
-
.handleIncomingRedirect({
|
|
102
|
-
restorePreviousSession: true,
|
|
103
|
-
url: window.location.href
|
|
104
|
-
})
|
|
105
|
-
// Check to see if a hash was stored in local storage
|
|
106
|
-
];
|
|
107
|
-
case 1:
|
|
108
|
-
/**
|
|
109
|
-
* Handle a successful authentication redirect
|
|
110
|
-
*/
|
|
111
|
-
_a.sent();
|
|
112
|
-
postLoginRedirectHash = window.localStorage.getItem('preLoginRedirectHash');
|
|
113
|
-
if (postLoginRedirectHash) {
|
|
114
|
-
curUrl = new URL(window.location.href);
|
|
115
|
-
if (curUrl.hash !== postLoginRedirectHash) {
|
|
116
|
-
if (history.pushState) {
|
|
117
|
-
// console.log('Setting window.location.has using pushState')
|
|
118
|
-
history.pushState(null, document.title, postLoginRedirectHash);
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
// console.warn('Setting window.location.has using location.hash')
|
|
122
|
-
location.hash = postLoginRedirectHash;
|
|
123
|
-
}
|
|
124
|
-
curUrl.hash = postLoginRedirectHash;
|
|
125
|
-
}
|
|
126
|
-
// See https://stackoverflow.com/questions/3870057/how-can-i-update-window-location-hash-without-jumping-the-document
|
|
127
|
-
// window.location.href = curUrl.toString()// @@ See https://developer.mozilla.org/en-US/docs/Web/API/Window/location
|
|
128
|
-
window.localStorage.setItem('preLoginRedirectHash', '');
|
|
129
|
-
}
|
|
130
|
-
me = (0, authUtil_1.offlineTestID)();
|
|
131
|
-
if (me) {
|
|
132
|
-
return [2 /*return*/, Promise.resolve(setUserCallback ? setUserCallback(me) : me)];
|
|
133
|
-
}
|
|
134
|
-
webId = this.webIdFromSession(this.session.info);
|
|
135
|
-
if (webId) {
|
|
136
|
-
me = this.saveUser(webId);
|
|
137
|
-
}
|
|
138
|
-
if (me) {
|
|
139
|
-
debug.log("(Logged in as ".concat(me, " by authentication)"));
|
|
140
|
-
}
|
|
141
|
-
return [2 /*return*/, Promise.resolve(setUserCallback ? setUserCallback(me) : me)];
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
});
|
|
145
|
-
};
|
|
146
|
-
/**
|
|
147
|
-
* Saves `webId` in `context.me`
|
|
148
|
-
* @param webId
|
|
149
|
-
* @param context
|
|
150
|
-
*
|
|
151
|
-
* @returns Returns the WebID, after setting it
|
|
152
|
-
*/
|
|
153
|
-
SolidAuthnLogic.prototype.saveUser = function (webId, context) {
|
|
154
|
-
var webIdUri;
|
|
155
|
-
if (webId) {
|
|
156
|
-
webIdUri = (typeof webId === 'string') ? webId : webId.uri;
|
|
157
|
-
var me = (0, rdflib_1.namedNode)(webIdUri);
|
|
158
|
-
if (context) {
|
|
159
|
-
context.me = me;
|
|
160
|
-
}
|
|
161
|
-
return me;
|
|
162
|
-
}
|
|
163
|
-
return null;
|
|
164
|
-
};
|
|
165
|
-
/**
|
|
166
|
-
* @returns {Promise<string|null>} Resolves with WebID URI or null
|
|
167
|
-
*/
|
|
168
|
-
SolidAuthnLogic.prototype.webIdFromSession = function (session) {
|
|
169
|
-
var webId = (session === null || session === void 0 ? void 0 : session.webId) && session.isLoggedIn ? session.webId : null;
|
|
170
|
-
return webId;
|
|
13
|
+
var _a;
|
|
14
|
+
return ((_a = this.session) === null || _a === void 0 ? void 0 : _a.info.webId) ? (0, rdflib_1.sym)(this.session.info.webId) : null;
|
|
171
15
|
};
|
|
172
16
|
return SolidAuthnLogic;
|
|
173
17
|
}());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidAuthnLogic.js","sourceRoot":"","sources":["../../src/authn/SolidAuthnLogic.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SolidAuthnLogic.js","sourceRoot":"","sources":["../../src/authn/SolidAuthnLogic.ts"],"names":[],"mappings":";;;AAAA,iCAAwC;AAIxC;;GAEG;AACH;IAGE,yBAAY,gBAAyB;QACnC,IAAI,CAAC,OAAO,GAAG,gBAAgB,CAAC;IAClC,CAAC;IAED,qCAAW,GAAX;;QACE,OAAO,CAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,IAAI,CAAC,KAAK,EAAC,CAAC,CAAC,IAAA,YAAG,EAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACxE,CAAC;IACH,sBAAC;AAAD,CAAC,AAVD,IAUC;AAVY,0CAAe"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/authn/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,MAAM,SAAS,GAAG,IAAI,CAAC;CACrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/authn/index.ts"],"names":[],"mappings":""}
|
package/lib/chat/ChatLogic.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LiveStore, NamedNode } from "rdflib";
|
|
2
|
+
import { SolidNamespace } from "../index";
|
|
2
3
|
import { ProfileLogic } from "../profile/ProfileLogic";
|
|
3
|
-
import { SolidNamespace } from "../types";
|
|
4
4
|
/**
|
|
5
5
|
* Chat-related logic
|
|
6
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatLogic.d.ts","sourceRoot":"","sources":["../../src/chat/ChatLogic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"ChatLogic.d.ts","sourceRoot":"","sources":["../../src/chat/ChatLogic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAkB,MAAM,QAAQ,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAgBvD;;GAEG;AACH,qBAAa,SAAS;IACpB,KAAK,EAAE,SAAS,CAAC;IACjB,EAAE,EAAE,cAAc,CAAC;IACnB,OAAO,EAAE,YAAY,CAAC;gBAEV,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,cAAc,EAAE,OAAO,EAAE,YAAY;IAMjE,MAAM,CACV,aAAa,EAAE,SAAS,EACxB,EAAE,EAAE,SAAS,EACb,OAAO,EAAE,SAAS,GACjB,OAAO,CAAC,IAAI,CAAC;YAsCF,qBAAqB;YAqCrB,QAAQ;YAeR,eAAe;IAW7B,OAAO,CAAC,OAAO;IAoDf;;;;;OAKG;IACG,OAAO,CACX,OAAO,EAAE,SAAS,EAClB,eAAe,UAAO,GACrB,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;YAgBd,UAAU;CA6BzB"}
|
package/lib/chat/ChatLogic.js
CHANGED
|
@@ -49,7 +49,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
49
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
50
|
exports.ChatLogic = void 0;
|
|
51
51
|
var rdflib_1 = require("rdflib");
|
|
52
|
-
var uri_1 = require("../
|
|
52
|
+
var uri_1 = require("../uri");
|
|
53
53
|
var determineChatContainer_1 = require("./determineChatContainer");
|
|
54
54
|
var CHAT_LOCATION_IN_CONTAINER = "index.ttl#this";
|
|
55
55
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatLogic.js","sourceRoot":"","sources":["../../src/chat/ChatLogic.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAA8D;AAG9D,
|
|
1
|
+
{"version":3,"file":"ChatLogic.js","sourceRoot":"","sources":["../../src/chat/ChatLogic.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAA8D;AAG9D,8BAAkC;AAClC,mEAAkE;AAElE,IAAM,0BAA0B,GAAG,gBAAgB,CAAC;AAYpD;;GAEG;AACH;IAKE,mBAAY,KAAgB,EAAE,EAAkB,EAAE,OAAqB;QACrE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,EAAE,GAAG,EAAE,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