979 Commits

Author SHA1 Message Date
Daniel Holmgren
57bec34cf5
Post media (#400)
* adding in banners & some lex codegen improvements for server

* fix up spacing

* couple small fixes

* client codegen & remove media embed schemas

* hook up banners

* missed a couple of lexicons

* sketching out embed schemas

* change wrapper obj property name

* setting up indexing for post media

* adding to views

* codegen client

* some tests

* Update lexicons/app/bsky/feed/getAuthorFeed.json

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

* Update lexicons/app/bsky/feed/getPostThread.json

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

* Update lexicons/app/bsky/feed/getTimeline.json

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

* exhaustive check

Co-authored-by: devin ivy <devinivy@gmail.com>
2022-12-13 13:17:53 -06:00
devin ivy
4bc9af4c37
Downgrade file-type dep version, fix build (#407)
Downgrade file-type dep since it is now ESM-only
2022-12-12 15:53:05 -05:00
devin ivy
789fbb27c4
Fix size/url for profile banner (#406) 2022-12-12 14:55:27 -05:00
Paul Frazee
3636bd19a8
A couple lexicon-related fixes (#405)
* Fix the generated type for encoding when the value is */* (close #391)

* Add 'toKnownError' test and fix named error for updateProfile

* Improve blob errors
2022-12-12 13:48:59 -06:00
devin ivy
2ab2dbf75a
Streaming: decouple consumers from the message queue (#403)
* Begin to decouple message queue consumers from the queue itself

* Tidy

* Get rid of callback variant of Listener
2022-12-12 14:32:06 -05:00
devin ivy
f3eac9b2e8
Support compression in requests to xrpc-server (#396)
* Support compression in requests to xrpc-server

* Check payload streaming payload sizes in xrpc-server

* Tidy tests

* Move MaxSizeChecker into common stream utils
2022-12-12 12:52:14 -05:00
Daniel Holmgren
a125f4e36d
Banners (#397)
* adding in banners & some lex codegen improvements for server

* fix up spacing

* couple small fixes

* client codegen & remove media embed schemas

* hook up banners

* missed a couple of lexicons
2022-12-12 10:18:50 -06:00
Daniel Holmgren
91215f4f67
Verify content type of files (#395)
check content type of files
2022-12-08 17:00:11 -06:00
Daniel Holmgren
c74262299b
Rename upload blob NSID (#393)
* rename blob route

* Tweak to codegen after rebase

Co-authored-by: Paul Frazee <pfrazee@gmail.com>
2022-12-08 13:30:10 -06:00
Daniel Holmgren
2a4a1ec4d1
Various blob fixes (#394)
* fix byte streaming from mem blobstore

* Enlarge avatar maxSize to 300kb

* Skip the cache on empty files

Co-authored-by: Paul Frazee <pfrazee@gmail.com>
2022-12-08 13:26:05 -06:00
Paul Frazee
79c3f31f9e
Add 'avatar' to the outputs of views (#392)
* Add sharp to the dev-env deps

* Add 'avatar' to the outputs of views
2022-12-08 11:40:19 -06:00
devin ivy
bab3b1f783
Fix issue with duped blobs (#390) 2022-12-08 11:53:58 -05:00
Daniel Holmgren
d0b7497a08
File uploads & profile image support (#383)
* Setup interface for image processing

* Implement getInfo() on SharpImageProcessor

* Reorganize pds image processing code

* Implement initial resize() on SharpImageProcessor

* Test sharp image processor, apply a couple fixes

* Tidy

* wip

* improve repo processing & add blbos

* more blob processing

* work into routes & config

* testing out w profiles

* Implement initial pds image uri builder/signer/verifier

* pr fixup & tests

* streaming

* better streaming interface

* s3 interface

* fix s3 prefixes

* readable streams as xrpc inputs

* more tests + cleaning up apis

* tests for failed references

* Initial implementation of image processing server

* Update node types for node v18

* fix clone issue

* add getStream to blobstore

* fixing up tests & dev-env

* get img info on upload

* integrating img processing

* hex for img uri & fixing build errors

* improve streams

* hook up uris to getProfile

* pr feedback on tmp

* test on getprofile

* testing avatars

* fix snapshot after hmac changed

* quick cleanup

Co-authored-by: Devin Ivy <devinivy@gmail.com>
2022-12-07 18:08:29 -06:00
devin ivy
d19fbe5473
Image processing interface (#378)
* Setup interface for image processing

* Implement getInfo() on SharpImageProcessor

* Reorganize pds image processing code

* Implement initial resize() on SharpImageProcessor

* Test sharp image processor, apply a couple fixes

* Tidy

* Implement initial pds image uri builder/signer/verifier

* Initial implementation of image processing server

* Update node types for node v18

* Add disk caching to pds image service

* Test pds image process caching, tidy

* Move pds image processor away from an interface

* Add sharp to pds build externals

* Move away from xrpc-server errors to http-errors for pds image server

* Tidy pds image exports

* Tidy
2022-12-07 09:44:34 -06:00
Paul Frazee
d7b4697b2d
Add terms-of-service and privacy-policy links (#386)
* Add privacy-policy and terms-of-service to getAccountsConfig

* Add privacy policy and tos urls to dev environment
2022-12-06 13:05:05 -06:00
devin ivy
aea590ef37
Auth in XRPC server (#384)
* Add auth to xrpc-server, refactor to use per-route middleware stack

* Add xrpc-server error middleware, tidy

* Tests in xrpc for for catchall errors and auth

* Tidy

* Update lex-cli for new xrpc-server auth interface

* Update pds lexicon w/ codegen for xrpc auth

* Use xrpc-server auth in pds

* Update tests for newly-required auth
2022-12-05 23:46:21 -05:00
Paul Frazee
c966185f01
Lexicon tweaks: encoding and union $type discriminators (#382)
* Update LexXrpcBody encoding to always be a single string with comma-separated values

* Update lexicon union-type to use  as a discriminator, and add closed flag to establish if new union members may be added

* Fix to generated code for open unions
2022-12-05 09:38:51 -06:00
Paul Frazee
dd180f3dd1
Refactor lexicon definitions to reuse more shared types (#381)
* Factor out app.bsky.system.declRef

* Factor out app.bsky.actor.ref and app.bsky.feed.embed

* Factor out com.atproto.repo.strongRef and use app.bsky.actor.ref in more places

* Modify app.bsky.actor.ref to be light reference, add #withInfo for indexed info
2022-12-02 09:25:03 -06:00
Paul Frazee
f2aa6ddbea
Rework lexicon references to use a more consistent structure (#380) 2022-12-01 16:09:41 -06:00
Paul Frazee
63b9873bb1
Lexicon rework (#379)
* 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>
2022-12-01 12:26:18 -06:00
devin ivy
645a2ca5f7
Enforce max payload size for PLC and PDS (#376)
* Sketching out max payload size in xrpc-server

* Fixes and testing for external payload parsing

* Apply max json payload limit to pds and plc

* Move parsing middleware into xrpc-server w/ options
2022-11-29 13:02:03 -05:00
Paul Frazee
47c69f5469
Update getPostThread to handle missing parents (#373) 2022-11-28 21:35:40 -06:00
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
9d29ef96f6
Well-defined pagination in PDS (#365)
* Implement tuple keyset cursor to break pagination ties, apply to feeds and assertions

* Tuple keyset cursor on rest of views

* Tidy keysets for postgres

* Add default implementation to Keyset to remove some boilerplate

* Simplify Keyset interface

* Remove dead code

* Move to new Keyset interface, incl. TimeCidKeyset

* Make pds assertion view tests deterministic

* Apply pds keyset interface to user search
2022-11-28 11:51:27 -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
Daniel Holmgren
6fd50bd46c
Wait for servers to close at end of test suite (#362)
wait for servers to close
2022-11-18 15:47:03 -06:00
Daniel Holmgren
0f2562419b
Return post ancestors (#361)
* recursively get post ancestors

* tests
2022-11-17 17:06:44 -06:00
Daniel Holmgren
40458a6249
Fix unclear indexedAt in processor (#360)
fix unclear indexedAt in processor
2022-11-17 15:36:05 -06:00
Daniel Holmgren
dafeeee4af
MessageQueue fix (#358)
* keep message queue from getting behind

* better error hadnling that doesnt crash sanity loop

* 3 -> 1 min

* timeout + destory on mq

* destory mq on db close
2022-11-17 15:34:18 -06:00
Daniel Holmgren
53d8209c9c
Don't give notifications for mentions & replies to self (#359)
Dont give notifciations for metnions & replies to self
2022-11-17 15:22:14 -06:00
Daniel Holmgren
227b85608e
Deduping indexing (#354)
* record processor

* moving records to new processor

* plugins finished

* hook up to db

* migration

* yay tests working

* Tx migration (#355)

* migrations in txs

* fix tx issue

* testing

* test deduping

* test assertions

* rm types on migrations

* dont do migrations in txs, fixes pg issue
2022-11-17 14:10:37 -06:00
devin ivy
4fa2110553
Use public hostname in invite codes (#353) 2022-11-17 12:03:17 -05:00
Daniel Holmgren
c207947bd5
Stagable blockstore (#351)
* stagable blockstore + remove mutable repo

* pds wip

* nearly there

* bugfix

* assertion ordering

* del old code

* save staged if no callback

* removing level

* pr fixup
2022-11-17 09:51:36 -06: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
Paul Frazee
e02671ba82
Give 'HandleNotAvailable' error on reserved handles (#349) 2022-11-14 15:32:04 -06:00
Daniel Holmgren
43788cdc5a
Show own reposts in timeline views (#348)
show own reposts in timelines
2022-11-14 13:42:12 -06:00
Paul Frazee
60071e0770
Handle updateProfile when no record exists (#343)
* WIP handle updateProfile when no record exists

* create new profile in updateProfile

Co-authored-by: dholms <dtholmgren@gmail.com>
2022-11-11 14:10:56 -06:00
devin ivy
5b4e2b9ee3
Fix test snapshots post-merge (#342) 2022-11-11 14:59:29 -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
Daniel Holmgren
962041e6c1
Scene trending (#327)
* wip

* views

* trending schema

* starting message queue

* scene processor

* wip

* send mq messages from db

* db events

* undo screwing up codegen lol

* setup queue

* db migrations

* fixing up message processing

* div by 0 check

* tx issue

* queue use cursor

* update not insert

* sql bugfix + tests

* trying to linearize tests

* correclty serializing txs

* attempt update before insert

* log errors

* handle gaps in cursor

* cleanup

* oops reenable test

* correctly incr cursor
2022-11-11 12:29:48 -06:00
Paul Frazee
8e548af023
Add missing execute() to confirmation delete (#339) 2022-11-10 16:51:26 -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
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
8b689de071
Reenable account tests + quick fix (#326)
reenable + quick fix
2022-11-08 16:12:11 -06:00