@atproto/pds 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2758,6 +2758,9 @@ export declare const schemaDict: {
2758
2758
  emailConfirmed: {
2759
2759
  type: string;
2760
2760
  };
2761
+ didDoc: {
2762
+ type: string;
2763
+ };
2761
2764
  };
2762
2765
  };
2763
2766
  };
@@ -8,6 +8,7 @@ export interface OutputSchema {
8
8
  did: string;
9
9
  email?: string;
10
10
  emailConfirmed?: boolean;
11
+ didDoc?: {};
11
12
  [k: string]: unknown;
12
13
  }
13
14
  export declare type HandlerInput = undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atproto/pds",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "license": "MIT",
5
5
  "description": "Reference implementation of atproto Personal Data Server (PDS)",
6
6
  "keywords": [
@@ -43,7 +43,7 @@
43
43
  "typed-emitter": "^2.1.0",
44
44
  "uint8arrays": "3.0.0",
45
45
  "zod": "^3.21.4",
46
- "@atproto/api": "^0.6.22",
46
+ "@atproto/api": "^0.6.23",
47
47
  "@atproto/aws": "^0.1.4",
48
48
  "@atproto/common": "^0.3.3",
49
49
  "@atproto/crypto": "^0.2.3",
@@ -67,9 +67,9 @@
67
67
  "@types/sharp": "^0.31.0",
68
68
  "axios": "^0.27.2",
69
69
  "ws": "^8.12.0",
70
- "@atproto/api": "^0.6.22",
71
- "@atproto/bsky": "^0.0.13",
72
- "@atproto/dev-env": "^0.2.13",
70
+ "@atproto/api": "^0.6.23",
71
+ "@atproto/bsky": "^0.0.14",
72
+ "@atproto/dev-env": "^0.2.14",
73
73
  "@atproto/lex-cli": "^0.2.4"
74
74
  },
75
75
  "scripts": {
@@ -1,13 +1,17 @@
1
1
  import { InvalidRequestError } from '@atproto/xrpc-server'
2
2
  import AppContext from '../../../../context'
3
3
  import { Server } from '../../../../lexicon'
4
+ import { didDocForSession } from './util'
4
5
 
5
6
  export default function (server: Server, ctx: AppContext) {
6
7
  server.com.atproto.server.getSession({
7
8
  auth: ctx.authVerifier.access,
8
9
  handler: async ({ auth }) => {
9
10
  const did = auth.credentials.did
10
- const user = await ctx.services.account(ctx.db).getAccount(did)
11
+ const [user, didDoc] = await Promise.all([
12
+ ctx.services.account(ctx.db).getAccount(did),
13
+ didDocForSession(ctx, did),
14
+ ])
11
15
  if (!user) {
12
16
  throw new InvalidRequestError(
13
17
  `Could not find user info for account: ${did}`,
@@ -18,6 +22,7 @@ export default function (server: Server, ctx: AppContext) {
18
22
  body: {
19
23
  handle: user.handle,
20
24
  did: user.did,
25
+ didDoc,
21
26
  email: user.email,
22
27
  emailConfirmed: !!user.emailConfirmedAt,
23
28
  },
@@ -3007,6 +3007,9 @@ export const schemaDict = {
3007
3007
  emailConfirmed: {
3008
3008
  type: 'boolean',
3009
3009
  },
3010
+ didDoc: {
3011
+ type: 'unknown',
3012
+ },
3010
3013
  },
3011
3014
  },
3012
3015
  },
@@ -17,6 +17,7 @@ export interface OutputSchema {
17
17
  did: string
18
18
  email?: string
19
19
  emailConfirmed?: boolean
20
+ didDoc?: {}
20
21
  [k: string]: unknown
21
22
  }
22
23