@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.
Files changed (207) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/api/app/bsky/actor/getProfile.d.ts.map +1 -1
  3. package/dist/api/app/bsky/actor/getProfile.js +2 -1
  4. package/dist/api/app/bsky/actor/getProfile.js.map +1 -1
  5. package/dist/api/app/bsky/actor/getProfiles.d.ts.map +1 -1
  6. package/dist/api/app/bsky/actor/getProfiles.js +2 -1
  7. package/dist/api/app/bsky/actor/getProfiles.js.map +1 -1
  8. package/dist/api/app/bsky/actor/searchActors.d.ts.map +1 -1
  9. package/dist/api/app/bsky/actor/searchActors.js +2 -1
  10. package/dist/api/app/bsky/actor/searchActors.js.map +1 -1
  11. package/dist/api/app/bsky/bookmark/getBookmarks.d.ts.map +1 -1
  12. package/dist/api/app/bsky/bookmark/getBookmarks.js +1 -1
  13. package/dist/api/app/bsky/bookmark/getBookmarks.js.map +1 -1
  14. package/dist/api/app/bsky/contact/getMatches.d.ts.map +1 -1
  15. package/dist/api/app/bsky/contact/getMatches.js +1 -1
  16. package/dist/api/app/bsky/contact/getMatches.js.map +1 -1
  17. package/dist/api/app/bsky/feed/getAuthorFeed.d.ts.map +1 -1
  18. package/dist/api/app/bsky/feed/getAuthorFeed.js +2 -1
  19. package/dist/api/app/bsky/feed/getAuthorFeed.js.map +1 -1
  20. package/dist/api/app/bsky/feed/getLikes.d.ts.map +1 -1
  21. package/dist/api/app/bsky/feed/getLikes.js +2 -1
  22. package/dist/api/app/bsky/feed/getLikes.js.map +1 -1
  23. package/dist/api/app/bsky/feed/getPostThread.d.ts.map +1 -1
  24. package/dist/api/app/bsky/feed/getPostThread.js +2 -1
  25. package/dist/api/app/bsky/feed/getPostThread.js.map +1 -1
  26. package/dist/api/app/bsky/feed/getQuotes.d.ts.map +1 -1
  27. package/dist/api/app/bsky/feed/getQuotes.js +2 -1
  28. package/dist/api/app/bsky/feed/getQuotes.js.map +1 -1
  29. package/dist/api/app/bsky/feed/getRepostedBy.d.ts.map +1 -1
  30. package/dist/api/app/bsky/feed/getRepostedBy.js +2 -1
  31. package/dist/api/app/bsky/feed/getRepostedBy.js.map +1 -1
  32. package/dist/api/app/bsky/feed/getTimeline.d.ts +2 -4
  33. package/dist/api/app/bsky/feed/getTimeline.d.ts.map +1 -1
  34. package/dist/api/app/bsky/feed/getTimeline.js +1 -1
  35. package/dist/api/app/bsky/feed/getTimeline.js.map +1 -1
  36. package/dist/api/app/bsky/feed/searchPosts.d.ts.map +1 -1
  37. package/dist/api/app/bsky/feed/searchPosts.js +2 -1
  38. package/dist/api/app/bsky/feed/searchPosts.js.map +1 -1
  39. package/dist/api/app/bsky/graph/getActorStarterPacks.d.ts.map +1 -1
  40. package/dist/api/app/bsky/graph/getActorStarterPacks.js +2 -1
  41. package/dist/api/app/bsky/graph/getActorStarterPacks.js.map +1 -1
  42. package/dist/api/app/bsky/graph/getBlocks.d.ts.map +1 -1
  43. package/dist/api/app/bsky/graph/getBlocks.js +1 -1
  44. package/dist/api/app/bsky/graph/getBlocks.js.map +1 -1
  45. package/dist/api/app/bsky/graph/getFollowers.d.ts.map +1 -1
  46. package/dist/api/app/bsky/graph/getFollowers.js +2 -1
  47. package/dist/api/app/bsky/graph/getFollowers.js.map +1 -1
  48. package/dist/api/app/bsky/graph/getFollows.d.ts.map +1 -1
  49. package/dist/api/app/bsky/graph/getFollows.js +2 -1
  50. package/dist/api/app/bsky/graph/getFollows.js.map +1 -1
  51. package/dist/api/app/bsky/graph/getKnownFollowers.d.ts.map +1 -1
  52. package/dist/api/app/bsky/graph/getKnownFollowers.js +1 -1
  53. package/dist/api/app/bsky/graph/getKnownFollowers.js.map +1 -1
  54. package/dist/api/app/bsky/graph/getList.d.ts.map +1 -1
  55. package/dist/api/app/bsky/graph/getList.js +2 -1
  56. package/dist/api/app/bsky/graph/getList.js.map +1 -1
  57. package/dist/api/app/bsky/graph/getListBlocks.d.ts.map +1 -1
  58. package/dist/api/app/bsky/graph/getListBlocks.js +1 -1
  59. package/dist/api/app/bsky/graph/getListBlocks.js.map +1 -1
  60. package/dist/api/app/bsky/graph/getListMutes.d.ts.map +1 -1
  61. package/dist/api/app/bsky/graph/getListMutes.js +1 -1
  62. package/dist/api/app/bsky/graph/getListMutes.js.map +1 -1
  63. package/dist/api/app/bsky/graph/getLists.d.ts.map +1 -1
  64. package/dist/api/app/bsky/graph/getLists.js +2 -1
  65. package/dist/api/app/bsky/graph/getLists.js.map +1 -1
  66. package/dist/api/app/bsky/graph/getListsWithMembership.js +1 -1
  67. package/dist/api/app/bsky/graph/getListsWithMembership.js.map +1 -1
  68. package/dist/api/app/bsky/graph/getMutes.d.ts.map +1 -1
  69. package/dist/api/app/bsky/graph/getMutes.js +1 -1
  70. package/dist/api/app/bsky/graph/getMutes.js.map +1 -1
  71. package/dist/api/app/bsky/graph/getStarterPack.d.ts.map +1 -1
  72. package/dist/api/app/bsky/graph/getStarterPack.js +2 -1
  73. package/dist/api/app/bsky/graph/getStarterPack.js.map +1 -1
  74. package/dist/api/app/bsky/graph/getStarterPacks.d.ts.map +1 -1
  75. package/dist/api/app/bsky/graph/getStarterPacks.js +2 -1
  76. package/dist/api/app/bsky/graph/getStarterPacks.js.map +1 -1
  77. package/dist/api/app/bsky/graph/getStarterPacksWithMembership.js +1 -1
  78. package/dist/api/app/bsky/graph/getStarterPacksWithMembership.js.map +1 -1
  79. package/dist/api/app/bsky/graph/searchStarterPacks.d.ts.map +1 -1
  80. package/dist/api/app/bsky/graph/searchStarterPacks.js +2 -1
  81. package/dist/api/app/bsky/graph/searchStarterPacks.js.map +1 -1
  82. package/dist/api/app/bsky/notification/listActivitySubscriptions.js +1 -1
  83. package/dist/api/app/bsky/notification/listActivitySubscriptions.js.map +1 -1
  84. package/dist/api/app/bsky/notification/listNotifications.d.ts.map +1 -1
  85. package/dist/api/app/bsky/notification/listNotifications.js +1 -1
  86. package/dist/api/app/bsky/notification/listNotifications.js.map +1 -1
  87. package/dist/api/app/bsky/unspecced/getPostThreadOtherV2.d.ts.map +1 -1
  88. package/dist/api/app/bsky/unspecced/getPostThreadOtherV2.js +2 -1
  89. package/dist/api/app/bsky/unspecced/getPostThreadOtherV2.js.map +1 -1
  90. package/dist/api/app/bsky/unspecced/getPostThreadV2.d.ts.map +1 -1
  91. package/dist/api/app/bsky/unspecced/getPostThreadV2.js +2 -1
  92. package/dist/api/app/bsky/unspecced/getPostThreadV2.js.map +1 -1
  93. package/dist/auth-verifier.d.ts +1 -0
  94. package/dist/auth-verifier.d.ts.map +1 -1
  95. package/dist/auth-verifier.js +1 -0
  96. package/dist/auth-verifier.js.map +1 -1
  97. package/dist/data-plane/client/index.d.ts.map +1 -1
  98. package/dist/data-plane/client/index.js +2 -0
  99. package/dist/data-plane/client/index.js.map +1 -1
  100. package/dist/data-plane/client/util.d.ts +2 -1
  101. package/dist/data-plane/client/util.d.ts.map +1 -1
  102. package/dist/data-plane/client/util.js +6 -1
  103. package/dist/data-plane/client/util.js.map +1 -1
  104. package/dist/data-plane/client/util.test.d.ts +2 -0
  105. package/dist/data-plane/client/util.test.d.ts.map +1 -0
  106. package/dist/data-plane/client/util.test.js +33 -0
  107. package/dist/data-plane/client/util.test.js.map +1 -0
  108. package/dist/data-plane/server/indexing/plugins/feed-generator.js +2 -1
  109. package/dist/data-plane/server/indexing/plugins/feed-generator.js.map +1 -1
  110. package/dist/data-plane/server/indexing/plugins/list.js +2 -1
  111. package/dist/data-plane/server/indexing/plugins/list.js.map +1 -1
  112. package/dist/data-plane/server/indexing/plugins/post.js +3 -3
  113. package/dist/data-plane/server/indexing/plugins/post.js.map +1 -1
  114. package/dist/data-plane/server/indexing/plugins/profile.js +3 -2
  115. package/dist/data-plane/server/indexing/plugins/profile.js.map +1 -1
  116. package/dist/hydration/hydrator.d.ts +5 -0
  117. package/dist/hydration/hydrator.d.ts.map +1 -1
  118. package/dist/hydration/hydrator.js +8 -0
  119. package/dist/hydration/hydrator.js.map +1 -1
  120. package/dist/hydration/util.d.ts +13 -7
  121. package/dist/hydration/util.d.ts.map +1 -1
  122. package/dist/hydration/util.js +30 -10
  123. package/dist/hydration/util.js.map +1 -1
  124. package/dist/lexicons/app/bsky/actor/defs.defs.d.ts +1 -0
  125. package/dist/lexicons/app/bsky/actor/defs.defs.d.ts.map +1 -1
  126. package/dist/lexicons/app/bsky/actor/defs.defs.js +1 -0
  127. package/dist/lexicons/app/bsky/actor/defs.defs.js.map +1 -1
  128. package/dist/lexicons/app/bsky/actor/profile.defs.d.ts.map +1 -1
  129. package/dist/lexicons/app/bsky/actor/profile.defs.js +2 -10
  130. package/dist/lexicons/app/bsky/actor/profile.defs.js.map +1 -1
  131. package/dist/lexicons/app/bsky/embed/external.defs.d.ts.map +1 -1
  132. package/dist/lexicons/app/bsky/embed/external.defs.js +1 -1
  133. package/dist/lexicons/app/bsky/embed/external.defs.js.map +1 -1
  134. package/dist/lexicons/app/bsky/embed/images.defs.d.ts +3 -0
  135. package/dist/lexicons/app/bsky/embed/images.defs.d.ts.map +1 -1
  136. package/dist/lexicons/app/bsky/embed/images.defs.js +1 -5
  137. package/dist/lexicons/app/bsky/embed/images.defs.js.map +1 -1
  138. package/dist/lexicons/app/bsky/embed/video.defs.d.ts.map +1 -1
  139. package/dist/lexicons/app/bsky/embed/video.defs.js +2 -6
  140. package/dist/lexicons/app/bsky/embed/video.defs.js.map +1 -1
  141. package/dist/lexicons/app/bsky/feed/generator.defs.d.ts.map +1 -1
  142. package/dist/lexicons/app/bsky/feed/generator.defs.js +1 -5
  143. package/dist/lexicons/app/bsky/feed/generator.defs.js.map +1 -1
  144. package/dist/lexicons/app/bsky/graph/list.defs.d.ts.map +1 -1
  145. package/dist/lexicons/app/bsky/graph/list.defs.js +1 -5
  146. package/dist/lexicons/app/bsky/graph/list.defs.js.map +1 -1
  147. package/dist/lexicons/app/bsky/video/defs.defs.js +1 -1
  148. package/dist/lexicons/app/bsky/video/defs.defs.js.map +1 -1
  149. package/dist/lexicons/com/atproto/repo/uploadBlob.defs.d.ts +2 -6
  150. package/dist/lexicons/com/atproto/repo/uploadBlob.defs.d.ts.map +1 -1
  151. package/dist/lexicons/com/atproto/repo/uploadBlob.defs.js +1 -1
  152. package/dist/lexicons/com/atproto/repo/uploadBlob.defs.js.map +1 -1
  153. package/dist/views/index.d.ts.map +1 -1
  154. package/dist/views/index.js +13 -8
  155. package/dist/views/index.js.map +1 -1
  156. package/dist/views/util.d.ts +1 -2
  157. package/dist/views/util.d.ts.map +1 -1
  158. package/dist/views/util.js +1 -5
  159. package/dist/views/util.js.map +1 -1
  160. package/package.json +10 -10
  161. package/src/api/app/bsky/actor/getProfile.ts +3 -1
  162. package/src/api/app/bsky/actor/getProfiles.ts +3 -1
  163. package/src/api/app/bsky/actor/searchActors.ts +3 -1
  164. package/src/api/app/bsky/bookmark/getBookmarks.ts +3 -6
  165. package/src/api/app/bsky/contact/getMatches.ts +3 -6
  166. package/src/api/app/bsky/feed/getAuthorFeed.ts +3 -1
  167. package/src/api/app/bsky/feed/getLikes.ts +3 -1
  168. package/src/api/app/bsky/feed/getPostThread.ts +2 -1
  169. package/src/api/app/bsky/feed/getQuotes.ts +3 -1
  170. package/src/api/app/bsky/feed/getRepostedBy.ts +3 -1
  171. package/src/api/app/bsky/feed/getTimeline.ts +3 -6
  172. package/src/api/app/bsky/feed/searchPosts.ts +3 -1
  173. package/src/api/app/bsky/graph/getActorStarterPacks.ts +3 -1
  174. package/src/api/app/bsky/graph/getBlocks.ts +3 -6
  175. package/src/api/app/bsky/graph/getFollowers.ts +3 -1
  176. package/src/api/app/bsky/graph/getFollows.ts +3 -1
  177. package/src/api/app/bsky/graph/getKnownFollowers.ts +3 -6
  178. package/src/api/app/bsky/graph/getList.ts +3 -1
  179. package/src/api/app/bsky/graph/getListBlocks.ts +3 -6
  180. package/src/api/app/bsky/graph/getListMutes.ts +3 -6
  181. package/src/api/app/bsky/graph/getLists.ts +3 -1
  182. package/src/api/app/bsky/graph/getListsWithMembership.ts +3 -3
  183. package/src/api/app/bsky/graph/getMutes.ts +3 -6
  184. package/src/api/app/bsky/graph/getStarterPack.ts +3 -1
  185. package/src/api/app/bsky/graph/getStarterPacks.ts +3 -1
  186. package/src/api/app/bsky/graph/getStarterPacksWithMembership.ts +3 -3
  187. package/src/api/app/bsky/graph/searchStarterPacks.ts +3 -1
  188. package/src/api/app/bsky/notification/listActivitySubscriptions.ts +3 -3
  189. package/src/api/app/bsky/notification/listNotifications.ts +3 -6
  190. package/src/api/app/bsky/unspecced/getPostThreadOtherV2.ts +2 -1
  191. package/src/api/app/bsky/unspecced/getPostThreadV2.ts +2 -1
  192. package/src/auth-verifier.ts +1 -0
  193. package/src/data-plane/client/index.ts +2 -0
  194. package/src/data-plane/client/util.test.ts +39 -0
  195. package/src/data-plane/client/util.ts +9 -1
  196. package/src/data-plane/server/indexing/plugins/feed-generator.ts +2 -2
  197. package/src/data-plane/server/indexing/plugins/list.ts +2 -2
  198. package/src/data-plane/server/indexing/plugins/post.ts +4 -4
  199. package/src/data-plane/server/indexing/plugins/profile.ts +3 -3
  200. package/src/hydration/hydrator.ts +8 -0
  201. package/src/hydration/util.ts +40 -21
  202. package/src/views/index.ts +19 -15
  203. package/src/views/util.ts +1 -5
  204. package/tests/views/__snapshots__/profile.test.ts.snap +3 -0
  205. package/tests/views/blocks.test.ts +69 -0
  206. package/tests/views/profile.test.ts +77 -0
  207. package/tsconfig.build.tsbuildinfo +1 -1
