559 Commits

Author SHA1 Message Date
Paul Frazee
d2f1207b20
Publish @atproto/api@0.2.10 (#905)
@atproto/api@0.2.10
2023-04-26 15:46:46 -05:00
Paul Frazee
1656f6c5a8 Apply code formatting 2023-04-26 15:44:24 -05:00
Paul Frazee
23cf788216 Merge branch 'add-shortcuts-to-bskyagent' of https://github.com/thinkverse/atproto into thinkverse-add-shortcuts-to-bskyagent 2023-04-26 15:41:59 -05:00
devin ivy
eb7667e4fc
Add labels onto record embeds (#854)
* Add lexicons for labeling embeds

* Hydrate labels onto record embeds in pds

* Support labels on embeds in bsky appview
2023-04-25 17:19:40 -04:00
Kim Hallberg
8256df303f
Add getPosts shortcut 2023-04-25 00:29:13 +02:00
Kim Hallberg
3852b857d5
Add getSuggestions shortcut 2023-04-25 00:27:15 +02:00
Paul Frazee
02dcf7d891
@atproto/api@0.2.9 (#886) 2023-04-24 16:37:58 -05:00
Daniel Holmgren
553f59923c
Get posts method (#876)
* implement getPosts method

* tests

* bsky tests

* comment out test

* Handle stripping record-with-media viewer info in bsky tests

---------

Co-authored-by: Devin Ivy <devinivy@gmail.com>
2023-04-23 23:43:37 -05:00
Paul Frazee
5b4f506150
Bump @atproto/api@0.2.8 (#865) 2023-04-21 19:12:28 -05:00
Alice
a5016eba20
Fix README for api (#850)
=>
2023-04-20 12:57:46 -05:00
devin ivy
c70cb2b6e5
Notifications from the appview (#829)
* Update notif lexicons for stateless seenAt param

* In-progress work on appview notifs

* Fix-up bsky notification methods

* Add appview notification table table

* Process notifications in bsky appview, test notif indexing

* Test bsky appview notification methods

* Tidy bsky notification tests

* Explicitly don't support seenAt notif params on pds

* Tidy bsky notifs tests

* Sync bsky notif handling with pds

* Remove stale comment

* Switch bsky notifs tests to use testenv
2023-04-18 17:55:03 -04:00
Daniel Holmgren
6446e8d1d6
App passwords (#826)
* app password lex & auth chnages

* scrypt things

* implemented app password refresh tokens

* db tidy & migration

* revocation + bugfixin

* tests, listing passwords & cleanup

* Update packages/pds/src/db/scrypt.ts

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

* Update packages/pds/src/db/scrypt.ts

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

* pr feedback

---------

Co-authored-by: devin ivy <devinivy@gmail.com>
2023-04-18 13:47:04 -05:00
Daniel Holmgren
9e1bb49957
Create invite codes for many accounts (#825)
* create invite codes for many accounts

* test
2023-04-18 10:44:34 -05:00
S. Ota
2360ffea62
fix: typo. (#818) 2023-04-17 11:38:18 -07:00
Daniel Holmgren
d8b50c73e4
Add admin.updateAccountEamil (#812)
* -add admin capability to update account email

* pr feedback
2023-04-13 14:43:53 -05:00
Daniel Holmgren
aa46ad1e1c
Admin labeling (#801)
* adding to moderation flows

* some bugfixing in labels

* hardcode profile nsid

* make labels off moderation action

* db updates

* wip

* report labels in admin views & reverse moderation actions

* Test admin get record and repo w/ labels

* update db

* fix

* exclude negs from labels

* exclude neg on moderation views as well

* Check-in missing lex

* Check-in missing lex

* In-progress admin label tests

* Test label creation/reversal via actions

* Admin label test snapshots (#808)

* new snapshots for label on user

* fix get moderation action snap

* fix dev-env

---------

Co-authored-by: Devin Ivy <devinivy@gmail.com>
2023-04-12 22:53:32 -05:00
bnewbold
6592fcd6eb
Lex: additional report types (#788)
* lex: more report types

* lex: basic definitions of report reasonTypes

* package/api codegen: report types

* packages/pds codegen: report types

* packages/bsky codegen: report types; also roll-up many other changes
2023-04-12 22:32:57 -05:00
Paul Frazee
55e90ac865 @atproto/api@0.2.7 2023-04-12 20:16:42 -07:00
Devin Ivy
09d1df680e v0.2.6 2023-04-12 18:08:18 -07:00
Daniel Holmgren
521c1c1edb
Admin update handle (#803)
* admin route for updating accoutn handle on services domain

* tests

* Update lexicons/com/atproto/admin/updateAccountHandle.json

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

---------

Co-authored-by: devin ivy <devinivy@gmail.com>
2023-04-12 17:23:58 -05:00
Daniel Holmgren
8b1da9fed8
Labeling (#789)
* take notifs off of message queue

* fix order of notif handling

* table

* reintroducing message queue

* setting up user

* added labeler classes

* tidy + hook up labeler to config / service start

* hooking up p-queue to labeler

* rip out message queue

* drop mq tables

* rm stream consumers

* keyword labeler

* tidy + some tests

* work labels into views

* update snaps

* labeled images in dev-env

* snaps

* labeler tests

* more labels

* Update packages/pds/src/api/app/bsky/notification/listNotifications.ts

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

* Update packages/dev-env/src/mock/index.ts

* Update packages/dev-env/src/mock/index.ts

* Update packages/pds/src/labeler/util.ts

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

* Update packages/pds/tests/labeler/hive.test.ts

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

* pr feedback + migration change

* fix lower case keywords issue

---------

Co-authored-by: devin ivy <devinivy@gmail.com>
2023-04-12 14:34:18 -05:00
Daniel Holmgren
15762260fd
Sync/listRepos (#784)
* add getHostedRepos lex & route

* tests

* tidy

* rename
2023-04-11 17:16:13 -07:00
Daniel Holmgren
fc4a34caf2
Fully deprecate handle on createSession (#761)
* fully deprecate handle on createSession

* fix tests
2023-04-11 17:10:35 -07:00
Daniel Holmgren
8d0cbb4c86
Create bulk invite codes (#783)
add bulk create invite code route
2023-04-11 17:09:53 -07:00
bnewbold
aa20d20efb
More label lexicons (#672)
* com.atproto.label.label lexicon

For persisting un-signed label objects in repositories.

There will likely be a handful of XRPC query endpoints in the
com.atproto.label namespace in the near future.

* lexicons: com.atproto.label.subscribeLabels

* lexicons: com.atproto.label.query

* lexicons: label updates post lex-refactor

* lexicons: rename label.query to label.queryLabels

* lexicons: queryLabels larger batch sizes; improve description

* lexicons: add labels to profiles, posts, notifications

* lexicons: add negation ('neg') flag to labels

* lexicon: label vals on moderation actions

This is a mechanism to create (or negate) labels as part of a moderation
action. The fields are optional, so this is backwards compatible, and if
we wanted to embed entire labels in the future (instead of just "val"
strings), that would be possible using a different field name.

* lexicons: update label.label to label.defs#label

* codegen

---------

Co-authored-by: dholms <dtholmgren@gmail.com>
2023-04-11 12:44:19 -05:00
Paul Frazee
f818d1c55e
Bump @atproto/api@0.2.5 (#776)
@atproto/api@0.2.5
2023-04-07 10:08:20 -05:00
Paul Frazee
831b7dade9
api@0.2.4, pds@0.1.3 (#765)
* @atproto/api@0.2.4

* @atproto/pds@0.1.3
2023-04-05 18:12:14 -05:00
Daniel Holmgren
83828c52cd
User invite codes (#757)
* getUserInviteCodes lex

* small change

* implement user invite code creation/getting

* transactionally ensure we dont allow duplicate creates

* testing & fixes

* clean up & allow admin creation for a particular user

* fix dev-env

* user -> accnt & add admin disable codes route

* proposed admin inv schemas

* more admin routes for inv codes

* tests for invite admin views

* pr feedback

* refactor & return usedBy + more details on getAccountInviteCodes

* adding invite info into moderation views

* tests passing
2023-04-05 17:13:26 -04:00
Paul Frazee
47cb6402cd
Bump pds@0.1.2, api@0.2.3 (#762)
* @atproto/pds@0.1.2

* @atproto/api@0.2.3
2023-04-04 17:05:51 -05:00
Daniel Holmgren
ba527918e4
Paginate listRecords based on cursor (#751)
paginate listRecords based on cursor
2023-04-04 15:36:44 -05:00
Paul Frazee
25c23b6b61
Add email to createSession (#760)
Add email to createSession and update api to store email in the session object

Co-authored-by: Devin Ivy <devinivy@gmail.com>
2023-04-04 16:06:19 -04:00
Daniel Holmgren
eb488b96f5
lex refactor hot fixes (#745)
* filter embeds from get popular

* Truncate profile info to satisfy validation (#746)

* Remove trailing replacement character when utf8-truncating (#747)

* Truncate profile info to satisfy validation

* Fix utf8 truncation w/ replacement character

* filter replies

* delete embeds from records on getPopular

* Update profile display name and description lengths to be based on graphemes (#748)

* @atproto api v0.2.1

* Tidy

---------

Co-authored-by: devin ivy <devinivy@gmail.com>
2023-04-04 15:56:53 -04:00
Paul Frazee
1014938520
Pkg bumps after #756 (#759)
* @atproto/0.2.2

* @atproto/pds@0.1.1
2023-04-04 14:33:23 -05:00
Daniel Holmgren
095652b75b
Include email on server.getSession (#756)
* include email on getSession

* fix up tests & return email on createSession

* fix more tests

* cleanup
2023-04-04 13:49:38 -05:00
Paul Frazee
9bad971e21
Post lex refactor pkg publishes (#738)
* @atproto/common-web@0.1.0

* @atproto/identifier@0.1.0

* @atproto/crypto@0.1.1

* @atproto/common@0.2.0

* @atproto/repo@0.1.0

* @atproto/lexicon@0.1.0

* @atproto/xrpc@0.1.0

* @atproto/xrpc-server@0.1.0

* @atproto/lex-cli@0.1.0

* @atproto/pds@0.1.0

* @atproto/dev-env@0.1.0

* @atproto/api@0.2.0
2023-03-31 14:54:25 -05:00
Daniel Holmgren
7f008c05a0
Lexicon refactor (#658)
* remove return in test

* couple of fixups in other pacakges

* Add dummy checks to declaration and follow app migrations, remove paranoid join

* update db nsid migration

* Ensure there are writes in follow app migration

* Add dumy check to votes-to-likes app migration, tidy

* Ensure there are writes in vote-to-like app migration

* update migration name

* pr feedback

* count utf8 & grapheme length

* add maxUtf8

* siwtch max semantics

* plural

* update post schema

* added bytes & cid refs

* add ipld<>json

* fixin up a could tings

* Add app.bsky.richtext.facet, replace post entities with facets

* plural actors

* wip

* Setup backlinks table on pds

* wip

* send & recieve cids/bytes with xrpc

* Track backlinks when indexing records on pds

* handle ipld vals in xrpc server

* added cids & bytes to codegen

* In createRecord, add deletions to avoid duplicate likes/follows/reposts

* Tests and fixes for prevention of dupe follows, likes, reposts

* Backlink migration tidy

* cleanup dag json parser

* Fix dupe backlink inserts

* Tidy

* blob refs + codegen

* Make profile displayName optional

* Test view and updateProfile for empty display name

* working into pds

* Make aggregate counts optional on post and profile views

* Make viewer state optional on post view for consistency

* Remove deprecated myState field on profile view

* Tidy repo method descriptions

* tests & types & fixes

* Implementation and tests for putRecord

* Remove updateProfile method

* Update repo service so that head can be taken for update externally

* Lex updates for compare-and-swap records/commits

* Add error to lex for bad repo compare-and-swaps

* Improve update-at-head thru repo service

* common package

* Implement and test compare-and-swaps on repo write methods

* Use lex discriminator for applyWrites

* Remove post entity/facet index

* Update lex descriptions to clarify repo write semantics

* Make deleteRecord idempotent w/ tests

* cleanup

* fix things up

* adding more formats

* tests

* updating schema

* Only generate tid rkeys on pds, support literal rkeys on client

* Add backlink indexes

* Update format of post embed views, fix external uri validation

* fixing up tests

* Include embeds on record embeds

* cleanup

* Notify users when they are quoted

* Remove determineRkey indirection

* fix api tests

* support concatenated cbor

* integrating to server

* re-enable tests

* fix up tests

* Thread compare-and-swaps down into repo service rather than use pinned storage

* Tidy

* Update packages/common/tests/ipld-multi.test.ts

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

* Update packages/lexicon/src/validators/formats.ts

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

* pr feedback

* pr feedback

* Add postgres-specific migration path for missing profile display names

* Tidy/clarify deep embeds

* Tidy

* rm unused escape

* decrease crud race count

* update subscribeRepos lexicon

* Fix applyWrite lexicon re: collection fields

* sign post event type

* update cids & bytes json encoding

* update lex blob & cid-link types

* updated codegen & pds

* number -> float

* missed a couple

* remove old image constraints

* pr feedback + descripts

* no hardcoded port numbers

* remove separate tooLarge evt

* fix dumb build error

* fixin gup lex + xrpc server

* better parsing of message types

* dont mutate body in subscription

* bugfix in subscription

* rm commented out code

* init feature branch

* undo

* Remove old lexicons

* Remove creator from profile view

* wip

* rework seqs

* fixed up tests

* bug fixing

* sequence handles & notify in dbTxn

* tidy

* update lex to include times

* test syncing handle changes

* one more fix

* handle too big evts

* dont thread sequencer through everything

* Split common into server vs web-friendly versions

* Make lexicon, identifier web-safe using common-web

* Switch api package to be a browser build, fix identifier package for browser bundling

* Fix pds and repo for lexicon package changes, tidy

* Make common-web a browser build, tidy

* fixing up deps

* fix up test

* turn off caching in actions

* Standardize repo write interfaces around repo input

* Update repo write endpoints for repo input field

* Remove scene follows during app migration

* API package updates (#712)

* Add bsky agent and various sugars to the api package

* Add richtext library to api package

* Update richtext to use facets and deprecate entities

* Update richtext to use utf8 indices

* Richtext converts deprecated entity indices from utf16 locations to utf8 locations

* Add note about encodings in the lexicon

* Add RichText facet detection

* Remove dead code

* Add deprecation notices to lexicons

* Usability improvements to RichText

* Update the api package readme

* Add RichText#detectFacetsWithoutResolution

* Add upsertProfile to bsky-agent

* Update packages/pds/src/api/com/atproto/repo/applyWrites.ts

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

* pr feedback

* fix flaky timing streaming tests

* simplify emptyPromise

* fixed up open handles

* fix missed repo syntax

* fix error in test from fkey constraint

* fix another api agent bug

* Embed consistency, add complex record embed

* Tidy embed lex descriptions

* rename pg schemas

* use swc for jest

* fix up deps

* cleanup

* Update pds indexing, views, tests for complex record embeds

* fixing up profile view semantics

* wip

* update snaps

* Rename embed.complexRecord to embed.recordWithMedia

* Tidy aroud record w/ media embeds

* Add grapheme utilities to api RichText (#720)

Co-authored-by: dholms <dtholmgren@gmail.com>

* Fix: app.bsky.feed.getPostThread#... to app.bsky.feed.defs#... (#726)

* Update bskyagent to use repo param

* Minor typing fix

* Add exports to api package: blobref & lex/json converters (#727)

* Add exports to api package: BlobRef & lex/json converters

* Add an example react-native fetch handler

* Switch all lingering references of recordRef to strongRef

* Update lexicon for richtext facets to have multiple features, byte slice rather than text slice

* Implement multi-feature richtext facets on pds

* Update api package to use updated richtext facets

* Minor fixes to admin repo/record views

* Fix app migration exports, remove old app migration

* Fix: sort richtext facets so they can render correctly

* Disable app migration dummy checks that don't work on live deploy

* Optimize lex de/serialization using simple checks

* Tidy comment typos

* App migration to cleanup notifications for likes, follows, old scene notifs

* Fix notification reason for change from vote to like

---------

Co-authored-by: Devin Ivy <devinivy@gmail.com>
Co-authored-by: Paul Frazee <pfrazee@gmail.com>
2023-03-31 13:34:51 -04:00
Daniel Holmgren
9af530e837
Add unspecced getPopular route (#687)
* added unspecced getPopular route

* remove dupe

* super simple test

* pr feedback
2023-03-17 17:36:34 -04:00
Daniel Holmgren
197f40b891
List blobs method (#662)
* add list blobs method

* tests + small bugfix

* one more test
2023-03-15 11:15:01 -05:00
Daniel Holmgren
d8ec856865
Add hostname param to notifyOfUpdate (#638) 2023-03-14 11:17:22 -05:00
Daniel Holmgren
afa28c709f
Get blobs (#606)
* refactor repo routes

* basic blob route

* getBlob route

* tidy

* move getBlob to sync

* allow mimetype on getBlob

* creator on blob table

* migration

* migration

* handle deletes & check db on getBlob

* fix content type bug

* back to octet-stream

* Update packages/pds/src/api/com/atproto/sync/getBlob.ts

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

* fix up migrations

* pr feedback

* fixing up merge & migration

* patched up migration

---------

Co-authored-by: devin ivy <devinivy@gmail.com>
2023-03-13 19:11:47 -05:00
Akiomi Kamakura
1c7e641ff7
Fix README.md (#622) 2023-03-03 10:48:05 -05:00
Daniel Holmgren
07d941639f
Repo ops on sync stream (#614)
* repo op schema

* repo ops on sync stream

* delete old seqs

* nullable cids

* pr feedback
2023-03-02 12:18:49 -06:00
Paul Frazee
5e5d3df615
Bump @atproto/api@0.1.3, @atproto/pds@0.0.4 (#613)
* @atproto/api@0.1.3

* @atproto/pds@0.0.4
2023-03-01 17:04:38 -06:00
Daniel Holmgren
6ee3a8cfda
Crawler schemas (#602)
* sketch of crawl schemas

* codgen

* hostname param

* Update lexicons/com/atproto/sync/requestCrawl.json

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

* codegen

---------

Co-authored-by: devin ivy <devinivy@gmail.com>
2023-02-28 18:24:28 -06:00
Daniel Holmgren
bb05232720
Sync subscription tweaks (#599)
* tweaks to sync subscription

* fix test
2023-02-27 10:22:54 -06:00
devin ivy
ca87aeb93f
Post embeds (#553)
* Add lexicon for post embeds

* Model post embeds

* Handle and present post embeds

* Test and tidy post embeds

* Generalize post embeds to record embeds

* Tidy
2023-02-22 12:05:15 -05:00
devin ivy
3a6d785ae0
Fix PDS build, updating main to dist in api package (#566) 2023-02-18 16:15:19 -05:00
Daniel Holmgren
66f731ecee
Repo sync semantic changes (#563)
* switch to cursor & only one event type

* quick bugfix

* no dangling async stuff

* didnt rebuild lex-cli
2023-02-17 17:33:31 -05:00
Daniel Holmgren
20a35b31c1
Add com.atproto.sync.getBlocks XRPC method (#564)
* add sync getBlocks method

* oops didnt build lex-cli
2023-02-17 17:18:13 -05:00
devin ivy
9c119fb9c6
Allow unsetting profile images and description in updateProfile (#554)
* Add support for nullable on lex objects

* Support clearing fields in updateProfile lexicon

* Support clearing fields in updateProfile method
2023-02-16 14:32:25 -05:00