@atproto/bsky 0.0.155 → 0.0.157

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 (144) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/api/app/bsky/{unspecced/getPostThreadHiddenV2.d.ts → notification/getPreferences.d.ts} +1 -1
  3. package/dist/api/app/bsky/notification/getPreferences.d.ts.map +1 -0
  4. package/dist/api/app/bsky/notification/getPreferences.js +39 -0
  5. package/dist/api/app/bsky/notification/getPreferences.js.map +1 -0
  6. package/dist/api/app/bsky/notification/putPreferencesV2.d.ts +4 -0
  7. package/dist/api/app/bsky/notification/putPreferencesV2.d.ts.map +1 -0
  8. package/dist/api/app/bsky/notification/putPreferencesV2.js +47 -0
  9. package/dist/api/app/bsky/notification/putPreferencesV2.js.map +1 -0
  10. package/dist/api/app/bsky/notification/util.d.ts +9 -0
  11. package/dist/api/app/bsky/notification/util.d.ts.map +1 -0
  12. package/dist/api/app/bsky/notification/util.js +84 -0
  13. package/dist/api/app/bsky/notification/util.js.map +1 -0
  14. package/dist/api/app/bsky/unspecced/getPostThreadOtherV2.d.ts +4 -0
  15. package/dist/api/app/bsky/unspecced/getPostThreadOtherV2.d.ts.map +1 -0
  16. package/dist/api/app/bsky/unspecced/{getPostThreadHiddenV2.js → getPostThreadOtherV2.js} +5 -5
  17. package/dist/api/app/bsky/unspecced/getPostThreadOtherV2.js.map +1 -0
  18. package/dist/api/app/bsky/unspecced/getPostThreadV2.js +2 -2
  19. package/dist/api/app/bsky/unspecced/getPostThreadV2.js.map +1 -1
  20. package/dist/api/index.d.ts.map +1 -1
  21. package/dist/api/index.js +6 -2
  22. package/dist/api/index.js.map +1 -1
  23. package/dist/context.d.ts +3 -0
  24. package/dist/context.d.ts.map +1 -1
  25. package/dist/context.js +3 -0
  26. package/dist/context.js.map +1 -1
  27. package/dist/data-plane/bsync/index.d.ts.map +1 -1
  28. package/dist/data-plane/bsync/index.js +84 -0
  29. package/dist/data-plane/bsync/index.js.map +1 -1
  30. package/dist/data-plane/server/db/database-schema.d.ts +2 -1
  31. package/dist/data-plane/server/db/database-schema.d.ts.map +1 -1
  32. package/dist/data-plane/server/db/migrations/20250602T190357447Z-add-private-data.d.ts +4 -0
  33. package/dist/data-plane/server/db/migrations/20250602T190357447Z-add-private-data.d.ts.map +1 -0
  34. package/dist/data-plane/server/db/migrations/20250602T190357447Z-add-private-data.js +24 -0
  35. package/dist/data-plane/server/db/migrations/20250602T190357447Z-add-private-data.js.map +1 -0
  36. package/dist/data-plane/server/db/migrations/index.d.ts +1 -0
  37. package/dist/data-plane/server/db/migrations/index.d.ts.map +1 -1
  38. package/dist/data-plane/server/db/migrations/index.js +2 -1
  39. package/dist/data-plane/server/db/migrations/index.js.map +1 -1
  40. package/dist/data-plane/server/db/tables/private-data.d.ts +13 -0
  41. package/dist/data-plane/server/db/tables/private-data.d.ts.map +1 -0
  42. package/dist/data-plane/server/db/tables/private-data.js +5 -0
  43. package/dist/data-plane/server/db/tables/private-data.js.map +1 -0
  44. package/dist/data-plane/server/routes/index.d.ts.map +1 -1
  45. package/dist/data-plane/server/routes/index.js +2 -0
  46. package/dist/data-plane/server/routes/index.js.map +1 -1
  47. package/dist/data-plane/server/routes/private-data.d.ts +9 -0
  48. package/dist/data-plane/server/routes/private-data.d.ts.map +1 -0
  49. package/dist/data-plane/server/routes/private-data.js +63 -0
  50. package/dist/data-plane/server/routes/private-data.js.map +1 -0
  51. package/dist/data-plane/server/util.d.ts +6 -6
  52. package/dist/index.d.ts.map +1 -1
  53. package/dist/index.js +3 -0
  54. package/dist/index.js.map +1 -1
  55. package/dist/lexicon/index.d.ts +8 -4
  56. package/dist/lexicon/index.d.ts.map +1 -1
  57. package/dist/lexicon/index.js +14 -6
  58. package/dist/lexicon/index.js.map +1 -1
  59. package/dist/lexicon/lexicons.d.ts +518 -100
  60. package/dist/lexicon/lexicons.d.ts.map +1 -1
  61. package/dist/lexicon/lexicons.js +277 -52
  62. package/dist/lexicon/lexicons.js.map +1 -1
  63. package/dist/lexicon/types/app/bsky/notification/defs.d.ts +40 -0
  64. package/dist/lexicon/types/app/bsky/notification/defs.d.ts.map +1 -1
  65. package/dist/lexicon/types/app/bsky/notification/defs.js +36 -0
  66. package/dist/lexicon/types/app/bsky/notification/defs.js.map +1 -1
  67. package/dist/lexicon/types/app/bsky/notification/getPreferences.d.ts +35 -0
  68. package/dist/lexicon/types/app/bsky/notification/getPreferences.d.ts.map +1 -0
  69. package/dist/lexicon/types/app/bsky/notification/getPreferences.js +7 -0
  70. package/dist/lexicon/types/app/bsky/notification/getPreferences.js.map +1 -0
  71. package/dist/lexicon/types/app/bsky/notification/putPreferencesV2.d.ts +52 -0
  72. package/dist/lexicon/types/app/bsky/notification/putPreferencesV2.d.ts.map +1 -0
  73. package/dist/lexicon/types/app/bsky/notification/putPreferencesV2.js +7 -0
  74. package/dist/lexicon/types/app/bsky/notification/putPreferencesV2.js.map +1 -0
  75. package/dist/lexicon/types/app/bsky/unspecced/{getPostThreadHiddenV2.d.ts → getPostThreadOtherV2.d.ts} +7 -7
  76. package/dist/lexicon/types/app/bsky/unspecced/getPostThreadOtherV2.d.ts.map +1 -0
  77. package/dist/lexicon/types/app/bsky/unspecced/getPostThreadOtherV2.js +16 -0
  78. package/dist/lexicon/types/app/bsky/unspecced/getPostThreadOtherV2.js.map +1 -0
  79. package/dist/lexicon/types/app/bsky/unspecced/getPostThreadV2.d.ts +2 -2
  80. package/dist/lexicon/types/app/bsky/unspecced/getPostThreadV2.d.ts.map +1 -1
  81. package/dist/proto/bsky_connect.d.ts +10 -1
  82. package/dist/proto/bsky_connect.d.ts.map +1 -1
  83. package/dist/proto/bsky_connect.js +9 -0
  84. package/dist/proto/bsky_connect.js.map +1 -1
  85. package/dist/proto/bsky_pb.d.ts +234 -0
  86. package/dist/proto/bsky_pb.d.ts.map +1 -1
  87. package/dist/proto/bsky_pb.js +693 -5
  88. package/dist/proto/bsky_pb.js.map +1 -1
  89. package/dist/proto/bsync_pb.d.ts +10 -10
  90. package/dist/proto/bsync_pb.d.ts.map +1 -1
  91. package/dist/proto/bsync_pb.js +15 -15
  92. package/dist/proto/bsync_pb.js.map +1 -1
  93. package/dist/stash.d.ts +26 -0
  94. package/dist/stash.d.ts.map +1 -0
  95. package/dist/stash.js +56 -0
  96. package/dist/stash.js.map +1 -0
  97. package/dist/views/index.d.ts +8 -8
  98. package/dist/views/index.d.ts.map +1 -1
  99. package/dist/views/index.js +32 -32
  100. package/dist/views/index.js.map +1 -1
  101. package/dist/views/threads-v2.d.ts +11 -11
  102. package/dist/views/threads-v2.d.ts.map +1 -1
  103. package/dist/views/threads-v2.js.map +1 -1
  104. package/package.json +4 -4
  105. package/proto/bsky.proto +61 -0
  106. package/src/api/app/bsky/notification/getPreferences.ts +50 -0
  107. package/src/api/app/bsky/notification/putPreferencesV2.ts +62 -0
  108. package/src/api/app/bsky/notification/util.ts +123 -0
  109. package/src/api/app/bsky/unspecced/{getPostThreadHiddenV2.ts → getPostThreadOtherV2.ts} +5 -5
  110. package/src/api/app/bsky/unspecced/getPostThreadV2.ts +2 -2
  111. package/src/api/index.ts +6 -2
  112. package/src/context.ts +6 -0
  113. package/src/data-plane/bsync/index.ts +109 -1
  114. package/src/data-plane/server/db/database-schema.ts +3 -1
  115. package/src/data-plane/server/db/migrations/20250602T190357447Z-add-private-data.ts +22 -0
  116. package/src/data-plane/server/db/migrations/index.ts +1 -0
  117. package/src/data-plane/server/db/tables/private-data.ts +13 -0
  118. package/src/data-plane/server/routes/index.ts +2 -0
  119. package/src/data-plane/server/routes/private-data.ts +90 -0
  120. package/src/index.ts +4 -0
  121. package/src/lexicon/index.ts +38 -14
  122. package/src/lexicon/lexicons.ts +281 -54
  123. package/src/lexicon/types/app/bsky/notification/defs.ts +76 -0
  124. package/src/lexicon/types/app/bsky/notification/getPreferences.ts +52 -0
  125. package/src/lexicon/types/app/bsky/notification/putPreferencesV2.ts +69 -0
  126. package/src/lexicon/types/app/bsky/unspecced/{getPostThreadHiddenV2.ts → getPostThreadOtherV2.ts} +10 -10
  127. package/src/lexicon/types/app/bsky/unspecced/getPostThreadV2.ts +2 -2
  128. package/src/proto/bsky_connect.ts +11 -0
  129. package/src/proto/bsky_pb.ts +669 -0
  130. package/src/proto/bsync_pb.ts +15 -15
  131. package/src/stash.ts +75 -0
  132. package/src/views/index.ts +46 -46
  133. package/src/views/threads-v2.ts +23 -23
  134. package/tests/stash.test.ts +156 -0
  135. package/tests/views/__snapshots__/thread-v2.test.ts.snap +7 -7
  136. package/tests/views/notifications.test.ts +221 -0
  137. package/tests/views/thread-v2.test.ts +93 -93
  138. package/tsconfig.build.tsbuildinfo +1 -1
  139. package/tsconfig.tests.tsbuildinfo +1 -1
  140. package/dist/api/app/bsky/unspecced/getPostThreadHiddenV2.d.ts.map +0 -1
  141. package/dist/api/app/bsky/unspecced/getPostThreadHiddenV2.js.map +0 -1
  142. package/dist/lexicon/types/app/bsky/unspecced/getPostThreadHiddenV2.d.ts.map +0 -1
  143. package/dist/lexicon/types/app/bsky/unspecced/getPostThreadHiddenV2.js +0 -16
  144. package/dist/lexicon/types/app/bsky/unspecced/getPostThreadHiddenV2.js.map +0 -1
