@atproto/bsky 0.0.45 → 0.0.47

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.
Files changed (44) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/api/app/bsky/actor/getSuggestions.d.ts.map +1 -1
  3. package/dist/api/app/bsky/actor/getSuggestions.js +26 -13
  4. package/dist/api/app/bsky/actor/getSuggestions.js.map +1 -1
  5. package/dist/config.d.ts +4 -0
  6. package/dist/config.d.ts.map +1 -1
  7. package/dist/config.js +10 -0
  8. package/dist/config.js.map +1 -1
  9. package/dist/context.d.ts +2 -0
  10. package/dist/context.d.ts.map +1 -1
  11. package/dist/context.js +3 -0
  12. package/dist/context.js.map +1 -1
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +7 -0
  15. package/dist/index.js.map +1 -1
  16. package/dist/lexicon/index.d.ts +2 -0
  17. package/dist/lexicon/index.d.ts.map +1 -1
  18. package/dist/lexicon/index.js +4 -0
  19. package/dist/lexicon/index.js.map +1 -1
  20. package/dist/lexicon/lexicons.d.ts +61 -0
  21. package/dist/lexicon/lexicons.d.ts.map +1 -1
  22. package/dist/lexicon/lexicons.js +64 -0
  23. package/dist/lexicon/lexicons.js.map +1 -1
  24. package/dist/lexicon/types/app/bsky/unspecced/getSuggestionsSkeleton.d.ts +40 -0
  25. package/dist/lexicon/types/app/bsky/unspecced/getSuggestionsSkeleton.d.ts.map +1 -0
  26. package/dist/lexicon/types/app/bsky/unspecced/getSuggestionsSkeleton.js +3 -0
  27. package/dist/lexicon/types/app/bsky/unspecced/getSuggestionsSkeleton.js.map +1 -0
  28. package/dist/lexicon/types/com/atproto/server/createSession.d.ts +3 -1
  29. package/dist/lexicon/types/com/atproto/server/createSession.d.ts.map +1 -1
  30. package/dist/lexicon/types/com/atproto/server/getSession.d.ts +1 -0
  31. package/dist/lexicon/types/com/atproto/server/getSession.d.ts.map +1 -1
  32. package/dist/lexicon/types/com/atproto/server/updateEmail.d.ts +1 -0
  33. package/dist/lexicon/types/com/atproto/server/updateEmail.d.ts.map +1 -1
  34. package/package.json +4 -4
  35. package/src/api/app/bsky/actor/getSuggestions.ts +28 -13
  36. package/src/config.ts +14 -0
  37. package/src/context.ts +5 -0
  38. package/src/index.ts +12 -0
  39. package/src/lexicon/index.ts +12 -0
  40. package/src/lexicon/lexicons.ts +67 -0
  41. package/src/lexicon/types/app/bsky/unspecced/getSuggestionsSkeleton.ts +50 -0
  42. package/src/lexicon/types/com/atproto/server/createSession.ts +3 -1
  43. package/src/lexicon/types/com/atproto/server/getSession.ts +1 -0
  44. package/src/lexicon/types/com/atproto/server/updateEmail.ts +1 -0
