559 Commits

Author SHA1 Message Date
Paul Frazee
ebf8e5c9ed
Add NotFoundError to getPostThread (#375) 2022-11-28 21:33:32 -06:00
devin ivy
134595e26e
Standardize limit schema across lexicons (#377) 2022-11-28 21:34:55 -05:00
devin ivy
fd359bada0
Use integers in lexicons (#367)
Use json schema integers rather than numbers where appropriate in lexicons
2022-11-23 16:13:37 -05:00
devin ivy
13aead171c
Support shallow builds and sourcemaps (#352)
* Enable all modules to be built shallowly, externalizing their deps

* Setup shallow builds to modify package.json main

* Hoist update-main-to-dist to separate call, fix lex-cli and plc shallow builds

* Generate sourcemaps during build

* Tidy

* Hoist new build deps up to root
2022-11-15 19:24:58 -05:00
Daniel Holmgren
2d947be9c2
Allow updating scene profiles (#341)
allow updating scene profiles
2022-11-11 13:36:36 -06:00
Paul Frazee
a1bee406e2
Add app.bsky.graph.getAssertions() (#340)
* Add app.bsky.graph.getAssertions()

* Update getAssertions to support query by author or subject

* Revert accidental change to members test
2022-11-11 12:38:25 -06:00
devin ivy
8ab87ff1f7
Standard actor declarations in app.bsky (#338)
* Include scene trends in feeds

* Tidy

* Tidy

* Sweep app.bsky schemas for standard actor declarations, remove reference from com.atproto

* Replace declarationCid on follow, assertion, confirmation records

* Sweep pds for standard app.bsky actor declarations

* Fix dev-env

* Tidy after merge
2022-11-10 15:46:16 -05:00
devin ivy
c52b9f0771
Include scene trends in feeds (#335)
* Include scene trends in feeds

* Tidy

* Tidy
2022-11-10 14:26:57 -05:00
Paul Frazee
7431e65f2a
Fix codegen signature for the record delete methods (#336) 2022-11-10 12:26:32 -06:00
Daniel Holmgren
e6471a7419
Trend schemas (#333)
trend schemas
2022-11-09 14:44:46 -06:00
devin ivy
da8f055816
Align XRPC parameters with subset of json schema (#328)
* Model procedure for setting a vote on a post

* Implement app.bsky.feed.setVote() method

* Support json schema subset for parameters in lexicon and lex-cli

* Update lexicons w/ json schema parameters

* Use enum in getVotes parameters

* Support json schema subset for parameters in xrpc-server, ajv validation

* Include parameter enums in generated markdown

* Tidy

* Unify xrpc parameter md docs with inputs and outputs: show ts interfaces

* Tidy
2022-11-09 15:39:47 -05:00
devin ivy
1bd8ef1811
Implement setVote() method (#325)
* Model procedure for setting a vote on a post

* Implement app.bsky.feed.setVote() method

* Ensure setVote() no-ops when already in correct state
2022-11-09 15:24:35 -05:00
Paul Frazee
e1150465ab
Add 'member' to getProfile state output, and add some dev-env mock data (#332)
* Add a scene to the dev-env mock data

* Add 'member' to myState output of getProfile

* Await db writes in dev env mock data

Co-authored-by: devin ivy <devinivy@gmail.com>

Co-authored-by: devin ivy <devinivy@gmail.com>
2022-11-09 14:09:16 -06:00
Daniel Holmgren
58634c47d7
Scene membership (#322)
* schemas

* routes

* bugfix

* tests

* test fixups

* delcaration in member views

* sort notif output
2022-11-08 14:22:16 -06:00
devin ivy
b117ae4568
Move from likes to votes (#319)
* Model votes in lexicon, remove likes

* Model votes in db, setup notifs, fix schema

* Update pds logic, move likes to votes

* Codegen

* Update tests for votes

* Test vote filter by direction

* Fix dev-env
2022-11-08 11:02:41 -05:00
Paul Frazee
cd1b64e600
Add app.bsky.actor.getSuggestions (#318)
* Fix some lexicon filenames

* Add app.bsky.actor.getSuggestions
2022-11-08 09:40:52 -06:00
Daniel Holmgren
b530a13d09
Scene creation & membership (#304)
* scene creation w unique handles

* wip

* user_dids -> did_handle

* invites -> assertion/confirmation

* do all the ops on scene create

* start tests + bug fixin

* user can make requests on behalf of scene

* accepting invites

* fix schema names

* get scene profiles

* return actor type in getProfile

* scene views test

* notifications test

* patch up a few db things

* rework handle & email noramlization

* codegen createscene errors
2022-11-07 14:33:33 -06:00
Paul Frazee
70c525f806
Rework post text slices to be objects (#311) 2022-11-04 18:26:33 -05:00
Paul Frazee
e61127111a
Split lexicons into more specific namespaces (#306)
* Segment lexicons into more specific namespaces and tighten up some naming conventions

* Update API to use new lexicons

* Update pds and dev-env to use new lexicons
2022-11-04 12:59:00 -05:00
Daniel Holmgren
7fdbb4dbb5
Username -> Handle (#303)
* schemas

* db

* atproto xrpc

* bsky xrpc

* got er done
2022-11-03 11:35:21 -05:00
Paul Frazee
9289ce15c6
Rename getHomeFeed to getTimeline to improve some semantic clarity (#300) 2022-11-02 16:52:25 -05:00
Paul Frazee
c986066e4c
Update XRPC procedures to use request body by default (#297)
* Update lexicons of xprc procedures to avoid using query params when possible

* Update code generated by lex-cli to reduce param counts

* Update all API usages to new signatures

* Fix readme

* Remove params from postNotifiactionsSeen lexicon schema
2022-11-02 16:37:58 -05:00
Daniel Holmgren
4229ac91a5
Remove badges (#291)
* rm schemas

* rm db

* wrapping up

Co-authored-by: Devin Ivy <devinivy@gmail.com>
2022-11-02 10:30:23 -05:00
devin ivy
55a07dd4d5
Fix app.bsky.post entity def to be more intuitive (#294) 2022-11-02 10:19:07 -05:00
devin ivy
a6c5737bb5
Session management in PDS client (#288)
* Move codegen api client into its own directory

* Implement session-aware client for pds

* Test pds session client, fixes

* Use pds lexicon rather than api types where possible

* Tidy
2022-11-02 09:55:51 -04:00
Daniel Holmgren
2fb128d94f
Account declaration & invites (#289)
* schemas

* database & buffing up schemas

* declaration on createAccount, + fixing up test client

* fix up dev-env

* schema comments

* nsid for declaration actorType

* declaration description

* oops token schema slipped in

* declaration -> declarationCid

* missed a couple of db things
2022-11-01 18:15:52 -05:00
devin ivy
51dd5665a1
Session refresh token for PDS (#286)
* Update lexicons for auth refresh token

* Implement pds refresh tokens

* Test pds auth sessions

* Fix dev-env

* Tidy

* Ignore invalid revoked and expired tokens during deleteSession
2022-10-31 20:41:51 -04:00
Paul Frazee
07a2bd117d
Improve codegen quality (shorter typenames) (#269)
* Improve lex-cli's generated code (specifically type names)

* Update to use the shorter typenames

Co-authored-by: Devin Ivy <devinivy@gmail.com>
2022-10-26 13:45:42 -05:00
Daniel Holmgren
29463093c1
Recovery key (#263)
* clean up old todos

* recovery key in server cfg & allow user provided key

* tests & rename

* testing did creation

* recoveryKey in dev-env

* require recovery key
2022-10-25 15:25:44 -05:00
Daniel Holmgren
a8368d148d
Linting (#262)
* move eslint ignore to eslintrc

* dont verify codgen stuff

* require node 18
2022-10-24 14:48:43 -05:00
Paul Frazee
feca3622c1
Rename ADX -> ATP (#244)
* Rename ADX to ATP

* Remove old docs (now in atproto website repo)

* Update readme

* Update README.md

Co-authored-by: devin ivy <devinivy@gmail.com>

* A couple of @ -> AT

Co-authored-by: devin ivy <devinivy@gmail.com>
2022-10-18 12:21:59 -05:00
Daniel Holmgren
fd18da2cb5
Schema keyed hint (#243)
* update schemas for keyed

* codegen dict

* codgen record ids

* determine key type from schema

* allow non-tid keys

* rm tids from batch write schema

* use schema ids record in db layouts

* standardize on rkey

* doc update

* crud test

* repo tests for custom rkeys
2022-10-18 11:14:47 -05:00
devin ivy
0820013316
Unify pagination interface across all methods (#242)
* Update lexicons for cursor convention, fix minor cid usage in interface

* Liked by cursor pagination, temp fix for other tests

* Home and author feed cursor pagination

* Paginate crud list w/ cursor, minor adjustments to lex and xrpc

* Paginate notifications view w/ cursor

* Paginate reposts view w/ cursor

* Paginate follow views w/ cursor

* Paginate user search view w/ cursor

* Fix notification tests

* Make repoListRecords order desc by default for consistency

* Paginate badge memebers view w/ cursor
2022-10-17 18:19:37 -04:00
Daniel Holmgren
3679719571
Badging utilities (#237)
* record type for accepted badge

* getBadgeMembers view

* updateProfile procedure

* better return type on updateProfile & gen client

* add badges to getProfile view

* testing & bug fixes

* tests for updating profile & linking badges

* errors

* badgeOffer record type

* getProfile view ensures badges are both offered & accepted

* getBadgeMembers test

* PR feedback

* cid check
2022-10-17 11:18:08 -05:00
devin ivy
e314974d1b
User search (#238)
* Add initial schemas for getUsersSearch and getUsersTypeahead

* Stub-out pds user search/typeahead, add pg indexes to support it

* Implement and test user typeahead method for postgres

* Implement user typeahead for sqlite

* Tidy

* Get user search view working, except pagination

* Get pagination working on pds user search w/ postgres

* Bail on jest snapshots for the conditional pg/sqlite search results

* Refactor user search queries out of user search method

* Apply user search helpers to typeahead

* Tidy user search implementation

* Test bad search input for sqlite

* Fix loading of pg_trgm extension to be friendly with the test suite

* Fix typo

* Query consistency

* All server tests can reference app

* Handle bad user search cursors
2022-10-14 16:16:32 -04:00
Paul Frazee
90b3792d90
Finalize lexicon reference behaviors, adding lex: URI references (#236)
* Update lexicon doc format to support .defs field and .descriptions within method bodies

* Add correct  resolution to lexicon, including to lex: URIs

* Update lexicons and generated code to use new  resolution
2022-10-13 14:08:09 -05:00
Daniel Holmgren
bfaf3a86f9
Handling updates (#231)
* disabled udpates

* remove update tests

* update schemas

* crud operations

* working cids into db layer

* crud working

* views tests working & updated snapshots

* rm tests for likes on reposts

* fix up repo tests

* quick pr feedback

* recordKey -> rkey & nameOrDid -> user

* reference records by uri & cid obj

* fix dev-env
2022-10-12 18:36:40 -05:00
Paul Frazee
90cdb99bdd
Update NSID semantics to final (#232)
* 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
2022-10-12 14:32:18 -05:00
devin ivy
59f18ac707
Forgot password methods (#216)
* Schemas and scaffolding for reset password methods

* Initial handler for todo.adx.requestAccountPasswordReset

* Initial handler for todo.adx.resetAccountPassword

* Implement server mailer

* Configure server for mailer and testing w/ mailer

* Test happy path of pass reset, fix reset bug

* Update lex to fix types bug for requestAccountPasswordReset

* Fix handlebars reference to config getters

* Test some negative password reset flows

* Minor cleanup to pass reset

* Tidy handlebars file with prettier, supporting double-quotes for html

* Fix esbuild of server for mailer templates, fix test issue

* Misc tidying for password reset

* Misc tidying for password reset
2022-10-06 14:24:26 -04:00
Daniel Holmgren
b3c60696da
Invite codes (#204)
* implement invite codes

* siwtch to admin basic auth & tests

* signular InviteCodeUse for table name

* comment

* pr fixups

* tx TODOs
2022-10-04 15:13:55 -05:00
Paul Frazee
11928993dc
Make the cursor field a required output in get*Feed (#206) 2022-10-04 12:28:49 -05:00
devin ivy
d64e4f6a75
Support firehose feed algorithm (#205)
* Split getFeed() into getAuthorFeed() and getHomeFeed()

* Remove unused getFeed codegen file

* Unify queries for getHomeFeed and getAuthorFeed

* Factor out common query parts for building feeds

* Test firehose and default feed algorithm

* Fix api tsconfig reference
2022-10-04 12:18:34 -05:00
Daniel Holmgren
8b0884a315
Notifications (#200)
* notification methods on tables

* process notifs

* last seen

* notifs xrpc methods

* seen notifs route

* register route

* notifications tests

* rm unused db method
2022-09-30 11:09:42 -05:00
Daniel Holmgren
ee68e6977b
Pds Did integration (#190)
* parsing dids to something we understand

* revamping did-sdk with did-resolver

* testing

* fixing some thigns & finishing tests

* fix type error & remove old test

* wip

* create did on server & add email

* check username available & store email

* better test utils

* remove did:test

* allow authstore to sign for controlled dids
2022-09-28 17:36:53 -05:00
Paul Frazee
6b47ad7622
Add better cursor pagination behavior to getFeed (#196) 2022-09-28 17:33:18 -05:00
Paul Frazee
a21417ba91
Improved XRPC error protocol (#194)
* Add lexicon doc

* Update error-handling spec

* Implement new error-behaviors in xrpc and xrpc-server packages

* Update lexicon and lex-cli packages to add xrpc error behaviors

* Generate new API and test an error behavior
2022-09-28 11:55:43 -05:00
Paul Frazee
31bd54e69c
More client integration updates (#192)
* Update dev-env to use new authorization system

* Add did and name to createSession response body

* Handle not found in getProfile api

* Stop putting a timestamp in the generated code, ffs

* Add todo.adx.getAccountsConfig

* Remove timestamps from schema codegen
2022-09-27 12:32:17 -05:00
Daniel Holmgren
1d136eba17
JWT auth (#187)
* setting up auth

* sticking auth on all the routes

* fixed up tests

* add util.getAuthstore fn

* rm fixed TODO

* use nodes native scrypt
2022-09-23 11:11:16 -05:00
Paul Frazee
3a4e4c0759
Dev env tooling, server package restructuring, add did:test and *.test rules (#186)
* Add ServerConfig class

* Update todo.adx.resolveName spec to make name param optional

* Add .test username and did:test behaviors

* Document name/did resolution and the .test/did:test behaviors

* Move did:test registry into server config to share across servers in the dev env

* Rework the server package structure to make it easier to include as a library

* Fix dev-env build issues

* Give better error when repo API is called on an invalid DID

* Add mock data environment to dev-env
2022-09-22 13:34:46 -05:00
Paul Frazee
f67626e5f2
Unify schemas under lexicon package (#183)
Unify schemas under lexicon package; remove schemas package; rename xrpc-cli to lex-cli
2022-09-20 18:08:30 -05:00