Skip to content

Commit

Permalink
Update NSID semantics to final (bluesky-social#232)
Browse files Browse the repository at this point in the history
* Improve lex-cli to remove files that no longer exist

* Update lex-cli to use new ns

* Rename lexicons: todo.adx to com.atproto, todo.social to app.bsky

* Improve lex-cli md generator
  • Loading branch information
pfrazee authored Oct 12, 2022
1 parent 7f2dfb8 commit 90cdb99
Show file tree
Hide file tree
Showing 180 changed files with 1,501 additions and 1,354 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.adx.createAccount",
"id": "com.atproto.createAccount",
"type": "procedure",
"description": "Create an account.",
"parameters": {},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.adx.createInviteCode",
"id": "com.atproto.createInviteCode",
"type": "procedure",
"description": "Create an invite code.",
"parameters": {},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.adx.createSession",
"id": "com.atproto.createSession",
"type": "procedure",
"description": "Create an authentication session.",
"parameters": {},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.adx.deleteAccount",
"id": "com.atproto.deleteAccount",
"type": "procedure",
"description": "Delete an account.",
"parameters": {},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.adx.deleteSession",
"id": "com.atproto.deleteSession",
"type": "procedure",
"description": "Delete the current session.",
"parameters": {},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.adx.getAccount",
"id": "com.atproto.getAccount",
"type": "query",
"description": "Get information about an account.",
"parameters": {},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.adx.getAccountsConfig",
"id": "com.atproto.getAccountsConfig",
"type": "query",
"description": "Get a document describing the service's accounts configuration.",
"parameters": {},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.adx.getSession",
"id": "com.atproto.getSession",
"type": "query",
"description": "Get information about the current session.",
"parameters": {},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.adx.repoBatchWrite",
"id": "com.atproto.repoBatchWrite",
"type": "procedure",
"description": "Apply a batch transaction of creates, puts, and deletes.",
"parameters": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.adx.repoCreateRecord",
"id": "com.atproto.repoCreateRecord",
"type": "procedure",
"description": "Create a new record.",
"parameters": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.adx.repoDeleteRecord",
"id": "com.atproto.repoDeleteRecord",
"type": "procedure",
"description": "Delete a record.",
"parameters": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.adx.repoDescribe",
"id": "com.atproto.repoDescribe",
"type": "query",
"description": "Get information about the repo, including the list of collections.",
"parameters": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.adx.repoGetRecord",
"id": "com.atproto.repoGetRecord",
"type": "query",
"description": "Fetch a record.",
"parameters": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.adx.repoListRecords",
"id": "com.atproto.repoListRecords",
"type": "query",
"description": "List a range of records in a collection.",
"parameters": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.adx.repoPutRecord",
"id": "com.atproto.repoPutRecord",
"type": "procedure",
"description": "Write a record.",
"parameters": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.adx.requestAccountPasswordReset",
"id": "com.atproto.requestAccountPasswordReset",
"type": "procedure",
"description": "Initiate a user account password reset via email",
"parameters": {},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.adx.resetAccountPassword",
"id": "com.atproto.resetAccountPassword",
"type": "procedure",
"description": "Reset a user account password using a token",
"parameters": {},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.adx.resolveName",
"id": "com.atproto.resolveName",
"type": "query",
"description": "Provides the DID of a repo.",
"parameters": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.adx.syncGetRepo",
"id": "com.atproto.syncGetRepo",
"type": "query",
"description": "Gets the repo state.",
"parameters": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.adx.syncGetRoot",
"id": "com.atproto.syncGetRoot",
"type": "query",
"description": "Gets the current root CID of a repo.",
"parameters": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.adx.syncUpdateRepo",
"id": "com.atproto.syncUpdateRepo",
"type": "procedure",
"description": "Writes commits to a repo.",
"parameters": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.social.badge",
"id": "app.bsky.badge",
"type": "record",
"description": "An assertion about the subject by this user.",
"record": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.social.follow",
"id": "app.bsky.follow",
"type": "record",
"description": "A social follow",
"record": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.social.getAuthorFeed",
"id": "app.bsky.getAuthorFeed",
"type": "query",
"description": "A view of a user's feed",
"parameters": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.social.getHomeFeed",
"id": "app.bsky.getHomeFeed",
"type": "query",
"description": "A view of the user's home feed",
"parameters": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.social.getLikedBy",
"id": "app.bsky.getLikedBy",
"type": "query",
"parameters": {
"uri": {"type": "string", "required": true},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.social.getNotificationCount",
"id": "app.bsky.getNotificationCount",
"type": "query",
"parameters": { },
"output": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.social.getNotifications",
"id": "app.bsky.getNotifications",
"type": "query",
"parameters": {
"limit": {"type": "number", "maximum": 100},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.social.getPostThread",
"id": "app.bsky.getPostThread",
"type": "query",
"parameters": {
"uri": {"type": "string", "required": true},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.social.getProfile",
"id": "app.bsky.getProfile",
"type": "query",
"parameters": {
"user": {"type": "string", "required": true}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.social.getRepostedBy",
"id": "app.bsky.getRepostedBy",
"type": "query",
"parameters": {
"uri": {"type": "string", "required": true},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.social.getUserFollowers",
"id": "app.bsky.getUserFollowers",
"type": "query",
"description": "Who is following a user?",
"parameters": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.social.getUserFollows",
"id": "app.bsky.getUserFollows",
"type": "query",
"description": "Who is a user following?",
"parameters": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.social.like",
"id": "app.bsky.like",
"type": "record",
"record": {
"type": "object",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.social.mediaEmbed",
"id": "app.bsky.mediaEmbed",
"type": "record",
"description": "A list of media embedded in a post or document.",
"record": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.social.post",
"id": "app.bsky.post",
"type": "record",
"record": {
"type": "object",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.social.postNotificationsSeen",
"id": "app.bsky.postNotificationsSeen",
"type": "procedure",
"description": "Notify server that the user has seen notifications",
"parameters": { },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.social.profile",
"id": "app.bsky.profile",
"type": "record",
"record": {
"type": "object",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lexicon": 1,
"id": "todo.social.repost",
"id": "app.bsky.repost",
"type": "record",
"record": {
"type": "object",
Expand Down
12 changes: 6 additions & 6 deletions packages/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ import API from '@adxp/api'
const client = API.service('http://example.com')

// xrpc methods
const res1 = await client.todo.adx.repoCreateRecord(
{did: alice.did, type: 'todo.social.post'},
const res1 = await client.com.atproto.repoCreateRecord(
{did: alice.did, type: 'app.bsky.post'},
{
$type: 'todo.social.post',
$type: 'app.bsky.post',
text: 'Hello, world!',
createdAt: (new Date()).toISOString()
}
)
const res2 = await client.todo.adx.repoListRecords({did: alice.did, type: 'todo.social.post'})
const res2 = await client.com.atproto.repoListRecords({did: alice.did, type: 'app.bsky.post'})

// repo record methods
const res3 = await client.todo.social.post.create({did: alice.did}, {
const res3 = await client.app.bsky.post.create({did: alice.did}, {
text: 'Hello, world!',
createdAt: (new Date()).toISOString()
})
const res4 = await client.todo.social.post.list({did: alice.did})
const res4 = await client.app.bsky.post.list({did: alice.did})
```

## License
Expand Down
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.1",
"main": "src/index.ts",
"scripts": {
"codegen": "lex gen-api ./src ../../schemas/todo.adx/* ../../schemas/todo.social/*",
"codegen": "lex gen-api ./src ../../lexicons/atproto.com/* ../../lexicons/bsky.app/*",
"prettier": "prettier --check src/",
"prettier:fix": "prettier --write src/",
"lint": "eslint . --ext .ts,.tsx",
Expand Down
Loading

0 comments on commit 90cdb99

Please sign in to comment.