fedipod 1.48.0 → 1.48.1

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.
@@ -32999,6 +32999,33 @@ var PodTransport = class {
32999
32999
  await this.writeAboutWebId(podBase, { inserts: missing, deletes: stale });
33000
33000
  return true;
33001
33001
  }
33002
+ /**
33003
+ * The account taken out of the WebID profile again, as linkAccountInProfile
33004
+ * wrote it: the foaf:account link, what the profile says of the actor, and
33005
+ * `outbox` when it is the one named. From every document of the profile that
33006
+ * holds any of it, each write checked. Returns how many documents changed.
33007
+ */
33008
+ async unlinkAccountInProfile({ actorUrl, outbox = null }) {
33009
+ const me = namedNode2(this.webId);
33010
+ const actor = namedNode2(actorUrl);
33011
+ let changed = 0;
33012
+ for (const d of await this.profileDocs(podBaseOfWebId(this.webId))) {
33013
+ if (!d.g) continue;
33014
+ const gone = [
33015
+ ...d.g.statementsMatching(me, FOAF("account"), actor),
33016
+ ...d.g.statementsMatching(actor, RDF3("type"), FOAF("OnlineAccount")),
33017
+ ...d.g.statementsMatching(actor, RDF3("type"), AS("Person")),
33018
+ ...d.g.statementsMatching(actor, RDF3("type"), AS("Group")),
33019
+ ...d.g.statementsMatching(actor, FOAF("accountName"), null),
33020
+ ...outbox ? d.g.statementsMatching(me, AS("outbox"), namedNode2(outbox)) : []
33021
+ ].map((st2) => [st2.subject, st2.predicate, st2.object]);
33022
+ if (!gone.length) continue;
33023
+ const status = await this.writeRdfChecked(d.url, d.g, { deletes: gone, mustDescribe: d.profile ? this.webId : null });
33024
+ if (status >= 300) throw new Error(`not written: ${d.url} \u2192 ${status}`);
33025
+ changed++;
33026
+ }
33027
+ return changed;
33028
+ }
33002
33029
  /**
33003
33030
  * An N3 Patch of exactly these statements, or false when the pod will not
33004
33031
  * take one and the caller should write the document instead.