solid-logic 1.3.13-bbdd4a66 → 1.3.13-f1b5b524
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/jest.config.js +1 -1
- package/lib/authSession/authSession.d.ts +1 -2
- package/lib/authSession/authSession.d.ts.map +1 -1
- package/lib/authSession/authSession.js +4 -14
- package/lib/authSession/authSession.js.map +1 -1
- package/lib/authn/SolidAuthnLogic.d.ts +3 -2
- package/lib/authn/SolidAuthnLogic.d.ts.map +1 -1
- package/lib/authn/SolidAuthnLogic.js +6 -0
- package/lib/authn/SolidAuthnLogic.js.map +1 -1
- package/lib/index.d.ts +8 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +17 -12
- package/lib/index.js.map +1 -1
- package/lib/logic/solidLogicSingleton.d.ts +1 -5
- package/lib/logic/solidLogicSingleton.d.ts.map +1 -1
- package/lib/logic/solidLogicSingleton.js +5 -17
- package/lib/logic/solidLogicSingleton.js.map +1 -1
- package/lib/types.d.ts +2 -0
- package/lib/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/authSession/authSession.ts +2 -11
- package/src/authn/SolidAuthnLogic.ts +6 -3
- package/src/index.ts +14 -3
- package/src/logic/solidLogicSingleton.ts +2 -9
- package/src/types.ts +2 -0
- package/test/authUtil.test.ts +4 -0
- package/test/solidAuthLogic.test.ts +5 -1
package/jest.config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authSession.d.ts","sourceRoot":"","sources":["../../src/authSession/authSession.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAER,MAAM,oCAAoC,CAAA;AAE3C,
|
|
1
|
+
{"version":3,"file":"authSession.d.ts","sourceRoot":"","sources":["../../src/authSession/authSession.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAER,MAAM,oCAAoC,CAAA;AAE3C,eAAO,MAAM,WAAW,SAKrB,CAAA"}
|
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.authSession = void 0;
|
|
3
4
|
var solid_client_authn_browser_1 = require("@inrupt/solid-client-authn-browser");
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
authSession = new solid_client_authn_browser_1.Session({
|
|
8
|
-
clientAuthentication: (0, solid_client_authn_browser_1.getClientAuthenticationWithDependencies)({})
|
|
9
|
-
}, 'mySession');
|
|
10
|
-
// @ts-ignore
|
|
11
|
-
window.authSession = authSession;
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
// @ts-ignore
|
|
15
|
-
authSession = window.authSession;
|
|
16
|
-
}
|
|
17
|
-
exports.default = authSession;
|
|
5
|
+
exports.authSession = new solid_client_authn_browser_1.Session({
|
|
6
|
+
clientAuthentication: (0, solid_client_authn_browser_1.getClientAuthenticationWithDependencies)({})
|
|
7
|
+
}, 'mySession');
|
|
18
8
|
//# sourceMappingURL=authSession.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authSession.js","sourceRoot":"","sources":["../../src/authSession/authSession.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"authSession.js","sourceRoot":"","sources":["../../src/authSession/authSession.ts"],"names":[],"mappings":";;;AAAA,iFAG2C;AAE9B,QAAA,WAAW,GAAG,IAAI,oCAAO,CAClC;IACE,oBAAoB,EAAE,IAAA,oEAAuC,EAAC,EAAE,CAAC;CAClE,EACD,WAAW,CACZ,CAAA"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { NamedNode } from "rdflib";
|
|
2
2
|
import { Session } from "@inrupt/solid-client-authn-browser";
|
|
3
|
-
import { AuthenticationContext } from "../types";
|
|
4
|
-
export declare class SolidAuthnLogic {
|
|
3
|
+
import { AuthenticationContext, AuthnLogic } from "../types";
|
|
4
|
+
export declare class SolidAuthnLogic implements AuthnLogic {
|
|
5
5
|
private session;
|
|
6
6
|
constructor(solidAuthSession: Session);
|
|
7
|
+
get authSession(): Session;
|
|
7
8
|
currentUser(): NamedNode | null;
|
|
8
9
|
/**
|
|
9
10
|
* Retrieves currently logged in webId from either
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidAuthnLogic.d.ts","sourceRoot":"","sources":["../../src/authn/SolidAuthnLogic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,SAAS,EAAO,MAAM,QAAQ,CAAC;AAGnD,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"SolidAuthnLogic.d.ts","sourceRoot":"","sources":["../../src/authn/SolidAuthnLogic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,SAAS,EAAO,MAAM,QAAQ,CAAC;AAGnD,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC7D,qBAAa,eAAgB,YAAW,UAAU;IAChD,OAAO,CAAC,OAAO,CAAU;gBAEb,gBAAgB,EAAE,OAAO;IAKrC,IAAI,WAAW,IAAG,OAAO,CAAwB;IAEjD,WAAW,IAAI,SAAS,GAAG,IAAI;IAW/B;;;;;;OAMG;IACG,SAAS,CAAC,CAAC,EACf,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,SAAS,GAAG,IAAI,KAAK,CAAC,GAC5C,OAAO,CAAC,SAAS,GAAG,CAAC,GAAG,IAAI,CAAC;IAwDhC;;;;;;OAMG;IACH,QAAQ,CACN,KAAK,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,EAChC,OAAO,CAAC,EAAE,qBAAqB,GAC9B,SAAS,GAAG,IAAI;IAanB;;OAEG;IACH,gBAAgB,CAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,OAAO,CAAA;KAAE,GAAG,MAAM,GAAG,IAAI;CAKpF"}
|
|
@@ -63,6 +63,12 @@ var SolidAuthnLogic = /** @class */ (function () {
|
|
|
63
63
|
function SolidAuthnLogic(solidAuthSession) {
|
|
64
64
|
this.session = solidAuthSession;
|
|
65
65
|
}
|
|
66
|
+
Object.defineProperty(SolidAuthnLogic.prototype, "authSession", {
|
|
67
|
+
// we created authSession getter because we want to access it as authn.authSession externally
|
|
68
|
+
get: function () { return this.session; },
|
|
69
|
+
enumerable: false,
|
|
70
|
+
configurable: true
|
|
71
|
+
});
|
|
66
72
|
SolidAuthnLogic.prototype.currentUser = function () {
|
|
67
73
|
var app = (0, authUtil_1.appContext)();
|
|
68
74
|
if (app.viewingNoAuthPage) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidAuthnLogic.js","sourceRoot":"","sources":["../../src/authn/SolidAuthnLogic.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAmD;AACnD,uCAAuD;AACvD,mDAAsC;AAGtC;IAGE,yBAAY,gBAAyB;QACnC,IAAI,CAAC,OAAO,GAAG,gBAAgB,CAAC;IAClC,CAAC;
|
|
1
|
+
{"version":3,"file":"SolidAuthnLogic.js","sourceRoot":"","sources":["../../src/authn/SolidAuthnLogic.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAmD;AACnD,uCAAuD;AACvD,mDAAsC;AAGtC;IAGE,yBAAY,gBAAyB;QACnC,IAAI,CAAC,OAAO,GAAG,gBAAgB,CAAC;IAClC,CAAC;IAGD,sBAAI,wCAAW;QADf,6FAA6F;aAC7F,cAA4B,OAAO,IAAI,CAAC,OAAO,CAAA,CAAC,CAAC;;;OAAA;IAEjD,qCAAW,GAAX;QACE,IAAM,GAAG,GAAG,IAAA,qBA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C,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAA;YAC1D,IAAM,EAAE,GAAG,IAAA,kBAAS,EAAC,QAAQ,CAAC,CAAA;YAC9B,IAAI,OAAO,EAAE;gBACX,OAAO,CAAC,EAAE,GAAG,EAAE,CAAA;aAChB;YACD,OAAO,EAAE,CAAA;SACV;QACD,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,0CAAgB,GAAhB,UAAkB,OAAiD;QACjE,IAAM,KAAK,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,KAAI,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAA;QACzE,OAAO,KAAK,CAAA;IACd,CAAC;IAEH,sBAAC;AAAD,CAAC,AArHD,IAqHC;AArHY,0CAAe"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
declare const authn: import("./types").AuthnLogic;
|
|
2
|
+
declare const authSession: import("@inrupt/solid-client-authn-browser").Session;
|
|
3
|
+
declare const store: import("rdflib").LiveStore;
|
|
4
|
+
declare const chat: import("./chat/ChatLogic").ChatLogic;
|
|
5
|
+
declare const profile: import("./profile/ProfileLogic").ProfileLogic;
|
|
1
6
|
export { setACLUserPublic, genACLText } from './acl/aclLogic';
|
|
2
7
|
export { ensureTypeIndexes, loadTypeIndexes, registerInTypeIndex, loadIndex } from './typeIndex/typeIndexLogic';
|
|
3
|
-
export {
|
|
4
|
-
export { SolidLogic } from "./logic/SolidLogic";
|
|
8
|
+
export { SolidLogic } from './logic/SolidLogic';
|
|
5
9
|
export { offlineTestID, appContext } from './authn/authUtil';
|
|
6
10
|
export { ACL_LINK } from './util/UtilityLogic';
|
|
7
11
|
export { getSuggestedIssuers } from './issuer/issuerLogic';
|
|
8
12
|
export { AppDetails, SolidNamespace, AuthenticationContext } from './types';
|
|
9
|
-
export { solidLogicSingleton
|
|
13
|
+
export { solidLogicSingleton } from './logic/solidLogicSingleton';
|
|
10
14
|
export { UnauthorizedError, CrossOriginForbiddenError, SameOriginForbiddenError, NotFoundError, FetchError } from './logic/CustomError';
|
|
15
|
+
export { authn, authSession, store, chat, profile };
|
|
11
16
|
//# 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":"AAGA,QAAA,MAAM,KAAK,8BAA4B,CAAA;AACvC,QAAA,MAAM,WAAW,sDAAwC,CAAA;AACzD,QAAA,MAAM,KAAK,4BAA4B,CAAA;AAEvC,QAAA,MAAM,IAAI,sCAA2B,CAAA;AACrC,QAAA,MAAM,OAAO,+CAA8B,CAAA;AAE3C,OAAO,EACL,gBAAgB,EAChB,UAAU,EACX,MAAM,gBAAgB,CAAA;AACvB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,SAAS,EACV,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAE3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACvI,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAA"}
|
package/lib/index.js
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
3
|
+
exports.profile = exports.chat = exports.store = exports.authSession = exports.authn = exports.FetchError = exports.NotFoundError = exports.SameOriginForbiddenError = exports.CrossOriginForbiddenError = exports.UnauthorizedError = exports.solidLogicSingleton = exports.getSuggestedIssuers = exports.ACL_LINK = exports.appContext = exports.offlineTestID = exports.SolidLogic = exports.loadIndex = exports.registerInTypeIndex = exports.loadTypeIndexes = exports.ensureTypeIndexes = exports.genACLText = exports.setACLUserPublic = void 0;
|
|
4
|
+
// Make these variables directly accessible as it is what you need most of the time
|
|
5
|
+
// This also makes these variable globaly accesible in mashlib
|
|
6
|
+
var solidLogicSingleton_1 = require("./logic/solidLogicSingleton");
|
|
7
|
+
var authn = solidLogicSingleton_1.solidLogicSingleton.authn;
|
|
8
|
+
exports.authn = authn;
|
|
9
|
+
var authSession = solidLogicSingleton_1.solidLogicSingleton.authn.authSession;
|
|
10
|
+
exports.authSession = authSession;
|
|
11
|
+
var store = solidLogicSingleton_1.solidLogicSingleton.store;
|
|
12
|
+
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;
|
|
7
17
|
var aclLogic_1 = require("./acl/aclLogic");
|
|
8
18
|
Object.defineProperty(exports, "setACLUserPublic", { enumerable: true, get: function () { return aclLogic_1.setACLUserPublic; } });
|
|
9
19
|
Object.defineProperty(exports, "genACLText", { enumerable: true, get: function () { return aclLogic_1.genACLText; } });
|
|
@@ -12,8 +22,6 @@ Object.defineProperty(exports, "ensureTypeIndexes", { enumerable: true, get: fun
|
|
|
12
22
|
Object.defineProperty(exports, "loadTypeIndexes", { enumerable: true, get: function () { return typeIndexLogic_1.loadTypeIndexes; } });
|
|
13
23
|
Object.defineProperty(exports, "registerInTypeIndex", { enumerable: true, get: function () { return typeIndexLogic_1.registerInTypeIndex; } });
|
|
14
24
|
Object.defineProperty(exports, "loadIndex", { enumerable: true, get: function () { return typeIndexLogic_1.loadIndex; } });
|
|
15
|
-
var authSession_1 = require("./authSession/authSession");
|
|
16
|
-
Object.defineProperty(exports, "authSession", { enumerable: true, get: function () { return __importDefault(authSession_1).default; } });
|
|
17
25
|
var SolidLogic_1 = require("./logic/SolidLogic");
|
|
18
26
|
Object.defineProperty(exports, "SolidLogic", { enumerable: true, get: function () { return SolidLogic_1.SolidLogic; } });
|
|
19
27
|
var authUtil_1 = require("./authn/authUtil");
|
|
@@ -23,12 +31,9 @@ var UtilityLogic_1 = require("./util/UtilityLogic");
|
|
|
23
31
|
Object.defineProperty(exports, "ACL_LINK", { enumerable: true, get: function () { return UtilityLogic_1.ACL_LINK; } });
|
|
24
32
|
var issuerLogic_1 = require("./issuer/issuerLogic");
|
|
25
33
|
Object.defineProperty(exports, "getSuggestedIssuers", { enumerable: true, get: function () { return issuerLogic_1.getSuggestedIssuers; } });
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
Object.defineProperty(exports, "
|
|
29
|
-
Object.defineProperty(exports, "store", { enumerable: true, get: function () { return solidLogicSingleton_1.store; } });
|
|
30
|
-
Object.defineProperty(exports, "chat", { enumerable: true, get: function () { return solidLogicSingleton_1.chat; } });
|
|
31
|
-
Object.defineProperty(exports, "profile", { enumerable: true, get: function () { return solidLogicSingleton_1.profile; } });
|
|
34
|
+
// solidLogicSingleton is exported entirely because it is used in solid-panes
|
|
35
|
+
var solidLogicSingleton_2 = require("./logic/solidLogicSingleton");
|
|
36
|
+
Object.defineProperty(exports, "solidLogicSingleton", { enumerable: true, get: function () { return solidLogicSingleton_2.solidLogicSingleton; } });
|
|
32
37
|
var CustomError_1 = require("./logic/CustomError");
|
|
33
38
|
Object.defineProperty(exports, "UnauthorizedError", { enumerable: true, get: function () { return CustomError_1.UnauthorizedError; } });
|
|
34
39
|
Object.defineProperty(exports, "CrossOriginForbiddenError", { enumerable: true, get: function () { return CustomError_1.CrossOriginForbiddenError; } });
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mFAAmF;AACnF,8DAA8D;AAC9D,mEAAiE;AACjE,IAAM,KAAK,GAAG,yCAAmB,CAAC,KAAK,CAAA;AAyB9B,sBAAK;AAxBd,IAAM,WAAW,GAAG,yCAAmB,CAAC,KAAK,CAAC,WAAW,CAAA;AAwBzC,kCAAW;AAvB3B,IAAM,KAAK,GAAG,yCAAmB,CAAC,KAAK,CAAA;AAuBV,sBAAK;AArBlC,IAAM,IAAI,GAAG,yCAAmB,CAAC,IAAI,CAAA;AAqBD,oBAAI;AApBxC,IAAM,OAAO,GAAG,yCAAmB,CAAC,OAAO,CAAA;AAoBD,0BAAO;AAlBjD,2CAGuB;AAFrB,4GAAA,gBAAgB,OAAA;AAChB,sGAAA,UAAU,OAAA;AAEZ,6DAKmC;AAJjC,mHAAA,iBAAiB,OAAA;AACjB,iHAAA,eAAe,OAAA;AACf,qHAAA,mBAAmB,OAAA;AACnB,2GAAA,SAAS,OAAA;AAEX,iDAA+C;AAAtC,wGAAA,UAAU,OAAA;AACnB,6CAA4D;AAAnD,yGAAA,aAAa,OAAA;AAAE,sGAAA,UAAU,OAAA;AAClC,oDAA8C;AAArC,wGAAA,QAAQ,OAAA;AACjB,oDAA0D;AAAjD,kHAAA,mBAAmB,OAAA;AAE5B,6EAA6E;AAC7E,mEAAiE;AAAxD,0HAAA,mBAAmB,OAAA;AAC5B,mDAAuI;AAA9H,gHAAA,iBAAiB,OAAA;AAAE,wHAAA,yBAAyB,OAAA;AAAE,uHAAA,wBAAwB,OAAA;AAAE,4GAAA,aAAa,OAAA;AAAE,yGAAA,UAAU,OAAA"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { SolidLogic } from "./SolidLogic";
|
|
2
2
|
declare const solidLogicSingleton: SolidLogic;
|
|
3
|
-
|
|
4
|
-
declare const store: import("rdflib").LiveStore;
|
|
5
|
-
declare const chat: import("../chat/ChatLogic").ChatLogic;
|
|
6
|
-
declare const profile: import("../profile/ProfileLogic").ProfileLogic;
|
|
7
|
-
export { solidLogicSingleton, authn, store, chat, profile };
|
|
3
|
+
export { solidLogicSingleton };
|
|
8
4
|
//# sourceMappingURL=solidLogicSingleton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solidLogicSingleton.d.ts","sourceRoot":"","sources":["../../src/logic/solidLogicSingleton.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAUzC,QAAA,MAAM,mBAAmB,YAAkD,CAAA;
|
|
1
|
+
{"version":3,"file":"solidLogicSingleton.d.ts","sourceRoot":"","sources":["../../src/logic/solidLogicSingleton.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAUzC,QAAA,MAAM,mBAAmB,YAAkD,CAAA;AAI3E,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
|
|
@@ -54,18 +54,15 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
54
54
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
58
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
59
|
-
};
|
|
60
57
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
61
|
-
exports.
|
|
58
|
+
exports.solidLogicSingleton = void 0;
|
|
62
59
|
var debug = __importStar(require("../util/debug"));
|
|
63
|
-
var authSession_1 =
|
|
60
|
+
var authSession_1 = require("../authSession/authSession");
|
|
64
61
|
var SolidLogic_1 = require("./SolidLogic");
|
|
65
62
|
var fetcher = function (url, requestInit) { return __awaiter(void 0, void 0, void 0, function () {
|
|
66
63
|
return __generator(this, function (_a) {
|
|
67
|
-
if (authSession_1.
|
|
68
|
-
return [2 /*return*/, authSession_1.
|
|
64
|
+
if (authSession_1.authSession.info.webId) {
|
|
65
|
+
return [2 /*return*/, authSession_1.authSession.fetch(url, requestInit)];
|
|
69
66
|
}
|
|
70
67
|
else {
|
|
71
68
|
return [2 /*return*/, window.fetch(url, requestInit)];
|
|
@@ -73,16 +70,7 @@ var fetcher = function (url, requestInit) { return __awaiter(void 0, void 0, voi
|
|
|
73
70
|
return [2 /*return*/];
|
|
74
71
|
});
|
|
75
72
|
}); };
|
|
76
|
-
var solidLogicSingleton = new SolidLogic_1.SolidLogic({ fetch: fetcher }, authSession_1.
|
|
73
|
+
var solidLogicSingleton = new SolidLogic_1.SolidLogic({ fetch: fetcher }, authSession_1.authSession);
|
|
77
74
|
exports.solidLogicSingleton = solidLogicSingleton;
|
|
78
|
-
// Make this directly accessible as it is what you need most of the time
|
|
79
|
-
var authn = solidLogicSingleton.authn;
|
|
80
|
-
exports.authn = authn;
|
|
81
|
-
var store = solidLogicSingleton.store;
|
|
82
|
-
exports.store = store;
|
|
83
|
-
var chat = solidLogicSingleton.chat;
|
|
84
|
-
exports.chat = chat;
|
|
85
|
-
var profile = solidLogicSingleton.profile;
|
|
86
|
-
exports.profile = profile;
|
|
87
75
|
debug.log('Unique quadstore initialized.');
|
|
88
76
|
//# sourceMappingURL=solidLogicSingleton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solidLogicSingleton.js","sourceRoot":"","sources":["../../src/logic/solidLogicSingleton.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"solidLogicSingleton.js","sourceRoot":"","sources":["../../src/logic/solidLogicSingleton.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAsC;AACtC,0DAAwD;AACxD,2CAAyC;AAEzC,IAAM,OAAO,GAAG,UAAO,GAAG,EAAE,WAAW;;QACnC,IAAI,yBAAW,CAAC,IAAI,CAAC,KAAK,EAAE;YACxB,sBAAO,yBAAW,CAAC,KAAK,CAAC,GAAG,EAAE,WAAW,CAAC,EAAA;SAC7C;aAAM;YACH,sBAAO,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,WAAW,CAAC,EAAA;SACxC;;;KACJ,CAAA;AAED,IAAM,mBAAmB,GAAG,IAAI,uBAAU,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,yBAAW,CAAC,CAAA;AAIlE,kDAAmB;AAF5B,KAAK,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAA"}
|
package/lib/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Session } from "@inrupt/solid-client-authn-browser";
|
|
1
2
|
import { NamedNode } from "rdflib";
|
|
2
3
|
export declare type AppDetails = {
|
|
3
4
|
noun: string;
|
|
@@ -19,6 +20,7 @@ export declare type AuthenticationContext = {
|
|
|
19
20
|
statusArea?: HTMLElement;
|
|
20
21
|
};
|
|
21
22
|
export interface AuthnLogic {
|
|
23
|
+
authSession: Session;
|
|
22
24
|
currentUser: () => NamedNode | null;
|
|
23
25
|
checkUser: <T>(setUserCallback?: (me: NamedNode | null) => T) => Promise<NamedNode | T | null>;
|
|
24
26
|
saveUser: (webId: NamedNode | string | null, context?: AuthenticationContext) => NamedNode | null;
|
package/lib/types.d.ts.map
CHANGED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E,qBAAqB,KAAK,SAAS,GAAG,IAAI,CAAA;CAC3D;AAED,MAAM,WAAW,cAAc;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,SAAS,CAAA;CAC7C"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solid-logic",
|
|
3
|
-
"version": "1.3.13-
|
|
3
|
+
"version": "1.3.13-f1b5b524",
|
|
4
4
|
"description": "Core business logic of Solid OS",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"build": "tsc",
|
|
7
|
+
"build": "npm run clean && tsc",
|
|
8
8
|
"clean": "rm -rf lib",
|
|
9
9
|
"lint": "eslint ./src",
|
|
10
10
|
"test": "jest",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"typescript": "4.5.4"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@inrupt/solid-client-authn-browser": "^1.11.
|
|
45
|
+
"@inrupt/solid-client-authn-browser": "^1.11.3",
|
|
46
46
|
"rdflib": "^2.2.17",
|
|
47
47
|
"solid-namespace": "^0.5.2"
|
|
48
48
|
}
|
|
@@ -3,20 +3,11 @@ import {
|
|
|
3
3
|
getClientAuthenticationWithDependencies
|
|
4
4
|
} from '@inrupt/solid-client-authn-browser'
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
// @ts-ignore
|
|
8
|
-
if (!window.authSession) {
|
|
9
|
-
authSession = new Session(
|
|
6
|
+
export const authSession = new Session(
|
|
10
7
|
{
|
|
11
8
|
clientAuthentication: getClientAuthenticationWithDependencies({})
|
|
12
9
|
},
|
|
13
10
|
'mySession'
|
|
14
11
|
)
|
|
15
|
-
// @ts-ignore
|
|
16
|
-
window.authSession = authSession
|
|
17
|
-
} else {
|
|
18
|
-
// @ts-ignore
|
|
19
|
-
authSession = window.authSession
|
|
20
|
-
}
|
|
21
12
|
|
|
22
|
-
|
|
13
|
+
|
|
@@ -2,13 +2,16 @@ import { namedNode, NamedNode, sym } from "rdflib";
|
|
|
2
2
|
import { appContext, offlineTestID } from "./authUtil";
|
|
3
3
|
import * as debug from '../util/debug'
|
|
4
4
|
import { Session } from "@inrupt/solid-client-authn-browser";
|
|
5
|
-
import { AuthenticationContext } from "../types";
|
|
6
|
-
export class SolidAuthnLogic {
|
|
7
|
-
private session: Session;
|
|
5
|
+
import { AuthenticationContext, AuthnLogic } from "../types";
|
|
6
|
+
export class SolidAuthnLogic implements AuthnLogic {
|
|
7
|
+
private session: Session;
|
|
8
8
|
|
|
9
9
|
constructor(solidAuthSession: Session) {
|
|
10
10
|
this.session = solidAuthSession;
|
|
11
11
|
}
|
|
12
|
+
|
|
13
|
+
// we created authSession getter because we want to access it as authn.authSession externally
|
|
14
|
+
get authSession():Session { return this.session }
|
|
12
15
|
|
|
13
16
|
currentUser(): NamedNode | null {
|
|
14
17
|
const app = appContext()
|
package/src/index.ts
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
// Make these variables directly accessible as it is what you need most of the time
|
|
2
|
+
// This also makes these variable globaly accesible in mashlib
|
|
3
|
+
import { solidLogicSingleton } from './logic/solidLogicSingleton'
|
|
4
|
+
const authn = solidLogicSingleton.authn
|
|
5
|
+
const authSession = solidLogicSingleton.authn.authSession
|
|
6
|
+
const store = solidLogicSingleton.store
|
|
7
|
+
|
|
8
|
+
const chat = solidLogicSingleton.chat
|
|
9
|
+
const profile = solidLogicSingleton.profile
|
|
10
|
+
|
|
1
11
|
export {
|
|
2
12
|
setACLUserPublic,
|
|
3
13
|
genACLText
|
|
@@ -8,11 +18,12 @@ export {
|
|
|
8
18
|
registerInTypeIndex,
|
|
9
19
|
loadIndex
|
|
10
20
|
} from './typeIndex/typeIndexLogic'
|
|
11
|
-
export {
|
|
12
|
-
export { SolidLogic } from "./logic/SolidLogic"
|
|
21
|
+
export { SolidLogic } from './logic/SolidLogic'
|
|
13
22
|
export { offlineTestID, appContext } from './authn/authUtil'
|
|
14
23
|
export { ACL_LINK } from './util/UtilityLogic'
|
|
15
24
|
export { getSuggestedIssuers } from './issuer/issuerLogic'
|
|
16
25
|
export { AppDetails, SolidNamespace, AuthenticationContext } from './types'
|
|
17
|
-
|
|
26
|
+
// solidLogicSingleton is exported entirely because it is used in solid-panes
|
|
27
|
+
export { solidLogicSingleton } from './logic/solidLogicSingleton'
|
|
18
28
|
export { UnauthorizedError, CrossOriginForbiddenError, SameOriginForbiddenError, NotFoundError, FetchError } from './logic/CustomError'
|
|
29
|
+
export { authn, authSession, store, chat, profile }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as debug from "../util/debug"
|
|
2
|
-
import authSession from "../authSession/authSession"
|
|
2
|
+
import { authSession } from "../authSession/authSession"
|
|
3
3
|
import { SolidLogic } from "./SolidLogic"
|
|
4
4
|
|
|
5
5
|
const fetcher = async (url, requestInit) => {
|
|
@@ -12,13 +12,6 @@ const fetcher = async (url, requestInit) => {
|
|
|
12
12
|
|
|
13
13
|
const solidLogicSingleton = new SolidLogic({ fetch: fetcher }, authSession)
|
|
14
14
|
|
|
15
|
-
// Make this directly accessible as it is what you need most of the time
|
|
16
|
-
const authn = solidLogicSingleton.authn
|
|
17
|
-
const store = solidLogicSingleton.store
|
|
18
|
-
|
|
19
|
-
const chat = solidLogicSingleton.chat
|
|
20
|
-
const profile = solidLogicSingleton.profile
|
|
21
|
-
|
|
22
15
|
debug.log('Unique quadstore initialized.')
|
|
23
16
|
|
|
24
|
-
export { solidLogicSingleton
|
|
17
|
+
export { solidLogicSingleton }
|
package/src/types.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Session } from "@inrupt/solid-client-authn-browser"
|
|
1
2
|
import { NamedNode } from "rdflib"
|
|
2
3
|
|
|
3
4
|
export type AppDetails = {
|
|
@@ -20,6 +21,7 @@ export type AuthenticationContext = {
|
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
export interface AuthnLogic {
|
|
24
|
+
authSession: Session //this needs to be deprecated in the future. Is only here to allow imports like panes.UI.authn.authSession prior to moving authn from ui to logic
|
|
23
25
|
currentUser: () => NamedNode | null
|
|
24
26
|
checkUser: <T>(setUserCallback?: (me: NamedNode | null) => T) => Promise<NamedNode | T | null>
|
|
25
27
|
saveUser: (webId: NamedNode | string | null,
|
package/test/authUtil.test.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jest-environment jsdom
|
|
3
|
+
*
|
|
4
|
+
*/
|
|
1
5
|
import { SolidAuthnLogic } from '../src/authn/SolidAuthnLogic'
|
|
2
6
|
import { silenceDebugMessages } from './helpers/setup'
|
|
3
|
-
import {
|
|
7
|
+
import { authSession } from '../src/authSession/authSession'
|
|
4
8
|
import { AuthenticationContext } from '../src/types'
|
|
5
9
|
|
|
6
10
|
silenceDebugMessages()
|