@atproto/bsky 0.0.282 → 0.1.0

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 (138) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/api/app/bsky/feed/getFeed.d.ts +8 -0
  3. package/dist/api/app/bsky/feed/getFeed.d.ts.map +1 -1
  4. package/dist/api/app/bsky/feed/getFeed.js +17 -0
  5. package/dist/api/app/bsky/feed/getFeed.js.map +1 -1
  6. package/dist/api/app/bsky/feed/getListFeed.d.ts +2 -1
  7. package/dist/api/app/bsky/feed/getListFeed.d.ts.map +1 -1
  8. package/dist/api/app/bsky/feed/getListFeed.js +17 -4
  9. package/dist/api/app/bsky/feed/getListFeed.js.map +1 -1
  10. package/dist/api/app/bsky/feed/getTimeline.d.ts +2 -1
  11. package/dist/api/app/bsky/feed/getTimeline.d.ts.map +1 -1
  12. package/dist/api/app/bsky/feed/getTimeline.js +17 -4
  13. package/dist/api/app/bsky/feed/getTimeline.js.map +1 -1
  14. package/dist/api/app/bsky/notification/constants.d.ts +37 -0
  15. package/dist/api/app/bsky/notification/constants.d.ts.map +1 -0
  16. package/dist/api/app/bsky/notification/constants.js +24 -0
  17. package/dist/api/app/bsky/notification/constants.js.map +1 -0
  18. package/dist/api/app/bsky/notification/getGroupedNotifications.d.ts +5 -0
  19. package/dist/api/app/bsky/notification/getGroupedNotifications.d.ts.map +1 -0
  20. package/dist/api/app/bsky/notification/getGroupedNotifications.js +349 -0
  21. package/dist/api/app/bsky/notification/getGroupedNotifications.js.map +1 -0
  22. package/dist/api/app/bsky/notification/grouping/algoGravity.d.ts +4 -0
  23. package/dist/api/app/bsky/notification/grouping/algoGravity.d.ts.map +1 -0
  24. package/dist/api/app/bsky/notification/grouping/algoGravity.js +141 -0
  25. package/dist/api/app/bsky/notification/grouping/algoGravity.js.map +1 -0
  26. package/dist/api/app/bsky/notification/grouping/algoLookback.d.ts +4 -0
  27. package/dist/api/app/bsky/notification/grouping/algoLookback.d.ts.map +1 -0
  28. package/dist/api/app/bsky/notification/grouping/algoLookback.js +61 -0
  29. package/dist/api/app/bsky/notification/grouping/algoLookback.js.map +1 -0
  30. package/dist/api/app/bsky/notification/grouping/grouping.d.ts +41 -0
  31. package/dist/api/app/bsky/notification/grouping/grouping.d.ts.map +1 -0
  32. package/dist/api/app/bsky/notification/grouping/grouping.js +54 -0
  33. package/dist/api/app/bsky/notification/grouping/grouping.js.map +1 -0
  34. package/dist/api/app/bsky/notification/grouping/shared.d.ts +8 -0
  35. package/dist/api/app/bsky/notification/grouping/shared.d.ts.map +1 -0
  36. package/dist/api/app/bsky/notification/grouping/shared.js +20 -0
  37. package/dist/api/app/bsky/notification/grouping/shared.js.map +1 -0
  38. package/dist/api/app/bsky/notification/grouping/spotlight.d.ts +3 -0
  39. package/dist/api/app/bsky/notification/grouping/spotlight.d.ts.map +1 -0
  40. package/dist/api/app/bsky/notification/grouping/spotlight.js +114 -0
  41. package/dist/api/app/bsky/notification/grouping/spotlight.js.map +1 -0
  42. package/dist/api/app/bsky/notification/listNotifications.d.ts +0 -7
  43. package/dist/api/app/bsky/notification/listNotifications.d.ts.map +1 -1
  44. package/dist/api/app/bsky/notification/listNotifications.js +7 -59
  45. package/dist/api/app/bsky/notification/listNotifications.js.map +1 -1
  46. package/dist/api/app/bsky/notification/updateSeen.d.ts.map +1 -1
  47. package/dist/api/app/bsky/notification/updateSeen.js +4 -3
  48. package/dist/api/app/bsky/notification/updateSeen.js.map +1 -1
  49. package/dist/api/app/bsky/notification/util.d.ts +8 -0
  50. package/dist/api/app/bsky/notification/util.d.ts.map +1 -1
  51. package/dist/api/app/bsky/notification/util.js +55 -0
  52. package/dist/api/app/bsky/notification/util.js.map +1 -1
  53. package/dist/api/index.d.ts.map +1 -1
  54. package/dist/api/index.js +2 -0
  55. package/dist/api/index.js.map +1 -1
  56. package/dist/api/util.d.ts +5 -0
  57. package/dist/api/util.d.ts.map +1 -1
  58. package/dist/api/util.js +4 -1
  59. package/dist/api/util.js.map +1 -1
  60. package/dist/config.d.ts +7 -0
  61. package/dist/config.d.ts.map +1 -1
  62. package/dist/config.js +19 -0
  63. package/dist/config.js.map +1 -1
  64. package/dist/data-plane/server/db/pagination.d.ts +7 -0
  65. package/dist/data-plane/server/db/pagination.d.ts.map +1 -1
  66. package/dist/data-plane/server/db/pagination.js +18 -2
  67. package/dist/data-plane/server/db/pagination.js.map +1 -1
  68. package/dist/data-plane/server/db/tables/notification.d.ts +2 -1
  69. package/dist/data-plane/server/db/tables/notification.d.ts.map +1 -1
  70. package/dist/data-plane/server/db/tables/notification.js.map +1 -1
  71. package/dist/data-plane/server/indexing/index.d.ts +2 -0
  72. package/dist/data-plane/server/indexing/index.d.ts.map +1 -1
  73. package/dist/data-plane/server/indexing/plugins/follow.d.ts +6 -9
  74. package/dist/data-plane/server/indexing/plugins/follow.d.ts.map +1 -1
  75. package/dist/data-plane/server/indexing/plugins/follow.js +13 -2
  76. package/dist/data-plane/server/indexing/plugins/follow.js.map +1 -1
  77. package/dist/data-plane/server/indexing/plugins/like.d.ts.map +1 -1
  78. package/dist/data-plane/server/indexing/plugins/like.js +3 -2
  79. package/dist/data-plane/server/indexing/plugins/like.js.map +1 -1
  80. package/dist/data-plane/server/indexing/plugins/post.d.ts.map +1 -1
  81. package/dist/data-plane/server/indexing/plugins/post.js +5 -4
  82. package/dist/data-plane/server/indexing/plugins/post.js.map +1 -1
  83. package/dist/data-plane/server/indexing/plugins/profile.d.ts.map +1 -1
  84. package/dist/data-plane/server/indexing/plugins/profile.js +2 -1
  85. package/dist/data-plane/server/indexing/plugins/profile.js.map +1 -1
  86. package/dist/data-plane/server/indexing/plugins/repost.d.ts.map +1 -1
  87. package/dist/data-plane/server/indexing/plugins/repost.js +3 -2
  88. package/dist/data-plane/server/indexing/plugins/repost.js.map +1 -1
  89. package/dist/data-plane/server/indexing/plugins/verification.d.ts.map +1 -1
  90. package/dist/data-plane/server/indexing/plugins/verification.js +3 -2
  91. package/dist/data-plane/server/indexing/plugins/verification.js.map +1 -1
  92. package/dist/data-plane/server/routes/feeds.d.ts +1 -1
  93. package/dist/data-plane/server/routes/feeds.d.ts.map +1 -1
  94. package/dist/data-plane/server/routes/feeds.js +35 -7
  95. package/dist/data-plane/server/routes/feeds.js.map +1 -1
  96. package/dist/data-plane/server/routes/notifs.d.ts.map +1 -1
  97. package/dist/data-plane/server/routes/notifs.js +67 -2
  98. package/dist/data-plane/server/routes/notifs.js.map +1 -1
  99. package/dist/hydration/hydrator.d.ts +2 -0
  100. package/dist/hydration/hydrator.d.ts.map +1 -1
  101. package/dist/hydration/hydrator.js +69 -1
  102. package/dist/hydration/hydrator.js.map +1 -1
  103. package/dist/lexicons/app/bsky/authManageNotifications.defs.d.ts.map +1 -1
  104. package/dist/lexicons/app/bsky/authManageNotifications.defs.js +1 -0
  105. package/dist/lexicons/app/bsky/authManageNotifications.defs.js.map +1 -1
  106. package/dist/lexicons/app/bsky/feed/getListFeed.defs.d.ts +4 -0
  107. package/dist/lexicons/app/bsky/feed/getListFeed.defs.d.ts.map +1 -1
  108. package/dist/lexicons/app/bsky/feed/getListFeed.defs.js +2 -0
  109. package/dist/lexicons/app/bsky/feed/getListFeed.defs.js.map +1 -1
  110. package/dist/lexicons/app/bsky/feed/getTimeline.defs.d.ts +4 -0
  111. package/dist/lexicons/app/bsky/feed/getTimeline.defs.d.ts.map +1 -1
  112. package/dist/lexicons/app/bsky/feed/getTimeline.defs.js +2 -0
  113. package/dist/lexicons/app/bsky/feed/getTimeline.defs.js.map +1 -1
  114. package/dist/lexicons/app/bsky/notification/getGroupedNotifications.d.ts +3 -0
  115. package/dist/lexicons/app/bsky/notification/getGroupedNotifications.d.ts.map +1 -0
  116. package/dist/lexicons/app/bsky/notification/getGroupedNotifications.defs.d.ts +299 -0
  117. package/dist/lexicons/app/bsky/notification/getGroupedNotifications.defs.d.ts.map +1 -0
  118. package/dist/lexicons/app/bsky/notification/getGroupedNotifications.defs.js +231 -0
  119. package/dist/lexicons/app/bsky/notification/getGroupedNotifications.defs.js.map +1 -0
  120. package/dist/lexicons/app/bsky/notification/getGroupedNotifications.js +6 -0
  121. package/dist/lexicons/app/bsky/notification/getGroupedNotifications.js.map +1 -0
  122. package/dist/lexicons/app/bsky/notification.d.ts +1 -0
  123. package/dist/lexicons/app/bsky/notification.d.ts.map +1 -1
  124. package/dist/lexicons/app/bsky/notification.js +1 -0
  125. package/dist/lexicons/app/bsky/notification.js.map +1 -1
  126. package/dist/proto/bsky_connect.d.ts +10 -1
  127. package/dist/proto/bsky_connect.d.ts.map +1 -1
  128. package/dist/proto/bsky_connect.js +10 -1
  129. package/dist/proto/bsky_connect.js.map +1 -1
  130. package/dist/proto/bsky_pb.d.ts +120 -25
  131. package/dist/proto/bsky_pb.d.ts.map +1 -1
  132. package/dist/proto/bsky_pb.js +166 -27
  133. package/dist/proto/bsky_pb.js.map +1 -1
  134. package/dist/views/index.d.ts +3 -0
  135. package/dist/views/index.d.ts.map +1 -1
  136. package/dist/views/index.js +133 -0
  137. package/dist/views/index.js.map +1 -1
  138. package/package.json +14 -14
