Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into dm-schemas
Browse files Browse the repository at this point in the history
* origin/main: (23 commits)
  Feed context & sendInteractions impl (#2402)
  Pass through topics headers (#2447)
  Version packages (#2446)
  ✨ Allow muting reporter (#2390)
  Version packages (#2443)
  Add `savedFeedsPrefV2` and new methods (#2427)
  fix(ozone): properly import "lande" ES module (from CJS) (#2441)
  Appview: remove replies to blocked posts from feeds (#2430)
  PDS: handle S3 upload timeout more gracefully (#2429)
  Appview: maintain language info when going out to a suggestions service (#2424)
  Appview: ensure hydration context tracks viewer did and not full service ref (#2423)
  ✨ Detect language from record content if lang property is not set (#2301)
  Version packages (#2422)
  Add email auth factor tools to API (#2419)
  Version packages (#2417)
  Lexicons: email auth factor (#2416)
  Suggestions skeleton impl (#2403)
  getSuggestionsSkeleton lexicon (#2399)
  Version packages (#2401)
  Appview: support new post search params, viewer context in search (#2409)
  ...
  • Loading branch information
estrattonbailey committed Apr 29, 2024
2 parents 6036e37 + e306304 commit 4449c35
Show file tree
Hide file tree
Showing 126 changed files with 4,086 additions and 156 deletions.
5 changes: 0 additions & 5 deletions .changeset/chilly-terms-add.md

This file was deleted.

33 changes: 33 additions & 0 deletions lexicons/app/bsky/actor/defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
"#adultContentPref",
"#contentLabelPref",
"#savedFeedsPref",
"#savedFeedsPrefV2",
"#personalDetailsPref",
"#feedViewPref",
"#threadViewPref",
Expand Down Expand Up @@ -154,6 +155,38 @@
}
}
},
"savedFeed": {
"type": "object",
"required": ["id", "type", "value", "pinned"],
"properties": {
"id": {
"type": "string"
},
"type": {
"type": "string",
"knownValues": ["feed", "list", "timeline"]
},
"value": {
"type": "string"
},
"pinned": {
"type": "boolean"
}
}
},
"savedFeedsPrefV2": {
"type": "object",
"required": ["items"],
"properties": {
"items": {
"type": "array",
"items": {
"type": "ref",
"ref": "app.bsky.actor.defs#savedFeed"
}
}
}
},
"savedFeedsPref": {
"type": "object",
"required": ["pinned", "saved"],
Expand Down
5 changes: 0 additions & 5 deletions lexicons/app/bsky/actor/searchActorsTypeahead.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
"type": "string",
"description": "Search query prefix; not a full query string."
},
"viewer": {
"type": "string",
"format": "did",
"description": "DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking."
},
"limit": {
"type": "integer",
"minimum": 1,
Expand Down
44 changes: 44 additions & 0 deletions lexicons/app/bsky/unspecced/getSuggestionsSkeleton.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"lexicon": 1,
"id": "app.bsky.unspecced.getSuggestionsSkeleton",
"defs": {
"main": {
"type": "query",
"description": "Get a skeleton of suggested actors. Intended to be called and then hydrated through app.bsky.actor.getSuggestions",
"parameters": {
"type": "params",
"properties": {
"viewer": {
"type": "string",
"format": "did",
"description": "DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking."
},
"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": "ref",
"ref": "app.bsky.unspecced.defs#skeletonSearchActor"
}
}
}
}
}
}
}
}
11 changes: 8 additions & 3 deletions lexicons/com/atproto/server/createSession.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"type": "string",
"description": "Handle or other identifier supported by the server for the authenticating user."
},
"password": { "type": "string" }
"password": { "type": "string" },
"authFactorToken": { "type": "string" }
}
}
},
Expand All @@ -31,11 +32,15 @@
"did": { "type": "string", "format": "did" },
"didDoc": { "type": "unknown" },
"email": { "type": "string" },
"emailConfirmed": { "type": "boolean" }
"emailConfirmed": { "type": "boolean" },
"emailAuthFactor": { "type": "boolean" }
}
}
},
"errors": [{ "name": "AccountTakedown" }]
"errors": [
{ "name": "AccountTakedown" },
{ "name": "AuthFactorTokenRequired" }
]
}
}
}
1 change: 1 addition & 0 deletions lexicons/com/atproto/server/getSession.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"did": { "type": "string", "format": "did" },
"email": { "type": "string" },
"emailConfirmed": { "type": "boolean" },
"emailAuthFactor": { "type": "boolean" },
"didDoc": { "type": "unknown" }
}
}
Expand Down
1 change: 1 addition & 0 deletions lexicons/com/atproto/server/updateEmail.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"required": ["email"],
"properties": {
"email": { "type": "string" },
"emailAuthFactor": { "type": "boolean" },
"token": {
"type": "string",
"description": "Requires a token from com.atproto.sever.requestEmailUpdate if the account's email has been confirmed."
Expand Down
36 changes: 36 additions & 0 deletions lexicons/tools/ozone/moderation/defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
"#modEventAcknowledge",
"#modEventEscalate",
"#modEventMute",
"#modEventUnmute",
"#modEventMuteReporter",
"#modEventUnmuteReporter",
"#modEventEmail",
"#modEventResolveAppeal",
"#modEventDivert"
Expand Down Expand Up @@ -67,6 +70,9 @@
"#modEventAcknowledge",
"#modEventEscalate",
"#modEventMute",
"#modEventUnmute",
"#modEventMuteReporter",
"#modEventUnmuteReporter",
"#modEventEmail",
"#modEventResolveAppeal",
"#modEventDivert"
Expand Down Expand Up @@ -128,6 +134,10 @@
"type": "string",
"format": "datetime"
},
"muteReportingUntil": {
"type": "string",
"format": "datetime"
},
"lastReviewedBy": {
"type": "string",
"format": "did"
Expand Down Expand Up @@ -242,6 +252,10 @@
"comment": {
"type": "string"
},
"isReporterMuted": {
"type": "boolean",
"description": "Set to true if the reporter was muted from reporting at the time of the event. These reports won't impact the reviewState of the subject."
},
"reportType": {
"type": "ref",
"ref": "com.atproto.moderation.defs#reasonType"
Expand Down Expand Up @@ -300,6 +314,28 @@
}
}
},
"modEventMuteReporter": {
"type": "object",
"description": "Mute incoming reports from an account",
"required": ["durationInHours"],
"properties": {
"comment": { "type": "string" },
"durationInHours": {
"type": "integer",
"description": "Indicates how long the account should remain muted."
}
}
},
"modEventUnmuteReporter": {
"type": "object",
"description": "Unmute incoming reports from an account",
"properties": {
"comment": {
"type": "string",
"description": "Describe reasoning behind the reversal."
}
}
},
"modEventEmail": {
"type": "object",
"description": "Keep a log of outgoing email to a user",
Expand Down
3 changes: 3 additions & 0 deletions lexicons/tools/ozone/moderation/emitEvent.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
"tools.ozone.moderation.defs#modEventLabel",
"tools.ozone.moderation.defs#modEventReport",
"tools.ozone.moderation.defs#modEventMute",
"tools.ozone.moderation.defs#modEventUnmute",
"tools.ozone.moderation.defs#modEventMuteReporter",
"tools.ozone.moderation.defs#modEventUnmuteReporter",
"tools.ozone.moderation.defs#modEventReverseTakedown",
"tools.ozone.moderation.defs#modEventUnmute",
"tools.ozone.moderation.defs#modEventEmail",
Expand Down
4 changes: 4 additions & 0 deletions lexicons/tools/ozone/moderation/queryStatuses.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
"type": "boolean",
"description": "By default, we don't include muted subjects in the results. Set this to true to include them."
},
"onlyMuted": {
"type": "boolean",
"description": "When set to true, only muted subjects and reporters will be returned."
},
"reviewState": {
"type": "string",
"description": "Specify when fetching subjects in a certain state"
Expand Down
34 changes: 34 additions & 0 deletions packages/api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
# @atproto/api

## 0.12.7

### Patch Changes

- [#2390](https://github.com/bluesky-social/atproto/pull/2390) [`58551bbe0`](https://github.com/bluesky-social/atproto/commit/58551bbe0595462c44fc3b6ab5b83e520f141933) Thanks [@foysalit](https://github.com/foysalit)! - Allow muting reports from accounts via `#modEventMuteReporter` event

## 0.12.6

### Patch Changes

- [#2427](https://github.com/bluesky-social/atproto/pull/2427) [`b9b7c5821`](https://github.com/bluesky-social/atproto/commit/b9b7c582199d57d2fe0af8af5c8c411ed34f5b9d) Thanks [@estrattonbailey](https://github.com/estrattonbailey)! - Introduces V2 of saved feeds preferences. V2 and v1 prefs are incompatible. v1
methods and preference objects are retained for backwards compatability, but are
considered deprecated. Developers should immediately migrate to v2 interfaces.

## 0.12.5

### Patch Changes

- [#2419](https://github.com/bluesky-social/atproto/pull/2419) [`3424a1770`](https://github.com/bluesky-social/atproto/commit/3424a17703891f5678ec76ef97e696afb3288b22) Thanks [@pfrazee](https://github.com/pfrazee)! - Add authFactorToken to session objects

## 0.12.4

### Patch Changes

- [#2416](https://github.com/bluesky-social/atproto/pull/2416) [`93a4a4df9`](https://github.com/bluesky-social/atproto/commit/93a4a4df9ce38f89a5d05e300d247b85fb007e05) Thanks [@devinivy](https://github.com/devinivy)! - Support for email auth factor lexicons

## 0.12.3

### Patch Changes

- [#2383](https://github.com/bluesky-social/atproto/pull/2383) [`0edef0ec0`](https://github.com/bluesky-social/atproto/commit/0edef0ec01403fd6097a4d2875b68313f2f1261f) Thanks [@dholms](https://github.com/dholms)! - Added feed generator interaction lexicons

- [#2409](https://github.com/bluesky-social/atproto/pull/2409) [`c6d758b8b`](https://github.com/bluesky-social/atproto/commit/c6d758b8b63f4ef50b2ab9afc62164e92a53e7f0) Thanks [@devinivy](https://github.com/devinivy)! - Support for upcoming post search params

## 0.12.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@atproto/api",
"version": "0.12.2",
"version": "0.12.7",
"license": "MIT",
"description": "Client library for atproto and Bluesky",
"keywords": [
Expand Down
4 changes: 4 additions & 0 deletions packages/api/src/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ export class AtpAgent {
did: res.data.did,
email: opts.email,
emailConfirmed: false,
emailAuthFactor: false,
}
this._updateApiEndpoint(res.data.didDoc)
return res
Expand All @@ -173,6 +174,7 @@ export class AtpAgent {
const res = await this.api.com.atproto.server.createSession({
identifier: opts.identifier,
password: opts.password,
authFactorToken: opts.authFactorToken,
})
this.session = {
accessJwt: res.data.accessJwt,
Expand All @@ -181,6 +183,7 @@ export class AtpAgent {
did: res.data.did,
email: res.data.email,
emailConfirmed: res.data.emailConfirmed,
emailAuthFactor: res.data.emailAuthFactor,
}
this._updateApiEndpoint(res.data.didDoc)
return res
Expand Down Expand Up @@ -215,6 +218,7 @@ export class AtpAgent {
this.session.email = res.data.email
this.session.handle = res.data.handle
this.session.emailConfirmed = res.data.emailConfirmed
this.session.emailAuthFactor = res.data.emailAuthFactor
this._updateApiEndpoint(res.data.didDoc)
this._persistSession?.('update', this.session)
return res
Expand Down
Loading

0 comments on commit 4449c35

Please sign in to comment.