From b52db4c05dc005a65ec678c0c7bd0fe688c0c021 Mon Sep 17 00:00:00 2001 From: Niels Mokkenstorm Date: Wed, 15 Jul 2026 00:04:59 +0200 Subject: [PATCH] style(lexicons): reformat sdl with the fixed inline-object printer --- .../microcosm/identity/resolveMiniDoc.sdl | 15 ++++++--- .../blue/microcosm/links/getBacklinks.sdl | 10 ++++-- lexicons/com/atproto/repo/createRecord.sdl | 28 ++++++++++++----- lexicons/com/atproto/repo/deleteRecord.sdl | 18 +++++++---- lexicons/com/atproto/repo/getRecord.sdl | 6 +++- lexicons/com/atproto/repo/listRecords.sdl | 5 ++- lexicons/com/atproto/repo/putRecord.sdl | 31 +++++++++++++------ .../crate/catalog/adoptRelease.sdl | 18 +++++++---- .../crate/catalog/applyEditProposal.sdl | 16 +++++++--- .../mokkenstorm/crate/discogs/getStatus.sdl | 7 +++-- .../crate/discogs/resolveBarcode.sdl | 12 ++++--- .../crate/discogs/searchReleases.sdl | 6 +++- .../mokkenstorm/crate/server/getSession.sdl | 8 +++-- .../dev/mokkenstorm/crate/shelf/addEntry.sdl | 30 +++++++++++++++--- .../mokkenstorm/crate/shelf/amendEntry.sdl | 19 +++++++++--- .../mokkenstorm/crate/shelf/appendEvent.sdl | 18 +++++++++-- .../dev/mokkenstorm/crate/shelf/getEntry.sdl | 10 ++++-- .../mokkenstorm/crate/shelf/listEntries.sdl | 8 +++-- .../mokkenstorm/crate/shelf/purgeEntry.sdl | 6 ++-- .../mokkenstorm/crate/shelf/uploadCover.sdl | 5 ++- 20 files changed, 203 insertions(+), 73 deletions(-) diff --git a/lexicons/blue/microcosm/identity/resolveMiniDoc.sdl b/lexicons/blue/microcosm/identity/resolveMiniDoc.sdl index 5593e48..eaaf4c1 100644 --- a/lexicons/blue/microcosm/identity/resolveMiniDoc.sdl +++ b/lexicons/blue/microcosm/identity/resolveMiniDoc.sdl @@ -1,7 +1,12 @@ /// like com.atproto.identity.resolveIdentity but instead of the full DID Doc, returns an atproto-relevant subset query resolveMiniDoc(identifier: AtIdentifier! @description("handle or DID to resolve")) @main - : { /// DID, bi-directionally verified if a handle was provided in the query -did: Did!, /// the validated handle of the account or 'handle.invalid' if the handle did not bi-directionally match the DID document -handle: Handle!, /// the identity's PDS URL -pds: Uri!, /// the atproto signing key publicKeyMultibase -signing_key: String! } + : { + /// DID, bi-directionally verified if a handle was provided in the query + did: Did! + /// the validated handle of the account or 'handle.invalid' if the handle did not bi-directionally match the DID document + handle: Handle! + /// the identity's PDS URL + pds: Uri! + /// the atproto signing key publicKeyMultibase + signing_key: String! + } diff --git a/lexicons/blue/microcosm/links/getBacklinks.sdl b/lexicons/blue/microcosm/links/getBacklinks.sdl index e89e681..31a04f8 100644 --- a/lexicons/blue/microcosm/links/getBacklinks.sdl +++ b/lexicons/blue/microcosm/links/getBacklinks.sdl @@ -9,6 +9,10 @@ type linkRecord { /// a list of records linking to any record, identity, or uri query getBacklinks(did: [String] @description("filter links to those from specific users"), limit: Int @description("number of results to return") @range(1, 100) @default(16), source: String! @description("collection and path specification (e.g., 'app.bsky.feed.like:subject.uri')"), subject: Uri! @description("the target being linked to (at-uri, did, or uri)")) @main - : { /// pagination cursor -cursor: String, records: [linkRecord]!, /// total number of matching links -total: Int! } + : { + /// pagination cursor + cursor: String + records: [linkRecord]! + /// total number of matching links + total: Int! + } diff --git a/lexicons/com/atproto/repo/createRecord.sdl b/lexicons/com/atproto/repo/createRecord.sdl index c84f991..5c8e2c4 100644 --- a/lexicons/com/atproto/repo/createRecord.sdl +++ b/lexicons/com/atproto/repo/createRecord.sdl @@ -1,13 +1,25 @@ /// Create a single new repository record. Requires auth, implemented by PDS. procedure createRecord() @main - accepts { /// The NSID of the record collection. -collection: Nsid!, /// The record itself. Must contain a $type field. -record: Unknown!, /// The handle or DID of the repo (aka, current account). -repo: AtIdentifier!, /// The Record Key. -rkey: RecordKey @len(max: 512), /// Compare and swap with the previous commit by CID. -swapCommit: Cid, /// Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons. -validate: Bool } - : { cid: Cid!, commit: com.atproto.repo.defs#commitMeta, uri: AtUri!, validationStatus: String @known("valid", "unknown") } + accepts { + /// The NSID of the record collection. + collection: Nsid! + /// The record itself. Must contain a $type field. + record: Unknown! + /// The handle or DID of the repo (aka, current account). + repo: AtIdentifier! + /// The Record Key. + rkey: RecordKey @len(max: 512) + /// Compare and swap with the previous commit by CID. + swapCommit: Cid + /// Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons. + validate: Bool + } + : { + cid: Cid! + commit: com.atproto.repo.defs#commitMeta + uri: AtUri! + validationStatus: String @known("valid", "unknown") + } throws { /// Indicates that 'swapCommit' didn't match current repo commit. InvalidSwap diff --git a/lexicons/com/atproto/repo/deleteRecord.sdl b/lexicons/com/atproto/repo/deleteRecord.sdl index 26a6524..a174d8c 100644 --- a/lexicons/com/atproto/repo/deleteRecord.sdl +++ b/lexicons/com/atproto/repo/deleteRecord.sdl @@ -1,10 +1,16 @@ /// Delete a repository record, or ensure it doesn't exist. Requires auth, implemented by PDS. procedure deleteRecord() @main - accepts { /// The NSID of the record collection. -collection: Nsid!, /// The handle or DID of the repo (aka, current account). -repo: AtIdentifier!, /// The Record Key. -rkey: RecordKey!, /// Compare and swap with the previous commit by CID. -swapCommit: Cid, /// Compare and swap with the previous record by CID. -swapRecord: Cid } + accepts { + /// The NSID of the record collection. + collection: Nsid! + /// The handle or DID of the repo (aka, current account). + repo: AtIdentifier! + /// The Record Key. + rkey: RecordKey! + /// Compare and swap with the previous commit by CID. + swapCommit: Cid + /// Compare and swap with the previous record by CID. + swapRecord: Cid + } : { commit: com.atproto.repo.defs#commitMeta } throws InvalidSwap diff --git a/lexicons/com/atproto/repo/getRecord.sdl b/lexicons/com/atproto/repo/getRecord.sdl index 290fb93..4d2fc64 100644 --- a/lexicons/com/atproto/repo/getRecord.sdl +++ b/lexicons/com/atproto/repo/getRecord.sdl @@ -1,4 +1,8 @@ /// Get a single record from a repository. Does not require auth. query getRecord(cid: Cid @description("The CID of the version of the record. If not specified, then return the most recent version."), collection: Nsid! @description("The NSID of the record collection."), repo: AtIdentifier! @description("The handle or DID of the repo."), rkey: RecordKey! @description("The Record Key.")) @main - : { cid: Cid, uri: AtUri!, value: Unknown! } + : { + cid: Cid + uri: AtUri! + value: Unknown! + } throws RecordNotFound diff --git a/lexicons/com/atproto/repo/listRecords.sdl b/lexicons/com/atproto/repo/listRecords.sdl index adb2083..9e1275d 100644 --- a/lexicons/com/atproto/repo/listRecords.sdl +++ b/lexicons/com/atproto/repo/listRecords.sdl @@ -1,6 +1,9 @@ /// List a range of records in a repository, matching a specific collection. Does not require auth. query listRecords(collection: Nsid! @description("The NSID of the record type."), cursor: String, limit: Int @description("The number of records to return.") @range(1, 100) @default(50), repo: AtIdentifier! @description("The handle or DID of the repo."), reverse: Bool @description("Flag to reverse the order of the returned records.")) @main - : { cursor: String, records: [recordEntry]! } + : { + cursor: String + records: [recordEntry]! + } type recordEntry { cid: Cid! diff --git a/lexicons/com/atproto/repo/putRecord.sdl b/lexicons/com/atproto/repo/putRecord.sdl index 00cea51..a810ba9 100644 --- a/lexicons/com/atproto/repo/putRecord.sdl +++ b/lexicons/com/atproto/repo/putRecord.sdl @@ -1,12 +1,25 @@ /// Write a repository record, creating or updating it as needed. Requires auth, implemented by PDS. procedure putRecord() @main - accepts { /// The NSID of the record collection. -collection: Nsid!, /// The record to write. -record: Unknown!, /// The handle or DID of the repo (aka, current account). -repo: AtIdentifier!, /// The Record Key. -rkey: RecordKey! @len(max: 512), /// Compare and swap with the previous commit by CID. -swapCommit: Cid, /// Compare and swap with the previous record by CID. WARNING: nullable and optional field; may cause problems with golang implementation -swapRecord: Cid @nullable, /// Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons. -validate: Bool } - : { cid: Cid!, commit: com.atproto.repo.defs#commitMeta, uri: AtUri!, validationStatus: String @known("valid", "unknown") } + accepts { + /// The NSID of the record collection. + collection: Nsid! + /// The record to write. + record: Unknown! + /// The handle or DID of the repo (aka, current account). + repo: AtIdentifier! + /// The Record Key. + rkey: RecordKey! @len(max: 512) + /// Compare and swap with the previous commit by CID. + swapCommit: Cid + /// Compare and swap with the previous record by CID. WARNING: nullable and optional field; may cause problems with golang implementation + swapRecord: Cid @nullable + /// Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons. + validate: Bool + } + : { + cid: Cid! + commit: com.atproto.repo.defs#commitMeta + uri: AtUri! + validationStatus: String @known("valid", "unknown") + } throws InvalidSwap diff --git a/lexicons/dev/mokkenstorm/crate/catalog/adoptRelease.sdl b/lexicons/dev/mokkenstorm/crate/catalog/adoptRelease.sdl index f7bd86d..58c3e20 100644 --- a/lexicons/dev/mokkenstorm/crate/catalog/adoptRelease.sdl +++ b/lexicons/dev/mokkenstorm/crate/catalog/adoptRelease.sdl @@ -1,8 +1,14 @@ /// Adopt a browsed catalog release into the caller's crate as a genesis shelf event. procedure adoptRelease() @main - accepts { /// Expected CID, re-verified against the live record before writing. -cid: Cid!, /// Defaults to owned when absent. -status: String @known("owned", "wanted"), /// at-uri of the catalog release to adopt. -uri: AtUri! } - : { /// TID of the genesis event that identifies the new entry. -entryId: String! } + accepts { + /// Expected CID, re-verified against the live record before writing. + cid: Cid! + /// Defaults to owned when absent. + status: String @known("owned", "wanted") + /// at-uri of the catalog release to adopt. + uri: AtUri! + } + : { + /// TID of the genesis event that identifies the new entry. + entryId: String! + } diff --git a/lexicons/dev/mokkenstorm/crate/catalog/applyEditProposal.sdl b/lexicons/dev/mokkenstorm/crate/catalog/applyEditProposal.sdl index ce2e6a8..8dc873a 100644 --- a/lexicons/dev/mokkenstorm/crate/catalog/applyEditProposal.sdl +++ b/lexicons/dev/mokkenstorm/crate/catalog/applyEditProposal.sdl @@ -1,7 +1,13 @@ /// Apply an edit proposal filed against one of the caller's own current catalog releases: mints a superseding release from the proposal's fields and re-points every shelf entry that referenced the old one. The proposal record itself is left untouched in the proposer's repo. procedure applyEditProposal() @main - accepts { /// Expected CID, re-verified against the live proposal record before applying. -cid: Cid!, /// at-uri of the catalog.edit proposal to apply. -uri: AtUri! } - : { releaseCid: Cid!, /// at-uri of the newly minted superseding catalog release. -releaseUri: AtUri! } + accepts { + /// Expected CID, re-verified against the live proposal record before applying. + cid: Cid! + /// at-uri of the catalog.edit proposal to apply. + uri: AtUri! + } + : { + releaseCid: Cid! + /// at-uri of the newly minted superseding catalog release. + releaseUri: AtUri! + } diff --git a/lexicons/dev/mokkenstorm/crate/discogs/getStatus.sdl b/lexicons/dev/mokkenstorm/crate/discogs/getStatus.sdl index 056cea7..a0b1798 100644 --- a/lexicons/dev/mokkenstorm/crate/discogs/getStatus.sdl +++ b/lexicons/dev/mokkenstorm/crate/discogs/getStatus.sdl @@ -1,4 +1,7 @@ /// Whether the caller has a connected Discogs account, and its username. query getStatus() @main - : { connected: Bool!, /// Present only when connected. -username: String } + : { + connected: Bool! + /// Present only when connected. + username: String + } diff --git a/lexicons/dev/mokkenstorm/crate/discogs/resolveBarcode.sdl b/lexicons/dev/mokkenstorm/crate/discogs/resolveBarcode.sdl index 491c66b..07dc645 100644 --- a/lexicons/dev/mokkenstorm/crate/discogs/resolveBarcode.sdl +++ b/lexicons/dev/mokkenstorm/crate/discogs/resolveBarcode.sdl @@ -1,9 +1,13 @@ /// Resolve a scanned barcode to its best Discogs release match, if any. query resolveBarcode(barcode: String!) @main - : { /// A release already known to the shared at-record catalog, found before any Discogs lookup was made. Present only on a network hit; when present, Discogs was never queried. -network: networkMatch, /// The best match, or null when the barcode resolves to nothing. -result: dev.mokkenstorm.crate.discogs.searchReleases#discogsRelease, /// Best-effort 'did you mean' candidates when the barcode itself resolved to nothing, ranked by descending confidence. Absent when there are none. -suggestions: [suggestion] } + : { + /// A release already known to the shared at-record catalog, found before any Discogs lookup was made. Present only on a network hit; when present, Discogs was never queried. + network: networkMatch + /// The best match, or null when the barcode resolves to nothing. + result: dev.mokkenstorm.crate.discogs.searchReleases#discogsRelease + /// Best-effort 'did you mean' candidates when the barcode itself resolved to nothing, ranked by descending confidence. Absent when there are none. + suggestions: [suggestion] + } /// A catalog release resolved from the shared at-record network for a scanned barcode, ahead of any Discogs lookup. type networkMatch { diff --git a/lexicons/dev/mokkenstorm/crate/discogs/searchReleases.sdl b/lexicons/dev/mokkenstorm/crate/discogs/searchReleases.sdl index 219333f..176fe69 100644 --- a/lexicons/dev/mokkenstorm/crate/discogs/searchReleases.sdl +++ b/lexicons/dev/mokkenstorm/crate/discogs/searchReleases.sdl @@ -11,4 +11,8 @@ type discogsRelease { /// Search Discogs for candidate releases to seed a crate entry. query searchReleases(artist: String @description("Optional Discogs artist filter, scopes results via the Discogs artist= param."), format: String @description("Optional Discogs format filter (e.g. Vinyl)."), page: Int @description("1-based page number; defaults to 1."), q: String!) @main - : { page: Int!, pages: Int!, results: [discogsRelease]! } + : { + page: Int! + pages: Int! + results: [discogsRelease]! + } diff --git a/lexicons/dev/mokkenstorm/crate/server/getSession.sdl b/lexicons/dev/mokkenstorm/crate/server/getSession.sdl index 35c1ef8..d6a1d41 100644 --- a/lexicons/dev/mokkenstorm/crate/server/getSession.sdl +++ b/lexicons/dev/mokkenstorm/crate/server/getSession.sdl @@ -1,4 +1,8 @@ /// The current session's identity, resolved from the auth cookie. query getSession() @main - : { /// Whether the caller's OAuth client is confidential. -confidential: Bool!, did: Did!, handle: Handle! } + : { + /// Whether the caller's OAuth client is confidential. + confidential: Bool! + did: Did! + handle: Handle! + } diff --git a/lexicons/dev/mokkenstorm/crate/shelf/addEntry.sdl b/lexicons/dev/mokkenstorm/crate/shelf/addEntry.sdl index c8b93c4..7dccf2e 100644 --- a/lexicons/dev/mokkenstorm/crate/shelf/addEntry.sdl +++ b/lexicons/dev/mokkenstorm/crate/shelf/addEntry.sdl @@ -1,7 +1,27 @@ /// Add a release to the crate by writing its genesis shelf event. procedure addEntry() @main - accepts { artist: String!, /// Who you acquired from / sold to. -counterparty: String @len(max: 2560) @graphemes(max: 256), coverUrl: Uri, /// When present, joins the shared catalog via adopt-or-mint promotion. -discogsId: String, folder: String @len(max: 1280) @graphemes(max: 128), format: String, mediaGrade: String, notes: String, price: dev.mokkenstorm.crate.defs#price, rating: Int @range(1, 5), sleeveGrade: String @known("M", "NM", "VG+", "VG", "G+", "G", "F", "P"), /// Defaults to owned when absent. -status: String @known("owned", "wanted"), thumbUrl: Uri, title: String!, year: Int } - : { cid: Cid!, entryId: String!, uri: AtUri! } + accepts { + artist: String! + /// Who you acquired from / sold to. + counterparty: String @len(max: 2560) @graphemes(max: 256) + coverUrl: Uri + /// When present, joins the shared catalog via adopt-or-mint promotion. + discogsId: String + folder: String @len(max: 1280) @graphemes(max: 128) + format: String + mediaGrade: String + notes: String + price: dev.mokkenstorm.crate.defs#price + rating: Int @range(1, 5) + sleeveGrade: String @known("M", "NM", "VG+", "VG", "G+", "G", "F", "P") + /// Defaults to owned when absent. + status: String @known("owned", "wanted") + thumbUrl: Uri + title: String! + year: Int + } + : { + cid: Cid! + entryId: String! + uri: AtUri! + } diff --git a/lexicons/dev/mokkenstorm/crate/shelf/amendEntry.sdl b/lexicons/dev/mokkenstorm/crate/shelf/amendEntry.sdl index 81a0ded..ecf03a6 100644 --- a/lexicons/dev/mokkenstorm/crate/shelf/amendEntry.sdl +++ b/lexicons/dev/mokkenstorm/crate/shelf/amendEntry.sdl @@ -1,6 +1,17 @@ /// Correct an entry's release fields, minting a new catalog release and re-pointing the entry via an updated event. procedure amendEntry() @main - accepts { country: String, entryId: String!, genres: [String], /// Re-fetch cover art from the release's own Discogs id. -refreshCover: Bool, released: String, styles: [String], title: String } - : { entryId: String!, /// at-uri of the newly minted catalog release the entry now points to. -releaseUri: AtUri! } + accepts { + country: String + entryId: String! + genres: [String] + /// Re-fetch cover art from the release's own Discogs id. + refreshCover: Bool + released: String + styles: [String] + title: String + } + : { + entryId: String! + /// at-uri of the newly minted catalog release the entry now points to. + releaseUri: AtUri! + } diff --git a/lexicons/dev/mokkenstorm/crate/shelf/appendEvent.sdl b/lexicons/dev/mokkenstorm/crate/shelf/appendEvent.sdl index 9c84563..4f24c54 100644 --- a/lexicons/dev/mokkenstorm/crate/shelf/appendEvent.sdl +++ b/lexicons/dev/mokkenstorm/crate/shelf/appendEvent.sdl @@ -1,5 +1,17 @@ /// Append an immutable action event (acquire, sell, regrade, rate, move, annotate, drop) to an entry. procedure appendEvent() @main - accepts { action: String! @known("acquired", "wanted", "regraded", "rated", "moved", "annotated", "sold", "dropped"), /// The genesis TID of the entry to append to. -entryId: String!, folder: String, mediaGrade: String, notes: String, rating: Int, sleeveGrade: String } - : { cid: Cid!, entryId: String!, uri: AtUri! } + accepts { + action: String! @known("acquired", "wanted", "regraded", "rated", "moved", "annotated", "sold", "dropped") + /// The genesis TID of the entry to append to. + entryId: String! + folder: String + mediaGrade: String + notes: String + rating: Int + sleeveGrade: String + } + : { + cid: Cid! + entryId: String! + uri: AtUri! + } diff --git a/lexicons/dev/mokkenstorm/crate/shelf/getEntry.sdl b/lexicons/dev/mokkenstorm/crate/shelf/getEntry.sdl index 02f630a..54aae01 100644 --- a/lexicons/dev/mokkenstorm/crate/shelf/getEntry.sdl +++ b/lexicons/dev/mokkenstorm/crate/shelf/getEntry.sdl @@ -1,8 +1,12 @@ /// The full event timeline for one entry, plus its resolved release fields. query getEntry(entry: String! @description("The entry's genesis TID.")) @main - : { entryId: String!, /// Every shelf event for the entry, oldest first. -events: [dev.mokkenstorm.crate.shelf.entry]!, /// Display fields from the resolved catalog release, omitted when unresolvable. -release: releaseInfo } + : { + entryId: String! + /// Every shelf event for the entry, oldest first. + events: [dev.mokkenstorm.crate.shelf.entry]! + /// Display fields from the resolved catalog release, omitted when unresolvable. + release: releaseInfo + } /// Display-relevant fields off a resolved catalog release. type releaseInfo { diff --git a/lexicons/dev/mokkenstorm/crate/shelf/listEntries.sdl b/lexicons/dev/mokkenstorm/crate/shelf/listEntries.sdl index cdd0c7d..ab4d793 100644 --- a/lexicons/dev/mokkenstorm/crate/shelf/listEntries.sdl +++ b/lexicons/dev/mokkenstorm/crate/shelf/listEntries.sdl @@ -17,5 +17,9 @@ type entry { /// The caller's folded crate for a view, one row per entry. query listEntries(view: String @description("Which slice of the crate to fold; defaults to owned.") @known("owned", "wanted", "all", "history")) @main - : { handle: Handle!, items: [entry]!, /// Map of entryId to the @handle of the foreign publisher an adopted release came from. -viaHandles: Unknown! } + : { + handle: Handle! + items: [entry]! + /// Map of entryId to the @handle of the foreign publisher an adopted release came from. + viaHandles: Unknown! + } diff --git a/lexicons/dev/mokkenstorm/crate/shelf/purgeEntry.sdl b/lexicons/dev/mokkenstorm/crate/shelf/purgeEntry.sdl index 6847dd9..cc730df 100644 --- a/lexicons/dev/mokkenstorm/crate/shelf/purgeEntry.sdl +++ b/lexicons/dev/mokkenstorm/crate/shelf/purgeEntry.sdl @@ -1,4 +1,6 @@ /// Delete every event of an entry, removing it from the crate. procedure purgeEntry() @main - accepts { /// The genesis TID of the entry to purge. -entryId: String! } + accepts { + /// The genesis TID of the entry to purge. + entryId: String! + } diff --git a/lexicons/dev/mokkenstorm/crate/shelf/uploadCover.sdl b/lexicons/dev/mokkenstorm/crate/shelf/uploadCover.sdl index d6a9c78..938b4ae 100644 --- a/lexicons/dev/mokkenstorm/crate/shelf/uploadCover.sdl +++ b/lexicons/dev/mokkenstorm/crate/shelf/uploadCover.sdl @@ -1,4 +1,7 @@ /// Upload a cover image for an entry as a cover-only amendment. procedure uploadCover(entry: String! @description("The entry's genesis TID.")) @main accepts Blob @encoding("multipart/form-data") @description("A single image file, at most 2MB.") - : { entryId: String!, releaseUri: AtUri! } + : { + entryId: String! + releaseUri: AtUri! + } -- 2.51.2