@pod-os/core 0.23.1-rc.6d14494.0 → 0.23.1-rc.b62ebb7.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 +180 -53
- package/lib/index.js +186 -54
- package/package.json +1 -1
- package/types/index.d.ts +2 -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 +2 -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() {
|
|
@@ -26628,6 +26713,51 @@ var AnonymousSession = class {
|
|
|
26628
26713
|
}
|
|
26629
26714
|
};
|
|
26630
26715
|
|
|
26716
|
+
// src/type-index/TypeIndex.ts
|
|
26717
|
+
var TypeIndex2 = class extends Thing {
|
|
26718
|
+
constructor(uri6, store, editable = false) {
|
|
26719
|
+
super(uri6, store, editable);
|
|
26720
|
+
this.uri = uri6;
|
|
26721
|
+
this.store = store;
|
|
26722
|
+
this.editable = editable;
|
|
26723
|
+
}
|
|
26724
|
+
listAll() {
|
|
26725
|
+
const forClassStatements = this.store.statementsMatching(
|
|
26726
|
+
null,
|
|
26727
|
+
solid("forClass"),
|
|
26728
|
+
null,
|
|
26729
|
+
namedNode(this.uri)
|
|
26730
|
+
);
|
|
26731
|
+
return forClassStatements.map((statement2) => {
|
|
26732
|
+
const subject8 = statement2.subject;
|
|
26733
|
+
const instanceContainerStatements = this.store.statementsMatching(
|
|
26734
|
+
subject8,
|
|
26735
|
+
solid("instanceContainer"),
|
|
26736
|
+
null,
|
|
26737
|
+
namedNode(this.uri)
|
|
26738
|
+
);
|
|
26739
|
+
const instanceStatements = this.store.statementsMatching(
|
|
26740
|
+
subject8,
|
|
26741
|
+
solid("instance"),
|
|
26742
|
+
null,
|
|
26743
|
+
namedNode(this.uri)
|
|
26744
|
+
);
|
|
26745
|
+
const instances2 = instanceStatements.map((it) => ({
|
|
26746
|
+
type: "instance",
|
|
26747
|
+
uri: it.object.value
|
|
26748
|
+
}));
|
|
26749
|
+
const instanceContainers = instanceContainerStatements.map((it) => ({
|
|
26750
|
+
type: "container",
|
|
26751
|
+
uri: it.object.value
|
|
26752
|
+
}));
|
|
26753
|
+
return {
|
|
26754
|
+
targets: [...instanceContainers, ...instances2],
|
|
26755
|
+
forClass: statement2.object.value
|
|
26756
|
+
};
|
|
26757
|
+
});
|
|
26758
|
+
}
|
|
26759
|
+
};
|
|
26760
|
+
|
|
26631
26761
|
// src/index.ts
|
|
26632
26762
|
var PodOS = class {
|
|
26633
26763
|
constructor({
|
|
@@ -26649,6 +26779,7 @@ var PodOS = class {
|
|
|
26649
26779
|
this.pictureGateway = new PictureGateway(this.store, this.fileFetcher);
|
|
26650
26780
|
this.flagAuthorizationMetaDataOnSessionChange();
|
|
26651
26781
|
this.uriService = new UriService(this.store);
|
|
26782
|
+
this.profileGateway = new ProfileGateway(this.store);
|
|
26652
26783
|
}
|
|
26653
26784
|
/*
|
|
26654
26785
|
Flagging authorization metadata is necessary every time the user
|
|
@@ -26708,13 +26839,7 @@ var PodOS = class {
|
|
|
26708
26839
|
* @param webId
|
|
26709
26840
|
*/
|
|
26710
26841
|
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;
|
|
26842
|
+
return this.profileGateway.fetchProfile(webId);
|
|
26718
26843
|
}
|
|
26719
26844
|
/**
|
|
26720
26845
|
* Fetch the private label index for the given profile and build a search index from it
|
|
@@ -26775,11 +26900,13 @@ export {
|
|
|
26775
26900
|
OfflineCapableFetcher,
|
|
26776
26901
|
PictureGateway,
|
|
26777
26902
|
PodOS,
|
|
26903
|
+
ProfileGateway,
|
|
26778
26904
|
RdfDocument,
|
|
26779
26905
|
SearchGateway,
|
|
26780
26906
|
SearchIndex,
|
|
26781
26907
|
Store,
|
|
26782
26908
|
Thing,
|
|
26909
|
+
TypeIndex2 as TypeIndex,
|
|
26783
26910
|
UriService,
|
|
26784
26911
|
WebIdProfile,
|
|
26785
26912
|
createPictureLinkOperation,
|
package/lib/index.js
CHANGED
|
@@ -34753,11 +34753,13 @@ _: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,
|
|
34759
34760
|
Store: () => Store,
|
|
34760
34761
|
Thing: () => Thing,
|
|
34762
|
+
TypeIndex: () => TypeIndex2,
|
|
34761
34763
|
UriService: () => UriService,
|
|
34762
34764
|
WebIdProfile: () => WebIdProfile,
|
|
34763
34765
|
createPictureLinkOperation: () => createPictureLinkOperation,
|
|
@@ -37787,51 +37789,6 @@ _:patch
|
|
|
37787
37789
|
}
|
|
37788
37790
|
};
|
|
37789
37791
|
|
|
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
37792
|
// src/search/SearchIndex.ts
|
|
37836
37793
|
var import_lunr = __toESM(require_lunr(), 1);
|
|
37837
37794
|
var SearchIndex = class {
|
|
@@ -37919,6 +37876,7 @@ _:patch
|
|
|
37919
37876
|
init_esm();
|
|
37920
37877
|
var rdfs = Namespace("http://www.w3.org/2000/01/rdf-schema#");
|
|
37921
37878
|
var pim2 = Namespace("http://www.w3.org/ns/pim/space#");
|
|
37879
|
+
var schema = Namespace("https://schema.org/");
|
|
37922
37880
|
|
|
37923
37881
|
// src/search/LabelIndex.ts
|
|
37924
37882
|
var LabelIndex = class extends RdfDocument {
|
|
@@ -37966,6 +37924,9 @@ _:patch
|
|
|
37966
37924
|
});
|
|
37967
37925
|
}
|
|
37968
37926
|
|
|
37927
|
+
// node_modules/@solid-data-modules/rdflib-utils/dist/queries/PreferencesQuery.js
|
|
37928
|
+
init_esm();
|
|
37929
|
+
|
|
37969
37930
|
// node_modules/@solid-data-modules/rdflib-utils/dist/namespaces/index.js
|
|
37970
37931
|
init_esm();
|
|
37971
37932
|
var rdf4 = Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#");
|
|
@@ -37973,6 +37934,55 @@ _:patch
|
|
|
37973
37934
|
var pim3 = Namespace("http://www.w3.org/ns/pim/space#");
|
|
37974
37935
|
var ldp2 = Namespace("http://www.w3.org/ns/ldp#");
|
|
37975
37936
|
|
|
37937
|
+
// node_modules/@solid-data-modules/rdflib-utils/dist/queries/PreferencesQuery.js
|
|
37938
|
+
var PreferencesQuery2 = class {
|
|
37939
|
+
constructor(store, webIdNode, preferencesDoc) {
|
|
37940
|
+
this.store = store;
|
|
37941
|
+
this.webIdNode = webIdNode;
|
|
37942
|
+
this.preferencesDoc = preferencesDoc;
|
|
37943
|
+
}
|
|
37944
|
+
/**
|
|
37945
|
+
* Look up the private type index. Returns null if none is found or if the predicated does not link to a proper named node
|
|
37946
|
+
*/
|
|
37947
|
+
queryPrivateTypeIndex() {
|
|
37948
|
+
const node3 = this.store.any(this.webIdNode, solid2("privateTypeIndex"), null, this.preferencesDoc);
|
|
37949
|
+
if (isNamedNode(node3)) {
|
|
37950
|
+
return node3;
|
|
37951
|
+
}
|
|
37952
|
+
return null;
|
|
37953
|
+
}
|
|
37954
|
+
};
|
|
37955
|
+
|
|
37956
|
+
// node_modules/@solid-data-modules/rdflib-utils/dist/queries/ProfileQuery.js
|
|
37957
|
+
init_esm();
|
|
37958
|
+
var ProfileQuery2 = class {
|
|
37959
|
+
constructor(webIdNode, store) {
|
|
37960
|
+
this.webIdNode = webIdNode;
|
|
37961
|
+
this.store = store;
|
|
37962
|
+
}
|
|
37963
|
+
/**
|
|
37964
|
+
* Look up the public type index. Returns null if none is found or if the predicated does not link to a proper named node
|
|
37965
|
+
*/
|
|
37966
|
+
queryPublicTypeIndex() {
|
|
37967
|
+
const predicate4 = solid2("publicTypeIndex");
|
|
37968
|
+
return this.queryNamedNode(predicate4);
|
|
37969
|
+
}
|
|
37970
|
+
/**
|
|
37971
|
+
* Look up the preferences file. Returns null if none is found or if the predicated does not link to a proper named node
|
|
37972
|
+
*/
|
|
37973
|
+
queryPreferencesFile() {
|
|
37974
|
+
const predicate4 = pim3("preferencesFile");
|
|
37975
|
+
return this.queryNamedNode(predicate4);
|
|
37976
|
+
}
|
|
37977
|
+
queryNamedNode(predicate4) {
|
|
37978
|
+
const node3 = this.store.any(this.webIdNode, predicate4, null, this.webIdNode.doc());
|
|
37979
|
+
if (isNamedNode(node3)) {
|
|
37980
|
+
return node3;
|
|
37981
|
+
}
|
|
37982
|
+
return null;
|
|
37983
|
+
}
|
|
37984
|
+
};
|
|
37985
|
+
|
|
37976
37986
|
// node_modules/@solid-data-modules/rdflib-utils/dist/identifier/generate-id.js
|
|
37977
37987
|
var import_short_unique_id2 = __toESM(require_short_unique_id(), 1);
|
|
37978
37988
|
var uid2 = new import_short_unique_id2.default({ length: 10 });
|
|
@@ -38291,7 +38301,7 @@ _:patch
|
|
|
38291
38301
|
rdf: () => rdf5,
|
|
38292
38302
|
rdfs: () => rdfs2,
|
|
38293
38303
|
sched: () => sched,
|
|
38294
|
-
schema: () =>
|
|
38304
|
+
schema: () => schema2,
|
|
38295
38305
|
schema_https: () => schema_https,
|
|
38296
38306
|
sec: () => sec,
|
|
38297
38307
|
shacl: () => shacl,
|
|
@@ -59545,7 +59555,7 @@ _:patch
|
|
|
59545
59555
|
var rdf5 = rdfImport;
|
|
59546
59556
|
var rdfs2 = rdfsImport;
|
|
59547
59557
|
var sched = schedImport;
|
|
59548
|
-
var
|
|
59558
|
+
var schema2 = schemaImport;
|
|
59549
59559
|
var schema_https = schema_httpsImport;
|
|
59550
59560
|
var sec = secImport;
|
|
59551
59561
|
var shacl = shaclImport;
|
|
@@ -59595,6 +59605,87 @@ _:patch
|
|
|
59595
59605
|
}
|
|
59596
59606
|
};
|
|
59597
59607
|
|
|
59608
|
+
// src/profile/WebIdProfile.ts
|
|
59609
|
+
init_esm();
|
|
59610
|
+
var WebIdProfile = class extends Thing {
|
|
59611
|
+
constructor(webId, store, editable = false) {
|
|
59612
|
+
super(webId, store, editable);
|
|
59613
|
+
this.webId = webId;
|
|
59614
|
+
this.store = store;
|
|
59615
|
+
this.editable = editable;
|
|
59616
|
+
this.profileQuery = new ProfileQuery2(namedNode(this.webId), this.store);
|
|
59617
|
+
}
|
|
59618
|
+
/**
|
|
59619
|
+
* Returns the URI of the preferences document
|
|
59620
|
+
*/
|
|
59621
|
+
getPreferencesFile() {
|
|
59622
|
+
return this.profileQuery.queryPreferencesFile()?.value;
|
|
59623
|
+
}
|
|
59624
|
+
/**
|
|
59625
|
+
* Returns the URI of the public type index document
|
|
59626
|
+
*/
|
|
59627
|
+
getPublicTypeIndex() {
|
|
59628
|
+
return this.profileQuery.queryPublicTypeIndex()?.value;
|
|
59629
|
+
}
|
|
59630
|
+
/**
|
|
59631
|
+
* Returns the URI of the private type index document
|
|
59632
|
+
*/
|
|
59633
|
+
getPrivateTypeIndex() {
|
|
59634
|
+
const preferences = this.profileQuery.queryPreferencesFile();
|
|
59635
|
+
if (!preferences) return void 0;
|
|
59636
|
+
const query4 = new PreferencesQuery2(
|
|
59637
|
+
this.store,
|
|
59638
|
+
namedNode(this.webId),
|
|
59639
|
+
preferences
|
|
59640
|
+
);
|
|
59641
|
+
return query4.queryPrivateTypeIndex()?.value;
|
|
59642
|
+
}
|
|
59643
|
+
/**
|
|
59644
|
+
* Returns the URIs of the private label indexes
|
|
59645
|
+
*/
|
|
59646
|
+
getPrivateLabelIndexes() {
|
|
59647
|
+
const profileNodes = this.store.each(
|
|
59648
|
+
namedNode(this.webId),
|
|
59649
|
+
namedNode("http://www.w3.org/ns/solid/terms#privateLabelIndex"),
|
|
59650
|
+
void 0,
|
|
59651
|
+
namedNode(this.webId).doc()
|
|
59652
|
+
);
|
|
59653
|
+
const preferences = this.getPreferencesFile();
|
|
59654
|
+
if (preferences) {
|
|
59655
|
+
const preferencesNodes = this.store.each(
|
|
59656
|
+
namedNode(this.webId),
|
|
59657
|
+
namedNode("http://www.w3.org/ns/solid/terms#privateLabelIndex"),
|
|
59658
|
+
void 0,
|
|
59659
|
+
namedNode(preferences)
|
|
59660
|
+
);
|
|
59661
|
+
return [...profileNodes, ...preferencesNodes].map((it) => it.value);
|
|
59662
|
+
} else {
|
|
59663
|
+
return profileNodes.map((it) => it.value);
|
|
59664
|
+
}
|
|
59665
|
+
}
|
|
59666
|
+
};
|
|
59667
|
+
|
|
59668
|
+
// src/profile/ProfileGateway.ts
|
|
59669
|
+
var ProfileGateway = class {
|
|
59670
|
+
constructor(store) {
|
|
59671
|
+
this.store = store;
|
|
59672
|
+
}
|
|
59673
|
+
async fetchProfile(webId) {
|
|
59674
|
+
await this.store.fetch(webId);
|
|
59675
|
+
const profile2 = this.store.get(webId).assume(WebIdProfile);
|
|
59676
|
+
const preferences = profile2.getPreferencesFile();
|
|
59677
|
+
if (preferences) {
|
|
59678
|
+
await this.store.fetch(preferences);
|
|
59679
|
+
}
|
|
59680
|
+
const publicTypeIndex2 = profile2.getPublicTypeIndex();
|
|
59681
|
+
const privateTypeIndex2 = profile2.getPrivateTypeIndex();
|
|
59682
|
+
await this.store.fetchAll(
|
|
59683
|
+
[privateTypeIndex2, publicTypeIndex2].filter((it) => it !== void 0)
|
|
59684
|
+
);
|
|
59685
|
+
return profile2;
|
|
59686
|
+
}
|
|
59687
|
+
};
|
|
59688
|
+
|
|
59598
59689
|
// src/authentication/index.ts
|
|
59599
59690
|
var AnonymousSession = class {
|
|
59600
59691
|
constructor() {
|
|
@@ -59617,6 +59708,52 @@ _:patch
|
|
|
59617
59708
|
}
|
|
59618
59709
|
};
|
|
59619
59710
|
|
|
59711
|
+
// src/type-index/TypeIndex.ts
|
|
59712
|
+
init_esm();
|
|
59713
|
+
var TypeIndex2 = class extends Thing {
|
|
59714
|
+
constructor(uri6, store, editable = false) {
|
|
59715
|
+
super(uri6, store, editable);
|
|
59716
|
+
this.uri = uri6;
|
|
59717
|
+
this.store = store;
|
|
59718
|
+
this.editable = editable;
|
|
59719
|
+
}
|
|
59720
|
+
listAll() {
|
|
59721
|
+
const forClassStatements = this.store.statementsMatching(
|
|
59722
|
+
null,
|
|
59723
|
+
solid2("forClass"),
|
|
59724
|
+
null,
|
|
59725
|
+
namedNode(this.uri)
|
|
59726
|
+
);
|
|
59727
|
+
return forClassStatements.map((statement2) => {
|
|
59728
|
+
const subject8 = statement2.subject;
|
|
59729
|
+
const instanceContainerStatements = this.store.statementsMatching(
|
|
59730
|
+
subject8,
|
|
59731
|
+
solid2("instanceContainer"),
|
|
59732
|
+
null,
|
|
59733
|
+
namedNode(this.uri)
|
|
59734
|
+
);
|
|
59735
|
+
const instanceStatements = this.store.statementsMatching(
|
|
59736
|
+
subject8,
|
|
59737
|
+
solid2("instance"),
|
|
59738
|
+
null,
|
|
59739
|
+
namedNode(this.uri)
|
|
59740
|
+
);
|
|
59741
|
+
const instances2 = instanceStatements.map((it) => ({
|
|
59742
|
+
type: "instance",
|
|
59743
|
+
uri: it.object.value
|
|
59744
|
+
}));
|
|
59745
|
+
const instanceContainers = instanceContainerStatements.map((it) => ({
|
|
59746
|
+
type: "container",
|
|
59747
|
+
uri: it.object.value
|
|
59748
|
+
}));
|
|
59749
|
+
return {
|
|
59750
|
+
targets: [...instanceContainers, ...instances2],
|
|
59751
|
+
forClass: statement2.object.value
|
|
59752
|
+
};
|
|
59753
|
+
});
|
|
59754
|
+
}
|
|
59755
|
+
};
|
|
59756
|
+
|
|
59620
59757
|
// src/index.ts
|
|
59621
59758
|
var PodOS = class {
|
|
59622
59759
|
constructor({
|
|
@@ -59638,6 +59775,7 @@ _:patch
|
|
|
59638
59775
|
this.pictureGateway = new PictureGateway(this.store, this.fileFetcher);
|
|
59639
59776
|
this.flagAuthorizationMetaDataOnSessionChange();
|
|
59640
59777
|
this.uriService = new UriService(this.store);
|
|
59778
|
+
this.profileGateway = new ProfileGateway(this.store);
|
|
59641
59779
|
}
|
|
59642
59780
|
/*
|
|
59643
59781
|
Flagging authorization metadata is necessary every time the user
|
|
@@ -59697,13 +59835,7 @@ _:patch
|
|
|
59697
59835
|
* @param webId
|
|
59698
59836
|
*/
|
|
59699
59837
|
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;
|
|
59838
|
+
return this.profileGateway.fetchProfile(webId);
|
|
59707
59839
|
}
|
|
59708
59840
|
/**
|
|
59709
59841
|
* 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
|
@@ -26,6 +26,7 @@ export * from "./terms";
|
|
|
26
26
|
export * from "./Store";
|
|
27
27
|
export * from "./uri";
|
|
28
28
|
export * from "./problems";
|
|
29
|
+
export * from "./type-index";
|
|
29
30
|
export interface PodOsConfiguration {
|
|
30
31
|
offlineCache?: OfflineCache;
|
|
31
32
|
onlineStatus?: OnlineStatus;
|
|
@@ -40,6 +41,7 @@ export declare class PodOS {
|
|
|
40
41
|
private readonly searchGateway;
|
|
41
42
|
private readonly pictureGateway;
|
|
42
43
|
private readonly offlineCache;
|
|
44
|
+
private readonly profileGateway;
|
|
43
45
|
constructor({ session, offlineCache, onlineStatus, internalStore, }?: PodOsConfiguration);
|
|
44
46
|
private flagAuthorizationMetaDataOnSessionChange;
|
|
45
47
|
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
|
+
}
|