@pod-os/core 0.23.1-rc.6d14494.0 → 0.23.1-rc.f73863c.0
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/dist/index.js +134 -53
- package/lib/index.js +139 -54
- package/package.json +1 -1
- package/types/index.d.ts +1 -0
- package/types/namespaces/index.d.ts +1 -0
- package/types/profile/ProfileGateway.d.ts +7 -0
- package/types/profile/ProfileGateway.spec.d.ts +1 -0
- package/types/profile/WebIdProfile.d.ts +12 -3
- package/types/profile/index.d.ts +1 -0
- package/types/type-index/TypeIndex.d.ts +13 -0
- package/types/type-index/TypeIndex.spec.d.ts +1 -0
- package/types/type-index/TypeRegistration.d.ts +26 -0
- package/types/type-index/index.d.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -4813,50 +4813,6 @@ var PictureGateway = class {
|
|
|
4813
4813
|
}
|
|
4814
4814
|
};
|
|
4815
4815
|
|
|
4816
|
-
// src/profile/WebIdProfile.ts
|
|
4817
|
-
var WebIdProfile = class extends Thing {
|
|
4818
|
-
constructor(webId, store, editable = false) {
|
|
4819
|
-
super(webId, store, editable);
|
|
4820
|
-
this.webId = webId;
|
|
4821
|
-
this.store = store;
|
|
4822
|
-
this.editable = editable;
|
|
4823
|
-
}
|
|
4824
|
-
/**
|
|
4825
|
-
* Returns te URI of the preferences document
|
|
4826
|
-
*/
|
|
4827
|
-
getPreferencesFile() {
|
|
4828
|
-
return this.store.anyValue(
|
|
4829
|
-
namedNode(this.webId),
|
|
4830
|
-
namedNode("http://www.w3.org/ns/pim/space#preferencesFile"),
|
|
4831
|
-
void 0,
|
|
4832
|
-
namedNode(this.webId).doc()
|
|
4833
|
-
);
|
|
4834
|
-
}
|
|
4835
|
-
/**
|
|
4836
|
-
* Returns the URIs of the private label indexes
|
|
4837
|
-
*/
|
|
4838
|
-
getPrivateLabelIndexes() {
|
|
4839
|
-
const profileNodes = this.store.each(
|
|
4840
|
-
namedNode(this.webId),
|
|
4841
|
-
namedNode("http://www.w3.org/ns/solid/terms#privateLabelIndex"),
|
|
4842
|
-
void 0,
|
|
4843
|
-
namedNode(this.webId).doc()
|
|
4844
|
-
);
|
|
4845
|
-
const preferences = this.getPreferencesFile();
|
|
4846
|
-
if (preferences) {
|
|
4847
|
-
const preferencesNodes = this.store.each(
|
|
4848
|
-
namedNode(this.webId),
|
|
4849
|
-
namedNode("http://www.w3.org/ns/solid/terms#privateLabelIndex"),
|
|
4850
|
-
void 0,
|
|
4851
|
-
namedNode(preferences)
|
|
4852
|
-
);
|
|
4853
|
-
return [...profileNodes, ...preferencesNodes].map((it) => it.value);
|
|
4854
|
-
} else {
|
|
4855
|
-
return profileNodes.map((it) => it.value);
|
|
4856
|
-
}
|
|
4857
|
-
}
|
|
4858
|
-
};
|
|
4859
|
-
|
|
4860
4816
|
// src/search/SearchIndex.ts
|
|
4861
4817
|
var import_lunr = __toESM(require_lunr(), 1);
|
|
4862
4818
|
var SearchIndex = class {
|
|
@@ -4939,6 +4895,7 @@ var RdfDocument = class extends Thing {
|
|
|
4939
4895
|
// src/namespaces/index.ts
|
|
4940
4896
|
var rdfs = Namespace("http://www.w3.org/2000/01/rdf-schema#");
|
|
4941
4897
|
var pim = Namespace("http://www.w3.org/ns/pim/space#");
|
|
4898
|
+
var schema = Namespace("https://schema.org/");
|
|
4942
4899
|
|
|
4943
4900
|
// src/search/LabelIndex.ts
|
|
4944
4901
|
var LabelIndex = class extends RdfDocument {
|
|
@@ -4989,6 +4946,54 @@ var solid = Namespace("http://www.w3.org/ns/solid/terms#");
|
|
|
4989
4946
|
var pim2 = Namespace("http://www.w3.org/ns/pim/space#");
|
|
4990
4947
|
var ldp = Namespace("http://www.w3.org/ns/ldp#");
|
|
4991
4948
|
|
|
4949
|
+
// node_modules/@solid-data-modules/rdflib-utils/dist/queries/PreferencesQuery.js
|
|
4950
|
+
var PreferencesQuery = class {
|
|
4951
|
+
constructor(store, webIdNode, preferencesDoc) {
|
|
4952
|
+
this.store = store;
|
|
4953
|
+
this.webIdNode = webIdNode;
|
|
4954
|
+
this.preferencesDoc = preferencesDoc;
|
|
4955
|
+
}
|
|
4956
|
+
/**
|
|
4957
|
+
* Look up the private type index. Returns null if none is found or if the predicated does not link to a proper named node
|
|
4958
|
+
*/
|
|
4959
|
+
queryPrivateTypeIndex() {
|
|
4960
|
+
const node3 = this.store.any(this.webIdNode, solid("privateTypeIndex"), null, this.preferencesDoc);
|
|
4961
|
+
if (isNamedNode(node3)) {
|
|
4962
|
+
return node3;
|
|
4963
|
+
}
|
|
4964
|
+
return null;
|
|
4965
|
+
}
|
|
4966
|
+
};
|
|
4967
|
+
|
|
4968
|
+
// node_modules/@solid-data-modules/rdflib-utils/dist/queries/ProfileQuery.js
|
|
4969
|
+
var ProfileQuery = class {
|
|
4970
|
+
constructor(webIdNode, store) {
|
|
4971
|
+
this.webIdNode = webIdNode;
|
|
4972
|
+
this.store = store;
|
|
4973
|
+
}
|
|
4974
|
+
/**
|
|
4975
|
+
* Look up the public type index. Returns null if none is found or if the predicated does not link to a proper named node
|
|
4976
|
+
*/
|
|
4977
|
+
queryPublicTypeIndex() {
|
|
4978
|
+
const predicate4 = solid("publicTypeIndex");
|
|
4979
|
+
return this.queryNamedNode(predicate4);
|
|
4980
|
+
}
|
|
4981
|
+
/**
|
|
4982
|
+
* Look up the preferences file. Returns null if none is found or if the predicated does not link to a proper named node
|
|
4983
|
+
*/
|
|
4984
|
+
queryPreferencesFile() {
|
|
4985
|
+
const predicate4 = pim2("preferencesFile");
|
|
4986
|
+
return this.queryNamedNode(predicate4);
|
|
4987
|
+
}
|
|
4988
|
+
queryNamedNode(predicate4) {
|
|
4989
|
+
const node3 = this.store.any(this.webIdNode, predicate4, null, this.webIdNode.doc());
|
|
4990
|
+
if (isNamedNode(node3)) {
|
|
4991
|
+
return node3;
|
|
4992
|
+
}
|
|
4993
|
+
return null;
|
|
4994
|
+
}
|
|
4995
|
+
};
|
|
4996
|
+
|
|
4992
4997
|
// node_modules/@solid-data-modules/rdflib-utils/dist/identifier/generate-id.js
|
|
4993
4998
|
var import_short_unique_id = __toESM(require_short_unique_id(), 1);
|
|
4994
4999
|
var uid = new import_short_unique_id.default({ length: 10 });
|
|
@@ -5302,7 +5307,7 @@ __export(index_es_exports, {
|
|
|
5302
5307
|
rdf: () => rdf2,
|
|
5303
5308
|
rdfs: () => rdfs2,
|
|
5304
5309
|
sched: () => sched,
|
|
5305
|
-
schema: () =>
|
|
5310
|
+
schema: () => schema2,
|
|
5306
5311
|
schema_https: () => schema_https,
|
|
5307
5312
|
sec: () => sec,
|
|
5308
5313
|
shacl: () => shacl,
|
|
@@ -26556,7 +26561,7 @@ var trip3 = tripImport;
|
|
|
26556
26561
|
var rdf2 = rdfImport;
|
|
26557
26562
|
var rdfs2 = rdfsImport;
|
|
26558
26563
|
var sched = schedImport;
|
|
26559
|
-
var
|
|
26564
|
+
var schema2 = schemaImport;
|
|
26560
26565
|
var schema_https = schema_httpsImport;
|
|
26561
26566
|
var sec = secImport;
|
|
26562
26567
|
var shacl = shaclImport;
|
|
@@ -26606,6 +26611,86 @@ var UriService = class {
|
|
|
26606
26611
|
}
|
|
26607
26612
|
};
|
|
26608
26613
|
|
|
26614
|
+
// src/profile/WebIdProfile.ts
|
|
26615
|
+
var WebIdProfile = class extends Thing {
|
|
26616
|
+
constructor(webId, store, editable = false) {
|
|
26617
|
+
super(webId, store, editable);
|
|
26618
|
+
this.webId = webId;
|
|
26619
|
+
this.store = store;
|
|
26620
|
+
this.editable = editable;
|
|
26621
|
+
this.profileQuery = new ProfileQuery(namedNode(this.webId), this.store);
|
|
26622
|
+
}
|
|
26623
|
+
/**
|
|
26624
|
+
* Returns the URI of the preferences document
|
|
26625
|
+
*/
|
|
26626
|
+
getPreferencesFile() {
|
|
26627
|
+
return this.profileQuery.queryPreferencesFile()?.value;
|
|
26628
|
+
}
|
|
26629
|
+
/**
|
|
26630
|
+
* Returns the URI of the public type index document
|
|
26631
|
+
*/
|
|
26632
|
+
getPublicTypeIndex() {
|
|
26633
|
+
return this.profileQuery.queryPublicTypeIndex()?.value;
|
|
26634
|
+
}
|
|
26635
|
+
/**
|
|
26636
|
+
* Returns the URI of the private type index document
|
|
26637
|
+
*/
|
|
26638
|
+
getPrivateTypeIndex() {
|
|
26639
|
+
const preferences = this.profileQuery.queryPreferencesFile();
|
|
26640
|
+
if (!preferences) return void 0;
|
|
26641
|
+
const query4 = new PreferencesQuery(
|
|
26642
|
+
this.store,
|
|
26643
|
+
namedNode(this.webId),
|
|
26644
|
+
preferences
|
|
26645
|
+
);
|
|
26646
|
+
return query4.queryPrivateTypeIndex()?.value;
|
|
26647
|
+
}
|
|
26648
|
+
/**
|
|
26649
|
+
* Returns the URIs of the private label indexes
|
|
26650
|
+
*/
|
|
26651
|
+
getPrivateLabelIndexes() {
|
|
26652
|
+
const profileNodes = this.store.each(
|
|
26653
|
+
namedNode(this.webId),
|
|
26654
|
+
namedNode("http://www.w3.org/ns/solid/terms#privateLabelIndex"),
|
|
26655
|
+
void 0,
|
|
26656
|
+
namedNode(this.webId).doc()
|
|
26657
|
+
);
|
|
26658
|
+
const preferences = this.getPreferencesFile();
|
|
26659
|
+
if (preferences) {
|
|
26660
|
+
const preferencesNodes = this.store.each(
|
|
26661
|
+
namedNode(this.webId),
|
|
26662
|
+
namedNode("http://www.w3.org/ns/solid/terms#privateLabelIndex"),
|
|
26663
|
+
void 0,
|
|
26664
|
+
namedNode(preferences)
|
|
26665
|
+
);
|
|
26666
|
+
return [...profileNodes, ...preferencesNodes].map((it) => it.value);
|
|
26667
|
+
} else {
|
|
26668
|
+
return profileNodes.map((it) => it.value);
|
|
26669
|
+
}
|
|
26670
|
+
}
|
|
26671
|
+
};
|
|
26672
|
+
|
|
26673
|
+
// src/profile/ProfileGateway.ts
|
|
26674
|
+
var ProfileGateway = class {
|
|
26675
|
+
constructor(store) {
|
|
26676
|
+
this.store = store;
|
|
26677
|
+
}
|
|
26678
|
+
async fetchProfile(webId) {
|
|
26679
|
+
await this.store.fetch(webId);
|
|
26680
|
+
const profile2 = this.store.get(webId).assume(WebIdProfile);
|
|
26681
|
+
const preferences = profile2.getPreferencesFile();
|
|
26682
|
+
if (preferences) {
|
|
26683
|
+
await this.store.fetch(preferences);
|
|
26684
|
+
}
|
|
26685
|
+
const publicTypeIndex2 = profile2.getPublicTypeIndex();
|
|
26686
|
+
const privateTypeIndex2 = profile2.getPrivateTypeIndex();
|
|
26687
|
+
await this.store.fetchAll(
|
|
26688
|
+
[privateTypeIndex2, publicTypeIndex2].filter((it) => it !== void 0)
|
|
26689
|
+
);
|
|
26690
|
+
return profile2;
|
|
26691
|
+
}
|
|
26692
|
+
};
|
|
26693
|
+
|
|
26609
26694
|
// src/authentication/index.ts
|
|
26610
26695
|
var AnonymousSession = class {
|
|
26611
26696
|
constructor() {
|
|
@@ -26649,6 +26734,7 @@ var PodOS = class {
|
|
|
26649
26734
|
this.pictureGateway = new PictureGateway(this.store, this.fileFetcher);
|
|
26650
26735
|
this.flagAuthorizationMetaDataOnSessionChange();
|
|
26651
26736
|
this.uriService = new UriService(this.store);
|
|
26737
|
+
this.profileGateway = new ProfileGateway(this.store);
|
|
26652
26738
|
}
|
|
26653
26739
|
/*
|
|
26654
26740
|
Flagging authorization metadata is necessary every time the user
|
|
@@ -26708,13 +26794,7 @@ var PodOS = class {
|
|
|
26708
26794
|
* @param webId
|
|
26709
26795
|
*/
|
|
26710
26796
|
async fetchProfile(webId) {
|
|
26711
|
-
|
|
26712
|
-
const profile2 = this.store.get(webId).assume(WebIdProfile);
|
|
26713
|
-
const preferences = profile2.getPreferencesFile();
|
|
26714
|
-
if (preferences) {
|
|
26715
|
-
await this.fetch(preferences);
|
|
26716
|
-
}
|
|
26717
|
-
return profile2;
|
|
26797
|
+
return this.profileGateway.fetchProfile(webId);
|
|
26718
26798
|
}
|
|
26719
26799
|
/**
|
|
26720
26800
|
* Fetch the private label index for the given profile and build a search index from it
|
|
@@ -26775,6 +26855,7 @@ export {
|
|
|
26775
26855
|
OfflineCapableFetcher,
|
|
26776
26856
|
PictureGateway,
|
|
26777
26857
|
PodOS,
|
|
26858
|
+
ProfileGateway,
|
|
26778
26859
|
RdfDocument,
|
|
26779
26860
|
SearchGateway,
|
|
26780
26861
|
SearchIndex,
|
package/lib/index.js
CHANGED
|
@@ -34753,6 +34753,7 @@ _:patch
|
|
|
34753
34753
|
OfflineCapableFetcher: () => OfflineCapableFetcher,
|
|
34754
34754
|
PictureGateway: () => PictureGateway,
|
|
34755
34755
|
PodOS: () => PodOS,
|
|
34756
|
+
ProfileGateway: () => ProfileGateway,
|
|
34756
34757
|
RdfDocument: () => RdfDocument,
|
|
34757
34758
|
SearchGateway: () => SearchGateway,
|
|
34758
34759
|
SearchIndex: () => SearchIndex,
|
|
@@ -37787,51 +37788,6 @@ _:patch
|
|
|
37787
37788
|
}
|
|
37788
37789
|
};
|
|
37789
37790
|
|
|
37790
|
-
// src/profile/WebIdProfile.ts
|
|
37791
|
-
init_esm();
|
|
37792
|
-
var WebIdProfile = class extends Thing {
|
|
37793
|
-
constructor(webId, store, editable = false) {
|
|
37794
|
-
super(webId, store, editable);
|
|
37795
|
-
this.webId = webId;
|
|
37796
|
-
this.store = store;
|
|
37797
|
-
this.editable = editable;
|
|
37798
|
-
}
|
|
37799
|
-
/**
|
|
37800
|
-
* Returns te URI of the preferences document
|
|
37801
|
-
*/
|
|
37802
|
-
getPreferencesFile() {
|
|
37803
|
-
return this.store.anyValue(
|
|
37804
|
-
namedNode(this.webId),
|
|
37805
|
-
namedNode("http://www.w3.org/ns/pim/space#preferencesFile"),
|
|
37806
|
-
void 0,
|
|
37807
|
-
namedNode(this.webId).doc()
|
|
37808
|
-
);
|
|
37809
|
-
}
|
|
37810
|
-
/**
|
|
37811
|
-
* Returns the URIs of the private label indexes
|
|
37812
|
-
*/
|
|
37813
|
-
getPrivateLabelIndexes() {
|
|
37814
|
-
const profileNodes = this.store.each(
|
|
37815
|
-
namedNode(this.webId),
|
|
37816
|
-
namedNode("http://www.w3.org/ns/solid/terms#privateLabelIndex"),
|
|
37817
|
-
void 0,
|
|
37818
|
-
namedNode(this.webId).doc()
|
|
37819
|
-
);
|
|
37820
|
-
const preferences = this.getPreferencesFile();
|
|
37821
|
-
if (preferences) {
|
|
37822
|
-
const preferencesNodes = this.store.each(
|
|
37823
|
-
namedNode(this.webId),
|
|
37824
|
-
namedNode("http://www.w3.org/ns/solid/terms#privateLabelIndex"),
|
|
37825
|
-
void 0,
|
|
37826
|
-
namedNode(preferences)
|
|
37827
|
-
);
|
|
37828
|
-
return [...profileNodes, ...preferencesNodes].map((it) => it.value);
|
|
37829
|
-
} else {
|
|
37830
|
-
return profileNodes.map((it) => it.value);
|
|
37831
|
-
}
|
|
37832
|
-
}
|
|
37833
|
-
};
|
|
37834
|
-
|
|
37835
37791
|
// src/search/SearchIndex.ts
|
|
37836
37792
|
var import_lunr = __toESM(require_lunr(), 1);
|
|
37837
37793
|
var SearchIndex = class {
|
|
@@ -37919,6 +37875,7 @@ _:patch
|
|
|
37919
37875
|
init_esm();
|
|
37920
37876
|
var rdfs = Namespace("http://www.w3.org/2000/01/rdf-schema#");
|
|
37921
37877
|
var pim2 = Namespace("http://www.w3.org/ns/pim/space#");
|
|
37878
|
+
var schema = Namespace("https://schema.org/");
|
|
37922
37879
|
|
|
37923
37880
|
// src/search/LabelIndex.ts
|
|
37924
37881
|
var LabelIndex = class extends RdfDocument {
|
|
@@ -37966,6 +37923,9 @@ _:patch
|
|
|
37966
37923
|
});
|
|
37967
37924
|
}
|
|
37968
37925
|
|
|
37926
|
+
// node_modules/@solid-data-modules/rdflib-utils/dist/queries/PreferencesQuery.js
|
|
37927
|
+
init_esm();
|
|
37928
|
+
|
|
37969
37929
|
// node_modules/@solid-data-modules/rdflib-utils/dist/namespaces/index.js
|
|
37970
37930
|
init_esm();
|
|
37971
37931
|
var rdf4 = Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#");
|
|
@@ -37973,6 +37933,55 @@ _:patch
|
|
|
37973
37933
|
var pim3 = Namespace("http://www.w3.org/ns/pim/space#");
|
|
37974
37934
|
var ldp2 = Namespace("http://www.w3.org/ns/ldp#");
|
|
37975
37935
|
|
|
37936
|
+
// node_modules/@solid-data-modules/rdflib-utils/dist/queries/PreferencesQuery.js
|
|
37937
|
+
var PreferencesQuery2 = class {
|
|
37938
|
+
constructor(store, webIdNode, preferencesDoc) {
|
|
37939
|
+
this.store = store;
|
|
37940
|
+
this.webIdNode = webIdNode;
|
|
37941
|
+
this.preferencesDoc = preferencesDoc;
|
|
37942
|
+
}
|
|
37943
|
+
/**
|
|
37944
|
+
* Look up the private type index. Returns null if none is found or if the predicated does not link to a proper named node
|
|
37945
|
+
*/
|
|
37946
|
+
queryPrivateTypeIndex() {
|
|
37947
|
+
const node3 = this.store.any(this.webIdNode, solid2("privateTypeIndex"), null, this.preferencesDoc);
|
|
37948
|
+
if (isNamedNode(node3)) {
|
|
37949
|
+
return node3;
|
|
37950
|
+
}
|
|
37951
|
+
return null;
|
|
37952
|
+
}
|
|
37953
|
+
};
|
|
37954
|
+
|
|
37955
|
+
// node_modules/@solid-data-modules/rdflib-utils/dist/queries/ProfileQuery.js
|
|
37956
|
+
init_esm();
|
|
37957
|
+
var ProfileQuery2 = class {
|
|
37958
|
+
constructor(webIdNode, store) {
|
|
37959
|
+
this.webIdNode = webIdNode;
|
|
37960
|
+
this.store = store;
|
|
37961
|
+
}
|
|
37962
|
+
/**
|
|
37963
|
+
* Look up the public type index. Returns null if none is found or if the predicated does not link to a proper named node
|
|
37964
|
+
*/
|
|
37965
|
+
queryPublicTypeIndex() {
|
|
37966
|
+
const predicate4 = solid2("publicTypeIndex");
|
|
37967
|
+
return this.queryNamedNode(predicate4);
|
|
37968
|
+
}
|
|
37969
|
+
/**
|
|
37970
|
+
* Look up the preferences file. Returns null if none is found or if the predicated does not link to a proper named node
|
|
37971
|
+
*/
|
|
37972
|
+
queryPreferencesFile() {
|
|
37973
|
+
const predicate4 = pim3("preferencesFile");
|
|
37974
|
+
return this.queryNamedNode(predicate4);
|
|
37975
|
+
}
|
|
37976
|
+
queryNamedNode(predicate4) {
|
|
37977
|
+
const node3 = this.store.any(this.webIdNode, predicate4, null, this.webIdNode.doc());
|
|
37978
|
+
if (isNamedNode(node3)) {
|
|
37979
|
+
return node3;
|
|
37980
|
+
}
|
|
37981
|
+
return null;
|
|
37982
|
+
}
|
|
37983
|
+
};
|
|
37984
|
+
|
|
37976
37985
|
// node_modules/@solid-data-modules/rdflib-utils/dist/identifier/generate-id.js
|
|
37977
37986
|
var import_short_unique_id2 = __toESM(require_short_unique_id(), 1);
|
|
37978
37987
|
var uid2 = new import_short_unique_id2.default({ length: 10 });
|
|
@@ -38291,7 +38300,7 @@ _:patch
|
|
|
38291
38300
|
rdf: () => rdf5,
|
|
38292
38301
|
rdfs: () => rdfs2,
|
|
38293
38302
|
sched: () => sched,
|
|
38294
|
-
schema: () =>
|
|
38303
|
+
schema: () => schema2,
|
|
38295
38304
|
schema_https: () => schema_https,
|
|
38296
38305
|
sec: () => sec,
|
|
38297
38306
|
shacl: () => shacl,
|
|
@@ -59545,7 +59554,7 @@ _:patch
|
|
|
59545
59554
|
var rdf5 = rdfImport;
|
|
59546
59555
|
var rdfs2 = rdfsImport;
|
|
59547
59556
|
var sched = schedImport;
|
|
59548
|
-
var
|
|
59557
|
+
var schema2 = schemaImport;
|
|
59549
59558
|
var schema_https = schema_httpsImport;
|
|
59550
59559
|
var sec = secImport;
|
|
59551
59560
|
var shacl = shaclImport;
|
|
@@ -59595,6 +59604,87 @@ _:patch
|
|
|
59595
59604
|
}
|
|
59596
59605
|
};
|
|
59597
59606
|
|
|
59607
|
+
// src/profile/WebIdProfile.ts
|
|
59608
|
+
init_esm();
|
|
59609
|
+
var WebIdProfile = class extends Thing {
|
|
59610
|
+
constructor(webId, store, editable = false) {
|
|
59611
|
+
super(webId, store, editable);
|
|
59612
|
+
this.webId = webId;
|
|
59613
|
+
this.store = store;
|
|
59614
|
+
this.editable = editable;
|
|
59615
|
+
this.profileQuery = new ProfileQuery2(namedNode(this.webId), this.store);
|
|
59616
|
+
}
|
|
59617
|
+
/**
|
|
59618
|
+
* Returns the URI of the preferences document
|
|
59619
|
+
*/
|
|
59620
|
+
getPreferencesFile() {
|
|
59621
|
+
return this.profileQuery.queryPreferencesFile()?.value;
|
|
59622
|
+
}
|
|
59623
|
+
/**
|
|
59624
|
+
* Returns the URI of the public type index document
|
|
59625
|
+
*/
|
|
59626
|
+
getPublicTypeIndex() {
|
|
59627
|
+
return this.profileQuery.queryPublicTypeIndex()?.value;
|
|
59628
|
+
}
|
|
59629
|
+
/**
|
|
59630
|
+
* Returns the URI of the private type index document
|
|
59631
|
+
*/
|
|
59632
|
+
getPrivateTypeIndex() {
|
|
59633
|
+
const preferences = this.profileQuery.queryPreferencesFile();
|
|
59634
|
+
if (!preferences) return void 0;
|
|
59635
|
+
const query4 = new PreferencesQuery2(
|
|
59636
|
+
this.store,
|
|
59637
|
+
namedNode(this.webId),
|
|
59638
|
+
preferences
|
|
59639
|
+
);
|
|
59640
|
+
return query4.queryPrivateTypeIndex()?.value;
|
|
59641
|
+
}
|
|
59642
|
+
/**
|
|
59643
|
+
* Returns the URIs of the private label indexes
|
|
59644
|
+
*/
|
|
59645
|
+
getPrivateLabelIndexes() {
|
|
59646
|
+
const profileNodes = this.store.each(
|
|
59647
|
+
namedNode(this.webId),
|
|
59648
|
+
namedNode("http://www.w3.org/ns/solid/terms#privateLabelIndex"),
|
|
59649
|
+
void 0,
|
|
59650
|
+
namedNode(this.webId).doc()
|
|
59651
|
+
);
|
|
59652
|
+
const preferences = this.getPreferencesFile();
|
|
59653
|
+
if (preferences) {
|
|
59654
|
+
const preferencesNodes = this.store.each(
|
|
59655
|
+
namedNode(this.webId),
|
|
59656
|
+
namedNode("http://www.w3.org/ns/solid/terms#privateLabelIndex"),
|
|
59657
|
+
void 0,
|
|
59658
|
+
namedNode(preferences)
|
|
59659
|
+
);
|
|
59660
|
+
return [...profileNodes, ...preferencesNodes].map((it) => it.value);
|
|
59661
|
+
} else {
|
|
59662
|
+
return profileNodes.map((it) => it.value);
|
|
59663
|
+
}
|
|
59664
|
+
}
|
|
59665
|
+
};
|
|
59666
|
+
|
|
59667
|
+
// src/profile/ProfileGateway.ts
|
|
59668
|
+
var ProfileGateway = class {
|
|
59669
|
+
constructor(store) {
|
|
59670
|
+
this.store = store;
|
|
59671
|
+
}
|
|
59672
|
+
async fetchProfile(webId) {
|
|
59673
|
+
await this.store.fetch(webId);
|
|
59674
|
+
const profile2 = this.store.get(webId).assume(WebIdProfile);
|
|
59675
|
+
const preferences = profile2.getPreferencesFile();
|
|
59676
|
+
if (preferences) {
|
|
59677
|
+
await this.store.fetch(preferences);
|
|
59678
|
+
}
|
|
59679
|
+
const publicTypeIndex2 = profile2.getPublicTypeIndex();
|
|
59680
|
+
const privateTypeIndex2 = profile2.getPrivateTypeIndex();
|
|
59681
|
+
await this.store.fetchAll(
|
|
59682
|
+
[privateTypeIndex2, publicTypeIndex2].filter((it) => it !== void 0)
|
|
59683
|
+
);
|
|
59684
|
+
return profile2;
|
|
59685
|
+
}
|
|
59686
|
+
};
|
|
59687
|
+
|
|
59598
59688
|
// src/authentication/index.ts
|
|
59599
59689
|
var AnonymousSession = class {
|
|
59600
59690
|
constructor() {
|
|
@@ -59638,6 +59728,7 @@ _:patch
|
|
|
59638
59728
|
this.pictureGateway = new PictureGateway(this.store, this.fileFetcher);
|
|
59639
59729
|
this.flagAuthorizationMetaDataOnSessionChange();
|
|
59640
59730
|
this.uriService = new UriService(this.store);
|
|
59731
|
+
this.profileGateway = new ProfileGateway(this.store);
|
|
59641
59732
|
}
|
|
59642
59733
|
/*
|
|
59643
59734
|
Flagging authorization metadata is necessary every time the user
|
|
@@ -59697,13 +59788,7 @@ _:patch
|
|
|
59697
59788
|
* @param webId
|
|
59698
59789
|
*/
|
|
59699
59790
|
async fetchProfile(webId) {
|
|
59700
|
-
|
|
59701
|
-
const profile2 = this.store.get(webId).assume(WebIdProfile);
|
|
59702
|
-
const preferences = profile2.getPreferencesFile();
|
|
59703
|
-
if (preferences) {
|
|
59704
|
-
await this.fetch(preferences);
|
|
59705
|
-
}
|
|
59706
|
-
return profile2;
|
|
59791
|
+
return this.profileGateway.fetchProfile(webId);
|
|
59707
59792
|
}
|
|
59708
59793
|
/**
|
|
59709
59794
|
* Fetch the private label index for the given profile and build a search index from it
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ export declare class PodOS {
|
|
|
40
40
|
private readonly searchGateway;
|
|
41
41
|
private readonly pictureGateway;
|
|
42
42
|
private readonly offlineCache;
|
|
43
|
+
private readonly profileGateway;
|
|
43
44
|
constructor({ session, offlineCache, onlineStatus, internalStore, }?: PodOsConfiguration);
|
|
44
45
|
private flagAuthorizationMetaDataOnSessionChange;
|
|
45
46
|
fetch(uri: string): Promise<Response>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
import { IndexedFormula } from "rdflib";
|
|
2
2
|
import { Thing } from "../thing";
|
|
3
3
|
/**
|
|
4
|
-
* Allows
|
|
4
|
+
* Allows finding things related to the WebID and their profile document
|
|
5
5
|
*/
|
|
6
6
|
export declare class WebIdProfile extends Thing {
|
|
7
7
|
readonly webId: string;
|
|
8
8
|
readonly store: IndexedFormula;
|
|
9
9
|
readonly editable: boolean;
|
|
10
|
+
private profileQuery;
|
|
10
11
|
constructor(webId: string, store: IndexedFormula, editable?: boolean);
|
|
11
12
|
/**
|
|
12
|
-
* Returns
|
|
13
|
+
* Returns the URI of the preferences document
|
|
13
14
|
*/
|
|
14
|
-
getPreferencesFile(): string |
|
|
15
|
+
getPreferencesFile(): string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Returns the URI of the public type index document
|
|
18
|
+
*/
|
|
19
|
+
getPublicTypeIndex(): string | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Returns the URI of the private type index document
|
|
22
|
+
*/
|
|
23
|
+
getPrivateTypeIndex(): string | undefined;
|
|
15
24
|
/**
|
|
16
25
|
* Returns the URIs of the private label indexes
|
|
17
26
|
*/
|
package/types/profile/index.d.ts
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Thing } from "../thing";
|
|
2
|
+
import { IndexedFormula } from "rdflib";
|
|
3
|
+
import { TypeRegistration } from "./TypeRegistration";
|
|
4
|
+
/**
|
|
5
|
+
* Represents a private or public type index document
|
|
6
|
+
*/
|
|
7
|
+
export declare class TypeIndex extends Thing {
|
|
8
|
+
readonly uri: string;
|
|
9
|
+
readonly store: IndexedFormula;
|
|
10
|
+
readonly editable: boolean;
|
|
11
|
+
constructor(uri: string, store: IndexedFormula, editable?: boolean);
|
|
12
|
+
listAll(): TypeRegistration[];
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registration of a type in the type index
|
|
3
|
+
*/
|
|
4
|
+
export interface TypeRegistration {
|
|
5
|
+
/**
|
|
6
|
+
* RDF class of the indexed item(s) (resembling terms:forClass)
|
|
7
|
+
*/
|
|
8
|
+
forClass: string;
|
|
9
|
+
/**
|
|
10
|
+
* The containers or things this registration points to
|
|
11
|
+
*/
|
|
12
|
+
targets: RegistrationTarget[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Target of a type registration
|
|
16
|
+
*/
|
|
17
|
+
export interface RegistrationTarget {
|
|
18
|
+
/**
|
|
19
|
+
* container containing instances or direct reference to a single instance
|
|
20
|
+
*/
|
|
21
|
+
type: "container" | "instance";
|
|
22
|
+
/**
|
|
23
|
+
* URI the index points to (resembling terms:instance or terms:instanceContainer)
|
|
24
|
+
*/
|
|
25
|
+
uri: string;
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TypeIndex } from "./TypeIndex";
|