@atproto/bsky 0.0.222 → 0.0.224
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.
- package/CHANGELOG.md +18 -0
- package/dist/api/app/bsky/graph/getSuggestedFollowsByActor.js +1 -1
- package/dist/api/app/bsky/graph/getSuggestedFollowsByActor.js.map +1 -1
- package/dist/api/app/bsky/unspecced/getSuggestedUsersForDiscover.d.ts +4 -0
- package/dist/api/app/bsky/unspecced/getSuggestedUsersForDiscover.d.ts.map +1 -0
- package/dist/api/app/bsky/unspecced/getSuggestedUsersForDiscover.js +107 -0
- package/dist/api/app/bsky/unspecced/getSuggestedUsersForDiscover.js.map +1 -0
- package/dist/api/app/bsky/unspecced/getSuggestedUsersForExplore.d.ts +4 -0
- package/dist/api/app/bsky/unspecced/getSuggestedUsersForExplore.d.ts.map +1 -0
- package/dist/api/app/bsky/unspecced/getSuggestedUsersForExplore.js +109 -0
- package/dist/api/app/bsky/unspecced/getSuggestedUsersForExplore.js.map +1 -0
- package/dist/api/app/bsky/unspecced/getSuggestedUsersForSeeMore.d.ts +4 -0
- package/dist/api/app/bsky/unspecced/getSuggestedUsersForSeeMore.d.ts.map +1 -0
- package/dist/api/app/bsky/unspecced/getSuggestedUsersForSeeMore.js +109 -0
- package/dist/api/app/bsky/unspecced/getSuggestedUsersForSeeMore.js.map +1 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +6 -0
- package/dist/api/index.js.map +1 -1
- package/dist/feature-gates/gates.d.ts +3 -0
- package/dist/feature-gates/gates.d.ts.map +1 -1
- package/dist/feature-gates/gates.js +3 -0
- package/dist/feature-gates/gates.js.map +1 -1
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForDiscover.d.ts +3 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForDiscover.d.ts.map +1 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForDiscover.defs.d.ts +22 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForDiscover.defs.d.ts.map +1 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForDiscover.defs.js +53 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForDiscover.defs.js.map +1 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForDiscover.js +45 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForDiscover.js.map +1 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForDiscoverSkeleton.d.ts +3 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForDiscoverSkeleton.d.ts.map +1 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForDiscoverSkeleton.defs.d.ts +31 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForDiscoverSkeleton.defs.d.ts.map +1 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForDiscoverSkeleton.defs.js +20 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForDiscoverSkeleton.defs.js.map +1 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForDiscoverSkeleton.js +45 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForDiscoverSkeleton.js.map +1 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForExplore.d.ts +3 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForExplore.d.ts.map +1 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForExplore.defs.d.ts +24 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForExplore.defs.d.ts.map +1 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForExplore.defs.js +54 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForExplore.defs.js.map +1 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForExplore.js +45 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForExplore.js.map +1 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForExploreSkeleton.d.ts +3 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForExploreSkeleton.d.ts.map +1 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForExploreSkeleton.defs.d.ts +33 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForExploreSkeleton.defs.d.ts.map +1 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForExploreSkeleton.defs.js +21 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForExploreSkeleton.defs.js.map +1 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForExploreSkeleton.js +45 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForExploreSkeleton.js.map +1 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForSeeMore.d.ts +3 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForSeeMore.d.ts.map +1 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForSeeMore.defs.d.ts +24 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForSeeMore.defs.d.ts.map +1 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForSeeMore.defs.js +54 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForSeeMore.defs.js.map +1 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForSeeMore.js +45 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForSeeMore.js.map +1 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForSeeMoreSkeleton.d.ts +3 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForSeeMoreSkeleton.d.ts.map +1 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForSeeMoreSkeleton.defs.d.ts +33 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForSeeMoreSkeleton.defs.d.ts.map +1 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForSeeMoreSkeleton.defs.js +21 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForSeeMoreSkeleton.defs.js.map +1 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForSeeMoreSkeleton.js +45 -0
- package/dist/lexicons/app/bsky/unspecced/getSuggestedUsersForSeeMoreSkeleton.js.map +1 -0
- package/dist/lexicons/app/bsky/unspecced.d.ts +6 -0
- package/dist/lexicons/app/bsky/unspecced.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/unspecced.js +7 -1
- package/dist/lexicons/app/bsky/unspecced.js.map +1 -1
- package/package.json +7 -7
- package/src/api/app/bsky/graph/getSuggestedFollowsByActor.ts +2 -2
- package/src/api/app/bsky/unspecced/getSuggestedUsersForDiscover.ts +175 -0
- package/src/api/app/bsky/unspecced/getSuggestedUsersForExplore.ts +178 -0
- package/src/api/app/bsky/unspecced/getSuggestedUsersForSeeMore.ts +178 -0
- package/src/api/index.ts +6 -0
- package/src/feature-gates/gates.ts +3 -0
- package/tsconfig.build.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atproto/bsky
|
|
2
2
|
|
|
3
|
+
## 0.0.224
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#4830](https://github.com/bluesky-social/atproto/pull/4830) [`42232c7`](https://github.com/bluesky-social/atproto/commit/42232c7f3622f1d4a4ebe78eb1321817a8df1c96) Thanks [@estrattonbailey](https://github.com/estrattonbailey)! - Register new suggested user endpoints with the router
|
|
8
|
+
|
|
9
|
+
## 0.0.223
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#4809](https://github.com/bluesky-social/atproto/pull/4809) [`2a5e2c2`](https://github.com/bluesky-social/atproto/commit/2a5e2c267f130df8eed87c9bdcb26e97841abc13) Thanks [@ds-boyce](https://github.com/ds-boyce)! - Create new endpoints for suggested users
|
|
14
|
+
|
|
15
|
+
- [#4810](https://github.com/bluesky-social/atproto/pull/4810) [`34f9ae1`](https://github.com/bluesky-social/atproto/commit/34f9ae1f6824bdd7f66c94c57e41cec757e267df) Thanks [@ds-boyce](https://github.com/ds-boyce)! - Show suggestions to logged out users
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [[`2a5e2c2`](https://github.com/bluesky-social/atproto/commit/2a5e2c267f130df8eed87c9bdcb26e97841abc13), [`3711454`](https://github.com/bluesky-social/atproto/commit/371145432178b6c8c411f1289c266314cc7ec592)]:
|
|
18
|
+
- @atproto/api@0.19.6
|
|
19
|
+
- @atproto/syntax@0.5.3
|
|
20
|
+
|
|
3
21
|
## 0.0.222
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -9,7 +9,7 @@ const util_1 = require("../../../util");
|
|
|
9
9
|
function default_1(server, ctx) {
|
|
10
10
|
const getSuggestedFollowsByActor = (0, pipeline_1.createPipeline)(skeleton, hydration, noBlocksOrMutes, presentation);
|
|
11
11
|
server.add(index_js_1.app.bsky.graph.getSuggestedFollowsByActor, {
|
|
12
|
-
auth: ctx.authVerifier.
|
|
12
|
+
auth: ctx.authVerifier.standardOptional,
|
|
13
13
|
handler: async ({ auth, params, req }) => {
|
|
14
14
|
const viewer = auth.credentials.iss;
|
|
15
15
|
const labelers = ctx.reqLabelers(req);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSuggestedFollowsByActor.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/graph/getSuggestedFollowsByActor.ts"],"names":[],"mappings":";;AAqBA,4BAqDC;AA1ED,4CAA6D;AAE7D,sDAK6B;AAG7B,4DAAmD;AACnD,mDAM6B;AAE7B,wCAA0C;AAE1C,mBAAyB,MAAc,EAAE,GAAe;IACtD,MAAM,0BAA0B,GAAG,IAAA,yBAAc,EAC/C,QAAQ,EACR,SAAS,EACT,eAAe,EACf,YAAY,CACb,CAAA;IACD,MAAM,CAAC,GAAG,CAAC,cAAG,CAAC,IAAI,CAAC,KAAK,CAAC,0BAA0B,EAAE;QACpD,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"getSuggestedFollowsByActor.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/graph/getSuggestedFollowsByActor.ts"],"names":[],"mappings":";;AAqBA,4BAqDC;AA1ED,4CAA6D;AAE7D,sDAK6B;AAG7B,4DAAmD;AACnD,mDAM6B;AAE7B,wCAA0C;AAE1C,mBAAyB,MAAc,EAAE,GAAe;IACtD,MAAM,0BAA0B,GAAG,IAAA,yBAAc,EAC/C,QAAQ,EACR,SAAS,EACT,eAAe,EACf,YAAY,CACb,CAAA;IACD,MAAM,CAAC,GAAG,CAAC,cAAG,CAAC,IAAI,CAAC,KAAK,CAAC,0BAA0B,EAAE;QACpD,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,gBAAgB;QACvC,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,EAAE;YACvC,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAA;YACnC,MAAM,QAAQ,GAAG,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA;YACrC,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,aAAa,CAAC;gBAClD,QAAQ;gBACR,MAAM;gBACN,QAAQ,EAAE,GAAG,CAAC,kBAAkB,CAAC,KAAK,CACpC,GAAG,CAAC,kBAAkB,CAAC,2BAA2B,CAAC;oBACjD,MAAM;oBACN,GAAG;iBACJ,CAAC,CACH;aACF,CAAC,CAAA;YAEF,IAAI,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC;gBAC3B,OAAO;oBACL,QAAQ,EAAE,kBAAkB;oBAC5B,IAAI,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE;oBACz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AAC,CAAA;IACvE,CAAC;AACH,CAAC,CAAA;AAED,MAAM,eAAe,GAAG,CACtB,KAAmD,EACnD,EAAE;IACF,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,CAAA;IAC1C,QAAQ,CAAC,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CACpD,CAAC,GAAG,EAAE,EAAE,CACN,CAAC,GAAG,CAAC,KAAK,CAAC,iBAAiB,CAAC,GAAG,EAAE,SAAS,CAAC;QAC5C,CAAC,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC,GAAG,EAAE,SAAS,CAAC,CAC9C,CAAA;IACD,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA;AAED,MAAM,YAAY,GAAG,CACnB,KAA0D,EAC1D,EAAE;IACF,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAA;IAC1C,MAAM,EAAE,aAAa,EAAE,eAAe,EAAE,GAAG,QAAQ,CAAA;IACnD,MAAM,WAAW,GAAG,IAAA,mBAAU,EAAC,aAAa,EAAE,CAAC,GAAG,EAAE,EAAE,CACpD,GAAG,CAAC,KAAK,CAAC,qBAAqB,CAAC,GAAG,EAAE,SAAS,CAAC,CAChD,CAAA;IACD,OAAO;QACL,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,eAAe;QACf,WAAW;KACZ,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { mapDefined, noUndefinedVals } from '@atproto/common'\nimport { Client, DidString } from '@atproto/lex'\nimport {\n Headers as HeadersMap,\n InternalServerError,\n InvalidRequestError,\n Server,\n} from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context'\nimport { HydrateCtx, Hydrator } from '../../../../hydration/hydrator'\nimport { app } from '../../../../lexicons/index.js'\nimport {\n HydrationFnInput,\n PresentationFnInput,\n RulesFnInput,\n SkeletonFnInput,\n createPipeline,\n} from '../../../../pipeline'\nimport { Views } from '../../../../views'\nimport { resHeaders } from '../../../util'\n\nexport default function (server: Server, ctx: AppContext) {\n const getSuggestedFollowsByActor = createPipeline(\n skeleton,\n hydration,\n noBlocksOrMutes,\n presentation,\n )\n server.add(app.bsky.graph.getSuggestedFollowsByActor, {\n auth: ctx.authVerifier.standardOptional,\n handler: async ({ auth, params, req }) => {\n const viewer = auth.credentials.iss\n const labelers = ctx.reqLabelers(req)\n const hydrateCtx = await ctx.hydrator.createContext({\n labelers,\n viewer,\n features: ctx.featureGatesClient.scope(\n ctx.featureGatesClient.parseUserContextFromHandler({\n viewer,\n req,\n }),\n ),\n })\n\n if (!ctx.suggestionsClient) {\n return {\n encoding: 'application/json',\n body: { suggestions: [] },\n headers: resHeaders({ labelers: hydrateCtx.labelers }),\n }\n }\n\n const headers = noUndefinedVals({\n 'accept-language': req.headers['accept-language'],\n 'x-bsky-topics': Array.isArray(req.headers['x-bsky-topics'])\n ? req.headers['x-bsky-topics'].join(',')\n : req.headers['x-bsky-topics'],\n })\n\n const { contentLanguage, ...body } = await getSuggestedFollowsByActor(\n { ...params, hydrateCtx, headers },\n ctx,\n )\n\n return {\n encoding: 'application/json',\n body,\n headers: {\n ...(contentLanguage ? { 'content-language': contentLanguage } : null),\n ...resHeaders({ labelers: hydrateCtx.labelers }),\n },\n }\n },\n })\n}\n\nconst skeleton = async (\n input: SkeletonFnInput<Context, Params>,\n): Promise<SkeletonState> => {\n const { params, ctx } = input\n\n // handled above already, this branch should not be reached\n if (!ctx.suggestionsClient) {\n throw new InternalServerError('Suggestions service not configured')\n }\n\n const [relativeToDid] = await ctx.hydrator.actor.getDids([params.actor])\n if (!relativeToDid) {\n throw new InvalidRequestError('Actor not found')\n }\n\n const res = await ctx.suggestionsClient.xrpc(\n app.bsky.unspecced.getSuggestionsSkeleton,\n {\n params: {\n viewer: params.hydrateCtx.viewer ?? undefined,\n relativeToDid,\n },\n headers: params.headers,\n },\n )\n\n return {\n recIdStr: res.body.recIdStr,\n suggestedDids: res.body.actors.map((a) => a.did),\n contentLanguage: res.headers.get('content-language') ?? undefined,\n }\n}\n\nconst hydration = async (\n input: HydrationFnInput<Context, Params, SkeletonState>,\n) => {\n const { ctx, params, skeleton } = input\n const { suggestedDids } = skeleton\n if (\n params.hydrateCtx.features.checkGate(\n params.hydrateCtx.features.Gate.SuggestedUsersSocialProofEnable,\n )\n ) {\n return ctx.hydrator.hydrateProfilesDetailed(\n suggestedDids,\n params.hydrateCtx,\n )\n } else {\n return ctx.hydrator.hydrateProfiles(suggestedDids, params.hydrateCtx)\n }\n}\n\nconst noBlocksOrMutes = (\n input: RulesFnInput<Context, Params, SkeletonState>,\n) => {\n const { ctx, skeleton, hydration } = input\n skeleton.suggestedDids = skeleton.suggestedDids.filter(\n (did) =>\n !ctx.views.viewerBlockExists(did, hydration) &&\n !ctx.views.viewerMuteExists(did, hydration),\n )\n return skeleton\n}\n\nconst presentation = (\n input: PresentationFnInput<Context, Params, SkeletonState>,\n) => {\n const { ctx, hydration, skeleton } = input\n const { suggestedDids, contentLanguage } = skeleton\n const suggestions = mapDefined(suggestedDids, (did) =>\n ctx.views.profileKnownFollowers(did, hydration),\n )\n return {\n recIdStr: skeleton.recIdStr,\n contentLanguage,\n suggestions,\n }\n}\n\ntype Context = {\n hydrator: Hydrator\n views: Views\n suggestionsClient: Client | undefined\n}\n\ntype Params = app.bsky.graph.getSuggestedFollowsByActor.$Params & {\n hydrateCtx: HydrateCtx\n headers: HeadersMap\n}\n\ntype SkeletonState = {\n suggestedDids: DidString[]\n recIdStr?: string\n contentLanguage?: string\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSuggestedUsersForDiscover.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/unspecced/getSuggestedUsersForDiscover.ts"],"names":[],"mappings":"AAEA,OAAO,EAA6B,MAAM,EAAE,MAAM,sBAAsB,CAAA;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAgBhD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAuCvD"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = default_1;
|
|
4
|
+
const common_1 = require("@atproto/common");
|
|
5
|
+
const xrpc_server_1 = require("@atproto/xrpc-server");
|
|
6
|
+
const hydrator_1 = require("../../../../hydration/hydrator");
|
|
7
|
+
const index_js_1 = require("../../../../lexicons/index.js");
|
|
8
|
+
const pipeline_1 = require("../../../../pipeline");
|
|
9
|
+
function default_1(server, ctx) {
|
|
10
|
+
const getSuggestedUsersForDiscover = (0, pipeline_1.createPipeline)(skeleton, hydration, noBlocksOrFollows, presentation);
|
|
11
|
+
server.add(index_js_1.app.bsky.unspecced.getSuggestedUsersForDiscover, {
|
|
12
|
+
auth: ctx.authVerifier.standardOptional,
|
|
13
|
+
handler: async ({ auth, params, req }) => {
|
|
14
|
+
const viewer = auth.credentials.iss;
|
|
15
|
+
const labelers = ctx.reqLabelers(req);
|
|
16
|
+
const hydrateCtx = await ctx.hydrator.createContext({
|
|
17
|
+
labelers,
|
|
18
|
+
viewer,
|
|
19
|
+
features: ctx.featureGatesClient.scope(ctx.featureGatesClient.parseUserContextFromHandler({
|
|
20
|
+
viewer,
|
|
21
|
+
req,
|
|
22
|
+
})),
|
|
23
|
+
});
|
|
24
|
+
const headers = (0, common_1.noUndefinedVals)({
|
|
25
|
+
'accept-language': req.headers['accept-language'],
|
|
26
|
+
});
|
|
27
|
+
const result = await getSuggestedUsersForDiscover({
|
|
28
|
+
...params,
|
|
29
|
+
hydrateCtx,
|
|
30
|
+
headers,
|
|
31
|
+
}, ctx);
|
|
32
|
+
return {
|
|
33
|
+
encoding: 'application/json',
|
|
34
|
+
body: result,
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
const skeletonFromGetSuggestedUsersSkeleton = async (input) => {
|
|
40
|
+
const { params, ctx } = input;
|
|
41
|
+
if (!ctx.suggestionsClient) {
|
|
42
|
+
throw new xrpc_server_1.MethodNotImplementedError('Suggestions agent not available');
|
|
43
|
+
}
|
|
44
|
+
return ctx.suggestionsClient.call(index_js_1.app.bsky.unspecced.getSuggestedUsersSkeleton, {
|
|
45
|
+
limit: params.limit,
|
|
46
|
+
viewer: params.hydrateCtx.viewer ?? undefined,
|
|
47
|
+
}, {
|
|
48
|
+
headers: params.headers,
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
// TODO: rename to `skeleton` once we can fully migrate to the new endpoint
|
|
52
|
+
const skeletonFromGetSuggestedUsersForDiscoverSkeleton = async (input) => {
|
|
53
|
+
const { params, ctx } = input;
|
|
54
|
+
if (!ctx.suggestionsClient) {
|
|
55
|
+
throw new xrpc_server_1.MethodNotImplementedError('Suggestions agent not available');
|
|
56
|
+
}
|
|
57
|
+
return ctx.suggestionsClient.call(index_js_1.app.bsky.unspecced.getSuggestedUsersForDiscoverSkeleton, {
|
|
58
|
+
limit: params.limit,
|
|
59
|
+
viewer: params.hydrateCtx.viewer ?? undefined,
|
|
60
|
+
}, {
|
|
61
|
+
headers: params.headers,
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
const skeleton = async (input) => {
|
|
65
|
+
const useDiscover = input.params.hydrateCtx.features.checkGate(input.params.hydrateCtx.features.Gate.SuggestedUsersForDiscoverEnable);
|
|
66
|
+
const skeletonFn = useDiscover
|
|
67
|
+
? skeletonFromGetSuggestedUsersForDiscoverSkeleton
|
|
68
|
+
: skeletonFromGetSuggestedUsersSkeleton;
|
|
69
|
+
return skeletonFn(input);
|
|
70
|
+
};
|
|
71
|
+
const hydration = async (input) => {
|
|
72
|
+
const { ctx, params, skeleton } = input;
|
|
73
|
+
const dids = (0, common_1.dedupeStrs)(skeleton.dids);
|
|
74
|
+
const pairs = new Map();
|
|
75
|
+
const viewer = params.hydrateCtx.viewer;
|
|
76
|
+
if (viewer) {
|
|
77
|
+
pairs.set(viewer, dids);
|
|
78
|
+
}
|
|
79
|
+
const [profilesState, bidirectionalBlocks] = await Promise.all([
|
|
80
|
+
ctx.hydrator.hydrateProfiles(dids, params.hydrateCtx),
|
|
81
|
+
ctx.hydrator.hydrateBidirectionalBlocks(pairs, params.hydrateCtx),
|
|
82
|
+
]);
|
|
83
|
+
return (0, hydrator_1.mergeManyStates)(profilesState, { bidirectionalBlocks });
|
|
84
|
+
};
|
|
85
|
+
const noBlocksOrFollows = (input) => {
|
|
86
|
+
const { ctx, skeleton, params, hydration } = input;
|
|
87
|
+
const viewer = params.hydrateCtx.viewer;
|
|
88
|
+
if (!viewer) {
|
|
89
|
+
return skeleton;
|
|
90
|
+
}
|
|
91
|
+
const blocks = hydration.bidirectionalBlocks?.get(viewer);
|
|
92
|
+
return {
|
|
93
|
+
...skeleton,
|
|
94
|
+
dids: skeleton.dids.filter((did) => {
|
|
95
|
+
const viewer = ctx.views.profileViewer(did, hydration);
|
|
96
|
+
return !blocks?.get(did) && !viewer?.following;
|
|
97
|
+
}),
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
const presentation = (input) => {
|
|
101
|
+
const { ctx, skeleton, hydration } = input;
|
|
102
|
+
return {
|
|
103
|
+
recIdStr: skeleton.recIdStr,
|
|
104
|
+
actors: (0, common_1.mapDefined)(skeleton.dids, (did) => ctx.views.profile(did, hydration)),
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
//# sourceMappingURL=getSuggestedUsersForDiscover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSuggestedUsersForDiscover.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/unspecced/getSuggestedUsersForDiscover.ts"],"names":[],"mappings":";;AAmBA,4BAuCC;AA1DD,4CAAyE;AAEzE,sDAAwE;AAExE,6DAIuC;AACvC,4DAAmD;AACnD,mDAM6B;AAG7B,mBAAyB,MAAc,EAAE,GAAe;IAC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M,GAAG,GAAG,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;YACtD,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAA;QAChD,CAAC,CAAC;KACH,CAAA;AACH,CAAC,CAAA;AAED,MAAM,YAAY,GAAG,CACnB,KAA0D,EAC1D,EAAE;IACF,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,CAAA;IAC1C,OAAO;QACL,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,MAAM,EAAE,IAAA,mBAAU,EAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CACxC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAClC;KACF,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { dedupeStrs, mapDefined, noUndefinedVals } from '@atproto/common'\nimport { Client, DidString } from '@atproto/lex'\nimport { MethodNotImplementedError, Server } from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context'\nimport {\n HydrateCtx,\n Hydrator,\n mergeManyStates,\n} from '../../../../hydration/hydrator'\nimport { app } from '../../../../lexicons/index.js'\nimport {\n HydrationFnInput,\n PresentationFnInput,\n RulesFnInput,\n SkeletonFnInput,\n createPipeline,\n} from '../../../../pipeline'\nimport { Views } from '../../../../views'\n\nexport default function (server: Server, ctx: AppContext) {\n const getSuggestedUsersForDiscover = createPipeline(\n skeleton,\n hydration,\n noBlocksOrFollows,\n presentation,\n )\n server.add(app.bsky.unspecced.getSuggestedUsersForDiscover, {\n auth: ctx.authVerifier.standardOptional,\n handler: async ({ auth, params, req }) => {\n const viewer = auth.credentials.iss\n const labelers = ctx.reqLabelers(req)\n const hydrateCtx = await ctx.hydrator.createContext({\n labelers,\n viewer,\n features: ctx.featureGatesClient.scope(\n ctx.featureGatesClient.parseUserContextFromHandler({\n viewer,\n req,\n }),\n ),\n })\n const headers = noUndefinedVals({\n 'accept-language': req.headers['accept-language'],\n })\n const result = await getSuggestedUsersForDiscover(\n {\n ...params,\n hydrateCtx,\n headers,\n },\n ctx,\n )\n return {\n encoding: 'application/json',\n body: result,\n }\n },\n })\n}\n\nconst skeletonFromGetSuggestedUsersSkeleton = async (\n input: SkeletonFnInput<Context, Params>,\n): Promise<SkeletonState> => {\n const { params, ctx } = input\n if (!ctx.suggestionsClient) {\n throw new MethodNotImplementedError('Suggestions agent not available')\n }\n\n return ctx.suggestionsClient.call(\n app.bsky.unspecced.getSuggestedUsersSkeleton,\n {\n limit: params.limit,\n viewer: params.hydrateCtx.viewer ?? undefined,\n },\n {\n headers: params.headers,\n },\n )\n}\n\n// TODO: rename to `skeleton` once we can fully migrate to the new endpoint\nconst skeletonFromGetSuggestedUsersForDiscoverSkeleton = async (\n input: SkeletonFnInput<Context, Params>,\n): Promise<SkeletonState> => {\n const { params, ctx } = input\n\n if (!ctx.suggestionsClient) {\n throw new MethodNotImplementedError('Suggestions agent not available')\n }\n\n return ctx.suggestionsClient.call(\n app.bsky.unspecced.getSuggestedUsersForDiscoverSkeleton,\n {\n limit: params.limit,\n viewer: params.hydrateCtx.viewer ?? undefined,\n },\n {\n headers: params.headers,\n },\n )\n}\n\nconst skeleton = async (input: SkeletonFnInput<Context, Params>) => {\n const useDiscover = input.params.hydrateCtx.features.checkGate(\n input.params.hydrateCtx.features.Gate.SuggestedUsersForDiscoverEnable,\n )\n const skeletonFn = useDiscover\n ? skeletonFromGetSuggestedUsersForDiscoverSkeleton\n : skeletonFromGetSuggestedUsersSkeleton\n return skeletonFn(input)\n}\n\nconst hydration = async (\n input: HydrationFnInput<Context, Params, SkeletonState>,\n) => {\n const { ctx, params, skeleton } = input\n const dids = dedupeStrs(skeleton.dids)\n const pairs: Map<DidString, DidString[]> = new Map()\n const viewer = params.hydrateCtx.viewer\n if (viewer) {\n pairs.set(viewer, dids)\n }\n const [profilesState, bidirectionalBlocks] = await Promise.all([\n ctx.hydrator.hydrateProfiles(dids, params.hydrateCtx),\n ctx.hydrator.hydrateBidirectionalBlocks(pairs, params.hydrateCtx),\n ])\n\n return mergeManyStates(profilesState, { bidirectionalBlocks })\n}\n\nconst noBlocksOrFollows = (\n input: RulesFnInput<Context, Params, SkeletonState>,\n) => {\n const { ctx, skeleton, params, hydration } = input\n const viewer = params.hydrateCtx.viewer\n if (!viewer) {\n return skeleton\n }\n const blocks = hydration.bidirectionalBlocks?.get(viewer)\n return {\n ...skeleton,\n dids: skeleton.dids.filter((did) => {\n const viewer = ctx.views.profileViewer(did, hydration)\n return !blocks?.get(did) && !viewer?.following\n }),\n }\n}\n\nconst presentation = (\n input: PresentationFnInput<Context, Params, SkeletonState>,\n) => {\n const { ctx, skeleton, hydration } = input\n return {\n recIdStr: skeleton.recIdStr,\n actors: mapDefined(skeleton.dids, (did) =>\n ctx.views.profile(did, hydration),\n ),\n }\n}\n\ntype Context = {\n hydrator: Hydrator\n views: Views\n suggestionsClient: Client | undefined\n}\n\ntype Params = app.bsky.unspecced.getSuggestedUsersForDiscover.$Params & {\n hydrateCtx: HydrateCtx & { viewer: string | null }\n headers: Record<string, string>\n}\n\ntype SkeletonState = {\n dids: DidString[]\n recIdStr?: string\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSuggestedUsersForExplore.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/unspecced/getSuggestedUsersForExplore.ts"],"names":[],"mappings":"AAEA,OAAO,EAA6B,MAAM,EAAE,MAAM,sBAAsB,CAAA;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAgBhD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAuCvD"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = default_1;
|
|
4
|
+
const common_1 = require("@atproto/common");
|
|
5
|
+
const xrpc_server_1 = require("@atproto/xrpc-server");
|
|
6
|
+
const hydrator_1 = require("../../../../hydration/hydrator");
|
|
7
|
+
const index_js_1 = require("../../../../lexicons/index.js");
|
|
8
|
+
const pipeline_1 = require("../../../../pipeline");
|
|
9
|
+
function default_1(server, ctx) {
|
|
10
|
+
const getSuggestedUsersForExplore = (0, pipeline_1.createPipeline)(skeleton, hydration, noBlocksOrFollows, presentation);
|
|
11
|
+
server.add(index_js_1.app.bsky.unspecced.getSuggestedUsersForExplore, {
|
|
12
|
+
auth: ctx.authVerifier.standardOptional,
|
|
13
|
+
handler: async ({ auth, params, req }) => {
|
|
14
|
+
const viewer = auth.credentials.iss;
|
|
15
|
+
const labelers = ctx.reqLabelers(req);
|
|
16
|
+
const hydrateCtx = await ctx.hydrator.createContext({
|
|
17
|
+
labelers,
|
|
18
|
+
viewer,
|
|
19
|
+
features: ctx.featureGatesClient.scope(ctx.featureGatesClient.parseUserContextFromHandler({
|
|
20
|
+
viewer,
|
|
21
|
+
req,
|
|
22
|
+
})),
|
|
23
|
+
});
|
|
24
|
+
const headers = (0, common_1.noUndefinedVals)({
|
|
25
|
+
'accept-language': req.headers['accept-language'],
|
|
26
|
+
});
|
|
27
|
+
const result = await getSuggestedUsersForExplore({
|
|
28
|
+
...params,
|
|
29
|
+
hydrateCtx,
|
|
30
|
+
headers,
|
|
31
|
+
}, ctx);
|
|
32
|
+
return {
|
|
33
|
+
encoding: 'application/json',
|
|
34
|
+
body: result,
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
const skeletonFromGetSuggestedUsersSkeleton = async (input) => {
|
|
40
|
+
const { params, ctx } = input;
|
|
41
|
+
if (!ctx.suggestionsClient) {
|
|
42
|
+
throw new xrpc_server_1.MethodNotImplementedError('Suggestions agent not available');
|
|
43
|
+
}
|
|
44
|
+
return ctx.suggestionsClient.call(index_js_1.app.bsky.unspecced.getSuggestedUsersSkeleton, {
|
|
45
|
+
limit: params.limit,
|
|
46
|
+
category: params.category,
|
|
47
|
+
viewer: params.hydrateCtx.viewer ?? undefined,
|
|
48
|
+
}, {
|
|
49
|
+
headers: params.headers,
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
// TODO: rename to `skeleton` once we can fully migrate to the new endpoint
|
|
53
|
+
const skeletonFromGetSuggestedUsersForExploreSkeleton = async (input) => {
|
|
54
|
+
const { params, ctx } = input;
|
|
55
|
+
if (!ctx.suggestionsClient) {
|
|
56
|
+
throw new xrpc_server_1.MethodNotImplementedError('Suggestions agent not available');
|
|
57
|
+
}
|
|
58
|
+
return ctx.suggestionsClient.call(index_js_1.app.bsky.unspecced.getSuggestedUsersForExploreSkeleton, {
|
|
59
|
+
limit: params.limit,
|
|
60
|
+
category: params.category,
|
|
61
|
+
viewer: params.hydrateCtx.viewer ?? undefined,
|
|
62
|
+
}, {
|
|
63
|
+
headers: params.headers,
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
const skeleton = async (input) => {
|
|
67
|
+
const useExplore = input.params.hydrateCtx.features.checkGate(input.params.hydrateCtx.features.Gate.SuggestedUsersForExploreEnable);
|
|
68
|
+
const skeletonFn = useExplore
|
|
69
|
+
? skeletonFromGetSuggestedUsersForExploreSkeleton
|
|
70
|
+
: skeletonFromGetSuggestedUsersSkeleton;
|
|
71
|
+
return skeletonFn(input);
|
|
72
|
+
};
|
|
73
|
+
const hydration = async (input) => {
|
|
74
|
+
const { ctx, params, skeleton } = input;
|
|
75
|
+
const dids = (0, common_1.dedupeStrs)(skeleton.dids);
|
|
76
|
+
const pairs = new Map();
|
|
77
|
+
const viewer = params.hydrateCtx.viewer;
|
|
78
|
+
if (viewer) {
|
|
79
|
+
pairs.set(viewer, dids);
|
|
80
|
+
}
|
|
81
|
+
const [profilesState, bidirectionalBlocks] = await Promise.all([
|
|
82
|
+
ctx.hydrator.hydrateProfiles(dids, params.hydrateCtx),
|
|
83
|
+
ctx.hydrator.hydrateBidirectionalBlocks(pairs, params.hydrateCtx),
|
|
84
|
+
]);
|
|
85
|
+
return (0, hydrator_1.mergeManyStates)(profilesState, { bidirectionalBlocks });
|
|
86
|
+
};
|
|
87
|
+
const noBlocksOrFollows = (input) => {
|
|
88
|
+
const { ctx, skeleton, params, hydration } = input;
|
|
89
|
+
const viewer = params.hydrateCtx.viewer;
|
|
90
|
+
if (!viewer) {
|
|
91
|
+
return skeleton;
|
|
92
|
+
}
|
|
93
|
+
const blocks = hydration.bidirectionalBlocks?.get(viewer);
|
|
94
|
+
return {
|
|
95
|
+
...skeleton,
|
|
96
|
+
dids: skeleton.dids.filter((did) => {
|
|
97
|
+
const viewer = ctx.views.profileViewer(did, hydration);
|
|
98
|
+
return !blocks?.get(did) && !viewer?.following;
|
|
99
|
+
}),
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
const presentation = (input) => {
|
|
103
|
+
const { ctx, skeleton, hydration } = input;
|
|
104
|
+
return {
|
|
105
|
+
recIdStr: skeleton.recIdStr,
|
|
106
|
+
actors: (0, common_1.mapDefined)(skeleton.dids, (did) => ctx.views.profile(did, hydration)),
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
//# sourceMappingURL=getSuggestedUsersForExplore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSuggestedUsersForExplore.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/unspecced/getSuggestedUsersForExplore.ts"],"names":[],"mappings":";;AAmBA,4BAuCC;AA1DD,4CAAyE;AAEzE,sDAAwE;AAExE,6DAIuC;AACvC,4DAAmD;AACnD,mDAM6B;AAG7B,mBAAyB,MAAc,EAAE,GAAe;IACtD,MAAM,2BAA2B,GAAG,IAAA,yBAAc,EAChD,QAAQ,EACR,SAAS,EACT,iBAAiB,EACjB,YAAY,CACb,CAAA;IACD,MAAM,CAAC,GAAG,CAAC,cAAG,CAAC,IAAI,CAAC,SA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tD,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAA;QAChD,CAAC,CAAC;KACH,CAAA;AACH,CAAC,CAAA;AAED,MAAM,YAAY,GAAG,CACnB,KAA0D,EAC1D,EAAE;IACF,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,CAAA;IAC1C,OAAO;QACL,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,MAAM,EAAE,IAAA,mBAAU,EAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CACxC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAClC;KACF,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { dedupeStrs, mapDefined, noUndefinedVals } from '@atproto/common'\nimport { Client, DidString } from '@atproto/lex'\nimport { MethodNotImplementedError, Server } from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context'\nimport {\n HydrateCtx,\n Hydrator,\n mergeManyStates,\n} from '../../../../hydration/hydrator'\nimport { app } from '../../../../lexicons/index.js'\nimport {\n HydrationFnInput,\n PresentationFnInput,\n RulesFnInput,\n SkeletonFnInput,\n createPipeline,\n} from '../../../../pipeline'\nimport { Views } from '../../../../views'\n\nexport default function (server: Server, ctx: AppContext) {\n const getSuggestedUsersForExplore = createPipeline(\n skeleton,\n hydration,\n noBlocksOrFollows,\n presentation,\n )\n server.add(app.bsky.unspecced.getSuggestedUsersForExplore, {\n auth: ctx.authVerifier.standardOptional,\n handler: async ({ auth, params, req }) => {\n const viewer = auth.credentials.iss\n const labelers = ctx.reqLabelers(req)\n const hydrateCtx = await ctx.hydrator.createContext({\n labelers,\n viewer,\n features: ctx.featureGatesClient.scope(\n ctx.featureGatesClient.parseUserContextFromHandler({\n viewer,\n req,\n }),\n ),\n })\n const headers = noUndefinedVals({\n 'accept-language': req.headers['accept-language'],\n })\n const result = await getSuggestedUsersForExplore(\n {\n ...params,\n hydrateCtx,\n headers,\n },\n ctx,\n )\n return {\n encoding: 'application/json',\n body: result,\n }\n },\n })\n}\n\nconst skeletonFromGetSuggestedUsersSkeleton = async (\n input: SkeletonFnInput<Context, Params>,\n): Promise<SkeletonState> => {\n const { params, ctx } = input\n if (!ctx.suggestionsClient) {\n throw new MethodNotImplementedError('Suggestions agent not available')\n }\n\n return ctx.suggestionsClient.call(\n app.bsky.unspecced.getSuggestedUsersSkeleton,\n {\n limit: params.limit,\n category: params.category,\n viewer: params.hydrateCtx.viewer ?? undefined,\n },\n {\n headers: params.headers,\n },\n )\n}\n\n// TODO: rename to `skeleton` once we can fully migrate to the new endpoint\nconst skeletonFromGetSuggestedUsersForExploreSkeleton = async (\n input: SkeletonFnInput<Context, Params>,\n): Promise<SkeletonState> => {\n const { params, ctx } = input\n\n if (!ctx.suggestionsClient) {\n throw new MethodNotImplementedError('Suggestions agent not available')\n }\n\n return ctx.suggestionsClient.call(\n app.bsky.unspecced.getSuggestedUsersForExploreSkeleton,\n {\n limit: params.limit,\n category: params.category,\n viewer: params.hydrateCtx.viewer ?? undefined,\n },\n {\n headers: params.headers,\n },\n )\n}\n\nconst skeleton = async (input: SkeletonFnInput<Context, Params>) => {\n const useExplore = input.params.hydrateCtx.features.checkGate(\n input.params.hydrateCtx.features.Gate.SuggestedUsersForExploreEnable,\n )\n const skeletonFn = useExplore\n ? skeletonFromGetSuggestedUsersForExploreSkeleton\n : skeletonFromGetSuggestedUsersSkeleton\n return skeletonFn(input)\n}\n\nconst hydration = async (\n input: HydrationFnInput<Context, Params, SkeletonState>,\n) => {\n const { ctx, params, skeleton } = input\n const dids = dedupeStrs(skeleton.dids)\n const pairs: Map<DidString, DidString[]> = new Map()\n const viewer = params.hydrateCtx.viewer\n if (viewer) {\n pairs.set(viewer, dids)\n }\n const [profilesState, bidirectionalBlocks] = await Promise.all([\n ctx.hydrator.hydrateProfiles(dids, params.hydrateCtx),\n ctx.hydrator.hydrateBidirectionalBlocks(pairs, params.hydrateCtx),\n ])\n\n return mergeManyStates(profilesState, { bidirectionalBlocks })\n}\n\nconst noBlocksOrFollows = (\n input: RulesFnInput<Context, Params, SkeletonState>,\n) => {\n const { ctx, skeleton, params, hydration } = input\n const viewer = params.hydrateCtx.viewer\n if (!viewer) {\n return skeleton\n }\n const blocks = hydration.bidirectionalBlocks?.get(viewer)\n return {\n ...skeleton,\n dids: skeleton.dids.filter((did) => {\n const viewer = ctx.views.profileViewer(did, hydration)\n return !blocks?.get(did) && !viewer?.following\n }),\n }\n}\n\nconst presentation = (\n input: PresentationFnInput<Context, Params, SkeletonState>,\n) => {\n const { ctx, skeleton, hydration } = input\n return {\n recIdStr: skeleton.recIdStr,\n actors: mapDefined(skeleton.dids, (did) =>\n ctx.views.profile(did, hydration),\n ),\n }\n}\n\ntype Context = {\n hydrator: Hydrator\n views: Views\n suggestionsClient: Client | undefined\n}\n\ntype Params = app.bsky.unspecced.getSuggestedUsersForExplore.$Params & {\n hydrateCtx: HydrateCtx & { viewer: string | null }\n headers: Record<string, string>\n category?: string\n}\n\ntype SkeletonState = {\n dids: DidString[]\n recIdStr?: string\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSuggestedUsersForSeeMore.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/unspecced/getSuggestedUsersForSeeMore.ts"],"names":[],"mappings":"AAEA,OAAO,EAA6B,MAAM,EAAE,MAAM,sBAAsB,CAAA;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAgBhD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAuCvD"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = default_1;
|
|
4
|
+
const common_1 = require("@atproto/common");
|
|
5
|
+
const xrpc_server_1 = require("@atproto/xrpc-server");
|
|
6
|
+
const hydrator_1 = require("../../../../hydration/hydrator");
|
|
7
|
+
const index_js_1 = require("../../../../lexicons/index.js");
|
|
8
|
+
const pipeline_1 = require("../../../../pipeline");
|
|
9
|
+
function default_1(server, ctx) {
|
|
10
|
+
const getSuggestedUsersForSeeMore = (0, pipeline_1.createPipeline)(skeleton, hydration, noBlocksOrFollows, presentation);
|
|
11
|
+
server.add(index_js_1.app.bsky.unspecced.getSuggestedUsersForSeeMore, {
|
|
12
|
+
auth: ctx.authVerifier.standardOptional,
|
|
13
|
+
handler: async ({ auth, params, req }) => {
|
|
14
|
+
const viewer = auth.credentials.iss;
|
|
15
|
+
const labelers = ctx.reqLabelers(req);
|
|
16
|
+
const hydrateCtx = await ctx.hydrator.createContext({
|
|
17
|
+
labelers,
|
|
18
|
+
viewer,
|
|
19
|
+
features: ctx.featureGatesClient.scope(ctx.featureGatesClient.parseUserContextFromHandler({
|
|
20
|
+
viewer,
|
|
21
|
+
req,
|
|
22
|
+
})),
|
|
23
|
+
});
|
|
24
|
+
const headers = (0, common_1.noUndefinedVals)({
|
|
25
|
+
'accept-language': req.headers['accept-language'],
|
|
26
|
+
});
|
|
27
|
+
const result = await getSuggestedUsersForSeeMore({
|
|
28
|
+
...params,
|
|
29
|
+
hydrateCtx,
|
|
30
|
+
headers,
|
|
31
|
+
}, ctx);
|
|
32
|
+
return {
|
|
33
|
+
encoding: 'application/json',
|
|
34
|
+
body: result,
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
const skeletonFromGetSuggestedUsersSkeleton = async (input) => {
|
|
40
|
+
const { params, ctx } = input;
|
|
41
|
+
if (!ctx.suggestionsClient) {
|
|
42
|
+
throw new xrpc_server_1.MethodNotImplementedError('Suggestions agent not available');
|
|
43
|
+
}
|
|
44
|
+
return ctx.suggestionsClient.call(index_js_1.app.bsky.unspecced.getSuggestedUsersSkeleton, {
|
|
45
|
+
limit: params.limit,
|
|
46
|
+
category: params.category,
|
|
47
|
+
viewer: params.hydrateCtx.viewer ?? undefined,
|
|
48
|
+
}, {
|
|
49
|
+
headers: params.headers,
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
// TODO: rename to `skeleton` once we can fully migrate to the new endpoint
|
|
53
|
+
const skeletonFromGetSuggestedUsersForSeeMoreSkeleton = async (input) => {
|
|
54
|
+
const { params, ctx } = input;
|
|
55
|
+
if (!ctx.suggestionsClient) {
|
|
56
|
+
throw new xrpc_server_1.MethodNotImplementedError('Suggestions agent not available');
|
|
57
|
+
}
|
|
58
|
+
return ctx.suggestionsClient.call(index_js_1.app.bsky.unspecced.getSuggestedUsersForSeeMoreSkeleton, {
|
|
59
|
+
limit: params.limit,
|
|
60
|
+
category: params.category,
|
|
61
|
+
viewer: params.hydrateCtx.viewer ?? undefined,
|
|
62
|
+
}, {
|
|
63
|
+
headers: params.headers,
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
const skeleton = async (input) => {
|
|
67
|
+
const useSeeMore = input.params.hydrateCtx.features.checkGate(input.params.hydrateCtx.features.Gate.SuggestedUsersForSeeMoreEnable);
|
|
68
|
+
const skeletonFn = useSeeMore
|
|
69
|
+
? skeletonFromGetSuggestedUsersForSeeMoreSkeleton
|
|
70
|
+
: skeletonFromGetSuggestedUsersSkeleton;
|
|
71
|
+
return skeletonFn(input);
|
|
72
|
+
};
|
|
73
|
+
const hydration = async (input) => {
|
|
74
|
+
const { ctx, params, skeleton } = input;
|
|
75
|
+
const dids = (0, common_1.dedupeStrs)(skeleton.dids);
|
|
76
|
+
const pairs = new Map();
|
|
77
|
+
const viewer = params.hydrateCtx.viewer;
|
|
78
|
+
if (viewer) {
|
|
79
|
+
pairs.set(viewer, dids);
|
|
80
|
+
}
|
|
81
|
+
const [profilesState, bidirectionalBlocks] = await Promise.all([
|
|
82
|
+
ctx.hydrator.hydrateProfiles(dids, params.hydrateCtx),
|
|
83
|
+
ctx.hydrator.hydrateBidirectionalBlocks(pairs, params.hydrateCtx),
|
|
84
|
+
]);
|
|
85
|
+
return (0, hydrator_1.mergeManyStates)(profilesState, { bidirectionalBlocks });
|
|
86
|
+
};
|
|
87
|
+
const noBlocksOrFollows = (input) => {
|
|
88
|
+
const { ctx, skeleton, params, hydration } = input;
|
|
89
|
+
const viewer = params.hydrateCtx.viewer;
|
|
90
|
+
if (!viewer) {
|
|
91
|
+
return skeleton;
|
|
92
|
+
}
|
|
93
|
+
const blocks = hydration.bidirectionalBlocks?.get(viewer);
|
|
94
|
+
return {
|
|
95
|
+
...skeleton,
|
|
96
|
+
dids: skeleton.dids.filter((did) => {
|
|
97
|
+
const viewer = ctx.views.profileViewer(did, hydration);
|
|
98
|
+
return !blocks?.get(did) && !viewer?.following;
|
|
99
|
+
}),
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
const presentation = (input) => {
|
|
103
|
+
const { ctx, skeleton, hydration } = input;
|
|
104
|
+
return {
|
|
105
|
+
recIdStr: skeleton.recIdStr,
|
|
106
|
+
actors: (0, common_1.mapDefined)(skeleton.dids, (did) => ctx.views.profile(did, hydration)),
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
//# sourceMappingURL=getSuggestedUsersForSeeMore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSuggestedUsersForSeeMore.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/unspecced/getSuggestedUsersForSeeMore.ts"],"names":[],"mappings":";;AAmBA,4BAuCC;AA1DD,4CAAyE;AAEzE,sDAAwE;AAExE,6DAIuC;AACvC,4DAAmD;AACnD,mDAM6B;AAG7B,mBAAyB,MAAc,EAAE,GAAe;IACtD,MAAM,2BAA2B,GAAG,IAAA,yBAAc,EAChD,QAAQ,EACR,SAAS,EACT,iBAAiB,EACjB,YAAY,CACb,CAAA;IACD,MAAM,CAAC,GAAG,CAAC,cAAG,CAAC,IAAI,CAAC,SAAS,CAAC,2BAA2B,EAAE;QACzD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AAG,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAA;QAChD,CAAC,CAAC;KACH,CAAA;AACH,CAAC,CAAA;AAED,MAAM,YAAY,GAAG,CACnB,KAA0D,EAC1D,EAAE;IACF,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,CAAA;IAC1C,OAAO;QACL,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,MAAM,EAAE,IAAA,mBAAU,EAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CACxC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAClC;KACF,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { dedupeStrs, mapDefined, noUndefinedVals } from '@atproto/common'\nimport { Client, DidString } from '@atproto/lex'\nimport { MethodNotImplementedError, Server } from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context'\nimport {\n HydrateCtx,\n Hydrator,\n mergeManyStates,\n} from '../../../../hydration/hydrator'\nimport { app } from '../../../../lexicons/index.js'\nimport {\n HydrationFnInput,\n PresentationFnInput,\n RulesFnInput,\n SkeletonFnInput,\n createPipeline,\n} from '../../../../pipeline'\nimport { Views } from '../../../../views'\n\nexport default function (server: Server, ctx: AppContext) {\n const getSuggestedUsersForSeeMore = createPipeline(\n skeleton,\n hydration,\n noBlocksOrFollows,\n presentation,\n )\n server.add(app.bsky.unspecced.getSuggestedUsersForSeeMore, {\n auth: ctx.authVerifier.standardOptional,\n handler: async ({ auth, params, req }) => {\n const viewer = auth.credentials.iss\n const labelers = ctx.reqLabelers(req)\n const hydrateCtx = await ctx.hydrator.createContext({\n labelers,\n viewer,\n features: ctx.featureGatesClient.scope(\n ctx.featureGatesClient.parseUserContextFromHandler({\n viewer,\n req,\n }),\n ),\n })\n const headers = noUndefinedVals({\n 'accept-language': req.headers['accept-language'],\n })\n const result = await getSuggestedUsersForSeeMore(\n {\n ...params,\n hydrateCtx,\n headers,\n },\n ctx,\n )\n return {\n encoding: 'application/json',\n body: result,\n }\n },\n })\n}\n\nconst skeletonFromGetSuggestedUsersSkeleton = async (\n input: SkeletonFnInput<Context, Params>,\n): Promise<SkeletonState> => {\n const { params, ctx } = input\n if (!ctx.suggestionsClient) {\n throw new MethodNotImplementedError('Suggestions agent not available')\n }\n\n return ctx.suggestionsClient.call(\n app.bsky.unspecced.getSuggestedUsersSkeleton,\n {\n limit: params.limit,\n category: params.category,\n viewer: params.hydrateCtx.viewer ?? undefined,\n },\n {\n headers: params.headers,\n },\n )\n}\n\n// TODO: rename to `skeleton` once we can fully migrate to the new endpoint\nconst skeletonFromGetSuggestedUsersForSeeMoreSkeleton = async (\n input: SkeletonFnInput<Context, Params>,\n): Promise<SkeletonState> => {\n const { params, ctx } = input\n\n if (!ctx.suggestionsClient) {\n throw new MethodNotImplementedError('Suggestions agent not available')\n }\n\n return ctx.suggestionsClient.call(\n app.bsky.unspecced.getSuggestedUsersForSeeMoreSkeleton,\n {\n limit: params.limit,\n category: params.category,\n viewer: params.hydrateCtx.viewer ?? undefined,\n },\n {\n headers: params.headers,\n },\n )\n}\n\nconst skeleton = async (input: SkeletonFnInput<Context, Params>) => {\n const useSeeMore = input.params.hydrateCtx.features.checkGate(\n input.params.hydrateCtx.features.Gate.SuggestedUsersForSeeMoreEnable,\n )\n const skeletonFn = useSeeMore\n ? skeletonFromGetSuggestedUsersForSeeMoreSkeleton\n : skeletonFromGetSuggestedUsersSkeleton\n return skeletonFn(input)\n}\n\nconst hydration = async (\n input: HydrationFnInput<Context, Params, SkeletonState>,\n) => {\n const { ctx, params, skeleton } = input\n const dids = dedupeStrs(skeleton.dids)\n const pairs: Map<DidString, DidString[]> = new Map()\n const viewer = params.hydrateCtx.viewer\n if (viewer) {\n pairs.set(viewer, dids)\n }\n const [profilesState, bidirectionalBlocks] = await Promise.all([\n ctx.hydrator.hydrateProfiles(dids, params.hydrateCtx),\n ctx.hydrator.hydrateBidirectionalBlocks(pairs, params.hydrateCtx),\n ])\n\n return mergeManyStates(profilesState, { bidirectionalBlocks })\n}\n\nconst noBlocksOrFollows = (\n input: RulesFnInput<Context, Params, SkeletonState>,\n) => {\n const { ctx, skeleton, params, hydration } = input\n const viewer = params.hydrateCtx.viewer\n if (!viewer) {\n return skeleton\n }\n const blocks = hydration.bidirectionalBlocks?.get(viewer)\n return {\n ...skeleton,\n dids: skeleton.dids.filter((did) => {\n const viewer = ctx.views.profileViewer(did, hydration)\n return !blocks?.get(did) && !viewer?.following\n }),\n }\n}\n\nconst presentation = (\n input: PresentationFnInput<Context, Params, SkeletonState>,\n) => {\n const { ctx, skeleton, hydration } = input\n return {\n recIdStr: skeleton.recIdStr,\n actors: mapDefined(skeleton.dids, (did) =>\n ctx.views.profile(did, hydration),\n ),\n }\n}\n\ntype Context = {\n hydrator: Hydrator\n views: Views\n suggestionsClient: Client | undefined\n}\n\ntype Params = app.bsky.unspecced.getSuggestedUsersForSeeMore.$Params & {\n hydrateCtx: HydrateCtx & { viewer: string | null }\n headers: Record<string, string>\n category?: string\n}\n\ntype SkeletonState = {\n dids: DidString[]\n recIdStr?: string\n}\n"]}
|
package/dist/api/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAkGvC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA;AAElC,OAAO,KAAK,SAAS,MAAM,cAAc,CAAA;AAEzC,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAA;AAE/C,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAA;AAEtC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAA;AAEpC,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAmGvD"}
|
package/dist/api/index.js
CHANGED
|
@@ -120,6 +120,9 @@ const getSuggestedFeeds_2 = __importDefault(require("./app/bsky/unspecced/getSug
|
|
|
120
120
|
const getSuggestedOnboardingUsers_1 = __importDefault(require("./app/bsky/unspecced/getSuggestedOnboardingUsers"));
|
|
121
121
|
const getSuggestedStarterPacks_1 = __importDefault(require("./app/bsky/unspecced/getSuggestedStarterPacks"));
|
|
122
122
|
const getSuggestedUsers_1 = __importDefault(require("./app/bsky/unspecced/getSuggestedUsers"));
|
|
123
|
+
const getSuggestedUsersForDiscover_1 = __importDefault(require("./app/bsky/unspecced/getSuggestedUsersForDiscover"));
|
|
124
|
+
const getSuggestedUsersForExplore_1 = __importDefault(require("./app/bsky/unspecced/getSuggestedUsersForExplore"));
|
|
125
|
+
const getSuggestedUsersForSeeMore_1 = __importDefault(require("./app/bsky/unspecced/getSuggestedUsersForSeeMore"));
|
|
123
126
|
const getTaggedSuggestions_1 = __importDefault(require("./app/bsky/unspecced/getTaggedSuggestions"));
|
|
124
127
|
const getTrendingTopics_1 = __importDefault(require("./app/bsky/unspecced/getTrendingTopics"));
|
|
125
128
|
const getTrends_1 = __importDefault(require("./app/bsky/unspecced/getTrends"));
|
|
@@ -201,6 +204,9 @@ function default_1(server, ctx) {
|
|
|
201
204
|
(0, getSuggestedOnboardingUsers_1.default)(server, ctx);
|
|
202
205
|
(0, getSuggestedStarterPacks_1.default)(server, ctx);
|
|
203
206
|
(0, getSuggestedUsers_1.default)(server, ctx);
|
|
207
|
+
(0, getSuggestedUsersForDiscover_1.default)(server, ctx);
|
|
208
|
+
(0, getSuggestedUsersForExplore_1.default)(server, ctx);
|
|
209
|
+
(0, getSuggestedUsersForSeeMore_1.default)(server, ctx);
|
|
204
210
|
(0, getSuggestedFeeds_2.default)(server, ctx);
|
|
205
211
|
(0, getServices_1.default)(server, ctx);
|
|
206
212
|
(0, searchActors_1.default)(server, ctx);
|
package/dist/api/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0GA,4BAgGC;AAxMD,6EAAoD;AACpD,+EAAsD;AACtD,qFAA4D;AAC5D,iFAAwD;AACxD,mGAA0E;AAC1E,0EAAmD;AACnD,kFAA2D;AAC3D,gFAAyD;AACzD,wFAA+D;AAC/D,wFAA+D;AAC/D,oFAA2D;AAC3D,mFAA0D;AAC1D,+EAAsD;AACtD,qFAA4D;AAC5D,uFAA8D;AAC9D,+EAAsD;AACtD,2FAAkE;AAClE,uGAA8E;AAC9E,iFAAwD;AACxD,+EAAsD;AACtD,+EAAsD;AACtD,2EAAkD;AAClD,+EAAsD;AACtD,kFAAyD;AACzD,kFAAyD;AACzD,kFAAyD;AACzD,sEAA6C;AAC7C,wFAA+D;AAC/D,0FAAiE;AACjE,wEAA+C;AAC/C,8EAAqD;AACrD,kFAAyD;AACzD,wEAA+C;AAC/C,0EAAiD;AACjD,kFAAyD;AACzD,0FAAiE;AACjE,8EAAqD;AACrD,8EAAqD;AACrD,iGAAwE;AACxE,2EAAkD;AAClD,iFAAwD;AACxD,6EAAoD;AACpD,2FAAkE;AAClE,uEAA8C;AAC9C,mFAA0D;AAC1D,iFAAwD;AACxD,yEAAgD;AAChD,qGAA4E;AAC5E,yEAAgD;AAChD,yFAAgE;AAChE,qFAA4D;AAC5D,uFAA8D;AAC9D,mHAA0F;AAC1F,6GAAoF;AACpF,2EAAkD;AAClD,mFAA0D;AAC1D,6EAAoD;AACpD,6FAAoE;AACpE,+EAAsD;AACtD,uFAA8D;AAC9D,iFA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AAA;IACzB,IAAA,wBAAc,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,IAAA,mBAAS,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACtB,IAAA,kCAAwB,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACrC,IAAA,8BAAoB,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACjC,IAAA,8BAAoB,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACjC,IAAA,0BAAgB,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC7B,IAAA,mBAAW,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACxB,IAAA,kBAAU,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACvB,IAAA,eAAO,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACpB,cAAc;IACd,IAAA,0BAAgB,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC7B,IAAA,6BAAmB,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAChC,IAAA,yBAAe,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC5B,IAAA,uBAAa,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC1B,IAAA,mBAAS,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACtB,IAAA,qBAAW,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACxB,IAAA,qBAAW,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAC1B,CAAC","sourcesContent":["import { Server } from '@atproto/xrpc-server'\nimport { AppContext } from '../context'\nimport getProfile from './app/bsky/actor/getProfile'\nimport getProfiles from './app/bsky/actor/getProfiles'\nimport getSuggestions from './app/bsky/actor/getSuggestions'\nimport searchActors from './app/bsky/actor/searchActors'\nimport searchActorsTypeahead from './app/bsky/actor/searchActorsTypeahead'\nimport aaBegin from './app/bsky/ageassurance/begin'\nimport aaGetConfig from './app/bsky/ageassurance/getConfig'\nimport aaGetState from './app/bsky/ageassurance/getState'\nimport createBookmark from './app/bsky/bookmark/createBookmark'\nimport deleteBookmark from './app/bsky/bookmark/deleteBookmark'\nimport getBookmarks from './app/bsky/bookmark/getBookmarks'\nimport dismissMatch from './app/bsky/contact/dismissMatch'\nimport getMatches from './app/bsky/contact/getMatches'\nimport getSyncStatus from './app/bsky/contact/getSyncStatus'\nimport importContacts from './app/bsky/contact/importContacts'\nimport removeData from './app/bsky/contact/removeData'\nimport sendNotification from './app/bsky/contact/sendNotification'\nimport startPhoneVerification from './app/bsky/contact/startPhoneVerification'\nimport verifyPhone from './app/bsky/contact/verifyPhone'\nimport createDraft from './app/bsky/draft/createDraft'\nimport deleteDraft from './app/bsky/draft/deleteDraft'\nimport getDrafts from './app/bsky/draft/getDrafts'\nimport updateDraft from './app/bsky/draft/updateDraft'\nimport getActorFeeds from './app/bsky/feed/getActorFeeds'\nimport getActorLikes from './app/bsky/feed/getActorLikes'\nimport getAuthorFeed from './app/bsky/feed/getAuthorFeed'\nimport getFeed from './app/bsky/feed/getFeed'\nimport getFeedGenerator from './app/bsky/feed/getFeedGenerator'\nimport getFeedGenerators from './app/bsky/feed/getFeedGenerators'\nimport getLikes from './app/bsky/feed/getLikes'\nimport getListFeed from './app/bsky/feed/getListFeed'\nimport getPostThread from './app/bsky/feed/getPostThread'\nimport getPosts from './app/bsky/feed/getPosts'\nimport getQuotes from './app/bsky/feed/getQuotes'\nimport getRepostedBy from './app/bsky/feed/getRepostedBy'\nimport getSuggestedFeeds from './app/bsky/feed/getSuggestedFeeds'\nimport getTimeline from './app/bsky/feed/getTimeline'\nimport searchPosts from './app/bsky/feed/searchPosts'\nimport getActorStarterPacks from './app/bsky/graph/getActorStarterPacks'\nimport getBlocks from './app/bsky/graph/getBlocks'\nimport getFollowers from './app/bsky/graph/getFollowers'\nimport getFollows from './app/bsky/graph/getFollows'\nimport getKnownFollowers from './app/bsky/graph/getKnownFollowers'\nimport getList from './app/bsky/graph/getList'\nimport getListBlocks from './app/bsky/graph/getListBlocks'\nimport getListMutes from './app/bsky/graph/getListMutes'\nimport getLists from './app/bsky/graph/getLists'\nimport getListsWithMembership from './app/bsky/graph/getListsWithMembership'\nimport getMutes from './app/bsky/graph/getMutes'\nimport getRelationships from './app/bsky/graph/getRelationships'\nimport getStarterPack from './app/bsky/graph/getStarterPack'\nimport getStarterPacks from './app/bsky/graph/getStarterPacks'\nimport getStarterPacksWithMembership from './app/bsky/graph/getStarterPacksWithMembership'\nimport getSuggestedFollowsByActor from './app/bsky/graph/getSuggestedFollowsByActor'\nimport muteActor from './app/bsky/graph/muteActor'\nimport muteActorList from './app/bsky/graph/muteActorList'\nimport muteThread from './app/bsky/graph/muteThread'\nimport searchStarterPacks from './app/bsky/graph/searchStarterPacks'\nimport unmuteActor from './app/bsky/graph/unmuteActor'\nimport unmuteActorList from './app/bsky/graph/unmuteActorList'\nimport unmuteThread from './app/bsky/graph/unmuteThread'\nimport getLabelerServices from './app/bsky/labeler/getServices'\nimport getPreferences from './app/bsky/notification/getPreferences'\nimport getUnreadCount from './app/bsky/notification/getUnreadCount'\nimport listActivitySubscriptions from './app/bsky/notification/listActivitySubscriptions'\nimport listNotifications from './app/bsky/notification/listNotifications'\nimport putActivitySubscription from './app/bsky/notification/putActivitySubscription'\nimport putPreferences from './app/bsky/notification/putPreferences'\nimport putPreferencesV2 from './app/bsky/notification/putPreferencesV2'\nimport registerPush from './app/bsky/notification/registerPush'\nimport unregisterPush from './app/bsky/notification/unregisterPush'\nimport updateSeen from './app/bsky/notification/updateSeen'\nimport getAgeAssuranceState from './app/bsky/unspecced/getAgeAssuranceState'\nimport getConfig from './app/bsky/unspecced/getConfig'\nimport getOnboardingSuggestedStarterPacks from './app/bsky/unspecced/getOnboardingSuggestedStarterPacks'\nimport getPopularFeedGenerators from './app/bsky/unspecced/getPopularFeedGenerators'\nimport getPostThreadOtherV2 from './app/bsky/unspecced/getPostThreadOtherV2'\nimport getPostThreadV2 from './app/bsky/unspecced/getPostThreadV2'\nimport getUnspeccedSuggestedFeeds from './app/bsky/unspecced/getSuggestedFeeds'\nimport getSuggestedOnboardingUsers from './app/bsky/unspecced/getSuggestedOnboardingUsers'\nimport getSuggestedStarterPacks from './app/bsky/unspecced/getSuggestedStarterPacks'\nimport getSuggestedUsers from './app/bsky/unspecced/getSuggestedUsers'\nimport getTaggedSuggestions from './app/bsky/unspecced/getTaggedSuggestions'\nimport getTrendingTopics from './app/bsky/unspecced/getTrendingTopics'\nimport getTrends from './app/bsky/unspecced/getTrends'\nimport initAgeAssurance from './app/bsky/unspecced/initAgeAssurance'\nimport getAccountInfos from './com/atproto/admin/getAccountInfos'\nimport getSubjectStatus from './com/atproto/admin/getSubjectStatus'\nimport updateSubjectStatus from './com/atproto/admin/updateSubjectStatus'\nimport resolveHandle from './com/atproto/identity/resolveHandle'\nimport queryLabels from './com/atproto/label/queryLabels'\nimport getRecord from './com/atproto/repo/getRecord'\nimport fetchLabels from './com/atproto/temp/fetchLabels'\n\nexport * as health from './health'\n\nexport * as wellKnown from './well-known'\n\nexport * as blobResolver from './blob-resolver'\n\nexport * as external from './external'\n\nexport * as sitemap from './sitemap'\n\nexport default function (server: Server, ctx: AppContext) {\n // app.bsky\n getTimeline(server, ctx)\n createBookmark(server, ctx)\n deleteBookmark(server, ctx)\n getBookmarks(server, ctx)\n createDraft(server, ctx)\n deleteDraft(server, ctx)\n getDrafts(server, ctx)\n updateDraft(server, ctx)\n dismissMatch(server, ctx)\n getMatches(server, ctx)\n getSyncStatus(server, ctx)\n importContacts(server, ctx)\n removeData(server, ctx)\n sendNotification(server, ctx)\n startPhoneVerification(server, ctx)\n verifyPhone(server, ctx)\n getActorFeeds(server, ctx)\n getSuggestedFeeds(server, ctx)\n getAuthorFeed(server, ctx)\n getFeed(server, ctx)\n getFeedGenerator(server, ctx)\n getFeedGenerators(server, ctx)\n getLikes(server, ctx)\n getListFeed(server, ctx)\n getQuotes(server, ctx)\n getPostThread(server, ctx)\n getPostThreadOtherV2(server, ctx)\n getPostThreadV2(server, ctx)\n getPosts(server, ctx)\n searchPosts(server, ctx)\n getActorLikes(server, ctx)\n getProfile(server, ctx)\n getProfiles(server, ctx)\n getRepostedBy(server, ctx)\n getActorStarterPacks(server, ctx)\n getBlocks(server, ctx)\n getListBlocks(server, ctx)\n getFollowers(server, ctx)\n getKnownFollowers(server, ctx)\n getFollows(server, ctx)\n getList(server, ctx)\n getLists(server, ctx)\n getListsWithMembership(server, ctx)\n getListMutes(server, ctx)\n getMutes(server, ctx)\n getRelationships(server, ctx)\n getStarterPack(server, ctx)\n getStarterPacks(server, ctx)\n getStarterPacksWithMembership(server, ctx)\n searchStarterPacks(server, ctx)\n muteActor(server, ctx)\n unmuteActor(server, ctx)\n muteActorList(server, ctx)\n unmuteActorList(server, ctx)\n muteThread(server, ctx)\n unmuteThread(server, ctx)\n getSuggestedFollowsByActor(server, ctx)\n getTrendingTopics(server, ctx)\n getTrends(server, ctx)\n getOnboardingSuggestedStarterPacks(server, ctx)\n getSuggestedOnboardingUsers(server, ctx)\n getSuggestedStarterPacks(server, ctx)\n getSuggestedUsers(server, ctx)\n getUnspeccedSuggestedFeeds(server, ctx)\n getLabelerServices(server, ctx)\n searchActors(server, ctx)\n searchActorsTypeahead(server, ctx)\n getSuggestions(server, ctx)\n getPreferences(server, ctx)\n getUnreadCount(server, ctx)\n listActivitySubscriptions(server, ctx)\n listNotifications(server, ctx)\n putActivitySubscription(server, ctx)\n updateSeen(server, ctx)\n putPreferences(server, ctx)\n putPreferencesV2(server, ctx)\n registerPush(server, ctx)\n unregisterPush(server, ctx)\n getConfig(server, ctx)\n getPopularFeedGenerators(server, ctx)\n getTaggedSuggestions(server, ctx)\n getAgeAssuranceState(server, ctx)\n initAgeAssurance(server, ctx)\n aaGetConfig(server, ctx)\n aaGetState(server, ctx)\n aaBegin(server, ctx)\n // com.atproto\n getSubjectStatus(server, ctx)\n updateSubjectStatus(server, ctx)\n getAccountInfos(server, ctx)\n resolveHandle(server, ctx)\n getRecord(server, ctx)\n fetchLabels(server, ctx)\n queryLabels(server, ctx)\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6GA,4BAmGC;AA9MD,6EAAoD;AACpD,+EAAsD;AACtD,qFAA4D;AAC5D,iFAAwD;AACxD,mGAA0E;AAC1E,0EAAmD;AACnD,kFAA2D;AAC3D,gFAAyD;AACzD,wFAA+D;AAC/D,wFAA+D;AAC/D,oFAA2D;AAC3D,mFAA0D;AAC1D,+EAAsD;AACtD,qFAA4D;AAC5D,uFAA8D;AAC9D,+EAAsD;AACtD,2FAAkE;AAClE,uGAA8E;AAC9E,iFAAwD;AACxD,+EAAsD;AACtD,+EAAsD;AACtD,2EAAkD;AAClD,+EAAsD;AACtD,kFAAyD;AACzD,kFAAyD;AACzD,kFAAyD;AACzD,sEAA6C;AAC7C,wFAA+D;AAC/D,0FAAiE;AACjE,wEAA+C;AAC/C,8EAAqD;AACrD,kFAAyD;AACzD,wEAA+C;AAC/C,0EAAiD;AACjD,kFAAyD;AACzD,0FAAiE;AACjE,8EAAqD;AACrD,8EAAqD;AACrD,iGAAwE;AACxE,2EAAkD;AAClD,iFAAwD;AACxD,6EAAoD;AACpD,2FAAkE;AAClE,uEAA8C;AAC9C,mFAA0D;AAC1D,iFAAwD;AACxD,yEAAgD;AAChD,qGAA4E;AAC5E,yEAAgD;AAChD,yFAAgE;AAChE,qFAA4D;AAC5D,uFAA8D;AAC9D,mHAA0F;AAC1F,6GAAoF;AACpF,2EAAkD;AAClD,mFAA0D;AAC1D,6EAAoD;AACpD,6FAAoE;AACpE,+EAAsD;AACtD,uFAA8D;AAC9D,iFAAwD;AACxD,iFAA+D;AAC/D,4FAAmE;AACnE,4FAAmE;AACnE,kHAAyF;AACzF,kGAAyE;AACzE,8GAAqF;AACrF,4FAAmE;AACnE,gGAAuE;AACvE,wFAA+D;AAC/D,4FAAmE;AACnE,o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CAAA;IAC7B,IAAA,sBAAY,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACzB,IAAA,wBAAc,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,IAAA,mBAAS,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACtB,IAAA,kCAAwB,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACrC,IAAA,8BAAoB,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACjC,IAAA,8BAAoB,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACjC,IAAA,0BAAgB,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC7B,IAAA,mBAAW,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACxB,IAAA,kBAAU,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACvB,IAAA,eAAO,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACpB,cAAc;IACd,IAAA,0BAAgB,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC7B,IAAA,6BAAmB,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAChC,IAAA,yBAAe,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC5B,IAAA,uBAAa,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC1B,IAAA,mBAAS,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACtB,IAAA,qBAAW,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACxB,IAAA,qBAAW,EAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAC1B,CAAC","sourcesContent":["import { Server } from '@atproto/xrpc-server'\nimport { AppContext } from '../context'\nimport getProfile from './app/bsky/actor/getProfile'\nimport getProfiles from './app/bsky/actor/getProfiles'\nimport getSuggestions from './app/bsky/actor/getSuggestions'\nimport searchActors from './app/bsky/actor/searchActors'\nimport searchActorsTypeahead from './app/bsky/actor/searchActorsTypeahead'\nimport aaBegin from './app/bsky/ageassurance/begin'\nimport aaGetConfig from './app/bsky/ageassurance/getConfig'\nimport aaGetState from './app/bsky/ageassurance/getState'\nimport createBookmark from './app/bsky/bookmark/createBookmark'\nimport deleteBookmark from './app/bsky/bookmark/deleteBookmark'\nimport getBookmarks from './app/bsky/bookmark/getBookmarks'\nimport dismissMatch from './app/bsky/contact/dismissMatch'\nimport getMatches from './app/bsky/contact/getMatches'\nimport getSyncStatus from './app/bsky/contact/getSyncStatus'\nimport importContacts from './app/bsky/contact/importContacts'\nimport removeData from './app/bsky/contact/removeData'\nimport sendNotification from './app/bsky/contact/sendNotification'\nimport startPhoneVerification from './app/bsky/contact/startPhoneVerification'\nimport verifyPhone from './app/bsky/contact/verifyPhone'\nimport createDraft from './app/bsky/draft/createDraft'\nimport deleteDraft from './app/bsky/draft/deleteDraft'\nimport getDrafts from './app/bsky/draft/getDrafts'\nimport updateDraft from './app/bsky/draft/updateDraft'\nimport getActorFeeds from './app/bsky/feed/getActorFeeds'\nimport getActorLikes from './app/bsky/feed/getActorLikes'\nimport getAuthorFeed from './app/bsky/feed/getAuthorFeed'\nimport getFeed from './app/bsky/feed/getFeed'\nimport getFeedGenerator from './app/bsky/feed/getFeedGenerator'\nimport getFeedGenerators from './app/bsky/feed/getFeedGenerators'\nimport getLikes from './app/bsky/feed/getLikes'\nimport getListFeed from './app/bsky/feed/getListFeed'\nimport getPostThread from './app/bsky/feed/getPostThread'\nimport getPosts from './app/bsky/feed/getPosts'\nimport getQuotes from './app/bsky/feed/getQuotes'\nimport getRepostedBy from './app/bsky/feed/getRepostedBy'\nimport getSuggestedFeeds from './app/bsky/feed/getSuggestedFeeds'\nimport getTimeline from './app/bsky/feed/getTimeline'\nimport searchPosts from './app/bsky/feed/searchPosts'\nimport getActorStarterPacks from './app/bsky/graph/getActorStarterPacks'\nimport getBlocks from './app/bsky/graph/getBlocks'\nimport getFollowers from './app/bsky/graph/getFollowers'\nimport getFollows from './app/bsky/graph/getFollows'\nimport getKnownFollowers from './app/bsky/graph/getKnownFollowers'\nimport getList from './app/bsky/graph/getList'\nimport getListBlocks from './app/bsky/graph/getListBlocks'\nimport getListMutes from './app/bsky/graph/getListMutes'\nimport getLists from './app/bsky/graph/getLists'\nimport getListsWithMembership from './app/bsky/graph/getListsWithMembership'\nimport getMutes from './app/bsky/graph/getMutes'\nimport getRelationships from './app/bsky/graph/getRelationships'\nimport getStarterPack from './app/bsky/graph/getStarterPack'\nimport getStarterPacks from './app/bsky/graph/getStarterPacks'\nimport getStarterPacksWithMembership from './app/bsky/graph/getStarterPacksWithMembership'\nimport getSuggestedFollowsByActor from './app/bsky/graph/getSuggestedFollowsByActor'\nimport muteActor from './app/bsky/graph/muteActor'\nimport muteActorList from './app/bsky/graph/muteActorList'\nimport muteThread from './app/bsky/graph/muteThread'\nimport searchStarterPacks from './app/bsky/graph/searchStarterPacks'\nimport unmuteActor from './app/bsky/graph/unmuteActor'\nimport unmuteActorList from './app/bsky/graph/unmuteActorList'\nimport unmuteThread from './app/bsky/graph/unmuteThread'\nimport getLabelerServices from './app/bsky/labeler/getServices'\nimport getPreferences from './app/bsky/notification/getPreferences'\nimport getUnreadCount from './app/bsky/notification/getUnreadCount'\nimport listActivitySubscriptions from './app/bsky/notification/listActivitySubscriptions'\nimport listNotifications from './app/bsky/notification/listNotifications'\nimport putActivitySubscription from './app/bsky/notification/putActivitySubscription'\nimport putPreferences from './app/bsky/notification/putPreferences'\nimport putPreferencesV2 from './app/bsky/notification/putPreferencesV2'\nimport registerPush from './app/bsky/notification/registerPush'\nimport unregisterPush from './app/bsky/notification/unregisterPush'\nimport updateSeen from './app/bsky/notification/updateSeen'\nimport getAgeAssuranceState from './app/bsky/unspecced/getAgeAssuranceState'\nimport getConfig from './app/bsky/unspecced/getConfig'\nimport getOnboardingSuggestedStarterPacks from './app/bsky/unspecced/getOnboardingSuggestedStarterPacks'\nimport getPopularFeedGenerators from './app/bsky/unspecced/getPopularFeedGenerators'\nimport getPostThreadOtherV2 from './app/bsky/unspecced/getPostThreadOtherV2'\nimport getPostThreadV2 from './app/bsky/unspecced/getPostThreadV2'\nimport getUnspeccedSuggestedFeeds from './app/bsky/unspecced/getSuggestedFeeds'\nimport getSuggestedOnboardingUsers from './app/bsky/unspecced/getSuggestedOnboardingUsers'\nimport getSuggestedStarterPacks from './app/bsky/unspecced/getSuggestedStarterPacks'\nimport getSuggestedUsers from './app/bsky/unspecced/getSuggestedUsers'\nimport getSuggestedUsersForDiscover from './app/bsky/unspecced/getSuggestedUsersForDiscover'\nimport getSuggestedUsersForExplore from './app/bsky/unspecced/getSuggestedUsersForExplore'\nimport getSuggestedUsersForSeeMore from './app/bsky/unspecced/getSuggestedUsersForSeeMore'\nimport getTaggedSuggestions from './app/bsky/unspecced/getTaggedSuggestions'\nimport getTrendingTopics from './app/bsky/unspecced/getTrendingTopics'\nimport getTrends from './app/bsky/unspecced/getTrends'\nimport initAgeAssurance from './app/bsky/unspecced/initAgeAssurance'\nimport getAccountInfos from './com/atproto/admin/getAccountInfos'\nimport getSubjectStatus from './com/atproto/admin/getSubjectStatus'\nimport updateSubjectStatus from './com/atproto/admin/updateSubjectStatus'\nimport resolveHandle from './com/atproto/identity/resolveHandle'\nimport queryLabels from './com/atproto/label/queryLabels'\nimport getRecord from './com/atproto/repo/getRecord'\nimport fetchLabels from './com/atproto/temp/fetchLabels'\n\nexport * as health from './health'\n\nexport * as wellKnown from './well-known'\n\nexport * as blobResolver from './blob-resolver'\n\nexport * as external from './external'\n\nexport * as sitemap from './sitemap'\n\nexport default function (server: Server, ctx: AppContext) {\n // app.bsky\n getTimeline(server, ctx)\n createBookmark(server, ctx)\n deleteBookmark(server, ctx)\n getBookmarks(server, ctx)\n createDraft(server, ctx)\n deleteDraft(server, ctx)\n getDrafts(server, ctx)\n updateDraft(server, ctx)\n dismissMatch(server, ctx)\n getMatches(server, ctx)\n getSyncStatus(server, ctx)\n importContacts(server, ctx)\n removeData(server, ctx)\n sendNotification(server, ctx)\n startPhoneVerification(server, ctx)\n verifyPhone(server, ctx)\n getActorFeeds(server, ctx)\n getSuggestedFeeds(server, ctx)\n getAuthorFeed(server, ctx)\n getFeed(server, ctx)\n getFeedGenerator(server, ctx)\n getFeedGenerators(server, ctx)\n getLikes(server, ctx)\n getListFeed(server, ctx)\n getQuotes(server, ctx)\n getPostThread(server, ctx)\n getPostThreadOtherV2(server, ctx)\n getPostThreadV2(server, ctx)\n getPosts(server, ctx)\n searchPosts(server, ctx)\n getActorLikes(server, ctx)\n getProfile(server, ctx)\n getProfiles(server, ctx)\n getRepostedBy(server, ctx)\n getActorStarterPacks(server, ctx)\n getBlocks(server, ctx)\n getListBlocks(server, ctx)\n getFollowers(server, ctx)\n getKnownFollowers(server, ctx)\n getFollows(server, ctx)\n getList(server, ctx)\n getLists(server, ctx)\n getListsWithMembership(server, ctx)\n getListMutes(server, ctx)\n getMutes(server, ctx)\n getRelationships(server, ctx)\n getStarterPack(server, ctx)\n getStarterPacks(server, ctx)\n getStarterPacksWithMembership(server, ctx)\n searchStarterPacks(server, ctx)\n muteActor(server, ctx)\n unmuteActor(server, ctx)\n muteActorList(server, ctx)\n unmuteActorList(server, ctx)\n muteThread(server, ctx)\n unmuteThread(server, ctx)\n getSuggestedFollowsByActor(server, ctx)\n getTrendingTopics(server, ctx)\n getTrends(server, ctx)\n getOnboardingSuggestedStarterPacks(server, ctx)\n getSuggestedOnboardingUsers(server, ctx)\n getSuggestedStarterPacks(server, ctx)\n getSuggestedUsers(server, ctx)\n getSuggestedUsersForDiscover(server, ctx)\n getSuggestedUsersForExplore(server, ctx)\n getSuggestedUsersForSeeMore(server, ctx)\n getUnspeccedSuggestedFeeds(server, ctx)\n getLabelerServices(server, ctx)\n searchActors(server, ctx)\n searchActorsTypeahead(server, ctx)\n getSuggestions(server, ctx)\n getPreferences(server, ctx)\n getUnreadCount(server, ctx)\n listActivitySubscriptions(server, ctx)\n listNotifications(server, ctx)\n putActivitySubscription(server, ctx)\n updateSeen(server, ctx)\n putPreferences(server, ctx)\n putPreferencesV2(server, ctx)\n registerPush(server, ctx)\n unregisterPush(server, ctx)\n getConfig(server, ctx)\n getPopularFeedGenerators(server, ctx)\n getTaggedSuggestions(server, ctx)\n getAgeAssuranceState(server, ctx)\n initAgeAssurance(server, ctx)\n aaGetConfig(server, ctx)\n aaGetState(server, ctx)\n aaBegin(server, ctx)\n // com.atproto\n getSubjectStatus(server, ctx)\n updateSubjectStatus(server, ctx)\n getAccountInfos(server, ctx)\n resolveHandle(server, ctx)\n getRecord(server, ctx)\n fetchLabels(server, ctx)\n queryLabels(server, ctx)\n}\n"]}
|