@@ -1,8 +1,16 @@
1
1
  import type { Un$Typed } from '@atproto/lex';
2
+ import type { AtUriString, DidString } from '@atproto/syntax';
2
3
  import type { AppContext } from '../../../../context.js';
4
+ import type { HydrationState } from '../../../../hydration/hydrator.js';
3
5
  import type { app } from '../../../../lexicons/index.js';
4
6
  import { type NotificationPreferences } from '../../../../proto/bsky_pb.js';
5
7
  import { AppPlatform } from '../../../../proto/courier_pb.js';
8
+ import type { Views } from '../../../../views/index.js';
9
+ export declare const shouldFilterReplyByThreadgate: (reason: string, uri: AtUriString, viewer: string, hydration: HydrationState, views: Views) => boolean;
10
+ export declare const shouldFilterHiddenThreadTag: (reason: string, uri: AtUriString, did: DidString, hydration: HydrationState, hiddenTags: ReadonlySet<string>) => boolean;
11
+ export declare const shouldFilterForNeedsReview: (reason: string, did: DidString, uri: AtUriString, hydration: HydrationState, views: Views) => boolean;
12
+ /** Applies the configured delay to the notification cursor timestamp. */
13
+ export declare const delayCursor: (cursorStr: string | undefined, delayMs: number) => string;
6
14
  type DeepPartial<T> = T extends object ? {
7
15
  [P in keyof T]?: DeepPartial<T[P]>;
8
16
  } : T;
@@ -1 +1 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/notification/util.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAE5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACxD,OAAO,EAKL,KAAK,uBAAuB,EAC7B,MAAM,8BAA8B,CAAA;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAA;AAE7D,KAAK,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAClC;KACG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACnC,GACD,CAAC,CAAA;AAEL,KAAK,0BAA0B,GAC7B,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;AAoBlD,eAAO,MAAM,4BAA4B,YAC9B,0BAA0B,WAC1B,OAAO,CAAC,0BAA0B,CAAC,KAC3C,0BAQF,CAAA;AAED,eAAO,MAAM,0BAA0B,QAChC,UAAU,YACL,MAAM,KACf,OAAO,CAAC,0BAA0B,CAoBpC,CAAA;AA0DD,eAAO,MAAM,uBAAuB,EAAE,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,cAI9D,CAAA;AAqBH,eAAO,MAAM,aAAa,QACnB,WAAW,CAAC,uBAAuB,CAAC,KACxC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,WAkB7B,CAAA;AAED,KAAK,WAAW,GAAG,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C,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACnC,GACD,CAAC,CAAA;AAEL,KAAK,0BAA0B,GAC7B,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;AAoBlD,eAAO,MAAM,4BAA4B,YAC9B,0BAA0B,WAC1B,OAAO,CAAC,0BAA0B,CAAC,KAC3C,0BAQF,CAAA;AAED,eAAO,MAAM,0BAA0B,QAChC,UAAU,YACL,MAAM,KACf,OAAO,CAAC,0BAA0B,CAoBpC,CAAA;AA0DD,eAAO,MAAM,uBAAuB,EAAE,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,cAI9D,CAAA;AAqBH,eAAO,MAAM,aAAa,QACnB,WAAW,CAAC,uBAAuB,CAAC,KACxC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,WAkB7B,CAAA;AAED,KAAK,WAAW,GAAG,KAAK,GAAG,SAAS,GAAG,KAAK,CAAA;AAE5C,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,QAAQ,IAAI,WAAW,CAIjC;AAED,eAAO,MAAM,0BAA0B,aAAc,MAAM,KAAG,WAKvC,CAAA"}
@@ -2,6 +2,61 @@ import assert from 'node:assert';
2
2
  import { UpstreamFailureError } from '@atproto/xrpc-server';
3
3
  import { NotificationInclude, } from '../../../../proto/bsky_pb.js';
4
4
  import { AppPlatform } from '../../../../proto/courier_pb.js';
