solid-logic 1.3.13-438dc3ae → 1.3.13-b2cfa99d
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/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -4
- package/lib/index.js.map +1 -1
- package/lib/logic/solidLogicSingleton.js +4 -7
- package/lib/logic/solidLogicSingleton.js.map +1 -1
- package/package.json +4 -4
- package/src/authSession/authSession.ts +1 -11
- package/src/index.ts +2 -2
- package/src/logic/solidLogicSingleton.ts +1 -1
- 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"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { setACLUserPublic, genACLText } from './acl/aclLogic';
|
|
2
2
|
export { ensureTypeIndexes, loadTypeIndexes, registerInTypeIndex, loadIndex } from './typeIndex/typeIndexLogic';
|
|
3
|
-
export {
|
|
4
|
-
export { SolidLogic } from
|
|
3
|
+
export { authSession } from './authSession/authSession';
|
|
4
|
+
export { SolidLogic } from './logic/SolidLogic';
|
|
5
5
|
export { offlineTestID, appContext } from './authn/authUtil';
|
|
6
6
|
export { ACL_LINK } from './util/UtilityLogic';
|
|
7
7
|
export { getSuggestedIssuers } from './issuer/issuerLogic';
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,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,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,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,WAAW,EAAE,MAAM,2BAA2B,CAAA;AACvD,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;AAC3E,OAAO,EAAE,mBAAmB,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAA;AAC9F,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA"}
|
package/lib/index.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
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
3
|
exports.FetchError = exports.NotFoundError = exports.SameOriginForbiddenError = exports.CrossOriginForbiddenError = exports.UnauthorizedError = exports.profile = exports.chat = exports.store = exports.authn = exports.solidLogicSingleton = exports.getSuggestedIssuers = exports.ACL_LINK = exports.appContext = exports.offlineTestID = exports.SolidLogic = exports.authSession = exports.loadIndex = exports.registerInTypeIndex = exports.loadTypeIndexes = exports.ensureTypeIndexes = exports.genACLText = exports.setACLUserPublic = void 0;
|
|
7
4
|
var aclLogic_1 = require("./acl/aclLogic");
|
|
@@ -13,7 +10,7 @@ Object.defineProperty(exports, "loadTypeIndexes", { enumerable: true, get: funct
|
|
|
13
10
|
Object.defineProperty(exports, "registerInTypeIndex", { enumerable: true, get: function () { return typeIndexLogic_1.registerInTypeIndex; } });
|
|
14
11
|
Object.defineProperty(exports, "loadIndex", { enumerable: true, get: function () { return typeIndexLogic_1.loadIndex; } });
|
|
15
12
|
var authSession_1 = require("./authSession/authSession");
|
|
16
|
-
Object.defineProperty(exports, "authSession", { enumerable: true, get: function () { return
|
|
13
|
+
Object.defineProperty(exports, "authSession", { enumerable: true, get: function () { return authSession_1.authSession; } });
|
|
17
14
|
var SolidLogic_1 = require("./logic/SolidLogic");
|
|
18
15
|
Object.defineProperty(exports, "SolidLogic", { enumerable: true, get: function () { return SolidLogic_1.SolidLogic; } });
|
|
19
16
|
var authUtil_1 = require("./authn/authUtil");
|
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,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,yDAAuD;AAA9C,0GAAA,WAAW,OAAA;AACpB,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,mEAA8F;AAArF,0HAAA,mBAAmB,OAAA;AAAE,4GAAA,KAAK,OAAA;AAAE,4GAAA,KAAK,OAAA;AAAE,2GAAA,IAAI,OAAA;AAAE,8GAAA,OAAO,OAAA;AACzD,mDAAuI;AAA9H,gHAAA,iBAAiB,OAAA;AAAE,wHAAA,yBAAyB,OAAA;AAAE,uHAAA,wBAAwB,OAAA;AAAE,4GAAA,aAAa,OAAA;AAAE,yGAAA,UAAU,OAAA"}
|
|
@@ -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
58
|
exports.profile = exports.chat = exports.store = exports.authn = 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,7 +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
75
|
// Make this directly accessible as it is what you need most of the time
|
|
79
76
|
var authn = solidLogicSingleton.authn;
|
|
@@ -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;AAWlE,kDAAmB;AAT5B,wEAAwE;AACxE,IAAM,KAAK,GAAG,mBAAmB,CAAC,KAAK,CAAA;AAQT,sBAAK;AAPnC,IAAM,KAAK,GAAG,mBAAmB,CAAC,KAAK,CAAA;AAOF,sBAAK;AAL1C,IAAM,IAAI,GAAG,mBAAmB,CAAC,IAAI,CAAA;AAKO,oBAAI;AAJhD,IAAM,OAAO,GAAG,mBAAmB,CAAC,OAAO,CAAA;AAIO,0BAAO;AAFzD,KAAK,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAA"}
|
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-b2cfa99d",
|
|
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",
|
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
"@babel/plugin-transform-runtime": "7.16.5",
|
|
31
31
|
"@babel/preset-env": "7.16.5",
|
|
32
32
|
"@babel/preset-typescript": "7.16.5",
|
|
33
|
-
"@inrupt/solid-client-authn-browser": "^1.11.3",
|
|
34
33
|
"@types/jest": "^27.0.3",
|
|
35
34
|
"@typescript-eslint/eslint-plugin": "^5.8.0",
|
|
36
35
|
"@typescript-eslint/parser": "^5.8.0",
|
|
@@ -38,11 +37,12 @@
|
|
|
38
37
|
"jest": "27.4.5",
|
|
39
38
|
"jest-fetch-mock": "^3.0.3",
|
|
40
39
|
"prettier": "^2.5.1",
|
|
40
|
+
"standard": "^16.0.4",
|
|
41
41
|
"ts-jest": "27.1.2",
|
|
42
42
|
"typescript": "4.5.4"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"
|
|
45
|
+
"@inrupt/solid-client-authn-browser": "^1.11.5",
|
|
46
46
|
"rdflib": "^2.2.17",
|
|
47
47
|
"solid-namespace": "^0.5.2"
|
|
48
48
|
}
|
|
@@ -3,20 +3,10 @@ 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
|
-
export default authSession
|
package/src/index.ts
CHANGED
|
@@ -8,8 +8,8 @@ export {
|
|
|
8
8
|
registerInTypeIndex,
|
|
9
9
|
loadIndex
|
|
10
10
|
} from './typeIndex/typeIndexLogic'
|
|
11
|
-
export {
|
|
12
|
-
export { SolidLogic } from
|
|
11
|
+
export { authSession } from './authSession/authSession'
|
|
12
|
+
export { SolidLogic } from './logic/SolidLogic'
|
|
13
13
|
export { offlineTestID, appContext } from './authn/authUtil'
|
|
14
14
|
export { ACL_LINK } from './util/UtilityLogic'
|
|
15
15
|
export { getSuggestedIssuers } from './issuer/issuerLogic'
|
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()
|