From bf636d698a6b249cbb4090f6a7d69139e128a652 Mon Sep 17 00:00:00 2001 From: mary <148872143+mary-ext@users.noreply.github.com> Date: Sun, 16 Nov 2025 18:59:30 +0700 Subject: [PATCH] add lexicon documents --- .../blue.microcosm/links/getBacklinks.json | 95 ++++++++++++++++++ .../links/getManyToManyCounts.json | 99 +++++++++++++++++++ .../identity/resolveMiniDoc.json | 56 +++++++++++ .../com.bad-example/repo/getUriRecord.json | 54 ++++++++++ 4 files changed, 304 insertions(+) create mode 100644 lexicons/blue.microcosm/links/getBacklinks.json create mode 100644 lexicons/blue.microcosm/links/getManyToManyCounts.json create mode 100644 lexicons/com.bad-example/identity/resolveMiniDoc.json create mode 100644 lexicons/com.bad-example/repo/getUriRecord.json diff --git a/lexicons/blue.microcosm/links/getBacklinks.json b/lexicons/blue.microcosm/links/getBacklinks.json new file mode 100644 index 0000000..ec6c511 --- /dev/null +++ b/lexicons/blue.microcosm/links/getBacklinks.json @@ -0,0 +1,95 @@ +{ + "lexicon": 1, + "id": "blue.microcosm.links.getBacklinks", + "defs": { + "main": { + "type": "query", + "description": "a list of records linking to any record, identity, or uri", + "parameters": { + "type": "params", + "required": [ + "subject", + "source" + ], + "properties": { + "subject": { + "type": "string", + "format": "uri", + "description": "the target being linked to (at-uri, did, or uri)" + }, + "source": { + "type": "string", + "description": "collection and path specification (e.g., 'app.bsky.feed.like:subject.uri')" + }, + "did": { + "type": "array", + "description": "filter links to those from specific users", + "items": { + "type": "string", + "format": "did" + } + }, + "limit": { + "type": "integer", + "minimum": 1, + "maximum": 100, + "default": 16, + "description": "number of results to return" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "total", + "records" + ], + "properties": { + "total": { + "type": "integer", + "description": "total number of matching links" + }, + "records": { + "type": "array", + "items": { + "type": "ref", + "ref": "#linkRecord" + } + }, + "cursor": { + "type": "string", + "description": "pagination cursor" + } + } + } + } + }, + "linkRecord": { + "type": "object", + "required": [ + "did", + "collection", + "rkey" + ], + "properties": { + "did": { + "type": "string", + "format": "did", + "description": "the DID of the linking record's repository" + }, + "collection": { + "type": "string", + "format": "nsid", + "description": "the collection of the linking record" + }, + "rkey": { + "type": "string", + "format": "record-key", + "description": "the record key of the linking record" + } + } + } + } +} diff --git a/lexicons/blue.microcosm/links/getManyToManyCounts.json b/lexicons/blue.microcosm/links/getManyToManyCounts.json new file mode 100644 index 0000000..c918d3a --- /dev/null +++ b/lexicons/blue.microcosm/links/getManyToManyCounts.json @@ -0,0 +1,99 @@ +{ + "lexicon": 1, + "id": "blue.microcosm.links.getManyToManyCounts", + "defs": { + "main": { + "type": "query", + "description": "count many-to-many relationships with secondary link paths", + "parameters": { + "type": "params", + "required": [ + "subject", + "source", + "pathToOther" + ], + "properties": { + "subject": { + "type": "string", + "format": "uri", + "description": "the primary target being linked to (at-uri, did, or uri)" + }, + "source": { + "type": "string", + "description": "collection and path specification for the primary link" + }, + "pathToOther": { + "type": "string", + "description": "path to the secondary link in the many-to-many record (e.g., 'otherThing.uri')" + }, + "did": { + "type": "array", + "description": "filter links to those from specific users", + "items": { + "type": "string", + "format": "did" + } + }, + "otherSubject": { + "type": "array", + "description": "filter secondary links to specific subjects", + "items": { + "type": "string" + } + }, + "limit": { + "type": "integer", + "minimum": 1, + "maximum": 100, + "default": 16, + "description": "number of results to return" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "counts_by_other_subject" + ], + "properties": { + "counts_by_other_subject": { + "type": "array", + "items": { + "type": "ref", + "ref": "#countBySubject" + } + }, + "cursor": { + "type": "string", + "description": "pagination cursor" + } + } + } + } + }, + "countBySubject": { + "type": "object", + "required": [ + "subject", + "total", + "distinct" + ], + "properties": { + "subject": { + "type": "string", + "description": "the secondary subject being counted" + }, + "total": { + "type": "integer", + "description": "total number of links to this subject" + }, + "distinct": { + "type": "integer", + "description": "number of distinct DIDs linking to this subject" + } + } + } + } +} diff --git a/lexicons/com.bad-example/identity/resolveMiniDoc.json b/lexicons/com.bad-example/identity/resolveMiniDoc.json new file mode 100644 index 0000000..89daf48 --- /dev/null +++ b/lexicons/com.bad-example/identity/resolveMiniDoc.json @@ -0,0 +1,56 @@ +{ + "lexicon": 1, + "id": "com.bad-example.identity.resolveMiniDoc", + "defs": { + "main": { + "type": "query", + "description": "like com.atproto.identity.resolveIdentity but instead of the full didDoc it returns an atproto-relevant subset", + "parameters": { + "type": "params", + "required": [ + "identifier" + ], + "properties": { + "identifier": { + "type": "string", + "format": "at-identifier", + "description": "handle or DID to resolve" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "did", + "handle", + "pds", + "signing_key" + ], + "properties": { + "did": { + "type": "string", + "format": "did", + "description": "DID, bi-directionally verified if a handle was provided in the query" + }, + "handle": { + "type": "string", + "format": "handle", + "description": "the validated handle of the account or 'handle.invalid' if the handle did not bi-directionally match the DID document" + }, + "pds": { + "type": "string", + "format": "uri", + "description": "the identity's PDS URL" + }, + "signing_key": { + "type": "string", + "description": "the atproto signing key publicKeyMultibase" + } + } + } + } + } + } +} diff --git a/lexicons/com.bad-example/repo/getUriRecord.json b/lexicons/com.bad-example/repo/getUriRecord.json new file mode 100644 index 0000000..379be72 --- /dev/null +++ b/lexicons/com.bad-example/repo/getUriRecord.json @@ -0,0 +1,54 @@ +{ + "lexicon": 1, + "id": "com.bad-example.repo.getUriRecord", + "defs": { + "main": { + "type": "query", + "description": "ergonomic complement to com.atproto.repo.getRecord which accepts an at-uri instead of individual repo/collection/rkey params", + "parameters": { + "type": "params", + "required": [ + "at_uri" + ], + "properties": { + "at_uri": { + "type": "string", + "format": "at-uri", + "description": "the at-uri of the record (identifier can be a DID or handle)" + }, + "cid": { + "type": "string", + "format": "cid", + "description": "optional CID of the version of the record. if not specified, return the most recent version. if specified and a newer version exists, returns 404." + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "uri", + "value" + ], + "properties": { + "uri": { + "type": "string", + "format": "at-uri", + "description": "at-uri for this record" + }, + "cid": { + "type": "string", + "format": "cid", + "description": "CID for this exact version of the record" + }, + "value": { + "type": "unknown", + "description": "the record itself" + } + } + } + } + } + } +} -- 2.51.2