@@ -0,0 +1,40 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import express from 'express';
5
+ import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
6
+ import * as AppBskyUnspeccedDefs from './defs';
7
+ export interface QueryParams {
8
+ /** DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking. */
9
+ viewer?: string;
10
+ limit: number;
11
+ cursor?: string;
12
+ }
13
+ export type InputSchema = undefined;
14
+ export interface OutputSchema {
15
+ cursor?: string;
16
+ actors: AppBskyUnspeccedDefs.SkeletonSearchActor[];
17
+ [k: string]: unknown;
18
+ }
19
+ export type HandlerInput = undefined;
20
+ export interface HandlerSuccess {
21
+ encoding: 'application/json';
22
+ body: OutputSchema;
23
+ headers?: {
24
+ [key: string]: string;
25
+ };
26
+ }
27
+ export interface HandlerError {
28
+ status: number;
29
+ message?: string;
30
+ }
31
+ export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
32
+ export type HandlerReqCtx<HA extends HandlerAuth = never> = {
33
+ auth: HA;
34
+ params: QueryParams;
35
+ input: HandlerInput;
36
+ req: express.Request;
37
+ res: express.Response;
38
+ };
39
+ export type Handler<HA extends HandlerAuth = never> = (ctx: HandlerReqCtx<HA>) => Promise<HandlerOutput> | HandlerOutput;
40
+ //# sourceMappingURL=getSuggestionsSkeleton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSuggestionsSkeleton.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/app/bsky/unspecced/getSuggestionsSkeleton.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,OAAO,MAAM,SAAS,CAAA;AAK7B,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACtE,OAAO,KAAK,oBAAoB,MAAM,QAAQ,CAAA;AAE9C,MAAM,WAAW,WAAW;IAC1B,2IAA2I;IAC3I,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,MAAM,WAAW,GAAG,SAAS,CAAA;AAEnC,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,oBAAoB,CAAC,mBAAmB,EAAE,CAAA;IAClD,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACrB;AAED,MAAM,MAAM,YAAY,GAAG,SAAS,CAAA;AAEpC,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,IAAI,EAAE,YAAY,CAAA;IAClB,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;CACpC;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,cAAc,GAAG,kBAAkB,CAAA;AAC9E,MAAM,MAAM,aAAa,CAAC,EAAE,SAAS,WAAW,GAAG,KAAK,IAAI;IAC1D,IAAI,EAAE,EAAE,CAAA;IACR,MAAM,EAAE,WAAW,CAAA;IACnB,KAAK,EAAE,YAAY,CAAA;IACnB,GAAG,EAAE,OAAO,CAAC,OAAO,CAAA;IACpB,GAAG,EAAE,OAAO,CAAC,QAAQ,CAAA;CACtB,CAAA;AACD,MAAM,MAAM,OAAO,CAAC,EAAE,SAAS,WAAW,GAAG,KAAK,IAAI,CACpD,GAAG,EAAE,aAAa,CAAC,EAAE,CAAC,KACnB,OAAO,CAAC,aAAa,CAAC,GAAG,aAAa,CAAA"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=getSuggestionsSkeleton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSuggestionsSkeleton.js","sourceRoot":"","sources":["../../../../../../src/lexicon/types/app/bsky/unspecced/getSuggestionsSkeleton.ts"],"names":[],"mappings":""}
@@ -9,6 +9,7 @@ export interface InputSchema {
9
9
  /** Handle or other identifier supported by the server for the authenticating user. */
10
10
  identifier: string;
11
11
  password: string;
12
+ authFactorToken?: string;
12
13
  [k: string]: unknown;
13
14
  }
