solid-logic 3.1.1-b94c904 → 3.1.1-bf9b34c
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 +4 -6
- package/dist/acl/aclLogic.d.ts.map +1 -1
- package/dist/acl/aclLogic.js +11 -16
- package/dist/acl/aclLogic.js.map +1 -1
- package/dist/authSession/authSession.js +2 -5
- package/dist/authSession/authSession.js.map +1 -1
- package/dist/authn/SolidAuthnLogic.js +13 -51
- package/dist/authn/SolidAuthnLogic.js.map +1 -1
- package/dist/authn/authUtil.d.ts.map +1 -1
- package/dist/authn/authUtil.js +7 -48
- package/dist/authn/authUtil.js.map +1 -1
- package/dist/chat/chatLogic.d.ts.map +1 -1
- package/dist/chat/chatLogic.js +20 -23
- package/dist/chat/chatLogic.js.map +1 -1
- package/dist/inbox/inboxLogic.d.ts.map +1 -1
- package/dist/inbox/inboxLogic.js +3 -7
- package/dist/inbox/inboxLogic.js.map +1 -1
- package/dist/index.js +11 -28
- package/dist/index.js.map +1 -1
- package/dist/issuer/issuerLogic.js +1 -4
- package/dist/issuer/issuerLogic.js.map +1 -1
- package/dist/logic/CustomError.js +7 -18
- package/dist/logic/CustomError.js.map +1 -1
- package/dist/logic/solidLogic.d.ts.map +1 -1
- package/dist/logic/solidLogic.js +19 -56
- package/dist/logic/solidLogic.js.map +1 -1
- package/dist/logic/solidLogicSingleton.d.ts +2 -1
- package/dist/logic/solidLogicSingleton.d.ts.map +1 -1
- package/dist/logic/solidLogicSingleton.js +21 -44
- package/dist/logic/solidLogicSingleton.js.map +1 -1
- package/dist/profile/profileLogic.d.ts.map +1 -1
- package/dist/profile/profileLogic.js +17 -54
- package/dist/profile/profileLogic.js.map +1 -1
- package/dist/{solid-logic.esm.external.js → solid-logic.esm.js} +6121 -11490
- package/dist/solid-logic.esm.js.map +1 -0
- package/dist/solid-logic.esm.min.js +32 -0
- package/dist/solid-logic.esm.min.js.map +1 -0
- package/dist/solid-logic.js +6171 -11558
- package/dist/solid-logic.js.map +1 -1
- package/dist/solid-logic.min.js +8 -8
- package/dist/solid-logic.min.js.map +1 -1
- package/dist/typeIndex/typeIndexLogic.d.ts.map +1 -1
- package/dist/typeIndex/typeIndexLogic.js +15 -55
- package/dist/typeIndex/typeIndexLogic.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -2
- package/dist/util/containerLogic.js +4 -7
- package/dist/util/containerLogic.js.map +1 -1
- package/dist/util/debug.js +4 -11
- package/dist/util/debug.js.map +1 -1
- package/dist/util/ns.js +3 -42
- package/dist/util/ns.js.map +1 -1
- package/dist/util/utilityLogic.js +15 -51
- package/dist/util/utilityLogic.js.map +1 -1
- package/dist/util/utils.js +11 -19
- package/dist/util/utils.js.map +1 -1
- package/dist/versionInfo.js +3 -5
- package/dist/versionInfo.js.map +1 -1
- package/package.json +8 -8
- package/dist/solid-logic.esm.external.js.map +0 -1
- package/dist/solid-logic.esm.external.min.js +0 -32
- package/dist/solid-logic.esm.external.min.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"issuerLogic.js","sourceRoot":"","sources":["../../src/issuer/issuerLogic.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"issuerLogic.js","sourceRoot":"","sources":["../../src/issuer/issuerLogic.ts"],"names":[],"mappings":"AAAA,MAAM,eAAe,GAAG;IACtB;QACE,IAAI,EAAE,iBAAiB;QACvB,GAAG,EAAE,4BAA4B;KAClC;IACD;QACE,IAAI,EAAE,WAAW;QACjB,GAAG,EAAE,sBAAsB;KAC5B;IACD;QACE,IAAI,EAAE,cAAc;QACpB,GAAG,EAAE,qBAAqB;KAC3B;IACD;QACE,IAAI,EAAE,YAAY;QAClB,GAAG,EAAE,0BAA0B;KAChC;CACF,CAAA;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB;IAC/B,yCAAyC;IACzC,MAAM,OAAO,GAAG,CAAC,GAAG,eAAe,CAAC,CAAA;IAEpC,mDAAmD;IACnD,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC/C,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAA;IACzD,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC;QACpF,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAA;IAC9C,CAAC;IAED,OAAO,OAAO,CAAA;AAChB,CAAC;AAEH,SAAS,aAAa,CAAE,SAAiB,EAAE,MAAc;IACrD,MAAM,GAAG,GAAG,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,CAAA;IAChD,OAAO,GAAG,GAAG,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC,KAAK,GAAG,IAAI,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;AAC1E,CAAC"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FetchError = exports.WebOperationError = exports.NotEditableError = exports.NotFoundError = exports.SameOriginForbiddenError = exports.CrossOriginForbiddenError = exports.UnauthorizedError = void 0;
|
|
4
1
|
class CustomError extends Error {
|
|
5
2
|
constructor(message) {
|
|
6
3
|
super(message);
|
|
@@ -9,30 +6,22 @@ class CustomError extends Error {
|
|
|
9
6
|
this.name = new.target.name; // stack traces display correctly now
|
|
10
7
|
}
|
|
11
8
|
}
|
|
12
|
-
class UnauthorizedError extends CustomError {
|
|
9
|
+
export class UnauthorizedError extends CustomError {
|
|
13
10
|
}
|
|
14
|
-
|
|
15
|
-
class CrossOriginForbiddenError extends CustomError {
|
|
11
|
+
export class CrossOriginForbiddenError extends CustomError {
|
|
16
12
|
}
|
|
17
|
-
|
|
18
|
-
class SameOriginForbiddenError extends CustomError {
|
|
13
|
+
export class SameOriginForbiddenError extends CustomError {
|
|
19
14
|
}
|
|
20
|
-
|
|
21
|
-
class NotFoundError extends CustomError {
|
|
15
|
+
export class NotFoundError extends CustomError {
|
|
22
16
|
}
|
|
23
|
-
|
|
24
|
-
class NotEditableError extends CustomError {
|
|
17
|
+
export class NotEditableError extends CustomError {
|
|
25
18
|
}
|
|
26
|
-
|
|
27
|
-
class WebOperationError extends CustomError {
|
|
19
|
+
export class WebOperationError extends CustomError {
|
|
28
20
|
}
|
|
29
|
-
|
|
30
|
-
class FetchError extends CustomError {
|
|
31
|
-
status;
|
|
21
|
+
export class FetchError extends CustomError {
|
|
32
22
|
constructor(status, message) {
|
|
33
23
|
super(message);
|
|
34
24
|
this.status = status;
|
|
35
25
|
}
|
|
36
26
|
}
|
|
37
|
-
exports.FetchError = FetchError;
|
|
38
27
|
//# sourceMappingURL=CustomError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomError.js","sourceRoot":"","sources":["../../src/logic/CustomError.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CustomError.js","sourceRoot":"","sources":["../../src/logic/CustomError.ts"],"names":[],"mappings":"AAAA,MAAM,WAAY,SAAQ,KAAK;IAC3B,YAAY,OAAgB;QACxB,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,0EAA0E;QAC1E,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA,CAAC,0BAA0B;QAC5E,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAA,CAAC,qCAAqC;IACrE,CAAC;CACJ;AAED,MAAM,OAAO,iBAAkB,SAAQ,WAAW;CAAG;AAErD,MAAM,OAAO,yBAA0B,SAAQ,WAAW;CAAG;AAE7D,MAAM,OAAO,wBAAyB,SAAQ,WAAW;CAAG;AAE5D,MAAM,OAAO,aAAc,SAAQ,WAAW;CAAG;AAEjD,MAAM,OAAO,gBAAiB,SAAQ,WAAW;CAAI;AAErD,MAAM,OAAO,iBAAkB,SAAQ,WAAW;CAAG;AAErD,MAAM,OAAO,UAAW,SAAQ,WAAW;IAGvC,YAAY,MAAc,EAAE,OAAgB;QACxC,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACxB,CAAC;CACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solidLogic.d.ts","sourceRoot":"","sources":["../../src/logic/solidLogic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA;AAW5D,OAAO,EAAc,UAAU,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"solidLogic.d.ts","sourceRoot":"","sources":["../../src/logic/solidLogic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA;AAW5D,OAAO,EAAc,UAAU,EAAE,MAAM,UAAU,CAAA;AAQjD,wBAAgB,gBAAgB,CAAC,YAAY,EAAE;IAAE,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,WAAW,EAAE,GAAG,KAAK,GAAG,CAAA;CAAE,EAAE,OAAO,EAAE,OAAO,GAAG,UAAU,CAuD3H"}
|
package/dist/logic/solidLogic.js
CHANGED
|
@@ -1,70 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.createSolidLogic = createSolidLogic;
|
|
37
|
-
const rdf = __importStar(require("rdflib"));
|
|
38
|
-
const aclLogic_1 = require("../acl/aclLogic");
|
|
39
|
-
const SolidAuthnLogic_1 = require("../authn/SolidAuthnLogic");
|
|
40
|
-
const chatLogic_1 = require("../chat/chatLogic");
|
|
41
|
-
const inboxLogic_1 = require("../inbox/inboxLogic");
|
|
42
|
-
const profileLogic_1 = require("../profile/profileLogic");
|
|
43
|
-
const typeIndexLogic_1 = require("../typeIndex/typeIndexLogic");
|
|
44
|
-
const containerLogic_1 = require("../util/containerLogic");
|
|
45
|
-
const utilityLogic_1 = require("../util/utilityLogic");
|
|
46
|
-
const debug = __importStar(require("../util/debug"));
|
|
1
|
+
import * as rdf from 'rdflib';
|
|
2
|
+
import { createAclLogic } from '../acl/aclLogic';
|
|
3
|
+
import { SolidAuthnLogic } from '../authn/SolidAuthnLogic';
|
|
4
|
+
import { createChatLogic } from '../chat/chatLogic';
|
|
5
|
+
import { createInboxLogic } from '../inbox/inboxLogic';
|
|
6
|
+
import { createProfileLogic } from '../profile/profileLogic';
|
|
7
|
+
import { createTypeIndexLogic } from '../typeIndex/typeIndexLogic';
|
|
8
|
+
import { createContainerLogic } from '../util/containerLogic';
|
|
9
|
+
import { createUtilityLogic } from '../util/utilityLogic';
|
|
10
|
+
import * as debug from '../util/debug';
|
|
47
11
|
/*
|
|
48
12
|
** It is important to distinquish `fetch`, a function provided by the browser
|
|
49
13
|
** and `Fetcher`, a helper object for the rdflib Store which turns it
|
|
50
14
|
** into a `ConnectedStore` or a `LiveStore`. A Fetcher object is
|
|
51
15
|
** available at store.fetcher, and `fetch` function at `store.fetcher._fetch`,
|
|
52
16
|
*/
|
|
53
|
-
|
|
54
|
-
function createSolidLogic(specialFetch, session) {
|
|
17
|
+
export function createSolidLogic(specialFetch, session) {
|
|
55
18
|
debug.log('SolidLogic: Unique instance created. There should only be one of these.');
|
|
56
19
|
const store = rdf.graph();
|
|
57
20
|
rdf.fetcher(store, { fetch: specialFetch.fetch }); // Attach a web I/O module, store.fetcher
|
|
58
21
|
store.updater = new rdf.UpdateManager(store); // Add real-time live updates store.updater
|
|
59
22
|
store.features = []; // disable automatic node merging on store load
|
|
60
|
-
const authn = new
|
|
61
|
-
const acl =
|
|
62
|
-
const containerLogic =
|
|
63
|
-
const utilityLogic =
|
|
64
|
-
const profile =
|
|
65
|
-
const chat =
|
|
66
|
-
const inbox =
|
|
67
|
-
const typeIndex =
|
|
23
|
+
const authn = new SolidAuthnLogic(session);
|
|
24
|
+
const acl = createAclLogic(store);
|
|
25
|
+
const containerLogic = createContainerLogic(store);
|
|
26
|
+
const utilityLogic = createUtilityLogic(store, acl, containerLogic);
|
|
27
|
+
const profile = createProfileLogic(store, authn, utilityLogic);
|
|
28
|
+
const chat = createChatLogic(store, profile);
|
|
29
|
+
const inbox = createInboxLogic(store, profile, utilityLogic, containerLogic, acl);
|
|
30
|
+
const typeIndex = createTypeIndexLogic(store, authn, profile, utilityLogic);
|
|
68
31
|
debug.log('SolidAuthnLogic initialized');
|
|
69
32
|
function load(doc) {
|
|
70
33
|
return store.fetcher.load(doc);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solidLogic.js","sourceRoot":"","sources":["../../src/logic/solidLogic.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"solidLogic.js","sourceRoot":"","sources":["../../src/logic/solidLogic.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,GAAG,MAAM,QAAQ,CAAA;AAE7B,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAEzD,OAAO,KAAK,KAAK,MAAM,eAAe,CAAA;AACtC;;;;;EAKE;AACF,MAAM,UAAU,gBAAgB,CAAC,YAA4D,EAAE,OAAgB;IAE3G,KAAK,CAAC,GAAG,CAAC,0EAA0E,CAAC,CAAA;IACrF,MAAM,KAAK,GAAc,GAAG,CAAC,KAAK,EAAe,CAAA;IACjD,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,EAAC,KAAK,EAAE,YAAY,CAAC,KAAK,EAAC,CAAC,CAAA,CAAC,yCAAyC;IACzF,KAAK,CAAC,OAAO,GAAG,IAAI,GAAG,CAAC,a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O,EAAE,CAAA;gBACT,CAAC;YACL,CAAC,CAAC,CAAA,CAAC,WAAW;QACd,CAAC,CAAC,CAAA,CAAC,UAAU;IACjB,CAAC;IAED,SAAS,UAAU;QACf,KAAK,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;IAC9D,CAAC;IAED,OAAO;QACH,KAAK;QACL,KAAK;QACL,GAAG;QACH,KAAK;QACL,IAAI;QACJ,OAAO;QACP,SAAS;QACT,IAAI;QACJ,aAAa;QACb,UAAU;KACb,CAAA;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solidLogicSingleton.d.ts","sourceRoot":"","sources":["../../src/logic/solidLogicSingleton.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"solidLogicSingleton.d.ts","sourceRoot":"","sources":["../../src/logic/solidLogicSingleton.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAiCrC,QAAA,MAAM,mBAAmB,YAAyB,CAAA;AAElD,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
|
|
@@ -1,54 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.solidLogicSingleton = void 0;
|
|
37
|
-
const debug = __importStar(require("../util/debug"));
|
|
38
|
-
const authSession_1 = require("../authSession/authSession");
|
|
39
|
-
const solidLogic_1 = require("./solidLogic");
|
|
1
|
+
import * as debug from '../util/debug';
|
|
2
|
+
import { authSession } from '../authSession/authSession';
|
|
3
|
+
import { createSolidLogic } from './solidLogic';
|
|
40
4
|
const _fetch = async (url, requestInit) => {
|
|
41
5
|
const omitCreds = requestInit && requestInit.credentials && requestInit.credentials == 'omit';
|
|
42
|
-
if (
|
|
6
|
+
if (authSession.info.webId && !omitCreds) { // see https://github.com/solidos/solidos/issues/114
|
|
43
7
|
// In fact fetch should respect credentials omit itself
|
|
44
|
-
return
|
|
8
|
+
return authSession.fetch(url, requestInit);
|
|
45
9
|
}
|
|
46
10
|
else {
|
|
47
11
|
return window.fetch(url, requestInit);
|
|
48
12
|
}
|
|
49
13
|
};
|
|
14
|
+
// Global singleton pattern to ensure unique store across library versions
|
|
15
|
+
const SINGLETON_SYMBOL = Symbol.for('solid-logic-singleton');
|
|
16
|
+
const globalThis = (typeof window !== 'undefined' ? window : global);
|
|
17
|
+
function getOrCreateSingleton() {
|
|
18
|
+
if (!globalThis[SINGLETON_SYMBOL]) {
|
|
19
|
+
debug.log('SolidLogic: Creating new global singleton instance.');
|
|
20
|
+
globalThis[SINGLETON_SYMBOL] = createSolidLogic({ fetch: _fetch }, authSession);
|
|
21
|
+
debug.log('Unique quadstore initialized.');
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
debug.log('SolidLogic: Using existing global singleton instance.');
|
|
25
|
+
}
|
|
26
|
+
return globalThis[SINGLETON_SYMBOL];
|
|
27
|
+
}
|
|
50
28
|
//this const makes solidLogicSingleton global accessible in mashlib
|
|
51
|
-
const solidLogicSingleton = (
|
|
52
|
-
|
|
53
|
-
debug.log('Unique quadstore initialized.');
|
|
29
|
+
const solidLogicSingleton = getOrCreateSingleton();
|
|
30
|
+
export { solidLogicSingleton };
|
|
54
31
|
//# 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,OAAO,KAAK,KAAK,MAAM,eAAe,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAG/C,MAAM,MAAM,GAAG,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,EAAE;IACtC,MAAM,SAAS,GAAG,WAAW,IAAI,WAAW,CAAC,WAAW,IAAI,WAAW,CAAC,WAAW,IAAI,MAAM,CAAA;IAC7F,IAAI,WAAW,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS,EAAE,CAAC,CAA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sourceRoot":"","sources":["../../src/profile/profileLogic.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEvC,wBAAgB,kBAAkB,CAAC,KAAK,KAAA,EAAE,KAAK,KAAA,EAAE,YAAY,KAAA,GAAG,YAAY,CAoH3E"}
|
|
@@ -1,45 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.createProfileLogic = createProfileLogic;
|
|
37
|
-
const CustomError_1 = require("../logic/CustomError");
|
|
38
|
-
const debug = __importStar(require("../util/debug"));
|
|
39
|
-
const ns_1 = require("../util/ns");
|
|
40
|
-
const utils_1 = require("../util/utils");
|
|
41
|
-
function createProfileLogic(store, authn, utilityLogic) {
|
|
42
|
-
const ns = ns_1.ns;
|
|
1
|
+
import { CrossOriginForbiddenError, FetchError, NotEditableError, SameOriginForbiddenError, UnauthorizedError, WebOperationError } from '../logic/CustomError';
|
|
2
|
+
import * as debug from '../util/debug';
|
|
3
|
+
import { ns as namespace } from '../util/ns';
|
|
4
|
+
import { differentOrigin, suggestPreferencesFile } from '../util/utils';
|
|
5
|
+
export function createProfileLogic(store, authn, utilityLogic) {
|
|
6
|
+
const ns = namespace;
|
|
43
7
|
/**
|
|
44
8
|
* loads the preference without throwing errors - if it can create it it does so.
|
|
45
9
|
* remark: it still throws error if it cannot load profile.
|
|
@@ -49,7 +13,6 @@ function createProfileLogic(store, authn, utilityLogic) {
|
|
|
49
13
|
async function silencedLoadPreferences(user) {
|
|
50
14
|
try {
|
|
51
15
|
return await loadPreferences(user);
|
|
52
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
53
16
|
}
|
|
54
17
|
catch (err) {
|
|
55
18
|
return undefined;
|
|
@@ -63,7 +26,7 @@ function createProfileLogic(store, authn, utilityLogic) {
|
|
|
63
26
|
*/
|
|
64
27
|
async function loadPreferences(user) {
|
|
65
28
|
await loadProfile(user);
|
|
66
|
-
const possiblePreferencesFile =
|
|
29
|
+
const possiblePreferencesFile = suggestPreferencesFile(user);
|
|
67
30
|
let preferencesFile;
|
|
68
31
|
try {
|
|
69
32
|
preferencesFile = await utilityLogic.followOrCreateLink(user, ns.space('preferencesFile'), possiblePreferencesFile, user.doc());
|
|
@@ -72,22 +35,22 @@ function createProfileLogic(store, authn, utilityLogic) {
|
|
|
72
35
|
const message = `User ${user} has no pointer in profile to preferences file.`;
|
|
73
36
|
debug.warn(message);
|
|
74
37
|
// we are listing the possible errors
|
|
75
|
-
if (err instanceof
|
|
38
|
+
if (err instanceof NotEditableError) {
|
|
76
39
|
throw err;
|
|
77
40
|
}
|
|
78
|
-
if (err instanceof
|
|
41
|
+
if (err instanceof WebOperationError) {
|
|
79
42
|
throw err;
|
|
80
43
|
}
|
|
81
|
-
if (err instanceof
|
|
44
|
+
if (err instanceof UnauthorizedError) {
|
|
82
45
|
throw err;
|
|
83
46
|
}
|
|
84
|
-
if (err instanceof
|
|
47
|
+
if (err instanceof CrossOriginForbiddenError) {
|
|
85
48
|
throw err;
|
|
86
49
|
}
|
|
87
|
-
if (err instanceof
|
|
50
|
+
if (err instanceof SameOriginForbiddenError) {
|
|
88
51
|
throw err;
|
|
89
52
|
}
|
|
90
|
-
if (err instanceof
|
|
53
|
+
if (err instanceof FetchError) {
|
|
91
54
|
throw err;
|
|
92
55
|
}
|
|
93
56
|
throw err;
|
|
@@ -99,13 +62,13 @@ function createProfileLogic(store, authn, utilityLogic) {
|
|
|
99
62
|
const msg = `Unable to load preference of user ${user}: ${err}`;
|
|
100
63
|
debug.warn(msg);
|
|
101
64
|
if (err.response.status === 401) {
|
|
102
|
-
throw new
|
|
65
|
+
throw new UnauthorizedError();
|
|
103
66
|
}
|
|
104
67
|
if (err.response.status === 403) {
|
|
105
|
-
if (
|
|
106
|
-
throw new
|
|
68
|
+
if (differentOrigin(preferencesFile)) {
|
|
69
|
+
throw new CrossOriginForbiddenError();
|
|
107
70
|
}
|
|
108
|
-
throw new
|
|
71
|
+
throw new SameOriginForbiddenError();
|
|
109
72
|
}
|
|
110
73
|
/*if (err.response.status === 404) {
|
|
111
74
|
throw new NotFoundError();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profileLogic.js","sourceRoot":"","sources":["../../src/profile/profileLogic.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"profileLogic.js","sourceRoot":"","sources":["../../src/profile/profileLogic.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,UAAU,EAAE,gBAAgB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