@atproto/bsky 0.0.224 → 0.0.226
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 +34 -0
- package/dist/api/app/bsky/actor/getProfile.d.ts.map +1 -1
- package/dist/api/app/bsky/actor/getProfile.js +2 -1
- package/dist/api/app/bsky/actor/getProfile.js.map +1 -1
- package/dist/api/app/bsky/actor/getProfiles.d.ts.map +1 -1
- package/dist/api/app/bsky/actor/getProfiles.js +2 -1
- package/dist/api/app/bsky/actor/getProfiles.js.map +1 -1
- package/dist/api/app/bsky/actor/searchActors.d.ts.map +1 -1
- package/dist/api/app/bsky/actor/searchActors.js +2 -1
- package/dist/api/app/bsky/actor/searchActors.js.map +1 -1
- package/dist/api/app/bsky/bookmark/getBookmarks.d.ts.map +1 -1
- package/dist/api/app/bsky/bookmark/getBookmarks.js +1 -1
- package/dist/api/app/bsky/bookmark/getBookmarks.js.map +1 -1
- package/dist/api/app/bsky/contact/getMatches.d.ts.map +1 -1
- package/dist/api/app/bsky/contact/getMatches.js +1 -1
- package/dist/api/app/bsky/contact/getMatches.js.map +1 -1
- package/dist/api/app/bsky/feed/getAuthorFeed.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/getAuthorFeed.js +2 -1
- package/dist/api/app/bsky/feed/getAuthorFeed.js.map +1 -1
- package/dist/api/app/bsky/feed/getLikes.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/getLikes.js +2 -1
- package/dist/api/app/bsky/feed/getLikes.js.map +1 -1
- package/dist/api/app/bsky/feed/getPostThread.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/getPostThread.js +2 -1
- package/dist/api/app/bsky/feed/getPostThread.js.map +1 -1
- package/dist/api/app/bsky/feed/getQuotes.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/getQuotes.js +2 -1
- package/dist/api/app/bsky/feed/getQuotes.js.map +1 -1
- package/dist/api/app/bsky/feed/getRepostedBy.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/getRepostedBy.js +2 -1
- package/dist/api/app/bsky/feed/getRepostedBy.js.map +1 -1
- package/dist/api/app/bsky/feed/getTimeline.d.ts +2 -4
- package/dist/api/app/bsky/feed/getTimeline.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/getTimeline.js +1 -1
- package/dist/api/app/bsky/feed/getTimeline.js.map +1 -1
- package/dist/api/app/bsky/feed/searchPosts.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/searchPosts.js +2 -1
- package/dist/api/app/bsky/feed/searchPosts.js.map +1 -1
- package/dist/api/app/bsky/graph/getActorStarterPacks.d.ts.map +1 -1
- package/dist/api/app/bsky/graph/getActorStarterPacks.js +2 -1
- package/dist/api/app/bsky/graph/getActorStarterPacks.js.map +1 -1
- package/dist/api/app/bsky/graph/getBlocks.d.ts.map +1 -1
- package/dist/api/app/bsky/graph/getBlocks.js +1 -1
- package/dist/api/app/bsky/graph/getBlocks.js.map +1 -1
- package/dist/api/app/bsky/graph/getFollowers.d.ts.map +1 -1
- package/dist/api/app/bsky/graph/getFollowers.js +2 -1
- package/dist/api/app/bsky/graph/getFollowers.js.map +1 -1
- package/dist/api/app/bsky/graph/getFollows.d.ts.map +1 -1
- package/dist/api/app/bsky/graph/getFollows.js +2 -1
- package/dist/api/app/bsky/graph/getFollows.js.map +1 -1
- package/dist/api/app/bsky/graph/getKnownFollowers.d.ts.map +1 -1
- package/dist/api/app/bsky/graph/getKnownFollowers.js +1 -1
- package/dist/api/app/bsky/graph/getKnownFollowers.js.map +1 -1
- package/dist/api/app/bsky/graph/getList.d.ts.map +1 -1
- package/dist/api/app/bsky/graph/getList.js +2 -1
- package/dist/api/app/bsky/graph/getList.js.map +1 -1
- package/dist/api/app/bsky/graph/getListBlocks.d.ts.map +1 -1
- package/dist/api/app/bsky/graph/getListBlocks.js +1 -1
- package/dist/api/app/bsky/graph/getListBlocks.js.map +1 -1
- package/dist/api/app/bsky/graph/getListMutes.d.ts.map +1 -1
- package/dist/api/app/bsky/graph/getListMutes.js +1 -1
- package/dist/api/app/bsky/graph/getListMutes.js.map +1 -1
- package/dist/api/app/bsky/graph/getLists.d.ts.map +1 -1
- package/dist/api/app/bsky/graph/getLists.js +2 -1
- package/dist/api/app/bsky/graph/getLists.js.map +1 -1
- package/dist/api/app/bsky/graph/getListsWithMembership.js +1 -1
- package/dist/api/app/bsky/graph/getListsWithMembership.js.map +1 -1
- package/dist/api/app/bsky/graph/getMutes.d.ts.map +1 -1
- package/dist/api/app/bsky/graph/getMutes.js +1 -1
- package/dist/api/app/bsky/graph/getMutes.js.map +1 -1
- package/dist/api/app/bsky/graph/getStarterPack.d.ts.map +1 -1
- package/dist/api/app/bsky/graph/getStarterPack.js +2 -1
- package/dist/api/app/bsky/graph/getStarterPack.js.map +1 -1
- package/dist/api/app/bsky/graph/getStarterPacks.d.ts.map +1 -1
- package/dist/api/app/bsky/graph/getStarterPacks.js +2 -1
- package/dist/api/app/bsky/graph/getStarterPacks.js.map +1 -1
- package/dist/api/app/bsky/graph/getStarterPacksWithMembership.js +1 -1
- package/dist/api/app/bsky/graph/getStarterPacksWithMembership.js.map +1 -1
- package/dist/api/app/bsky/graph/searchStarterPacks.d.ts.map +1 -1
- package/dist/api/app/bsky/graph/searchStarterPacks.js +2 -1
- package/dist/api/app/bsky/graph/searchStarterPacks.js.map +1 -1
- package/dist/api/app/bsky/notification/listActivitySubscriptions.js +1 -1
- package/dist/api/app/bsky/notification/listActivitySubscriptions.js.map +1 -1
- package/dist/api/app/bsky/notification/listNotifications.d.ts.map +1 -1
- package/dist/api/app/bsky/notification/listNotifications.js +1 -1
- package/dist/api/app/bsky/notification/listNotifications.js.map +1 -1
- package/dist/api/app/bsky/unspecced/getPostThreadOtherV2.d.ts.map +1 -1
- package/dist/api/app/bsky/unspecced/getPostThreadOtherV2.js +2 -1
- package/dist/api/app/bsky/unspecced/getPostThreadOtherV2.js.map +1 -1
- package/dist/api/app/bsky/unspecced/getPostThreadV2.d.ts.map +1 -1
- package/dist/api/app/bsky/unspecced/getPostThreadV2.js +2 -1
- package/dist/api/app/bsky/unspecced/getPostThreadV2.js.map +1 -1
- package/dist/auth-verifier.d.ts +1 -0
- package/dist/auth-verifier.d.ts.map +1 -1
- package/dist/auth-verifier.js +1 -0
- package/dist/auth-verifier.js.map +1 -1
- package/dist/data-plane/client/index.d.ts.map +1 -1
- package/dist/data-plane/client/index.js +2 -0
- package/dist/data-plane/client/index.js.map +1 -1
- package/dist/data-plane/client/util.d.ts +2 -1
- package/dist/data-plane/client/util.d.ts.map +1 -1
- package/dist/data-plane/client/util.js +6 -1
- package/dist/data-plane/client/util.js.map +1 -1
- package/dist/data-plane/client/util.test.d.ts +2 -0
- package/dist/data-plane/client/util.test.d.ts.map +1 -0
- package/dist/data-plane/client/util.test.js +33 -0
- package/dist/data-plane/client/util.test.js.map +1 -0
- package/dist/data-plane/server/indexing/plugins/feed-generator.js +2 -1
- package/dist/data-plane/server/indexing/plugins/feed-generator.js.map +1 -1
- package/dist/data-plane/server/indexing/plugins/list.js +2 -1
- package/dist/data-plane/server/indexing/plugins/list.js.map +1 -1
- package/dist/data-plane/server/indexing/plugins/post.js +3 -3
- package/dist/data-plane/server/indexing/plugins/post.js.map +1 -1
- package/dist/data-plane/server/indexing/plugins/profile.js +3 -2
- package/dist/data-plane/server/indexing/plugins/profile.js.map +1 -1
- package/dist/hydration/hydrator.d.ts +5 -0
- package/dist/hydration/hydrator.d.ts.map +1 -1
- package/dist/hydration/hydrator.js +8 -0
- package/dist/hydration/hydrator.js.map +1 -1
- package/dist/hydration/util.d.ts +13 -7
- package/dist/hydration/util.d.ts.map +1 -1
- package/dist/hydration/util.js +30 -10
- package/dist/hydration/util.js.map +1 -1
- package/dist/lexicons/app/bsky/actor/defs.defs.d.ts +1 -0
- package/dist/lexicons/app/bsky/actor/defs.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/actor/defs.defs.js +1 -0
- package/dist/lexicons/app/bsky/actor/defs.defs.js.map +1 -1
- package/dist/lexicons/app/bsky/actor/profile.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/actor/profile.defs.js +2 -10
- package/dist/lexicons/app/bsky/actor/profile.defs.js.map +1 -1
- package/dist/lexicons/app/bsky/embed/external.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/embed/external.defs.js +1 -1
- package/dist/lexicons/app/bsky/embed/external.defs.js.map +1 -1
- package/dist/lexicons/app/bsky/embed/images.defs.d.ts +3 -0
- package/dist/lexicons/app/bsky/embed/images.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/embed/images.defs.js +1 -5
- package/dist/lexicons/app/bsky/embed/images.defs.js.map +1 -1
- package/dist/lexicons/app/bsky/embed/video.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/embed/video.defs.js +2 -6
- package/dist/lexicons/app/bsky/embed/video.defs.js.map +1 -1
- package/dist/lexicons/app/bsky/feed/generator.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/feed/generator.defs.js +1 -5
- package/dist/lexicons/app/bsky/feed/generator.defs.js.map +1 -1
- package/dist/lexicons/app/bsky/graph/list.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/graph/list.defs.js +1 -5
- package/dist/lexicons/app/bsky/graph/list.defs.js.map +1 -1
- package/dist/lexicons/app/bsky/video/defs.defs.js +1 -1
- package/dist/lexicons/app/bsky/video/defs.defs.js.map +1 -1
- package/dist/lexicons/com/atproto/repo/uploadBlob.defs.d.ts +2 -6
- package/dist/lexicons/com/atproto/repo/uploadBlob.defs.d.ts.map +1 -1
- package/dist/lexicons/com/atproto/repo/uploadBlob.defs.js +1 -1
- package/dist/lexicons/com/atproto/repo/uploadBlob.defs.js.map +1 -1
- package/dist/views/index.d.ts.map +1 -1
- package/dist/views/index.js +13 -8
- package/dist/views/index.js.map +1 -1
- package/dist/views/util.d.ts +1 -2
- package/dist/views/util.d.ts.map +1 -1
- package/dist/views/util.js +1 -5
- package/dist/views/util.js.map +1 -1
- package/package.json +10 -10
- package/src/api/app/bsky/actor/getProfile.ts +3 -1
- package/src/api/app/bsky/actor/getProfiles.ts +3 -1
- package/src/api/app/bsky/actor/searchActors.ts +3 -1
- package/src/api/app/bsky/bookmark/getBookmarks.ts +3 -6
- package/src/api/app/bsky/contact/getMatches.ts +3 -6
- package/src/api/app/bsky/feed/getAuthorFeed.ts +3 -1
- package/src/api/app/bsky/feed/getLikes.ts +3 -1
- package/src/api/app/bsky/feed/getPostThread.ts +2 -1
- package/src/api/app/bsky/feed/getQuotes.ts +3 -1
- package/src/api/app/bsky/feed/getRepostedBy.ts +3 -1
- package/src/api/app/bsky/feed/getTimeline.ts +3 -6
- package/src/api/app/bsky/feed/searchPosts.ts +3 -1
- package/src/api/app/bsky/graph/getActorStarterPacks.ts +3 -1
- package/src/api/app/bsky/graph/getBlocks.ts +3 -6
- package/src/api/app/bsky/graph/getFollowers.ts +3 -1
- package/src/api/app/bsky/graph/getFollows.ts +3 -1
- package/src/api/app/bsky/graph/getKnownFollowers.ts +3 -6
- package/src/api/app/bsky/graph/getList.ts +3 -1
- package/src/api/app/bsky/graph/getListBlocks.ts +3 -6
- package/src/api/app/bsky/graph/getListMutes.ts +3 -6
- package/src/api/app/bsky/graph/getLists.ts +3 -1
- package/src/api/app/bsky/graph/getListsWithMembership.ts +3 -3
- package/src/api/app/bsky/graph/getMutes.ts +3 -6
- package/src/api/app/bsky/graph/getStarterPack.ts +3 -1
- package/src/api/app/bsky/graph/getStarterPacks.ts +3 -1
- package/src/api/app/bsky/graph/getStarterPacksWithMembership.ts +3 -3
- package/src/api/app/bsky/graph/searchStarterPacks.ts +3 -1
- package/src/api/app/bsky/notification/listActivitySubscriptions.ts +3 -3
- package/src/api/app/bsky/notification/listNotifications.ts +3 -6
- package/src/api/app/bsky/unspecced/getPostThreadOtherV2.ts +2 -1
- package/src/api/app/bsky/unspecced/getPostThreadV2.ts +2 -1
- package/src/auth-verifier.ts +1 -0
- package/src/data-plane/client/index.ts +2 -0
- package/src/data-plane/client/util.test.ts +39 -0
- package/src/data-plane/client/util.ts +9 -1
- package/src/data-plane/server/indexing/plugins/feed-generator.ts +2 -2
- package/src/data-plane/server/indexing/plugins/list.ts +2 -2
- package/src/data-plane/server/indexing/plugins/post.ts +4 -4
- package/src/data-plane/server/indexing/plugins/profile.ts +3 -3
- package/src/hydration/hydrator.ts +8 -0
- package/src/hydration/util.ts +40 -21
- package/src/views/index.ts +19 -15
- package/src/views/util.ts +1 -5
- package/tests/views/__snapshots__/profile.test.ts.snap +3 -0
- package/tests/views/blocks.test.ts +69 -0
- package/tests/views/profile.test.ts +77 -0
- package/tsconfig.build.tsbuildinfo +1 -1
package/dist/views/util.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AtUriString,
|
|
1
|
+
import { AtUriString, DidString, UriString } from '@atproto/lex';
|
|
2
2
|
import { GateRecord, PostRecord, PostgateRecord } from './types.js';
|
|
3
3
|
export declare const parseThreadGate: (replierDid: string, ownerDid: string, rootPost: PostRecord | null, gate: GateRecord | null) => ParsedThreadGate;
|
|
4
4
|
type ParsedThreadGate = {
|
|
@@ -8,7 +8,6 @@ type ParsedThreadGate = {
|
|
|
8
8
|
allowFollowing?: boolean;
|
|
9
9
|
allowListUris?: AtUriString[];
|
|
10
10
|
};
|
|
11
|
-
export declare const cidFromBlobJson: (json: BlobRef) => string;
|
|
12
11
|
export declare const parsePostgate: ({ gate, viewerDid, authorDid, }: {
|
|
13
12
|
gate: PostgateRecord | undefined;
|
|
14
13
|
viewerDid: string | undefined;
|
package/dist/views/util.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/views/util.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/views/util.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,SAA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
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.VideoUriBuilder = exports.parsePostgate = exports.
|
|
36
|
+
exports.VideoUriBuilder = exports.parsePostgate = exports.parseThreadGate = void 0;
|
|
37
37
|
const util = __importStar(require("node:util"));
|
|
38
38
|
const types_js_1 = require("./types.js");
|
|
39
39
|
const parseThreadGate = (replierDid, ownerDid, rootPost, gate) => {
|
|
@@ -66,10 +66,6 @@ const parseThreadGate = (replierDid, ownerDid, rootPost, gate) => {
|
|
|
66
66
|
return { allowMentions, allowFollower, allowFollowing, allowListUris };
|
|
67
67
|
};
|
|
68
68
|
exports.parseThreadGate = parseThreadGate;
|
|
69
|
-
const cidFromBlobJson = (json) => {
|
|
70
|
-
return json.ref.toString();
|
|
71
|
-
};
|
|
72
|
-
exports.cidFromBlobJson = cidFromBlobJson;
|
|
73
69
|
const parsePostgate = ({ gate, viewerDid, authorDid, }) => {
|
|
74
70
|
if (viewerDid === authorDid) {
|
|
75
71
|
return { embeddingRules: { canEmbed: true } };
|
package/dist/views/util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/views/util.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAiC;AAEjC,yCAUmB;AAEZ,MAAM,eAAe,GAAG,CAC7B,UAAkB,EAClB,QAAgB,EAChB,QAA2B,EAC3B,IAAuB,EACL,EAAE;IACpB,IAAI,UAAU,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAA;IAC3B,CAAC;IACD,yGAAyG;IACzG,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QACzB,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAA;IAC3B,CAAC;IAED,MAAM,aAAa,GAAG,IAAI,CAAC,KAA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SAAS,GAKV,EAAkB,EAAE;IACnB,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,EAAE,cAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAA;IAC/C,CAAC;IACD,yCAAyC;IACzC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;QAClC,OAAO,EAAE,cAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAA;IAC/C,CAAC;IAED,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,oCAAyB,CAAC,CAAA;IACpE,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,EAAE,cAAc,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAA;IAChD,CAAC;IAED,OAAO,EAAE,cAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAA;AAC/C,CAAC,CAAA;AAvBY,QAAA,aAAa,iBAuBzB;AAQD,MAAa,eAAe;IAC1B,YACU,IAGP;QAHD;;;;mBAAQ,IAAI;WAGX;IACA,CAAC;IACJ,QAAQ,CAAC,EAAE,GAAG,EAAE,GAAG,EAAmC;QACpD,OAAO,IAAI,CAAC,MAAM,CAChB,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAC5B,kBAAkB,CAAC,GAAG,CAAC,EACvB,kBAAkB,CAAC,GAAG,CAAC,CACX,CAAA;IAChB,CAAC;IACD,SAAS,CAAC,EAAE,GAAG,EAAE,GAAG,EAAmC;QACrD,OAAO,IAAI,CAAC,MAAM,CAChB,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAC7B,kBAAkB,CAAC,GAAG,CAAC,EACvB,kBAAkB,CAAC,GAAG,CAAC,CACX,CAAA;IAChB,CAAC;CACF;AArBD,0CAqBC","sourcesContent":["import * as util from 'node:util'\nimport { AtUriString, DidString, UriString } from '@atproto/lex'\nimport {\n GateRecord,\n PostRecord,\n PostgateRecord,\n isFollowerRuleType,\n isFollowingRuleType,\n isListRuleType,\n isMentionFacetType,\n isMentionRuleType,\n isPostgateDisableRuleType,\n} from './types.js'\n\nexport const parseThreadGate = (\n replierDid: string,\n ownerDid: string,\n rootPost: PostRecord | null,\n gate: GateRecord | null,\n): ParsedThreadGate => {\n if (replierDid === ownerDid) {\n return { canReply: true }\n }\n // if gate.allow is unset then *any* reply is allowed, if it is an empty array then *no* reply is allowed\n if (!gate || !gate.allow) {\n return { canReply: true }\n }\n\n const allowMentions = gate.allow.some(isMentionRuleType)\n const allowFollower = gate.allow.some(isFollowerRuleType)\n const allowFollowing = gate.allow.some(isFollowingRuleType)\n const allowListUris = gate.allow.filter(isListRuleType).map((i) => i.list)\n\n // check mentions first since it's quick and synchronous\n if (allowMentions) {\n const isMentioned = rootPost?.facets?.some((facet) => {\n return facet.features.some(\n (item) => isMentionFacetType(item) && item.did === replierDid,\n )\n })\n if (isMentioned) {\n return {\n canReply: true,\n allowMentions,\n allowFollower,\n allowFollowing,\n allowListUris,\n }\n }\n }\n return { allowMentions, allowFollower, allowFollowing, allowListUris }\n}\n\ntype ParsedThreadGate = {\n canReply?: boolean\n allowMentions?: boolean\n allowFollower?: boolean\n allowFollowing?: boolean\n allowListUris?: AtUriString[]\n}\n\nexport const parsePostgate = ({\n gate,\n viewerDid,\n authorDid,\n}: {\n gate: PostgateRecord | undefined\n viewerDid: string | undefined\n authorDid: string\n}): ParsedPostgate => {\n if (viewerDid === authorDid) {\n return { embeddingRules: { canEmbed: true } }\n }\n // default state is unset, allow everyone\n if (!gate || !gate.embeddingRules) {\n return { embeddingRules: { canEmbed: true } }\n }\n\n const disabled = gate.embeddingRules.some(isPostgateDisableRuleType)\n if (disabled) {\n return { embeddingRules: { canEmbed: false } }\n }\n\n return { embeddingRules: { canEmbed: true } }\n}\n\ntype ParsedPostgate = {\n embeddingRules: {\n canEmbed: boolean\n }\n}\n\nexport class VideoUriBuilder {\n constructor(\n private opts: {\n playlistUrlPattern: string // e.g. https://hostname/vid/%s/%s/playlist.m3u8\n thumbnailUrlPattern: string // e.g. https://hostname/vid/%s/%s/thumbnail.jpg\n },\n ) {}\n playlist({ did, cid }: { did: DidString; cid: string }): UriString {\n return util.format(\n this.opts.playlistUrlPattern,\n encodeURIComponent(did),\n encodeURIComponent(cid),\n ) as UriString\n }\n thumbnail({ did, cid }: { did: DidString; cid: string }): UriString {\n return util.format(\n this.opts.thumbnailUrlPattern,\n encodeURIComponent(did),\n encodeURIComponent(cid),\n ) as UriString\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/bsky",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.226",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Reference implementation of app.bsky App View (Bluesky API)",
|
|
6
6
|
"keywords": [
|
|
@@ -52,16 +52,16 @@
|
|
|
52
52
|
"zod": "3.23.8",
|
|
53
53
|
"@atproto-labs/fetch-node": "^0.2.0",
|
|
54
54
|
"@atproto-labs/xrpc-utils": "^0.0.24",
|
|
55
|
-
"@atproto/api": "^0.19.
|
|
56
|
-
"@atproto/common": "^0.5.
|
|
55
|
+
"@atproto/api": "^0.19.8",
|
|
56
|
+
"@atproto/common": "^0.5.16",
|
|
57
57
|
"@atproto/crypto": "^0.4.5",
|
|
58
58
|
"@atproto/did": "^0.3.0",
|
|
59
|
-
"@atproto/
|
|
60
|
-
"@atproto/lex": "^0.0.
|
|
61
|
-
"@atproto/
|
|
62
|
-
"@atproto/
|
|
63
|
-
"@atproto/
|
|
64
|
-
"@atproto/
|
|
59
|
+
"@atproto/identity": "^0.4.12",
|
|
60
|
+
"@atproto/lex": "^0.0.25",
|
|
61
|
+
"@atproto/repo": "^0.9.1",
|
|
62
|
+
"@atproto/sync": "^0.2.2",
|
|
63
|
+
"@atproto/syntax": "^0.5.4",
|
|
64
|
+
"@atproto/xrpc-server": "^0.10.20"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@bufbuild/buf": "^1.28.1",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"jest": "^28.1.2",
|
|
78
78
|
"ts-node": "^10.8.2",
|
|
79
79
|
"typescript": "^5.6.3",
|
|
80
|
-
"@atproto/pds": "^0.4.
|
|
80
|
+
"@atproto/pds": "^0.4.219"
|
|
81
81
|
},
|
|
82
82
|
"scripts": {
|
|
83
83
|
"codegen": "lex build --override --indexFile --lexicons ../../lexicons",
|
|
@@ -16,12 +16,14 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
16
16
|
server.add(app.bsky.actor.getProfile, {
|
|
17
17
|
auth: ctx.authVerifier.optionalStandardOrRole,
|
|
18
18
|
handler: async ({ auth, params, req }) => {
|
|
19
|
-
const { viewer, includeTakedowns } =
|
|
19
|
+
const { viewer, includeTakedowns, skipViewerBlocks } =
|
|
20
|
+
ctx.authVerifier.parseCreds(auth)
|
|
20
21
|
const labelers = ctx.reqLabelers(req)
|
|
21
22
|
const hydrateCtx = await ctx.hydrator.createContext({
|
|
22
23
|
labelers,
|
|
23
24
|
viewer,
|
|
24
25
|
includeTakedowns,
|
|
26
|
+
skipViewerBlocks,
|
|
25
27
|
})
|
|
26
28
|
|
|
27
29
|
const result = await getProfile({ ...params, hydrateCtx }, ctx)
|
|
@@ -30,12 +30,14 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
30
30
|
paramsParseLoose: true,
|
|
31
31
|
},
|
|
32
32
|
handler: async ({ auth, params, req }) => {
|
|
33
|
-
const { viewer, includeTakedowns } =
|
|
33
|
+
const { viewer, includeTakedowns, skipViewerBlocks } =
|
|
34
|
+
ctx.authVerifier.parseCreds(auth)
|
|
34
35
|
const labelers = ctx.reqLabelers(req)
|
|
35
36
|
const hydrateCtx = await ctx.hydrator.createContext({
|
|
36
37
|
viewer,
|
|
37
38
|
labelers,
|
|
38
39
|
includeTakedowns,
|
|
40
|
+
skipViewerBlocks,
|
|
39
41
|
})
|
|
40
42
|
|
|
41
43
|
const result = await getProfile({ ...params, hydrateCtx }, ctx)
|
|
@@ -26,12 +26,14 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
26
26
|
server.add(app.bsky.actor.searchActors, {
|
|
27
27
|
auth: ctx.authVerifier.standardOptional,
|
|
28
28
|
handler: async ({ auth, params, req }) => {
|
|
29
|
-
const { viewer, includeTakedowns } =
|
|
29
|
+
const { viewer, includeTakedowns, skipViewerBlocks } =
|
|
30
|
+
ctx.authVerifier.parseCreds(auth)
|
|
30
31
|
const labelers = ctx.reqLabelers(req)
|
|
31
32
|
const hydrateCtx = await ctx.hydrator.createContext({
|
|
32
33
|
viewer,
|
|
33
34
|
labelers,
|
|
34
35
|
includeTakedowns,
|
|
36
|
+
skipViewerBlocks,
|
|
35
37
|
})
|
|
36
38
|
const results = await searchActors({ ...params, hydrateCtx }, ctx)
|
|
37
39
|
return {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { mapDefined } from '@atproto/common'
|
|
2
2
|
import { Server } from '@atproto/xrpc-server'
|
|
3
3
|
import { AppContext } from '../../../../context'
|
|
4
|
-
import {
|
|
4
|
+
import { HydrateCtxWithViewer, Hydrator } from '../../../../hydration/hydrator'
|
|
5
5
|
import { app } from '../../../../lexicons/index.js'
|
|
6
6
|
import {
|
|
7
7
|
HydrationFnInput,
|
|
@@ -31,10 +31,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
31
31
|
viewer,
|
|
32
32
|
})
|
|
33
33
|
|
|
34
|
-
const result = await getBookmarks(
|
|
35
|
-
{ ...params, hydrateCtx: hydrateCtx.copy({ viewer }) },
|
|
36
|
-
ctx,
|
|
37
|
-
)
|
|
34
|
+
const result = await getBookmarks({ ...params, hydrateCtx }, ctx)
|
|
38
35
|
|
|
39
36
|
return {
|
|
40
37
|
encoding: 'application/json',
|
|
@@ -87,7 +84,7 @@ type Context = {
|
|
|
87
84
|
}
|
|
88
85
|
|
|
89
86
|
type Params = app.bsky.bookmark.getBookmarks.$Params & {
|
|
90
|
-
hydrateCtx:
|
|
87
|
+
hydrateCtx: HydrateCtxWithViewer
|
|
91
88
|
}
|
|
92
89
|
|
|
93
90
|
type SkeletonState = {
|
|
@@ -3,7 +3,7 @@ import { DidString } from '@atproto/lex'
|
|
|
3
3
|
import { Server } from '@atproto/xrpc-server'
|
|
4
4
|
import { AppContext } from '../../../../context'
|
|
5
5
|
import {
|
|
6
|
-
|
|
6
|
+
HydrateCtxWithViewer,
|
|
7
7
|
HydrationState,
|
|
8
8
|
Hydrator,
|
|
9
9
|
} from '../../../../hydration/hydrator'
|
|
@@ -32,10 +32,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
32
32
|
viewer,
|
|
33
33
|
})
|
|
34
34
|
|
|
35
|
-
const result = await getMatches(
|
|
36
|
-
{ ...params, hydrateCtx: hydrateCtx.copy({ viewer }) },
|
|
37
|
-
ctx,
|
|
38
|
-
)
|
|
35
|
+
const result = await getMatches({ ...params, hydrateCtx }, ctx)
|
|
39
36
|
|
|
40
37
|
return {
|
|
41
38
|
encoding: 'application/json',
|
|
@@ -104,7 +101,7 @@ type Context = {
|
|
|
104
101
|
}
|
|
105
102
|
|
|
106
103
|
type Params = app.bsky.contact.getMatches.$Params & {
|
|
107
|
-
hydrateCtx:
|
|
104
|
+
hydrateCtx: HydrateCtxWithViewer
|
|
108
105
|
}
|
|
109
106
|
|
|
110
107
|
type SkeletonState = {
|
|
@@ -29,12 +29,14 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
29
29
|
server.add(app.bsky.feed.getAuthorFeed, {
|
|
30
30
|
auth: ctx.authVerifier.optionalStandardOrRole,
|
|
31
31
|
handler: async ({ params, auth, req }) => {
|
|
32
|
-
const { viewer, includeTakedowns } =
|
|
32
|
+
const { viewer, includeTakedowns, skipViewerBlocks } =
|
|
33
|
+
ctx.authVerifier.parseCreds(auth)
|
|
33
34
|
const labelers = ctx.reqLabelers(req)
|
|
34
35
|
const hydrateCtx = await ctx.hydrator.createContext({
|
|
35
36
|
labelers,
|
|
36
37
|
viewer,
|
|
37
38
|
includeTakedowns,
|
|
39
|
+
skipViewerBlocks,
|
|
38
40
|
})
|
|
39
41
|
|
|
40
42
|
const result = await getAuthorFeed({ ...params, hydrateCtx }, ctx)
|
|
@@ -24,12 +24,14 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
24
24
|
server.add(app.bsky.feed.getLikes, {
|
|
25
25
|
auth: ctx.authVerifier.standardOptional,
|
|
26
26
|
handler: async ({ params, auth, req }) => {
|
|
27
|
-
const { viewer, includeTakedowns } =
|
|
27
|
+
const { viewer, includeTakedowns, skipViewerBlocks } =
|
|
28
|
+
ctx.authVerifier.parseCreds(auth)
|
|
28
29
|
const labelers = ctx.reqLabelers(req)
|
|
29
30
|
const hydrateCtx = await ctx.hydrator.createContext({
|
|
30
31
|
labelers,
|
|
31
32
|
viewer,
|
|
32
33
|
includeTakedowns,
|
|
34
|
+
skipViewerBlocks,
|
|
33
35
|
})
|
|
34
36
|
const result = await getLikes({ ...params, hydrateCtx }, ctx)
|
|
35
37
|
|
|
@@ -31,7 +31,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
31
31
|
paramsParseLoose: true,
|
|
32
32
|
},
|
|
33
33
|
handler: async ({ params, auth, req, res }) => {
|
|
34
|
-
const { viewer, includeTakedowns, include3pBlocks } =
|
|
34
|
+
const { viewer, includeTakedowns, include3pBlocks, skipViewerBlocks } =
|
|
35
35
|
ctx.authVerifier.parseCreds(auth)
|
|
36
36
|
const labelers = ctx.reqLabelers(req)
|
|
37
37
|
const hydrateCtx = await ctx.hydrator.createContext({
|
|
@@ -39,6 +39,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
39
39
|
viewer,
|
|
40
40
|
includeTakedowns,
|
|
41
41
|
include3pBlocks,
|
|
42
|
+
skipViewerBlocks,
|
|
42
43
|
})
|
|
43
44
|
|
|
44
45
|
let result: app.bsky.feed.getPostThread.$OutputBody
|
|
@@ -24,12 +24,14 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
24
24
|
server.add(app.bsky.feed.getQuotes, {
|
|
25
25
|
auth: ctx.authVerifier.standardOptional,
|
|
26
26
|
handler: async ({ params, auth, req }) => {
|
|
27
|
-
const { viewer, includeTakedowns } =
|
|
27
|
+
const { viewer, includeTakedowns, skipViewerBlocks } =
|
|
28
|
+
ctx.authVerifier.parseCreds(auth)
|
|
28
29
|
const labelers = ctx.reqLabelers(req)
|
|
29
30
|
const hydrateCtx = await ctx.hydrator.createContext({
|
|
30
31
|
labelers,
|
|
31
32
|
viewer,
|
|
32
33
|
includeTakedowns,
|
|
34
|
+
skipViewerBlocks,
|
|
33
35
|
})
|
|
34
36
|
const result = await getQuotes({ ...params, hydrateCtx }, ctx)
|
|
35
37
|
return {
|
|
@@ -24,12 +24,14 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
24
24
|
server.add(app.bsky.feed.getRepostedBy, {
|
|
25
25
|
auth: ctx.authVerifier.standardOptional,
|
|
26
26
|
handler: async ({ params, auth, req }) => {
|
|
27
|
-
const { viewer, includeTakedowns } =
|
|
27
|
+
const { viewer, includeTakedowns, skipViewerBlocks } =
|
|
28
|
+
ctx.authVerifier.parseCreds(auth)
|
|
28
29
|
const labelers = ctx.reqLabelers(req)
|
|
29
30
|
const hydrateCtx = await ctx.hydrator.createContext({
|
|
30
31
|
labelers,
|
|
31
32
|
viewer,
|
|
32
33
|
includeTakedowns,
|
|
34
|
+
skipViewerBlocks,
|
|
33
35
|
})
|
|
34
36
|
const result = await getRepostedBy({ ...params, hydrateCtx }, ctx)
|
|
35
37
|
|
|
@@ -5,7 +5,7 @@ import { AppContext } from '../../../../context'
|
|
|
5
5
|
import { DataPlaneClient } from '../../../../data-plane'
|
|
6
6
|
import { FeedItem } from '../../../../hydration/feed'
|
|
7
7
|
import {
|
|
8
|
-
|
|
8
|
+
HydrateCtxWithViewer,
|
|
9
9
|
HydrationState,
|
|
10
10
|
Hydrator,
|
|
11
11
|
} from '../../../../hydration/hydrator'
|
|
@@ -34,10 +34,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
34
34
|
const labelers = ctx.reqLabelers(req)
|
|
35
35
|
const hydrateCtx = await ctx.hydrator.createContext({ labelers, viewer })
|
|
36
36
|
|
|
37
|
-
const result = await getTimeline(
|
|
38
|
-
{ ...params, hydrateCtx: hydrateCtx.copy({ viewer }) },
|
|
39
|
-
ctx,
|
|
40
|
-
)
|
|
37
|
+
const result = await getTimeline({ ...params, hydrateCtx }, ctx)
|
|
41
38
|
|
|
42
39
|
const repoRev = await ctx.hydrator.actor.getRepoRevSafe(viewer)
|
|
43
40
|
|
|
@@ -121,7 +118,7 @@ type Context = {
|
|
|
121
118
|
}
|
|
122
119
|
|
|
123
120
|
type Params = app.bsky.feed.getTimeline.$Params & {
|
|
124
|
-
hydrateCtx:
|
|
121
|
+
hydrateCtx: HydrateCtxWithViewer
|
|
125
122
|
}
|
|
126
123
|
|
|
127
124
|
type Skeleton = {
|
|
@@ -32,12 +32,14 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
32
32
|
server.add(app.bsky.feed.searchPosts, {
|
|
33
33
|
auth: ctx.authVerifier.standardOptional,
|
|
34
34
|
handler: async ({ auth, params, req }) => {
|
|
35
|
-
const { viewer, isModService } =
|
|
35
|
+
const { viewer, isModService, skipViewerBlocks } =
|
|
36
|
+
ctx.authVerifier.parseCreds(auth)
|
|
36
37
|
|
|
37
38
|
const labelers = ctx.reqLabelers(req)
|
|
38
39
|
const hydrateCtx = await ctx.hydrator.createContext({
|
|
39
40
|
labelers,
|
|
40
41
|
viewer,
|
|
42
|
+
skipViewerBlocks,
|
|
41
43
|
features: ctx.featureGatesClient.scope(
|
|
42
44
|
ctx.featureGatesClient.parseUserContextFromHandler({
|
|
43
45
|
viewer,
|
|
@@ -26,12 +26,14 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
26
26
|
server.add(app.bsky.graph.getActorStarterPacks, {
|
|
27
27
|
auth: ctx.authVerifier.standardOptional,
|
|
28
28
|
handler: async ({ params, auth, req }) => {
|
|
29
|
-
const { viewer, includeTakedowns } =
|
|
29
|
+
const { viewer, includeTakedowns, skipViewerBlocks } =
|
|
30
|
+
ctx.authVerifier.parseCreds(auth)
|
|
30
31
|
const labelers = ctx.reqLabelers(req)
|
|
31
32
|
const hydrateCtx = await ctx.hydrator.createContext({
|
|
32
33
|
labelers,
|
|
33
34
|
viewer,
|
|
34
35
|
includeTakedowns,
|
|
36
|
+
skipViewerBlocks,
|
|
35
37
|
})
|
|
36
38
|
const result = await getActorStarterPacks({ ...params, hydrateCtx }, ctx)
|
|
37
39
|
return {
|
|
@@ -2,7 +2,7 @@ import { mapDefined } from '@atproto/common'
|
|
|
2
2
|
import { AtUriString, DidString } from '@atproto/syntax'
|
|
3
3
|
import { Server } from '@atproto/xrpc-server'
|
|
4
4
|
import { AppContext } from '../../../../context'
|
|
5
|
-
import {
|
|
5
|
+
import { HydrateCtxWithViewer, Hydrator } from '../../../../hydration/hydrator'
|
|
6
6
|
import { app } from '../../../../lexicons/index.js'
|
|
7
7
|
import {
|
|
8
8
|
HydrationFnInput,
|
|
@@ -22,10 +22,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
22
22
|
const viewer = auth.credentials.iss
|
|
23
23
|
const labelers = ctx.reqLabelers(req)
|
|
24
24
|
const hydrateCtx = await ctx.hydrator.createContext({ labelers, viewer })
|
|
25
|
-
const result = await getBlocks(
|
|
26
|
-
{ ...params, hydrateCtx: hydrateCtx.copy({ viewer }) },
|
|
27
|
-
ctx,
|
|
28
|
-
)
|
|
25
|
+
const result = await getBlocks({ ...params, hydrateCtx }, ctx)
|
|
29
26
|
return {
|
|
30
27
|
encoding: 'application/json',
|
|
31
28
|
body: result,
|
|
@@ -85,7 +82,7 @@ type Context = {
|
|
|
85
82
|
}
|
|
86
83
|
|
|
87
84
|
type Params = app.bsky.graph.getBlocks.$Params & {
|
|
88
|
-
hydrateCtx:
|
|
85
|
+
hydrateCtx: HydrateCtxWithViewer
|
|
89
86
|
}
|
|
90
87
|
|
|
91
88
|
type SkeletonState = {
|
|
@@ -29,12 +29,14 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
29
29
|
server.add(app.bsky.graph.getFollowers, {
|
|
30
30
|
auth: ctx.authVerifier.optionalStandardOrRole,
|
|
31
31
|
handler: async ({ params, auth, req }) => {
|
|
32
|
-
const { viewer, includeTakedowns } =
|
|
32
|
+
const { viewer, includeTakedowns, skipViewerBlocks } =
|
|
33
|
+
ctx.authVerifier.parseCreds(auth)
|
|
33
34
|
const labelers = ctx.reqLabelers(req)
|
|
34
35
|
const hydrateCtx = await ctx.hydrator.createContext({
|
|
35
36
|
labelers,
|
|
36
37
|
viewer,
|
|
37
38
|
includeTakedowns,
|
|
39
|
+
skipViewerBlocks,
|
|
38
40
|
})
|
|
39
41
|
|
|
40
42
|
const result = await getFollowers({ ...params, hydrateCtx }, ctx)
|
|
@@ -23,12 +23,14 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
23
23
|
server.add(app.bsky.graph.getFollows, {
|
|
24
24
|
auth: ctx.authVerifier.optionalStandardOrRole,
|
|
25
25
|
handler: async ({ params, auth, req }) => {
|
|
26
|
-
const { viewer, includeTakedowns } =
|
|
26
|
+
const { viewer, includeTakedowns, skipViewerBlocks } =
|
|
27
|
+
ctx.authVerifier.parseCreds(auth)
|
|
27
28
|
const labelers = ctx.reqLabelers(req)
|
|
28
29
|
const hydrateCtx = await ctx.hydrator.createContext({
|
|
29
30
|
labelers,
|
|
30
31
|
viewer,
|
|
31
32
|
includeTakedowns,
|
|
33
|
+
skipViewerBlocks,
|
|
32
34
|
})
|
|
33
35
|
|
|
34
36
|
// @TODO ensure canViewTakedowns gets threaded through and applied properly
|
|
@@ -2,7 +2,7 @@ import { mapDefined } from '@atproto/common'
|
|
|
2
2
|
import { DidString } from '@atproto/lex'
|
|
3
3
|
import { InvalidRequestError, Server } from '@atproto/xrpc-server'
|
|
4
4
|
import { AppContext } from '../../../../context'
|
|
5
|
-
import {
|
|
5
|
+
import { HydrateCtxWithViewer, Hydrator } from '../../../../hydration/hydrator'
|
|
6
6
|
import { app } from '../../../../lexicons/index.js'
|
|
7
7
|
import {
|
|
8
8
|
HydrationFnInput,
|
|
@@ -31,10 +31,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
31
31
|
viewer,
|
|
32
32
|
})
|
|
33
33
|
|
|
34
|
-
const result = await getKnownFollowers(
|
|
35
|
-
{ ...params, hydrateCtx: hydrateCtx.copy({ viewer }) },
|
|
36
|
-
ctx,
|
|
37
|
-
)
|
|
34
|
+
const result = await getKnownFollowers({ ...params, hydrateCtx }, ctx)
|
|
38
35
|
|
|
39
36
|
return {
|
|
40
37
|
encoding: 'application/json',
|
|
@@ -113,7 +110,7 @@ type Context = {
|
|
|
113
110
|
}
|
|
114
111
|
|
|
115
112
|
type Params = app.bsky.graph.getKnownFollowers.$Params & {
|
|
116
|
-
hydrateCtx:
|
|
113
|
+
hydrateCtx: HydrateCtxWithViewer
|
|
117
114
|
}
|
|
118
115
|
|
|
119
116
|
type SkeletonState = {
|
|
@@ -26,13 +26,15 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
26
26
|
server.add(app.bsky.graph.getList, {
|
|
27
27
|
auth: ctx.authVerifier.standardOptional,
|
|
28
28
|
handler: async ({ params, auth, req }) => {
|
|
29
|
-
const { viewer, includeTakedowns } =
|
|
29
|
+
const { viewer, includeTakedowns, skipViewerBlocks } =
|
|
30
|
+
ctx.authVerifier.parseCreds(auth)
|
|
30
31
|
|
|
31
32
|
const labelers = ctx.reqLabelers(req)
|
|
32
33
|
const hydrateCtx = await ctx.hydrator.createContext({
|
|
33
34
|
labelers,
|
|
34
35
|
viewer,
|
|
35
36
|
includeTakedowns,
|
|
37
|
+
skipViewerBlocks,
|
|
36
38
|
})
|
|
37
39
|
const result = await getList({ ...params, hydrateCtx }, ctx)
|
|
38
40
|
return {
|
|
@@ -2,7 +2,7 @@ import { mapDefined } from '@atproto/common'
|
|
|
2
2
|
import { AtUriString } from '@atproto/lex'
|
|
3
3
|
import { Server } from '@atproto/xrpc-server'
|
|
4
4
|
import { AppContext } from '../../../../context'
|
|
5
|
-
import {
|
|
5
|
+
import { HydrateCtxWithViewer, Hydrator } from '../../../../hydration/hydrator'
|
|
6
6
|
import { app } from '../../../../lexicons/index.js'
|
|
7
7
|
import {
|
|
8
8
|
HydrationFnInput,
|
|
@@ -27,10 +27,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
27
27
|
const viewer = auth.credentials.iss
|
|
28
28
|
const labelers = ctx.reqLabelers(req)
|
|
29
29
|
const hydrateCtx = await ctx.hydrator.createContext({ labelers, viewer })
|
|
30
|
-
const result = await getListBlocks(
|
|
31
|
-
{ ...params, hydrateCtx: hydrateCtx.copy({ viewer }) },
|
|
32
|
-
ctx,
|
|
33
|
-
)
|
|
30
|
+
const result = await getListBlocks({ ...params, hydrateCtx }, ctx)
|
|
34
31
|
return {
|
|
35
32
|
encoding: 'application/json',
|
|
36
33
|
body: result,
|
|
@@ -78,7 +75,7 @@ type Context = {
|
|
|
78
75
|
}
|
|
79
76
|
|
|
80
77
|
type Params = app.bsky.graph.getListBlocks.$Params & {
|
|
81
|
-
hydrateCtx:
|
|
78
|
+
hydrateCtx: HydrateCtxWithViewer
|
|
82
79
|
}
|
|
83
80
|
|
|
84
81
|
type SkeletonState = {
|
|
@@ -2,7 +2,7 @@ import { mapDefined } from '@atproto/common'
|
|
|
2
2
|
import { AtUriString } from '@atproto/lex'
|
|
3
3
|
import { Server } from '@atproto/xrpc-server'
|
|
4
4
|
import { AppContext } from '../../../../context'
|
|
5
|
-
import {
|
|
5
|
+
import { HydrateCtxWithViewer, Hydrator } from '../../../../hydration/hydrator'
|
|
6
6
|
import { app } from '../../../../lexicons/index.js'
|
|
7
7
|
import {
|
|
8
8
|
HydrationFnInput,
|
|
@@ -27,10 +27,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
27
27
|
const viewer = auth.credentials.iss
|
|
28
28
|
const labelers = ctx.reqLabelers(req)
|
|
29
29
|
const hydrateCtx = await ctx.hydrator.createContext({ labelers, viewer })
|
|
30
|
-
const result = await getListMutes(
|
|
31
|
-
{ ...params, hydrateCtx: hydrateCtx.copy({ viewer }) },
|
|
32
|
-
ctx,
|
|
33
|
-
)
|
|
30
|
+
const result = await getListMutes({ ...params, hydrateCtx }, ctx)
|
|
34
31
|
return {
|
|
35
32
|
encoding: 'application/json',
|
|
36
33
|
body: result,
|
|
@@ -78,7 +75,7 @@ type Context = {
|
|
|
78
75
|
}
|
|
79
76
|
|
|
80
77
|
type Params = app.bsky.graph.getListBlocks.$Params & {
|
|
81
|
-
hydrateCtx:
|
|
78
|
+
hydrateCtx: HydrateCtxWithViewer
|
|
82
79
|
}
|
|
83
80
|
|
|
84
81
|
type SkeletonState = {
|
|
@@ -29,11 +29,13 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
29
29
|
auth: ctx.authVerifier.optionalStandardOrRole,
|
|
30
30
|
handler: async ({ params, auth, req }) => {
|
|
31
31
|
const labelers = ctx.reqLabelers(req)
|
|
32
|
-
const { viewer, includeTakedowns } =
|
|
32
|
+
const { viewer, includeTakedowns, skipViewerBlocks } =
|
|
33
|
+
ctx.authVerifier.parseCreds(auth)
|
|
33
34
|
const hydrateCtx = await ctx.hydrator.createContext({
|
|
34
35
|
labelers,
|
|
35
36
|
viewer,
|
|
36
37
|
includeTakedowns,
|
|
38
|
+
skipViewerBlocks,
|
|
37
39
|
})
|
|
38
40
|
const result = await getLists({ ...params, hydrateCtx }, ctx)
|
|
39
41
|
|
|
@@ -2,7 +2,7 @@ import { mapDefined } from '@atproto/common'
|
|
|
2
2
|
import { AtUriString, DidString } from '@atproto/lex'
|
|
3
3
|
import { InvalidRequestError, Server } from '@atproto/xrpc-server'
|
|
4
4
|
import { AppContext } from '../../../../context'
|
|
5
|
-
import {
|
|
5
|
+
import { HydrateCtxWithViewer, Hydrator } from '../../../../hydration/hydrator'
|
|
6
6
|
import { parseString } from '../../../../hydration/util'
|
|
7
7
|
import { app } from '../../../../lexicons/index.js'
|
|
8
8
|
import {
|
|
@@ -35,7 +35,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
35
35
|
viewer,
|
|
36
36
|
})
|
|
37
37
|
const result = await getListsWithMembership(
|
|
38
|
-
{ ...params, hydrateCtx
|
|
38
|
+
{ ...params, hydrateCtx },
|
|
39
39
|
ctx,
|
|
40
40
|
)
|
|
41
41
|
|
|
@@ -133,7 +133,7 @@ type Context = {
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
type Params = app.bsky.graph.getListsWithMembership.$Params & {
|
|
136
|
-
hydrateCtx:
|
|
136
|
+
hydrateCtx: HydrateCtxWithViewer
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
type SkeletonState = {
|
|
@@ -2,7 +2,7 @@ import { mapDefined } from '@atproto/common'
|
|
|
2
2
|
import { DidString } from '@atproto/lex'
|
|
3
3
|
import { Server } from '@atproto/xrpc-server'
|
|
4
4
|
import { AppContext } from '../../../../context'
|
|
5
|
-
import {
|
|
5
|
+
import { HydrateCtxWithViewer, Hydrator } from '../../../../hydration/hydrator'
|
|
6
6
|
import { app } from '../../../../lexicons/index.js'
|
|
7
7
|
import {
|
|
8
8
|
HydrationFnInput,
|
|
@@ -22,10 +22,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
22
22
|
const viewer = auth.credentials.iss
|
|
23
23
|
const labelers = ctx.reqLabelers(req)
|
|
24
24
|
const hydrateCtx = await ctx.hydrator.createContext({ labelers, viewer })
|
|
25
|
-
const result = await getMutes(
|
|
26
|
-
{ ...params, hydrateCtx: hydrateCtx.copy({ viewer }) },
|
|
27
|
-
ctx,
|
|
28
|
-
)
|
|
25
|
+
const result = await getMutes({ ...params, hydrateCtx }, ctx)
|
|
29
26
|
return {
|
|
30
27
|
encoding: 'application/json',
|
|
31
28
|
body: result,
|
|
@@ -78,7 +75,7 @@ type Context = {
|
|
|
78
75
|
}
|
|
79
76
|
|
|
80
77
|
type Params = app.bsky.graph.getMutes.$Params & {
|
|
81
|
-
hydrateCtx:
|
|
78
|
+
hydrateCtx: HydrateCtxWithViewer
|
|
82
79
|
}
|
|
83
80
|
|
|
84
81
|
type SkeletonState = {
|
|
@@ -23,12 +23,14 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
23
23
|
server.add(app.bsky.graph.getStarterPack, {
|
|
24
24
|
auth: ctx.authVerifier.standardOptional,
|
|
25
25
|
handler: async ({ params, auth, req }) => {
|
|
26
|
-
const { viewer, includeTakedowns } =
|
|
26
|
+
const { viewer, includeTakedowns, skipViewerBlocks } =
|
|
27
|
+
ctx.authVerifier.parseCreds(auth)
|
|
27
28
|
const labelers = ctx.reqLabelers(req)
|
|
28
29
|
const hydrateCtx = await ctx.hydrator.createContext({
|
|
29
30
|
labelers,
|
|
30
31
|
viewer,
|
|
31
32
|
includeTakedowns,
|
|
33
|
+
skipViewerBlocks,
|
|
32
34
|
})
|
|
33
35
|
const result = await getStarterPack({ ...params, hydrateCtx }, ctx)
|
|
34
36
|
return {
|