A set of utilities for working with the AT Protocol in Elixir.

feat: include core atproto lexicons as modules

ovyerus.com 31e2da4b f628dd73

verified
Changed files
+3973 -21
lib
atproto
com
atproto
admin
identity
label
lexicon
moderation
repo
server
sync
+3 -19
.gitignore
···
-
# The directory Mix will write compiled artifacts to.
/_build/
-
-
# If you run "mix test --cover", coverage assets end up here.
/cover/
-
-
# The directory Mix downloads your dependencies sources to.
/deps/
-
-
# Where third-party dependencies like ExDoc output generated docs.
/doc/
-
-
# If the VM crashes, it generates a dump, let's ignore it too.
erl_crash.dump
-
-
# Also ignore archive artifacts (built via "mix archive.build").
*.ez
-
-
# Ignore package tarball (built via "mix hex.build").
atex-*.tar
-
-
# Temporary files, for example, from tests.
/tmp/
.envrc
···
.vscode/
.elixir_ls
lexicons
-
lib/atproto
secrets
-
node_modules
-
atproto-oauth-example
.DS_Store
-
CLAUDE.md
+
CLAUDE.md
+
tmp
+
temp
+2 -1
CHANGELOG.md
···
- `deflexicon` now emits structs for records, objects, queries, and procedures.
- `Atex.XRPC.get/3` and `Atex.XRPC.post/3` now support having a lexicon struct
as the second argument instead of the method's name, making it easier to have
-
properly checked API calls.
+
properly checked XRPC calls.
+
- Add pre-transpiled modules for the core `com.atproto` lexicons.
## [0.5.0] - 2025-10-11
+3 -1
README.md
···
- [x] Macro for converting a Lexicon definition into a runtime-validation schema
- [x] Codegen to convert a directory of lexicons
- [x] Oauth stuff
-
- [ ] Extended XRPC client with support for validated inputs/outputs
+
- [x] Extended XRPC client with support for validated inputs/outputs
+
- [ ] Proper MST & CAR handling things
+
- [ ] Pre-transpiled libraries for popular lexicons
## Installation
+11
bump_builtin_lexicons.sh
···
+
#!/usr/bin/env bash
+
+
set -euo pipefail
+
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+
cd "$SCRIPT_DIR"
+
+
mkdir -p ./tmp
+
git clone --depth 1 --single-branch https://github.com/bluesky-social/atproto.git ./tmp/atproto
+
mix atex.lexicons ./tmp/atproto/lexicons/com/atproto/**/*.json
+
rm -rf ./tmp
+73
lib/atproto/com/atproto/admin/defs.ex
···
+
defmodule Com.Atproto.Admin.Defs do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"accountView" => %{
+
"properties" => %{
+
"deactivatedAt" => %{"format" => "datetime", "type" => "string"},
+
"did" => %{"format" => "did", "type" => "string"},
+
"email" => %{"type" => "string"},
+
"emailConfirmedAt" => %{"format" => "datetime", "type" => "string"},
+
"handle" => %{"format" => "handle", "type" => "string"},
+
"indexedAt" => %{"format" => "datetime", "type" => "string"},
+
"inviteNote" => %{"type" => "string"},
+
"invitedBy" => %{
+
"ref" => "com.atproto.server.defs#inviteCode",
+
"type" => "ref"
+
},
+
"invites" => %{
+
"items" => %{
+
"ref" => "com.atproto.server.defs#inviteCode",
+
"type" => "ref"
+
},
+
"type" => "array"
+
},
+
"invitesDisabled" => %{"type" => "boolean"},
+
"relatedRecords" => %{
+
"items" => %{"type" => "unknown"},
+
"type" => "array"
+
},
+
"threatSignatures" => %{
+
"items" => %{"ref" => "#threatSignature", "type" => "ref"},
+
"type" => "array"
+
}
+
},
+
"required" => ["did", "handle", "indexedAt"],
+
"type" => "object"
+
},
+
"repoBlobRef" => %{
+
"properties" => %{
+
"cid" => %{"format" => "cid", "type" => "string"},
+
"did" => %{"format" => "did", "type" => "string"},
+
"recordUri" => %{"format" => "at-uri", "type" => "string"}
+
},
+
"required" => ["did", "cid"],
+
"type" => "object"
+
},
+
"repoRef" => %{
+
"properties" => %{"did" => %{"format" => "did", "type" => "string"}},
+
"required" => ["did"],
+
"type" => "object"
+
},
+
"statusAttr" => %{
+
"properties" => %{
+
"applied" => %{"type" => "boolean"},
+
"ref" => %{"type" => "string"}
+
},
+
"required" => ["applied"],
+
"type" => "object"
+
},
+
"threatSignature" => %{
+
"properties" => %{
+
"property" => %{"type" => "string"},
+
"value" => %{"type" => "string"}
+
},
+
"required" => ["property", "value"],
+
"type" => "object"
+
}
+
},
+
"id" => "com.atproto.admin.defs",
+
"lexicon" => 1
+
})
+
end
+22
lib/atproto/com/atproto/admin/deleteAccount.ex
···
+
defmodule Com.Atproto.Admin.DeleteAccount do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" => "Delete a user account as an administrator.",
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{"did" => %{"format" => "did", "type" => "string"}},
+
"required" => ["did"],
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.admin.deleteAccount",
+
"lexicon" => 1
+
})
+
end
+29
lib/atproto/com/atproto/admin/disableAccountInvites.ex
···
+
defmodule Com.Atproto.Admin.DisableAccountInvites do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Disable an account from receiving new invite codes, but does not invalidate existing codes.",
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"account" => %{"format" => "did", "type" => "string"},
+
"note" => %{
+
"description" => "Optional reason for disabled invites.",
+
"type" => "string"
+
}
+
},
+
"required" => ["account"],
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.admin.disableAccountInvites",
+
"lexicon" => 1
+
})
+
end
+25
lib/atproto/com/atproto/admin/disableInviteCodes.ex
···
+
defmodule Com.Atproto.Admin.DisableInviteCodes do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Disable some set of codes and/or all codes associated with a set of users.",
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"accounts" => %{"items" => %{"type" => "string"}, "type" => "array"},
+
"codes" => %{"items" => %{"type" => "string"}, "type" => "array"}
+
},
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.admin.disableInviteCodes",
+
"lexicon" => 1
+
})
+
end
+28
lib/atproto/com/atproto/admin/enableAccountInvites.ex
···
+
defmodule Com.Atproto.Admin.EnableAccountInvites do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" => "Re-enable an account's ability to receive invite codes.",
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"account" => %{"format" => "did", "type" => "string"},
+
"note" => %{
+
"description" => "Optional reason for enabled invites.",
+
"type" => "string"
+
}
+
},
+
"required" => ["account"],
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.admin.enableAccountInvites",
+
"lexicon" => 1
+
})
+
end
+26
lib/atproto/com/atproto/admin/getAccountInfo.ex
···
+
defmodule Com.Atproto.Admin.GetAccountInfo do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" => "Get details about an account.",
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"ref" => "com.atproto.admin.defs#accountView",
+
"type" => "ref"
+
}
+
},
+
"parameters" => %{
+
"properties" => %{"did" => %{"format" => "did", "type" => "string"}},
+
"required" => ["did"],
+
"type" => "params"
+
},
+
"type" => "query"
+
}
+
},
+
"id" => "com.atproto.admin.getAccountInfo",
+
"lexicon" => 1
+
})
+
end
+40
lib/atproto/com/atproto/admin/getAccountInfos.ex
···
+
defmodule Com.Atproto.Admin.GetAccountInfos do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" => "Get details about some accounts.",
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"infos" => %{
+
"items" => %{
+
"ref" => "com.atproto.admin.defs#accountView",
+
"type" => "ref"
+
},
+
"type" => "array"
+
}
+
},
+
"required" => ["infos"],
+
"type" => "object"
+
}
+
},
+
"parameters" => %{
+
"properties" => %{
+
"dids" => %{
+
"items" => %{"format" => "did", "type" => "string"},
+
"type" => "array"
+
}
+
},
+
"required" => ["dids"],
+
"type" => "params"
+
},
+
"type" => "query"
+
}
+
},
+
"id" => "com.atproto.admin.getAccountInfos",
+
"lexicon" => 1
+
})
+
end
+48
lib/atproto/com/atproto/admin/getInviteCodes.ex
···
+
defmodule Com.Atproto.Admin.GetInviteCodes do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" => "Get an admin view of invite codes.",
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"codes" => %{
+
"items" => %{
+
"ref" => "com.atproto.server.defs#inviteCode",
+
"type" => "ref"
+
},
+
"type" => "array"
+
},
+
"cursor" => %{"type" => "string"}
+
},
+
"required" => ["codes"],
+
"type" => "object"
+
}
+
},
+
"parameters" => %{
+
"properties" => %{
+
"cursor" => %{"type" => "string"},
+
"limit" => %{
+
"default" => 100,
+
"maximum" => 500,
+
"minimum" => 1,
+
"type" => "integer"
+
},
+
"sort" => %{
+
"default" => "recent",
+
"knownValues" => ["recent", "usage"],
+
"type" => "string"
+
}
+
},
+
"type" => "params"
+
},
+
"type" => "query"
+
}
+
},
+
"id" => "com.atproto.admin.getInviteCodes",
+
"lexicon" => 1
+
})
+
end
+48
lib/atproto/com/atproto/admin/getSubjectStatus.ex
···
+
defmodule Com.Atproto.Admin.GetSubjectStatus do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Get the service-specific admin status of a subject (account, record, or blob).",
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"deactivated" => %{
+
"ref" => "com.atproto.admin.defs#statusAttr",
+
"type" => "ref"
+
},
+
"subject" => %{
+
"refs" => [
+
"com.atproto.admin.defs#repoRef",
+
"com.atproto.repo.strongRef",
+
"com.atproto.admin.defs#repoBlobRef"
+
],
+
"type" => "union"
+
},
+
"takedown" => %{
+
"ref" => "com.atproto.admin.defs#statusAttr",
+
"type" => "ref"
+
}
+
},
+
"required" => ["subject"],
+
"type" => "object"
+
}
+
},
+
"parameters" => %{
+
"properties" => %{
+
"blob" => %{"format" => "cid", "type" => "string"},
+
"did" => %{"format" => "did", "type" => "string"},
+
"uri" => %{"format" => "at-uri", "type" => "string"}
+
},
+
"type" => "params"
+
},
+
"type" => "query"
+
}
+
},
+
"id" => "com.atproto.admin.getSubjectStatus",
+
"lexicon" => 1
+
})
+
end
+44
lib/atproto/com/atproto/admin/searchAccounts.ex
···
+
defmodule Com.Atproto.Admin.SearchAccounts do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" => "Get list of accounts that matches your search query.",
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"accounts" => %{
+
"items" => %{
+
"ref" => "com.atproto.admin.defs#accountView",
+
"type" => "ref"
+
},
+
"type" => "array"
+
},
+
"cursor" => %{"type" => "string"}
+
},
+
"required" => ["accounts"],
+
"type" => "object"
+
}
+
},
+
"parameters" => %{
+
"properties" => %{
+
"cursor" => %{"type" => "string"},
+
"email" => %{"type" => "string"},
+
"limit" => %{
+
"default" => 50,
+
"maximum" => 100,
+
"minimum" => 1,
+
"type" => "integer"
+
}
+
},
+
"type" => "params"
+
},
+
"type" => "query"
+
}
+
},
+
"id" => "com.atproto.admin.searchAccounts",
+
"lexicon" => 1
+
})
+
end
+40
lib/atproto/com/atproto/admin/sendEmail.ex
···
+
defmodule Com.Atproto.Admin.SendEmail do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" => "Send email to a user's account email address.",
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"comment" => %{
+
"description" =>
+
"Additional comment by the sender that won't be used in the email itself but helpful to provide more context for moderators/reviewers",
+
"type" => "string"
+
},
+
"content" => %{"type" => "string"},
+
"recipientDid" => %{"format" => "did", "type" => "string"},
+
"senderDid" => %{"format" => "did", "type" => "string"},
+
"subject" => %{"type" => "string"}
+
},
+
"required" => ["recipientDid", "content", "senderDid"],
+
"type" => "object"
+
}
+
},
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{"sent" => %{"type" => "boolean"}},
+
"required" => ["sent"],
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.admin.sendEmail",
+
"lexicon" => 1
+
})
+
end
+29
lib/atproto/com/atproto/admin/updateAccountEmail.ex
···
+
defmodule Com.Atproto.Admin.UpdateAccountEmail do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" => "Administrative action to update an account's email.",
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"account" => %{
+
"description" => "The handle or DID of the repo.",
+
"format" => "at-identifier",
+
"type" => "string"
+
},
+
"email" => %{"type" => "string"}
+
},
+
"required" => ["account", "email"],
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.admin.updateAccountEmail",
+
"lexicon" => 1
+
})
+
end
+25
lib/atproto/com/atproto/admin/updateAccountHandle.ex
···
+
defmodule Com.Atproto.Admin.UpdateAccountHandle do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" => "Administrative action to update an account's handle.",
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"did" => %{"format" => "did", "type" => "string"},
+
"handle" => %{"format" => "handle", "type" => "string"}
+
},
+
"required" => ["did", "handle"],
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.admin.updateAccountHandle",
+
"lexicon" => 1
+
})
+
end
+25
lib/atproto/com/atproto/admin/updateAccountPassword.ex
···
+
defmodule Com.Atproto.Admin.UpdateAccountPassword do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" => "Update the password for a user account as an administrator.",
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"did" => %{"format" => "did", "type" => "string"},
+
"password" => %{"type" => "string"}
+
},
+
"required" => ["did", "password"],
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.admin.updateAccountPassword",
+
"lexicon" => 1
+
})
+
end
+30
lib/atproto/com/atproto/admin/updateAccountSigningKey.ex
···
+
defmodule Com.Atproto.Admin.UpdateAccountSigningKey do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Administrative action to update an account's signing key in their Did document.",
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"did" => %{"format" => "did", "type" => "string"},
+
"signingKey" => %{
+
"description" => "Did-key formatted public key",
+
"format" => "did",
+
"type" => "string"
+
}
+
},
+
"required" => ["did", "signingKey"],
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.admin.updateAccountSigningKey",
+
"lexicon" => 1
+
})
+
end
+61
lib/atproto/com/atproto/admin/updateSubjectStatus.ex
···
+
defmodule Com.Atproto.Admin.UpdateSubjectStatus do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Update the service-specific admin status of a subject (account, record, or blob).",
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"deactivated" => %{
+
"ref" => "com.atproto.admin.defs#statusAttr",
+
"type" => "ref"
+
},
+
"subject" => %{
+
"refs" => [
+
"com.atproto.admin.defs#repoRef",
+
"com.atproto.repo.strongRef",
+
"com.atproto.admin.defs#repoBlobRef"
+
],
+
"type" => "union"
+
},
+
"takedown" => %{
+
"ref" => "com.atproto.admin.defs#statusAttr",
+
"type" => "ref"
+
}
+
},
+
"required" => ["subject"],
+
"type" => "object"
+
}
+
},
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"subject" => %{
+
"refs" => [
+
"com.atproto.admin.defs#repoRef",
+
"com.atproto.repo.strongRef",
+
"com.atproto.admin.defs#repoBlobRef"
+
],
+
"type" => "union"
+
},
+
"takedown" => %{
+
"ref" => "com.atproto.admin.defs#statusAttr",
+
"type" => "ref"
+
}
+
},
+
"required" => ["subject"],
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.admin.updateSubjectStatus",
+
"lexicon" => 1
+
})
+
end
+27
lib/atproto/com/atproto/identity/defs.ex
···
+
defmodule Com.Atproto.Identity.Defs do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"identityInfo" => %{
+
"properties" => %{
+
"did" => %{"format" => "did", "type" => "string"},
+
"didDoc" => %{
+
"description" => "The complete DID document for the identity.",
+
"type" => "unknown"
+
},
+
"handle" => %{
+
"description" =>
+
"The validated handle of the account; or 'handle.invalid' if the handle did not bi-directionally match the DID document.",
+
"format" => "handle",
+
"type" => "string"
+
}
+
},
+
"required" => ["did", "handle", "didDoc"],
+
"type" => "object"
+
}
+
},
+
"id" => "com.atproto.identity.defs",
+
"lexicon" => 1
+
})
+
end
+35
lib/atproto/com/atproto/identity/getRecommendedDidCredentials.ex
···
+
defmodule Com.Atproto.Identity.GetRecommendedDidCredentials do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Describe the credentials that should be included in the DID doc of an account that is migrating to this service.",
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"alsoKnownAs" => %{
+
"items" => %{"type" => "string"},
+
"type" => "array"
+
},
+
"rotationKeys" => %{
+
"description" =>
+
"Recommended rotation keys for PLC dids. Should be undefined (or ignored) for did:webs.",
+
"items" => %{"type" => "string"},
+
"type" => "array"
+
},
+
"services" => %{"type" => "unknown"},
+
"verificationMethods" => %{"type" => "unknown"}
+
},
+
"type" => "object"
+
}
+
},
+
"type" => "query"
+
}
+
},
+
"id" => "com.atproto.identity.getRecommendedDidCredentials",
+
"lexicon" => 1
+
})
+
end
+47
lib/atproto/com/atproto/identity/refreshIdentity.ex
···
+
defmodule Com.Atproto.Identity.RefreshIdentity do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Request that the server re-resolve an identity (DID and handle). The server may ignore this request, or require authentication, depending on the role, implementation, and policy of the server.",
+
"errors" => [
+
%{
+
"description" =>
+
"The resolution process confirmed that the handle does not resolve to any DID.",
+
"name" => "HandleNotFound"
+
},
+
%{
+
"description" => "The DID resolution process confirmed that there is no current DID.",
+
"name" => "DidNotFound"
+
},
+
%{
+
"description" => "The DID previously existed, but has been deactivated.",
+
"name" => "DidDeactivated"
+
}
+
],
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"identifier" => %{"format" => "at-identifier", "type" => "string"}
+
},
+
"required" => ["identifier"],
+
"type" => "object"
+
}
+
},
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"ref" => "com.atproto.identity.defs#identityInfo",
+
"type" => "ref"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.identity.refreshIdentity",
+
"lexicon" => 1
+
})
+
end
+15
lib/atproto/com/atproto/identity/requestPlcOperationSignature.ex
···
+
defmodule Com.Atproto.Identity.RequestPlcOperationSignature do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Request an email with a code to in order to request a signed PLC operation. Requires Auth.",
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.identity.requestPlcOperationSignature",
+
"lexicon" => 1
+
})
+
end
+48
lib/atproto/com/atproto/identity/resolveDid.ex
···
+
defmodule Com.Atproto.Identity.ResolveDid do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" => "Resolves DID to DID document. Does not bi-directionally verify handle.",
+
"errors" => [
+
%{
+
"description" => "The DID resolution process confirmed that there is no current DID.",
+
"name" => "DidNotFound"
+
},
+
%{
+
"description" => "The DID previously existed, but has been deactivated.",
+
"name" => "DidDeactivated"
+
}
+
],
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"didDoc" => %{
+
"description" => "The complete DID document for the identity.",
+
"type" => "unknown"
+
}
+
},
+
"required" => ["didDoc"],
+
"type" => "object"
+
}
+
},
+
"parameters" => %{
+
"properties" => %{
+
"did" => %{
+
"description" => "DID to resolve.",
+
"format" => "did",
+
"type" => "string"
+
}
+
},
+
"required" => ["did"],
+
"type" => "params"
+
},
+
"type" => "query"
+
}
+
},
+
"id" => "com.atproto.identity.resolveDid",
+
"lexicon" => 1
+
})
+
end
+41
lib/atproto/com/atproto/identity/resolveHandle.ex
···
+
defmodule Com.Atproto.Identity.ResolveHandle do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Resolves an atproto handle (hostname) to a DID. Does not necessarily bi-directionally verify against the the DID document.",
+
"errors" => [
+
%{
+
"description" =>
+
"The resolution process confirmed that the handle does not resolve to any DID.",
+
"name" => "HandleNotFound"
+
}
+
],
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{"did" => %{"format" => "did", "type" => "string"}},
+
"required" => ["did"],
+
"type" => "object"
+
}
+
},
+
"parameters" => %{
+
"properties" => %{
+
"handle" => %{
+
"description" => "The handle to resolve.",
+
"format" => "handle",
+
"type" => "string"
+
}
+
},
+
"required" => ["handle"],
+
"type" => "params"
+
},
+
"type" => "query"
+
}
+
},
+
"id" => "com.atproto.identity.resolveHandle",
+
"lexicon" => 1
+
})
+
end
+48
lib/atproto/com/atproto/identity/resolveIdentity.ex
···
+
defmodule Com.Atproto.Identity.ResolveIdentity do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Resolves an identity (DID or Handle) to a full identity (DID document and verified handle).",
+
"errors" => [
+
%{
+
"description" =>
+
"The resolution process confirmed that the handle does not resolve to any DID.",
+
"name" => "HandleNotFound"
+
},
+
%{
+
"description" => "The DID resolution process confirmed that there is no current DID.",
+
"name" => "DidNotFound"
+
},
+
%{
+
"description" => "The DID previously existed, but has been deactivated.",
+
"name" => "DidDeactivated"
+
}
+
],
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"ref" => "com.atproto.identity.defs#identityInfo",
+
"type" => "ref"
+
}
+
},
+
"parameters" => %{
+
"properties" => %{
+
"identifier" => %{
+
"description" => "Handle or DID to resolve.",
+
"format" => "at-identifier",
+
"type" => "string"
+
}
+
},
+
"required" => ["identifier"],
+
"type" => "params"
+
},
+
"type" => "query"
+
}
+
},
+
"id" => "com.atproto.identity.resolveIdentity",
+
"lexicon" => 1
+
})
+
end
+51
lib/atproto/com/atproto/identity/signPlcOperation.ex
···
+
defmodule Com.Atproto.Identity.SignPlcOperation do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Signs a PLC operation to update some value(s) in the requesting DID's document.",
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"alsoKnownAs" => %{
+
"items" => %{"type" => "string"},
+
"type" => "array"
+
},
+
"rotationKeys" => %{
+
"items" => %{"type" => "string"},
+
"type" => "array"
+
},
+
"services" => %{"type" => "unknown"},
+
"token" => %{
+
"description" =>
+
"A token received through com.atproto.identity.requestPlcOperationSignature",
+
"type" => "string"
+
},
+
"verificationMethods" => %{"type" => "unknown"}
+
},
+
"type" => "object"
+
}
+
},
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"operation" => %{
+
"description" => "A signed DID PLC operation.",
+
"type" => "unknown"
+
}
+
},
+
"required" => ["operation"],
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.identity.signPlcOperation",
+
"lexicon" => 1
+
})
+
end
+23
lib/atproto/com/atproto/identity/submitPlcOperation.ex
···
+
defmodule Com.Atproto.Identity.SubmitPlcOperation do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Validates a PLC operation to ensure that it doesn't violate a service's constraints or get the identity into a bad state, then submits it to the PLC registry",
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{"operation" => %{"type" => "unknown"}},
+
"required" => ["operation"],
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.identity.submitPlcOperation",
+
"lexicon" => 1
+
})
+
end
+29
lib/atproto/com/atproto/identity/updateHandle.ex
···
+
defmodule Com.Atproto.Identity.UpdateHandle do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Updates the current account's handle. Verifies handle validity, and updates did:plc document if necessary. Implemented by PDS, and requires auth.",
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"handle" => %{
+
"description" => "The new handle.",
+
"format" => "handle",
+
"type" => "string"
+
}
+
},
+
"required" => ["handle"],
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.identity.updateHandle",
+
"lexicon" => 1
+
})
+
end
+170
lib/atproto/com/atproto/label/defs.ex
···
+
defmodule Com.Atproto.Label.Defs do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"label" => %{
+
"description" => "Metadata tag on an atproto resource (eg, repo or record).",
+
"properties" => %{
+
"cid" => %{
+
"description" =>
+
"Optionally, CID specifying the specific version of 'uri' resource this label applies to.",
+
"format" => "cid",
+
"type" => "string"
+
},
+
"cts" => %{
+
"description" => "Timestamp when this label was created.",
+
"format" => "datetime",
+
"type" => "string"
+
},
+
"exp" => %{
+
"description" => "Timestamp at which this label expires (no longer applies).",
+
"format" => "datetime",
+
"type" => "string"
+
},
+
"neg" => %{
+
"description" => "If true, this is a negation label, overwriting a previous label.",
+
"type" => "boolean"
+
},
+
"sig" => %{
+
"description" => "Signature of dag-cbor encoded label.",
+
"type" => "bytes"
+
},
+
"src" => %{
+
"description" => "DID of the actor who created this label.",
+
"format" => "did",
+
"type" => "string"
+
},
+
"uri" => %{
+
"description" =>
+
"AT URI of the record, repository (account), or other resource that this label applies to.",
+
"format" => "uri",
+
"type" => "string"
+
},
+
"val" => %{
+
"description" => "The short string name of the value or type of this label.",
+
"maxLength" => 128,
+
"type" => "string"
+
},
+
"ver" => %{
+
"description" => "The AT Protocol version of the label object.",
+
"type" => "integer"
+
}
+
},
+
"required" => ["src", "uri", "val", "cts"],
+
"type" => "object"
+
},
+
"labelValue" => %{
+
"knownValues" => [
+
"!hide",
+
"!no-promote",
+
"!warn",
+
"!no-unauthenticated",
+
"dmca-violation",
+
"doxxing",
+
"porn",
+
"sexual",
+
"nudity",
+
"nsfl",
+
"gore"
+
],
+
"type" => "string"
+
},
+
"labelValueDefinition" => %{
+
"description" => "Declares a label value and its expected interpretations and behaviors.",
+
"properties" => %{
+
"adultOnly" => %{
+
"description" =>
+
"Does the user need to have adult content enabled in order to configure this label?",
+
"type" => "boolean"
+
},
+
"blurs" => %{
+
"description" =>
+
"What should this label hide in the UI, if applied? 'content' hides all of the target; 'media' hides the images/video/audio; 'none' hides nothing.",
+
"knownValues" => ["content", "media", "none"],
+
"type" => "string"
+
},
+
"defaultSetting" => %{
+
"default" => "warn",
+
"description" => "The default setting for this label.",
+
"knownValues" => ["ignore", "warn", "hide"],
+
"type" => "string"
+
},
+
"identifier" => %{
+
"description" =>
+
"The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+).",
+
"maxGraphemes" => 100,
+
"maxLength" => 100,
+
"type" => "string"
+
},
+
"locales" => %{
+
"items" => %{"ref" => "#labelValueDefinitionStrings", "type" => "ref"},
+
"type" => "array"
+
},
+
"severity" => %{
+
"description" =>
+
"How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing.",
+
"knownValues" => ["inform", "alert", "none"],
+
"type" => "string"
+
}
+
},
+
"required" => ["identifier", "severity", "blurs", "locales"],
+
"type" => "object"
+
},
+
"labelValueDefinitionStrings" => %{
+
"description" =>
+
"Strings which describe the label in the UI, localized into a specific language.",
+
"properties" => %{
+
"description" => %{
+
"description" =>
+
"A longer description of what the label means and why it might be applied.",
+
"maxGraphemes" => 10000,
+
"maxLength" => 100_000,
+
"type" => "string"
+
},
+
"lang" => %{
+
"description" => "The code of the language these strings are written in.",
+
"format" => "language",
+
"type" => "string"
+
},
+
"name" => %{
+
"description" => "A short human-readable name for the label.",
+
"maxGraphemes" => 64,
+
"maxLength" => 640,
+
"type" => "string"
+
}
+
},
+
"required" => ["lang", "name", "description"],
+
"type" => "object"
+
},
+
"selfLabel" => %{
+
"description" =>
+
"Metadata tag on an atproto record, published by the author within the record. Note that schemas should use #selfLabels, not #selfLabel.",
+
"properties" => %{
+
"val" => %{
+
"description" => "The short string name of the value or type of this label.",
+
"maxLength" => 128,
+
"type" => "string"
+
}
+
},
+
"required" => ["val"],
+
"type" => "object"
+
},
+
"selfLabels" => %{
+
"description" =>
+
"Metadata tags on an atproto record, published by the author within the record.",
+
"properties" => %{
+
"values" => %{
+
"items" => %{"ref" => "#selfLabel", "type" => "ref"},
+
"maxLength" => 10,
+
"type" => "array"
+
}
+
},
+
"required" => ["values"],
+
"type" => "object"
+
}
+
},
+
"id" => "com.atproto.label.defs",
+
"lexicon" => 1
+
})
+
end
+56
lib/atproto/com/atproto/label/queryLabels.ex
···
+
defmodule Com.Atproto.Label.QueryLabels do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Find labels relevant to the provided AT-URI patterns. Public endpoint for moderation services, though may return different or additional results with auth.",
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"cursor" => %{"type" => "string"},
+
"labels" => %{
+
"items" => %{
+
"ref" => "com.atproto.label.defs#label",
+
"type" => "ref"
+
},
+
"type" => "array"
+
}
+
},
+
"required" => ["labels"],
+
"type" => "object"
+
}
+
},
+
"parameters" => %{
+
"properties" => %{
+
"cursor" => %{"type" => "string"},
+
"limit" => %{
+
"default" => 50,
+
"maximum" => 250,
+
"minimum" => 1,
+
"type" => "integer"
+
},
+
"sources" => %{
+
"description" => "Optional list of label sources (DIDs) to filter on.",
+
"items" => %{"format" => "did", "type" => "string"},
+
"type" => "array"
+
},
+
"uriPatterns" => %{
+
"description" =>
+
"List of AT URI patterns to match (boolean 'OR'). Each may be a prefix (ending with '*'; will match inclusive of the string leading to '*'), or a full URI.",
+
"items" => %{"type" => "string"},
+
"type" => "array"
+
}
+
},
+
"required" => ["uriPatterns"],
+
"type" => "params"
+
},
+
"type" => "query"
+
}
+
},
+
"id" => "com.atproto.label.queryLabels",
+
"lexicon" => 1
+
})
+
end
+47
lib/atproto/com/atproto/label/subscribeLabels.ex
···
+
defmodule Com.Atproto.Label.SubscribeLabels do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"info" => %{
+
"properties" => %{
+
"message" => %{"type" => "string"},
+
"name" => %{"knownValues" => ["OutdatedCursor"], "type" => "string"}
+
},
+
"required" => ["name"],
+
"type" => "object"
+
},
+
"labels" => %{
+
"properties" => %{
+
"labels" => %{
+
"items" => %{"ref" => "com.atproto.label.defs#label", "type" => "ref"},
+
"type" => "array"
+
},
+
"seq" => %{"type" => "integer"}
+
},
+
"required" => ["seq", "labels"],
+
"type" => "object"
+
},
+
"main" => %{
+
"description" =>
+
"Subscribe to stream of labels (and negations). Public endpoint implemented by mod services. Uses same sequencing scheme as repo event stream.",
+
"errors" => [%{"name" => "FutureCursor"}],
+
"message" => %{
+
"schema" => %{"refs" => ["#labels", "#info"], "type" => "union"}
+
},
+
"parameters" => %{
+
"properties" => %{
+
"cursor" => %{
+
"description" => "The last known event seq number to backfill from.",
+
"type" => "integer"
+
}
+
},
+
"type" => "params"
+
},
+
"type" => "subscription"
+
}
+
},
+
"id" => "com.atproto.label.subscribeLabels",
+
"lexicon" => 1
+
})
+
end
+27
lib/atproto/com/atproto/lexicon/schema.ex
···
+
defmodule Com.Atproto.Lexicon.Schema do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Representation of Lexicon schemas themselves, when published as atproto records. Note that the schema language is not defined in Lexicon; this meta schema currently only includes a single version field ('lexicon'). See the atproto specifications for description of the other expected top-level fields ('id', 'defs', etc).",
+
"key" => "nsid",
+
"record" => %{
+
"properties" => %{
+
"lexicon" => %{
+
"description" =>
+
"Indicates the 'version' of the Lexicon language. Must be '1' for the current atproto/Lexicon schema system.",
+
"type" => "integer"
+
}
+
},
+
"required" => ["lexicon"],
+
"type" => "object"
+
},
+
"type" => "record"
+
}
+
},
+
"id" => "com.atproto.lexicon.schema",
+
"lexicon" => 1
+
})
+
end
+81
lib/atproto/com/atproto/moderation/createReport.ex
···
+
defmodule Com.Atproto.Moderation.CreateReport do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Submit a moderation report regarding an atproto account or record. Implemented by moderation services (with PDS proxying), and requires auth.",
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"modTool" => %{"ref" => "#modTool", "type" => "ref"},
+
"reason" => %{
+
"description" => "Additional context about the content and violation.",
+
"maxGraphemes" => 2000,
+
"maxLength" => 20000,
+
"type" => "string"
+
},
+
"reasonType" => %{
+
"description" => "Indicates the broad category of violation the report is for.",
+
"ref" => "com.atproto.moderation.defs#reasonType",
+
"type" => "ref"
+
},
+
"subject" => %{
+
"refs" => ["com.atproto.admin.defs#repoRef", "com.atproto.repo.strongRef"],
+
"type" => "union"
+
}
+
},
+
"required" => ["reasonType", "subject"],
+
"type" => "object"
+
}
+
},
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"createdAt" => %{"format" => "datetime", "type" => "string"},
+
"id" => %{"type" => "integer"},
+
"reason" => %{
+
"maxGraphemes" => 2000,
+
"maxLength" => 20000,
+
"type" => "string"
+
},
+
"reasonType" => %{
+
"ref" => "com.atproto.moderation.defs#reasonType",
+
"type" => "ref"
+
},
+
"reportedBy" => %{"format" => "did", "type" => "string"},
+
"subject" => %{
+
"refs" => ["com.atproto.admin.defs#repoRef", "com.atproto.repo.strongRef"],
+
"type" => "union"
+
}
+
},
+
"required" => ["id", "reasonType", "subject", "reportedBy", "createdAt"],
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
},
+
"modTool" => %{
+
"description" => "Moderation tool information for tracing the source of the action",
+
"properties" => %{
+
"meta" => %{
+
"description" => "Additional arbitrary metadata about the source",
+
"type" => "unknown"
+
},
+
"name" => %{
+
"description" =>
+
"Name/identifier of the source (e.g., 'bsky-app/android', 'bsky-web/chrome')",
+
"type" => "string"
+
}
+
},
+
"required" => ["name"],
+
"type" => "object"
+
}
+
},
+
"id" => "com.atproto.moderation.createReport",
+
"lexicon" => 1
+
})
+
end
+101
lib/atproto/com/atproto/moderation/defs.ex
···
+
defmodule Com.Atproto.Moderation.Defs do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"reasonAppeal" => %{
+
"description" => "Appeal a previously taken moderation action",
+
"type" => "token"
+
},
+
"reasonMisleading" => %{
+
"description" =>
+
"Misleading identity, affiliation, or content. Prefer new lexicon definition `tools.ozone.report.defs#reasonMisleadingOther`.",
+
"type" => "token"
+
},
+
"reasonOther" => %{
+
"description" =>
+
"Reports not falling under another report category. Prefer new lexicon definition `tools.ozone.report.defs#reasonOther`.",
+
"type" => "token"
+
},
+
"reasonRude" => %{
+
"description" =>
+
"Rude, harassing, explicit, or otherwise unwelcoming behavior. Prefer new lexicon definition `tools.ozone.report.defs#reasonHarassmentOther`.",
+
"type" => "token"
+
},
+
"reasonSexual" => %{
+
"description" =>
+
"Unwanted or mislabeled sexual content. Prefer new lexicon definition `tools.ozone.report.defs#reasonSexualUnlabeled`.",
+
"type" => "token"
+
},
+
"reasonSpam" => %{
+
"description" =>
+
"Spam: frequent unwanted promotion, replies, mentions. Prefer new lexicon definition `tools.ozone.report.defs#reasonMisleadingSpam`.",
+
"type" => "token"
+
},
+
"reasonType" => %{
+
"knownValues" => [
+
"com.atproto.moderation.defs#reasonSpam",
+
"com.atproto.moderation.defs#reasonViolation",
+
"com.atproto.moderation.defs#reasonMisleading",
+
"com.atproto.moderation.defs#reasonSexual",
+
"com.atproto.moderation.defs#reasonRude",
+
"com.atproto.moderation.defs#reasonOther",
+
"com.atproto.moderation.defs#reasonAppeal",
+
"tools.ozone.report.defs#reasonAppeal",
+
"tools.ozone.report.defs#reasonOther",
+
"tools.ozone.report.defs#reasonViolenceAnimal",
+
"tools.ozone.report.defs#reasonViolenceThreats",
+
"tools.ozone.report.defs#reasonViolenceGraphicContent",
+
"tools.ozone.report.defs#reasonViolenceGlorification",
+
"tools.ozone.report.defs#reasonViolenceExtremistContent",
+
"tools.ozone.report.defs#reasonViolenceTrafficking",
+
"tools.ozone.report.defs#reasonViolenceOther",
+
"tools.ozone.report.defs#reasonSexualAbuseContent",
+
"tools.ozone.report.defs#reasonSexualNCII",
+
"tools.ozone.report.defs#reasonSexualDeepfake",
+
"tools.ozone.report.defs#reasonSexualAnimal",
+
"tools.ozone.report.defs#reasonSexualUnlabeled",
+
"tools.ozone.report.defs#reasonSexualOther",
+
"tools.ozone.report.defs#reasonChildSafetyCSAM",
+
"tools.ozone.report.defs#reasonChildSafetyGroom",
+
"tools.ozone.report.defs#reasonChildSafetyPrivacy",
+
"tools.ozone.report.defs#reasonChildSafetyHarassment",
+
"tools.ozone.report.defs#reasonChildSafetyOther",
+
"tools.ozone.report.defs#reasonHarassmentTroll",
+
"tools.ozone.report.defs#reasonHarassmentTargeted",
+
"tools.ozone.report.defs#reasonHarassmentHateSpeech",
+
"tools.ozone.report.defs#reasonHarassmentDoxxing",
+
"tools.ozone.report.defs#reasonHarassmentOther",
+
"tools.ozone.report.defs#reasonMisleadingBot",
+
"tools.ozone.report.defs#reasonMisleadingImpersonation",
+
"tools.ozone.report.defs#reasonMisleadingSpam",
+
"tools.ozone.report.defs#reasonMisleadingScam",
+
"tools.ozone.report.defs#reasonMisleadingElections",
+
"tools.ozone.report.defs#reasonMisleadingOther",
+
"tools.ozone.report.defs#reasonRuleSiteSecurity",
+
"tools.ozone.report.defs#reasonRuleProhibitedSales",
+
"tools.ozone.report.defs#reasonRuleBanEvasion",
+
"tools.ozone.report.defs#reasonRuleOther",
+
"tools.ozone.report.defs#reasonSelfHarmContent",
+
"tools.ozone.report.defs#reasonSelfHarmED",
+
"tools.ozone.report.defs#reasonSelfHarmStunts",
+
"tools.ozone.report.defs#reasonSelfHarmSubstances",
+
"tools.ozone.report.defs#reasonSelfHarmOther"
+
],
+
"type" => "string"
+
},
+
"reasonViolation" => %{
+
"description" =>
+
"Direct violation of server rules, laws, terms of service. Prefer new lexicon definition `tools.ozone.report.defs#reasonRuleOther`.",
+
"type" => "token"
+
},
+
"subjectType" => %{
+
"description" => "Tag describing a type of subject that might be reported.",
+
"knownValues" => ["account", "record", "chat"],
+
"type" => "string"
+
}
+
},
+
"id" => "com.atproto.moderation.defs",
+
"lexicon" => 1
+
})
+
end
+140
lib/atproto/com/atproto/repo/applyWrites.ex
···
+
defmodule Com.Atproto.Repo.ApplyWrites do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"create" => %{
+
"description" => "Operation which creates a new record.",
+
"properties" => %{
+
"collection" => %{"format" => "nsid", "type" => "string"},
+
"rkey" => %{
+
"description" =>
+
"NOTE: maxLength is redundant with record-key format. Keeping it temporarily to ensure backwards compatibility.",
+
"format" => "record-key",
+
"maxLength" => 512,
+
"type" => "string"
+
},
+
"value" => %{"type" => "unknown"}
+
},
+
"required" => ["collection", "value"],
+
"type" => "object"
+
},
+
"createResult" => %{
+
"properties" => %{
+
"cid" => %{"format" => "cid", "type" => "string"},
+
"uri" => %{"format" => "at-uri", "type" => "string"},
+
"validationStatus" => %{
+
"knownValues" => ["valid", "unknown"],
+
"type" => "string"
+
}
+
},
+
"required" => ["uri", "cid"],
+
"type" => "object"
+
},
+
"delete" => %{
+
"description" => "Operation which deletes an existing record.",
+
"properties" => %{
+
"collection" => %{"format" => "nsid", "type" => "string"},
+
"rkey" => %{"format" => "record-key", "type" => "string"}
+
},
+
"required" => ["collection", "rkey"],
+
"type" => "object"
+
},
+
"deleteResult" => %{
+
"properties" => %{},
+
"required" => [],
+
"type" => "object"
+
},
+
"main" => %{
+
"description" =>
+
"Apply a batch transaction of repository creates, updates, and deletes. Requires auth, implemented by PDS.",
+
"errors" => [
+
%{
+
"description" =>
+
"Indicates that the 'swapCommit' parameter did not match current commit.",
+
"name" => "InvalidSwap"
+
}
+
],
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"repo" => %{
+
"description" => "The handle or DID of the repo (aka, current account).",
+
"format" => "at-identifier",
+
"type" => "string"
+
},
+
"swapCommit" => %{
+
"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.",
+
"format" => "cid",
+
"type" => "string"
+
},
+
"validate" => %{
+
"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.",
+
"type" => "boolean"
+
},
+
"writes" => %{
+
"items" => %{
+
"closed" => true,
+
"refs" => ["#create", "#update", "#delete"],
+
"type" => "union"
+
},
+
"type" => "array"
+
}
+
},
+
"required" => ["repo", "writes"],
+
"type" => "object"
+
}
+
},
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"commit" => %{
+
"ref" => "com.atproto.repo.defs#commitMeta",
+
"type" => "ref"
+
},
+
"results" => %{
+
"items" => %{
+
"closed" => true,
+
"refs" => ["#createResult", "#updateResult", "#deleteResult"],
+
"type" => "union"
+
},
+
"type" => "array"
+
}
+
},
+
"required" => [],
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
},
+
"update" => %{
+
"description" => "Operation which updates an existing record.",
+
"properties" => %{
+
"collection" => %{"format" => "nsid", "type" => "string"},
+
"rkey" => %{"format" => "record-key", "type" => "string"},
+
"value" => %{"type" => "unknown"}
+
},
+
"required" => ["collection", "rkey", "value"],
+
"type" => "object"
+
},
+
"updateResult" => %{
+
"properties" => %{
+
"cid" => %{"format" => "cid", "type" => "string"},
+
"uri" => %{"format" => "at-uri", "type" => "string"},
+
"validationStatus" => %{
+
"knownValues" => ["valid", "unknown"],
+
"type" => "string"
+
}
+
},
+
"required" => ["uri", "cid"],
+
"type" => "object"
+
}
+
},
+
"id" => "com.atproto.repo.applyWrites",
+
"lexicon" => 1
+
})
+
end
+79
lib/atproto/com/atproto/repo/createRecord.ex
···
+
defmodule Com.Atproto.Repo.CreateRecord do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Create a single new repository record. Requires auth, implemented by PDS.",
+
"errors" => [
+
%{
+
"description" => "Indicates that 'swapCommit' didn't match current repo commit.",
+
"name" => "InvalidSwap"
+
}
+
],
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"collection" => %{
+
"description" => "The NSID of the record collection.",
+
"format" => "nsid",
+
"type" => "string"
+
},
+
"record" => %{
+
"description" => "The record itself. Must contain a $type field.",
+
"type" => "unknown"
+
},
+
"repo" => %{
+
"description" => "The handle or DID of the repo (aka, current account).",
+
"format" => "at-identifier",
+
"type" => "string"
+
},
+
"rkey" => %{
+
"description" => "The Record Key.",
+
"format" => "record-key",
+
"maxLength" => 512,
+
"type" => "string"
+
},
+
"swapCommit" => %{
+
"description" => "Compare and swap with the previous commit by CID.",
+
"format" => "cid",
+
"type" => "string"
+
},
+
"validate" => %{
+
"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.",
+
"type" => "boolean"
+
}
+
},
+
"required" => ["repo", "collection", "record"],
+
"type" => "object"
+
}
+
},
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"cid" => %{"format" => "cid", "type" => "string"},
+
"commit" => %{
+
"ref" => "com.atproto.repo.defs#commitMeta",
+
"type" => "ref"
+
},
+
"uri" => %{"format" => "at-uri", "type" => "string"},
+
"validationStatus" => %{
+
"knownValues" => ["valid", "unknown"],
+
"type" => "string"
+
}
+
},
+
"required" => ["uri", "cid"],
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.repo.createRecord",
+
"lexicon" => 1
+
})
+
end
+18
lib/atproto/com/atproto/repo/defs.ex
···
+
defmodule Com.Atproto.Repo.Defs do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"commitMeta" => %{
+
"properties" => %{
+
"cid" => %{"format" => "cid", "type" => "string"},
+
"rev" => %{"format" => "tid", "type" => "string"}
+
},
+
"required" => ["cid", "rev"],
+
"type" => "object"
+
}
+
},
+
"id" => "com.atproto.repo.defs",
+
"lexicon" => 1
+
})
+
end
+62
lib/atproto/com/atproto/repo/deleteRecord.ex
···
+
defmodule Com.Atproto.Repo.DeleteRecord do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Delete a repository record, or ensure it doesn't exist. Requires auth, implemented by PDS.",
+
"errors" => [%{"name" => "InvalidSwap"}],
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"collection" => %{
+
"description" => "The NSID of the record collection.",
+
"format" => "nsid",
+
"type" => "string"
+
},
+
"repo" => %{
+
"description" => "The handle or DID of the repo (aka, current account).",
+
"format" => "at-identifier",
+
"type" => "string"
+
},
+
"rkey" => %{
+
"description" => "The Record Key.",
+
"format" => "record-key",
+
"type" => "string"
+
},
+
"swapCommit" => %{
+
"description" => "Compare and swap with the previous commit by CID.",
+
"format" => "cid",
+
"type" => "string"
+
},
+
"swapRecord" => %{
+
"description" => "Compare and swap with the previous record by CID.",
+
"format" => "cid",
+
"type" => "string"
+
}
+
},
+
"required" => ["repo", "collection", "rkey"],
+
"type" => "object"
+
}
+
},
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"commit" => %{
+
"ref" => "com.atproto.repo.defs#commitMeta",
+
"type" => "ref"
+
}
+
},
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.repo.deleteRecord",
+
"lexicon" => 1
+
})
+
end
+52
lib/atproto/com/atproto/repo/describeRepo.ex
···
+
defmodule Com.Atproto.Repo.DescribeRepo do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Get information about an account and repository, including the list of collections. Does not require auth.",
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"collections" => %{
+
"description" =>
+
"List of all the collections (NSIDs) for which this repo contains at least one record.",
+
"items" => %{"format" => "nsid", "type" => "string"},
+
"type" => "array"
+
},
+
"did" => %{"format" => "did", "type" => "string"},
+
"didDoc" => %{
+
"description" => "The complete DID document for this account.",
+
"type" => "unknown"
+
},
+
"handle" => %{"format" => "handle", "type" => "string"},
+
"handleIsCorrect" => %{
+
"description" =>
+
"Indicates if handle is currently valid (resolves bi-directionally)",
+
"type" => "boolean"
+
}
+
},
+
"required" => ["handle", "did", "didDoc", "collections", "handleIsCorrect"],
+
"type" => "object"
+
}
+
},
+
"parameters" => %{
+
"properties" => %{
+
"repo" => %{
+
"description" => "The handle or DID of the repo.",
+
"format" => "at-identifier",
+
"type" => "string"
+
}
+
},
+
"required" => ["repo"],
+
"type" => "params"
+
},
+
"type" => "query"
+
}
+
},
+
"id" => "com.atproto.repo.describeRepo",
+
"lexicon" => 1
+
})
+
end
+54
lib/atproto/com/atproto/repo/getRecord.ex
···
+
defmodule Com.Atproto.Repo.GetRecord do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" => "Get a single record from a repository. Does not require auth.",
+
"errors" => [%{"name" => "RecordNotFound"}],
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"cid" => %{"format" => "cid", "type" => "string"},
+
"uri" => %{"format" => "at-uri", "type" => "string"},
+
"value" => %{"type" => "unknown"}
+
},
+
"required" => ["uri", "value"],
+
"type" => "object"
+
}
+
},
+
"parameters" => %{
+
"properties" => %{
+
"cid" => %{
+
"description" =>
+
"The CID of the version of the record. If not specified, then return the most recent version.",
+
"format" => "cid",
+
"type" => "string"
+
},
+
"collection" => %{
+
"description" => "The NSID of the record collection.",
+
"format" => "nsid",
+
"type" => "string"
+
},
+
"repo" => %{
+
"description" => "The handle or DID of the repo.",
+
"format" => "at-identifier",
+
"type" => "string"
+
},
+
"rkey" => %{
+
"description" => "The Record Key.",
+
"format" => "record-key",
+
"type" => "string"
+
}
+
},
+
"required" => ["repo", "collection", "rkey"],
+
"type" => "params"
+
},
+
"type" => "query"
+
}
+
},
+
"id" => "com.atproto.repo.getRecord",
+
"lexicon" => 1
+
})
+
end
+16
lib/atproto/com/atproto/repo/importRepo.ex
···
+
defmodule Com.Atproto.Repo.ImportRepo do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Import a repo in the form of a CAR file. Requires Content-Length HTTP header to be set.",
+
"input" => %{"encoding" => "application/vnd.ipld.car"},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.repo.importRepo",
+
"lexicon" => 1
+
})
+
end
+49
lib/atproto/com/atproto/repo/listMissingBlobs.ex
···
+
defmodule Com.Atproto.Repo.ListMissingBlobs do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Returns a list of missing blobs for the requesting account. Intended to be used in the account migration flow.",
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"blobs" => %{
+
"items" => %{"ref" => "#recordBlob", "type" => "ref"},
+
"type" => "array"
+
},
+
"cursor" => %{"type" => "string"}
+
},
+
"required" => ["blobs"],
+
"type" => "object"
+
}
+
},
+
"parameters" => %{
+
"properties" => %{
+
"cursor" => %{"type" => "string"},
+
"limit" => %{
+
"default" => 500,
+
"maximum" => 1000,
+
"minimum" => 1,
+
"type" => "integer"
+
}
+
},
+
"type" => "params"
+
},
+
"type" => "query"
+
},
+
"recordBlob" => %{
+
"properties" => %{
+
"cid" => %{"format" => "cid", "type" => "string"},
+
"recordUri" => %{"format" => "at-uri", "type" => "string"}
+
},
+
"required" => ["cid", "recordUri"],
+
"type" => "object"
+
}
+
},
+
"id" => "com.atproto.repo.listMissingBlobs",
+
"lexicon" => 1
+
})
+
end
+66
lib/atproto/com/atproto/repo/listRecords.ex
···
+
defmodule Com.Atproto.Repo.ListRecords do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"List a range of records in a repository, matching a specific collection. Does not require auth.",
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"cursor" => %{"type" => "string"},
+
"records" => %{
+
"items" => %{"ref" => "#record", "type" => "ref"},
+
"type" => "array"
+
}
+
},
+
"required" => ["records"],
+
"type" => "object"
+
}
+
},
+
"parameters" => %{
+
"properties" => %{
+
"collection" => %{
+
"description" => "The NSID of the record type.",
+
"format" => "nsid",
+
"type" => "string"
+
},
+
"cursor" => %{"type" => "string"},
+
"limit" => %{
+
"default" => 50,
+
"description" => "The number of records to return.",
+
"maximum" => 100,
+
"minimum" => 1,
+
"type" => "integer"
+
},
+
"repo" => %{
+
"description" => "The handle or DID of the repo.",
+
"format" => "at-identifier",
+
"type" => "string"
+
},
+
"reverse" => %{
+
"description" => "Flag to reverse the order of the returned records.",
+
"type" => "boolean"
+
}
+
},
+
"required" => ["repo", "collection"],
+
"type" => "params"
+
},
+
"type" => "query"
+
},
+
"record" => %{
+
"properties" => %{
+
"cid" => %{"format" => "cid", "type" => "string"},
+
"uri" => %{"format" => "at-uri", "type" => "string"},
+
"value" => %{"type" => "unknown"}
+
},
+
"required" => ["uri", "cid", "value"],
+
"type" => "object"
+
}
+
},
+
"id" => "com.atproto.repo.listRecords",
+
"lexicon" => 1
+
})
+
end
+81
lib/atproto/com/atproto/repo/putRecord.ex
···
+
defmodule Com.Atproto.Repo.PutRecord do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Write a repository record, creating or updating it as needed. Requires auth, implemented by PDS.",
+
"errors" => [%{"name" => "InvalidSwap"}],
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"nullable" => ["swapRecord"],
+
"properties" => %{
+
"collection" => %{
+
"description" => "The NSID of the record collection.",
+
"format" => "nsid",
+
"type" => "string"
+
},
+
"record" => %{
+
"description" => "The record to write.",
+
"type" => "unknown"
+
},
+
"repo" => %{
+
"description" => "The handle or DID of the repo (aka, current account).",
+
"format" => "at-identifier",
+
"type" => "string"
+
},
+
"rkey" => %{
+
"description" => "The Record Key.",
+
"format" => "record-key",
+
"maxLength" => 512,
+
"type" => "string"
+
},
+
"swapCommit" => %{
+
"description" => "Compare and swap with the previous commit by CID.",
+
"format" => "cid",
+
"type" => "string"
+
},
+
"swapRecord" => %{
+
"description" =>
+
"Compare and swap with the previous record by CID. WARNING: nullable and optional field; may cause problems with golang implementation",
+
"format" => "cid",
+
"type" => "string"
+
},
+
"validate" => %{
+
"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.",
+
"type" => "boolean"
+
}
+
},
+
"required" => ["repo", "collection", "rkey", "record"],
+
"type" => "object"
+
}
+
},
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"cid" => %{"format" => "cid", "type" => "string"},
+
"commit" => %{
+
"ref" => "com.atproto.repo.defs#commitMeta",
+
"type" => "ref"
+
},
+
"uri" => %{"format" => "at-uri", "type" => "string"},
+
"validationStatus" => %{
+
"knownValues" => ["valid", "unknown"],
+
"type" => "string"
+
}
+
},
+
"required" => ["uri", "cid"],
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.repo.putRecord",
+
"lexicon" => 1
+
})
+
end
+19
lib/atproto/com/atproto/repo/strongRef.ex
···
+
defmodule Com.Atproto.Repo.StrongRef do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"properties" => %{
+
"cid" => %{"format" => "cid", "type" => "string"},
+
"uri" => %{"format" => "at-uri", "type" => "string"}
+
},
+
"required" => ["uri", "cid"],
+
"type" => "object"
+
}
+
},
+
"description" => "A URI with a content-hash fingerprint.",
+
"id" => "com.atproto.repo.strongRef",
+
"lexicon" => 1
+
})
+
end
+24
lib/atproto/com/atproto/repo/uploadBlob.ex
···
+
defmodule Com.Atproto.Repo.UploadBlob do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"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.",
+
"input" => %{"encoding" => "*/*"},
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{"blob" => %{"type" => "blob"}},
+
"required" => ["blob"],
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.repo.uploadBlob",
+
"lexicon" => 1
+
})
+
end
+15
lib/atproto/com/atproto/server/activateAccount.ex
···
+
defmodule Com.Atproto.Server.ActivateAccount do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Activates a currently deactivated account. Used to finalize account migration after the account's repo is imported and identity is setup.",
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.server.activateAccount",
+
"lexicon" => 1
+
})
+
end
+43
lib/atproto/com/atproto/server/checkAccountStatus.ex
···
+
defmodule Com.Atproto.Server.CheckAccountStatus do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Returns the status of an account, especially as pertaining to import or recovery. Can be called many times over the course of an account migration. Requires auth and can only be called pertaining to oneself.",
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"activated" => %{"type" => "boolean"},
+
"expectedBlobs" => %{"type" => "integer"},
+
"importedBlobs" => %{"type" => "integer"},
+
"indexedRecords" => %{"type" => "integer"},
+
"privateStateValues" => %{"type" => "integer"},
+
"repoBlocks" => %{"type" => "integer"},
+
"repoCommit" => %{"format" => "cid", "type" => "string"},
+
"repoRev" => %{"type" => "string"},
+
"validDid" => %{"type" => "boolean"}
+
},
+
"required" => [
+
"activated",
+
"validDid",
+
"repoCommit",
+
"repoRev",
+
"repoBlocks",
+
"indexedRecords",
+
"privateStateValues",
+
"expectedBlobs",
+
"importedBlobs"
+
],
+
"type" => "object"
+
}
+
},
+
"type" => "query"
+
}
+
},
+
"id" => "com.atproto.server.checkAccountStatus",
+
"lexicon" => 1
+
})
+
end
+32
lib/atproto/com/atproto/server/confirmEmail.ex
···
+
defmodule Com.Atproto.Server.ConfirmEmail do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Confirm an email using a token from com.atproto.server.requestEmailConfirmation.",
+
"errors" => [
+
%{"name" => "AccountNotFound"},
+
%{"name" => "ExpiredToken"},
+
%{"name" => "InvalidToken"},
+
%{"name" => "InvalidEmail"}
+
],
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"email" => %{"type" => "string"},
+
"token" => %{"type" => "string"}
+
},
+
"required" => ["email", "token"],
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.server.confirmEmail",
+
"lexicon" => 1
+
})
+
end
+83
lib/atproto/com/atproto/server/createAccount.ex
···
+
defmodule Com.Atproto.Server.CreateAccount do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" => "Create an account. Implemented by PDS.",
+
"errors" => [
+
%{"name" => "InvalidHandle"},
+
%{"name" => "InvalidPassword"},
+
%{"name" => "InvalidInviteCode"},
+
%{"name" => "HandleNotAvailable"},
+
%{"name" => "UnsupportedDomain"},
+
%{"name" => "UnresolvableDid"},
+
%{"name" => "IncompatibleDidDoc"}
+
],
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"did" => %{
+
"description" => "Pre-existing atproto DID, being imported to a new account.",
+
"format" => "did",
+
"type" => "string"
+
},
+
"email" => %{"type" => "string"},
+
"handle" => %{
+
"description" => "Requested handle for the account.",
+
"format" => "handle",
+
"type" => "string"
+
},
+
"inviteCode" => %{"type" => "string"},
+
"password" => %{
+
"description" =>
+
"Initial account password. May need to meet instance-specific password strength requirements.",
+
"type" => "string"
+
},
+
"plcOp" => %{
+
"description" =>
+
"A signed DID PLC operation to be submitted as part of importing an existing account to this instance. NOTE: this optional field may be updated when full account migration is implemented.",
+
"type" => "unknown"
+
},
+
"recoveryKey" => %{
+
"description" =>
+
"DID PLC rotation key (aka, recovery key) to be included in PLC creation operation.",
+
"type" => "string"
+
},
+
"verificationCode" => %{"type" => "string"},
+
"verificationPhone" => %{"type" => "string"}
+
},
+
"required" => ["handle"],
+
"type" => "object"
+
}
+
},
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"description" => "Account login session returned on successful account creation.",
+
"properties" => %{
+
"accessJwt" => %{"type" => "string"},
+
"did" => %{
+
"description" => "The DID of the new account.",
+
"format" => "did",
+
"type" => "string"
+
},
+
"didDoc" => %{
+
"description" => "Complete DID document.",
+
"type" => "unknown"
+
},
+
"handle" => %{"format" => "handle", "type" => "string"},
+
"refreshJwt" => %{"type" => "string"}
+
},
+
"required" => ["accessJwt", "refreshJwt", "handle", "did"],
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.server.createAccount",
+
"lexicon" => 1
+
})
+
end
+47
lib/atproto/com/atproto/server/createAppPassword.ex
···
+
defmodule Com.Atproto.Server.CreateAppPassword do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"appPassword" => %{
+
"properties" => %{
+
"createdAt" => %{"format" => "datetime", "type" => "string"},
+
"name" => %{"type" => "string"},
+
"password" => %{"type" => "string"},
+
"privileged" => %{"type" => "boolean"}
+
},
+
"required" => ["name", "password", "createdAt"],
+
"type" => "object"
+
},
+
"main" => %{
+
"description" => "Create an App Password.",
+
"errors" => [%{"name" => "AccountTakedown"}],
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"name" => %{
+
"description" => "A short name for the App Password, to help distinguish them.",
+
"type" => "string"
+
},
+
"privileged" => %{
+
"description" =>
+
"If an app password has 'privileged' access to possibly sensitive account state. Meant for use with trusted clients.",
+
"type" => "boolean"
+
}
+
},
+
"required" => ["name"],
+
"type" => "object"
+
}
+
},
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{"ref" => "#appPassword", "type" => "ref"}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.server.createAppPassword",
+
"lexicon" => 1
+
})
+
end
+33
lib/atproto/com/atproto/server/createInviteCode.ex
···
+
defmodule Com.Atproto.Server.CreateInviteCode do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" => "Create an invite code.",
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"forAccount" => %{"format" => "did", "type" => "string"},
+
"useCount" => %{"type" => "integer"}
+
},
+
"required" => ["useCount"],
+
"type" => "object"
+
}
+
},
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{"code" => %{"type" => "string"}},
+
"required" => ["code"],
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.server.createInviteCode",
+
"lexicon" => 1
+
})
+
end
+50
lib/atproto/com/atproto/server/createInviteCodes.ex
···
+
defmodule Com.Atproto.Server.CreateInviteCodes do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"accountCodes" => %{
+
"properties" => %{
+
"account" => %{"type" => "string"},
+
"codes" => %{"items" => %{"type" => "string"}, "type" => "array"}
+
},
+
"required" => ["account", "codes"],
+
"type" => "object"
+
},
+
"main" => %{
+
"description" => "Create invite codes.",
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"codeCount" => %{"default" => 1, "type" => "integer"},
+
"forAccounts" => %{
+
"items" => %{"format" => "did", "type" => "string"},
+
"type" => "array"
+
},
+
"useCount" => %{"type" => "integer"}
+
},
+
"required" => ["codeCount", "useCount"],
+
"type" => "object"
+
}
+
},
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"codes" => %{
+
"items" => %{"ref" => "#accountCodes", "type" => "ref"},
+
"type" => "array"
+
}
+
},
+
"required" => ["codes"],
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.server.createInviteCodes",
+
"lexicon" => 1
+
})
+
end
+63
lib/atproto/com/atproto/server/createSession.ex
···
+
defmodule Com.Atproto.Server.CreateSession do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" => "Create an authentication session.",
+
"errors" => [
+
%{"name" => "AccountTakedown"},
+
%{"name" => "AuthFactorTokenRequired"}
+
],
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"allowTakendown" => %{
+
"description" =>
+
"When true, instead of throwing error for takendown accounts, a valid response with a narrow scoped token will be returned",
+
"type" => "boolean"
+
},
+
"authFactorToken" => %{"type" => "string"},
+
"identifier" => %{
+
"description" =>
+
"Handle or other identifier supported by the server for the authenticating user.",
+
"type" => "string"
+
},
+
"password" => %{"type" => "string"}
+
},
+
"required" => ["identifier", "password"],
+
"type" => "object"
+
}
+
},
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"accessJwt" => %{"type" => "string"},
+
"active" => %{"type" => "boolean"},
+
"did" => %{"format" => "did", "type" => "string"},
+
"didDoc" => %{"type" => "unknown"},
+
"email" => %{"type" => "string"},
+
"emailAuthFactor" => %{"type" => "boolean"},
+
"emailConfirmed" => %{"type" => "boolean"},
+
"handle" => %{"format" => "handle", "type" => "string"},
+
"refreshJwt" => %{"type" => "string"},
+
"status" => %{
+
"description" =>
+
"If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.",
+
"knownValues" => ["takendown", "suspended", "deactivated"],
+
"type" => "string"
+
}
+
},
+
"required" => ["accessJwt", "refreshJwt", "handle", "did"],
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.server.createSession",
+
"lexicon" => 1
+
})
+
end
+29
lib/atproto/com/atproto/server/deactivateAccount.ex
···
+
defmodule Com.Atproto.Server.DeactivateAccount do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Deactivates a currently active account. Stops serving of repo, and future writes to repo until reactivated. Used to finalize account migration with the old host after the account has been activated on the new host.",
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"deleteAfter" => %{
+
"description" =>
+
"A recommendation to server as to how long they should hold onto the deactivated account before deleting.",
+
"format" => "datetime",
+
"type" => "string"
+
}
+
},
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.server.deactivateAccount",
+
"lexicon" => 1
+
})
+
end
+42
lib/atproto/com/atproto/server/defs.ex
···
+
defmodule Com.Atproto.Server.Defs do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"inviteCode" => %{
+
"properties" => %{
+
"available" => %{"type" => "integer"},
+
"code" => %{"type" => "string"},
+
"createdAt" => %{"format" => "datetime", "type" => "string"},
+
"createdBy" => %{"type" => "string"},
+
"disabled" => %{"type" => "boolean"},
+
"forAccount" => %{"type" => "string"},
+
"uses" => %{
+
"items" => %{"ref" => "#inviteCodeUse", "type" => "ref"},
+
"type" => "array"
+
}
+
},
+
"required" => [
+
"code",
+
"available",
+
"disabled",
+
"forAccount",
+
"createdBy",
+
"createdAt",
+
"uses"
+
],
+
"type" => "object"
+
},
+
"inviteCodeUse" => %{
+
"properties" => %{
+
"usedAt" => %{"format" => "datetime", "type" => "string"},
+
"usedBy" => %{"format" => "did", "type" => "string"}
+
},
+
"required" => ["usedBy", "usedAt"],
+
"type" => "object"
+
}
+
},
+
"id" => "com.atproto.server.defs",
+
"lexicon" => 1
+
})
+
end
+28
lib/atproto/com/atproto/server/deleteAccount.ex
···
+
defmodule Com.Atproto.Server.DeleteAccount do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Delete an actor's account with a token and password. Can only be called after requesting a deletion token. Requires auth.",
+
"errors" => [%{"name" => "ExpiredToken"}, %{"name" => "InvalidToken"}],
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"did" => %{"format" => "did", "type" => "string"},
+
"password" => %{"type" => "string"},
+
"token" => %{"type" => "string"}
+
},
+
"required" => ["did", "password", "token"],
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.server.deleteAccount",
+
"lexicon" => 1
+
})
+
end
+14
lib/atproto/com/atproto/server/deleteSession.ex
···
+
defmodule Com.Atproto.Server.DeleteSession do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" => "Delete the current session. Requires auth.",
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.server.deleteSession",
+
"lexicon" => 1
+
})
+
end
+61
lib/atproto/com/atproto/server/describeServer.ex
···
+
defmodule Com.Atproto.Server.DescribeServer do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"contact" => %{
+
"properties" => %{"email" => %{"type" => "string"}},
+
"type" => "object"
+
},
+
"links" => %{
+
"properties" => %{
+
"privacyPolicy" => %{"format" => "uri", "type" => "string"},
+
"termsOfService" => %{"format" => "uri", "type" => "string"}
+
},
+
"type" => "object"
+
},
+
"main" => %{
+
"description" =>
+
"Describes the server's account creation requirements and capabilities. Implemented by PDS.",
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"availableUserDomains" => %{
+
"description" => "List of domain suffixes that can be used in account handles.",
+
"items" => %{"type" => "string"},
+
"type" => "array"
+
},
+
"contact" => %{
+
"description" => "Contact information",
+
"ref" => "#contact",
+
"type" => "ref"
+
},
+
"did" => %{"format" => "did", "type" => "string"},
+
"inviteCodeRequired" => %{
+
"description" =>
+
"If true, an invite code must be supplied to create an account on this instance.",
+
"type" => "boolean"
+
},
+
"links" => %{
+
"description" => "URLs of service policy documents.",
+
"ref" => "#links",
+
"type" => "ref"
+
},
+
"phoneVerificationRequired" => %{
+
"description" =>
+
"If true, a phone verification token must be supplied to create an account on this instance.",
+
"type" => "boolean"
+
}
+
},
+
"required" => ["did", "availableUserDomains"],
+
"type" => "object"
+
}
+
},
+
"type" => "query"
+
}
+
},
+
"id" => "com.atproto.server.describeServer",
+
"lexicon" => 1
+
})
+
end
+43
lib/atproto/com/atproto/server/getAccountInviteCodes.ex
···
+
defmodule Com.Atproto.Server.GetAccountInviteCodes do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" => "Get all invite codes for the current account. Requires auth.",
+
"errors" => [%{"name" => "DuplicateCreate"}],
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"codes" => %{
+
"items" => %{
+
"ref" => "com.atproto.server.defs#inviteCode",
+
"type" => "ref"
+
},
+
"type" => "array"
+
}
+
},
+
"required" => ["codes"],
+
"type" => "object"
+
}
+
},
+
"parameters" => %{
+
"properties" => %{
+
"createAvailable" => %{
+
"default" => true,
+
"description" =>
+
"Controls whether any new 'earned' but not 'created' invites should be created.",
+
"type" => "boolean"
+
},
+
"includeUsed" => %{"default" => true, "type" => "boolean"}
+
},
+
"type" => "params"
+
},
+
"type" => "query"
+
}
+
},
+
"id" => "com.atproto.server.getAccountInviteCodes",
+
"lexicon" => 1
+
})
+
end
+52
lib/atproto/com/atproto/server/getServiceAuth.ex
···
+
defmodule Com.Atproto.Server.GetServiceAuth do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Get a signed token on behalf of the requesting DID for the requested service.",
+
"errors" => [
+
%{
+
"description" =>
+
"Indicates that the requested expiration date is not a valid. May be in the past or may be reliant on the requested scopes.",
+
"name" => "BadExpiration"
+
}
+
],
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{"token" => %{"type" => "string"}},
+
"required" => ["token"],
+
"type" => "object"
+
}
+
},
+
"parameters" => %{
+
"properties" => %{
+
"aud" => %{
+
"description" =>
+
"The DID of the service that the token will be used to authenticate with",
+
"format" => "did",
+
"type" => "string"
+
},
+
"exp" => %{
+
"description" =>
+
"The time in Unix Epoch seconds that the JWT expires. Defaults to 60 seconds in the future. The service may enforce certain time bounds on tokens depending on the requested scope.",
+
"type" => "integer"
+
},
+
"lxm" => %{
+
"description" => "Lexicon (XRPC) method to bind the requested token to",
+
"format" => "nsid",
+
"type" => "string"
+
}
+
},
+
"required" => ["aud"],
+
"type" => "params"
+
},
+
"type" => "query"
+
}
+
},
+
"id" => "com.atproto.server.getServiceAuth",
+
"lexicon" => 1
+
})
+
end
+36
lib/atproto/com/atproto/server/getSession.ex
···
+
defmodule Com.Atproto.Server.GetSession do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" => "Get information about the current auth session. Requires auth.",
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"active" => %{"type" => "boolean"},
+
"did" => %{"format" => "did", "type" => "string"},
+
"didDoc" => %{"type" => "unknown"},
+
"email" => %{"type" => "string"},
+
"emailAuthFactor" => %{"type" => "boolean"},
+
"emailConfirmed" => %{"type" => "boolean"},
+
"handle" => %{"format" => "handle", "type" => "string"},
+
"status" => %{
+
"description" =>
+
"If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.",
+
"knownValues" => ["takendown", "suspended", "deactivated"],
+
"type" => "string"
+
}
+
},
+
"required" => ["handle", "did"],
+
"type" => "object"
+
}
+
},
+
"type" => "query"
+
}
+
},
+
"id" => "com.atproto.server.getSession",
+
"lexicon" => 1
+
})
+
end
+37
lib/atproto/com/atproto/server/listAppPasswords.ex
···
+
defmodule Com.Atproto.Server.ListAppPasswords do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"appPassword" => %{
+
"properties" => %{
+
"createdAt" => %{"format" => "datetime", "type" => "string"},
+
"name" => %{"type" => "string"},
+
"privileged" => %{"type" => "boolean"}
+
},
+
"required" => ["name", "createdAt"],
+
"type" => "object"
+
},
+
"main" => %{
+
"description" => "List all App Passwords.",
+
"errors" => [%{"name" => "AccountTakedown"}],
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"passwords" => %{
+
"items" => %{"ref" => "#appPassword", "type" => "ref"},
+
"type" => "array"
+
}
+
},
+
"required" => ["passwords"],
+
"type" => "object"
+
}
+
},
+
"type" => "query"
+
}
+
},
+
"id" => "com.atproto.server.listAppPasswords",
+
"lexicon" => 1
+
})
+
end
+37
lib/atproto/com/atproto/server/refreshSession.ex
···
+
defmodule Com.Atproto.Server.RefreshSession do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Refresh an authentication session. Requires auth using the 'refreshJwt' (not the 'accessJwt').",
+
"errors" => [%{"name" => "AccountTakedown"}],
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"accessJwt" => %{"type" => "string"},
+
"active" => %{"type" => "boolean"},
+
"did" => %{"format" => "did", "type" => "string"},
+
"didDoc" => %{"type" => "unknown"},
+
"handle" => %{"format" => "handle", "type" => "string"},
+
"refreshJwt" => %{"type" => "string"},
+
"status" => %{
+
"description" =>
+
"Hosting status of the account. If not specified, then assume 'active'.",
+
"knownValues" => ["takendown", "suspended", "deactivated"],
+
"type" => "string"
+
}
+
},
+
"required" => ["accessJwt", "refreshJwt", "handle", "did"],
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.server.refreshSession",
+
"lexicon" => 1
+
})
+
end
+14
lib/atproto/com/atproto/server/requestAccountDelete.ex
···
+
defmodule Com.Atproto.Server.RequestAccountDelete do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" => "Initiate a user account deletion via email.",
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.server.requestAccountDelete",
+
"lexicon" => 1
+
})
+
end
+14
lib/atproto/com/atproto/server/requestEmailConfirmation.ex
···
+
defmodule Com.Atproto.Server.RequestEmailConfirmation do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" => "Request an email with a code to confirm ownership of email.",
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.server.requestEmailConfirmation",
+
"lexicon" => 1
+
})
+
end
+22
lib/atproto/com/atproto/server/requestEmailUpdate.ex
···
+
defmodule Com.Atproto.Server.RequestEmailUpdate do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" => "Request a token in order to update email.",
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{"tokenRequired" => %{"type" => "boolean"}},
+
"required" => ["tokenRequired"],
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.server.requestEmailUpdate",
+
"lexicon" => 1
+
})
+
end
+22
lib/atproto/com/atproto/server/requestPasswordReset.ex
···
+
defmodule Com.Atproto.Server.RequestPasswordReset do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" => "Initiate a user account password reset via email.",
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{"email" => %{"type" => "string"}},
+
"required" => ["email"],
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.server.requestPasswordReset",
+
"lexicon" => 1
+
})
+
end
+42
lib/atproto/com/atproto/server/reserveSigningKey.ex
···
+
defmodule Com.Atproto.Server.ReserveSigningKey do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Reserve a repo signing key, for use with account creation. Necessary so that a DID PLC update operation can be constructed during an account migraiton. Public and does not require auth; implemented by PDS. NOTE: this endpoint may change when full account migration is implemented.",
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"did" => %{
+
"description" => "The DID to reserve a key for.",
+
"format" => "did",
+
"type" => "string"
+
}
+
},
+
"type" => "object"
+
}
+
},
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"signingKey" => %{
+
"description" =>
+
"The public key for the reserved signing key, in did:key serialization.",
+
"type" => "string"
+
}
+
},
+
"required" => ["signingKey"],
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.server.reserveSigningKey",
+
"lexicon" => 1
+
})
+
end
+26
lib/atproto/com/atproto/server/resetPassword.ex
···
+
defmodule Com.Atproto.Server.ResetPassword do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" => "Reset a user account password using a token.",
+
"errors" => [%{"name" => "ExpiredToken"}, %{"name" => "InvalidToken"}],
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"password" => %{"type" => "string"},
+
"token" => %{"type" => "string"}
+
},
+
"required" => ["token", "password"],
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.server.resetPassword",
+
"lexicon" => 1
+
})
+
end
+22
lib/atproto/com/atproto/server/revokeAppPassword.ex
···
+
defmodule Com.Atproto.Server.RevokeAppPassword do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" => "Revoke an App Password by name.",
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{"name" => %{"type" => "string"}},
+
"required" => ["name"],
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.server.revokeAppPassword",
+
"lexicon" => 1
+
})
+
end
+35
lib/atproto/com/atproto/server/updateEmail.ex
···
+
defmodule Com.Atproto.Server.UpdateEmail do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" => "Update an account's email.",
+
"errors" => [
+
%{"name" => "ExpiredToken"},
+
%{"name" => "InvalidToken"},
+
%{"name" => "TokenRequired"}
+
],
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"email" => %{"type" => "string"},
+
"emailAuthFactor" => %{"type" => "boolean"},
+
"token" => %{
+
"description" =>
+
"Requires a token from com.atproto.sever.requestEmailUpdate if the account's email has been confirmed.",
+
"type" => "string"
+
}
+
},
+
"required" => ["email"],
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.server.updateEmail",
+
"lexicon" => 1
+
})
+
end
+14
lib/atproto/com/atproto/sync/defs.ex
···
+
defmodule Com.Atproto.Sync.Defs do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"hostStatus" => %{
+
"knownValues" => ["active", "idle", "offline", "throttled", "banned"],
+
"type" => "string"
+
}
+
},
+
"id" => "com.atproto.sync.defs",
+
"lexicon" => 1
+
})
+
end
+39
lib/atproto/com/atproto/sync/getBlob.ex
···
+
defmodule Com.Atproto.Sync.GetBlob do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Get a blob associated with a given account. Returns the full blob as originally uploaded. Does not require auth; implemented by PDS.",
+
"errors" => [
+
%{"name" => "BlobNotFound"},
+
%{"name" => "RepoNotFound"},
+
%{"name" => "RepoTakendown"},
+
%{"name" => "RepoSuspended"},
+
%{"name" => "RepoDeactivated"}
+
],
+
"output" => %{"encoding" => "*/*"},
+
"parameters" => %{
+
"properties" => %{
+
"cid" => %{
+
"description" => "The CID of the blob to fetch",
+
"format" => "cid",
+
"type" => "string"
+
},
+
"did" => %{
+
"description" => "The DID of the account.",
+
"format" => "did",
+
"type" => "string"
+
}
+
},
+
"required" => ["did", "cid"],
+
"type" => "params"
+
},
+
"type" => "query"
+
}
+
},
+
"id" => "com.atproto.sync.getBlob",
+
"lexicon" => 1
+
})
+
end
+38
lib/atproto/com/atproto/sync/getBlocks.ex
···
+
defmodule Com.Atproto.Sync.GetBlocks do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Get data blocks from a given repo, by CID. For example, intermediate MST nodes, or records. Does not require auth; implemented by PDS.",
+
"errors" => [
+
%{"name" => "BlockNotFound"},
+
%{"name" => "RepoNotFound"},
+
%{"name" => "RepoTakendown"},
+
%{"name" => "RepoSuspended"},
+
%{"name" => "RepoDeactivated"}
+
],
+
"output" => %{"encoding" => "application/vnd.ipld.car"},
+
"parameters" => %{
+
"properties" => %{
+
"cids" => %{
+
"items" => %{"format" => "cid", "type" => "string"},
+
"type" => "array"
+
},
+
"did" => %{
+
"description" => "The DID of the repo.",
+
"format" => "did",
+
"type" => "string"
+
}
+
},
+
"required" => ["did", "cids"],
+
"type" => "params"
+
},
+
"type" => "query"
+
}
+
},
+
"id" => "com.atproto.sync.getBlocks",
+
"lexicon" => 1
+
})
+
end
+26
lib/atproto/com/atproto/sync/getCheckout.ex
···
+
defmodule Com.Atproto.Sync.GetCheckout do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" => "DEPRECATED - please use com.atproto.sync.getRepo instead",
+
"output" => %{"encoding" => "application/vnd.ipld.car"},
+
"parameters" => %{
+
"properties" => %{
+
"did" => %{
+
"description" => "The DID of the repo.",
+
"format" => "did",
+
"type" => "string"
+
}
+
},
+
"required" => ["did"],
+
"type" => "params"
+
},
+
"type" => "query"
+
}
+
},
+
"id" => "com.atproto.sync.getCheckout",
+
"lexicon" => 1
+
})
+
end
+34
lib/atproto/com/atproto/sync/getHead.ex
···
+
defmodule Com.Atproto.Sync.GetHead do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" => "DEPRECATED - please use com.atproto.sync.getLatestCommit instead",
+
"errors" => [%{"name" => "HeadNotFound"}],
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{"root" => %{"format" => "cid", "type" => "string"}},
+
"required" => ["root"],
+
"type" => "object"
+
}
+
},
+
"parameters" => %{
+
"properties" => %{
+
"did" => %{
+
"description" => "The DID of the repo.",
+
"format" => "did",
+
"type" => "string"
+
}
+
},
+
"required" => ["did"],
+
"type" => "params"
+
},
+
"type" => "query"
+
}
+
},
+
"id" => "com.atproto.sync.getHead",
+
"lexicon" => 1
+
})
+
end
+50
lib/atproto/com/atproto/sync/getHostStatus.ex
···
+
defmodule Com.Atproto.Sync.GetHostStatus do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Returns information about a specified upstream host, as consumed by the server. Implemented by relays.",
+
"errors" => [%{"name" => "HostNotFound"}],
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"accountCount" => %{
+
"description" =>
+
"Number of accounts on the server which are associated with the upstream host. Note that the upstream may actually have more accounts.",
+
"type" => "integer"
+
},
+
"hostname" => %{"type" => "string"},
+
"seq" => %{
+
"description" =>
+
"Recent repo stream event sequence number. May be delayed from actual stream processing (eg, persisted cursor not in-memory cursor).",
+
"type" => "integer"
+
},
+
"status" => %{
+
"ref" => "com.atproto.sync.defs#hostStatus",
+
"type" => "ref"
+
}
+
},
+
"required" => ["hostname"],
+
"type" => "object"
+
}
+
},
+
"parameters" => %{
+
"properties" => %{
+
"hostname" => %{
+
"description" => "Hostname of the host (eg, PDS or relay) being queried.",
+
"type" => "string"
+
}
+
},
+
"required" => ["hostname"],
+
"type" => "params"
+
},
+
"type" => "query"
+
}
+
},
+
"id" => "com.atproto.sync.getHostStatus",
+
"lexicon" => 1
+
})
+
end
+43
lib/atproto/com/atproto/sync/getLatestCommit.ex
···
+
defmodule Com.Atproto.Sync.GetLatestCommit do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Get the current commit CID & revision of the specified repo. Does not require auth.",
+
"errors" => [
+
%{"name" => "RepoNotFound"},
+
%{"name" => "RepoTakendown"},
+
%{"name" => "RepoSuspended"},
+
%{"name" => "RepoDeactivated"}
+
],
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"cid" => %{"format" => "cid", "type" => "string"},
+
"rev" => %{"format" => "tid", "type" => "string"}
+
},
+
"required" => ["cid", "rev"],
+
"type" => "object"
+
}
+
},
+
"parameters" => %{
+
"properties" => %{
+
"did" => %{
+
"description" => "The DID of the repo.",
+
"format" => "did",
+
"type" => "string"
+
}
+
},
+
"required" => ["did"],
+
"type" => "params"
+
},
+
"type" => "query"
+
}
+
},
+
"id" => "com.atproto.sync.getLatestCommit",
+
"lexicon" => 1
+
})
+
end
+40
lib/atproto/com/atproto/sync/getRecord.ex
···
+
defmodule Com.Atproto.Sync.GetRecord do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Get data blocks needed to prove the existence or non-existence of record in the current version of repo. Does not require auth.",
+
"errors" => [
+
%{"name" => "RecordNotFound"},
+
%{"name" => "RepoNotFound"},
+
%{"name" => "RepoTakendown"},
+
%{"name" => "RepoSuspended"},
+
%{"name" => "RepoDeactivated"}
+
],
+
"output" => %{"encoding" => "application/vnd.ipld.car"},
+
"parameters" => %{
+
"properties" => %{
+
"collection" => %{"format" => "nsid", "type" => "string"},
+
"did" => %{
+
"description" => "The DID of the repo.",
+
"format" => "did",
+
"type" => "string"
+
},
+
"rkey" => %{
+
"description" => "Record Key",
+
"format" => "record-key",
+
"type" => "string"
+
}
+
},
+
"required" => ["did", "collection", "rkey"],
+
"type" => "params"
+
},
+
"type" => "query"
+
}
+
},
+
"id" => "com.atproto.sync.getRecord",
+
"lexicon" => 1
+
})
+
end
+38
lib/atproto/com/atproto/sync/getRepo.ex
···
+
defmodule Com.Atproto.Sync.GetRepo do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Download a repository export as CAR file. Optionally only a 'diff' since a previous revision. Does not require auth; implemented by PDS.",
+
"errors" => [
+
%{"name" => "RepoNotFound"},
+
%{"name" => "RepoTakendown"},
+
%{"name" => "RepoSuspended"},
+
%{"name" => "RepoDeactivated"}
+
],
+
"output" => %{"encoding" => "application/vnd.ipld.car"},
+
"parameters" => %{
+
"properties" => %{
+
"did" => %{
+
"description" => "The DID of the repo.",
+
"format" => "did",
+
"type" => "string"
+
},
+
"since" => %{
+
"description" => "The revision ('rev') of the repo to create a diff from.",
+
"format" => "tid",
+
"type" => "string"
+
}
+
},
+
"required" => ["did"],
+
"type" => "params"
+
},
+
"type" => "query"
+
}
+
},
+
"id" => "com.atproto.sync.getRepo",
+
"lexicon" => 1
+
})
+
end
+56
lib/atproto/com/atproto/sync/getRepoStatus.ex
···
+
defmodule Com.Atproto.Sync.GetRepoStatus do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Get the hosting status for a repository, on this server. Expected to be implemented by PDS and Relay.",
+
"errors" => [%{"name" => "RepoNotFound"}],
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"active" => %{"type" => "boolean"},
+
"did" => %{"format" => "did", "type" => "string"},
+
"rev" => %{
+
"description" => "Optional field, the current rev of the repo, if active=true",
+
"format" => "tid",
+
"type" => "string"
+
},
+
"status" => %{
+
"description" =>
+
"If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.",
+
"knownValues" => [
+
"takendown",
+
"suspended",
+
"deleted",
+
"deactivated",
+
"desynchronized",
+
"throttled"
+
],
+
"type" => "string"
+
}
+
},
+
"required" => ["did", "active"],
+
"type" => "object"
+
}
+
},
+
"parameters" => %{
+
"properties" => %{
+
"did" => %{
+
"description" => "The DID of the repo.",
+
"format" => "did",
+
"type" => "string"
+
}
+
},
+
"required" => ["did"],
+
"type" => "params"
+
},
+
"type" => "query"
+
}
+
},
+
"id" => "com.atproto.sync.getRepoStatus",
+
"lexicon" => 1
+
})
+
end
+58
lib/atproto/com/atproto/sync/listBlobs.ex
···
+
defmodule Com.Atproto.Sync.ListBlobs do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"List blob CIDs for an account, since some repo revision. Does not require auth; implemented by PDS.",
+
"errors" => [
+
%{"name" => "RepoNotFound"},
+
%{"name" => "RepoTakendown"},
+
%{"name" => "RepoSuspended"},
+
%{"name" => "RepoDeactivated"}
+
],
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"cids" => %{
+
"items" => %{"format" => "cid", "type" => "string"},
+
"type" => "array"
+
},
+
"cursor" => %{"type" => "string"}
+
},
+
"required" => ["cids"],
+
"type" => "object"
+
}
+
},
+
"parameters" => %{
+
"properties" => %{
+
"cursor" => %{"type" => "string"},
+
"did" => %{
+
"description" => "The DID of the repo.",
+
"format" => "did",
+
"type" => "string"
+
},
+
"limit" => %{
+
"default" => 500,
+
"maximum" => 1000,
+
"minimum" => 1,
+
"type" => "integer"
+
},
+
"since" => %{
+
"description" => "Optional revision of the repo to list blobs since.",
+
"format" => "tid",
+
"type" => "string"
+
}
+
},
+
"required" => ["did"],
+
"type" => "params"
+
},
+
"type" => "query"
+
}
+
},
+
"id" => "com.atproto.sync.listBlobs",
+
"lexicon" => 1
+
})
+
end
+63
lib/atproto/com/atproto/sync/listHosts.ex
···
+
defmodule Com.Atproto.Sync.ListHosts do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"host" => %{
+
"properties" => %{
+
"accountCount" => %{"type" => "integer"},
+
"hostname" => %{
+
"description" => "hostname of server; not a URL (no scheme)",
+
"type" => "string"
+
},
+
"seq" => %{
+
"description" =>
+
"Recent repo stream event sequence number. May be delayed from actual stream processing (eg, persisted cursor not in-memory cursor).",
+
"type" => "integer"
+
},
+
"status" => %{
+
"ref" => "com.atproto.sync.defs#hostStatus",
+
"type" => "ref"
+
}
+
},
+
"required" => ["hostname"],
+
"type" => "object"
+
},
+
"main" => %{
+
"description" =>
+
"Enumerates upstream hosts (eg, PDS or relay instances) that this service consumes from. Implemented by relays.",
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"cursor" => %{"type" => "string"},
+
"hosts" => %{
+
"description" =>
+
"Sort order is not formally specified. Recommended order is by time host was first seen by the server, with oldest first.",
+
"items" => %{"ref" => "#host", "type" => "ref"},
+
"type" => "array"
+
}
+
},
+
"required" => ["hosts"],
+
"type" => "object"
+
}
+
},
+
"parameters" => %{
+
"properties" => %{
+
"cursor" => %{"type" => "string"},
+
"limit" => %{
+
"default" => 200,
+
"maximum" => 1000,
+
"minimum" => 1,
+
"type" => "integer"
+
}
+
},
+
"type" => "params"
+
},
+
"type" => "query"
+
}
+
},
+
"id" => "com.atproto.sync.listHosts",
+
"lexicon" => 1
+
})
+
end
+68
lib/atproto/com/atproto/sync/listRepos.ex
···
+
defmodule Com.Atproto.Sync.ListRepos do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Enumerates all the DID, rev, and commit CID for all repos hosted by this service. Does not require auth; implemented by PDS and Relay.",
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"cursor" => %{"type" => "string"},
+
"repos" => %{
+
"items" => %{"ref" => "#repo", "type" => "ref"},
+
"type" => "array"
+
}
+
},
+
"required" => ["repos"],
+
"type" => "object"
+
}
+
},
+
"parameters" => %{
+
"properties" => %{
+
"cursor" => %{"type" => "string"},
+
"limit" => %{
+
"default" => 500,
+
"maximum" => 1000,
+
"minimum" => 1,
+
"type" => "integer"
+
}
+
},
+
"type" => "params"
+
},
+
"type" => "query"
+
},
+
"repo" => %{
+
"properties" => %{
+
"active" => %{"type" => "boolean"},
+
"did" => %{"format" => "did", "type" => "string"},
+
"head" => %{
+
"description" => "Current repo commit CID",
+
"format" => "cid",
+
"type" => "string"
+
},
+
"rev" => %{"format" => "tid", "type" => "string"},
+
"status" => %{
+
"description" =>
+
"If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.",
+
"knownValues" => [
+
"takendown",
+
"suspended",
+
"deleted",
+
"deactivated",
+
"desynchronized",
+
"throttled"
+
],
+
"type" => "string"
+
}
+
},
+
"required" => ["did", "head", "rev"],
+
"type" => "object"
+
}
+
},
+
"id" => "com.atproto.sync.listRepos",
+
"lexicon" => 1
+
})
+
end
+50
lib/atproto/com/atproto/sync/listReposByCollection.ex
···
+
defmodule Com.Atproto.Sync.ListReposByCollection do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Enumerates all the DIDs which have records with the given collection NSID.",
+
"output" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"cursor" => %{"type" => "string"},
+
"repos" => %{
+
"items" => %{"ref" => "#repo", "type" => "ref"},
+
"type" => "array"
+
}
+
},
+
"required" => ["repos"],
+
"type" => "object"
+
}
+
},
+
"parameters" => %{
+
"properties" => %{
+
"collection" => %{"format" => "nsid", "type" => "string"},
+
"cursor" => %{"type" => "string"},
+
"limit" => %{
+
"default" => 500,
+
"description" =>
+
"Maximum size of response set. Recommend setting a large maximum (1000+) when enumerating large DID lists.",
+
"maximum" => 2000,
+
"minimum" => 1,
+
"type" => "integer"
+
}
+
},
+
"required" => ["collection"],
+
"type" => "params"
+
},
+
"type" => "query"
+
},
+
"repo" => %{
+
"properties" => %{"did" => %{"format" => "did", "type" => "string"}},
+
"required" => ["did"],
+
"type" => "object"
+
}
+
},
+
"id" => "com.atproto.sync.listReposByCollection",
+
"lexicon" => 1
+
})
+
end
+29
lib/atproto/com/atproto/sync/notifyOfUpdate.ex
···
+
defmodule Com.Atproto.Sync.NotifyOfUpdate do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Notify a crawling service of a recent update, and that crawling should resume. Intended use is after a gap between repo stream events caused the crawling service to disconnect. Does not require auth; implemented by Relay. DEPRECATED: just use com.atproto.sync.requestCrawl",
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"hostname" => %{
+
"description" =>
+
"Hostname of the current service (usually a PDS) that is notifying of update.",
+
"type" => "string"
+
}
+
},
+
"required" => ["hostname"],
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.sync.notifyOfUpdate",
+
"lexicon" => 1
+
})
+
end
+30
lib/atproto/com/atproto/sync/requestCrawl.ex
···
+
defmodule Com.Atproto.Sync.RequestCrawl do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"main" => %{
+
"description" =>
+
"Request a service to persistently crawl hosted repos. Expected use is new PDS instances declaring their existence to Relays. Does not require auth.",
+
"errors" => [%{"name" => "HostBanned"}],
+
"input" => %{
+
"encoding" => "application/json",
+
"schema" => %{
+
"properties" => %{
+
"hostname" => %{
+
"description" =>
+
"Hostname of the current service (eg, PDS) that is requesting to be crawled.",
+
"type" => "string"
+
}
+
},
+
"required" => ["hostname"],
+
"type" => "object"
+
}
+
},
+
"type" => "procedure"
+
}
+
},
+
"id" => "com.atproto.sync.requestCrawl",
+
"lexicon" => 1
+
})
+
end
+237
lib/atproto/com/atproto/sync/subscribeRepos.ex
···
+
defmodule Com.Atproto.Sync.SubscribeRepos do
+
use Atex.Lexicon
+
+
deflexicon(%{
+
"defs" => %{
+
"account" => %{
+
"description" =>
+
"Represents a change to an account's status on a host (eg, PDS or Relay). The semantics of this event are that the status is at the host which emitted the event, not necessarily that at the currently active PDS. Eg, a Relay takedown would emit a takedown with active=false, even if the PDS is still active.",
+
"properties" => %{
+
"active" => %{
+
"description" =>
+
"Indicates that the account has a repository which can be fetched from the host that emitted this event.",
+
"type" => "boolean"
+
},
+
"did" => %{"format" => "did", "type" => "string"},
+
"seq" => %{"type" => "integer"},
+
"status" => %{
+
"description" =>
+
"If active=false, this optional field indicates a reason for why the account is not active.",
+
"knownValues" => [
+
"takendown",
+
"suspended",
+
"deleted",
+
"deactivated",
+
"desynchronized",
+
"throttled"
+
],
+
"type" => "string"
+
},
+
"time" => %{"format" => "datetime", "type" => "string"}
+
},
+
"required" => ["seq", "did", "time", "active"],
+
"type" => "object"
+
},
+
"commit" => %{
+
"description" =>
+
"Represents an update of repository state. Note that empty commits are allowed, which include no repo data changes, but an update to rev and signature.",
+
"nullable" => ["since"],
+
"properties" => %{
+
"blobs" => %{
+
"items" => %{
+
"description" =>
+
"DEPRECATED -- will soon always be empty. List of new blobs (by CID) referenced by records in this commit.",
+
"type" => "cid-link"
+
},
+
"type" => "array"
+
},
+
"blocks" => %{
+
"description" =>
+
"CAR file containing relevant blocks, as a diff since the previous repo state. The commit must be included as a block, and the commit block CID must be the first entry in the CAR header 'roots' list.",
+
"maxLength" => 2_000_000,
+
"type" => "bytes"
+
},
+
"commit" => %{
+
"description" => "Repo commit object CID.",
+
"type" => "cid-link"
+
},
+
"ops" => %{
+
"items" => %{
+
"description" =>
+
"List of repo mutation operations in this commit (eg, records created, updated, or deleted).",
+
"ref" => "#repoOp",
+
"type" => "ref"
+
},
+
"maxLength" => 200,
+
"type" => "array"
+
},
+
"prevData" => %{
+
"description" =>
+
"The root CID of the MST tree for the previous commit from this repo (indicated by the 'since' revision field in this message). Corresponds to the 'data' field in the repo commit object. NOTE: this field is effectively required for the 'inductive' version of firehose.",
+
"type" => "cid-link"
+
},
+
"rebase" => %{
+
"description" => "DEPRECATED -- unused",
+
"type" => "boolean"
+
},
+
"repo" => %{
+
"description" =>
+
"The repo this event comes from. Note that all other message types name this field 'did'.",
+
"format" => "did",
+
"type" => "string"
+
},
+
"rev" => %{
+
"description" =>
+
"The rev of the emitted commit. Note that this information is also in the commit object included in blocks, unless this is a tooBig event.",
+
"format" => "tid",
+
"type" => "string"
+
},
+
"seq" => %{
+
"description" => "The stream sequence number of this message.",
+
"type" => "integer"
+
},
+
"since" => %{
+
"description" => "The rev of the last emitted commit from this repo (if any).",
+
"format" => "tid",
+
"type" => "string"
+
},
+
"time" => %{
+
"description" => "Timestamp of when this message was originally broadcast.",
+
"format" => "datetime",
+
"type" => "string"
+
},
+
"tooBig" => %{
+
"description" =>
+
"DEPRECATED -- replaced by #sync event and data limits. Indicates that this commit contained too many ops, or data size was too large. Consumers will need to make a separate request to get missing data.",
+
"type" => "boolean"
+
}
+
},
+
"required" => [
+
"seq",
+
"rebase",
+
"tooBig",
+
"repo",
+
"commit",
+
"rev",
+
"since",
+
"blocks",
+
"ops",
+
"blobs",
+
"time"
+
],
+
"type" => "object"
+
},
+
"identity" => %{
+
"description" =>
+
"Represents a change to an account's identity. Could be an updated handle, signing key, or pds hosting endpoint. Serves as a prod to all downstream services to refresh their identity cache.",
+
"properties" => %{
+
"did" => %{"format" => "did", "type" => "string"},
+
"handle" => %{
+
"description" =>
+
"The current handle for the account, or 'handle.invalid' if validation fails. This field is optional, might have been validated or passed-through from an upstream source. Semantics and behaviors for PDS vs Relay may evolve in the future; see atproto specs for more details.",
+
"format" => "handle",
+
"type" => "string"
+
},
+
"seq" => %{"type" => "integer"},
+
"time" => %{"format" => "datetime", "type" => "string"}
+
},
+
"required" => ["seq", "did", "time"],
+
"type" => "object"
+
},
+
"info" => %{
+
"properties" => %{
+
"message" => %{"type" => "string"},
+
"name" => %{"knownValues" => ["OutdatedCursor"], "type" => "string"}
+
},
+
"required" => ["name"],
+
"type" => "object"
+
},
+
"main" => %{
+
"description" =>
+
"Repository event stream, aka Firehose endpoint. Outputs repo commits with diff data, and identity update events, for all repositories on the current server. See the atproto specifications for details around stream sequencing, repo versioning, CAR diff format, and more. Public and does not require auth; implemented by PDS and Relay.",
+
"errors" => [
+
%{"name" => "FutureCursor"},
+
%{
+
"description" =>
+
"If the consumer of the stream can not keep up with events, and a backlog gets too large, the server will drop the connection.",
+
"name" => "ConsumerTooSlow"
+
}
+
],
+
"message" => %{
+
"schema" => %{
+
"refs" => ["#commit", "#sync", "#identity", "#account", "#info"],
+
"type" => "union"
+
}
+
},
+
"parameters" => %{
+
"properties" => %{
+
"cursor" => %{
+
"description" => "The last known event seq number to backfill from.",
+
"type" => "integer"
+
}
+
},
+
"type" => "params"
+
},
+
"type" => "subscription"
+
},
+
"repoOp" => %{
+
"description" => "A repo operation, ie a mutation of a single record.",
+
"nullable" => ["cid"],
+
"properties" => %{
+
"action" => %{
+
"knownValues" => ["create", "update", "delete"],
+
"type" => "string"
+
},
+
"cid" => %{
+
"description" => "For creates and updates, the new record CID. For deletions, null.",
+
"type" => "cid-link"
+
},
+
"path" => %{"type" => "string"},
+
"prev" => %{
+
"description" =>
+
"For updates and deletes, the previous record CID (required for inductive firehose). For creations, field should not be defined.",
+
"type" => "cid-link"
+
}
+
},
+
"required" => ["action", "path", "cid"],
+
"type" => "object"
+
},
+
"sync" => %{
+
"description" =>
+
"Updates the repo to a new state, without necessarily including that state on the firehose. Used to recover from broken commit streams, data loss incidents, or in situations where upstream host does not know recent state of the repository.",
+
"properties" => %{
+
"blocks" => %{
+
"description" =>
+
"CAR file containing the commit, as a block. The CAR header must include the commit block CID as the first 'root'.",
+
"maxLength" => 10000,
+
"type" => "bytes"
+
},
+
"did" => %{
+
"description" =>
+
"The account this repo event corresponds to. Must match that in the commit object.",
+
"format" => "did",
+
"type" => "string"
+
},
+
"rev" => %{
+
"description" =>
+
"The rev of the commit. This value must match that in the commit object.",
+
"type" => "string"
+
},
+
"seq" => %{
+
"description" => "The stream sequence number of this message.",
+
"type" => "integer"
+
},
+
"time" => %{
+
"description" => "Timestamp of when this message was originally broadcast.",
+
"format" => "datetime",
+
"type" => "string"
+
}
+
},
+
"required" => ["seq", "did", "blocks", "rev", "time"],
+
"type" => "object"
+
}
+
},
+
"id" => "com.atproto.sync.subscribeRepos",
+
"lexicon" => 1
+
})
+
end