5
+ import { uriToDid } from '../../../../util/uris.js';
6
+ import { isPostRecordType } from '../../../../views/types.js';
7
+ import { NOTIFICATION_REASON } from './constants.js';
8
+ export const shouldFilterReplyByThreadgate = (reason, uri, viewer, hydration, views) => {
9
+ if (reason !== NOTIFICATION_REASON.REPLY)
10
+ return false;
11
+ const post = hydration.posts?.get(uri);
12
+ if (!post)
13
+ return false;
14
+ // Filter out hidden replies only if the viewer owns
15
+ // the threadgate and they hid the reply.
16
+ const rootUri = isPostRecordType(post.record)
17
+ ? post.record.reply?.root.uri
18
+ : undefined;
19
+ return Boolean(rootUri &&
20
+ uriToDid(rootUri) === viewer &&
21
+ views.replyIsHiddenByThreadgate(uri, rootUri, hydration));
22
+ };
23
+ export const shouldFilterHiddenThreadTag = (reason, uri, did, hydration, hiddenTags) => {
24
+ if (reason !== NOTIFICATION_REASON.REPLY &&
25
+ reason !== NOTIFICATION_REASON.QUOTE &&
26
+ reason !== NOTIFICATION_REASON.MENTION) {
27
+ return false;
28
+ }
29
+ const post = hydration.posts?.get(uri);
30
+ if (!post || hydration.profileViewers?.get(did)?.following)
31
+ return false;
32
+ // Filter out notifications from users that have thread hide tags and are from people they
33
+ // are not following.
34
+ for (const tag of post.tags) {
35
+ if (hiddenTags.has(tag))
36
+ return true;
37
+ }
38
+ return false;
39
+ };
40
+ export const shouldFilterForNeedsReview = (reason, did, uri, hydration, views) => {
41
+ // Filter out notifications from users that need review unless moots.
42
+ const applies = reason === NOTIFICATION_REASON.REPLY ||
43
+ reason === NOTIFICATION_REASON.QUOTE ||
44
+ reason === NOTIFICATION_REASON.MENTION ||
45
+ reason === NOTIFICATION_REASON.LIKE ||
46
+ reason === NOTIFICATION_REASON.FOLLOW ||
47
+ reason === NOTIFICATION_REASON.FOLLOW_BACK;
48
+ return applies && !views.viewerSeesNeedsReview({ did, uri }, hydration);
49
+ };
50
+ /** Applies the configured delay to the notification cursor timestamp. */
51
+ export const delayCursor = (cursorStr, delayMs) => {
52
+ const nowMinusDelay = Date.now() - delayMs;
53
+ if (cursorStr === undefined)
54
+ return new Date(nowMinusDelay).toISOString();
55
+ const cursor = new Date(cursorStr).getTime();
56
+ if (isNaN(cursor))
57
+ return cursorStr;
58
+ return new Date(Math.min(cursor, nowMinusDelay)).toISOString();
59
+ };
5
60
  const notificationPreferenceKeys = Object.keys({
6
61
  chat: true,
7
62
  follow: true,
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sour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,MAAM,UAAU,iBAAiB,CAC/B,QAAgB;IAEhB,IAAI,QAAQ,KAAK,KAAK,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,KAAK,EAAE,CAAC;QACvE,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAA;IAC9E,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,QAAgB,EAAe,EAAE,CAC1E,QAAQ,KAAK,KAAK;IAChB,CAAC,CAAC,WAAW,CAAC,GAAG;IACjB,CAAC,CAAC,QAAQ,KAAK,SAAS;QACtB,CAAC,CAAC,WAAW,CAAC,OAAO;QACrB,CAAC,CAAC,WAAW,CAAC,GAAG,CAAA","sourcesContent":["import assert from 'node:assert'\nimport type { Un$Typed } from '@atproto/lex'\nimport { UpstreamFailureError } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport type { app } from '../../../../lexicons/index.js'\nimport {\n type FilterableNotificationPreference,\n type GetNotificationPreferencesResponse,\n NotificationInclude,\n type NotificationPreference,\n type NotificationPreferences,\n} from '../../../../proto/bsky_pb.js'\nimport { AppPlatform } from '../../../../proto/courier_pb.js'\n\ntype DeepPartial<T> = T extends object\n ? {\n [P in keyof T]?: DeepPartial<T[P]>\n }\n : T\n\ntype LexNotificationPreferences =\n Un$Typed<app.bsky.notification.defs.Preferences>\n\nconst notificationPreferenceKeys = Object.keys({\n chat: true,\n follow: true,\n like: true,\n likeViaRepost: true,\n mention: true,\n quote: true,\n reply: true,\n repost: true,\n repostViaRepost: true,\n starterpackJoined: true,\n subscribedPost: true,\n unverified: true,\n verified: true,\n} satisfies Record<keyof LexNotificationPreferences, true>) as Array<\n keyof LexNotificationPreferences\n>\n\nexport const mergeNotificationPreferences = (\n current: LexNotificationPreferences,\n updates: Partial<LexNotificationPreferences>,\n): LexNotificationPreferences => {\n const preferences = { ...current }\n for (const key of notificationPreferenceKeys) {\n if (updates[key] !== undefined) {\n Object.assign(preferences, { [key]: updates[key] })\n }\n }\n return preferences\n}\n\nexport const getNotificationPreferences = async (\n ctx: AppContext,\n actorDid: string,\n): Promise<LexNotificationPreferences> => {\n let res: GetNotificationPreferencesResponse\n try {\n res = await ctx.dataplane.getNotificationPreferences({\n dids: [actorDid],\n })\n } catch (err) {\n throw new UpstreamFailureError(\n 'cannot get current notification preferences',\n 'NotificationPreferencesFailed',\n { cause: err },\n )\n }\n\n assert(\n res.preferences.length === 1,\n `expected exactly one preferences entry, got ${res.preferences.length}`,\n )\n\n return protobufToLex(res.preferences[0])\n}\n\nconst ensureChatPreference = (\n p?: DeepPartial<app.bsky.notification.defs.ChatPreference>,\n): app.bsky.notification.defs.ChatPreference => {\n const includeValues = ['all', 'accepted']\n return {\n include:\n typeof p?.include === 'string' && includeValues.includes(p.include)\n ? p.include\n : 'all',\n push: p?.push ?? true,\n }\n}\n\nconst ensureFilterablePreference = (\n p?: DeepPartial<app.bsky.notification.defs.FilterablePreference>,\n): app.bsky.notification.defs.FilterablePreference => {\n const includeValues = ['all', 'follows']\n return {\n include:\n typeof p?.include === 'string' && includeValues.includes(p.include)\n ? p.include\n : 'all',\n list: p?.list ?? true,\n push: p?.push ?? true,\n }\n}\n\nconst ensurePreference = (\n p?: DeepPartial<app.bsky.notification.defs.Preference>,\n): app.bsky.notification.defs.Preference => {\n return {\n list: p?.list ?? true,\n push: p?.push ?? true,\n }\n}\n\nconst ensurePreferences = (\n p: DeepPartial<app.bsky.notification.defs.Preferences>,\n): app.bsky.notification.defs.Preferences => {\n return {\n chat: ensureChatPreference(p.chat),\n follow: ensureFilterablePreference(p.follow),\n like: ensureFilterablePreference(p.like),\n likeViaRepost: ensureFilterablePreference(p.likeViaRepost),\n mention: ensureFilterablePreference(p.mention),\n quote: ensureFilterablePreference(p.quote),\n reply: ensureFilterablePreference(p.reply),\n repost: ensureFilterablePreference(p.repost),\n repostViaRepost: ensureFilterablePreference(p.repostViaRepost),\n starterpackJoined: ensurePreference(p.starterpackJoined),\n subscribedPost: ensurePreference(p.subscribedPost),\n unverified: ensurePreference(p.unverified),\n verified: ensurePreference(p.verified),\n }\n}\n\nexport const DEFAULT_CHAT_PREFERENCE: app.bsky.notification.defs.ChatPreference =\n {\n include: 'all',\n push: true,\n }\n\nconst protobufFilterablePreferenceToLex = (\n p?: DeepPartial<FilterableNotificationPreference>,\n): Partial<app.bsky.notification.defs.FilterablePreference> => {\n return {\n include: p?.include === NotificationInclude.FOLLOWS ? 'follows' : 'all',\n list: p?.list?.enabled,\n push: p?.push?.enabled,\n }\n}\n\nconst protobufPreferenceToLex = (\n p?: DeepPartial<NotificationPreference>,\n): Partial<app.bsky.notification.defs.Preference> => {\n return {\n list: p?.list?.enabled,\n push: p?.push?.enabled,\n }\n}\n\nexport const protobufToLex = (\n res: DeepPartial<NotificationPreferences>,\n): app.bsky.notification.defs.Preferences => {\n return ensurePreferences({\n // NOTE: See the deprecation notice on the lexicon. This field returns a static default value and shouldn't be used.\n // Use the chat.bsky.notification.defs#preferences type instead.\n chat: DEFAULT_CHAT_PREFERENCE,\n follow: protobufFilterablePreferenceToLex(res.follow),\n like: protobufFilterablePreferenceToLex(res.like),\n likeViaRepost: protobufFilterablePreferenceToLex(res.likeViaRepost),\n mention: protobufFilterablePreferenceToLex(res.mention),\n quote: protobufFilterablePreferenceToLex(res.quote),\n reply: protobufFilterablePreferenceToLex(res.reply),\n repost: protobufFilterablePreferenceToLex(res.repost),\n repostViaRepost: protobufFilterablePreferenceToLex(res.repostViaRepost),\n starterpackJoined: protobufPreferenceToLex(res.starterpackJoined),\n subscribedPost: protobufPreferenceToLex(res.subscribedPost),\n unverified: protobufPreferenceToLex(res.unverified),\n verified: protobufPreferenceToLex(res.verified),\n })\n}\n\ntype LexPlatform = 'ios' | 'android' | 'web'\n\nexport function assertLexPlatform(\n platform: string,\n): asserts platform is LexPlatform {\n if (platform !== 'ios' && platform !== 'android' && platform !== 'web') {\n throw new Error('Unsupported platform: must be \"ios\", \"android\", or \"web\".')\n }\n}\n\nexport const lexPlatformToProtoPlatform = (platform: string): AppPlatform =>\n platform === 'ios'\n ? AppPlatform.IOS\n : platform === 'android'\n ? AppPlatform.ANDROID\n : AppPlatform.WEB\n"]}
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/notification/util.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAGhC,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAI3D,OAAO,EAGL,mBAAmB,GAGpB,MAAM,8BAA8B,CAAA;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAA;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAEnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAEpD,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAC3C,MAAc,EACd,GAAgB,EAChB,MAAc,EACd,SAAyB,EACzB,KAAY,EACH,EAAE;IACX,IAAI,MAAM,KAAK,mBAAmB,CAAC,KAAK;QAAE,OAAO,KAAK,CAAA;IAEtD,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,CAAC,CAAA;IACtC,IAAI,CAAC,IAAI;QAAE,OAAO,KAAK,CAAA;IAEvB,oDAAoD;IACpD,yCAAyC;IACzC,MAAM,OAAO,GAAG,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC;QAC3C,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG;QAC7B,CAAC,CAAC,SAAS,CAAA;IACb,OAAO,OAAO,CACZ,OAAO;QACP,QAAQ,CAAC,OAAO,CAAC,KAAK,MAAM;QAC5B,KAAK,CAAC,yBAAyB,CAAC,GAAG,EAAE,OAAO,EAAE,SAAS,CAAC,CACzD,CAAA;AACH,CAAC,CAAA;A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AC;QACjE,cAAc,EAAE,uBAAuB,CAAC,GAAG,CAAC,cAAc,CAAC;QAC3D,UAAU,EAAE,uBAAuB,CAAC,GAAG,CAAC,UAAU,CAAC;QACnD,QAAQ,EAAE,uBAAuB,CAAC,GAAG,CAAC,QAAQ,CAAC;KAChD,CAAC,CAAA;AACJ,CAAC,CAAA;AAID,MAAM,UAAU,iBAAiB,CAC/B,QAAgB;IAEhB,IAAI,QAAQ,KAAK,KAAK,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,KAAK,EAAE,CAAC;QACvE,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAA;IAC9E,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,QAAgB,EAAe,EAAE,CAC1E,QAAQ,KAAK,KAAK;IAChB,CAAC,CAAC,WAAW,CAAC,GAAG;IACjB,CAAC,CAAC,QAAQ,KAAK,SAAS;QACtB,CAAC,CAAC,WAAW,CAAC,OAAO;QACrB,CAAC,CAAC,WAAW,CAAC,GAAG,CAAA","sourcesContent":["import assert from 'node:assert'\nimport type { Un$Typed } from '@atproto/lex'\nimport type { AtUriString, DidString } from '@atproto/syntax'\nimport { UpstreamFailureError } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport type { HydrationState } from '../../../../hydration/hydrator.js'\nimport type { app } from '../../../../lexicons/index.js'\nimport {\n type FilterableNotificationPreference,\n type GetNotificationPreferencesResponse,\n NotificationInclude,\n type NotificationPreference,\n type NotificationPreferences,\n} from '../../../../proto/bsky_pb.js'\nimport { AppPlatform } from '../../../../proto/courier_pb.js'\nimport { uriToDid } from '../../../../util/uris.js'\nimport type { Views } from '../../../../views/index.js'\nimport { isPostRecordType } from '../../../../views/types.js'\nimport { NOTIFICATION_REASON } from './constants.js'\n\nexport const shouldFilterReplyByThreadgate = (\n reason: string,\n uri: AtUriString,\n viewer: string,\n hydration: HydrationState,\n views: Views,\n): boolean => {\n if (reason !== NOTIFICATION_REASON.REPLY) return false\n\n const post = hydration.posts?.get(uri)\n if (!post) return false\n\n // Filter out hidden replies only if the viewer owns\n // the threadgate and they hid the reply.\n const rootUri = isPostRecordType(post.record)\n ? post.record.reply?.root.uri\n : undefined\n return Boolean(\n rootUri &&\n uriToDid(rootUri) === viewer &&\n views.replyIsHiddenByThreadgate(uri, rootUri, hydration),\n )\n}\n\nexport const shouldFilterHiddenThreadTag = (\n reason: string,\n uri: AtUriString,\n did: DidString,\n hydration: HydrationState,\n hiddenTags: ReadonlySet<string>,\n): boolean => {\n if (\n reason !== NOTIFICATION_REASON.REPLY &&\n reason !== NOTIFICATION_REASON.QUOTE &&\n reason !== NOTIFICATION_REASON.MENTION\n ) {\n return false\n }\n\n const post = hydration.posts?.get(uri)\n if (!post || hydration.profileViewers?.get(did)?.following) return false\n\n // Filter out notifications from users that have thread hide tags and are from people they\n // are not following.\n for (const tag of post.tags) {\n if (hiddenTags.has(tag)) return true\n }\n return false\n}\n\nexport const shouldFilterForNeedsReview = (\n reason: string,\n did: DidString,\n uri: AtUriString,\n hydration: HydrationState,\n views: Views,\n): boolean => {\n // Filter out notifications from users that need review unless moots.\n const applies =\n reason === NOTIFICATION_REASON.REPLY ||\n reason === NOTIFICATION_REASON.QUOTE ||\n reason === NOTIFICATION_REASON.MENTION ||\n reason === NOTIFICATION_REASON.LIKE ||\n reason === NOTIFICATION_REASON.FOLLOW ||\n reason === NOTIFICATION_REASON.FOLLOW_BACK\n return applies && !views.viewerSeesNeedsReview({ did, uri }, hydration)\n}\n\n/** Applies the configured delay to the notification cursor timestamp. */\nexport const delayCursor = (\n cursorStr: string | undefined,\n delayMs: number,\n): string => {\n const nowMinusDelay = Date.now() - delayMs\n if (cursorStr === undefined) return new Date(nowMinusDelay).toISOString()\n const cursor = new Date(cursorStr).getTime()\n if (isNaN(cursor)) return cursorStr\n return new Date(Math.min(cursor, nowMinusDelay)).toISOString()\n}\n\ntype DeepPartial<T> = T extends object\n ? {\n [P in keyof T]?: DeepPartial<T[P]>\n }\n : T\n\ntype LexNotificationPreferences =\n Un$Typed<app.bsky.notification.defs.Preferences>\n\nconst notificationPreferenceKeys = Object.keys({\n chat: true,\n follow: true,\n like: true,\n likeViaRepost: true,\n mention: true,\n quote: true,\n reply: true,\n repost: true,\n repostViaRepost: true,\n starterpackJoined: true,\n subscribedPost: true,\n unverified: true,\n verified: true,\n} satisfies Record<keyof LexNotificationPreferences, true>) as Array<\n keyof LexNotificationPreferences\n>\n\nexport const mergeNotificationPreferences = (\n current: LexNotificationPreferences,\n updates: Partial<LexNotificationPreferences>,\n): LexNotificationPreferences => {\n const preferences = { ...current }\n for (const key of notificationPreferenceKeys) {\n if (updates[key] !== undefined) {\n Object.assign(preferences, { [key]: updates[key] })\n }\n }\n return preferences\n}\n\nexport const getNotificationPreferences = async (\n ctx: AppContext,\n actorDid: string,\n): Promise<LexNotificationPreferences> => {\n let res: GetNotificationPreferencesResponse\n try {\n res = await ctx.dataplane.getNotificationPreferences({\n dids: [actorDid],\n })\n } catch (err) {\n throw new UpstreamFailureError(\n 'cannot get current notification preferences',\n 'NotificationPreferencesFailed',\n { cause: err },\n )\n }\n\n assert(\n res.preferences.length === 1,\n `expected exactly one preferences entry, got ${res.preferences.length}`,\n )\n\n return protobufToLex(res.preferences[0])\n}\n\nconst ensureChatPreference = (\n p?: DeepPartial<app.bsky.notification.defs.ChatPreference>,\n): app.bsky.notification.defs.ChatPreference => {\n const includeValues = ['all', 'accepted']\n return {\n include:\n typeof p?.include === 'string' && includeValues.includes(p.include)\n ? p.include\n : 'all',\n push: p?.push ?? true,\n }\n}\n\nconst ensureFilterablePreference = (\n p?: DeepPartial<app.bsky.notification.defs.FilterablePreference>,\n): app.bsky.notification.defs.FilterablePreference => {\n const includeValues = ['all', 'follows']\n return {\n include:\n typeof p?.include === 'string' && includeValues.includes(p.include)\n ? p.include\n : 'all',\n list: p?.list ?? true,\n push: p?.push ?? true,\n }\n}\n\nconst ensurePreference = (\n p?: DeepPartial<app.bsky.notification.defs.Preference>,\n): app.bsky.notification.defs.Preference => {\n return {\n list: p?.list ?? true,\n push: p?.push ?? true,\n }\n}\n\nconst ensurePreferences = (\n p: DeepPartial<app.bsky.notification.defs.Preferences>,\n): app.bsky.notification.defs.Preferences => {\n return {\n chat: ensureChatPreference(p.chat),\n follow: ensureFilterablePreference(p.follow),\n like: ensureFilterablePreference(p.like),\n likeViaRepost: ensureFilterablePreference(p.likeViaRepost),\n mention: ensureFilterablePreference(p.mention),\n quote: ensureFilterablePreference(p.quote),\n reply: ensureFilterablePreference(p.reply),\n repost: ensureFilterablePreference(p.repost),\n repostViaRepost: ensureFilterablePreference(p.repostViaRepost),\n starterpackJoined: ensurePreference(p.starterpackJoined),\n subscribedPost: ensurePreference(p.subscribedPost),\n unverified: ensurePreference(p.unverified),\n verified: ensurePreference(p.verified),\n }\n}\n\nexport const DEFAULT_CHAT_PREFERENCE: app.bsky.notification.defs.ChatPreference =\n {\n include: 'all',\n push: true,\n }\n\nconst protobufFilterablePreferenceToLex = (\n p?: DeepPartial<FilterableNotificationPreference>,\n): Partial<app.bsky.notification.defs.FilterablePreference> => {\n return {\n include: p?.include === NotificationInclude.FOLLOWS ? 'follows' : 'all',\n list: p?.list?.enabled,\n push: p?.push?.enabled,\n }\n}\n\nconst protobufPreferenceToLex = (\n p?: DeepPartial<NotificationPreference>,\n): Partial<app.bsky.notification.defs.Preference> => {\n return {\n list: p?.list?.enabled,\n push: p?.push?.enabled,\n }\n}\n\nexport const protobufToLex = (\n res: DeepPartial<NotificationPreferences>,\n): app.bsky.notification.defs.Preferences => {\n return ensurePreferences({\n // NOTE: See the deprecation notice on the lexicon. This field returns a static default value and shouldn't be used.\n // Use the chat.bsky.notification.defs#preferences type instead.\n chat: DEFAULT_CHAT_PREFERENCE,\n follow: protobufFilterablePreferenceToLex(res.follow),\n like: protobufFilterablePreferenceToLex(res.like),\n likeViaRepost: protobufFilterablePreferenceToLex(res.likeViaRepost),\n mention: protobufFilterablePreferenceToLex(res.mention),\n quote: protobufFilterablePreferenceToLex(res.quote),\n reply: protobufFilterablePreferenceToLex(res.reply),\n repost: protobufFilterablePreferenceToLex(res.repost),\n repostViaRepost: protobufFilterablePreferenceToLex(res.repostViaRepost),\n starterpackJoined: protobufPreferenceToLex(res.starterpackJoined),\n subscribedPost: protobufPreferenceToLex(res.subscribedPost),\n unverified: protobufPreferenceToLex(res.unverified),\n verified: protobufPreferenceToLex(res.verified),\n })\n}\n\ntype LexPlatform = 'ios' | 'android' | 'web'\n\nexport function assertLexPlatform(\n platform: string,\n): asserts platform is LexPlatform {\n if (platform !== 'ios' && platform !== 'android' && platform !== 'web') {\n throw new Error('Unsupported platform: must be \"ios\", \"android\", or \"web\".')\n }\n}\n\nexport const lexPlatformToProtoPlatform = (platform: string): AppPlatform =>\n platform === 'ios'\n ? AppPlatform.IOS\n : platform === 'android'\n ? AppPlatform.ANDROID\n : AppPlatform.WEB\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAsG/C,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AAErC,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAA;AAE5C,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAA;AAElD,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AAEzC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAEvC,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAwGvD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAuG/C,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AAErC,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAA;AAE5C,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAA;AAElD,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AAEzC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAEvC,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAyGvD"}
package/dist/api/index.js CHANGED
@@ -63,6 +63,7 @@ import unmuteActor from './app/bsky/graph/unmuteActor.js';
63
63
  import unmuteActorList from './app/bsky/graph/unmuteActorList.js';
64
64
  import unmuteThread from './app/bsky/graph/unmuteThread.js';
65
65
  import getLabelerServices from './app/bsky/labeler/getServices.js';
66
+ import getGroupedNotifications from './app/bsky/notification/getGroupedNotifications.js';
66
67
  import getPreferences from './app/bsky/notification/getPreferences.js';
67
68
  import getUnreadCount from './app/bsky/notification/getUnreadCount.js';
68
69
  import listActivitySubscriptions from './app/bsky/notification/listActivitySubscriptions.js';
@@ -183,6 +184,7 @@ export default function (server, ctx) {
183
184
  getUnreadCount(server, ctx);
184
185
  listActivitySubscriptions(server, ctx);
185
186
  listNotifications(server, ctx);
187
+ getGroupedNotifications(server, ctx);
186
188
  putActivitySubscription(server, ctx);
187
189
  updateSeen(server, ctx);
188
190
  putPreferences(server, ctx);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,MAAM,gCAAgC,CAAA;AACvD,OAAO,WAAW,MAAM,iCAAiC,CAAA;AACzD,OAAO,cAAc,MAAM,oCAAoC,CAAA;AAC/D,OAAO,YAAY,MAAM,kCAAkC,CAAA;AAC3D,OAAO,qBAAqB,MAAM,2CAA2C,CAAA;AAC7E,OAAO,OAAO,MAAM,kCAAkC,CAAA;AACtD,OAAO,WAA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AG,CAAC,CAAA;IAC7B,mBAAmB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAChC,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC5B,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC1B,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACtB,WAAW,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACxB,WAAW,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACxB,gBAAgB;IAChB,mBAAmB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAClC,CAAC","sourcesContent":["import type { Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../context.js'\nimport getProfile from './app/bsky/actor/getProfile.js'\nimport getProfiles from './app/bsky/actor/getProfiles.js'\nimport getSuggestions from './app/bsky/actor/getSuggestions.js'\nimport searchActors from './app/bsky/actor/searchActors.js'\nimport searchActorsTypeahead from './app/bsky/actor/searchActorsTypeahead.js'\nimport aaBegin from './app/bsky/ageassurance/begin.js'\nimport aaGetConfig from './app/bsky/ageassurance/getConfig.js'\nimport aaGetState from './app/bsky/ageassurance/getState.js'\nimport createBookmark from './app/bsky/bookmark/createBookmark.js'\nimport deleteBookmark from './app/bsky/bookmark/deleteBookmark.js'\nimport getBookmarks from './app/bsky/bookmark/getBookmarks.js'\nimport dismissMatch from './app/bsky/contact/dismissMatch.js'\nimport getMatches from './app/bsky/contact/getMatches.js'\nimport getSyncStatus from './app/bsky/contact/getSyncStatus.js'\nimport importContacts from './app/bsky/contact/importContacts.js'\nimport removeData from './app/bsky/contact/removeData.js'\nimport sendNotification from './app/bsky/contact/sendNotification.js'\nimport startPhoneVerification from './app/bsky/contact/startPhoneVerification.js'\nimport verifyPhone from './app/bsky/contact/verifyPhone.js'\nimport createDraft from './app/bsky/draft/createDraft.js'\nimport deleteDraft from './app/bsky/draft/deleteDraft.js'\nimport getDrafts from './app/bsky/draft/getDrafts.js'\nimport updateDraft from './app/bsky/draft/updateDraft.js'\nimport getEmbedExternalView from './app/bsky/embed/getEmbedExternalView.js'\nimport getActorFeeds from './app/bsky/feed/getActorFeeds.js'\nimport getActorLikes from './app/bsky/feed/getActorLikes.js'\nimport getAuthorFeed from './app/bsky/feed/getAuthorFeed.js'\nimport getFeed from './app/bsky/feed/getFeed.js'\nimport getFeedGenerator from './app/bsky/feed/getFeedGenerator.js'\nimport getFeedGenerators from './app/bsky/feed/getFeedGenerators.js'\nimport getLikes from './app/bsky/feed/getLikes.js'\nimport getListFeed from './app/bsky/feed/getListFeed.js'\nimport getPostThread from './app/bsky/feed/getPostThread.js'\nimport getPosts from './app/bsky/feed/getPosts.js'\nimport getQuotes from './app/bsky/feed/getQuotes.js'\nimport getRepostedBy from './app/bsky/feed/getRepostedBy.js'\nimport getSuggestedFeeds from './app/bsky/feed/getSuggestedFeeds.js'\nimport getTimeline from './app/bsky/feed/getTimeline.js'\nimport searchPosts from './app/bsky/feed/searchPosts.js'\nimport searchPostsV2 from './app/bsky/feed/searchPostsV2.js'\nimport getActorStarterPacks from './app/bsky/graph/getActorStarterPacks.js'\nimport getBlocks from './app/bsky/graph/getBlocks.js'\nimport getFollowers from './app/bsky/graph/getFollowers.js'\nimport getFollows from './app/bsky/graph/getFollows.js'\nimport getKnownFollowers from './app/bsky/graph/getKnownFollowers.js'\nimport getList from './app/bsky/graph/getList.js'\nimport getListBlocks from './app/bsky/graph/getListBlocks.js'\nimport getListMutes from './app/bsky/graph/getListMutes.js'\nimport getLists from './app/bsky/graph/getLists.js'\nimport getListsWithMembership from './app/bsky/graph/getListsWithMembership.js'\nimport getMutes from './app/bsky/graph/getMutes.js'\nimport getRelationships from './app/bsky/graph/getRelationships.js'\nimport getStarterPack from './app/bsky/graph/getStarterPack.js'\nimport getStarterPacks from './app/bsky/graph/getStarterPacks.js'\nimport getStarterPacksWithMembership from './app/bsky/graph/getStarterPacksWithMembership.js'\nimport getSuggestedFollowsByActor from './app/bsky/graph/getSuggestedFollowsByActor.js'\nimport muteActor from './app/bsky/graph/muteActor.js'\nimport muteActorList from './app/bsky/graph/muteActorList.js'\nimport muteThread from './app/bsky/graph/muteThread.js'\nimport searchStarterPacks from './app/bsky/graph/searchStarterPacks.js'\nimport searchStarterPacksV2 from './app/bsky/graph/searchStarterPacksV2.js'\nimport unmuteActor from './app/bsky/graph/unmuteActor.js'\nimport unmuteActorList from './app/bsky/graph/unmuteActorList.js'\nimport unmuteThread from './app/bsky/graph/unmuteThread.js'\nimport getLabelerServices from './app/bsky/labeler/getServices.js'\nimport getPreferences from './app/bsky/notification/getPreferences.js'\nimport getUnreadCount from './app/bsky/notification/getUnreadCount.js'\nimport listActivitySubscriptions from './app/bsky/notification/listActivitySubscriptions.js'\nimport listNotifications from './app/bsky/notification/listNotifications.js'\nimport putActivitySubscription from './app/bsky/notification/putActivitySubscription.js'\nimport putPreferences from './app/bsky/notification/putPreferences.js'\nimport putPreferencesV2 from './app/bsky/notification/putPreferencesV2.js'\nimport registerPush from './app/bsky/notification/registerPush.js'\nimport unregisterPush from './app/bsky/notification/unregisterPush.js'\nimport updateSeen from './app/bsky/notification/updateSeen.js'\nimport getAgeAssuranceState from './app/bsky/unspecced/getAgeAssuranceState.js'\nimport getConfig from './app/bsky/unspecced/getConfig.js'\nimport getOnboardingSuggestedStarterPacks from './app/bsky/unspecced/getOnboardingSuggestedStarterPacks.js'\nimport getPopularFeedGenerators from './app/bsky/unspecced/getPopularFeedGenerators.js'\nimport getPostThreadOtherV2 from './app/bsky/unspecced/getPostThreadOtherV2.js'\nimport getPostThreadV2 from './app/bsky/unspecced/getPostThreadV2.js'\nimport getUnspeccedSuggestedFeeds from './app/bsky/unspecced/getSuggestedFeeds.js'\nimport getSuggestedOnboardingUsers from './app/bsky/unspecced/getSuggestedOnboardingUsers.js'\nimport getSuggestedStarterPacks from './app/bsky/unspecced/getSuggestedStarterPacks.js'\nimport getSuggestedUsers from './app/bsky/unspecced/getSuggestedUsers.js'\nimport getSuggestedUsersForDiscover from './app/bsky/unspecced/getSuggestedUsersForDiscover.js'\nimport getSuggestedUsersForExplore from './app/bsky/unspecced/getSuggestedUsersForExplore.js'\nimport getSuggestedUsersForSeeMore from './app/bsky/unspecced/getSuggestedUsersForSeeMore.js'\nimport getTaggedSuggestions from './app/bsky/unspecced/getTaggedSuggestions.js'\nimport getTrendingTopics from './app/bsky/unspecced/getTrendingTopics.js'\nimport getTrends from './app/bsky/unspecced/getTrends.js'\nimport initAgeAssurance from './app/bsky/unspecced/initAgeAssurance.js'\nimport getAccountInfos from './com/atproto/admin/getAccountInfos.js'\nimport getSubjectStatus from './com/atproto/admin/getSubjectStatus.js'\nimport updateSubjectStatus from './com/atproto/admin/updateSubjectStatus.js'\nimport resolveHandle from './com/atproto/identity/resolveHandle.js'\nimport queryLabels from './com/atproto/label/queryLabels.js'\nimport getRecord from './com/atproto/repo/getRecord.js'\nimport fetchLabels from './com/atproto/temp/fetchLabels.js'\nimport internalGetProfiles from './internal/bsky/actor/getProfiles.js'\n\nexport * as health from './health.js'\n\nexport * as wellKnown from './well-known.js'\n\nexport * as blobResolver from './blob-resolver.js'\n\nexport * as external from './external.js'\n\nexport * as sitemap from './sitemap.js'\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 getEmbedExternalView(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 searchPostsV2(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 searchStarterPacksV2(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 // internal.bsky\n internalGetProfiles(server, ctx)\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,MAAM,gCAAgC,CAAA;AACvD,OAAO,WAAW,MAAM,iCAAiC,CAAA;AACzD,OAAO,cAAc,MAAM,oCAAoC,CAAA;AAC/D,OAAO,YAAY,MAAM,kCAAkC,CAAA;AAC3D,OAAO,qBAAqB,MAAM,2CAA2C,CAAA;AAC7E,OAAO,OAAO,MAAM,kCAAkC,CAAA;AACtD,OAAO,WAAW,MAAM,sCAAsC,CAAA;AAC9D,OAAO,UAAU,MAAM,qCAAqC,CAAA;AAC5D,OAAO,cAAc,MAAM,uCAAuC,CAAA;AAClE,OAAO,cAAc,MAAM,uCAAuC,CAAA;AAClE,OAAO,YAAY,MAAM,qCAAqC,CAAA;AAC9D,OAAO,YAAY,MAAM,oCAAoC,CAAA;AAC7D,OAAO,UAAU,MAAM,kCAAkC,CAAA;AACzD,OAAO,aAAa,MAAM,qCAAqC,CAAA;AAC/D,OAAO,cAAc,MAAM,sCAAsC,CAAA;AACjE,OAAO,UAAU,MAAM,kCAAkC,CAAA;AACzD,OAAO,gBAAgB,MAAM,wCAAwC,CAAA;AACrE,OAAO,sBAAsB,MAAM,8CAA8C,CAAA;AACjF,OAAO,WAAW,MAAM,mCAAmC,CAAA;AAC3D,OAAO,WAAW,MAAM,iCAAiC,CAAA;AACzD,OAAO,WAAW,MAAM,iCAAiC,CAAA;AACzD,OAAO,SAAS,MAAM,+BAA+B,CAAA;AACrD,OAAO,WAAW,MAAM,iCAAiC,CAAA;AACzD,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M,EAAE,GAAG,CAAC,CAAA;IACvB,cAAc,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,gBAAgB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC7B,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACzB,cAAc,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACtB,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACrC,oBAAoB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACjC,oBAAoB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACjC,gBAAgB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC7B,WAAW,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACxB,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACvB,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACpB,cAAc;IACd,gBAAgB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC7B,mBAAmB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAChC,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC5B,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC1B,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACtB,WAAW,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACxB,WAAW,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACxB,gBAAgB;IAChB,mBAAmB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAClC,CAAC","sourcesContent":["import type { Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../context.js'\nimport getProfile from './app/bsky/actor/getProfile.js'\nimport getProfiles from './app/bsky/actor/getProfiles.js'\nimport getSuggestions from './app/bsky/actor/getSuggestions.js'\nimport searchActors from './app/bsky/actor/searchActors.js'\nimport searchActorsTypeahead from './app/bsky/actor/searchActorsTypeahead.js'\nimport aaBegin from './app/bsky/ageassurance/begin.js'\nimport aaGetConfig from './app/bsky/ageassurance/getConfig.js'\nimport aaGetState from './app/bsky/ageassurance/getState.js'\nimport createBookmark from './app/bsky/bookmark/createBookmark.js'\nimport deleteBookmark from './app/bsky/bookmark/deleteBookmark.js'\nimport getBookmarks from './app/bsky/bookmark/getBookmarks.js'\nimport dismissMatch from './app/bsky/contact/dismissMatch.js'\nimport getMatches from './app/bsky/contact/getMatches.js'\nimport getSyncStatus from './app/bsky/contact/getSyncStatus.js'\nimport importContacts from './app/bsky/contact/importContacts.js'\nimport removeData from './app/bsky/contact/removeData.js'\nimport sendNotification from './app/bsky/contact/sendNotification.js'\nimport startPhoneVerification from './app/bsky/contact/startPhoneVerification.js'\nimport verifyPhone from './app/bsky/contact/verifyPhone.js'\nimport createDraft from './app/bsky/draft/createDraft.js'\nimport deleteDraft from './app/bsky/draft/deleteDraft.js'\nimport getDrafts from './app/bsky/draft/getDrafts.js'\nimport updateDraft from './app/bsky/draft/updateDraft.js'\nimport getEmbedExternalView from './app/bsky/embed/getEmbedExternalView.js'\nimport getActorFeeds from './app/bsky/feed/getActorFeeds.js'\nimport getActorLikes from './app/bsky/feed/getActorLikes.js'\nimport getAuthorFeed from './app/bsky/feed/getAuthorFeed.js'\nimport getFeed from './app/bsky/feed/getFeed.js'\nimport getFeedGenerator from './app/bsky/feed/getFeedGenerator.js'\nimport getFeedGenerators from './app/bsky/feed/getFeedGenerators.js'\nimport getLikes from './app/bsky/feed/getLikes.js'\nimport getListFeed from './app/bsky/feed/getListFeed.js'\nimport getPostThread from './app/bsky/feed/getPostThread.js'\nimport getPosts from './app/bsky/feed/getPosts.js'\nimport getQuotes from './app/bsky/feed/getQuotes.js'\nimport getRepostedBy from './app/bsky/feed/getRepostedBy.js'\nimport getSuggestedFeeds from './app/bsky/feed/getSuggestedFeeds.js'\nimport getTimeline from './app/bsky/feed/getTimeline.js'\nimport searchPosts from './app/bsky/feed/searchPosts.js'\nimport searchPostsV2 from './app/bsky/feed/searchPostsV2.js'\nimport getActorStarterPacks from './app/bsky/graph/getActorStarterPacks.js'\nimport getBlocks from './app/bsky/graph/getBlocks.js'\nimport getFollowers from './app/bsky/graph/getFollowers.js'\nimport getFollows from './app/bsky/graph/getFollows.js'\nimport getKnownFollowers from './app/bsky/graph/getKnownFollowers.js'\nimport getList from './app/bsky/graph/getList.js'\nimport getListBlocks from './app/bsky/graph/getListBlocks.js'\nimport getListMutes from './app/bsky/graph/getListMutes.js'\nimport getLists from './app/bsky/graph/getLists.js'\nimport getListsWithMembership from './app/bsky/graph/getListsWithMembership.js'\nimport getMutes from './app/bsky/graph/getMutes.js'\nimport getRelationships from './app/bsky/graph/getRelationships.js'\nimport getStarterPack from './app/bsky/graph/getStarterPack.js'\nimport getStarterPacks from './app/bsky/graph/getStarterPacks.js'\nimport getStarterPacksWithMembership from './app/bsky/graph/getStarterPacksWithMembership.js'\nimport getSuggestedFollowsByActor from './app/bsky/graph/getSuggestedFollowsByActor.js'\nimport muteActor from './app/bsky/graph/muteActor.js'\nimport muteActorList from './app/bsky/graph/muteActorList.js'\nimport muteThread from './app/bsky/graph/muteThread.js'\nimport searchStarterPacks from './app/bsky/graph/searchStarterPacks.js'\nimport searchStarterPacksV2 from './app/bsky/graph/searchStarterPacksV2.js'\nimport unmuteActor from './app/bsky/graph/unmuteActor.js'\nimport unmuteActorList from './app/bsky/graph/unmuteActorList.js'\nimport unmuteThread from './app/bsky/graph/unmuteThread.js'\nimport getLabelerServices from './app/bsky/labeler/getServices.js'\nimport getGroupedNotifications from './app/bsky/notification/getGroupedNotifications.js'\nimport getPreferences from './app/bsky/notification/getPreferences.js'\nimport getUnreadCount from './app/bsky/notification/getUnreadCount.js'\nimport listActivitySubscriptions from './app/bsky/notification/listActivitySubscriptions.js'\nimport listNotifications from './app/bsky/notification/listNotifications.js'\nimport putActivitySubscription from './app/bsky/notification/putActivitySubscription.js'\nimport putPreferences from './app/bsky/notification/putPreferences.js'\nimport putPreferencesV2 from './app/bsky/notification/putPreferencesV2.js'\nimport registerPush from './app/bsky/notification/registerPush.js'\nimport unregisterPush from './app/bsky/notification/unregisterPush.js'\nimport updateSeen from './app/bsky/notification/updateSeen.js'\nimport getAgeAssuranceState from './app/bsky/unspecced/getAgeAssuranceState.js'\nimport getConfig from './app/bsky/unspecced/getConfig.js'\nimport getOnboardingSuggestedStarterPacks from './app/bsky/unspecced/getOnboardingSuggestedStarterPacks.js'\nimport getPopularFeedGenerators from './app/bsky/unspecced/getPopularFeedGenerators.js'\nimport getPostThreadOtherV2 from './app/bsky/unspecced/getPostThreadOtherV2.js'\nimport getPostThreadV2 from './app/bsky/unspecced/getPostThreadV2.js'\nimport getUnspeccedSuggestedFeeds from './app/bsky/unspecced/getSuggestedFeeds.js'\nimport getSuggestedOnboardingUsers from './app/bsky/unspecced/getSuggestedOnboardingUsers.js'\nimport getSuggestedStarterPacks from './app/bsky/unspecced/getSuggestedStarterPacks.js'\nimport getSuggestedUsers from './app/bsky/unspecced/getSuggestedUsers.js'\nimport getSuggestedUsersForDiscover from './app/bsky/unspecced/getSuggestedUsersForDiscover.js'\nimport getSuggestedUsersForExplore from './app/bsky/unspecced/getSuggestedUsersForExplore.js'\nimport getSuggestedUsersForSeeMore from './app/bsky/unspecced/getSuggestedUsersForSeeMore.js'\nimport getTaggedSuggestions from './app/bsky/unspecced/getTaggedSuggestions.js'\nimport getTrendingTopics from './app/bsky/unspecced/getTrendingTopics.js'\nimport getTrends from './app/bsky/unspecced/getTrends.js'\nimport initAgeAssurance from './app/bsky/unspecced/initAgeAssurance.js'\nimport getAccountInfos from './com/atproto/admin/getAccountInfos.js'\nimport getSubjectStatus from './com/atproto/admin/getSubjectStatus.js'\nimport updateSubjectStatus from './com/atproto/admin/updateSubjectStatus.js'\nimport resolveHandle from './com/atproto/identity/resolveHandle.js'\nimport queryLabels from './com/atproto/label/queryLabels.js'\nimport getRecord from './com/atproto/repo/getRecord.js'\nimport fetchLabels from './com/atproto/temp/fetchLabels.js'\nimport internalGetProfiles from './internal/bsky/actor/getProfiles.js'\n\nexport * as health from './health.js'\n\nexport * as wellKnown from './well-known.js'\n\nexport * as blobResolver from './blob-resolver.js'\n\nexport * as external from './external.js'\n\nexport * as sitemap from './sitemap.js'\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 getEmbedExternalView(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 searchPostsV2(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 searchStarterPacksV2(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 getGroupedNotifications(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 // internal.bsky\n internalGetProfiles(server, ctx)\n}\n"]}
@@ -22,6 +22,11 @@ export declare const fillPage: <F extends PageFetch<{
22
22
  cursor?: string;
23
23
  limit: number;
24
24
  maxRequests?: number;
25
+ /**
26
+ * Cursor marking the end of a bounded range. Reaching it stops the refill,
27
+ * and it is returned untouched rather than read as an exhausted page.
28
+ */
29
+ terminalCursor?: string;
25
30
  fetch: F;
26
31
  items: (result: Awaited<ReturnType<F>>) => T[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;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,KAAK,EAAE,CAAC,CAAA;IACR,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAA;CAC/C,KAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAiCjC,CAAA;AAMD,eAAO,MAAM,uBAAuB,QAC7B;IAAE,OAAO,EAAE,mBAAmB,CAAA;CAAE,OAChC,YAAY,KAChB,OAMF,CAAA"}
package/dist/api/util.js CHANGED
@@ -28,7 +28,10 @@ export const fillPage = async (opts) => {
28
28
  }));
29
29
  const items = opts.items(result);
30
30
  let cursor = result.cursor || undefined;
31
- for (let requests = 1; requests < maxRequests && cursor && items.length < enoughItems; requests++) {
31
+ for (let requests = 1; requests < maxRequests &&
32
+ cursor &&
33
+ cursor !== opts.terminalCursor &&
34
+ items.length < enoughItems; requests++) {
32
35
  const previousCursor = cursor;
33
36
  const page = (await opts.fetch({
34
37
  cursor,
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/api/util.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAErE,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAA;AAC5C,MAAM,CAAC,MAAM,wBAAwB,GAAG,0BAA0B,CAAA;AAClE,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,CAAA;AAOlD,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,IAA4B,EACJ,EAAE;IAC1B,MAAM,OAAO,GAAG,EAAE,CAAA;IAClB,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;QAClB,OAAO,CAAC,wBAAwB,CAAC,GAAG,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACxE,CAAC;IACD,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QAC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,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA;QAC/B,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,SAAS,CAAA;QACjC,IAAI,MAAM,KAAK,cAAc,EAAE,CAAC;YAC9B,MAAM,GAAG,SAAS,CAAA;YAClB,MAAK;QACP,CAAC;QACD,IAAI,CAAC,MAAM;YAAE,MAAK;IACpB,CAAC;IACD,OAAO,EAAE,GAAG,MAAM,EAAE,MAAM,EAA4B,CAAA;AACxD,CAAC,CAAA;AAED,4EAA4E;AAC5E,qFAAqF;AACrF,MAAM,yBAAyB,GAAG,2BAA2B,CAAA;AAE7D,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,GAAqC,EACrC,GAAiB,EACR,EAAE;IACX,MAAM,QAAQ,GAAG,GAAG,CAAC,sBAAsB,CAAA;IAC3C,IAAI,CAAC,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC3B,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAA;IACpD,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;IAC7D,OAAO,MAAM,KAAK,QAAQ,CAAA;AAC5B,CAAC,CAAA","sourcesContent":["import type { IncomingHttpHeaders } from 'node:http'\nimport type { ServerConfig } from '../config.js'\nimport { type ParsedLabelers, formatLabelerHeader } from '../util.js'\n\nexport const BSKY_USER_AGENT = 'BskyAppView'\nexport const ATPROTO_CONTENT_LABELERS = 'Atproto-Content-Labelers'\nexport const ATPROTO_REPO_REV = 'Atproto-Repo-Rev'\n\ntype ResHeaderOpts = {\n labelers: ParsedLabelers\n repoRev: string | null\n}\n\nexport const resHeaders = (\n opts: Partial<ResHeaderOpts>,\n): Record<string, string> => {\n const headers = {}\n if (opts.labelers) {\n headers[ATPROTO_CONTENT_LABELERS] = formatLabelerHeader(opts.labelers)\n }\n if (opts.repoRev) {\n headers[ATPROTO_REPO_REV] = opts.repoRev\n }\n return headers\n}\n\nexport const clearlyBadCursor = (cursor?: string) => {\n // hallmark of v1 cursor, highly unlikely in v2 cursors based on time or rkeys\n return !!cursor?.includes('::')\n}\n\nconst DEFAULT_FILL_PAGE_MAX_REQUESTS = 10\n\ntype PageFetch<R extends { cursor?: string }> = (params: {\n cursor?: string\n limit: number\n}) => Promise<R>\n\nexport const fillPage = async <\n F extends PageFetch<{ cursor?: string }>,\n T,\n>(opts: {\n cursor?: string\n limit: number\n maxRequests?: number\n fetch: F\n items: (result: Awaited<ReturnType<F>>) => T[]\n}): Promise<Awaited<ReturnType<F>>> => {\n const maxRequests = opts.maxRequests ?? DEFAULT_FILL_PAGE_MAX_REQUESTS\n // Refilling is only worth its cost while the page is mostly empty: a page\n // that already holds half of what was asked for is served as is.\n const enoughItems = Math.ceil(opts.limit / 2)\n const result = (await opts.fetch({\n cursor: opts.cursor,\n limit: opts.limit,\n })) as Awaited<ReturnType<F>>\n const items = opts.items(result)\n let cursor = result.cursor || undefined\n for (\n let requests = 1;\n requests < maxRequests && cursor && items.length < enoughItems;\n requests++\n ) {\n const previousCursor = cursor\n const page = (await opts.fetch({\n cursor,\n limit: opts.limit - items.length,\n })) as Awaited<ReturnType<F>>\n items.push(...opts.items(page))\n cursor = page.cursor || undefined\n if (cursor === previousCursor) {\n cursor = undefined\n break\n }\n if (!cursor) break\n }\n return { ...result, cursor } as Awaited<ReturnType<F>>\n}\n\n// @TEMPORARY backdoor to force search v2 via a request header, gated by the\n// BSKY_SEARCH_V2_OVERRIDE_HEADER env var. Remove once search v2 is fully rolled out.\nconst SEARCH_V2_OVERRIDE_HEADER = 'x-bsky-search-v2-override'\n\nexport const resolveSearchV2Override = (\n req: { headers: IncomingHttpHeaders },\n cfg: ServerConfig,\n): boolean => {\n const expected = cfg.searchV2OverrideHeader\n if (!expected) return false\n const value = req.headers[SEARCH_V2_OVERRIDE_HEADER]\n const header = Array.isArray(value) ? value.join(',') : value\n return header === expected\n}\n"]}
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/api/util.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAErE,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAA;AAC5C,MAAM,CAAC,MAAM,wBAAwB,GAAG,0BAA0B,CAAA;AAClE,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,CAAA;AAOlD,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,IAA4B,EACJ,EAAE;IAC1B,MAAM,OAAO,GAAG,EAAE,CAAA;IAClB,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;QAClB,OAAO,CAAC,wBAAwB,CAAC,GAAG,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACxE,CAAC;IACD,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC,OAAO,CAAA;IAC1C,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAAe,EAAE,EAAE;IAClD,8EAA8E;IAC9E,OAAO,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAA;AACjC,CAAC,CAAA;AAED,MAAM,8BAA8B,GAAG,EAAE,CAAA;AAOzC,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,EAG3B,IAWD,EAAmC,EAAE;IACpC,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,IAAI,8BAA8B,CAAA;IACtE,0EAA0E;IAC1E,iEAAiE;IACjE,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAA;IAC7C,MAAM,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC;QAC/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,OAAO,CAAC,yBAAyB,CAAC,CAAA;IACpD,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;IAC7D,OAAO,MAAM,KAAK,QAAQ,CAAA;AAC5B,CAAC,CAAA","sourcesContent":["import type { IncomingHttpHeaders } from 'node:http'\nimport type { ServerConfig } from '../config.js'\nimport { type ParsedLabelers, formatLabelerHeader } from '../util.js'\n\nexport const BSKY_USER_AGENT = 'BskyAppView'\nexport const ATPROTO_CONTENT_LABELERS = 'Atproto-Content-Labelers'\nexport const ATPROTO_REPO_REV = 'Atproto-Repo-Rev'\n\ntype ResHeaderOpts = {\n labelers: ParsedLabelers\n repoRev: string | null\n}\n\nexport const resHeaders = (\n opts: Partial<ResHeaderOpts>,\n): Record<string, string> => {\n const headers = {}\n if (opts.labelers) {\n headers[ATPROTO_CONTENT_LABELERS] = formatLabelerHeader(opts.labelers)\n }\n if (opts.repoRev) {\n headers[ATPROTO_REPO_REV] = opts.repoRev\n }\n return headers\n}\n\nexport const clearlyBadCursor = (cursor?: string) => {\n // hallmark of v1 cursor, highly unlikely in v2 cursors based on time or rkeys\n return !!cursor?.includes('::')\n}\n\nconst DEFAULT_FILL_PAGE_MAX_REQUESTS = 10\n\ntype PageFetch<R extends { cursor?: string }> = (params: {\n cursor?: string\n limit: number\n}) => Promise<R>\n\nexport const fillPage = async <\n F extends PageFetch<{ cursor?: string }>,\n T,\n>(opts: {\n cursor?: string\n limit: number\n maxRequests?: number\n /**\n * Cursor marking the end of a bounded range. Reaching it stops the refill,\n * and it is returned untouched rather than read as an exhausted page.\n */\n terminalCursor?: string\n fetch: F\n items: (result: Awaited<ReturnType<F>>) => T[]\n}): Promise<Awaited<ReturnType<F>>> => {\n const maxRequests = opts.maxRequests ?? DEFAULT_FILL_PAGE_MAX_REQUESTS\n // Refilling is only worth its cost while the page is mostly empty: a page\n // that already holds half of what was asked for is served as is.\n const enoughItems = Math.ceil(opts.limit / 2)\n const result = (await opts.fetch({\n cursor: opts.cursor,\n limit: opts.limit,\n })) as Awaited<ReturnType<F>>\n const items = opts.items(result)\n let cursor = result.cursor || undefined\n for (\n let requests = 1;\n requests < maxRequests &&\n cursor &&\n cursor !== opts.terminalCursor &&\n items.length < enoughItems;\n requests++\n ) {\n const previousCursor = cursor\n const page = (await opts.fetch({\n cursor,\n limit: opts.limit - items.length,\n })) as Awaited<ReturnType<F>>\n items.push(...opts.items(page))\n cursor = page.cursor || undefined\n if (cursor === previousCursor) {\n cursor = undefined\n break\n }\n if (!cursor) break\n }\n return { ...result, cursor } as Awaited<ReturnType<F>>\n}\n\n// @TEMPORARY backdoor to force search v2 via a request header, gated by the\n// BSKY_SEARCH_V2_OVERRIDE_HEADER env var. Remove once search v2 is fully rolled out.\nconst SEARCH_V2_OVERRIDE_HEADER = 'x-bsky-search-v2-override'\n\nexport const resolveSearchV2Override = (\n req: { headers: IncomingHttpHeaders },\n cfg: ServerConfig,\n): boolean => {\n const expected = cfg.searchV2OverrideHeader\n if (!expected) return false\n const value = req.headers[SEARCH_V2_OVERRIDE_HEADER]\n const header = Array.isArray(value) ? value.join(',') : value\n return header === expected\n}\n"]}
package/dist/config.d.ts CHANGED
@@ -3,6 +3,7 @@ type LiveNowConfig = {
3
3
  did: DidString;
4
4
  domains: string[];
5
5
  }[];
6
+ export type NotificationsV2Algorithm = 'algoGravity' | 'algoLookback';
6
7
  export interface KwsConfig {
7
8
  apiKey: string;
8
9
  apiOrigin: string;
@@ -61,6 +62,8 @@ export interface ServerConfigValues {
61
62
  topicsUrl?: string;
62
63
  topicsApiKey?: string;
63
64
  irisUrl?: string;
65
+ irisServiceDid?: DidString;
66
+ trendingFeedDid?: DidString;
64
67
  irisFeedUris?: Set<string>;
65
68
  irisStagingUrl?: string;
66
69
  irisStagingFeedUris?: Set<string>;
@@ -89,6 +92,7 @@ export interface ServerConfigValues {
89
92
  visibilityTagHide: string;
90
93
  visibilityTagRankPrefix: string;
91
94
  notificationsDelayMs?: number;
95
+ notificationsV2Algorithm?: NotificationsV2Algorithm;
92
96
  clientCheckEmailConfirmed?: boolean;
93
97
  topicsEnabled?: boolean;
94
98
  disableSsrfProtection?: boolean;
@@ -143,6 +147,8 @@ export declare class ServerConfig {
143
147
  get topicsUrl(): string | undefined;
144
148
  get topicsApiKey(): string | undefined;
145
149
  get irisUrl(): string | undefined;
150
+ get irisServiceDid(): `did:${string}:${string}` | undefined;
151
+ get trendingFeedDid(): `did:${string}:${string}` | undefined;
146
152
  get irisFeedUris(): Set<string> | undefined;
147
153
  get irisStagingUrl(): string | undefined;
148
154
  get irisStagingFeedUris(): Set<string> | undefined;
@@ -173,6 +179,7 @@ export declare class ServerConfig {
173
179
  get visibilityTagHide(): string;
174
180
  get visibilityTagRankPrefix(): string;
175
181
  get notificationsDelayMs(): number;
182
+ get notificationsV2Algorithm(): NotificationsV2Algorithm;
176
183
  get disableSsrfProtection(): boolean;
177
184
  get proxyAllowHTTP2(): boolean;
178
185
  get proxyConnectTimeout(): number | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAe,MAAM,cAAc,CAAA;AAG1D,KAAK,aAAa,GAAG;IACnB,GAAG,EAAE,SAAS,CAAA;IACd,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB,EAAE,CAAA;AAEH,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAA;IAC1B;;OAEG;IACH,aAAa,EAAE,MAAM,CAAA;IACrB;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IAAI,oBAAoB,WAEvB;IAED,IAAI,wBAAwB,IAAI,wBAAwB,CAEvD;IAED,IAAI,qBAAqB,IAAI,OAAO,CAEnC;IAED,IAAI,eAAe,IAAI,OAAO,CAE7B;IAED,IAAI,mBAAmB,IAAI,MAAM,GAAG,SAAS,CAE5C;IAED,IAAI,mBAAmB,IAAI,MAAM,CAEhC;IAED,IAAI,gBAAgB,IAAI,MAAM,CAE7B;IAED,IAAI,oBAAoB,IAAI,MAAM,CAEjC;IAED,IAAI,eAAe,IAAI,MAAM,CAE5B;IAED,IAAI,qBAAqB,IAAI,OAAO,CAEnC;IAED,IAAI,GAAG,0BAEN;IAED,IAAI,qBAAqB,gBAExB;IAED,IAAI,WAAW,WAEd;IAED,IAAI,sBAAsB,uBAEzB;CACF"}
package/dist/config.js CHANGED
@@ -54,6 +54,10 @@ export class ServerConfig {
54
54
  const topicsUrl = process.env.BSKY_TOPICS_URL || undefined;
55
55
  const topicsApiKey = process.env.BSKY_TOPICS_API_KEY;
56
56
  const irisUrl = process.env.BSKY_IRIS_URL || undefined;
57
+ const irisServiceDid = process.env.BSKY_IRIS_SERVICE_DID || undefined;
58
+ assert(irisServiceDid == null || isDidString(irisServiceDid));
59
+ const trendingFeedDid = process.env.BSKY_TRENDING_FEED_DID || undefined;
60
+ assert(trendingFeedDid == null || isDidString(trendingFeedDid));
57
61
  const irisFeedUris = new Set(envList(process.env.BSKY_IRIS_FEED_URIS));
58
62
  const irisStagingUrl = process.env.BSKY_IRIS_STAGING_URL || undefined;
59
63
  const irisStagingFeedUris = new Set(envList(process.env.BSKY_IRIS_STAGING_FEED_URIS));
@@ -120,6 +124,9 @@ export class ServerConfig {
120
124
  const notificationsDelayMs = process.env.BSKY_NOTIFICATIONS_DELAY_MS
121
125
  ? parseInt(process.env.BSKY_NOTIFICATIONS_DELAY_MS || '', 10)
122
126
  : 0;
127
+ const notificationsV2Algorithm = process.env.BSKY_NOTIFICATIONS_V2_ALGORITHM === 'algoLookback'
128
+ ? 'algoLookback'
129
+ : 'algoGravity';
123
130
  const disableSsrfProtection = process.env.BSKY_DISABLE_SSRF_PROTECTION
124
131
  ? process.env.BSKY_DISABLE_SSRF_PROTECTION === 'true'
125
132
  : debugMode;
@@ -201,6 +208,8 @@ export class ServerConfig {
201
208
  topicsUrl,
202
209
  topicsApiKey,
203
210
  irisUrl,
211
+ irisServiceDid,
212
+ trendingFeedDid,
204
213
  irisFeedUris,
205
214
  irisStagingUrl,
206
215
  irisStagingFeedUris,
@@ -243,6 +252,7 @@ export class ServerConfig {
243
252
  visibilityTagHide,
244
253
  visibilityTagRankPrefix,
245
254
  notificationsDelayMs,
255
+ notificationsV2Algorithm,
246
256
  disableSsrfProtection,
247
257
  proxyAllowHTTP2,
248
258
  proxyConnectTimeout,
@@ -361,6 +371,12 @@ export class ServerConfig {
361
371
  get irisUrl() {
362
372
  return this.cfg.irisUrl;
363
373
  }
374
+ get irisServiceDid() {
375
+ return this.cfg.irisServiceDid;
376
+ }
377
+ get trendingFeedDid() {
378
+ return this.cfg.trendingFeedDid;
379
+ }
364
380
  get irisFeedUris() {
365
381
  return this.cfg.irisFeedUris;
366
382
  }
@@ -451,6 +467,9 @@ export class ServerConfig {
451
467
  get notificationsDelayMs() {
452
468
  return this.cfg.notificationsDelayMs ?? 0;
453
469
  }
470
+ get notificationsV2Algorithm() {
471
+ return this.cfg.notificationsV2Algorithm ?? 'algoGravity';
472
+ }
454
473
  get disableSsrfProtection() {
455
474
  return this.cfg.disableSsrfProtection ?? false;
456
475
  }