@pod-os/core 0.23.1-rc.d5481ff.0 → 0.24.0-rc.47722fb.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 +265 -63
- package/lib/index.js +278 -71
- package/package.json +1 -1
- package/types/attachments/AttachmentGateway.d.ts +23 -0
- package/types/attachments/index.d.ts +1 -0
- package/types/files/FileFetcher.d.ts +3 -0
- package/types/files/FileGateway.d.ts +26 -0
- package/types/files/FileGateway.spec.d.ts +1 -0
- package/types/files/createFileLinkOperation.d.ts +13 -0
- package/types/files/createFileLinkOperation.spec.d.ts +1 -0
- package/types/files/index.d.ts +1 -0
- package/types/index.d.ts +13 -3
- package/types/namespaces/index.d.ts +2 -0
- package/types/picture/PictureGateway.d.ts +6 -7
- package/types/picture/index.d.ts +0 -1
- package/types/profile/ProfileGateway.d.ts +10 -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/thing/Thing.attachments.spec.d.ts +1 -0
- package/types/thing/Thing.d.ts +8 -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 +30 -0
- package/types/type-index/index.d.ts +2 -0
- package/types/picture/createPictureLinkOperation.d.ts +0 -12
- /package/types/{picture/createPictureLinkOperation.spec.d.ts → attachments/AttachmentGateway.spec.d.ts} +0 -0
package/dist/index.js
CHANGED
|
@@ -4492,11 +4492,11 @@ var FileFetcher = class {
|
|
|
4492
4492
|
}
|
|
4493
4493
|
};
|
|
4494
4494
|
|
|
4495
|
-
// src/
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4495
|
+
// src/namespaces/index.ts
|
|
4496
|
+
var rdfs = Namespace("http://www.w3.org/2000/01/rdf-schema#");
|
|
4497
|
+
var pim = Namespace("http://www.w3.org/ns/pim/space#");
|
|
4498
|
+
var schema = Namespace("https://schema.org/");
|
|
4499
|
+
var flow = Namespace("http://www.w3.org/2005/01/wf/flow#");
|
|
4500
4500
|
|
|
4501
4501
|
// src/thing/accumulateSubjects.ts
|
|
4502
4502
|
var accumulateSubjects = (accumulator, current3) => {
|
|
@@ -4720,6 +4720,19 @@ var Thing = class {
|
|
|
4720
4720
|
label: labelForType(uri6)
|
|
4721
4721
|
}));
|
|
4722
4722
|
}
|
|
4723
|
+
/**
|
|
4724
|
+
* Returns all attachments linked to this thing
|
|
4725
|
+
*/
|
|
4726
|
+
attachments() {
|
|
4727
|
+
const statements = this.store.statementsMatching(
|
|
4728
|
+
namedNode(this.uri),
|
|
4729
|
+
flow("attachment")
|
|
4730
|
+
);
|
|
4731
|
+
return statements.filter((it) => isNamedNode(it.object)).map((statement2) => ({
|
|
4732
|
+
uri: statement2.object.value,
|
|
4733
|
+
label: labelFromUri(statement2.object.value)
|
|
4734
|
+
}));
|
|
4735
|
+
}
|
|
4723
4736
|
/**
|
|
4724
4737
|
* Call this method to switch to a more specific subclass of Thing.
|
|
4725
4738
|
*
|
|
@@ -4762,16 +4775,15 @@ var LdpContainer = class extends Thing {
|
|
|
4762
4775
|
}
|
|
4763
4776
|
};
|
|
4764
4777
|
|
|
4765
|
-
// src/
|
|
4766
|
-
|
|
4767
|
-
function createPictureLinkOperation(thing, file2) {
|
|
4778
|
+
// src/files/createFileLinkOperation.ts
|
|
4779
|
+
function createFileLinkOperation(thing, predicateUri, file2) {
|
|
4768
4780
|
return {
|
|
4769
4781
|
deletions: [],
|
|
4770
4782
|
filesToCreate: [],
|
|
4771
4783
|
insertions: [
|
|
4772
4784
|
st(
|
|
4773
4785
|
namedNode(thing.uri),
|
|
4774
|
-
namedNode(
|
|
4786
|
+
namedNode(predicateUri),
|
|
4775
4787
|
namedNode(file2.url),
|
|
4776
4788
|
namedNode(thing.uri).doc()
|
|
4777
4789
|
)
|
|
@@ -4779,32 +4791,33 @@ function createPictureLinkOperation(thing, file2) {
|
|
|
4779
4791
|
};
|
|
4780
4792
|
}
|
|
4781
4793
|
|
|
4782
|
-
// src/
|
|
4783
|
-
var
|
|
4794
|
+
// src/files/FileGateway.ts
|
|
4795
|
+
var FileGateway = class {
|
|
4784
4796
|
constructor(store, fileFetcher) {
|
|
4785
4797
|
this.store = store;
|
|
4786
4798
|
this.fileFetcher = fileFetcher;
|
|
4787
4799
|
}
|
|
4788
4800
|
/**
|
|
4789
|
-
* Uploads a
|
|
4801
|
+
* Uploads a file and associates it with a thing.
|
|
4790
4802
|
* The container is automatically derived from the thing's URI.
|
|
4791
4803
|
* Uses schema:image as the predicate.
|
|
4792
4804
|
*
|
|
4793
|
-
* @param thing - The thing to add the
|
|
4794
|
-
* @param
|
|
4795
|
-
* @
|
|
4805
|
+
* @param thing - The thing to add the file to
|
|
4806
|
+
* @param predicateUri - The URI of the predicate to use
|
|
4807
|
+
* @param fileToUpload - The file to upload
|
|
4808
|
+
* @returns Result with the uploaded metadata (url, name, contentType) or error
|
|
4796
4809
|
*/
|
|
4797
|
-
|
|
4810
|
+
uploadAndLinkFile(thing, predicateUri, fileToUpload) {
|
|
4798
4811
|
const container2 = this.getContainerFromThing(thing);
|
|
4799
|
-
return this.fileFetcher.createNewFile(container2,
|
|
4812
|
+
return this.fileFetcher.createNewFile(container2, fileToUpload).andThen((file2) => this.linkFileToThing(thing, predicateUri, file2));
|
|
4800
4813
|
}
|
|
4801
|
-
|
|
4802
|
-
const operation3 =
|
|
4814
|
+
linkFileToThing(thing, predicateUri, file2) {
|
|
4815
|
+
const operation3 = createFileLinkOperation(thing, predicateUri, file2);
|
|
4803
4816
|
return ResultAsync.fromPromise(
|
|
4804
4817
|
this.store.executeUpdate(operation3).then(() => file2),
|
|
4805
4818
|
() => ({
|
|
4806
4819
|
type: "network",
|
|
4807
|
-
title: "Failed to link
|
|
4820
|
+
title: "Failed to link file to thing"
|
|
4808
4821
|
})
|
|
4809
4822
|
);
|
|
4810
4823
|
}
|
|
@@ -4813,6 +4826,129 @@ var PictureGateway = class {
|
|
|
4813
4826
|
}
|
|
4814
4827
|
};
|
|
4815
4828
|
|
|
4829
|
+
// src/modules/contacts.ts
|
|
4830
|
+
async function loadContactsModule(store) {
|
|
4831
|
+
const module2 = await import("./dist-O5YU2L4C.js");
|
|
4832
|
+
return store.loadModule(module2);
|
|
4833
|
+
}
|
|
4834
|
+
|
|
4835
|
+
// src/attachments/AttachmentGateway.ts
|
|
4836
|
+
var AttachmentGateway = class {
|
|
4837
|
+
constructor(fileGateway) {
|
|
4838
|
+
this.fileGateway = fileGateway;
|
|
4839
|
+
}
|
|
4840
|
+
/**
|
|
4841
|
+
* Uploads an attachment file and associates it with a thing.
|
|
4842
|
+
* The container is automatically derived from the thing's URI.
|
|
4843
|
+
* Uses flow:attachment as the predicate.
|
|
4844
|
+
*
|
|
4845
|
+
* @param thing - The thing to add the attachment to
|
|
4846
|
+
* @param attachmentFile - The attachment file to upload
|
|
4847
|
+
* @returns Result with the uploaded attachment metadata (url, name, contentType) or error
|
|
4848
|
+
*/
|
|
4849
|
+
uploadAndAddAttachment(thing, attachmentFile) {
|
|
4850
|
+
return this.fileGateway.uploadAndLinkFile(
|
|
4851
|
+
thing,
|
|
4852
|
+
"http://www.w3.org/2005/01/wf/flow#attachment",
|
|
4853
|
+
attachmentFile
|
|
4854
|
+
);
|
|
4855
|
+
}
|
|
4856
|
+
};
|
|
4857
|
+
|
|
4858
|
+
// src/picture/PictureGateway.ts
|
|
4859
|
+
var PictureGateway = class {
|
|
4860
|
+
constructor(attachmentGateway) {
|
|
4861
|
+
this.attachmentGateway = attachmentGateway;
|
|
4862
|
+
}
|
|
4863
|
+
/**
|
|
4864
|
+
* Uploads a picture file and associates it with a thing.
|
|
4865
|
+
* The container is automatically derived from the thing's URI.
|
|
4866
|
+
* Uses schema:image as the predicate.
|
|
4867
|
+
*
|
|
4868
|
+
* @param thing - The thing to add the picture to
|
|
4869
|
+
* @param pictureFile - The picture file to upload
|
|
4870
|
+
* @returns Result with the uploaded picture metadata (url, name, contentType) or error
|
|
4871
|
+
*/
|
|
4872
|
+
uploadAndAddPicture(thing, pictureFile) {
|
|
4873
|
+
return this.attachmentGateway.uploadAndLinkFile(
|
|
4874
|
+
thing,
|
|
4875
|
+
"http://schema.org/image",
|
|
4876
|
+
pictureFile
|
|
4877
|
+
);
|
|
4878
|
+
}
|
|
4879
|
+
};
|
|
4880
|
+
|
|
4881
|
+
// node_modules/@solid-data-modules/rdflib-utils/dist/web-operations/executeUpdate.js
|
|
4882
|
+
async function executeUpdate(fetcher, updater, operation3) {
|
|
4883
|
+
await updater.updateMany(operation3.deletions, operation3.insertions);
|
|
4884
|
+
operation3.filesToCreate.map((file2) => {
|
|
4885
|
+
createEmptyTurtleFile(fetcher, file2.url);
|
|
4886
|
+
});
|
|
4887
|
+
}
|
|
4888
|
+
function createEmptyTurtleFile(fetcher, url7) {
|
|
4889
|
+
return fetcher.webOperation("PUT", url7, {
|
|
4890
|
+
contentType: "text/turtle"
|
|
4891
|
+
});
|
|
4892
|
+
}
|
|
4893
|
+
|
|
4894
|
+
// node_modules/@solid-data-modules/rdflib-utils/dist/namespaces/index.js
|
|
4895
|
+
var rdf = Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#");
|
|
4896
|
+
var solid = Namespace("http://www.w3.org/ns/solid/terms#");
|
|
4897
|
+
var pim2 = Namespace("http://www.w3.org/ns/pim/space#");
|
|
4898
|
+
var ldp = Namespace("http://www.w3.org/ns/ldp#");
|
|
4899
|
+
|
|
4900
|
+
// node_modules/@solid-data-modules/rdflib-utils/dist/queries/PreferencesQuery.js
|
|
4901
|
+
var PreferencesQuery = class {
|
|
4902
|
+
constructor(store, webIdNode, preferencesDoc) {
|
|
4903
|
+
this.store = store;
|
|
4904
|
+
this.webIdNode = webIdNode;
|
|
4905
|
+
this.preferencesDoc = preferencesDoc;
|
|
4906
|
+
}
|
|
4907
|
+
/**
|
|
4908
|
+
* Look up the private type index. Returns null if none is found or if the predicated does not link to a proper named node
|
|
4909
|
+
*/
|
|
4910
|
+
queryPrivateTypeIndex() {
|
|
4911
|
+
const node3 = this.store.any(this.webIdNode, solid("privateTypeIndex"), null, this.preferencesDoc);
|
|
4912
|
+
if (isNamedNode(node3)) {
|
|
4913
|
+
return node3;
|
|
4914
|
+
}
|
|
4915
|
+
return null;
|
|
4916
|
+
}
|
|
4917
|
+
};
|
|
4918
|
+
|
|
4919
|
+
// node_modules/@solid-data-modules/rdflib-utils/dist/queries/ProfileQuery.js
|
|
4920
|
+
var ProfileQuery = class {
|
|
4921
|
+
constructor(webIdNode, store) {
|
|
4922
|
+
this.webIdNode = webIdNode;
|
|
4923
|
+
this.store = store;
|
|
4924
|
+
}
|
|
4925
|
+
/**
|
|
4926
|
+
* Look up the public type index. Returns null if none is found or if the predicated does not link to a proper named node
|
|
4927
|
+
*/
|
|
4928
|
+
queryPublicTypeIndex() {
|
|
4929
|
+
const predicate4 = solid("publicTypeIndex");
|
|
4930
|
+
return this.queryNamedNode(predicate4);
|
|
4931
|
+
}
|
|
4932
|
+
/**
|
|
4933
|
+
* Look up the preferences file. Returns null if none is found or if the predicated does not link to a proper named node
|
|
4934
|
+
*/
|
|
4935
|
+
queryPreferencesFile() {
|
|
4936
|
+
const predicate4 = pim2("preferencesFile");
|
|
4937
|
+
return this.queryNamedNode(predicate4);
|
|
4938
|
+
}
|
|
4939
|
+
queryNamedNode(predicate4) {
|
|
4940
|
+
const node3 = this.store.any(this.webIdNode, predicate4, null, this.webIdNode.doc());
|
|
4941
|
+
if (isNamedNode(node3)) {
|
|
4942
|
+
return node3;
|
|
4943
|
+
}
|
|
4944
|
+
return null;
|
|
4945
|
+
}
|
|
4946
|
+
};
|
|
4947
|
+
|
|
4948
|
+
// node_modules/@solid-data-modules/rdflib-utils/dist/identifier/generate-id.js
|
|
4949
|
+
var import_short_unique_id = __toESM(require_short_unique_id(), 1);
|
|
4950
|
+
var uid = new import_short_unique_id.default({ length: 10 });
|
|
4951
|
+
|
|
4816
4952
|
// src/profile/WebIdProfile.ts
|
|
4817
4953
|
var WebIdProfile = class extends Thing {
|
|
4818
4954
|
constructor(webId, store, editable = false) {
|
|
@@ -4820,17 +4956,32 @@ var WebIdProfile = class extends Thing {
|
|
|
4820
4956
|
this.webId = webId;
|
|
4821
4957
|
this.store = store;
|
|
4822
4958
|
this.editable = editable;
|
|
4959
|
+
this.profileQuery = new ProfileQuery(namedNode(this.webId), this.store);
|
|
4823
4960
|
}
|
|
4824
4961
|
/**
|
|
4825
|
-
* Returns
|
|
4962
|
+
* Returns the URI of the preferences document
|
|
4826
4963
|
*/
|
|
4827
4964
|
getPreferencesFile() {
|
|
4828
|
-
return this.
|
|
4965
|
+
return this.profileQuery.queryPreferencesFile()?.value;
|
|
4966
|
+
}
|
|
4967
|
+
/**
|
|
4968
|
+
* Returns the URI of the public type index document
|
|
4969
|
+
*/
|
|
4970
|
+
getPublicTypeIndex() {
|
|
4971
|
+
return this.profileQuery.queryPublicTypeIndex()?.value;
|
|
4972
|
+
}
|
|
4973
|
+
/**
|
|
4974
|
+
* Returns the URI of the private type index document
|
|
4975
|
+
*/
|
|
4976
|
+
getPrivateTypeIndex() {
|
|
4977
|
+
const preferences = this.profileQuery.queryPreferencesFile();
|
|
4978
|
+
if (!preferences) return void 0;
|
|
4979
|
+
const query4 = new PreferencesQuery(
|
|
4980
|
+
this.store,
|
|
4829
4981
|
namedNode(this.webId),
|
|
4830
|
-
|
|
4831
|
-
void 0,
|
|
4832
|
-
namedNode(this.webId).doc()
|
|
4982
|
+
preferences
|
|
4833
4983
|
);
|
|
4984
|
+
return query4.queryPrivateTypeIndex()?.value;
|
|
4834
4985
|
}
|
|
4835
4986
|
/**
|
|
4836
4987
|
* Returns the URIs of the private label indexes
|
|
@@ -4857,6 +5008,31 @@ var WebIdProfile = class extends Thing {
|
|
|
4857
5008
|
}
|
|
4858
5009
|
};
|
|
4859
5010
|
|
|
5011
|
+
// src/profile/ProfileGateway.ts
|
|
5012
|
+
var ProfileGateway = class {
|
|
5013
|
+
constructor(store) {
|
|
5014
|
+
this.store = store;
|
|
5015
|
+
}
|
|
5016
|
+
async fetchProfile(webId) {
|
|
5017
|
+
await this.store.fetch(webId);
|
|
5018
|
+
const profile2 = this.store.get(webId).assume(WebIdProfile);
|
|
5019
|
+
const preferences = profile2.getPreferencesFile();
|
|
5020
|
+
if (preferences) {
|
|
5021
|
+
try {
|
|
5022
|
+
await this.store.fetch(preferences);
|
|
5023
|
+
} catch (error4) {
|
|
5024
|
+
console.warn(`Failed to fetch preferences file ${preferences}:`, error4);
|
|
5025
|
+
}
|
|
5026
|
+
}
|
|
5027
|
+
const publicTypeIndex2 = profile2.getPublicTypeIndex();
|
|
5028
|
+
const privateTypeIndex2 = profile2.getPrivateTypeIndex();
|
|
5029
|
+
await this.store.fetchAll(
|
|
5030
|
+
[privateTypeIndex2, publicTypeIndex2].filter((it) => it !== void 0)
|
|
5031
|
+
);
|
|
5032
|
+
return profile2;
|
|
5033
|
+
}
|
|
5034
|
+
};
|
|
5035
|
+
|
|
4860
5036
|
// src/search/SearchIndex.ts
|
|
4861
5037
|
var import_lunr = __toESM(require_lunr(), 1);
|
|
4862
5038
|
var SearchIndex = class {
|
|
@@ -4936,10 +5112,6 @@ var RdfDocument = class extends Thing {
|
|
|
4936
5112
|
}
|
|
4937
5113
|
};
|
|
4938
5114
|
|
|
4939
|
-
// src/namespaces/index.ts
|
|
4940
|
-
var rdfs = Namespace("http://www.w3.org/2000/01/rdf-schema#");
|
|
4941
|
-
var pim = Namespace("http://www.w3.org/ns/pim/space#");
|
|
4942
|
-
|
|
4943
5115
|
// src/search/LabelIndex.ts
|
|
4944
5116
|
var LabelIndex = class extends RdfDocument {
|
|
4945
5117
|
constructor(uri6, store, editable = false) {
|
|
@@ -4970,29 +5142,6 @@ var LabelIndex = class extends RdfDocument {
|
|
|
4970
5142
|
}
|
|
4971
5143
|
};
|
|
4972
5144
|
|
|
4973
|
-
// node_modules/@solid-data-modules/rdflib-utils/dist/web-operations/executeUpdate.js
|
|
4974
|
-
async function executeUpdate(fetcher, updater, operation3) {
|
|
4975
|
-
await updater.updateMany(operation3.deletions, operation3.insertions);
|
|
4976
|
-
operation3.filesToCreate.map((file2) => {
|
|
4977
|
-
createEmptyTurtleFile(fetcher, file2.url);
|
|
4978
|
-
});
|
|
4979
|
-
}
|
|
4980
|
-
function createEmptyTurtleFile(fetcher, url7) {
|
|
4981
|
-
return fetcher.webOperation("PUT", url7, {
|
|
4982
|
-
contentType: "text/turtle"
|
|
4983
|
-
});
|
|
4984
|
-
}
|
|
4985
|
-
|
|
4986
|
-
// node_modules/@solid-data-modules/rdflib-utils/dist/namespaces/index.js
|
|
4987
|
-
var rdf = Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#");
|
|
4988
|
-
var solid = Namespace("http://www.w3.org/ns/solid/terms#");
|
|
4989
|
-
var pim2 = Namespace("http://www.w3.org/ns/pim/space#");
|
|
4990
|
-
var ldp = Namespace("http://www.w3.org/ns/ldp#");
|
|
4991
|
-
|
|
4992
|
-
// node_modules/@solid-data-modules/rdflib-utils/dist/identifier/generate-id.js
|
|
4993
|
-
var import_short_unique_id = __toESM(require_short_unique_id(), 1);
|
|
4994
|
-
var uid = new import_short_unique_id.default({ length: 10 });
|
|
4995
|
-
|
|
4996
5145
|
// src/search/createDefaultLabelIndex.ts
|
|
4997
5146
|
function createDefaultLabelIndex(profile2) {
|
|
4998
5147
|
const webId = namedNode(profile2.webId);
|
|
@@ -5302,7 +5451,7 @@ __export(index_es_exports, {
|
|
|
5302
5451
|
rdf: () => rdf2,
|
|
5303
5452
|
rdfs: () => rdfs2,
|
|
5304
5453
|
sched: () => sched,
|
|
5305
|
-
schema: () =>
|
|
5454
|
+
schema: () => schema2,
|
|
5306
5455
|
schema_https: () => schema_https,
|
|
5307
5456
|
sec: () => sec,
|
|
5308
5457
|
shacl: () => shacl,
|
|
@@ -26556,7 +26705,7 @@ var trip3 = tripImport;
|
|
|
26556
26705
|
var rdf2 = rdfImport;
|
|
26557
26706
|
var rdfs2 = rdfsImport;
|
|
26558
26707
|
var sched = schedImport;
|
|
26559
|
-
var
|
|
26708
|
+
var schema2 = schemaImport;
|
|
26560
26709
|
var schema_https = schema_httpsImport;
|
|
26561
26710
|
var sec = secImport;
|
|
26562
26711
|
var shacl = shaclImport;
|
|
@@ -26628,6 +26777,52 @@ var AnonymousSession = class {
|
|
|
26628
26777
|
}
|
|
26629
26778
|
};
|
|
26630
26779
|
|
|
26780
|
+
// src/type-index/TypeIndex.ts
|
|
26781
|
+
var TypeIndex2 = class extends Thing {
|
|
26782
|
+
constructor(uri6, store, editable = false) {
|
|
26783
|
+
super(uri6, store, editable);
|
|
26784
|
+
this.uri = uri6;
|
|
26785
|
+
this.store = store;
|
|
26786
|
+
this.editable = editable;
|
|
26787
|
+
}
|
|
26788
|
+
listAll() {
|
|
26789
|
+
const forClassStatements = this.store.statementsMatching(
|
|
26790
|
+
null,
|
|
26791
|
+
solid("forClass"),
|
|
26792
|
+
null,
|
|
26793
|
+
namedNode(this.uri)
|
|
26794
|
+
);
|
|
26795
|
+
return forClassStatements.map((statement2) => {
|
|
26796
|
+
const subject8 = statement2.subject;
|
|
26797
|
+
const instanceContainerStatements = this.store.statementsMatching(
|
|
26798
|
+
subject8,
|
|
26799
|
+
solid("instanceContainer"),
|
|
26800
|
+
null,
|
|
26801
|
+
namedNode(this.uri)
|
|
26802
|
+
);
|
|
26803
|
+
const instanceStatements = this.store.statementsMatching(
|
|
26804
|
+
subject8,
|
|
26805
|
+
solid("instance"),
|
|
26806
|
+
null,
|
|
26807
|
+
namedNode(this.uri)
|
|
26808
|
+
);
|
|
26809
|
+
const instances2 = instanceStatements.map((it) => ({
|
|
26810
|
+
type: "instance",
|
|
26811
|
+
uri: it.object.value
|
|
26812
|
+
}));
|
|
26813
|
+
const instanceContainers = instanceContainerStatements.map((it) => ({
|
|
26814
|
+
type: "container",
|
|
26815
|
+
uri: it.object.value
|
|
26816
|
+
}));
|
|
26817
|
+
return {
|
|
26818
|
+
targets: [...instanceContainers, ...instances2],
|
|
26819
|
+
forClass: statement2.object.value,
|
|
26820
|
+
label: labelForType(statement2.object.value)
|
|
26821
|
+
};
|
|
26822
|
+
});
|
|
26823
|
+
}
|
|
26824
|
+
};
|
|
26825
|
+
|
|
26631
26826
|
// src/index.ts
|
|
26632
26827
|
var PodOS = class {
|
|
26633
26828
|
constructor({
|
|
@@ -26646,9 +26841,12 @@ var PodOS = class {
|
|
|
26646
26841
|
);
|
|
26647
26842
|
this.searchGateway = new SearchGateway(this.store);
|
|
26648
26843
|
this.fileFetcher = new FileFetcher(this.session);
|
|
26649
|
-
this.
|
|
26844
|
+
this.fileGateway = new FileGateway(this.store, this.fileFetcher);
|
|
26845
|
+
this.attachmentGateway = new AttachmentGateway(this.fileGateway);
|
|
26846
|
+
this.pictureGateway = new PictureGateway(this.fileGateway);
|
|
26650
26847
|
this.flagAuthorizationMetaDataOnSessionChange();
|
|
26651
26848
|
this.uriService = new UriService(this.store);
|
|
26849
|
+
this.profileGateway = new ProfileGateway(this.store);
|
|
26652
26850
|
}
|
|
26653
26851
|
/*
|
|
26654
26852
|
Flagging authorization metadata is necessary every time the user
|
|
@@ -26708,13 +26906,7 @@ var PodOS = class {
|
|
|
26708
26906
|
* @param webId
|
|
26709
26907
|
*/
|
|
26710
26908
|
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;
|
|
26909
|
+
return this.profileGateway.fetchProfile(webId);
|
|
26718
26910
|
}
|
|
26719
26911
|
/**
|
|
26720
26912
|
* Fetch the private label index for the given profile and build a search index from it
|
|
@@ -26761,13 +26953,22 @@ var PodOS = class {
|
|
|
26761
26953
|
uploadAndAddPicture(thing, pictureFile) {
|
|
26762
26954
|
return this.pictureGateway.uploadAndAddPicture(thing, pictureFile);
|
|
26763
26955
|
}
|
|
26956
|
+
/**
|
|
26957
|
+
* Provides access to attachment operations such as uploading and linking attachments to things
|
|
26958
|
+
* @returns {AttachmentGateway} An instance of AttachmentGateway that handles attachment operations
|
|
26959
|
+
*/
|
|
26960
|
+
attachments() {
|
|
26961
|
+
return this.attachmentGateway;
|
|
26962
|
+
}
|
|
26764
26963
|
};
|
|
26765
26964
|
export {
|
|
26766
26965
|
AnonymousSession,
|
|
26767
26966
|
AssumeAlwaysOnline,
|
|
26967
|
+
AttachmentGateway,
|
|
26768
26968
|
BinaryFile,
|
|
26769
26969
|
BrokenFile,
|
|
26770
26970
|
FileFetcher,
|
|
26971
|
+
FileGateway,
|
|
26771
26972
|
HttpStatus,
|
|
26772
26973
|
LabelIndex,
|
|
26773
26974
|
LdpContainer,
|
|
@@ -26775,14 +26976,15 @@ export {
|
|
|
26775
26976
|
OfflineCapableFetcher,
|
|
26776
26977
|
PictureGateway,
|
|
26777
26978
|
PodOS,
|
|
26979
|
+
ProfileGateway,
|
|
26778
26980
|
RdfDocument,
|
|
26779
26981
|
SearchGateway,
|
|
26780
26982
|
SearchIndex,
|
|
26781
26983
|
Store,
|
|
26782
26984
|
Thing,
|
|
26985
|
+
TypeIndex2 as TypeIndex,
|
|
26783
26986
|
UriService,
|
|
26784
26987
|
WebIdProfile,
|
|
26785
|
-
createPictureLinkOperation,
|
|
26786
26988
|
httpProblem,
|
|
26787
26989
|
labelFromUri,
|
|
26788
26990
|
listKnownTerms,
|