@pod-os/core 0.12.1-7d2693a.0 → 0.12.1-e864b4f.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.
@@ -4,11 +4,11 @@ import {
4
4
  lit,
5
5
  namedNode,
6
6
  st
7
- } from "./chunk-GBIS3SJI.js";
7
+ } from "./chunk-7C7N3OSJ.js";
8
8
  import {
9
9
  __commonJS,
10
10
  __toESM
11
- } from "./chunk-U67V476Y.js";
11
+ } from "./chunk-5NEDDTD5.js";
12
12
 
13
13
  // ../node_modules/short-unique-id/dist/short-unique-id.js
14
14
  var require_short_unique_id = __commonJS({
@@ -731,63 +731,6 @@ var PreferencesQuery = class {
731
731
  }
732
732
  };
733
733
 
734
- // ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/renameContact.js
735
- function renameContact(store, contactNode, newName) {
736
- const deletions = store.statementsMatching(contactNode, vcard("fn"), null, null);
737
- const insertions = deletions.map((it) => st(it.subject, it.predicate, lit(newName), it.graph));
738
- return {
739
- uri: "",
740
- insertions,
741
- deletions,
742
- filesToCreate: []
743
- };
744
- }
745
-
746
- // ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/addAddressBookToTypeIndex.js
747
- function addAddressBookToTypeIndex(typeIndexDoc, addressBookUri) {
748
- const registrationNode = namedNode(`${typeIndexDoc.value}#${generateId()}`);
749
- return {
750
- deletions: [],
751
- filesToCreate: [],
752
- insertions: [
753
- st(registrationNode, rdf("type"), solid("TypeRegistration"), typeIndexDoc),
754
- st(registrationNode, solid("forClass"), vcard("AddressBook"), typeIndexDoc),
755
- st(registrationNode, solid("instance"), namedNode(addressBookUri), typeIndexDoc)
756
- ],
757
- uri: ""
758
- };
759
- }
760
-
761
- // ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/updatePhoneNumber.js
762
- function updatePhoneNumber(phoneNumberNode, newPhoneNumber, store) {
763
- const oldValue = store.any(phoneNumberNode, vcard("value"));
764
- const deletions = oldValue ? [st(phoneNumberNode, vcard("value"), oldValue, phoneNumberNode.doc())] : [];
765
- const insertions = [
766
- st(phoneNumberNode, vcard("value"), namedNode("tel:" + newPhoneNumber), phoneNumberNode.doc())
767
- ];
768
- return {
769
- uri: "",
770
- insertions,
771
- deletions,
772
- filesToCreate: []
773
- };
774
- }
775
-
776
- // ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/updateEmailAddress.js
777
- function updateEmailAddress(emailAddressNode, newEmailAddress, store) {
778
- const oldValue = store.any(emailAddressNode, vcard("value"));
779
- const deletions = oldValue ? [st(emailAddressNode, vcard("value"), oldValue, emailAddressNode.doc())] : [];
780
- const insertions = [
781
- st(emailAddressNode, vcard("value"), namedNode("mailto:" + newEmailAddress), emailAddressNode.doc())
782
- ];
783
- return {
784
- uri: "",
785
- insertions,
786
- deletions,
787
- filesToCreate: []
788
- };
789
- }
790
-
791
734
  // ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/ContactsModuleRdfLib.js
792
735
  var ContactsModuleRdfLib = class {
793
736
  constructor(config) {
@@ -822,26 +765,11 @@ var ContactsModuleRdfLib = class {
822
765
  async fetchAll(nodes) {
823
766
  return Promise.all(nodes.map((it) => this.fetchNode(it)));
824
767
  }
825
- async createAddressBook({ containerUri, name, ownerWebId }) {
768
+ async createAddressBook({ containerUri, name }) {
826
769
  const operation = createAddressBook(containerUri, name);
827
770
  await executeUpdate(this.fetcher, this.updater, operation);
828
- if (ownerWebId) {
829
- await this.updatePrivateTypeIndex(ownerWebId, operation.uri);
830
- }
831
771
  return operation.uri;
832
772
  }
833
- async updatePrivateTypeIndex(ownerWebId, addressBookUri) {
834
- const profileNode = namedNode(ownerWebId);
835
- await this.fetchNode(profileNode);
836
- const profileQuery = new ProfileQuery(profileNode, this.store);
837
- const preferencesFile = profileQuery.queryPreferencesFile();
838
- const privateTypeIndex = await this.fetchPrivateTypeIndex(profileNode, preferencesFile);
839
- if (!privateTypeIndex) {
840
- throw new Error(`Private type not found for WebID ${ownerWebId}.`);
841
- }
842
- const operation = addAddressBookToTypeIndex(privateTypeIndex, addressBookUri);
843
- await executeUpdate(this.fetcher, this.updater, operation);
844
- }
845
773
  async createNewContact({ addressBookUri, contact, groupUris }) {
846
774
  const contactQuery = await this.executeCreateNewContact(addressBookUri, contact);
847
775
  await this.executeAddContactToGroups(groupUris, contactQuery);
@@ -942,18 +870,6 @@ var ContactsModuleRdfLib = class {
942
870
  const operation = removeEmailAddress(contactNode, emailAddressNode, this.store);
943
871
  await executeUpdate(this.fetcher, this.updater, operation);
944
872
  }
945
- async updatePhoneNumber({ phoneNumberUri, newPhoneNumber }) {
946
- const phoneNumberNode = namedNode(phoneNumberUri);
947
- await this.fetchNode(phoneNumberNode);
948
- const operation = updatePhoneNumber(phoneNumberNode, newPhoneNumber, this.store);
949
- await executeUpdate(this.fetcher, this.updater, operation);
950
- }
951
- async updateEmailAddress({ emailAddressUri, newEmailAddress }) {
952
- const emailAddressNode = namedNode(emailAddressUri);
953
- await this.fetchNode(emailAddressNode);
954
- const operation = updateEmailAddress(emailAddressNode, newEmailAddress, this.store);
955
- await executeUpdate(this.fetcher, this.updater, operation);
956
- }
957
873
  async listAddressBooks(webId) {
958
874
  const profileNode = namedNode(webId);
959
875
  await this.fetchNode(profileNode);
@@ -987,12 +903,6 @@ var ContactsModuleRdfLib = class {
987
903
  const preferencesQuery = new PreferencesQuery(this.store, profileNode, preferencesFile);
988
904
  return preferencesQuery.queryPrivateTypeIndex();
989
905
  }
990
- async renameContact({ contactUri, newName }) {
991
- const contactNode = namedNode(contactUri);
992
- await this.fetchNode(contactNode);
993
- const operation = renameContact(this.store, contactNode, newName);
994
- await executeUpdate(this.fetcher, this.updater, operation);
995
- }
996
906
  };
997
907
 
998
908
  // ../node_modules/@solid-data-modules/contacts-rdflib/dist/index.js