forked from bluesky-social/atproto
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Implement types and validation for new NIH lexicon DSL * Update xprc and xrpc-server to use new NIH lexicon DSL * Simplification: dont allow lexicon definitions to be refs or ref arrays * Add 'unknown' primitive type to NIH lexicon * Implement client codegen for NIH Lexicon * Implement server codegen for NIH Lexicon * Add the 'datetime' primitive type to the NIH Lexicon * Rework lexicons to use new NIH Lexicon DSL * Readd tokens to code generation * Update all code to use new NIH Lexicon (all tests passing!) * Add imports from external files to lex-cli codegen * Do not allow records, queries, or procedures outside of the main def * Update packages/lex-cli/src/util.ts Co-authored-by: devin ivy <devinivy@gmail.com> * Linter pass * Add knownValue output to codegen * Add comments to codegen * Use enum and const in codegen * Rework lexicon 'properties' structure * Treat falsy query params as undefined Co-authored-by: devin ivy <devinivy@gmail.com> * Remove now-redundant param presence validation Co-authored-by: devin ivy <devinivy@gmail.com>
- Loading branch information
Showing
243 changed files
with
13,169 additions
and
15,329 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,48 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "app.bsky.actor.createScene", | ||
"type": "procedure", | ||
"description": "Create a scene.", | ||
"input": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"required": ["handle"], | ||
"properties": { | ||
"handle": {"type": "string"}, | ||
"recoveryKey": {"type": "string"} | ||
} | ||
} | ||
}, | ||
"output": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"required": ["handle", "did", "declaration"], | ||
"properties": { | ||
"handle": { "type": "string" }, | ||
"did": { "type": "string" }, | ||
"declaration": {"$ref": "#/defs/declaration"} | ||
} | ||
} | ||
}, | ||
"errors": [ | ||
{"name": "InvalidHandle"}, | ||
{"name": "HandleNotAvailable"} | ||
], | ||
"defs": { | ||
"main": { | ||
"type": "procedure", | ||
"description": "Create a scene.", | ||
"input": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"required": ["handle"], | ||
"properties": { | ||
"handle": {"type": "string"}, | ||
"recoveryKey": {"type": "string"} | ||
} | ||
} | ||
}, | ||
"output": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"required": ["handle", "did", "declaration"], | ||
"properties": { | ||
"handle": { "type": "string" }, | ||
"did": { "type": "string" }, | ||
"declaration": "#declaration" | ||
} | ||
} | ||
}, | ||
"errors": [ | ||
{"name": "InvalidHandle"}, | ||
{"name": "HandleNotAvailable"} | ||
] | ||
}, | ||
"declaration": { | ||
"type": "object", | ||
"required": ["cid", "actorType"], | ||
"properties": { | ||
"cid": {"type": "string"}, | ||
"actorType": { | ||
"oneOf": [ | ||
{"$ref": "#/defs/actorKnown"}, | ||
{"$ref": "#/defs/actorUnknown"} | ||
] | ||
"type": "string", | ||
"knownValues": ["app.bsky.system.actorUser", "app.bsky.system.actorScene"] | ||
} | ||
} | ||
}, | ||
"actorKnown": { | ||
"type": "string", | ||
"enum": ["app.bsky.system.actorUser", "app.bsky.system.actorScene"] | ||
}, | ||
"actorUnknown": { | ||
"type": "string", | ||
"not": {"enum": ["app.bsky.system.actorUser", "app.bsky.system.actorScene"]} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,60 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "app.bsky.actor.getProfile", | ||
"type": "query", | ||
"parameters": { | ||
"type": "object", | ||
"required": ["actor"], | ||
"properties": { | ||
"actor": {"type": "string"} | ||
} | ||
}, | ||
"output": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"required": ["did", "declaration", "handle", "creator", "followersCount", "followsCount", "membersCount", "postsCount"], | ||
"properties": { | ||
"did": {"type": "string"}, | ||
"declaration": {"$ref": "#/defs/declaration"}, | ||
"handle": {"type": "string"}, | ||
"creator": {"type": "string"}, | ||
"displayName": { | ||
"type": "string", | ||
"maxLength": 64 | ||
}, | ||
"description": { | ||
"type": "string", | ||
"maxLength": 256 | ||
}, | ||
"followersCount": {"type": "integer"}, | ||
"followsCount": {"type": "integer"}, | ||
"membersCount": {"type": "integer"}, | ||
"postsCount": {"type": "integer"}, | ||
"myState": { | ||
"defs": { | ||
"main": { | ||
"type": "query", | ||
"parameters": { | ||
"type": "params", | ||
"required": ["actor"], | ||
"properties": { | ||
"actor": {"type": "string"} | ||
} | ||
}, | ||
"output": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"required": ["did", "declaration", "handle", "creator", "followersCount", "followsCount", "membersCount", "postsCount"], | ||
"properties": { | ||
"follow": {"type": "string"}, | ||
"member": {"type": "string"} | ||
"did": {"type": "string"}, | ||
"declaration": "#declaration", | ||
"handle": {"type": "string"}, | ||
"creator": {"type": "string"}, | ||
"displayName": { | ||
"type": "string", | ||
"maxLength": 64 | ||
}, | ||
"description": { | ||
"type": "string", | ||
"maxLength": 256 | ||
}, | ||
"followersCount": {"type": "integer"}, | ||
"followsCount": {"type": "integer"}, | ||
"membersCount": {"type": "integer"}, | ||
"postsCount": {"type": "integer"}, | ||
"myState": "#myState" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"defs": { | ||
}, | ||
"myState": { | ||
"type": "object", | ||
"properties": { | ||
"follow": {"type": "string"}, | ||
"member": {"type": "string"} | ||
} | ||
}, | ||
"declaration": { | ||
"type": "object", | ||
"required": ["cid", "actorType"], | ||
"properties": { | ||
"cid": {"type": "string"}, | ||
"actorType": { | ||
"oneOf": [ | ||
{"$ref": "#/defs/actorKnown"}, | ||
{"$ref": "#/defs/actorUnknown"} | ||
] | ||
"type": "string", | ||
"knownValues": ["app.bsky.system.actorUser", "app.bsky.system.actorScene"] | ||
} | ||
} | ||
}, | ||
"actorKnown": { | ||
"type": "string", | ||
"enum": ["app.bsky.system.actorUser", "app.bsky.system.actorScene"] | ||
}, | ||
"actorUnknown": { | ||
"type": "string", | ||
"not": {"enum": ["app.bsky.system.actorUser", "app.bsky.system.actorScene"]} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,64 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "app.bsky.actor.getSuggestions", | ||
"type": "query", | ||
"description": "Get a list of actors suggested for following. Used in discovery UIs.", | ||
"parameters": { | ||
"type": "object", | ||
"properties": { | ||
"limit": {"type": "integer", "minimum": 1, "maximum": 100, "default": 50}, | ||
"cursor": {"type": "string"} | ||
} | ||
}, | ||
"output": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"required": ["actors"], | ||
"properties": { | ||
"cursor": {"type": "string"}, | ||
"actors": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"required": ["did", "declaration", "handle"], | ||
"properties": { | ||
"did": {"type": "string"}, | ||
"declaration": {"$ref": "#/defs/declaration"}, | ||
"handle": {"type": "string"}, | ||
"displayName": { | ||
"type": "string", | ||
"maxLength": 64 | ||
}, | ||
"description": {"type": "string"}, | ||
"indexedAt": {"type": "string", "format": "date-time"}, | ||
"myState": { | ||
"type": "object", | ||
"properties": { | ||
"follow": {"type": "string"} | ||
} | ||
} | ||
"defs": { | ||
"main": { | ||
"type": "query", | ||
"description": "Get a list of actors suggested for following. Used in discovery UIs.", | ||
"parameters": { | ||
"type": "params", | ||
"properties": { | ||
"limit": {"type": "integer", "minimum": 1, "maximum": 100, "default": 50}, | ||
"cursor": {"type": "string"} | ||
} | ||
}, | ||
"output": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"required": ["actors"], | ||
"properties": { | ||
"cursor": {"type": "string"}, | ||
"actors": { | ||
"type": "array", | ||
"items": "#actor" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"defs": { | ||
}, | ||
"actor": { | ||
"type": "object", | ||
"required": ["did", "declaration", "handle"], | ||
"properties": { | ||
"did": {"type": "string"}, | ||
"declaration": "#declaration", | ||
"handle": {"type": "string"}, | ||
"displayName": { | ||
"type": "string", | ||
"maxLength": 64 | ||
}, | ||
"description": {"type": "string"}, | ||
"indexedAt": {"type": "datetime"}, | ||
"myState": "#myState" | ||
} | ||
}, | ||
"myState": { | ||
"type": "object", | ||
"properties": { | ||
"follow": {"type": "string"} | ||
} | ||
}, | ||
"declaration": { | ||
"type": "object", | ||
"required": ["cid", "actorType"], | ||
"properties": { | ||
"cid": {"type": "string"}, | ||
"actorType": { | ||
"oneOf": [ | ||
{"$ref": "#/defs/actorKnown"}, | ||
{"$ref": "#/defs/actorUnknown"} | ||
] | ||
"type": "string", | ||
"knownValues": ["app.bsky.system.actorUser", "app.bsky.system.actorScene"] | ||
} | ||
} | ||
}, | ||
"actorKnown": { | ||
"type": "string", | ||
"enum": ["app.bsky.system.actorUser", "app.bsky.system.actorScene"] | ||
}, | ||
"actorUnknown": { | ||
"type": "string", | ||
"not": {"enum": ["app.bsky.system.actorUser", "app.bsky.system.actorScene"]} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.