// Package atproto provides constants for XRPC endpoint paths used throughout ATCR. // // This package serves as a single source of truth for all XRPC endpoint URLs, // preventing typos and making refactoring easier. All endpoint paths follow the // XRPC/Lexicon naming convention: /xrpc/{namespace}.{method} package atproto // Hold service multipart upload endpoints (io.atcr.hold.*) // // These endpoints handle OCI blob uploads to hold services (BYOS storage). const ( // HoldInitiateUpload starts a new multipart upload session. // Method: POST // Request: {"digest": "sha256:..."} // Response: {"uploadId": "..."} HoldInitiateUpload = "/xrpc/io.atcr.hold.initiateUpload" // HoldGetPartUploadURL gets a presigned URL or endpoint info for uploading a specific part. // Method: POST // Request: {"uploadId": "...", "partNumber": 1} // Response: {"url": "...", "method": "PUT", "headers": {...}} HoldGetPartUploadURL = "/xrpc/io.atcr.hold.getPartUploadUrl" // HoldUploadPart handles direct buffered part uploads (alternative to presigned URLs). // Method: PUT // Headers: X-Upload-Id, X-Part-Number // Body: raw part data // Response: {"etag": "..."} HoldUploadPart = "/xrpc/io.atcr.hold.uploadPart" // HoldCompleteUpload finalizes a multipart upload and moves blob to final location. // Method: POST // Request: {"uploadId": "...", "digest": "sha256:...", "parts": [{...}]} // Response: {"status": "completed", "digest": "..."} HoldCompleteUpload = "/xrpc/io.atcr.hold.completeUpload" // HoldAbortUpload cancels a multipart upload and cleans up temporary data. // Method: POST // Request: {"uploadId": "..."} // Response: {"status": "aborted"} HoldAbortUpload = "/xrpc/io.atcr.hold.abortUpload" // HoldNotifyManifest notifies hold about a manifest upload for layer tracking and Bluesky posting. // Method: POST // Request: {"repository": "...", "tag": "...", "userDid": "...", "userHandle": "...", "manifest": {...}} // Response: {"success": true, "layersCreated": 5, "postCreated": true, "postUri": "at://..."} HoldNotifyManifest = "/xrpc/io.atcr.hold.notifyManifest" // HoldSetStats sets absolute stats values for a repository (used by migration). // Method: POST // Request: {"ownerDid": "...", "repository": "...", "pullCount": 10, "pushCount": 5, "lastPull": "...", "lastPush": "..."} // Response: {"success": true} HoldSetStats = "/xrpc/io.atcr.hold.setStats" ) // Hold service crew management endpoints (io.atcr.hold.*) // // These endpoints manage access control for hold services via crew membership. const ( // HoldRequestCrew requests crew membership for a hold service. // Method: POST // Request: OAuth-authenticated request with DPoP // Response: {"status": "pending"|"approved"} HoldRequestCrew = "/xrpc/io.atcr.hold.requestCrew" // Future: HoldDelegateAccess = "/xrpc/io.atcr.hold.delegateAccess" ) // ATProto sync endpoints (com.atproto.sync.*) // // Standard AT Protocol synchronization endpoints for PDS interoperability. const ( // SyncGetBlob retrieves a blob (or presigned URL) from a repository. // Method: GET // Query: did={did}&cid={cid}&method={GET|HEAD} // Response: {"url": "..."} or blob data SyncGetBlob = "/xrpc/com.atproto.sync.getBlob" // SyncGetRepo downloads a full repository or diff as a CAR file. // Method: GET // Query: did={did}&since={rev} // Response: CAR file (application/vnd.ipld.car) SyncGetRepo = "/xrpc/com.atproto.sync.getRepo" // SyncGetRecord retrieves a specific record as part of a repository sync. // Method: GET // Query: did={did}&collection={collection}&rkey={key} // Response: Record data SyncGetRecord = "/xrpc/com.atproto.sync.getRecord" // SyncListRepos lists all repositories on a PDS. // Method: GET // Response: {"repos": [{...}]} SyncListRepos = "/xrpc/com.atproto.sync.listRepos" // SyncListReposByCollection lists all repositories that have records in a specific collection. // Method: GET // Query: collection={collection}&limit={limit}&cursor={cursor} // Response: {"repos": [{"did": "..."}], "cursor": "..."} SyncListReposByCollection = "/xrpc/com.atproto.sync.listReposByCollection" // SyncSubscribeRepos subscribes to real-time repository events via WebSocket. // Method: GET (WebSocket upgrade) // Response: Stream of #commit events SyncSubscribeRepos = "/xrpc/com.atproto.sync.subscribeRepos" // SyncGetRepoStatus gets the hosting status for a repository. // Method: GET // Query: did={did} // Response: {"did": "...", "active": true, "rev": "..."} SyncGetRepoStatus = "/xrpc/com.atproto.sync.getRepoStatus" // SyncRequestCrawl requests a relay to crawl a PDS. // Method: POST // Request: {"hostname": "hold01.atcr.io"} // Response: {} SyncRequestCrawl = "/xrpc/com.atproto.sync.requestCrawl" ) // ATProto server endpoints (com.atproto.server.*) // // Standard AT Protocol server management and authentication endpoints. const ( // ServerGetServiceAuth gets a service auth token for inter-service communication. // Method: GET // Query: aud={serviceDID}&lxm={lexicon} // Response: {"token": "..."} ServerGetServiceAuth = "/xrpc/com.atproto.server.getServiceAuth" // ServerDescribeServer returns server metadata and capabilities. // Method: GET // Response: {"did": "...", "availableUserDomains": [...]} ServerDescribeServer = "/xrpc/com.atproto.server.describeServer" // ServerCreateSession creates a new session with identifier and password. // Method: POST // Request: {"identifier": "...", "password": "..."} // Response: {"accessJwt": "...", "refreshJwt": "...", "did": "...", "handle": "..."} ServerCreateSession = "/xrpc/com.atproto.server.createSession" // ServerRefreshSession refreshes an existing session using a refresh token. // Method: POST // Headers: Authorization (Bearer ) // Response: {"accessJwt": "...", "refreshJwt": "...", "did": "...", "handle": "..."} ServerRefreshSession = "/xrpc/com.atproto.server.refreshSession" // ServerGetSession validates a session and returns the current session info. // Method: GET // Headers: Authorization (Bearer or DPoP), DPoP (if using DPoP) // Response: {"did": "...", "handle": "..."} ServerGetSession = "/xrpc/com.atproto.server.getSession" ) // ATProto repo endpoints (com.atproto.repo.*) // // Standard AT Protocol repository management endpoints. const ( // RepoDescribeRepo describes a repository's structure and metadata. // Method: GET // Query: repo={did} // Response: {"did": "...", "handle": "...", "collections": [...]} RepoDescribeRepo = "/xrpc/com.atproto.repo.describeRepo" // RepoPutRecord creates or updates a record in a repository. // Method: POST // Request: {"repo": "...", "collection": "...", "rkey": "...", "record": {...}} // Response: {"uri": "...", "cid": "..."} RepoPutRecord = "/xrpc/com.atproto.repo.putRecord" // RepoGetRecord retrieves a record from a repository. // Method: GET // Query: repo={did}&collection={collection}&rkey={key} // Response: {"uri": "...", "cid": "...", "value": {...}} RepoGetRecord = "/xrpc/com.atproto.repo.getRecord" // RepoListRecords lists records in a collection. // Method: GET // Query: repo={did}&collection={collection}&limit={limit}&cursor={cursor} // Response: {"records": [...], "cursor": "..."} RepoListRecords = "/xrpc/com.atproto.repo.listRecords" // RepoDeleteRecord deletes a record from a repository. // Method: POST // Query: repo={did}&collection={collection}&rkey={key} // Response: {} RepoDeleteRecord = "/xrpc/com.atproto.repo.deleteRecord" // RepoUploadBlob uploads a blob to a repository (standard ATProto endpoint). // Method: POST // Body: blob data // Response: {"blob": {"$type": "blob", "ref": {...}, "mimeType": "...", "size": ...}} // Note: For OCI container layer uploads, ATCR uses io.atcr.hold.* multipart endpoints instead. RepoUploadBlob = "/xrpc/com.atproto.repo.uploadBlob" ) // ATProto identity endpoints (com.atproto.identity.*) // // Standard AT Protocol identity resolution endpoints. const ( // IdentityResolveHandle resolves a handle to a DID. // Method: GET // Query: handle={handle} // Response: {"did": "did:plc:..."} IdentityResolveHandle = "/xrpc/com.atproto.identity.resolveHandle" ) // Bluesky app endpoints (app.bsky.actor.*) // // Bluesky-specific actor/profile endpoints. const ( // ActorGetProfile retrieves an aggregated profile for an actor. // Method: GET // Query: actor={did|handle} // Response: {"did": "...", "handle": "...", "displayName": "...", "postsCount": ...} ActorGetProfile = "/xrpc/app.bsky.actor.getProfile" // ActorGetProfiles retrieves aggregated profiles for multiple actors. // Method: GET // Query: actors={did|handle}&actors={did|handle}... // Response: {"profiles": [{...}, {...}]} ActorGetProfiles = "/xrpc/app.bsky.actor.getProfiles" )