@@ -27,3 +27,79 @@ export function isRecordDeleted<V>(v: V) {
27
27
  export function validateRecordDeleted<V>(v: V) {
28
28
  return validate<RecordDeleted & V>(v, id, hashRecordDeleted)
29
29
  }
30
+
31
+ export interface ChatPreference {
32
+ $type?: 'app.bsky.notification.defs#chatPreference'
33
+ filter: 'all' | 'accepted' | (string & {})
34
+ push: boolean
35
+ }
36
+
37
+ const hashChatPreference = 'chatPreference'
38
+
39
+ export function isChatPreference<V>(v: V) {
40
+ return is$typed(v, id, hashChatPreference)
41
+ }
42
+
43
+ export function validateChatPreference<V>(v: V) {
44
+ return validate<ChatPreference & V>(v, id, hashChatPreference)
45
+ }
46
+
47
+ export interface FilterablePreference {
48
+ $type?: 'app.bsky.notification.defs#filterablePreference'
49
+ filter: 'all' | 'follows' | (string & {})
50
+ list: boolean
51
+ push: boolean
52
+ }
53
+
54
+ const hashFilterablePreference = 'filterablePreference'
55
+
56
+ export function isFilterablePreference<V>(v: V) {
57
+ return is$typed(v, id, hashFilterablePreference)
58
+ }
59
+
60
+ export function validateFilterablePreference<V>(v: V) {
61
+ return validate<FilterablePreference & V>(v, id, hashFilterablePreference)
62
+ }
63
+
64
+ export interface Preference {
65
+ $type?: 'app.bsky.notification.defs#preference'
66
+ list: boolean
67
+ push: boolean
68
+ }
69
+
70
+ const hashPreference = 'preference'
71
+
72
+ export function isPreference<V>(v: V) {
73
+ return is$typed(v, id, hashPreference)
74
+ }
75
+
76
+ export function validatePreference<V>(v: V) {
77
+ return validate<Preference & V>(v, id, hashPreference)
78
+ }
79
+
80
+ export interface Preferences {
81
+ $type?: 'app.bsky.notification.defs#preferences'
82
+ chat: ChatPreference
83
+ follow: FilterablePreference
84
+ like: FilterablePreference
85
+ likeViaRepost: FilterablePreference
86
+ mention: FilterablePreference
87
+ quote: FilterablePreference
88
+ reply: FilterablePreference
89
+ repost: FilterablePreference
90
+ repostViaRepost: FilterablePreference
91
+ starterpackJoined: Preference
92
+ subscribedPost: Preference
93
+ unverified: Preference
94
+ verified: Preference
95
+ }
96
+
97
+ const hashPreferences = 'preferences'
98
+
99
+ export function isPreferences<V>(v: V) {
100
+ return is$typed(v, id, hashPreferences)
101
+ }
102
+
103
+ export function validatePreferences<V>(v: V) {
104
+ return validate<Preferences & V>(v, id, hashPreferences)
105
+ }
@@ -0,0 +1,52 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import express from 'express'
5
+ import { type ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { CID } from 'multiformats/cid'
7
+ import { validate as _validate } from '../../../../lexicons'
8
+ import {
9
+ type $Typed,
10
+ is$typed as _is$typed,
11
+ type OmitKey,
12
+ } from '../../../../util'
13
+ import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
14
+ import type * as AppBskyNotificationDefs from './defs.js'
15
+
16
+ const is$typed = _is$typed,
17
+ validate = _validate
18
+ const id = 'app.bsky.notification.getPreferences'
19
+
20
+ export interface QueryParams {}
21
+
22
+ export type InputSchema = undefined
23
+
24
+ export interface OutputSchema {
25
+ preferences: AppBskyNotificationDefs.Preferences
26
+ }
27
+
28
+ export type HandlerInput = undefined
29
+
30
+ export interface HandlerSuccess {
31
+ encoding: 'application/json'
32
+ body: OutputSchema
33
+ headers?: { [key: string]: string }
34
+ }
35
+
36
+ export interface HandlerError {
37
+ status: number
38
+ message?: string
39
+ }
40
+
41
+ export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
42
+ export type HandlerReqCtx<HA extends HandlerAuth = never> = {
43
+ auth: HA
44
+ params: QueryParams
45
+ input: HandlerInput
46
+ req: express.Request
47
+ res: express.Response
48
+ resetRouteRateLimits: () => Promise<void>
49
+ }
50
+ export type Handler<HA extends HandlerAuth = never> = (
51
+ ctx: HandlerReqCtx<HA>,
52
+ ) => Promise<HandlerOutput> | HandlerOutput
@@ -0,0 +1,69 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import express from 'express'
5
+ import { type ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { CID } from 'multiformats/cid'
7
+ import { validate as _validate } from '../../../../lexicons'
8
+ import {
9
+ type $Typed,
10
+ is$typed as _is$typed,
11
+ type OmitKey,
12
+ } from '../../../../util'
13
+ import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
14
+ import type * as AppBskyNotificationDefs from './defs.js'
15
+
16
+ const is$typed = _is$typed,
17
+ validate = _validate
18
+ const id = 'app.bsky.notification.putPreferencesV2'
19
+
20
+ export interface QueryParams {}
21
+
22
+ export interface InputSchema {
23
+ chat?: AppBskyNotificationDefs.ChatPreference
24
+ follow?: AppBskyNotificationDefs.FilterablePreference
25
+ like?: AppBskyNotificationDefs.FilterablePreference
26
+ likeViaRepost?: AppBskyNotificationDefs.FilterablePreference
27
+ mention?: AppBskyNotificationDefs.FilterablePreference
28
+ quote?: AppBskyNotificationDefs.FilterablePreference
29
+ reply?: AppBskyNotificationDefs.FilterablePreference
30
+ repost?: AppBskyNotificationDefs.FilterablePreference
31
+ repostViaRepost?: AppBskyNotificationDefs.FilterablePreference
32
+ starterpackJoined?: AppBskyNotificationDefs.Preference
33
+ subscribedPost?: AppBskyNotificationDefs.Preference
34
+ unverified?: AppBskyNotificationDefs.Preference
35
+ verified?: AppBskyNotificationDefs.Preference
36
+ }
37
+
38
+ export interface OutputSchema {
39
+ preferences: AppBskyNotificationDefs.Preferences
40
+ }
41
+
42
+ export interface HandlerInput {
43
+ encoding: 'application/json'
44
+ body: InputSchema
45
+ }
46
+
47
+ export interface HandlerSuccess {
48
+ encoding: 'application/json'
49
+ body: OutputSchema
50
+ headers?: { [key: string]: string }
51
+ }
52
+
53
+ export interface HandlerError {
54
+ status: number
55
+ message?: string
56
+ }
57
+
58
+ export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
59
+ export type HandlerReqCtx<HA extends HandlerAuth = never> = {
60
+ auth: HA
61
+ params: QueryParams
62
+ input: HandlerInput
63
+ req: express.Request
64
+ res: express.Response
65
+ resetRouteRateLimits: () => Promise<void>
66
+ }
67
+ export type Handler<HA extends HandlerAuth = never> = (
68
+ ctx: HandlerReqCtx<HA>,
69
+ ) => Promise<HandlerOutput> | HandlerOutput
@@ -15,7 +15,7 @@ import type * as AppBskyUnspeccedDefs from './defs.js'
15
15
 
16
16
  const is$typed = _is$typed,
17
17
  validate = _validate
18
- const id = 'app.bsky.unspecced.getPostThreadHiddenV2'
18
+ const id = 'app.bsky.unspecced.getPostThreadOtherV2'
19
19
 
20
20
  export interface QueryParams {
21
21
  /** Reference (AT-URI) to post record. This is the anchor post. */
@@ -27,8 +27,8 @@ export interface QueryParams {
27
27
  export type InputSchema = undefined
28
28
 
29
29
  export interface OutputSchema {
30
- /** A flat list of hidden thread items. The depth of each item is indicated by the depth property inside the item. */
31
- thread: ThreadHiddenItem[]
30
+ /** A flat list of other thread items. The depth of each item is indicated by the depth property inside the item. */
31
+ thread: ThreadItem[]
32
32
  }
33
33
 
34
34
  export type HandlerInput = undefined
@@ -57,20 +57,20 @@ export type Handler<HA extends HandlerAuth = never> = (
57
57
  ctx: HandlerReqCtx<HA>,
58
58
  ) => Promise<HandlerOutput> | HandlerOutput
59
59
 
60
- export interface ThreadHiddenItem {
61
- $type?: 'app.bsky.unspecced.getPostThreadHiddenV2#threadHiddenItem'
60
+ export interface ThreadItem {
61
+ $type?: 'app.bsky.unspecced.getPostThreadOtherV2#threadItem'
62
62
  uri: string
63
63
  /** The nesting level of this item in the thread. Depth 0 means the anchor item. Items above have negative depths, items below have positive depths. */
64
64
  depth: number
65
65
  value: $Typed<AppBskyUnspeccedDefs.ThreadItemPost> | { $type: string }
66
66
  }
67
67
 
68
- const hashThreadHiddenItem = 'threadHiddenItem'
68
+ const hashThreadItem = 'threadItem'
69
69
 
70
- export function isThreadHiddenItem<V>(v: V) {
71
- return is$typed(v, id, hashThreadHiddenItem)
70
+ export function isThreadItem<V>(v: V) {
71
+ return is$typed(v, id, hashThreadItem)
72
72
  }
73
73
 
74
- export function validateThreadHiddenItem<V>(v: V) {
75
- return validate<ThreadHiddenItem & V>(v, id, hashThreadHiddenItem)
74
+ export function validateThreadItem<V>(v: V) {
75
+ return validate<ThreadItem & V>(v, id, hashThreadItem)
76
76
  }
@@ -39,8 +39,8 @@ export interface OutputSchema {
39
39
  /** A flat list of thread items. The depth of each item is indicated by the depth property inside the item. */
40
40
  thread: ThreadItem[]
41
41
  threadgate?: AppBskyFeedDefs.ThreadgateView
42
- /** Whether this thread has hidden replies. If true, a call can be made to the `getPostThreadHiddenV2` endpoint to retrieve them. */
43
- hasHiddenReplies: boolean
42
+ /** Whether this thread has additional replies. If true, a call can be made to the `getPostThreadOtherV2` endpoint to retrieve them. */
43
+ hasOtherReplies: boolean
44
44
  }
45
45
 
46
46
  export type HandlerInput = undefined
@@ -126,6 +126,8 @@ import {
126
126
  GetMutesResponse,
127
127
  GetNewUserCountForRangeRequest,
128
128
  GetNewUserCountForRangeResponse,
129
+ GetNotificationPreferencesRequest,
130
+ GetNotificationPreferencesResponse,
129
131
  GetNotificationSeenRequest,
130
132
  GetNotificationSeenResponse,
131
133
  GetNotificationsRequest,
@@ -732,6 +734,15 @@ export const Service = {
732
734
  /**
733
735
  * Notifications
734
736
  *
737
+ * @generated from rpc bsky.Service.GetNotificationPreferences
738
+ */
739
+ getNotificationPreferences: {
740
+ name: 'GetNotificationPreferences',
741
+ I: GetNotificationPreferencesRequest,
742
+ O: GetNotificationPreferencesResponse,
743
+ kind: MethodKind.Unary,
744
+ },
745
+ /**
735
746
  * @generated from rpc bsky.Service.GetNotifications
736
747
  */
737
748
  getNotifications: {