@@ -1,4 +1,4 @@
1
- import { AtUriString, BlobRef, DidString, UriString } from '@atproto/lex';
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;
@@ -1 +1 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/views/util.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACzE,OAAO,EACL,UAAU,EACV,UAAU,EACV,cAAc,EAOf,MAAM,YAAY,CAAA;AAEnB,eAAO,MAAM,eAAe,GAC1B,YAAY,MAAM,EAClB,UAAU,MAAM,EAChB,UAAU,UAAU,GAAG,IAAI,EAC3B,MAAM,UAAU,GAAG,IAAI,KACtB,gBAgCF,CAAA;AAED,KAAK,gBAAgB,GAAG;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,aAAa,CAAC,EAAE,WAAW,EAAE,CAAA;CAC9B,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,MAAM,OAAO,KAAG,MAE/C,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,iCAI3B;IACD,IAAI,EAAE,cAAc,GAAG,SAAS,CAAA;IAChC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;IAC7B,SAAS,EAAE,MAAM,CAAA;CAClB,KAAG,cAeH,CAAA;AAED,KAAK,cAAc,GAAG;IACpB,cAAc,EAAE;QACd,QAAQ,EAAE,OAAO,CAAA;KAClB,CAAA;CACF,CAAA;AAED,qBAAa,eAAe;IAExB,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE;QACZ,kBAAkB,EAAE,MAAM,CAAA;QAC1B,mBAAmB,EAAE,MAAM,CAAA;KAC5B;IAEH,QAAQ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AAM,CAAA;KAC5B;IAEH,QAAQ,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;QAAE,GAAG,EAAE,SAAS,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS;IAOlE,SAAS,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;QAAE,GAAG,EAAE,SAAS,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS;CAOpE"}
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.VideoUriBuilder = exports.parsePostgate = exports.cidFromBlobJson = exports.parseThreadGate = void 0;
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 } };
@@ -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,EAA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ACX,CAAA;IAChB,CAAC;CACF;AArBD,0CAqBC","sourcesContent":["import * as util from 'node:util'\nimport { AtUriString, BlobRef, 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 cidFromBlobJson = (json: BlobRef): string => {\n return json.ref.toString()\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"]}
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,KAAK,CAAC,IAAI,CAAC,4BAAiB,CAAC,CAAA;IACxD,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,6BAAkB,CAAC,CAAA;IACzD,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,8BAAmB,C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AC;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.224",
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.6",
56
- "@atproto/common": "^0.5.15",
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/repo": "^0.9.0",
60
- "@atproto/lex": "^0.0.23",
61
- "@atproto/sync": "^0.2.0",
62
- "@atproto/syntax": "^0.5.3",
63
- "@atproto/xrpc-server": "^0.10.18",
64
- "@atproto/identity": "^0.4.12"
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.217"
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 } = ctx.authVerifier.parseCreds(auth)
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 } = ctx.authVerifier.parseCreds(auth)
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 } = ctx.authVerifier.parseCreds(auth)
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 { HydrateCtx, Hydrator } from '../../../../hydration/hydrator'
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: HydrateCtx & { viewer: string }
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
- HydrateCtx,
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: HydrateCtx & { viewer: string }
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 } = ctx.authVerifier.parseCreds(auth)
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 } = ctx.authVerifier.parseCreds(auth)
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 } = ctx.authVerifier.parseCreds(auth)
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 } = ctx.authVerifier.parseCreds(auth)
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
- HydrateCtx,
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: HydrateCtx & { viewer: string }
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 } = ctx.authVerifier.parseCreds(auth)
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 } = ctx.authVerifier.parseCreds(auth)
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 { HydrateCtx, Hydrator } from '../../../../hydration/hydrator'
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: HydrateCtx & { viewer: string }
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 } = ctx.authVerifier.parseCreds(auth)
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 } = ctx.authVerifier.parseCreds(auth)
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 { HydrateCtx, Hydrator } from '../../../../hydration/hydrator'
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: HydrateCtx & { viewer: string }
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 } = ctx.authVerifier.parseCreds(auth)
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 { HydrateCtx, Hydrator } from '../../../../hydration/hydrator'
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: HydrateCtx & { viewer: string }
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 { HydrateCtx, Hydrator } from '../../../../hydration/hydrator'
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: HydrateCtx & { viewer: string }
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 } = ctx.authVerifier.parseCreds(auth)
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 { HydrateCtx, Hydrator } from '../../../../hydration/hydrator'
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: hydrateCtx.copy({ viewer }) },
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: HydrateCtx & { viewer: string }
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 { HydrateCtx, Hydrator } from '../../../../hydration/hydrator'
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: HydrateCtx & { viewer: string }
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 } = ctx.authVerifier.parseCreds(auth)
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 {