AT-based link agregator. Mirror of https://github.com/likeandscribe/frontpage

Publish lexicons (#158)

* WIP

* Add atproto submodule

* Remove submodule

* Fetch lexicons

* Run gen

* Migrate post creation to use client

* Remove unused file

* Remove frontpage diff

* Lockfile

* Add comment and vote

* Add typecheck script

authored by tom.sherman.is and committed by

GitHub ad5d8e1a adce439e

+3045 -5
+126
lexicons/com/atproto/repo/applyWrites.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.repo.applyWrites", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Apply a batch transaction of repository creates, updates, and deletes. Requires auth, implemented by PDS.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["repo", "writes"], 13 + "properties": { 14 + "repo": { 15 + "type": "string", 16 + "format": "at-identifier", 17 + "description": "The handle or DID of the repo (aka, current account)." 18 + }, 19 + "validate": { 20 + "type": "boolean", 21 + "description": "Can be set to 'false' to skip Lexicon schema validation of record data across all operations, 'true' to require it, or leave unset to validate only for known Lexicons." 22 + }, 23 + "writes": { 24 + "type": "array", 25 + "items": { 26 + "type": "union", 27 + "refs": ["#create", "#update", "#delete"], 28 + "closed": true 29 + } 30 + }, 31 + "swapCommit": { 32 + "type": "string", 33 + "description": "If provided, the entire operation will fail if the current repo commit CID does not match this value. Used to prevent conflicting repo mutations.", 34 + "format": "cid" 35 + } 36 + } 37 + } 38 + }, 39 + "output": { 40 + "encoding": "application/json", 41 + "schema": { 42 + "type": "object", 43 + "required": [], 44 + "properties": { 45 + "commit": { 46 + "type": "ref", 47 + "ref": "com.atproto.repo.defs#commitMeta" 48 + }, 49 + "results": { 50 + "type": "array", 51 + "items": { 52 + "type": "union", 53 + "refs": ["#createResult", "#updateResult", "#deleteResult"], 54 + "closed": true 55 + } 56 + } 57 + } 58 + } 59 + }, 60 + "errors": [ 61 + { 62 + "name": "InvalidSwap", 63 + "description": "Indicates that the 'swapCommit' parameter did not match current commit." 64 + } 65 + ] 66 + }, 67 + "create": { 68 + "type": "object", 69 + "description": "Operation which creates a new record.", 70 + "required": ["collection", "value"], 71 + "properties": { 72 + "collection": { "type": "string", "format": "nsid" }, 73 + "rkey": { "type": "string", "maxLength": 15 }, 74 + "value": { "type": "unknown" } 75 + } 76 + }, 77 + "update": { 78 + "type": "object", 79 + "description": "Operation which updates an existing record.", 80 + "required": ["collection", "rkey", "value"], 81 + "properties": { 82 + "collection": { "type": "string", "format": "nsid" }, 83 + "rkey": { "type": "string" }, 84 + "value": { "type": "unknown" } 85 + } 86 + }, 87 + "delete": { 88 + "type": "object", 89 + "description": "Operation which deletes an existing record.", 90 + "required": ["collection", "rkey"], 91 + "properties": { 92 + "collection": { "type": "string", "format": "nsid" }, 93 + "rkey": { "type": "string" } 94 + } 95 + }, 96 + "createResult": { 97 + "type": "object", 98 + "required": ["uri", "cid"], 99 + "properties": { 100 + "uri": { "type": "string", "format": "at-uri" }, 101 + "cid": { "type": "string", "format": "cid" }, 102 + "validationStatus": { 103 + "type": "string", 104 + "knownValues": ["valid", "unknown"] 105 + } 106 + } 107 + }, 108 + "updateResult": { 109 + "type": "object", 110 + "required": ["uri", "cid"], 111 + "properties": { 112 + "uri": { "type": "string", "format": "at-uri" }, 113 + "cid": { "type": "string", "format": "cid" }, 114 + "validationStatus": { 115 + "type": "string", 116 + "knownValues": ["valid", "unknown"] 117 + } 118 + } 119 + }, 120 + "deleteResult": { 121 + "type": "object", 122 + "required": [], 123 + "properties": {} 124 + } 125 + } 126 + }
+72
lexicons/com/atproto/repo/createRecord.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.repo.createRecord", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Create a single new repository record. Requires auth, implemented by PDS.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["repo", "collection", "record"], 13 + "properties": { 14 + "repo": { 15 + "type": "string", 16 + "format": "at-identifier", 17 + "description": "The handle or DID of the repo (aka, current account)." 18 + }, 19 + "collection": { 20 + "type": "string", 21 + "format": "nsid", 22 + "description": "The NSID of the record collection." 23 + }, 24 + "rkey": { 25 + "type": "string", 26 + "description": "The Record Key.", 27 + "maxLength": 15 28 + }, 29 + "validate": { 30 + "type": "boolean", 31 + "description": "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." 32 + }, 33 + "record": { 34 + "type": "unknown", 35 + "description": "The record itself. Must contain a $type field." 36 + }, 37 + "swapCommit": { 38 + "type": "string", 39 + "format": "cid", 40 + "description": "Compare and swap with the previous commit by CID." 41 + } 42 + } 43 + } 44 + }, 45 + "output": { 46 + "encoding": "application/json", 47 + "schema": { 48 + "type": "object", 49 + "required": ["uri", "cid"], 50 + "properties": { 51 + "uri": { "type": "string", "format": "at-uri" }, 52 + "cid": { "type": "string", "format": "cid" }, 53 + "commit": { 54 + "type": "ref", 55 + "ref": "com.atproto.repo.defs#commitMeta" 56 + }, 57 + "validationStatus": { 58 + "type": "string", 59 + "knownValues": ["valid", "unknown"] 60 + } 61 + } 62 + } 63 + }, 64 + "errors": [ 65 + { 66 + "name": "InvalidSwap", 67 + "description": "Indicates that 'swapCommit' didn't match current repo commit." 68 + } 69 + ] 70 + } 71 + } 72 + }
+14
lexicons/com/atproto/repo/defs.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.repo.defs", 4 + "defs": { 5 + "commitMeta": { 6 + "type": "object", 7 + "required": ["cid", "rev"], 8 + "properties": { 9 + "cid": { "type": "string", "format": "cid" }, 10 + "rev": { "type": "string" } 11 + } 12 + } 13 + } 14 + }
+56
lexicons/com/atproto/repo/deleteRecord.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.repo.deleteRecord", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Delete a repository record, or ensure it doesn't exist. Requires auth, implemented by PDS.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["repo", "collection", "rkey"], 13 + "properties": { 14 + "repo": { 15 + "type": "string", 16 + "format": "at-identifier", 17 + "description": "The handle or DID of the repo (aka, current account)." 18 + }, 19 + "collection": { 20 + "type": "string", 21 + "format": "nsid", 22 + "description": "The NSID of the record collection." 23 + }, 24 + "rkey": { 25 + "type": "string", 26 + "description": "The Record Key." 27 + }, 28 + "swapRecord": { 29 + "type": "string", 30 + "format": "cid", 31 + "description": "Compare and swap with the previous record by CID." 32 + }, 33 + "swapCommit": { 34 + "type": "string", 35 + "format": "cid", 36 + "description": "Compare and swap with the previous commit by CID." 37 + } 38 + } 39 + } 40 + }, 41 + "output": { 42 + "encoding": "application/json", 43 + "schema": { 44 + "type": "object", 45 + "properties": { 46 + "commit": { 47 + "type": "ref", 48 + "ref": "com.atproto.repo.defs#commitMeta" 49 + } 50 + } 51 + } 52 + }, 53 + "errors": [{ "name": "InvalidSwap" }] 54 + } 55 + } 56 + }
+51
lexicons/com/atproto/repo/describeRepo.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.repo.describeRepo", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get information about an account and repository, including the list of collections. Does not require auth.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["repo"], 11 + "properties": { 12 + "repo": { 13 + "type": "string", 14 + "format": "at-identifier", 15 + "description": "The handle or DID of the repo." 16 + } 17 + } 18 + }, 19 + "output": { 20 + "encoding": "application/json", 21 + "schema": { 22 + "type": "object", 23 + "required": [ 24 + "handle", 25 + "did", 26 + "didDoc", 27 + "collections", 28 + "handleIsCorrect" 29 + ], 30 + "properties": { 31 + "handle": { "type": "string", "format": "handle" }, 32 + "did": { "type": "string", "format": "did" }, 33 + "didDoc": { 34 + "type": "unknown", 35 + "description": "The complete DID document for this account." 36 + }, 37 + "collections": { 38 + "type": "array", 39 + "description": "List of all the collections (NSIDs) for which this repo contains at least one record.", 40 + "items": { "type": "string", "format": "nsid" } 41 + }, 42 + "handleIsCorrect": { 43 + "type": "boolean", 44 + "description": "Indicates if handle is currently valid (resolves bi-directionally)" 45 + } 46 + } 47 + } 48 + } 49 + } 50 + } 51 + }
+45
lexicons/com/atproto/repo/getRecord.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.repo.getRecord", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get a single record from a repository. Does not require auth.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["repo", "collection", "rkey"], 11 + "properties": { 12 + "repo": { 13 + "type": "string", 14 + "format": "at-identifier", 15 + "description": "The handle or DID of the repo." 16 + }, 17 + "collection": { 18 + "type": "string", 19 + "format": "nsid", 20 + "description": "The NSID of the record collection." 21 + }, 22 + "rkey": { "type": "string", "description": "The Record Key." }, 23 + "cid": { 24 + "type": "string", 25 + "format": "cid", 26 + "description": "The CID of the version of the record. If not specified, then return the most recent version." 27 + } 28 + } 29 + }, 30 + "output": { 31 + "encoding": "application/json", 32 + "schema": { 33 + "type": "object", 34 + "required": ["uri", "value"], 35 + "properties": { 36 + "uri": { "type": "string", "format": "at-uri" }, 37 + "cid": { "type": "string", "format": "cid" }, 38 + "value": { "type": "unknown" } 39 + } 40 + } 41 + }, 42 + "errors": [{ "name": "RecordNotFound" }] 43 + } 44 + } 45 + }
+13
lexicons/com/atproto/repo/importRepo.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.repo.importRepo", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Import a repo in the form of a CAR file. Requires Content-Length HTTP header to be set.", 8 + "input": { 9 + "encoding": "application/vnd.ipld.car" 10 + } 11 + } 12 + } 13 + }
+44
lexicons/com/atproto/repo/listMissingBlobs.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.repo.listMissingBlobs", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Returns a list of missing blobs for the requesting account. Intended to be used in the account migration flow.", 8 + "parameters": { 9 + "type": "params", 10 + "properties": { 11 + "limit": { 12 + "type": "integer", 13 + "minimum": 1, 14 + "maximum": 1000, 15 + "default": 500 16 + }, 17 + "cursor": { "type": "string" } 18 + } 19 + }, 20 + "output": { 21 + "encoding": "application/json", 22 + "schema": { 23 + "type": "object", 24 + "required": ["blobs"], 25 + "properties": { 26 + "cursor": { "type": "string" }, 27 + "blobs": { 28 + "type": "array", 29 + "items": { "type": "ref", "ref": "#recordBlob" } 30 + } 31 + } 32 + } 33 + } 34 + }, 35 + "recordBlob": { 36 + "type": "object", 37 + "required": ["cid", "recordUri"], 38 + "properties": { 39 + "cid": { "type": "string", "format": "cid" }, 40 + "recordUri": { "type": "string", "format": "at-uri" } 41 + } 42 + } 43 + } 44 + }
+69
lexicons/com/atproto/repo/listRecords.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.repo.listRecords", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "List a range of records in a repository, matching a specific collection. Does not require auth.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["repo", "collection"], 11 + "properties": { 12 + "repo": { 13 + "type": "string", 14 + "format": "at-identifier", 15 + "description": "The handle or DID of the repo." 16 + }, 17 + "collection": { 18 + "type": "string", 19 + "format": "nsid", 20 + "description": "The NSID of the record type." 21 + }, 22 + "limit": { 23 + "type": "integer", 24 + "minimum": 1, 25 + "maximum": 100, 26 + "default": 50, 27 + "description": "The number of records to return." 28 + }, 29 + "cursor": { "type": "string" }, 30 + "rkeyStart": { 31 + "type": "string", 32 + "description": "DEPRECATED: The lowest sort-ordered rkey to start from (exclusive)" 33 + }, 34 + "rkeyEnd": { 35 + "type": "string", 36 + "description": "DEPRECATED: The highest sort-ordered rkey to stop at (exclusive)" 37 + }, 38 + "reverse": { 39 + "type": "boolean", 40 + "description": "Flag to reverse the order of the returned records." 41 + } 42 + } 43 + }, 44 + "output": { 45 + "encoding": "application/json", 46 + "schema": { 47 + "type": "object", 48 + "required": ["records"], 49 + "properties": { 50 + "cursor": { "type": "string" }, 51 + "records": { 52 + "type": "array", 53 + "items": { "type": "ref", "ref": "#record" } 54 + } 55 + } 56 + } 57 + } 58 + }, 59 + "record": { 60 + "type": "object", 61 + "required": ["uri", "cid", "value"], 62 + "properties": { 63 + "uri": { "type": "string", "format": "at-uri" }, 64 + "cid": { "type": "string", "format": "cid" }, 65 + "value": { "type": "unknown" } 66 + } 67 + } 68 + } 69 + }
+73
lexicons/com/atproto/repo/putRecord.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.repo.putRecord", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Write a repository record, creating or updating it as needed. Requires auth, implemented by PDS.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["repo", "collection", "rkey", "record"], 13 + "nullable": ["swapRecord"], 14 + "properties": { 15 + "repo": { 16 + "type": "string", 17 + "format": "at-identifier", 18 + "description": "The handle or DID of the repo (aka, current account)." 19 + }, 20 + "collection": { 21 + "type": "string", 22 + "format": "nsid", 23 + "description": "The NSID of the record collection." 24 + }, 25 + "rkey": { 26 + "type": "string", 27 + "description": "The Record Key.", 28 + "maxLength": 15 29 + }, 30 + "validate": { 31 + "type": "boolean", 32 + "description": "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." 33 + }, 34 + "record": { 35 + "type": "unknown", 36 + "description": "The record to write." 37 + }, 38 + "swapRecord": { 39 + "type": "string", 40 + "format": "cid", 41 + "description": "Compare and swap with the previous record by CID. WARNING: nullable and optional field; may cause problems with golang implementation" 42 + }, 43 + "swapCommit": { 44 + "type": "string", 45 + "format": "cid", 46 + "description": "Compare and swap with the previous commit by CID." 47 + } 48 + } 49 + } 50 + }, 51 + "output": { 52 + "encoding": "application/json", 53 + "schema": { 54 + "type": "object", 55 + "required": ["uri", "cid"], 56 + "properties": { 57 + "uri": { "type": "string", "format": "at-uri" }, 58 + "cid": { "type": "string", "format": "cid" }, 59 + "commit": { 60 + "type": "ref", 61 + "ref": "com.atproto.repo.defs#commitMeta" 62 + }, 63 + "validationStatus": { 64 + "type": "string", 65 + "knownValues": ["valid", "unknown"] 66 + } 67 + } 68 + } 69 + }, 70 + "errors": [{ "name": "InvalidSwap" }] 71 + } 72 + } 73 + }
+15
lexicons/com/atproto/repo/strongRef.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.repo.strongRef", 4 + "description": "A URI with a content-hash fingerprint.", 5 + "defs": { 6 + "main": { 7 + "type": "object", 8 + "required": ["uri", "cid"], 9 + "properties": { 10 + "uri": { "type": "string", "format": "at-uri" }, 11 + "cid": { "type": "string", "format": "cid" } 12 + } 13 + } 14 + } 15 + }
+23
lexicons/com/atproto/repo/uploadBlob.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.repo.uploadBlob", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Upload a new blob, to be referenced from a repository record. The blob will be deleted if it is not referenced within a time window (eg, minutes). Blob restrictions (mimetype, size, etc) are enforced when the reference is created. Requires auth, implemented by PDS.", 8 + "input": { 9 + "encoding": "*/*" 10 + }, 11 + "output": { 12 + "encoding": "application/json", 13 + "schema": { 14 + "type": "object", 15 + "required": ["blob"], 16 + "properties": { 17 + "blob": { "type": "blob" } 18 + } 19 + } 20 + } 21 + } 22 + } 23 + }
+30
lexicons/fyi/unravel/frontpage/comment.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "fyi.unravel.frontpage.comment", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "Record containing a Frontpage comment.", 8 + "key": "tid", 9 + "record": { 10 + "type": "object", 11 + "required": ["content", "createdAt", "post"], 12 + "properties": { 13 + "content": { 14 + "type": "string", 15 + "maxLength": 100000, 16 + "maxGraphemes": 10000, 17 + "description": "The content of the comment." 18 + }, 19 + "createdAt": { 20 + "type": "string", 21 + "format": "datetime", 22 + "description": "Client-declared timestamp when this comment was originally created." 23 + }, 24 + "parent": { "type": "ref", "ref": "com.atproto.repo.strongRef" }, 25 + "post": { "type": "ref", "ref": "com.atproto.repo.strongRef" } 26 + } 27 + } 28 + } 29 + } 30 + }
+33
lexicons/fyi/unravel/frontpage/post.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "fyi.unravel.frontpage.post", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "Record containing a Frontpage post.", 8 + "key": "tid", 9 + "record": { 10 + "type": "object", 11 + "required": ["title", "url", "createdAt"], 12 + "properties": { 13 + "title": { 14 + "type": "string", 15 + "maxLength": 3000, 16 + "maxGraphemes": 300, 17 + "description": "The title of the post." 18 + }, 19 + "url": { 20 + "type": "string", 21 + "format": "uri", 22 + "description": "The URL of the post." 23 + }, 24 + "createdAt": { 25 + "type": "string", 26 + "format": "datetime", 27 + "description": "Client-declared timestamp when this post was originally created." 28 + } 29 + } 30 + } 31 + } 32 + } 33 + }
+23
lexicons/fyi/unravel/frontpage/vote.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "fyi.unravel.frontpage.vote", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "Record containing a Frontpage vote.", 8 + "key": "tid", 9 + "record": { 10 + "type": "object", 11 + "required": ["subject", "createdAt"], 12 + "properties": { 13 + "subject": { "type": "ref", "ref": "com.atproto.repo.strongRef" }, 14 + "createdAt": { 15 + "type": "string", 16 + "format": "datetime", 17 + "description": "Client-declared timestamp when this vote was originally created." 18 + } 19 + } 20 + } 21 + } 22 + } 23 + }
+21
packages/frontpage-atproto-client/README.md
··· 1 + # frontpage-atproto-client 2 + 3 + Generated schemas and API clients for the Frontpage lexicon. 4 + 5 + ## Building 6 + 7 + After an update to a lexicon (in the root of this monorepo) run: 8 + 9 + ```sh 10 + pnpm exec lex gen-api ./src ../../lexicons/**/*.json && pnpm run format:write 11 + ``` 12 + 13 + Note: This requires a shell with glob support. 14 + 15 + ## Fetching latest lexicons 16 + 17 + This is not needed often, only when the dependent lexicons are updated. 18 + 19 + ```sh 20 + pnpm run fetch-lexicons 21 + ```
+70
packages/frontpage-atproto-client/fetch-lexicons.mts
··· 1 + import { exec } from "child_process"; 2 + import fs from "node:fs/promises"; 3 + import path from "node:path"; 4 + import AdmZip from "adm-zip"; 5 + 6 + const LEXICON_PREFIXES_TO_FETCH = ["com/atproto/repo"]; 7 + const LEXICON_OUTPUT_PATH = path.resolve(import.meta.dirname, "../../lexicons"); 8 + 9 + const isWorkingDirectoryClean = await new Promise<boolean>((resolve, reject) => 10 + exec("git diff --quiet", (err) => { 11 + if (err) { 12 + return reject(err); 13 + } 14 + }).on("exit", (code) => { 15 + if (code === 0) { 16 + resolve(true); 17 + } else { 18 + resolve(false); 19 + } 20 + }), 21 + ); 22 + 23 + if (!isWorkingDirectoryClean) { 24 + console.error("ERR: Working directory is not clean"); 25 + process.exit(1); 26 + } 27 + 28 + const zipBuffer = await fetch( 29 + "https://github.com/bluesky-social/atproto/archive/refs/heads/main.zip", 30 + ).then((res) => res.arrayBuffer()); 31 + 32 + // We assume that the lexicons are in the atproto-main/lexicons/ folder 33 + const LEXICON_REPO_PATH_PREFIX = "atproto-main/lexicons/"; 34 + 35 + const zip = new AdmZip(Buffer.from(zipBuffer)); 36 + 37 + const lexiconEntries = zip 38 + .getEntries() 39 + .filter( 40 + (entry) => 41 + LEXICON_PREFIXES_TO_FETCH.some((prefix) => 42 + entry.entryName.startsWith(LEXICON_REPO_PATH_PREFIX + prefix), 43 + ) && !entry.isDirectory, 44 + ); 45 + 46 + await Promise.all( 47 + lexiconEntries.map(async (entry) => { 48 + const entryDirectory = entry.entryName 49 + .replace(LEXICON_REPO_PATH_PREFIX, "") 50 + .split("/") 51 + .slice(0, -1) 52 + .join("/"); 53 + const filename = entry.entryName.split("/").slice(-1)[0]; 54 + if (!filename) { 55 + throw new Error("Filename is empty from entry: " + entry.entryName); 56 + } 57 + 58 + const outputDirectory = path.join(LEXICON_OUTPUT_PATH, entryDirectory); 59 + await fs.mkdir(outputDirectory, { recursive: true }); 60 + 61 + const content = zip.readFile(entry); 62 + if (!content) { 63 + throw new Error("Content is missing"); 64 + } 65 + 66 + const outputPath = path.join(outputDirectory, filename); 67 + console.log(`Writing ${outputPath}`); 68 + await fs.writeFile(outputPath, content); 69 + }), 70 + );
+32
packages/frontpage-atproto-client/package.json
··· 1 + { 2 + "private": true, 3 + "name": "@repo/frontpage-atproto-client", 4 + "type": "module", 5 + "main": "src/index.ts", 6 + "exports": { 7 + ".": { 8 + "import": "./src/index.ts" 9 + }, 10 + "./lexicons": { 11 + "import": "./src/lexicons.ts" 12 + } 13 + }, 14 + "scripts": { 15 + "format:write": "prettier --write src", 16 + "fetch-lexicons": "tsx ./fetch-lexicons.mts", 17 + "type-check": "tsc --noEmit" 18 + }, 19 + "dependencies": { 20 + "@atproto/lexicon": "^0.4.2", 21 + "@atproto/xrpc": "^0.6.3", 22 + "multiformats": "^13.3.0" 23 + }, 24 + "devDependencies": { 25 + "@atproto/lex-cli": "^0.5.1", 26 + "@repo/typescript-config": "workspace:*", 27 + "@types/adm-zip": "^0.5.5", 28 + "@types/node": "^20", 29 + "adm-zip": "^0.5.16", 30 + "tsx": "^4.16.5" 31 + } 32 + }
+425
packages/frontpage-atproto-client/src/index.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { XrpcClient, FetchHandler, FetchHandlerOptions } from "@atproto/xrpc"; 5 + import { schemas } from "./lexicons"; 6 + import { CID } from "multiformats/cid"; 7 + import * as ComAtprotoRepoApplyWrites from "./types/com/atproto/repo/applyWrites"; 8 + import * as ComAtprotoRepoCreateRecord from "./types/com/atproto/repo/createRecord"; 9 + import * as ComAtprotoRepoDefs from "./types/com/atproto/repo/defs"; 10 + import * as ComAtprotoRepoDeleteRecord from "./types/com/atproto/repo/deleteRecord"; 11 + import * as ComAtprotoRepoDescribeRepo from "./types/com/atproto/repo/describeRepo"; 12 + import * as ComAtprotoRepoGetRecord from "./types/com/atproto/repo/getRecord"; 13 + import * as ComAtprotoRepoImportRepo from "./types/com/atproto/repo/importRepo"; 14 + import * as ComAtprotoRepoListMissingBlobs from "./types/com/atproto/repo/listMissingBlobs"; 15 + import * as ComAtprotoRepoListRecords from "./types/com/atproto/repo/listRecords"; 16 + import * as ComAtprotoRepoPutRecord from "./types/com/atproto/repo/putRecord"; 17 + import * as ComAtprotoRepoStrongRef from "./types/com/atproto/repo/strongRef"; 18 + import * as ComAtprotoRepoUploadBlob from "./types/com/atproto/repo/uploadBlob"; 19 + import * as FyiUnravelFrontpageComment from "./types/fyi/unravel/frontpage/comment"; 20 + import * as FyiUnravelFrontpagePost from "./types/fyi/unravel/frontpage/post"; 21 + import * as FyiUnravelFrontpageVote from "./types/fyi/unravel/frontpage/vote"; 22 + 23 + export * as ComAtprotoRepoApplyWrites from "./types/com/atproto/repo/applyWrites"; 24 + export * as ComAtprotoRepoCreateRecord from "./types/com/atproto/repo/createRecord"; 25 + export * as ComAtprotoRepoDefs from "./types/com/atproto/repo/defs"; 26 + export * as ComAtprotoRepoDeleteRecord from "./types/com/atproto/repo/deleteRecord"; 27 + export * as ComAtprotoRepoDescribeRepo from "./types/com/atproto/repo/describeRepo"; 28 + export * as ComAtprotoRepoGetRecord from "./types/com/atproto/repo/getRecord"; 29 + export * as ComAtprotoRepoImportRepo from "./types/com/atproto/repo/importRepo"; 30 + export * as ComAtprotoRepoListMissingBlobs from "./types/com/atproto/repo/listMissingBlobs"; 31 + export * as ComAtprotoRepoListRecords from "./types/com/atproto/repo/listRecords"; 32 + export * as ComAtprotoRepoPutRecord from "./types/com/atproto/repo/putRecord"; 33 + export * as ComAtprotoRepoStrongRef from "./types/com/atproto/repo/strongRef"; 34 + export * as ComAtprotoRepoUploadBlob from "./types/com/atproto/repo/uploadBlob"; 35 + export * as FyiUnravelFrontpageComment from "./types/fyi/unravel/frontpage/comment"; 36 + export * as FyiUnravelFrontpagePost from "./types/fyi/unravel/frontpage/post"; 37 + export * as FyiUnravelFrontpageVote from "./types/fyi/unravel/frontpage/vote"; 38 + 39 + export class AtpBaseClient extends XrpcClient { 40 + com: ComNS; 41 + fyi: FyiNS; 42 + 43 + constructor(options: FetchHandler | FetchHandlerOptions) { 44 + super(options, schemas); 45 + this.com = new ComNS(this); 46 + this.fyi = new FyiNS(this); 47 + } 48 + 49 + /** @deprecated use `this` instead */ 50 + get xrpc(): XrpcClient { 51 + return this; 52 + } 53 + } 54 + 55 + export class ComNS { 56 + _client: XrpcClient; 57 + atproto: ComAtprotoNS; 58 + 59 + constructor(client: XrpcClient) { 60 + this._client = client; 61 + this.atproto = new ComAtprotoNS(client); 62 + } 63 + } 64 + 65 + export class ComAtprotoNS { 66 + _client: XrpcClient; 67 + repo: ComAtprotoRepoNS; 68 + 69 + constructor(client: XrpcClient) { 70 + this._client = client; 71 + this.repo = new ComAtprotoRepoNS(client); 72 + } 73 + } 74 + 75 + export class ComAtprotoRepoNS { 76 + _client: XrpcClient; 77 + 78 + constructor(client: XrpcClient) { 79 + this._client = client; 80 + } 81 + 82 + applyWrites( 83 + data?: ComAtprotoRepoApplyWrites.InputSchema, 84 + opts?: ComAtprotoRepoApplyWrites.CallOptions, 85 + ): Promise<ComAtprotoRepoApplyWrites.Response> { 86 + return this._client 87 + .call("com.atproto.repo.applyWrites", opts?.qp, data, opts) 88 + .catch((e) => { 89 + throw ComAtprotoRepoApplyWrites.toKnownErr(e); 90 + }); 91 + } 92 + 93 + createRecord( 94 + data?: ComAtprotoRepoCreateRecord.InputSchema, 95 + opts?: ComAtprotoRepoCreateRecord.CallOptions, 96 + ): Promise<ComAtprotoRepoCreateRecord.Response> { 97 + return this._client 98 + .call("com.atproto.repo.createRecord", opts?.qp, data, opts) 99 + .catch((e) => { 100 + throw ComAtprotoRepoCreateRecord.toKnownErr(e); 101 + }); 102 + } 103 + 104 + deleteRecord( 105 + data?: ComAtprotoRepoDeleteRecord.InputSchema, 106 + opts?: ComAtprotoRepoDeleteRecord.CallOptions, 107 + ): Promise<ComAtprotoRepoDeleteRecord.Response> { 108 + return this._client 109 + .call("com.atproto.repo.deleteRecord", opts?.qp, data, opts) 110 + .catch((e) => { 111 + throw ComAtprotoRepoDeleteRecord.toKnownErr(e); 112 + }); 113 + } 114 + 115 + describeRepo( 116 + params?: ComAtprotoRepoDescribeRepo.QueryParams, 117 + opts?: ComAtprotoRepoDescribeRepo.CallOptions, 118 + ): Promise<ComAtprotoRepoDescribeRepo.Response> { 119 + return this._client.call( 120 + "com.atproto.repo.describeRepo", 121 + params, 122 + undefined, 123 + opts, 124 + ); 125 + } 126 + 127 + getRecord( 128 + params?: ComAtprotoRepoGetRecord.QueryParams, 129 + opts?: ComAtprotoRepoGetRecord.CallOptions, 130 + ): Promise<ComAtprotoRepoGetRecord.Response> { 131 + return this._client 132 + .call("com.atproto.repo.getRecord", params, undefined, opts) 133 + .catch((e) => { 134 + throw ComAtprotoRepoGetRecord.toKnownErr(e); 135 + }); 136 + } 137 + 138 + importRepo( 139 + data?: ComAtprotoRepoImportRepo.InputSchema, 140 + opts?: ComAtprotoRepoImportRepo.CallOptions, 141 + ): Promise<ComAtprotoRepoImportRepo.Response> { 142 + return this._client.call( 143 + "com.atproto.repo.importRepo", 144 + opts?.qp, 145 + data, 146 + opts, 147 + ); 148 + } 149 + 150 + listMissingBlobs( 151 + params?: ComAtprotoRepoListMissingBlobs.QueryParams, 152 + opts?: ComAtprotoRepoListMissingBlobs.CallOptions, 153 + ): Promise<ComAtprotoRepoListMissingBlobs.Response> { 154 + return this._client.call( 155 + "com.atproto.repo.listMissingBlobs", 156 + params, 157 + undefined, 158 + opts, 159 + ); 160 + } 161 + 162 + listRecords( 163 + params?: ComAtprotoRepoListRecords.QueryParams, 164 + opts?: ComAtprotoRepoListRecords.CallOptions, 165 + ): Promise<ComAtprotoRepoListRecords.Response> { 166 + return this._client.call( 167 + "com.atproto.repo.listRecords", 168 + params, 169 + undefined, 170 + opts, 171 + ); 172 + } 173 + 174 + putRecord( 175 + data?: ComAtprotoRepoPutRecord.InputSchema, 176 + opts?: ComAtprotoRepoPutRecord.CallOptions, 177 + ): Promise<ComAtprotoRepoPutRecord.Response> { 178 + return this._client 179 + .call("com.atproto.repo.putRecord", opts?.qp, data, opts) 180 + .catch((e) => { 181 + throw ComAtprotoRepoPutRecord.toKnownErr(e); 182 + }); 183 + } 184 + 185 + uploadBlob( 186 + data?: ComAtprotoRepoUploadBlob.InputSchema, 187 + opts?: ComAtprotoRepoUploadBlob.CallOptions, 188 + ): Promise<ComAtprotoRepoUploadBlob.Response> { 189 + return this._client.call( 190 + "com.atproto.repo.uploadBlob", 191 + opts?.qp, 192 + data, 193 + opts, 194 + ); 195 + } 196 + } 197 + 198 + export class FyiNS { 199 + _client: XrpcClient; 200 + unravel: FyiUnravelNS; 201 + 202 + constructor(client: XrpcClient) { 203 + this._client = client; 204 + this.unravel = new FyiUnravelNS(client); 205 + } 206 + } 207 + 208 + export class FyiUnravelNS { 209 + _client: XrpcClient; 210 + frontpage: FyiUnravelFrontpageNS; 211 + 212 + constructor(client: XrpcClient) { 213 + this._client = client; 214 + this.frontpage = new FyiUnravelFrontpageNS(client); 215 + } 216 + } 217 + 218 + export class FyiUnravelFrontpageNS { 219 + _client: XrpcClient; 220 + comment: CommentRecord; 221 + post: PostRecord; 222 + vote: VoteRecord; 223 + 224 + constructor(client: XrpcClient) { 225 + this._client = client; 226 + this.comment = new CommentRecord(client); 227 + this.post = new PostRecord(client); 228 + this.vote = new VoteRecord(client); 229 + } 230 + } 231 + 232 + export class CommentRecord { 233 + _client: XrpcClient; 234 + 235 + constructor(client: XrpcClient) { 236 + this._client = client; 237 + } 238 + 239 + async list( 240 + params: Omit<ComAtprotoRepoListRecords.QueryParams, "collection">, 241 + ): Promise<{ 242 + cursor?: string; 243 + records: { uri: string; value: FyiUnravelFrontpageComment.Record }[]; 244 + }> { 245 + const res = await this._client.call("com.atproto.repo.listRecords", { 246 + collection: "fyi.unravel.frontpage.comment", 247 + ...params, 248 + }); 249 + return res.data; 250 + } 251 + 252 + async get( 253 + params: Omit<ComAtprotoRepoGetRecord.QueryParams, "collection">, 254 + ): Promise<{ 255 + uri: string; 256 + cid: string; 257 + value: FyiUnravelFrontpageComment.Record; 258 + }> { 259 + const res = await this._client.call("com.atproto.repo.getRecord", { 260 + collection: "fyi.unravel.frontpage.comment", 261 + ...params, 262 + }); 263 + return res.data; 264 + } 265 + 266 + async create( 267 + params: Omit< 268 + ComAtprotoRepoCreateRecord.InputSchema, 269 + "collection" | "record" 270 + >, 271 + record: FyiUnravelFrontpageComment.Record, 272 + headers?: Record<string, string>, 273 + ): Promise<{ uri: string; cid: string }> { 274 + record.$type = "fyi.unravel.frontpage.comment"; 275 + const res = await this._client.call( 276 + "com.atproto.repo.createRecord", 277 + undefined, 278 + { collection: "fyi.unravel.frontpage.comment", ...params, record }, 279 + { encoding: "application/json", headers }, 280 + ); 281 + return res.data; 282 + } 283 + 284 + async delete( 285 + params: Omit<ComAtprotoRepoDeleteRecord.InputSchema, "collection">, 286 + headers?: Record<string, string>, 287 + ): Promise<void> { 288 + await this._client.call( 289 + "com.atproto.repo.deleteRecord", 290 + undefined, 291 + { collection: "fyi.unravel.frontpage.comment", ...params }, 292 + { headers }, 293 + ); 294 + } 295 + } 296 + 297 + export class PostRecord { 298 + _client: XrpcClient; 299 + 300 + constructor(client: XrpcClient) { 301 + this._client = client; 302 + } 303 + 304 + async list( 305 + params: Omit<ComAtprotoRepoListRecords.QueryParams, "collection">, 306 + ): Promise<{ 307 + cursor?: string; 308 + records: { uri: string; value: FyiUnravelFrontpagePost.Record }[]; 309 + }> { 310 + const res = await this._client.call("com.atproto.repo.listRecords", { 311 + collection: "fyi.unravel.frontpage.post", 312 + ...params, 313 + }); 314 + return res.data; 315 + } 316 + 317 + async get( 318 + params: Omit<ComAtprotoRepoGetRecord.QueryParams, "collection">, 319 + ): Promise<{ 320 + uri: string; 321 + cid: string; 322 + value: FyiUnravelFrontpagePost.Record; 323 + }> { 324 + const res = await this._client.call("com.atproto.repo.getRecord", { 325 + collection: "fyi.unravel.frontpage.post", 326 + ...params, 327 + }); 328 + return res.data; 329 + } 330 + 331 + async create( 332 + params: Omit< 333 + ComAtprotoRepoCreateRecord.InputSchema, 334 + "collection" | "record" 335 + >, 336 + record: FyiUnravelFrontpagePost.Record, 337 + headers?: Record<string, string>, 338 + ): Promise<{ uri: string; cid: string }> { 339 + record.$type = "fyi.unravel.frontpage.post"; 340 + const res = await this._client.call( 341 + "com.atproto.repo.createRecord", 342 + undefined, 343 + { collection: "fyi.unravel.frontpage.post", ...params, record }, 344 + { encoding: "application/json", headers }, 345 + ); 346 + return res.data; 347 + } 348 + 349 + async delete( 350 + params: Omit<ComAtprotoRepoDeleteRecord.InputSchema, "collection">, 351 + headers?: Record<string, string>, 352 + ): Promise<void> { 353 + await this._client.call( 354 + "com.atproto.repo.deleteRecord", 355 + undefined, 356 + { collection: "fyi.unravel.frontpage.post", ...params }, 357 + { headers }, 358 + ); 359 + } 360 + } 361 + 362 + export class VoteRecord { 363 + _client: XrpcClient; 364 + 365 + constructor(client: XrpcClient) { 366 + this._client = client; 367 + } 368 + 369 + async list( 370 + params: Omit<ComAtprotoRepoListRecords.QueryParams, "collection">, 371 + ): Promise<{ 372 + cursor?: string; 373 + records: { uri: string; value: FyiUnravelFrontpageVote.Record }[]; 374 + }> { 375 + const res = await this._client.call("com.atproto.repo.listRecords", { 376 + collection: "fyi.unravel.frontpage.vote", 377 + ...params, 378 + }); 379 + return res.data; 380 + } 381 + 382 + async get( 383 + params: Omit<ComAtprotoRepoGetRecord.QueryParams, "collection">, 384 + ): Promise<{ 385 + uri: string; 386 + cid: string; 387 + value: FyiUnravelFrontpageVote.Record; 388 + }> { 389 + const res = await this._client.call("com.atproto.repo.getRecord", { 390 + collection: "fyi.unravel.frontpage.vote", 391 + ...params, 392 + }); 393 + return res.data; 394 + } 395 + 396 + async create( 397 + params: Omit< 398 + ComAtprotoRepoCreateRecord.InputSchema, 399 + "collection" | "record" 400 + >, 401 + record: FyiUnravelFrontpageVote.Record, 402 + headers?: Record<string, string>, 403 + ): Promise<{ uri: string; cid: string }> { 404 + record.$type = "fyi.unravel.frontpage.vote"; 405 + const res = await this._client.call( 406 + "com.atproto.repo.createRecord", 407 + undefined, 408 + { collection: "fyi.unravel.frontpage.vote", ...params, record }, 409 + { encoding: "application/json", headers }, 410 + ); 411 + return res.data; 412 + } 413 + 414 + async delete( 415 + params: Omit<ComAtprotoRepoDeleteRecord.InputSchema, "collection">, 416 + headers?: Record<string, string>, 417 + ): Promise<void> { 418 + await this._client.call( 419 + "com.atproto.repo.deleteRecord", 420 + undefined, 421 + { collection: "fyi.unravel.frontpage.vote", ...params }, 422 + { headers }, 423 + ); 424 + } 425 + }
+880
packages/frontpage-atproto-client/src/lexicons.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { LexiconDoc, Lexicons } from "@atproto/lexicon"; 5 + 6 + export const schemaDict = { 7 + ComAtprotoRepoApplyWrites: { 8 + lexicon: 1, 9 + id: "com.atproto.repo.applyWrites", 10 + defs: { 11 + main: { 12 + type: "procedure", 13 + description: 14 + "Apply a batch transaction of repository creates, updates, and deletes. Requires auth, implemented by PDS.", 15 + input: { 16 + encoding: "application/json", 17 + schema: { 18 + type: "object", 19 + required: ["repo", "writes"], 20 + properties: { 21 + repo: { 22 + type: "string", 23 + format: "at-identifier", 24 + description: 25 + "The handle or DID of the repo (aka, current account).", 26 + }, 27 + validate: { 28 + type: "boolean", 29 + description: 30 + "Can be set to 'false' to skip Lexicon schema validation of record data across all operations, 'true' to require it, or leave unset to validate only for known Lexicons.", 31 + }, 32 + writes: { 33 + type: "array", 34 + items: { 35 + type: "union", 36 + refs: [ 37 + "lex:com.atproto.repo.applyWrites#create", 38 + "lex:com.atproto.repo.applyWrites#update", 39 + "lex:com.atproto.repo.applyWrites#delete", 40 + ], 41 + closed: true, 42 + }, 43 + }, 44 + swapCommit: { 45 + type: "string", 46 + description: 47 + "If provided, the entire operation will fail if the current repo commit CID does not match this value. Used to prevent conflicting repo mutations.", 48 + format: "cid", 49 + }, 50 + }, 51 + }, 52 + }, 53 + output: { 54 + encoding: "application/json", 55 + schema: { 56 + type: "object", 57 + required: [], 58 + properties: { 59 + commit: { 60 + type: "ref", 61 + ref: "lex:com.atproto.repo.defs#commitMeta", 62 + }, 63 + results: { 64 + type: "array", 65 + items: { 66 + type: "union", 67 + refs: [ 68 + "lex:com.atproto.repo.applyWrites#createResult", 69 + "lex:com.atproto.repo.applyWrites#updateResult", 70 + "lex:com.atproto.repo.applyWrites#deleteResult", 71 + ], 72 + closed: true, 73 + }, 74 + }, 75 + }, 76 + }, 77 + }, 78 + errors: [ 79 + { 80 + name: "InvalidSwap", 81 + description: 82 + "Indicates that the 'swapCommit' parameter did not match current commit.", 83 + }, 84 + ], 85 + }, 86 + create: { 87 + type: "object", 88 + description: "Operation which creates a new record.", 89 + required: ["collection", "value"], 90 + properties: { 91 + collection: { 92 + type: "string", 93 + format: "nsid", 94 + }, 95 + rkey: { 96 + type: "string", 97 + maxLength: 15, 98 + }, 99 + value: { 100 + type: "unknown", 101 + }, 102 + }, 103 + }, 104 + update: { 105 + type: "object", 106 + description: "Operation which updates an existing record.", 107 + required: ["collection", "rkey", "value"], 108 + properties: { 109 + collection: { 110 + type: "string", 111 + format: "nsid", 112 + }, 113 + rkey: { 114 + type: "string", 115 + }, 116 + value: { 117 + type: "unknown", 118 + }, 119 + }, 120 + }, 121 + delete: { 122 + type: "object", 123 + description: "Operation which deletes an existing record.", 124 + required: ["collection", "rkey"], 125 + properties: { 126 + collection: { 127 + type: "string", 128 + format: "nsid", 129 + }, 130 + rkey: { 131 + type: "string", 132 + }, 133 + }, 134 + }, 135 + createResult: { 136 + type: "object", 137 + required: ["uri", "cid"], 138 + properties: { 139 + uri: { 140 + type: "string", 141 + format: "at-uri", 142 + }, 143 + cid: { 144 + type: "string", 145 + format: "cid", 146 + }, 147 + validationStatus: { 148 + type: "string", 149 + knownValues: ["valid", "unknown"], 150 + }, 151 + }, 152 + }, 153 + updateResult: { 154 + type: "object", 155 + required: ["uri", "cid"], 156 + properties: { 157 + uri: { 158 + type: "string", 159 + format: "at-uri", 160 + }, 161 + cid: { 162 + type: "string", 163 + format: "cid", 164 + }, 165 + validationStatus: { 166 + type: "string", 167 + knownValues: ["valid", "unknown"], 168 + }, 169 + }, 170 + }, 171 + deleteResult: { 172 + type: "object", 173 + required: [], 174 + properties: {}, 175 + }, 176 + }, 177 + }, 178 + ComAtprotoRepoCreateRecord: { 179 + lexicon: 1, 180 + id: "com.atproto.repo.createRecord", 181 + defs: { 182 + main: { 183 + type: "procedure", 184 + description: 185 + "Create a single new repository record. Requires auth, implemented by PDS.", 186 + input: { 187 + encoding: "application/json", 188 + schema: { 189 + type: "object", 190 + required: ["repo", "collection", "record"], 191 + properties: { 192 + repo: { 193 + type: "string", 194 + format: "at-identifier", 195 + description: 196 + "The handle or DID of the repo (aka, current account).", 197 + }, 198 + collection: { 199 + type: "string", 200 + format: "nsid", 201 + description: "The NSID of the record collection.", 202 + }, 203 + rkey: { 204 + type: "string", 205 + description: "The Record Key.", 206 + maxLength: 15, 207 + }, 208 + validate: { 209 + type: "boolean", 210 + description: 211 + "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.", 212 + }, 213 + record: { 214 + type: "unknown", 215 + description: "The record itself. Must contain a $type field.", 216 + }, 217 + swapCommit: { 218 + type: "string", 219 + format: "cid", 220 + description: 221 + "Compare and swap with the previous commit by CID.", 222 + }, 223 + }, 224 + }, 225 + }, 226 + output: { 227 + encoding: "application/json", 228 + schema: { 229 + type: "object", 230 + required: ["uri", "cid"], 231 + properties: { 232 + uri: { 233 + type: "string", 234 + format: "at-uri", 235 + }, 236 + cid: { 237 + type: "string", 238 + format: "cid", 239 + }, 240 + commit: { 241 + type: "ref", 242 + ref: "lex:com.atproto.repo.defs#commitMeta", 243 + }, 244 + validationStatus: { 245 + type: "string", 246 + knownValues: ["valid", "unknown"], 247 + }, 248 + }, 249 + }, 250 + }, 251 + errors: [ 252 + { 253 + name: "InvalidSwap", 254 + description: 255 + "Indicates that 'swapCommit' didn't match current repo commit.", 256 + }, 257 + ], 258 + }, 259 + }, 260 + }, 261 + ComAtprotoRepoDefs: { 262 + lexicon: 1, 263 + id: "com.atproto.repo.defs", 264 + defs: { 265 + commitMeta: { 266 + type: "object", 267 + required: ["cid", "rev"], 268 + properties: { 269 + cid: { 270 + type: "string", 271 + format: "cid", 272 + }, 273 + rev: { 274 + type: "string", 275 + }, 276 + }, 277 + }, 278 + }, 279 + }, 280 + ComAtprotoRepoDeleteRecord: { 281 + lexicon: 1, 282 + id: "com.atproto.repo.deleteRecord", 283 + defs: { 284 + main: { 285 + type: "procedure", 286 + description: 287 + "Delete a repository record, or ensure it doesn't exist. Requires auth, implemented by PDS.", 288 + input: { 289 + encoding: "application/json", 290 + schema: { 291 + type: "object", 292 + required: ["repo", "collection", "rkey"], 293 + properties: { 294 + repo: { 295 + type: "string", 296 + format: "at-identifier", 297 + description: 298 + "The handle or DID of the repo (aka, current account).", 299 + }, 300 + collection: { 301 + type: "string", 302 + format: "nsid", 303 + description: "The NSID of the record collection.", 304 + }, 305 + rkey: { 306 + type: "string", 307 + description: "The Record Key.", 308 + }, 309 + swapRecord: { 310 + type: "string", 311 + format: "cid", 312 + description: 313 + "Compare and swap with the previous record by CID.", 314 + }, 315 + swapCommit: { 316 + type: "string", 317 + format: "cid", 318 + description: 319 + "Compare and swap with the previous commit by CID.", 320 + }, 321 + }, 322 + }, 323 + }, 324 + output: { 325 + encoding: "application/json", 326 + schema: { 327 + type: "object", 328 + properties: { 329 + commit: { 330 + type: "ref", 331 + ref: "lex:com.atproto.repo.defs#commitMeta", 332 + }, 333 + }, 334 + }, 335 + }, 336 + errors: [ 337 + { 338 + name: "InvalidSwap", 339 + }, 340 + ], 341 + }, 342 + }, 343 + }, 344 + ComAtprotoRepoDescribeRepo: { 345 + lexicon: 1, 346 + id: "com.atproto.repo.describeRepo", 347 + defs: { 348 + main: { 349 + type: "query", 350 + description: 351 + "Get information about an account and repository, including the list of collections. Does not require auth.", 352 + parameters: { 353 + type: "params", 354 + required: ["repo"], 355 + properties: { 356 + repo: { 357 + type: "string", 358 + format: "at-identifier", 359 + description: "The handle or DID of the repo.", 360 + }, 361 + }, 362 + }, 363 + output: { 364 + encoding: "application/json", 365 + schema: { 366 + type: "object", 367 + required: [ 368 + "handle", 369 + "did", 370 + "didDoc", 371 + "collections", 372 + "handleIsCorrect", 373 + ], 374 + properties: { 375 + handle: { 376 + type: "string", 377 + format: "handle", 378 + }, 379 + did: { 380 + type: "string", 381 + format: "did", 382 + }, 383 + didDoc: { 384 + type: "unknown", 385 + description: "The complete DID document for this account.", 386 + }, 387 + collections: { 388 + type: "array", 389 + description: 390 + "List of all the collections (NSIDs) for which this repo contains at least one record.", 391 + items: { 392 + type: "string", 393 + format: "nsid", 394 + }, 395 + }, 396 + handleIsCorrect: { 397 + type: "boolean", 398 + description: 399 + "Indicates if handle is currently valid (resolves bi-directionally)", 400 + }, 401 + }, 402 + }, 403 + }, 404 + }, 405 + }, 406 + }, 407 + ComAtprotoRepoGetRecord: { 408 + lexicon: 1, 409 + id: "com.atproto.repo.getRecord", 410 + defs: { 411 + main: { 412 + type: "query", 413 + description: 414 + "Get a single record from a repository. Does not require auth.", 415 + parameters: { 416 + type: "params", 417 + required: ["repo", "collection", "rkey"], 418 + properties: { 419 + repo: { 420 + type: "string", 421 + format: "at-identifier", 422 + description: "The handle or DID of the repo.", 423 + }, 424 + collection: { 425 + type: "string", 426 + format: "nsid", 427 + description: "The NSID of the record collection.", 428 + }, 429 + rkey: { 430 + type: "string", 431 + description: "The Record Key.", 432 + }, 433 + cid: { 434 + type: "string", 435 + format: "cid", 436 + description: 437 + "The CID of the version of the record. If not specified, then return the most recent version.", 438 + }, 439 + }, 440 + }, 441 + output: { 442 + encoding: "application/json", 443 + schema: { 444 + type: "object", 445 + required: ["uri", "value"], 446 + properties: { 447 + uri: { 448 + type: "string", 449 + format: "at-uri", 450 + }, 451 + cid: { 452 + type: "string", 453 + format: "cid", 454 + }, 455 + value: { 456 + type: "unknown", 457 + }, 458 + }, 459 + }, 460 + }, 461 + errors: [ 462 + { 463 + name: "RecordNotFound", 464 + }, 465 + ], 466 + }, 467 + }, 468 + }, 469 + ComAtprotoRepoImportRepo: { 470 + lexicon: 1, 471 + id: "com.atproto.repo.importRepo", 472 + defs: { 473 + main: { 474 + type: "procedure", 475 + description: 476 + "Import a repo in the form of a CAR file. Requires Content-Length HTTP header to be set.", 477 + input: { 478 + encoding: "application/vnd.ipld.car", 479 + }, 480 + }, 481 + }, 482 + }, 483 + ComAtprotoRepoListMissingBlobs: { 484 + lexicon: 1, 485 + id: "com.atproto.repo.listMissingBlobs", 486 + defs: { 487 + main: { 488 + type: "query", 489 + description: 490 + "Returns a list of missing blobs for the requesting account. Intended to be used in the account migration flow.", 491 + parameters: { 492 + type: "params", 493 + properties: { 494 + limit: { 495 + type: "integer", 496 + minimum: 1, 497 + maximum: 1000, 498 + default: 500, 499 + }, 500 + cursor: { 501 + type: "string", 502 + }, 503 + }, 504 + }, 505 + output: { 506 + encoding: "application/json", 507 + schema: { 508 + type: "object", 509 + required: ["blobs"], 510 + properties: { 511 + cursor: { 512 + type: "string", 513 + }, 514 + blobs: { 515 + type: "array", 516 + items: { 517 + type: "ref", 518 + ref: "lex:com.atproto.repo.listMissingBlobs#recordBlob", 519 + }, 520 + }, 521 + }, 522 + }, 523 + }, 524 + }, 525 + recordBlob: { 526 + type: "object", 527 + required: ["cid", "recordUri"], 528 + properties: { 529 + cid: { 530 + type: "string", 531 + format: "cid", 532 + }, 533 + recordUri: { 534 + type: "string", 535 + format: "at-uri", 536 + }, 537 + }, 538 + }, 539 + }, 540 + }, 541 + ComAtprotoRepoListRecords: { 542 + lexicon: 1, 543 + id: "com.atproto.repo.listRecords", 544 + defs: { 545 + main: { 546 + type: "query", 547 + description: 548 + "List a range of records in a repository, matching a specific collection. Does not require auth.", 549 + parameters: { 550 + type: "params", 551 + required: ["repo", "collection"], 552 + properties: { 553 + repo: { 554 + type: "string", 555 + format: "at-identifier", 556 + description: "The handle or DID of the repo.", 557 + }, 558 + collection: { 559 + type: "string", 560 + format: "nsid", 561 + description: "The NSID of the record type.", 562 + }, 563 + limit: { 564 + type: "integer", 565 + minimum: 1, 566 + maximum: 100, 567 + default: 50, 568 + description: "The number of records to return.", 569 + }, 570 + cursor: { 571 + type: "string", 572 + }, 573 + rkeyStart: { 574 + type: "string", 575 + description: 576 + "DEPRECATED: The lowest sort-ordered rkey to start from (exclusive)", 577 + }, 578 + rkeyEnd: { 579 + type: "string", 580 + description: 581 + "DEPRECATED: The highest sort-ordered rkey to stop at (exclusive)", 582 + }, 583 + reverse: { 584 + type: "boolean", 585 + description: "Flag to reverse the order of the returned records.", 586 + }, 587 + }, 588 + }, 589 + output: { 590 + encoding: "application/json", 591 + schema: { 592 + type: "object", 593 + required: ["records"], 594 + properties: { 595 + cursor: { 596 + type: "string", 597 + }, 598 + records: { 599 + type: "array", 600 + items: { 601 + type: "ref", 602 + ref: "lex:com.atproto.repo.listRecords#record", 603 + }, 604 + }, 605 + }, 606 + }, 607 + }, 608 + }, 609 + record: { 610 + type: "object", 611 + required: ["uri", "cid", "value"], 612 + properties: { 613 + uri: { 614 + type: "string", 615 + format: "at-uri", 616 + }, 617 + cid: { 618 + type: "string", 619 + format: "cid", 620 + }, 621 + value: { 622 + type: "unknown", 623 + }, 624 + }, 625 + }, 626 + }, 627 + }, 628 + ComAtprotoRepoPutRecord: { 629 + lexicon: 1, 630 + id: "com.atproto.repo.putRecord", 631 + defs: { 632 + main: { 633 + type: "procedure", 634 + description: 635 + "Write a repository record, creating or updating it as needed. Requires auth, implemented by PDS.", 636 + input: { 637 + encoding: "application/json", 638 + schema: { 639 + type: "object", 640 + required: ["repo", "collection", "rkey", "record"], 641 + nullable: ["swapRecord"], 642 + properties: { 643 + repo: { 644 + type: "string", 645 + format: "at-identifier", 646 + description: 647 + "The handle or DID of the repo (aka, current account).", 648 + }, 649 + collection: { 650 + type: "string", 651 + format: "nsid", 652 + description: "The NSID of the record collection.", 653 + }, 654 + rkey: { 655 + type: "string", 656 + description: "The Record Key.", 657 + maxLength: 15, 658 + }, 659 + validate: { 660 + type: "boolean", 661 + description: 662 + "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.", 663 + }, 664 + record: { 665 + type: "unknown", 666 + description: "The record to write.", 667 + }, 668 + swapRecord: { 669 + type: "string", 670 + format: "cid", 671 + description: 672 + "Compare and swap with the previous record by CID. WARNING: nullable and optional field; may cause problems with golang implementation", 673 + }, 674 + swapCommit: { 675 + type: "string", 676 + format: "cid", 677 + description: 678 + "Compare and swap with the previous commit by CID.", 679 + }, 680 + }, 681 + }, 682 + }, 683 + output: { 684 + encoding: "application/json", 685 + schema: { 686 + type: "object", 687 + required: ["uri", "cid"], 688 + properties: { 689 + uri: { 690 + type: "string", 691 + format: "at-uri", 692 + }, 693 + cid: { 694 + type: "string", 695 + format: "cid", 696 + }, 697 + commit: { 698 + type: "ref", 699 + ref: "lex:com.atproto.repo.defs#commitMeta", 700 + }, 701 + validationStatus: { 702 + type: "string", 703 + knownValues: ["valid", "unknown"], 704 + }, 705 + }, 706 + }, 707 + }, 708 + errors: [ 709 + { 710 + name: "InvalidSwap", 711 + }, 712 + ], 713 + }, 714 + }, 715 + }, 716 + ComAtprotoRepoStrongRef: { 717 + lexicon: 1, 718 + id: "com.atproto.repo.strongRef", 719 + description: "A URI with a content-hash fingerprint.", 720 + defs: { 721 + main: { 722 + type: "object", 723 + required: ["uri", "cid"], 724 + properties: { 725 + uri: { 726 + type: "string", 727 + format: "at-uri", 728 + }, 729 + cid: { 730 + type: "string", 731 + format: "cid", 732 + }, 733 + }, 734 + }, 735 + }, 736 + }, 737 + ComAtprotoRepoUploadBlob: { 738 + lexicon: 1, 739 + id: "com.atproto.repo.uploadBlob", 740 + defs: { 741 + main: { 742 + type: "procedure", 743 + description: 744 + "Upload a new blob, to be referenced from a repository record. The blob will be deleted if it is not referenced within a time window (eg, minutes). Blob restrictions (mimetype, size, etc) are enforced when the reference is created. Requires auth, implemented by PDS.", 745 + input: { 746 + encoding: "*/*", 747 + }, 748 + output: { 749 + encoding: "application/json", 750 + schema: { 751 + type: "object", 752 + required: ["blob"], 753 + properties: { 754 + blob: { 755 + type: "blob", 756 + }, 757 + }, 758 + }, 759 + }, 760 + }, 761 + }, 762 + }, 763 + FyiUnravelFrontpageComment: { 764 + lexicon: 1, 765 + id: "fyi.unravel.frontpage.comment", 766 + defs: { 767 + main: { 768 + type: "record", 769 + description: "Record containing a Frontpage comment.", 770 + key: "tid", 771 + record: { 772 + type: "object", 773 + required: ["content", "createdAt", "post"], 774 + properties: { 775 + content: { 776 + type: "string", 777 + maxLength: 100000, 778 + maxGraphemes: 10000, 779 + description: "The content of the comment.", 780 + }, 781 + createdAt: { 782 + type: "string", 783 + format: "datetime", 784 + description: 785 + "Client-declared timestamp when this comment was originally created.", 786 + }, 787 + parent: { 788 + type: "ref", 789 + ref: "lex:com.atproto.repo.strongRef", 790 + }, 791 + post: { 792 + type: "ref", 793 + ref: "lex:com.atproto.repo.strongRef", 794 + }, 795 + }, 796 + }, 797 + }, 798 + }, 799 + }, 800 + FyiUnravelFrontpagePost: { 801 + lexicon: 1, 802 + id: "fyi.unravel.frontpage.post", 803 + defs: { 804 + main: { 805 + type: "record", 806 + description: "Record containing a Frontpage post.", 807 + key: "tid", 808 + record: { 809 + type: "object", 810 + required: ["title", "url", "createdAt"], 811 + properties: { 812 + title: { 813 + type: "string", 814 + maxLength: 3000, 815 + maxGraphemes: 300, 816 + description: "The title of the post.", 817 + }, 818 + url: { 819 + type: "string", 820 + format: "uri", 821 + description: "The URL of the post.", 822 + }, 823 + createdAt: { 824 + type: "string", 825 + format: "datetime", 826 + description: 827 + "Client-declared timestamp when this post was originally created.", 828 + }, 829 + }, 830 + }, 831 + }, 832 + }, 833 + }, 834 + FyiUnravelFrontpageVote: { 835 + lexicon: 1, 836 + id: "fyi.unravel.frontpage.vote", 837 + defs: { 838 + main: { 839 + type: "record", 840 + description: "Record containing a Frontpage vote.", 841 + key: "tid", 842 + record: { 843 + type: "object", 844 + required: ["subject", "createdAt"], 845 + properties: { 846 + subject: { 847 + type: "ref", 848 + ref: "lex:com.atproto.repo.strongRef", 849 + }, 850 + createdAt: { 851 + type: "string", 852 + format: "datetime", 853 + description: 854 + "Client-declared timestamp when this vote was originally created.", 855 + }, 856 + }, 857 + }, 858 + }, 859 + }, 860 + }, 861 + }; 862 + export const schemas: LexiconDoc[] = Object.values(schemaDict) as LexiconDoc[]; 863 + export const lexicons: Lexicons = new Lexicons(schemas); 864 + export const ids = { 865 + ComAtprotoRepoApplyWrites: "com.atproto.repo.applyWrites", 866 + ComAtprotoRepoCreateRecord: "com.atproto.repo.createRecord", 867 + ComAtprotoRepoDefs: "com.atproto.repo.defs", 868 + ComAtprotoRepoDeleteRecord: "com.atproto.repo.deleteRecord", 869 + ComAtprotoRepoDescribeRepo: "com.atproto.repo.describeRepo", 870 + ComAtprotoRepoGetRecord: "com.atproto.repo.getRecord", 871 + ComAtprotoRepoImportRepo: "com.atproto.repo.importRepo", 872 + ComAtprotoRepoListMissingBlobs: "com.atproto.repo.listMissingBlobs", 873 + ComAtprotoRepoListRecords: "com.atproto.repo.listRecords", 874 + ComAtprotoRepoPutRecord: "com.atproto.repo.putRecord", 875 + ComAtprotoRepoStrongRef: "com.atproto.repo.strongRef", 876 + ComAtprotoRepoUploadBlob: "com.atproto.repo.uploadBlob", 877 + FyiUnravelFrontpageComment: "fyi.unravel.frontpage.comment", 878 + FyiUnravelFrontpagePost: "fyi.unravel.frontpage.post", 879 + FyiUnravelFrontpageVote: "fyi.unravel.frontpage.vote", 880 + };
+168
packages/frontpage-atproto-client/src/types/com/atproto/repo/applyWrites.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from "@atproto/xrpc"; 5 + import { ValidationResult, BlobRef } from "@atproto/lexicon"; 6 + import { isObj, hasProp } from "../../../../util"; 7 + import { lexicons } from "../../../../lexicons"; 8 + import { CID } from "multiformats/cid"; 9 + import * as ComAtprotoRepoDefs from "./defs"; 10 + 11 + export interface QueryParams {} 12 + 13 + export interface InputSchema { 14 + /** The handle or DID of the repo (aka, current account). */ 15 + repo: string; 16 + /** Can be set to 'false' to skip Lexicon schema validation of record data across all operations, 'true' to require it, or leave unset to validate only for known Lexicons. */ 17 + validate?: boolean; 18 + writes: (Create | Update | Delete)[]; 19 + /** If provided, the entire operation will fail if the current repo commit CID does not match this value. Used to prevent conflicting repo mutations. */ 20 + swapCommit?: string; 21 + [k: string]: unknown; 22 + } 23 + 24 + export interface OutputSchema { 25 + commit?: ComAtprotoRepoDefs.CommitMeta; 26 + results?: (CreateResult | UpdateResult | DeleteResult)[]; 27 + [k: string]: unknown; 28 + } 29 + 30 + export interface CallOptions { 31 + signal?: AbortSignal; 32 + headers?: HeadersMap; 33 + qp?: QueryParams; 34 + encoding?: "application/json"; 35 + } 36 + 37 + export interface Response { 38 + success: boolean; 39 + headers: HeadersMap; 40 + data: OutputSchema; 41 + } 42 + 43 + export class InvalidSwapError extends XRPCError { 44 + constructor(src: XRPCError) { 45 + super(src.status, src.error, src.message, src.headers, { cause: src }); 46 + } 47 + } 48 + 49 + export function toKnownErr(e: any) { 50 + if (e instanceof XRPCError) { 51 + if (e.error === "InvalidSwap") return new InvalidSwapError(e); 52 + } 53 + 54 + return e; 55 + } 56 + 57 + /** Operation which creates a new record. */ 58 + export interface Create { 59 + collection: string; 60 + rkey?: string; 61 + value: {}; 62 + [k: string]: unknown; 63 + } 64 + 65 + export function isCreate(v: unknown): v is Create { 66 + return ( 67 + isObj(v) && 68 + hasProp(v, "$type") && 69 + v.$type === "com.atproto.repo.applyWrites#create" 70 + ); 71 + } 72 + 73 + export function validateCreate(v: unknown): ValidationResult { 74 + return lexicons.validate("com.atproto.repo.applyWrites#create", v); 75 + } 76 + 77 + /** Operation which updates an existing record. */ 78 + export interface Update { 79 + collection: string; 80 + rkey: string; 81 + value: {}; 82 + [k: string]: unknown; 83 + } 84 + 85 + export function isUpdate(v: unknown): v is Update { 86 + return ( 87 + isObj(v) && 88 + hasProp(v, "$type") && 89 + v.$type === "com.atproto.repo.applyWrites#update" 90 + ); 91 + } 92 + 93 + export function validateUpdate(v: unknown): ValidationResult { 94 + return lexicons.validate("com.atproto.repo.applyWrites#update", v); 95 + } 96 + 97 + /** Operation which deletes an existing record. */ 98 + export interface Delete { 99 + collection: string; 100 + rkey: string; 101 + [k: string]: unknown; 102 + } 103 + 104 + export function isDelete(v: unknown): v is Delete { 105 + return ( 106 + isObj(v) && 107 + hasProp(v, "$type") && 108 + v.$type === "com.atproto.repo.applyWrites#delete" 109 + ); 110 + } 111 + 112 + export function validateDelete(v: unknown): ValidationResult { 113 + return lexicons.validate("com.atproto.repo.applyWrites#delete", v); 114 + } 115 + 116 + export interface CreateResult { 117 + uri: string; 118 + cid: string; 119 + validationStatus?: "valid" | "unknown" | (string & {}); 120 + [k: string]: unknown; 121 + } 122 + 123 + export function isCreateResult(v: unknown): v is CreateResult { 124 + return ( 125 + isObj(v) && 126 + hasProp(v, "$type") && 127 + v.$type === "com.atproto.repo.applyWrites#createResult" 128 + ); 129 + } 130 + 131 + export function validateCreateResult(v: unknown): ValidationResult { 132 + return lexicons.validate("com.atproto.repo.applyWrites#createResult", v); 133 + } 134 + 135 + export interface UpdateResult { 136 + uri: string; 137 + cid: string; 138 + validationStatus?: "valid" | "unknown" | (string & {}); 139 + [k: string]: unknown; 140 + } 141 + 142 + export function isUpdateResult(v: unknown): v is UpdateResult { 143 + return ( 144 + isObj(v) && 145 + hasProp(v, "$type") && 146 + v.$type === "com.atproto.repo.applyWrites#updateResult" 147 + ); 148 + } 149 + 150 + export function validateUpdateResult(v: unknown): ValidationResult { 151 + return lexicons.validate("com.atproto.repo.applyWrites#updateResult", v); 152 + } 153 + 154 + export interface DeleteResult { 155 + [k: string]: unknown; 156 + } 157 + 158 + export function isDeleteResult(v: unknown): v is DeleteResult { 159 + return ( 160 + isObj(v) && 161 + hasProp(v, "$type") && 162 + v.$type === "com.atproto.repo.applyWrites#deleteResult" 163 + ); 164 + } 165 + 166 + export function validateDeleteResult(v: unknown): ValidationResult { 167 + return lexicons.validate("com.atproto.repo.applyWrites#deleteResult", v); 168 + }
+62
packages/frontpage-atproto-client/src/types/com/atproto/repo/createRecord.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from "@atproto/xrpc"; 5 + import { ValidationResult, BlobRef } from "@atproto/lexicon"; 6 + import { isObj, hasProp } from "../../../../util"; 7 + import { lexicons } from "../../../../lexicons"; 8 + import { CID } from "multiformats/cid"; 9 + import * as ComAtprotoRepoDefs from "./defs"; 10 + 11 + export interface QueryParams {} 12 + 13 + export interface InputSchema { 14 + /** The handle or DID of the repo (aka, current account). */ 15 + repo: string; 16 + /** The NSID of the record collection. */ 17 + collection: string; 18 + /** The Record Key. */ 19 + rkey?: string; 20 + /** 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. */ 21 + validate?: boolean; 22 + /** The record itself. Must contain a $type field. */ 23 + record: {}; 24 + /** Compare and swap with the previous commit by CID. */ 25 + swapCommit?: string; 26 + [k: string]: unknown; 27 + } 28 + 29 + export interface OutputSchema { 30 + uri: string; 31 + cid: string; 32 + commit?: ComAtprotoRepoDefs.CommitMeta; 33 + validationStatus?: "valid" | "unknown" | (string & {}); 34 + [k: string]: unknown; 35 + } 36 + 37 + export interface CallOptions { 38 + signal?: AbortSignal; 39 + headers?: HeadersMap; 40 + qp?: QueryParams; 41 + encoding?: "application/json"; 42 + } 43 + 44 + export interface Response { 45 + success: boolean; 46 + headers: HeadersMap; 47 + data: OutputSchema; 48 + } 49 + 50 + export class InvalidSwapError extends XRPCError { 51 + constructor(src: XRPCError) { 52 + super(src.status, src.error, src.message, src.headers, { cause: src }); 53 + } 54 + } 55 + 56 + export function toKnownErr(e: any) { 57 + if (e instanceof XRPCError) { 58 + if (e.error === "InvalidSwap") return new InvalidSwapError(e); 59 + } 60 + 61 + return e; 62 + }
+25
packages/frontpage-atproto-client/src/types/com/atproto/repo/defs.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { ValidationResult, BlobRef } from "@atproto/lexicon"; 5 + import { isObj, hasProp } from "../../../../util"; 6 + import { lexicons } from "../../../../lexicons"; 7 + import { CID } from "multiformats/cid"; 8 + 9 + export interface CommitMeta { 10 + cid: string; 11 + rev: string; 12 + [k: string]: unknown; 13 + } 14 + 15 + export function isCommitMeta(v: unknown): v is CommitMeta { 16 + return ( 17 + isObj(v) && 18 + hasProp(v, "$type") && 19 + v.$type === "com.atproto.repo.defs#commitMeta" 20 + ); 21 + } 22 + 23 + export function validateCommitMeta(v: unknown): ValidationResult { 24 + return lexicons.validate("com.atproto.repo.defs#commitMeta", v); 25 + }
+57
packages/frontpage-atproto-client/src/types/com/atproto/repo/deleteRecord.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from "@atproto/xrpc"; 5 + import { ValidationResult, BlobRef } from "@atproto/lexicon"; 6 + import { isObj, hasProp } from "../../../../util"; 7 + import { lexicons } from "../../../../lexicons"; 8 + import { CID } from "multiformats/cid"; 9 + import * as ComAtprotoRepoDefs from "./defs"; 10 + 11 + export interface QueryParams {} 12 + 13 + export interface InputSchema { 14 + /** The handle or DID of the repo (aka, current account). */ 15 + repo: string; 16 + /** The NSID of the record collection. */ 17 + collection: string; 18 + /** The Record Key. */ 19 + rkey: string; 20 + /** Compare and swap with the previous record by CID. */ 21 + swapRecord?: string; 22 + /** Compare and swap with the previous commit by CID. */ 23 + swapCommit?: string; 24 + [k: string]: unknown; 25 + } 26 + 27 + export interface OutputSchema { 28 + commit?: ComAtprotoRepoDefs.CommitMeta; 29 + [k: string]: unknown; 30 + } 31 + 32 + export interface CallOptions { 33 + signal?: AbortSignal; 34 + headers?: HeadersMap; 35 + qp?: QueryParams; 36 + encoding?: "application/json"; 37 + } 38 + 39 + export interface Response { 40 + success: boolean; 41 + headers: HeadersMap; 42 + data: OutputSchema; 43 + } 44 + 45 + export class InvalidSwapError extends XRPCError { 46 + constructor(src: XRPCError) { 47 + super(src.status, src.error, src.message, src.headers, { cause: src }); 48 + } 49 + } 50 + 51 + export function toKnownErr(e: any) { 52 + if (e instanceof XRPCError) { 53 + if (e.error === "InvalidSwap") return new InvalidSwapError(e); 54 + } 55 + 56 + return e; 57 + }
+42
packages/frontpage-atproto-client/src/types/com/atproto/repo/describeRepo.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from "@atproto/xrpc"; 5 + import { ValidationResult, BlobRef } from "@atproto/lexicon"; 6 + import { isObj, hasProp } from "../../../../util"; 7 + import { lexicons } from "../../../../lexicons"; 8 + import { CID } from "multiformats/cid"; 9 + 10 + export interface QueryParams { 11 + /** The handle or DID of the repo. */ 12 + repo: string; 13 + } 14 + 15 + export type InputSchema = undefined; 16 + 17 + export interface OutputSchema { 18 + handle: string; 19 + did: string; 20 + /** The complete DID document for this account. */ 21 + didDoc: {}; 22 + /** List of all the collections (NSIDs) for which this repo contains at least one record. */ 23 + collections: string[]; 24 + /** Indicates if handle is currently valid (resolves bi-directionally) */ 25 + handleIsCorrect: boolean; 26 + [k: string]: unknown; 27 + } 28 + 29 + export interface CallOptions { 30 + signal?: AbortSignal; 31 + headers?: HeadersMap; 32 + } 33 + 34 + export interface Response { 35 + success: boolean; 36 + headers: HeadersMap; 37 + data: OutputSchema; 38 + } 39 + 40 + export function toKnownErr(e: any) { 41 + return e; 42 + }
+53
packages/frontpage-atproto-client/src/types/com/atproto/repo/getRecord.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from "@atproto/xrpc"; 5 + import { ValidationResult, BlobRef } from "@atproto/lexicon"; 6 + import { isObj, hasProp } from "../../../../util"; 7 + import { lexicons } from "../../../../lexicons"; 8 + import { CID } from "multiformats/cid"; 9 + 10 + export interface QueryParams { 11 + /** The handle or DID of the repo. */ 12 + repo: string; 13 + /** The NSID of the record collection. */ 14 + collection: string; 15 + /** The Record Key. */ 16 + rkey: string; 17 + /** The CID of the version of the record. If not specified, then return the most recent version. */ 18 + cid?: string; 19 + } 20 + 21 + export type InputSchema = undefined; 22 + 23 + export interface OutputSchema { 24 + uri: string; 25 + cid?: string; 26 + value: {}; 27 + [k: string]: unknown; 28 + } 29 + 30 + export interface CallOptions { 31 + signal?: AbortSignal; 32 + headers?: HeadersMap; 33 + } 34 + 35 + export interface Response { 36 + success: boolean; 37 + headers: HeadersMap; 38 + data: OutputSchema; 39 + } 40 + 41 + export class RecordNotFoundError extends XRPCError { 42 + constructor(src: XRPCError) { 43 + super(src.status, src.error, src.message, src.headers, { cause: src }); 44 + } 45 + } 46 + 47 + export function toKnownErr(e: any) { 48 + if (e instanceof XRPCError) { 49 + if (e.error === "RecordNotFound") return new RecordNotFoundError(e); 50 + } 51 + 52 + return e; 53 + }
+28
packages/frontpage-atproto-client/src/types/com/atproto/repo/importRepo.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from "@atproto/xrpc"; 5 + import { ValidationResult, BlobRef } from "@atproto/lexicon"; 6 + import { isObj, hasProp } from "../../../../util"; 7 + import { lexicons } from "../../../../lexicons"; 8 + import { CID } from "multiformats/cid"; 9 + 10 + export interface QueryParams {} 11 + 12 + export type InputSchema = string | Uint8Array | Blob; 13 + 14 + export interface CallOptions { 15 + signal?: AbortSignal; 16 + headers?: HeadersMap; 17 + qp?: QueryParams; 18 + encoding?: "application/vnd.ipld.car"; 19 + } 20 + 21 + export interface Response { 22 + success: boolean; 23 + headers: HeadersMap; 24 + } 25 + 26 + export function toKnownErr(e: any) { 27 + return e; 28 + }
+54
packages/frontpage-atproto-client/src/types/com/atproto/repo/listMissingBlobs.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from "@atproto/xrpc"; 5 + import { ValidationResult, BlobRef } from "@atproto/lexicon"; 6 + import { isObj, hasProp } from "../../../../util"; 7 + import { lexicons } from "../../../../lexicons"; 8 + import { CID } from "multiformats/cid"; 9 + 10 + export interface QueryParams { 11 + limit?: number; 12 + cursor?: string; 13 + } 14 + 15 + export type InputSchema = undefined; 16 + 17 + export interface OutputSchema { 18 + cursor?: string; 19 + blobs: RecordBlob[]; 20 + [k: string]: unknown; 21 + } 22 + 23 + export interface CallOptions { 24 + signal?: AbortSignal; 25 + headers?: HeadersMap; 26 + } 27 + 28 + export interface Response { 29 + success: boolean; 30 + headers: HeadersMap; 31 + data: OutputSchema; 32 + } 33 + 34 + export function toKnownErr(e: any) { 35 + return e; 36 + } 37 + 38 + export interface RecordBlob { 39 + cid: string; 40 + recordUri: string; 41 + [k: string]: unknown; 42 + } 43 + 44 + export function isRecordBlob(v: unknown): v is RecordBlob { 45 + return ( 46 + isObj(v) && 47 + hasProp(v, "$type") && 48 + v.$type === "com.atproto.repo.listMissingBlobs#recordBlob" 49 + ); 50 + } 51 + 52 + export function validateRecordBlob(v: unknown): ValidationResult { 53 + return lexicons.validate("com.atproto.repo.listMissingBlobs#recordBlob", v); 54 + }
+66
packages/frontpage-atproto-client/src/types/com/atproto/repo/listRecords.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from "@atproto/xrpc"; 5 + import { ValidationResult, BlobRef } from "@atproto/lexicon"; 6 + import { isObj, hasProp } from "../../../../util"; 7 + import { lexicons } from "../../../../lexicons"; 8 + import { CID } from "multiformats/cid"; 9 + 10 + export interface QueryParams { 11 + /** The handle or DID of the repo. */ 12 + repo: string; 13 + /** The NSID of the record type. */ 14 + collection: string; 15 + /** The number of records to return. */ 16 + limit?: number; 17 + cursor?: string; 18 + /** DEPRECATED: The lowest sort-ordered rkey to start from (exclusive) */ 19 + rkeyStart?: string; 20 + /** DEPRECATED: The highest sort-ordered rkey to stop at (exclusive) */ 21 + rkeyEnd?: string; 22 + /** Flag to reverse the order of the returned records. */ 23 + reverse?: boolean; 24 + } 25 + 26 + export type InputSchema = undefined; 27 + 28 + export interface OutputSchema { 29 + cursor?: string; 30 + records: Record[]; 31 + [k: string]: unknown; 32 + } 33 + 34 + export interface CallOptions { 35 + signal?: AbortSignal; 36 + headers?: HeadersMap; 37 + } 38 + 39 + export interface Response { 40 + success: boolean; 41 + headers: HeadersMap; 42 + data: OutputSchema; 43 + } 44 + 45 + export function toKnownErr(e: any) { 46 + return e; 47 + } 48 + 49 + export interface Record { 50 + uri: string; 51 + cid: string; 52 + value: {}; 53 + [k: string]: unknown; 54 + } 55 + 56 + export function isRecord(v: unknown): v is Record { 57 + return ( 58 + isObj(v) && 59 + hasProp(v, "$type") && 60 + v.$type === "com.atproto.repo.listRecords#record" 61 + ); 62 + } 63 + 64 + export function validateRecord(v: unknown): ValidationResult { 65 + return lexicons.validate("com.atproto.repo.listRecords#record", v); 66 + }
+64
packages/frontpage-atproto-client/src/types/com/atproto/repo/putRecord.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from "@atproto/xrpc"; 5 + import { ValidationResult, BlobRef } from "@atproto/lexicon"; 6 + import { isObj, hasProp } from "../../../../util"; 7 + import { lexicons } from "../../../../lexicons"; 8 + import { CID } from "multiformats/cid"; 9 + import * as ComAtprotoRepoDefs from "./defs"; 10 + 11 + export interface QueryParams {} 12 + 13 + export interface InputSchema { 14 + /** The handle or DID of the repo (aka, current account). */ 15 + repo: string; 16 + /** The NSID of the record collection. */ 17 + collection: string; 18 + /** The Record Key. */ 19 + rkey: string; 20 + /** 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. */ 21 + validate?: boolean; 22 + /** The record to write. */ 23 + record: {}; 24 + /** Compare and swap with the previous record by CID. WARNING: nullable and optional field; may cause problems with golang implementation */ 25 + swapRecord?: string | null; 26 + /** Compare and swap with the previous commit by CID. */ 27 + swapCommit?: string; 28 + [k: string]: unknown; 29 + } 30 + 31 + export interface OutputSchema { 32 + uri: string; 33 + cid: string; 34 + commit?: ComAtprotoRepoDefs.CommitMeta; 35 + validationStatus?: "valid" | "unknown" | (string & {}); 36 + [k: string]: unknown; 37 + } 38 + 39 + export interface CallOptions { 40 + signal?: AbortSignal; 41 + headers?: HeadersMap; 42 + qp?: QueryParams; 43 + encoding?: "application/json"; 44 + } 45 + 46 + export interface Response { 47 + success: boolean; 48 + headers: HeadersMap; 49 + data: OutputSchema; 50 + } 51 + 52 + export class InvalidSwapError extends XRPCError { 53 + constructor(src: XRPCError) { 54 + super(src.status, src.error, src.message, src.headers, { cause: src }); 55 + } 56 + } 57 + 58 + export function toKnownErr(e: any) { 59 + if (e instanceof XRPCError) { 60 + if (e.error === "InvalidSwap") return new InvalidSwapError(e); 61 + } 62 + 63 + return e; 64 + }
+26
packages/frontpage-atproto-client/src/types/com/atproto/repo/strongRef.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { ValidationResult, BlobRef } from "@atproto/lexicon"; 5 + import { isObj, hasProp } from "../../../../util"; 6 + import { lexicons } from "../../../../lexicons"; 7 + import { CID } from "multiformats/cid"; 8 + 9 + export interface Main { 10 + uri: string; 11 + cid: string; 12 + [k: string]: unknown; 13 + } 14 + 15 + export function isMain(v: unknown): v is Main { 16 + return ( 17 + isObj(v) && 18 + hasProp(v, "$type") && 19 + (v.$type === "com.atproto.repo.strongRef#main" || 20 + v.$type === "com.atproto.repo.strongRef") 21 + ); 22 + } 23 + 24 + export function validateMain(v: unknown): ValidationResult { 25 + return lexicons.validate("com.atproto.repo.strongRef#main", v); 26 + }
+34
packages/frontpage-atproto-client/src/types/com/atproto/repo/uploadBlob.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from "@atproto/xrpc"; 5 + import { ValidationResult, BlobRef } from "@atproto/lexicon"; 6 + import { isObj, hasProp } from "../../../../util"; 7 + import { lexicons } from "../../../../lexicons"; 8 + import { CID } from "multiformats/cid"; 9 + 10 + export interface QueryParams {} 11 + 12 + export type InputSchema = string | Uint8Array | Blob; 13 + 14 + export interface OutputSchema { 15 + blob: BlobRef; 16 + [k: string]: unknown; 17 + } 18 + 19 + export interface CallOptions { 20 + signal?: AbortSignal; 21 + headers?: HeadersMap; 22 + qp?: QueryParams; 23 + encoding?: string; 24 + } 25 + 26 + export interface Response { 27 + success: boolean; 28 + headers: HeadersMap; 29 + data: OutputSchema; 30 + } 31 + 32 + export function toKnownErr(e: any) { 33 + return e; 34 + }
+31
packages/frontpage-atproto-client/src/types/fyi/unravel/frontpage/comment.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { ValidationResult, BlobRef } from "@atproto/lexicon"; 5 + import { isObj, hasProp } from "../../../../util"; 6 + import { lexicons } from "../../../../lexicons"; 7 + import { CID } from "multiformats/cid"; 8 + import * as ComAtprotoRepoStrongRef from "../../../com/atproto/repo/strongRef"; 9 + 10 + export interface Record { 11 + /** The content of the comment. */ 12 + content: string; 13 + /** Client-declared timestamp when this comment was originally created. */ 14 + createdAt: string; 15 + parent?: ComAtprotoRepoStrongRef.Main; 16 + post: ComAtprotoRepoStrongRef.Main; 17 + [k: string]: unknown; 18 + } 19 + 20 + export function isRecord(v: unknown): v is Record { 21 + return ( 22 + isObj(v) && 23 + hasProp(v, "$type") && 24 + (v.$type === "fyi.unravel.frontpage.comment#main" || 25 + v.$type === "fyi.unravel.frontpage.comment") 26 + ); 27 + } 28 + 29 + export function validateRecord(v: unknown): ValidationResult { 30 + return lexicons.validate("fyi.unravel.frontpage.comment#main", v); 31 + }
+30
packages/frontpage-atproto-client/src/types/fyi/unravel/frontpage/post.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { ValidationResult, BlobRef } from "@atproto/lexicon"; 5 + import { isObj, hasProp } from "../../../../util"; 6 + import { lexicons } from "../../../../lexicons"; 7 + import { CID } from "multiformats/cid"; 8 + 9 + export interface Record { 10 + /** The title of the post. */ 11 + title: string; 12 + /** The URL of the post. */ 13 + url: string; 14 + /** Client-declared timestamp when this post was originally created. */ 15 + createdAt: string; 16 + [k: string]: unknown; 17 + } 18 + 19 + export function isRecord(v: unknown): v is Record { 20 + return ( 21 + isObj(v) && 22 + hasProp(v, "$type") && 23 + (v.$type === "fyi.unravel.frontpage.post#main" || 24 + v.$type === "fyi.unravel.frontpage.post") 25 + ); 26 + } 27 + 28 + export function validateRecord(v: unknown): ValidationResult { 29 + return lexicons.validate("fyi.unravel.frontpage.post#main", v); 30 + }
+28
packages/frontpage-atproto-client/src/types/fyi/unravel/frontpage/vote.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { ValidationResult, BlobRef } from "@atproto/lexicon"; 5 + import { isObj, hasProp } from "../../../../util"; 6 + import { lexicons } from "../../../../lexicons"; 7 + import { CID } from "multiformats/cid"; 8 + import * as ComAtprotoRepoStrongRef from "../../../com/atproto/repo/strongRef"; 9 + 10 + export interface Record { 11 + subject: ComAtprotoRepoStrongRef.Main; 12 + /** Client-declared timestamp when this vote was originally created. */ 13 + createdAt: string; 14 + [k: string]: unknown; 15 + } 16 + 17 + export function isRecord(v: unknown): v is Record { 18 + return ( 19 + isObj(v) && 20 + hasProp(v, "$type") && 21 + (v.$type === "fyi.unravel.frontpage.vote#main" || 22 + v.$type === "fyi.unravel.frontpage.vote") 23 + ); 24 + } 25 + 26 + export function validateRecord(v: unknown): ValidationResult { 27 + return lexicons.validate("fyi.unravel.frontpage.vote#main", v); 28 + }
+13
packages/frontpage-atproto-client/src/util.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + export function isObj(v: unknown): v is Record<string, unknown> { 5 + return typeof v === "object" && v !== null; 6 + } 7 + 8 + export function hasProp<K extends PropertyKey>( 9 + data: object, 10 + prop: K, 11 + ): data is Record<K, unknown> { 12 + return prop in data; 13 + }
+8
packages/frontpage-atproto-client/tsconfig.json
··· 1 + { 2 + "extends": "@repo/typescript-config/base.json", 3 + "include": ["src/**/*.ts", "fetch-lexicons.mts"], 4 + "compilerOptions": { 5 + "module": "Preserve", 6 + "moduleResolution": "Bundler" 7 + } 8 + }
+141 -5
pnpm-lock.yaml
··· 284 284 specifier: ^2.0.4 285 285 version: 2.0.4(@types/node@20.13.0)(jsdom@24.1.1(bufferutil@4.0.8)(utf-8-validate@6.0.3))(terser@5.34.1) 286 286 287 + packages/frontpage-atproto-client: 288 + dependencies: 289 + '@atproto/lexicon': 290 + specifier: ^0.4.2 291 + version: 0.4.2 292 + '@atproto/xrpc': 293 + specifier: ^0.6.3 294 + version: 0.6.3 295 + multiformats: 296 + specifier: ^13.3.0 297 + version: 13.3.0 298 + devDependencies: 299 + '@atproto/lex-cli': 300 + specifier: ^0.5.1 301 + version: 0.5.1 302 + '@repo/typescript-config': 303 + specifier: workspace:* 304 + version: link:../typescript-config 305 + '@types/adm-zip': 306 + specifier: ^0.5.5 307 + version: 0.5.5 308 + '@types/node': 309 + specifier: ^20 310 + version: 20.13.0 311 + adm-zip: 312 + specifier: ^0.5.16 313 + version: 0.5.16 314 + tsx: 315 + specifier: ^4.16.5 316 + version: 4.16.5 317 + 287 318 packages/typescript-config: {} 288 319 289 320 packages/unravel: ··· 363 394 '@atproto/common-web@0.3.0': 364 395 resolution: {integrity: sha512-67VnV6JJyX+ZWyjV7xFQMypAgDmjVaR9ZCuU/QW+mqlqI7fex2uL4Fv+7/jHadgzhuJHVd6OHOvNn0wR5WZYtA==} 365 396 397 + '@atproto/common-web@0.3.1': 398 + resolution: {integrity: sha512-N7wiTnus5vAr+lT//0y8m/FaHHLJ9LpGuEwkwDAeV3LCiPif4m/FS8x/QOYrx1PdZQwKso95RAPzCGWQBH5j6Q==} 399 + 366 400 '@atproto/common@0.4.1': 367 401 resolution: {integrity: sha512-uL7kQIcBTbvkBDNfxMXL6lBH4fO2DQpHd2BryJxMtbw/4iEPKe9xBYApwECHhEIk9+zhhpTRZ15FJ3gxTXN82Q==} 368 402 ··· 378 412 '@atproto/jwk@0.1.1': 379 413 resolution: {integrity: sha512-6h/bj1APUk7QcV9t/oA6+9DB5NZx9SZru9x+/pV5oHFI9Xz4ZuM5+dq1PfsJV54pZyqdnZ6W6M717cxoC7q7og==} 380 414 381 - '@atproto/lexicon@0.4.1': 382 - resolution: {integrity: sha512-bzyr+/VHXLQWbumViX5L7h1NKQObfs8Z+XZJl43OUK8nYFUI4e/sW1IZKRNfw7Wvi5YVNK+J+yP3DWIBZhkCYA==} 415 + '@atproto/lex-cli@0.5.1': 416 + resolution: {integrity: sha512-Xp9Ifvl523TdKzTtsOmWN0LQAEEaHSAdZ9AZEpkH7BT6FGDURPUqcElkU9IlLz9tQf/CTGgRk55AQQ6wf4j/5g==} 417 + hasBin: true 418 + 419 + '@atproto/lexicon@0.4.2': 420 + resolution: {integrity: sha512-CXoOkhcdF3XVUnR2oNgCs2ljWfo/8zUjxL5RIhJW/UNLp/FSl+KpF8Jm5fbk8Y/XXVPGRAsv9OYfxyU/14N/pw==} 383 421 384 422 '@atproto/oauth-types@0.1.2': 385 423 resolution: {integrity: sha512-yySPPTLxteFJ3O3xVWEhvBFx7rczgo4LK2nQNeqAPMZdYd5dpgvuZZ88nQQge074BfuOc0MWTnr0kPdxQMjjPw==} ··· 389 427 390 428 '@atproto/syntax@0.3.0': 391 429 resolution: {integrity: sha512-Weq0ZBxffGHDXHl9U7BQc2BFJi/e23AL+k+i5+D9hUq/bzT4yjGsrCejkjq0xt82xXDjmhhvQSZ0LqxyZ5woxA==} 430 + 431 + '@atproto/xrpc@0.6.3': 432 + resolution: {integrity: sha512-S3tRvOdA9amPkKLll3rc4vphlDitLrkN5TwWh5Tu/jzk7mnobVVE3akYgICV9XCNHKjWM+IAPxFFI2qi+VW6nQ==} 392 433 393 434 '@babel/code-frame@7.24.7': 394 435 resolution: {integrity: sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==} ··· 2407 2448 '@types/react-dom': 2408 2449 optional: true 2409 2450 2451 + '@ts-morph/common@0.17.0': 2452 + resolution: {integrity: sha512-RMSSvSfs9kb0VzkvQ2NWobwnj7TxCA9vI/IjR9bDHqgAyVbu2T0DN4wiKVqomyDWqO7dPr/tErSfq7urQ1Q37g==} 2453 + 2454 + '@types/adm-zip@0.5.5': 2455 + resolution: {integrity: sha512-YCGstVMjc4LTY5uK9/obvxBya93axZOVOyf2GSUulADzmLhYE45u2nAssCs/fWBs1Ifq5Vat75JTPwd5XZoPJw==} 2456 + 2410 2457 '@types/aria-query@5.0.4': 2411 2458 resolution: {integrity: sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==} 2412 2459 ··· 2765 2812 resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} 2766 2813 engines: {node: '>=0.4.0'} 2767 2814 hasBin: true 2815 + 2816 + adm-zip@0.5.16: 2817 + resolution: {integrity: sha512-TGw5yVi4saajsSEgz25grObGHEUaDrniwvA2qwSC060KfqGPdglhvPMA2lPIoxs3PQIItj2iag35fONcQqgUaQ==} 2818 + engines: {node: '>=12.0'} 2768 2819 2769 2820 agent-base@6.0.2: 2770 2821 resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} ··· 3056 3107 resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==} 3057 3108 engines: {node: '>=6'} 3058 3109 3110 + code-block-writer@11.0.3: 3111 + resolution: {integrity: sha512-NiujjUFB4SwScJq2bwbYUtXbZhBSlY6vYzm++3Q6oC+U+injTqfPYFK8wS9COOmb2lueqp0ZRB4nK1VYeHgNyw==} 3112 + 3059 3113 color-convert@1.9.3: 3060 3114 resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} 3061 3115 ··· 3086 3140 commander@4.1.1: 3087 3141 resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} 3088 3142 engines: {node: '>= 6'} 3143 + 3144 + commander@9.5.0: 3145 + resolution: {integrity: sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==} 3146 + engines: {node: ^12.20.0 || >=14} 3089 3147 3090 3148 commondir@1.0.1: 3091 3149 resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} ··· 4367 4425 minimatch@3.1.2: 4368 4426 resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} 4369 4427 4428 + minimatch@5.1.6: 4429 + resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} 4430 + engines: {node: '>=10'} 4431 + 4370 4432 minimatch@8.0.4: 4371 4433 resolution: {integrity: sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA==} 4372 4434 engines: {node: '>=16 || 14 >=14.17'} ··· 4393 4455 mkdirp-classic@0.5.3: 4394 4456 resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==} 4395 4457 4458 + mkdirp@1.0.4: 4459 + resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} 4460 + engines: {node: '>=10'} 4461 + hasBin: true 4462 + 4396 4463 module-details-from-path@1.0.3: 4397 4464 resolution: {integrity: sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A==} 4398 4465 ··· 4402 4469 ms@2.1.3: 4403 4470 resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} 4404 4471 4472 + multiformats@13.3.0: 4473 + resolution: {integrity: sha512-CBiqvsufgmpo01VT5ze94O+uc+Pbf6f/sThlvWss0sBZmAOu6GQn5usrYV2sf2mr17FWYc0rO8c/CNe2T90QAA==} 4474 + 4405 4475 multiformats@9.9.0: 4406 4476 resolution: {integrity: sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==} 4407 4477 ··· 4606 4676 4607 4677 parse5@7.1.2: 4608 4678 resolution: {integrity: sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==} 4679 + 4680 + path-browserify@1.0.1: 4681 + resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} 4609 4682 4610 4683 path-exists@4.0.0: 4611 4684 resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} ··· 5392 5465 ts-interface-checker@0.1.13: 5393 5466 resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} 5394 5467 5468 + ts-morph@16.0.0: 5469 + resolution: {integrity: sha512-jGNF0GVpFj0orFw55LTsQxVYEUOCWBAbR5Ls7fTYE5pQsbW18ssTb/6UXx/GYAEjS+DQTp8VoTw0vqYMiaaQuw==} 5470 + 5395 5471 tsconfck@3.1.1: 5396 5472 resolution: {integrity: sha512-00eoI6WY57SvZEVjm13stEVE90VkEdJAFGgpFLTsZbJyW/LwFQ7uQxJHWpZ2hzSWgCPKc9AnBnNP+0X7o3hAmQ==} 5397 5473 engines: {node: ^18 || >=20} ··· 5785 5861 engines: {node: '>= 14'} 5786 5862 hasBin: true 5787 5863 5864 + yesno@0.4.0: 5865 + resolution: {integrity: sha512-tdBxmHvbXPBKYIg81bMCB7bVeDmHkRzk5rVJyYYXurwKkHq/MCd8rz4HSJUP7hW0H2NlXiq8IFiWvYKEHhlotA==} 5866 + 5788 5867 yocto-queue@0.1.0: 5789 5868 resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} 5790 5869 engines: {node: '>=10'} ··· 5820 5899 uint8arrays: 3.0.0 5821 5900 zod: 3.23.8 5822 5901 5902 + '@atproto/common-web@0.3.1': 5903 + dependencies: 5904 + graphemer: 1.4.0 5905 + multiformats: 9.9.0 5906 + uint8arrays: 3.0.0 5907 + zod: 3.23.8 5908 + 5823 5909 '@atproto/common@0.4.1': 5824 5910 dependencies: 5825 5911 '@atproto/common-web': 0.3.0 ··· 5852 5938 multiformats: 9.9.0 5853 5939 zod: 3.23.8 5854 5940 5855 - '@atproto/lexicon@0.4.1': 5941 + '@atproto/lex-cli@0.5.1': 5856 5942 dependencies: 5857 - '@atproto/common-web': 0.3.0 5943 + '@atproto/lexicon': 0.4.2 5944 + '@atproto/syntax': 0.3.0 5945 + chalk: 4.1.2 5946 + commander: 9.5.0 5947 + prettier: 3.3.0 5948 + ts-morph: 16.0.0 5949 + yesno: 0.4.0 5950 + zod: 3.23.8 5951 + 5952 + '@atproto/lexicon@0.4.2': 5953 + dependencies: 5954 + '@atproto/common-web': 0.3.1 5858 5955 '@atproto/syntax': 0.3.0 5859 5956 iso-datestring-validator: 2.2.2 5860 5957 multiformats: 9.9.0 ··· 5870 5967 '@atproto/common': 0.4.1 5871 5968 '@atproto/common-web': 0.3.0 5872 5969 '@atproto/crypto': 0.4.1 5873 - '@atproto/lexicon': 0.4.1 5970 + '@atproto/lexicon': 0.4.2 5874 5971 '@ipld/car': 3.2.4 5875 5972 '@ipld/dag-cbor': 7.0.3 5876 5973 multiformats: 9.9.0 ··· 5879 5976 5880 5977 '@atproto/syntax@0.3.0': {} 5881 5978 5979 + '@atproto/xrpc@0.6.3': 5980 + dependencies: 5981 + '@atproto/lexicon': 0.4.2 5982 + zod: 3.23.8 5983 + 5882 5984 '@babel/code-frame@7.24.7': 5883 5985 dependencies: 5884 5986 '@babel/highlight': 7.24.7 ··· 7785 7887 '@types/react': 18.3.10 7786 7888 '@types/react-dom': 18.3.0 7787 7889 7890 + '@ts-morph/common@0.17.0': 7891 + dependencies: 7892 + fast-glob: 3.3.2 7893 + minimatch: 5.1.6 7894 + mkdirp: 1.0.4 7895 + path-browserify: 1.0.1 7896 + 7897 + '@types/adm-zip@0.5.5': 7898 + dependencies: 7899 + '@types/node': 20.13.0 7900 + 7788 7901 '@types/aria-query@5.0.4': {} 7789 7902 7790 7903 '@types/babel__core@7.20.5': ··· 8350 8463 8351 8464 acorn@8.11.3: {} 8352 8465 8466 + adm-zip@0.5.16: {} 8467 + 8353 8468 agent-base@6.0.2: 8354 8469 dependencies: 8355 8470 debug: 4.3.5 ··· 8696 8811 8697 8812 clsx@2.1.1: {} 8698 8813 8814 + code-block-writer@11.0.3: {} 8815 + 8699 8816 color-convert@1.9.3: 8700 8817 dependencies: 8701 8818 color-name: 1.1.3 ··· 8728 8845 8729 8846 commander@4.1.1: {} 8730 8847 8848 + commander@9.5.0: {} 8849 + 8731 8850 commondir@1.0.1: {} 8732 8851 8733 8852 concat-map@0.0.1: {} ··· 10319 10438 dependencies: 10320 10439 brace-expansion: 1.1.11 10321 10440 10441 + minimatch@5.1.6: 10442 + dependencies: 10443 + brace-expansion: 2.0.1 10444 + 10322 10445 minimatch@8.0.4: 10323 10446 dependencies: 10324 10447 brace-expansion: 2.0.1 ··· 10340 10463 mkdirp-classic@0.5.3: 10341 10464 optional: true 10342 10465 10466 + mkdirp@1.0.4: {} 10467 + 10343 10468 module-details-from-path@1.0.3: {} 10344 10469 10345 10470 ms@2.1.2: {} 10346 10471 10347 10472 ms@2.1.3: {} 10473 + 10474 + multiformats@13.3.0: {} 10348 10475 10349 10476 multiformats@9.9.0: {} 10350 10477 ··· 10597 10724 parse5@7.1.2: 10598 10725 dependencies: 10599 10726 entities: 4.5.0 10727 + 10728 + path-browserify@1.0.1: {} 10600 10729 10601 10730 path-exists@4.0.0: {} 10602 10731 ··· 11472 11601 11473 11602 ts-interface-checker@0.1.13: {} 11474 11603 11604 + ts-morph@16.0.0: 11605 + dependencies: 11606 + '@ts-morph/common': 0.17.0 11607 + code-block-writer: 11.0.3 11608 + 11475 11609 tsconfck@3.1.1(typescript@5.4.5): 11476 11610 optionalDependencies: 11477 11611 typescript: 5.4.5 ··· 11881 12015 yallist@3.1.1: {} 11882 12016 11883 12017 yaml@2.4.2: {} 12018 + 12019 + yesno@0.4.0: {} 11884 12020 11885 12021 yocto-queue@0.1.0: {} 11886 12022