source: Klonkt/src/services/guardianship/index.js@ c26cc18

main
Last change on this file since c26cc18 was 6b5d7da, checked in by Robin Genis <roboburr@…>, 7 weeks ago

Guardianship als eigen module + gedeelde BlocklistService

FEP-633c (Guardians) lag verspreid door ActivityPubService; nu is het één
cohesief onderdeel in src/services/guardianship/ met submodules. De
blocklist staat er bewust NAAST (BlocklistService): die wordt gedeeld met
Klonkt zelf (Block-tab) en is niet guardianship-specifiek.

De module importeert ActivityPubService nooit terug: de AP-helpers gaan er
één keer in via wireDelivery/wireHandshake, en de service delegeert met
dunne wrappers zodat elke bestaande aanroep blijft werken.

Naast de verhuizing ook de serverkant die nog miste (shaer-bh1): de
ap_guardianships-relaties, shaer:guardians/isGuardian/queues op het
actor-doc, en de adoptie-handshake Offer/Accept/Reject over C2S en S2S,
met het contract van de Shaer test-daemon zodat de iOS/Android-clients het
ongewijzigd spreken. Een inkomend hulpverzoek (shaer:helpRequest op een
directe mention) krijgt een eigen vlag in ap_mentions en pusht als
'help'-type richting de Guardian-PWA (volgende commit).

Changed files:
src/services/ActivityPubService.js

  • shaer-context, actor-props en helpRequest uit de module gespread
  • blocklist-functies zijn delegaties naar BlocklistService
  • c2sVisibility/deliverDirectNote re-export uit guardianship/delivery
  • C2S: Offer/Accept/Reject eerst langs de handshake-module
  • S2S: Offer aan GATED (signature-eis) + handshake-routering
  • inbound mention: help_request-vlag + 'help'/'guardian'-push-events

src/config/database.js

  • tabel ap_guardianships (slug, role, other_uri, status, offer_id)
  • kolom ap_mentions.help_request

test/activitypub-as2.test.js

  • shaer:queues/offers/follows/wards in de AS2-allowlist

New file:
src/services/BlocklistService.js

  • ap_blocks-opslag, blockTarget/unblock/listBlocks/isBlockedAny, purge; handle-resolver via injectie (geen circulaire import)

src/services/guardianship/index.js

  • de publieke API van het onderdeel

src/services/guardianship/context.js

  • shaer-namespace + Relationship-vocabulaire

src/services/guardianship/relations.js

  • ap_guardianships-API + actor-props (FEP-633c paragraaf 2)

src/services/guardianship/handshake.js

src/services/guardianship/queues.js

src/services/guardianship/notes.js

  • shaer:helpRequest lezen/schrijven

src/services/guardianship/delivery.js

  • de directe-note-route (call-for-help), gedrag ongewijzigd

remarks: alle 158 tests groen. push-teksten (push.n_help_*, push.n_guard_*)
en de queue-routes + Guardian-PWA volgen in de volgende commits.

-robo
Co-Authored-By: Claude Opus 4.8 <noreply@…>

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/**
2 * Guardianship (FEP-633c "Guardians") — the module.
3 *
4 * Klonkt's kid-safety feature as one cohesive unit:
5 * - context.js: the shaer JSON-LD namespace + Relationship vocabulary
6 * - relations.js: ward ↔ guardian relations (ap_guardianships) + actor props
7 * - handshake.js: the adoption Offer/Accept/Reject over C2S and S2S
8 * - queues.js: the owner-only dashboard collections (offers/follows/wards)
9 * - notes.js: the shaer:helpRequest flag on direct notes
10 * - delivery.js: the direct-note leg a ward's call-for-help rides
11 *
12 * The shared blocklist (Shaer's "in Orbit") intentionally lives NEXT TO this
13 * module in BlocklistService: Klonkt's own Block tab uses it too.
14 *
15 * ActivityPubService wires the AP helpers in once (wireDelivery/wireHandshake)
16 * and delegates; nothing here imports ActivityPubService back.
17 */
18export { SHAER_CONTEXT, GUARDIAN_RELATIONSHIP, GUARDIAN_RELATIONSHIP_COMPACT, isGuardianRelationship } from './context.js';
19export { helpRequestProps, isHelpRequest } from './notes.js';
20export { wireDelivery, c2sVisibility, deliverDirectNote } from './delivery.js';
21export { wireHandshake, handleOutbox as handleGuardianshipOutbox, handleInbox as handleGuardianshipInbox, parseRelationship } from './handshake.js';
22export { offersCollection, followsCollection, wardsCollection } from './queues.js';
23export {
24 listGuardians, listWards, listOffers, isGuardian, getRelation, findByOfferId,
25 recordOffer, acceptRelation, removeRelation, actorProps as guardianshipActorProps,
26} from './relations.js';
Note: See TracBrowser for help on using the repository browser.