559 Commits

Author SHA1 Message Date
Eric Bailey
a7c42cfe39
Clean up prettier/eslint scripts (#1514)
* add prettierignore, hoist script

* upgrade prettier

* bump prettier eslint deps

* format all files

* hoist prettier check

* remove unused scripts, hoist lint:fix

* remove npm-run-all, unused

* hoist lint

* remove lint scripts

* improve lint scripts

* remove prettierignores

* downgrade prettier deps to fix codgen

* reformat all files

* update makefile, format

* fix locklife

* final format

---------

Co-authored-by: dholms <dtholmgren@gmail.com>
2023-09-06 19:27:50 -05:00
David Buchanan
90b0a9d809
RFC: Support image aspect ratio metadata (#1306)
* Add aspectRatio field to embed image lexicon

* lexicon codegen

* pass aspectRatio through to imagesEmbed views

* simplify aspectRatio logic, port to bsky package

* re-run lexicon codegen
2023-09-06 10:08:06 -05:00
Eric Bailey
90e8325e5f
pnpm setup (#1532)
* use pnpm

* fix dependency issues, replace yarn and lerna scripts

* remove the main/dist scripts

* update Dockerfiles

* use pnpm

* fix dependency issues, replace yarn and lerna scripts

* remove the main/dist scripts

* update Dockerfiles

* update bin script

* remove unused zod dep

* fix type errors in pds

* add types prop to packages

* remove unused, bump lock

* fix test running

* build before test

* fix pino types

* format

* pds depends on dev-env in test

* refer to src instead of built packages

* pds relies on bsky in test too

* remove yarn.lock

* add -r flag to root test

* test push to aws

* remove docker test

* add publishConfig to new package

* move services to top level dir

(cherry picked from commit f5012bec33435a4473e9960066807623334f3aff)

* update workflow paths

(cherry picked from commit 5c70f0176d381ca35d6be10cfa173e22373a5b5d)

* add main-to-dist script

* use script in all packages, remove old Dockerfiles

* remove old bsky service

* remove newline

* test container builds

* Revert "test container builds"

This reverts commit c228611f5e8e1624d4b124be4976c49590130f43.

* remove unused config

* test build containers

* pnpm in syntax

* bump dd-trace

* shamefully hoist

* even more shame

* hoist, externalize deps

* clean install for prod and smaller containers

* dont build branches

---------

Co-authored-by: dholms <dtholmgren@gmail.com>
2023-09-05 18:45:49 -05:00
Foysal Ahamed
4fb32e1e06
Add missing labels that are available on the moderation tool (#1515)
* Add missing labels that are available on the moderation tool

* Remove unused label

* More cleanup

* 🧹 Get rid of ncii as well

*  Add new label in json instead of generated file 🤦🏽‍♂️
2023-09-05 10:49:55 -04:00
Eric Bailey
16662b220d
@atproto/api@0.6.9 (#1546)
* @atproto/api@0.6.9

* @atproto/api@0.6.10
2023-09-01 10:43:30 -05:00
Eric Bailey
f84027fe8e
add getFeedSuggestions (#1542)
* add getFeedSuggestions lex

* move to feed namespace

* codegen

* add table and migration

* add endpoints

* remove comment

* add test

* fix order

* rename

* just remove proxy check
2023-08-31 17:19:34 -05:00
Paul Frazee
6d765f7f61 @atproto/api@0.6.8 2023-08-29 17:13:35 -07:00
Paul Frazee
8db9077c68 @atproto/api@0.6.7 2023-08-29 17:10:13 -07:00
Paul Frazee
2b8cbcee1f
Add preferences helpers to SDK (#1537) 2023-08-29 17:09:46 -07:00
Daniel Holmgren
ad1fcf1387
Repo history rewrite (#1479)
* logical changes in repo

* tests

* tweak commit data

* building pds

* patching up some tests

* tidy + more tests

* patch up bsky

* clean up db

* db migration

* small patches

* fix up another test

* reinclude prevs

* api & lex updates

* add back in deprecated routes

* backward compatibility for commit v2

* add upgrade repo version root

* move namespace

* migration test

* patch up a few more tests

* remove deprecated rebase routes

* tweak api

* sprinkle rev around a few more places

* getCurrent -> getLatestCommit

* fix test

* pr feedback & tidy

* fix up block pagination

* tidy again

* add in a tets

* add cursor to listBlobs

* getRepo rev -> since

* clean up proofs test

* dont change getHead

* tweak migrate route

* build branch

* hit index in block range query

* check for dupe record refs

* tidy

* set prev to null

* dont build branch
2023-08-29 19:07:21 -05:00
bnewbold
bd3966555f
@atproto/syntax: merge of @atproto/identifier, uri, and nsid (#1464)
* move nsid package in to identifier

* move uri package in to identifier

* update packages to pull from identifier, not nsid or uri

* rename @atproto/identifier to @atproto/syntax

* update all refs from @atproto/identifer to @atproto/syntax
2023-08-25 10:18:10 -05:00
Paul Frazee
1dd0c46593 @atproto/api@0.6.6 2023-08-23 16:18:04 -07:00
Ansh
eae682f3bf
Native Notifications (#1428)
* pseudocode for sending notification to user

* add notification push token table

* lexicon codegen

* `pds` and `api` codegen

* update lexicon

* add simple function to `putNotificationPushToken` into `notification_push_token` table

* reorgnaize imports

* add unspecced `putNotificationPushToken` to pds

* add `notification-push-tokens` table to PDS

* check if token exists before adding it to db

* add endpoint and appId to PDS table

* setup notification server

* fix logic for inserting token into db

* fix NotificationServer methods by making them static

* fix merge conflicts

* add comments on how sending ntoifications work

* remove dead code

* move notifServer to AppContext

* refactor code to handle notif sending in `Indexer` service

* add additional data when sending notifs

* clean up code

* move notif logic to indexer

* add `appId` and `endpoint` optional params to putNotificationPushToken

* clone notification code to AppView

* add endpoint to register push token with app view

* disable pds and enable app view notification server

* clean up code

* simply logic to check if a token already exists

* remove NotificationServer from PDS

* remove notification-push-token table from PDS

* remove `putNotificationPushToken` endpoint

* clean up code

* let `axios` throw error if `gorush` has an error

* let `kysely` throw error if notif cannot be registered by client

* rename `registerPushNotificationEndpoint` to `registerPushNotifications`

* delete `putNotificationPushToken` from AppView

* rename putPushNotificationToken to registerPushNotification

* remove dead notification code from pds

* remove sanitizeDisplayName from NotificationSever

* move `pushNotificationEndpoint` to config

* temp add `pushNotificationEndpoint` to dev-env setup

* remove example test from feed-generation.test.ts

* add test for registerPushNotification and clean up error handling

* move notifications test to its own file

* add test for NotificationServer to check if tokens are retrieved correctly

* remove unused functions from NotificationServer

* add additional tests for NotificationServer

* add return type to getNotificationDisplayAttributes function

* remove unnecessary comments

* remove dead NotificationServer code from PDS

* clean up code to prepareNotifsToSend

* put sending notifications as part of the backgroundQueue

* log instead of throwing error if notification attributes don't exist

* remove logs

* add more tests to `notification-server.test.ts`

* show replied with text for reply notifs

* better error handling when sending notifications via backgroundQueue

* add rate limit and batching to sending notifications

* add comments to NotificationServer

* merge with main

* use redis for rate limiting instead of normal rate limits

* move `notificationBatchSize` into config

* usePrimary db in test

* hoist push notif migration to present, update model to remove endpoint

* update push notif lexicon

* pare down lex for unregistering push

* helpers for working with service endpoints from did doc

* service-authed register/unregister push notifs

* add well-known endpoint to appview

* update bsky notif service tests

* fix to batching logic, misc tidy

* batch display notifications

* colocate all notification sending logic

* tidy tests

* remove unregister token for now

* fix registerPush lexicon, make a procedure

* fix registerPush impl, test pds proxy to notif service

* fix tests, make notif server optional when not configured

* fix notif server config for bsky app service

* move notif server rate limiting in-mem for now, add sending retry

* codegen tidy

* only push notifs on commit

* build

* fix notif rate limiter check

* send notifs from users w/o a profile

* remove build

---------

Co-authored-by: dholms <dtholmgren@gmail.com>
Co-authored-by: Devin Ivy <devinivy@gmail.com>
2023-08-23 18:37:14 -04:00
Paul Frazee
7e4edb2ce1 @atproto/api@0.6.5 2023-08-22 12:13:26 -07:00
Eric Bailey
98cc8c5214 codegen 2023-08-22 11:16:56 -05:00
Eric Bailey
048cd16d0c Merge remote-tracking branch 'origin' into eric/app-796-likes-tab
* origin: (21 commits)
  styleguide
  Increase CI test matrix size (#1490)
  tweak author-feed rejects test syntax
  update test
  format
  add repost of reply, update snaps
  simplify query
  fix typos
  include reposted replies in posts_no_replies filter
  fix bad test syntax
  fix actor takedown tests
  use getActor, failing atm
  only include media posts by post creator
  Fix condition for viewing soft-deleted followers (#1485)
   Expose takendown profile, their follows and followers to mods (#1456)
  Handle revalidation (#1474)
  Handle db pool errors on appview (#1483)
  Handle db client errors on appview (#1481)
  v0.6.4
   Allow creating moderation action with a duration (#1431)
  ...
2023-08-18 11:10:04 -05:00
Devin Ivy
ea9d96e3a4 v0.6.4 2023-08-15 17:12:30 -04:00
Foysal Ahamed
7bc701e2e1
Allow creating moderation action with a duration (#1431)
*  Add action duration to action model

*  Add periodic moderation action reversal

*  Use actionDurationInHours and remove takedownExpiresAt

*  Destroy mod action reversal job

*  Add test for automatic moderation action reversal

* 🧹 Port over actionDuration to bsky package

* ♻️ Better naming for action duration and minor fixes

* ♻️ Optionally build expiresAt based on createdAt when logging action

* ♻️ Adjust constructor params

*  Copy over migration from pds to bsky package

* 🚨 Fix indentation

*  Propagate action reversal from app-view to pds

*  Revert locally only if pushAgent is not found

* build

* merge dbcoordinator work into periodic mod actions

* fix entrypoint for periodic mod reversals

* do not run periodic reversals on sequencer leader

* fix duration in action detail on bsky

* update env for pushing mod reversals

* allow zero-duration actions for testing

* remove build

---------

Co-authored-by: Devin Ivy <devinivy@gmail.com>
2023-08-15 15:44:53 -04:00
Eric Bailey
23d6feb3c9 add method to bsky agent 2023-08-15 13:58:40 -05:00
Eric Bailey
b05986f7d1 codegen 2023-08-14 15:39:48 -05:00
Paul Frazee
9a824aeae6 @atproto/api@0.6.3 2023-08-10 15:37:50 -07:00
Daniel Holmgren
244bf46e74
Include limited info on blocked embeds (#1463)
* add block info to embeds

* fix codegen

* Correctly handle blocked embeds and add block-other cause

* update snaps

* Correctly identify blocking behavior in embeds

---------

Co-authored-by: Paul Frazee <pfrazee@gmail.com>
2023-08-10 15:54:24 -05:00
Paul Frazee
29a1ee791a @atproto/api@0.6.2 2023-08-10 12:53:35 -07:00
Daniel Holmgren
ba979b4cdb
Include limited viewer info on blocked post (#1457)
* include limited viewer info on block

* blockedAuthor schema

* make author required

* merge & update codegen

* patch up tests
2023-08-10 14:31:45 -05:00
Daniel Holmgren
3f0e1b2563
Read after write (#1398)
* first pass on profiles

* quick test

* wip

* wip

* test post thread

* record embeds

* get author feed profiles

* wip timeline

* fix get timeline

* switch from counter to tid

* tidy into a service

* quick tid test

* pr feedback

* clock -> rev

* update image formatting

* disable migration & build branch

* add recent posts to getAuthorFeed & handle post thread not found errors

* refactor for lag header

* tidy

* rm collections check

* tidy test

* pr feedback

* fix small bug

* build branch

* get migrations into system

* enable migrations
2023-08-10 13:42:31 -05:00
Paul Frazee
b406a45829 @atproto/api@0.6.0 2023-08-09 16:08:05 -07:00
Paul Frazee
ab50816461
Self-labeling (#1444)
* Add self-label schemas

* switch around array and union for self-labels

* apply self-labels to post and profile views

* test for self labels in pds

* apply self-labels to post and profile views in bsky appview

* test for self labels in bsky appview

* update pds proxied test snapshots

* Add support for self-labels to the mdoeration sdk

* Disable unknown-labeler filtering until 3P support is added

---------

Co-authored-by: Devin Ivy <devinivy@gmail.com>
2023-08-09 19:06:29 -04:00
Eric Bailey
ef23263297
Merge pull request #1439 from bluesky-social/eric/app-787-media-tab
add filter param to getAuthorFeed
2023-08-09 15:38:09 -05:00
Paul Frazee
0f2c006641 @atproto/api@0.5.4 2023-08-08 16:22:54 -07:00
Paul Frazee
6dbf4c67bc @atproto/api@0.5.3 2023-08-08 16:18:38 -07:00
Paul Frazee
f9cce06c23
Tune moderation downgrading on self-content to carry over blurring behaviors in some cases (#1453)
* Tune moderation downgrading on self-content to carry over blurring behaviors in some cases

* Fixes
2023-08-08 16:18:03 -07:00
Eric Bailey
55f33234e2 fix naming 2023-08-08 16:40:55 -05:00
Eric Bailey
92f5979d44 update naming based on feedback 2023-08-08 15:41:48 -05:00
Eric Bailey
5083705a37 use more specific naming 2023-08-08 12:20:08 -05:00
Eric Bailey
59c435648d codegen again 2023-08-08 12:02:34 -05:00
Eric Bailey
7f84fb215e codegen 2023-08-08 12:02:34 -05:00
Paul Frazee
43bb6ae147 @atproto/api@0.5.2 2023-08-03 21:54:38 -07:00
Paul Frazee
82ada3d27a
Moderation API fixes - QP blurs & label names (#1435)
* Fix: blur quote posts with the blur-media label type

* Switch to label titles that are less stilted
2023-08-03 21:54:06 -07:00
dholms
ce5a43067d v0.5.1 2023-08-03 12:56:30 -05:00
Paul Frazee
749db2e425 @atproto/api@0.5.0 2023-08-03 10:29:54 -07:00
Paul Frazee
b30f847d09
Labeling & moderation updates to SDK (#1366)
* First pass on label definitions and reference-doc generation for them

* Tune labels

* Drop the 'csam' label in favor of using !hide

CSAM is an extremely delicate issue. Moderators must be careful to
remove it from the system without calling direct attention to it.
Using the generic !hide achieves the same effect while obscuring
the reason for the removal. Server and AppView bans will then be
employed (along with any other needed mechanisms) to strip the
content from the network.

There is also a 'false accusation' concern with using the csam
label. Fingerprinting techniques and AI are used to scan for csam.
These are capable of producing false positives which will then be
reverted after human review. The reputational damage caused by a
false positive could be severe, so we want to be careful about any
system which might publicize a false positive.

* Add label definition code generation

* Implement all type signatures for moderation

* Complete a first pass on the labeling sdk

* Add post-moderation test suite

* Add post moderation behavior documentation

* Add self-post behaviors

* Improve post moderation doc

* Tune up the post moderation doc

* Tune up the post moderation doc

* Tune up the post moderation doc

* Simplify the post moderation behavior descriptions

* More behavior description tuneup

* Add profile moderation final behaviors and tests

* Improve generated post-moderation-behaviors doc

* Add profile moderation behaviors doc

* Test muted-by-list specifically

* Fixes to label descriptions

* Fix to muted-by-list behavior

* Dont blur account in moderateProfile() when muting

* Tune label copy

* Apply post embed blurring when account is marked with blurmedia label

* Fix output signature

* Fixes to blocking behavior

* Rename LabelDefinitionPreference to LabelPreference

* Update docs

* Fix test

* Fix: self-harm should blur media only

* Fixes to tests

* Improve label copy

* Remove all labels that do not have a specific policy

Communicating moderation policies with active users is important.
This PR originally included labels which were proposed but did not
yet have policies. While we didn't intend to use them until a
policy was established, I decided it's better to hold off putting
them in the code until we're sure about them. They can be found in
backup files prefixed with "proposed-".
2023-08-03 10:28:06 -07:00
devin ivy
e5e24d510e
Push labels to PDS (#1423)
* add lexicon for unspecced applyLabels procedure

* implement label push to pds via unspecced.applyLabels

* add hive retry to bsky appview

* build

* update applyLabels to work with raw label data

* update bsky hive labeler

* remove build
2023-08-03 12:25:56 -04:00
dholms
2cbc4c31a5 v0.4.4 2023-08-01 17:57:14 -05:00
Foysal Ahamed
13b16b33f2
Allow setting a note when enabling/disabling invite codes (#1363)
* Allow setting a note when enabling/disabling invite codes

* Add inviteNote to repoView

*  Add test for inviteNote

*  Set to null when note is empty

*  Change note from text to varchar

* 📝 Better description
2023-08-01 17:43:21 -05:00
dholms
354e05225b v0.4.3 2023-07-20 12:35:42 -05:00
Eric Bailey
b2ef3865bc
Merge pull request #1365 from bluesky-social/eric/search-getPopularFeedGenerators
add optional `ILIKE` query to `getPopularFeedGenerators`
2023-07-20 11:00:51 -05:00
Eric Bailey
64137c7e5c add optional ilike query to getPopularFeedGenerators 2023-07-19 17:25:49 -05:00
Devin Ivy
754ad7f4f9 v0.4.2 2023-07-17 19:10:42 -04:00
Foysal Ahamed
775944e84a
Added new procedure for sending admin email (#1312)
* 🚧 Added new lexicon for sending admin email

*  Add moderation mailer

*  Switch to text email content from html

* 🧹 Cleanup some early implementation code and reflect PR reivew

*  Use smtp host instead of gmail service config

*  Move to using single smtp url
2023-07-17 19:06:44 -04:00
Devin Ivy
670daf5edd v0.4.1 2023-07-15 10:32:45 -07:00