14
15
  export interface OutputSchema {
@@ -19,6 +20,7 @@ export interface OutputSchema {
19
20
  didDoc?: {};
20
21
  email?: string;
21
22
  emailConfirmed?: boolean;
23
+ emailAuthFactor?: boolean;
22
24
  [k: string]: unknown;
23
25
  }
24
26
  export interface HandlerInput {
@@ -35,7 +37,7 @@ export interface HandlerSuccess {
35
37
  export interface HandlerError {
36
38
  status: number;
37
39
  message?: string;
38
- error?: 'AccountTakedown';
40
+ error?: 'AccountTakedown' | 'AuthFactorTokenRequired';
39
41
  }
40
42
  export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
41
43
  export type HandlerReqCtx<HA extends HandlerAuth = never> = {
@@ -1 +1 @@
1
- {"version":3,"file":"createSession.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/com/atproto/server/createSession.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,OAAO,MAAM,SAAS,CAAA;AAK7B,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAEtE,MAAM,WAAW,WAAW;CAAG;AAE/B,MAAM,WAAW,WAAW;IAC1B,sFAAsF;IACtF,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,CAAC,EAAE,EAAE,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,IAAI,EAAE,WAAW,CAAA;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,IAAI,EAAE,YAAY,CAAA;IAClB,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;CACpC;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,iBAAiB,CAAA;CAC1B;AAED,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,cAAc,GAAG,kBAAkB,CAAA;AAC9E,MAAM,MAAM,aAAa,CAAC,EAAE,SAAS,WAAW,GAAG,KAAK,IAAI;IAC1D,IAAI,EAAE,EAAE,CAAA;IACR,MAAM,EAAE,WAAW,CAAA;IACnB,KAAK,EAAE,YAAY,CAAA;IACnB,GAAG,EAAE,OAAO,CAAC,OAAO,CAAA;IACpB,GAAG,EAAE,OAAO,CAAC,QAAQ,CAAA;CACtB,CAAA;AACD,MAAM,MAAM,OAAO,CAAC,EAAE,SAAS,WAAW,GAAG,KAAK,IAAI,CACpD,GAAG,EAAE,aAAa,CAAC,EAAE,CAAC,KACnB,OAAO,CAAC,aAAa,CAAC,GAAG,aAAa,CAAA"}
1
+ {"version":3,"file":"createSession.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/com/atproto/server/createSession.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,OAAO,MAAM,SAAS,CAAA;AAK7B,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAEtE,MAAM,WAAW,WAAW;CAAG;AAE/B,MAAM,WAAW,WAAW;IAC1B,sFAAsF;IACtF,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,CAAC,EAAE,EAAE,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,IAAI,EAAE,WAAW,CAAA;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,IAAI,EAAE,YAAY,CAAA;IAClB,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;CACpC;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,iBAAiB,GAAG,yBAAyB,CAAA;CACtD;AAED,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,cAAc,GAAG,kBAAkB,CAAA;AAC9E,MAAM,MAAM,aAAa,CAAC,EAAE,SAAS,WAAW,GAAG,KAAK,IAAI;IAC1D,IAAI,EAAE,EAAE,CAAA;IACR,MAAM,EAAE,WAAW,CAAA;IACnB,KAAK,EAAE,YAAY,CAAA;IACnB,GAAG,EAAE,OAAO,CAAC,OAAO,CAAA;IACpB,GAAG,EAAE,OAAO,CAAC,QAAQ,CAAA;CACtB,CAAA;AACD,MAAM,MAAM,OAAO,CAAC,EAAE,SAAS,WAAW,GAAG,KAAK,IAAI,CACpD,GAAG,EAAE,aAAa,CAAC,EAAE,CAAC,KACnB,OAAO,CAAC,aAAa,CAAC,GAAG,aAAa,CAAA"}
@@ -11,6 +11,7 @@ export interface OutputSchema {
11
11
  did: string;
12
12
  email?: string;
13
13
  emailConfirmed?: boolean;
14
+ emailAuthFactor?: boolean;
14
15
  didDoc?: {};
15
16
  [k: string]: unknown;
16
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"getSession.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/com/atproto/server/getSession.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,OAAO,MAAM,SAAS,CAAA;AAK7B,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAEtE,MAAM,WAAW,WAAW;CAAG;AAE/B,MAAM,MAAM,WAAW,GAAG,SAAS,CAAA;AAEnC,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,MAAM,CAAC,EAAE,EAAE,CAAA;IACX,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACrB;AAED,MAAM,MAAM,YAAY,GAAG,SAAS,CAAA;AAEpC,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,IAAI,EAAE,YAAY,CAAA;IAClB,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;CACpC;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,cAAc,GAAG,kBAAkB,CAAA;AAC9E,MAAM,MAAM,aAAa,CAAC,EAAE,SAAS,WAAW,GAAG,KAAK,IAAI;IAC1D,IAAI,EAAE,EAAE,CAAA;IACR,MAAM,EAAE,WAAW,CAAA;IACnB,KAAK,EAAE,YAAY,CAAA;IACnB,GAAG,EAAE,OAAO,CAAC,OAAO,CAAA;IACpB,GAAG,EAAE,OAAO,CAAC,QAAQ,CAAA;CACtB,CAAA;AACD,MAAM,MAAM,OAAO,CAAC,EAAE,SAAS,WAAW,GAAG,KAAK,IAAI,CACpD,GAAG,EAAE,aAAa,CAAC,EAAE,CAAC,KACnB,OAAO,CAAC,aAAa,CAAC,GAAG,aAAa,CAAA"}
1
+ {"version":3,"file":"getSession.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/com/atproto/server/getSession.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,OAAO,MAAM,SAAS,CAAA;AAK7B,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAEtE,MAAM,WAAW,WAAW;CAAG;AAE/B,MAAM,MAAM,WAAW,GAAG,SAAS,CAAA;AAEnC,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,MAAM,CAAC,EAAE,EAAE,CAAA;IACX,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACrB;AAED,MAAM,MAAM,YAAY,GAAG,SAAS,CAAA;AAEpC,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,IAAI,EAAE,YAAY,CAAA;IAClB,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;CACpC;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,cAAc,GAAG,kBAAkB,CAAA;AAC9E,MAAM,MAAM,aAAa,CAAC,EAAE,SAAS,WAAW,GAAG,KAAK,IAAI;IAC1D,IAAI,EAAE,EAAE,CAAA;IACR,MAAM,EAAE,WAAW,CAAA;IACnB,KAAK,EAAE,YAAY,CAAA;IACnB,GAAG,EAAE,OAAO,CAAC,OAAO,CAAA;IACpB,GAAG,EAAE,OAAO,CAAC,QAAQ,CAAA;CACtB,CAAA;AACD,MAAM,MAAM,OAAO,CAAC,EAAE,SAAS,WAAW,GAAG,KAAK,IAAI,CACpD,GAAG,EAAE,aAAa,CAAC,EAAE,CAAC,KACnB,OAAO,CAAC,aAAa,CAAC,GAAG,aAAa,CAAA"}
@@ -7,6 +7,7 @@ export interface QueryParams {
7
7
  }
8
8
  export interface InputSchema {
9
9
  email: string;
10
+ emailAuthFactor?: boolean;
10
11
  /** Requires a token from com.atproto.sever.requestEmailUpdate if the account's email has been confirmed. */
11
12
  token?: string;
12
13
  [k: string]: unknown;
@@ -1 +1 @@
1
- {"version":3,"file":"updateEmail.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/com/atproto/server/updateEmail.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,OAAO,MAAM,SAAS,CAAA;AAK7B,OAAO,EAAE,WAAW,EAAsB,MAAM,sBAAsB,CAAA;AAEtE,MAAM,WAAW,WAAW;CAAG;AAE/B,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,4GAA4G;IAC5G,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,IAAI,EAAE,WAAW,CAAA;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,cAAc,GAAG,cAAc,GAAG,eAAe,CAAA;CAC1D;AAED,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,IAAI,CAAA;AAC/C,MAAM,MAAM,aAAa,CAAC,EAAE,SAAS,WAAW,GAAG,KAAK,IAAI;IAC1D,IAAI,EAAE,EAAE,CAAA;IACR,MAAM,EAAE,WAAW,CAAA;IACnB,KAAK,EAAE,YAAY,CAAA;IACnB,GAAG,EAAE,OAAO,CAAC,OAAO,CAAA;IACpB,GAAG,EAAE,OAAO,CAAC,QAAQ,CAAA;CACtB,CAAA;AACD,MAAM,MAAM,OAAO,CAAC,EAAE,SAAS,WAAW,GAAG,KAAK,IAAI,CACpD,GAAG,EAAE,aAAa,CAAC,EAAE,CAAC,KACnB,OAAO,CAAC,aAAa,CAAC,GAAG,aAAa,CAAA"}
1
+ {"version":3,"file":"updateEmail.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/com/atproto/server/updateEmail.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,OAAO,MAAM,SAAS,CAAA;AAK7B,OAAO,EAAE,WAAW,EAAsB,MAAM,sBAAsB,CAAA;AAEtE,MAAM,WAAW,WAAW;CAAG;AAE/B,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,4GAA4G;IAC5G,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,IAAI,EAAE,WAAW,CAAA;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,cAAc,GAAG,cAAc,GAAG,eAAe,CAAA;CAC1D;AAED,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,IAAI,CAAA;AAC/C,MAAM,MAAM,aAAa,CAAC,EAAE,SAAS,WAAW,GAAG,KAAK,IAAI;IAC1D,IAAI,EAAE,EAAE,CAAA;IACR,MAAM,EAAE,WAAW,CAAA;IACnB,KAAK,EAAE,YAAY,CAAA;IACnB,GAAG,EAAE,OAAO,CAAC,OAAO,CAAA;IACpB,GAAG,EAAE,OAAO,CAAC,QAAQ,CAAA;CACtB,CAAA;AACD,MAAM,MAAM,OAAO,CAAC,EAAE,SAAS,WAAW,GAAG,KAAK,IAAI,CACpD,GAAG,EAAE,aAAa,CAAC,EAAE,CAAC,KACnB,OAAO,CAAC,aAAa,CAAC,GAAG,aAAa,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atproto/bsky",
3
- "version": "0.0.45",
3
+ "version": "0.0.47",
4
4
  "license": "MIT",
5
5
  "description": "Reference implementation of app.bsky App View (Bluesky API)",
6
6
  "keywords": [
@@ -39,7 +39,7 @@
39
39
  "structured-headers": "^1.0.1",
40
40
  "typed-emitter": "^2.1.0",
41
41
  "uint8arrays": "3.0.0",
42
- "@atproto/api": "^0.12.3",
42
+ "@atproto/api": "^0.12.5",
43
43
  "@atproto/common": "^0.4.0",
44
44
  "@atproto/crypto": "^0.4.0",
45
45
  "@atproto/identity": "^0.4.0",
@@ -61,9 +61,9 @@
61
61
  "axios": "^0.27.2",
62
62
  "jest": "^28.1.2",
63
63
  "ts-node": "^10.8.2",
64
- "@atproto/api": "^0.12.3",
64
+ "@atproto/api": "^0.12.5",
65
65
  "@atproto/lex-cli": "^0.4.0",
66
- "@atproto/pds": "^0.4.14",
66
+ "@atproto/pds": "^0.4.16",
67
67
  "@atproto/xrpc": "^0.5.0"
68
68
  },
69
69
  "scripts": {
@@ -12,6 +12,7 @@ import { Views } from '../../../../views'
12
12
  import { DataPlaneClient } from '../../../../data-plane'
13
13
  import { parseString } from '../../../../hydration/util'
14
14
  import { resHeaders } from '../../../util'
15
+ import AtpAgent from '@atproto/api'
15
16
 
16
17
  export default function (server: Server, ctx: AppContext) {
17
18
  const getSuggestions = createPipeline(
@@ -43,21 +44,34 @@ const skeleton = async (input: {
43
44
  }): Promise<Skeleton> => {
44
45
  const { ctx, params } = input
45
46
  const viewer = params.hydrateCtx.viewer
46
- // @NOTE for appview swap moving to rkey-based cursors which are somewhat permissive, should not hard-break pagination
47
- const suggestions = await ctx.dataplane.getFollowSuggestions({
48
- actorDid: viewer ?? undefined,
49
- cursor: params.cursor,
50
- limit: params.limit,
51
- })
52
- let dids = suggestions.dids
53
- if (viewer !== null) {
54
- const follows = await ctx.dataplane.getActorFollowsActors({
55
- actorDid: viewer,
56
- targetDids: dids,
47
+ if (ctx.suggestionsAgent) {
48
+ const res =
49
+ await ctx.suggestionsAgent.api.app.bsky.unspecced.getSuggestionsSkeleton({
50
+ viewer: viewer ?? undefined,
51
+ limit: params.limit,
52
+ cursor: params.cursor,
53
+ })
54
+ return {
55
+ dids: res.data.actors.map((a) => a.did),
56
+ cursor: res.data.cursor,
57
+ }
58
+ } else {
59
+ // @NOTE for appview swap moving to rkey-based cursors which are somewhat permissive, should not hard-break pagination
60
+ const suggestions = await ctx.dataplane.getFollowSuggestions({
61
+ actorDid: viewer ?? undefined,
62
+ cursor: params.cursor,
63
+ limit: params.limit,
57
64
  })
58
- dids = dids.filter((did, i) => !follows.uris[i] && did !== viewer)
65
+ let dids = suggestions.dids
66
+ if (viewer !== null) {
67
+ const follows = await ctx.dataplane.getActorFollowsActors({
68
+ actorDid: viewer,
69
+ targetDids: dids,
70
+ })
71
+ dids = dids.filter((did, i) => !follows.uris[i] && did !== viewer)
72
+ }
73
+ return { dids, cursor: parseString(suggestions.cursor) }
59
74
  }
60
- return { dids, cursor: parseString(suggestions.cursor) }
61
75
  }
62
76
 
63
77
  const hydration = async (input: {
@@ -101,6 +115,7 @@ const presentation = (input: {
101
115
  }
102
116
 
103
117
  type Context = {
118
+ suggestionsAgent: AtpAgent | undefined
104
119
  dataplane: DataPlaneClient
105
120
  hydrator: Hydrator
106
121
  views: Views
package/src/config.ts CHANGED
@@ -20,6 +20,8 @@ export interface ServerConfigValues {
20
20
  courierHttpVersion?: '1.1' | '2'
21
21
  courierIgnoreBadTls?: boolean
22
22
  searchUrl?: string
23
+ suggestionsUrl?: string
24
+ suggestionsApiKey?: string
23
25
  cdnUrl?: string
24
26
  blobRateLimitBypassKey?: string
25
27
  blobRateLimitBypassHostname?: string
@@ -55,6 +57,8 @@ export class ServerConfig {
55
57
  process.env.BSKY_SEARCH_URL ||
56
58
  process.env.BSKY_SEARCH_ENDPOINT ||
57
59
  undefined
60
+ const suggestionsUrl = process.env.BSKY_SUGGESTIONS_URL || undefined
61
+ const suggestionsApiKey = process.env.BSKY_SUGGESTIONS_API_KEY || undefined
58
62
  let dataplaneUrls = overrides?.dataplaneUrls
59
63
  dataplaneUrls ??= process.env.BSKY_DATAPLANE_URLS
60
64
  ? process.env.BSKY_DATAPLANE_URLS.split(',')
@@ -104,6 +108,8 @@ export class ServerConfig {
104
108
  dataplaneHttpVersion,
105
109
  dataplaneIgnoreBadTls,
106
110
  searchUrl,
111
+ suggestionsUrl,
112
+ suggestionsApiKey,
107
113
  didPlcUrl,
108
114
  labelsFromIssuerDids,
109
115
  handleResolveNameservers,
@@ -206,6 +212,14 @@ export class ServerConfig {
206
212
  return this.cfg.searchUrl
207
213
  }
208
214
 
215
+ get suggestionsUrl() {
216
+ return this.cfg.suggestionsUrl
217
+ }
218
+
219
+ get suggestionsApiKey() {
220
+ return this.cfg.suggestionsApiKey
221
+ }
222
+
209
223
  get cdnUrl() {
210
224
  return this.cfg.cdnUrl
211
225
  }
package/src/context.ts CHANGED
@@ -24,6 +24,7 @@ export class AppContext {
24
24
  cfg: ServerConfig
25
25
  dataplane: DataPlaneClient
26
26
  searchAgent: AtpAgent | undefined
27
+ suggestionsAgent: AtpAgent | undefined
27
28
  hydrator: Hydrator
28
29
  views: Views
29
30
  signingKey: Keypair
@@ -46,6 +47,10 @@ export class AppContext {
46
47
  return this.opts.searchAgent
47
48
  }
48
49
 
50
+ get suggestionsAgent(): AtpAgent | undefined {
51
+ return this.opts.suggestionsAgent
52
+ }
53
+
49
54
  get hydrator(): Hydrator {
50
55
  return this.opts.hydrator
51
56
  }
package/src/index.ts CHANGED
@@ -74,6 +74,17 @@ export class BskyAppView {
74
74
  const searchAgent = config.searchUrl
75
75
  ? new AtpAgent({ service: config.searchUrl })
76
76
  : undefined
77
+
78
+ const suggestionsAgent = config.suggestionsUrl
79
+ ? new AtpAgent({ service: config.suggestionsUrl })
80
+ : undefined
81
+ if (suggestionsAgent && config.suggestionsApiKey) {
82
+ suggestionsAgent.api.setHeader(
83
+ 'authorization',
84
+ `Bearer ${config.suggestionsApiKey}`,
85
+ )
86
+ }
87
+
77
88
  const dataplane = createDataPlaneClient(config.dataplaneUrls, {
78
89
  httpVersion: config.dataplaneHttpVersion,
79
90
  rejectUnauthorized: !config.dataplaneIgnoreBadTls,
@@ -107,6 +118,7 @@ export class BskyAppView {
107
118
  cfg: config,
108
119
  dataplane,
109
120
  searchAgent,
121
+ suggestionsAgent,
110
122
  hydrator,
111
123
  views,
112
124
  signingKey,
@@ -125,6 +125,7 @@ import * as AppBskyNotificationListNotifications from './types/app/bsky/notifica
125
125
  import * as AppBskyNotificationRegisterPush from './types/app/bsky/notification/registerPush'
126
126
  import * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen'
127
127
  import * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators'
128
+ import * as AppBskyUnspeccedGetSuggestionsSkeleton from './types/app/bsky/unspecced/getSuggestionsSkeleton'
128
129
  import * as AppBskyUnspeccedGetTaggedSuggestions from './types/app/bsky/unspecced/getTaggedSuggestions'
129
130
  import * as AppBskyUnspeccedSearchActorsSkeleton from './types/app/bsky/unspecced/searchActorsSkeleton'
130
131
  import * as AppBskyUnspeccedSearchPostsSkeleton from './types/app/bsky/unspecced/searchPostsSkeleton'
@@ -1648,6 +1649,17 @@ export class AppBskyUnspeccedNS {
1648
1649
  return this._server.xrpc.method(nsid, cfg)
1649
1650
  }
1650
1651
 
1652
+ getSuggestionsSkeleton<AV extends AuthVerifier>(
1653
+ cfg: ConfigOf<
1654
+ AV,
1655
+ AppBskyUnspeccedGetSuggestionsSkeleton.Handler<ExtractAuth<AV>>,
1656
+ AppBskyUnspeccedGetSuggestionsSkeleton.HandlerReqCtx<ExtractAuth<AV>>
1657
+ >,
1658
+ ) {
1659
+ const nsid = 'app.bsky.unspecced.getSuggestionsSkeleton' // @ts-ignore
1660
+ return this._server.xrpc.method(nsid, cfg)
1661
+ }
1662
+
1651
1663
  getTaggedSuggestions<AV extends AuthVerifier>(
1652
1664
  cfg: ConfigOf<
1653
1665
  AV,
@@ -2209,6 +2209,9 @@ export const schemaDict = {
2209
2209
  password: {
2210
2210
  type: 'string',
2211
2211
  },
2212
+ authFactorToken: {
2213
+ type: 'string',
2214
+ },
2212
2215
  },
2213
2216
  },
2214
2217
  },
@@ -2241,6 +2244,9 @@ export const schemaDict = {
2241
2244
  emailConfirmed: {
2242
2245
  type: 'boolean',
2243
2246
  },
2247
+ emailAuthFactor: {
2248
+ type: 'boolean',
2249
+ },
2244
2250
  },
2245
2251
  },
2246
2252
  },
@@ -2248,6 +2254,9 @@ export const schemaDict = {
2248
2254
  {
2249
2255
  name: 'AccountTakedown',
2250
2256
  },
2257
+ {
2258
+ name: 'AuthFactorTokenRequired',
2259
+ },
2251
2260
  ],
2252
2261
  },
2253
2262
  },
@@ -2568,6 +2577,9 @@ export const schemaDict = {
2568
2577
  emailConfirmed: {
2569
2578
  type: 'boolean',
2570
2579
  },
2580
+ emailAuthFactor: {
2581
+ type: 'boolean',
2582
+ },
2571
2583
  didDoc: {
2572
2584
  type: 'unknown',
2573
2585
  },
@@ -2837,6 +2849,9 @@ export const schemaDict = {
2837
2849
  email: {
2838
2850
  type: 'string',
2839
2851
  },
2852
+ emailAuthFactor: {
2853
+ type: 'boolean',
2854
+ },
2840
2855
  token: {
2841
2856
  type: 'string',
2842
2857
  description:
@@ -7843,6 +7858,56 @@ export const schemaDict = {
7843
7858
  },
7844
7859
  },
7845
7860
  },
7861
+ AppBskyUnspeccedGetSuggestionsSkeleton: {
7862
+ lexicon: 1,
7863
+ id: 'app.bsky.unspecced.getSuggestionsSkeleton',
7864
+ defs: {
7865
+ main: {
7866
+ type: 'query',
7867
+ description:
7868
+ 'Get a skeleton of suggested actors. Intended to be called and then hydrated through app.bsky.actor.getSuggestions',
7869
+ parameters: {
7870
+ type: 'params',
7871
+ properties: {
7872
+ viewer: {
7873
+ type: 'string',
7874
+ format: 'did',
7875
+ description:
7876
+ 'DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking.',
7877
+ },
7878
+ limit: {
7879
+ type: 'integer',
7880
+ minimum: 1,
7881
+ maximum: 100,
7882
+ default: 50,
7883
+ },
7884
+ cursor: {
7885
+ type: 'string',
7886
+ },
7887
+ },
7888
+ },
7889
+ output: {
7890
+ encoding: 'application/json',
7891
+ schema: {
7892
+ type: 'object',
7893
+ required: ['actors'],
7894
+ properties: {
7895
+ cursor: {
7896
+ type: 'string',
7897
+ },
7898
+ actors: {
7899
+ type: 'array',
7900
+ items: {
7901
+ type: 'ref',
7902
+ ref: 'lex:app.bsky.unspecced.defs#skeletonSearchActor',
7903
+ },
7904
+ },
7905
+ },
7906
+ },
7907
+ },
7908
+ },
7909
+ },
7910
+ },
7846
7911
  AppBskyUnspeccedGetTaggedSuggestions: {
7847
7912
  lexicon: 1,
7848
7913
  id: 'app.bsky.unspecced.getTaggedSuggestions',
@@ -8244,6 +8309,8 @@ export const ids = {
8244
8309
  AppBskyUnspeccedDefs: 'app.bsky.unspecced.defs',
8245
8310
  AppBskyUnspeccedGetPopularFeedGenerators:
8246
8311
  'app.bsky.unspecced.getPopularFeedGenerators',
8312
+ AppBskyUnspeccedGetSuggestionsSkeleton:
8313
+ 'app.bsky.unspecced.getSuggestionsSkeleton',
8247
8314
  AppBskyUnspeccedGetTaggedSuggestions:
8248
8315
  'app.bsky.unspecced.getTaggedSuggestions',
8249
8316
  AppBskyUnspeccedSearchActorsSkeleton:
@@ -0,0 +1,50 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import express from 'express'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { lexicons } from '../../../../lexicons'
7
+ import { isObj, hasProp } from '../../../../util'
8
+ import { CID } from 'multiformats/cid'
9
+ import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
10
+ import * as AppBskyUnspeccedDefs from './defs'
11
+
12
+ export interface QueryParams {
13
+ /** DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking. */
14
+ viewer?: string
15
+ limit: number
16
+ cursor?: string
17
+ }
18
+
19
+ export type InputSchema = undefined
20
+
21
+ export interface OutputSchema {
22
+ cursor?: string
23
+ actors: AppBskyUnspeccedDefs.SkeletonSearchActor[]
24
+ [k: string]: unknown
25
+ }
26
+
27
+ export type HandlerInput = undefined
28
+
29
+ export interface HandlerSuccess {
30
+ encoding: 'application/json'
31
+ body: OutputSchema
32
+ headers?: { [key: string]: string }
33
+ }
34
+
35
+ export interface HandlerError {
36
+ status: number
37
+ message?: string
38
+ }
39
+
40
+ export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
41
+ export type HandlerReqCtx<HA extends HandlerAuth = never> = {
42
+ auth: HA
43
+ params: QueryParams
44
+ input: HandlerInput
45
+ req: express.Request
46
+ res: express.Response
47
+ }
48
+ export type Handler<HA extends HandlerAuth = never> = (
49
+ ctx: HandlerReqCtx<HA>,
50
+ ) => Promise<HandlerOutput> | HandlerOutput
@@ -14,6 +14,7 @@ export interface InputSchema {
14
14
  /** Handle or other identifier supported by the server for the authenticating user. */
15
15
  identifier: string
16
16
  password: string
17
+ authFactorToken?: string
17
18
  [k: string]: unknown
18
19
  }
19
20
 
@@ -25,6 +26,7 @@ export interface OutputSchema {
25
26
  didDoc?: {}
26
27
  email?: string
27
28
  emailConfirmed?: boolean
29
+ emailAuthFactor?: boolean
28
30
  [k: string]: unknown
29
31
  }
30
32
 
@@ -42,7 +44,7 @@ export interface HandlerSuccess {
42
44
  export interface HandlerError {
43
45
  status: number
44
46
  message?: string
45
- error?: 'AccountTakedown'
47
+ error?: 'AccountTakedown' | 'AuthFactorTokenRequired'
46
48
  }
47
49
 
48
50
  export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
@@ -17,6 +17,7 @@ export interface OutputSchema {
17
17
  did: string
18
18
  email?: string
19
19
  emailConfirmed?: boolean
20
+ emailAuthFactor?: boolean
20
21
  didDoc?: {}
21
22
  [k: string]: unknown
22
23
  }
@@ -12,6 +12,7 @@ export interface QueryParams {}
12
12
 
13
13
  export interface InputSchema {
14
14
  email: string
15
+ emailAuthFactor?: boolean
15
16
  /** Requires a token from com.atproto.sever.requestEmailUpdate if the account's email has been confirmed. */
16
17
  token?: string
17
18
  [k: string]: unknown