at main 167 lines 7.0 kB view raw
1{ 2 "lexicon": 1, 3 "id": "sh.weaver.collab.defs", 4 "defs": { 5 "notebook": { 6 "type": "token", 7 "description": "Collaboration scoped to an entire notebook." 8 }, 9 "entry": { 10 "type": "token", 11 "description": "Collaboration scoped to a single entry." 12 }, 13 "chapter": { 14 "type": "token", 15 "description": "Collaboration scoped to a chapter." 16 }, 17 "inviteView": { 18 "type": "object", 19 "description": "Hydrated view of a collaboration invite with status.", 20 "required": ["uri", "cid", "inviter", "invitee", "resource", "createdAt", "status"], 21 "properties": { 22 "uri": { "type": "string", "format": "at-uri" }, 23 "cid": { "type": "string", "format": "cid" }, 24 "inviter": { "type": "ref", "ref": "sh.weaver.actor.defs#profileViewBasic" }, 25 "invitee": { "type": "ref", "ref": "sh.weaver.actor.defs#profileViewBasic" }, 26 "resource": { "type": "ref", "ref": "com.atproto.repo.strongRef" }, 27 "resourceTitle": { "type": "string" }, 28 "scope": { 29 "type": "string", 30 "knownValues": ["notebook", "entry", "chapter"] 31 }, 32 "message": { "type": "string" }, 33 "createdAt": { "type": "string", "format": "datetime" }, 34 "expiresAt": { "type": "string", "format": "datetime" }, 35 "status": { 36 "type": "string", 37 "knownValues": ["pending", "accepted", "expired", "revoked"] 38 }, 39 "acceptUri": { "type": "string", "format": "at-uri" }, 40 "acceptedAt": { "type": "string", "format": "datetime" } 41 } 42 }, 43 "sessionView": { 44 "type": "object", 45 "description": "Active real-time collaboration session.", 46 "required": ["uri", "user", "resource", "nodeId", "createdAt"], 47 "properties": { 48 "uri": { "type": "string", "format": "at-uri" }, 49 "user": { "type": "ref", "ref": "sh.weaver.actor.defs#profileViewBasic" }, 50 "resource": { "type": "ref", "ref": "com.atproto.repo.strongRef" }, 51 "nodeId": { "type": "string" }, 52 "relayUrl": { "type": "string", "format": "uri" }, 53 "createdAt": { "type": "string", "format": "datetime" }, 54 "expiresAt": { "type": "string", "format": "datetime" } 55 } 56 }, 57 "collaborationStateView": { 58 "type": "object", 59 "description": "Full state of a collaboration relationship including version reconciliation. Tracks both current and former collaborators.", 60 "required": ["resource", "status", "participants"], 61 "properties": { 62 "resource": { "type": "ref", "ref": "com.atproto.repo.strongRef" }, 63 "canonicalUri": { 64 "type": "string", 65 "format": "at-uri", 66 "description": "The 'canonical' version URI (usually owner's)" 67 }, 68 "status": { 69 "type": "string", 70 "knownValues": ["active", "broken", "diverged", "reconciled"], 71 "description": "active=normal, broken=all invites revoked/expired, diverged=versions differ, reconciled=was diverged but resolved" 72 }, 73 "participants": { 74 "type": "array", 75 "items": { "type": "ref", "ref": "#participantStateView" }, 76 "description": "Current active + invited participants" 77 }, 78 "formerParticipants": { 79 "type": "array", 80 "items": { "type": "ref", "ref": "#formerCollaboratorView" }, 81 "description": "People who used to collaborate but relationship ended" 82 }, 83 "publishedVersions": { 84 "type": "array", 85 "items": { "type": "ref", "ref": "sh.weaver.notebook.defs#publishedVersionView" } 86 }, 87 "hasDivergence": { "type": "boolean" }, 88 "hasFormerCollaborators": { "type": "boolean" }, 89 "hasOrphanedVersions": { 90 "type": "boolean", 91 "description": "Published versions from former collaborators still exist" 92 }, 93 "lastSyncedAt": { "type": "string", "format": "datetime" }, 94 "createdAt": { "type": "string", "format": "datetime" }, 95 "firstCollaboratorAddedAt": { "type": "string", "format": "datetime" } 96 } 97 }, 98 "participantStateView": { 99 "type": "object", 100 "description": "Individual participant's state in a collaboration. Distinguishes 'was collaborator' vs 'never was'.", 101 "required": ["user", "role", "status"], 102 "properties": { 103 "user": { "type": "ref", "ref": "sh.weaver.actor.defs#profileViewBasic" }, 104 "role": { 105 "type": "string", 106 "knownValues": ["owner", "collaborator", "former_collaborator"] 107 }, 108 "status": { 109 "type": "string", 110 "knownValues": ["active", "invited", "left", "removed", "expired"], 111 "description": "active=can edit, invited=pending, left=voluntarily departed, removed=invite revoked, expired=invite timed out" 112 }, 113 "wasCollaborator": { 114 "type": "boolean", 115 "description": "True if they ever had active collaboration status" 116 }, 117 "inviteUri": { "type": "string", "format": "at-uri" }, 118 "acceptUri": { 119 "type": "string", 120 "format": "at-uri", 121 "description": "If they accepted (even if later broken)" 122 }, 123 "publishedVersion": { 124 "type": "ref", 125 "ref": "com.atproto.repo.strongRef", 126 "description": "Their published copy if any" 127 }, 128 "firstEditAt": { 129 "type": "string", 130 "format": "datetime", 131 "description": "When they first contributed" 132 }, 133 "lastEditAt": { "type": "string", "format": "datetime" }, 134 "relationshipEndedAt": { 135 "type": "string", 136 "format": "datetime", 137 "description": "When left/removed/expired" 138 }, 139 "endReason": { 140 "type": "string", 141 "knownValues": ["voluntary_leave", "invite_revoked", "invite_expired", "owner_deleted_resource"], 142 "description": "Why the relationship ended, if applicable" 143 } 144 } 145 }, 146 "formerCollaboratorView": { 147 "type": "object", 148 "description": "Lightweight view for 'this person used to collaborate but doesn't anymore'.", 149 "required": ["user", "wasActiveFrom", "wasActiveUntil", "endReason"], 150 "properties": { 151 "user": { "type": "ref", "ref": "sh.weaver.actor.defs#profileViewBasic" }, 152 "wasActiveFrom": { "type": "string", "format": "datetime" }, 153 "wasActiveUntil": { "type": "string", "format": "datetime" }, 154 "endReason": { 155 "type": "string", 156 "knownValues": ["voluntary_leave", "invite_revoked", "invite_expired", "owner_deleted_resource"] 157 }, 158 "contributionCount": { 159 "type": "integer", 160 "description": "Number of diffs they created while active" 161 }, 162 "hasPublishedVersion": { "type": "boolean" }, 163 "publishedVersionUri": { "type": "string", "format": "at-uri" } 164 } 165 } 166 } 167}