@atproto/pds 0.4.13 → 0.4.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/actor-store/migrate.d.ts.map +1 -1
  3. package/dist/api/proxy.d.ts.map +1 -1
  4. package/dist/auth-verifier.d.ts.map +1 -1
  5. package/dist/db/pagination.d.ts +4 -4
  6. package/dist/db/pagination.d.ts.map +1 -1
  7. package/dist/db/util.d.ts.map +1 -1
  8. package/dist/handle/index.js +1 -1
  9. package/dist/handle/index.js.map +1 -1
  10. package/dist/lexicon/index.d.ts +16 -0
  11. package/dist/lexicon/index.d.ts.map +1 -1
  12. package/dist/lexicon/index.js +19 -1
  13. package/dist/lexicon/index.js.map +1 -1
  14. package/dist/lexicon/lexicons.d.ts +230 -0
  15. package/dist/lexicon/lexicons.d.ts.map +1 -1
  16. package/dist/lexicon/lexicons.js +243 -0
  17. package/dist/lexicon/lexicons.js.map +1 -1
  18. package/dist/lexicon/types/app/bsky/embed/record.d.ts +3 -0
  19. package/dist/lexicon/types/app/bsky/embed/record.d.ts.map +1 -1
  20. package/dist/lexicon/types/app/bsky/embed/record.js.map +1 -1
  21. package/dist/lexicon/types/app/bsky/feed/defs.d.ts +38 -0
  22. package/dist/lexicon/types/app/bsky/feed/defs.d.ts.map +1 -1
  23. package/dist/lexicon/types/app/bsky/feed/defs.js +35 -1
  24. package/dist/lexicon/types/app/bsky/feed/defs.js.map +1 -1
  25. package/dist/lexicon/types/app/bsky/feed/generator.d.ts +2 -0
  26. package/dist/lexicon/types/app/bsky/feed/generator.d.ts.map +1 -1
  27. package/dist/lexicon/types/app/bsky/feed/generator.js.map +1 -1
  28. package/dist/lexicon/types/app/bsky/feed/searchPosts.d.ts +18 -0
  29. package/dist/lexicon/types/app/bsky/feed/searchPosts.d.ts.map +1 -1
  30. package/dist/lexicon/types/app/bsky/feed/sendInteractions.d.ts +40 -0
  31. package/dist/lexicon/types/app/bsky/feed/sendInteractions.d.ts.map +1 -0
  32. package/dist/lexicon/types/app/bsky/feed/sendInteractions.js +3 -0
  33. package/dist/lexicon/types/app/bsky/feed/sendInteractions.js.map +1 -0
  34. package/dist/lexicon/types/app/bsky/unspecced/searchActorsSkeleton.d.ts +2 -0
  35. package/dist/lexicon/types/app/bsky/unspecced/searchActorsSkeleton.d.ts.map +1 -1
  36. package/dist/lexicon/types/app/bsky/unspecced/searchPostsSkeleton.d.ts +20 -0
  37. package/dist/lexicon/types/app/bsky/unspecced/searchPostsSkeleton.d.ts.map +1 -1
  38. package/dist/pipethrough.d.ts.map +1 -1
  39. package/dist/read-after-write/util.d.ts +2 -10
  40. package/dist/read-after-write/util.d.ts.map +1 -1
  41. package/dist/read-after-write/viewer.d.ts.map +1 -1
  42. package/dist/read-after-write/viewer.js +8 -11
  43. package/dist/read-after-write/viewer.js.map +1 -1
  44. package/dist/redis.d.ts.map +1 -1
  45. package/dist/util/debug.d.ts.map +1 -1
  46. package/package.json +4 -4
  47. package/src/handle/index.ts +1 -1
  48. package/src/lexicon/index.ts +26 -0
  49. package/src/lexicon/lexicons.ts +269 -0
  50. package/src/lexicon/types/app/bsky/embed/record.ts +3 -0
  51. package/src/lexicon/types/app/bsky/feed/defs.ts +63 -0
  52. package/src/lexicon/types/app/bsky/feed/generator.ts +2 -0
  53. package/src/lexicon/types/app/bsky/feed/searchPosts.ts +18 -0
  54. package/src/lexicon/types/app/bsky/feed/sendInteractions.ts +49 -0
  55. package/src/lexicon/types/app/bsky/unspecced/searchActorsSkeleton.ts +2 -0
  56. package/src/lexicon/types/app/bsky/unspecced/searchPostsSkeleton.ts +20 -0
  57. package/src/read-after-write/viewer.ts +8 -11
  58. package/tests/handle-validation.test.ts +28 -0
  59. package/tests/proxied/__snapshots__/feedgen.test.ts.snap +3 -0
  60. package/tests/proxied/__snapshots__/views.test.ts.snap +30 -0
  61. package/tests/seeds/users-bulk.ts +5 -5
@@ -104,6 +104,7 @@ import * as AppBskyFeedGetRepostedBy from './types/app/bsky/feed/getRepostedBy'
104
104
  import * as AppBskyFeedGetSuggestedFeeds from './types/app/bsky/feed/getSuggestedFeeds'
105
105
  import * as AppBskyFeedGetTimeline from './types/app/bsky/feed/getTimeline'
106
106
  import * as AppBskyFeedSearchPosts from './types/app/bsky/feed/searchPosts'
107
+ import * as AppBskyFeedSendInteractions from './types/app/bsky/feed/sendInteractions'
107
108
  import * as AppBskyGraphGetBlocks from './types/app/bsky/graph/getBlocks'
108
109
  import * as AppBskyGraphGetFollowers from './types/app/bsky/graph/getFollowers'
109
110
  import * as AppBskyGraphGetFollows from './types/app/bsky/graph/getFollows'
@@ -148,6 +149,20 @@ export const COM_ATPROTO_MODERATION = {
148
149
  DefsReasonOther: 'com.atproto.moderation.defs#reasonOther',
149
150
  DefsReasonAppeal: 'com.atproto.moderation.defs#reasonAppeal',
150
151
  }
152
+ export const APP_BSKY_FEED = {
153
+ DefsRequestLess: 'app.bsky.feed.defs#requestLess',
154
+ DefsRequestMore: 'app.bsky.feed.defs#requestMore',
155
+ DefsClickthroughItem: 'app.bsky.feed.defs#clickthroughItem',
156
+ DefsClickthroughAuthor: 'app.bsky.feed.defs#clickthroughAuthor',
157
+ DefsClickthroughReposter: 'app.bsky.feed.defs#clickthroughReposter',
158
+ DefsClickthroughEmbed: 'app.bsky.feed.defs#clickthroughEmbed',
159
+ DefsInteractionSeen: 'app.bsky.feed.defs#interactionSeen',
160
+ DefsInteractionLike: 'app.bsky.feed.defs#interactionLike',
161
+ DefsInteractionRepost: 'app.bsky.feed.defs#interactionRepost',
162
+ DefsInteractionReply: 'app.bsky.feed.defs#interactionReply',
163
+ DefsInteractionQuote: 'app.bsky.feed.defs#interactionQuote',
164
+ DefsInteractionShare: 'app.bsky.feed.defs#interactionShare',
165
+ }
151
166
  export const APP_BSKY_GRAPH = {
152
167
  DefsModlist: 'app.bsky.graph.defs#modlist',
153
168
  DefsCuratelist: 'app.bsky.graph.defs#curatelist',
@@ -1380,6 +1395,17 @@ export class AppBskyFeedNS {
1380
1395
  const nsid = 'app.bsky.feed.searchPosts' // @ts-ignore
1381
1396
  return this._server.xrpc.method(nsid, cfg)
1382
1397
  }
1398
+
1399
+ sendInteractions<AV extends AuthVerifier>(
1400
+ cfg: ConfigOf<
1401
+ AV,
1402
+ AppBskyFeedSendInteractions.Handler<ExtractAuth<AV>>,
1403
+ AppBskyFeedSendInteractions.HandlerReqCtx<ExtractAuth<AV>>
1404
+ >,
1405
+ ) {
1406
+ const nsid = 'app.bsky.feed.sendInteractions' // @ts-ignore
1407
+ return this._server.xrpc.method(nsid, cfg)
1408
+ }
1383
1409
  }
1384
1410
 
1385
1411
  export class AppBskyGraphNS {
@@ -4561,6 +4561,15 @@ export const schemaDict = {
4561
4561
  ref: 'lex:com.atproto.label.defs#label',
4562
4562
  },
4563
4563
  },
4564
+ replyCount: {
4565
+ type: 'integer',
4566
+ },
4567
+ repostCount: {
4568
+ type: 'integer',
4569
+ },
4570
+ likeCount: {
4571
+ type: 'integer',
4572
+ },
4564
4573
  embeds: {
4565
4574
  type: 'array',
4566
4575
  items: {
@@ -4748,6 +4757,12 @@ export const schemaDict = {
4748
4757
  type: 'union',
4749
4758
  refs: ['lex:app.bsky.feed.defs#reasonRepost'],
4750
4759
  },
4760
+ feedContext: {
4761
+ type: 'string',
4762
+ description:
4763
+ 'Context provided by feed generator that may be passed back alongside interactions.',
4764
+ maxLength: 2000,
4765
+ },
4751
4766
  },
4752
4767
  },
4753
4768
  replyRef: {
@@ -4904,6 +4919,9 @@ export const schemaDict = {
4904
4919
  type: 'integer',
4905
4920
  minimum: 0,
4906
4921
  },
4922
+ acceptsInteractions: {
4923
+ type: 'boolean',
4924
+ },
4907
4925
  labels: {
4908
4926
  type: 'array',
4909
4927
  items: {
@@ -4942,6 +4960,12 @@ export const schemaDict = {
4942
4960
  type: 'union',
4943
4961
  refs: ['lex:app.bsky.feed.defs#skeletonReasonRepost'],
4944
4962
  },
4963
+ feedContext: {
4964
+ type: 'string',
4965
+ description:
4966
+ 'Context that will be passed through to client and may be passed to feed generator back alongside interactions.',
4967
+ maxLength: 2000,
4968
+ },
4945
4969
  },
4946
4970
  },
4947
4971
  skeletonReasonRepost: {
@@ -4977,6 +5001,89 @@ export const schemaDict = {
4977
5001
  },
4978
5002
  },
4979
5003
  },
5004
+ interaction: {
5005
+ type: 'object',
5006
+ properties: {
5007
+ item: {
5008
+ type: 'string',
5009
+ format: 'at-uri',
5010
+ },
5011
+ event: {
5012
+ type: 'string',
5013
+ knownValues: [
5014
+ 'app.bsky.feed.defs#requestLess',
5015
+ 'app.bsky.feed.defs#requestMore',
5016
+ 'app.bsky.feed.defs#clickthroughItem',
5017
+ 'app.bsky.feed.defs#clickthroughAuthor',
5018
+ 'app.bsky.feed.defs#clickthroughReposter',
5019
+ 'app.bsky.feed.defs#clickthroughEmbed',
5020
+ 'app.bsky.feed.defs#interactionSeen',
5021
+ 'app.bsky.feed.defs#interactionLike',
5022
+ 'app.bsky.feed.defs#interactionRepost',
5023
+ 'app.bsky.feed.defs#interactionReply',
5024
+ 'app.bsky.feed.defs#interactionQuote',
5025
+ 'app.bsky.feed.defs#interactionShare',
5026
+ ],
5027
+ },
5028
+ feedContext: {
5029
+ type: 'string',
5030
+ description:
5031
+ 'Context on a feed item that was orginally supplied by the feed generator on getFeedSkeleton.',
5032
+ maxLength: 2000,
5033
+ },
5034
+ },
5035
+ },
5036
+ requestLess: {
5037
+ type: 'token',
5038
+ description:
5039
+ 'Request that less content like the given feed item be shown in the feed',
5040
+ },
5041
+ requestMore: {
5042
+ type: 'token',
5043
+ description:
5044
+ 'Request that more content like the given feed item be shown in the feed',
5045
+ },
5046
+ clickthroughItem: {
5047
+ type: 'token',
5048
+ description: 'User clicked through to the feed item',
5049
+ },
5050
+ clickthroughAuthor: {
5051
+ type: 'token',
5052
+ description: 'User clicked through to the author of the feed item',
5053
+ },
5054
+ clickthroughReposter: {
5055
+ type: 'token',
5056
+ description: 'User clicked through to the reposter of the feed item',
5057
+ },
5058
+ clickthroughEmbed: {
5059
+ type: 'token',
5060
+ description:
5061
+ 'User clicked through to the embedded content of the feed item',
5062
+ },
5063
+ interactionSeen: {
5064
+ type: 'token',
5065
+ description: 'Feed item was seen by user',
5066
+ },
5067
+ interactionLike: {
5068
+ type: 'token',
5069
+ description: 'User liked the feed item',
5070
+ },
5071
+ interactionRepost: {
5072
+ type: 'token',
5073
+ description: 'User reposted the feed item',
5074
+ },
5075
+ interactionReply: {
5076
+ type: 'token',
5077
+ description: 'User replied to the feed item',
5078
+ },
5079
+ interactionQuote: {
5080
+ type: 'token',
5081
+ description: 'User quoted the feed item',
5082
+ },
5083
+ interactionShare: {
5084
+ type: 'token',
5085
+ description: 'User shared the feed item',
5086
+ },
4980
5087
  },
4981
5088
  },
4982
5089
  AppBskyFeedDescribeFeedGenerator: {
@@ -5074,6 +5181,11 @@ export const schemaDict = {
5074
5181
  accept: ['image/png', 'image/jpeg'],
5075
5182
  maxSize: 1000000,
5076
5183
  },
5184
+ acceptsInteractions: {
5185
+ type: 'boolean',
5186
+ description:
5187
+ 'Declaration that a feed accepts feedback interactions from a client through app.bsky.feed.sendInteractions',
5188
+ },
5077
5189
  labels: {
5078
5190
  type: 'union',
5079
5191
  description: 'Self-label values',
@@ -6055,6 +6167,61 @@ export const schemaDict = {
6055
6167
  description:
6056
6168
  'Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended.',
6057
6169
  },
6170
+ sort: {
6171
+ type: 'string',
6172
+ knownValues: ['top', 'latest'],
6173
+ default: 'latest',
6174
+ description: 'Specifies the ranking order of results.',
6175
+ },
6176
+ since: {
6177
+ type: 'string',
6178
+ description:
6179
+ "Filter results for posts after the indicated datetime (inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYYY-MM-DD).",
6180
+ },
6181
+ until: {
6182
+ type: 'string',
6183
+ description:
6184
+ "Filter results for posts before the indicated datetime (not inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYY-MM-DD).",
6185
+ },
6186
+ mentions: {
6187
+ type: 'string',
6188
+ format: 'at-identifier',
6189
+ description:
6190
+ 'Filter to posts which mention the given account. Handles are resolved to DID before query-time. Only matches rich-text facet mentions.',
6191
+ },
6192
+ author: {
6193
+ type: 'string',
6194
+ format: 'at-identifier',
6195
+ description:
6196
+ 'Filter to posts by the given account. Handles are resolved to DID before query-time.',
6197
+ },
6198
+ lang: {
6199
+ type: 'string',
6200
+ format: 'language',
6201
+ description:
6202
+ 'Filter to posts in the given language. Expected to be based on post language field, though server may override language detection.',
6203
+ },
6204
+ domain: {
6205
+ type: 'string',
6206
+ description:
6207
+ 'Filter to posts with URLs (facet links or embeds) linking to the given domain (hostname). Server may apply hostname normalization.',
6208
+ },
6209
+ url: {
6210
+ type: 'string',
6211
+ format: 'uri',
6212
+ description:
6213
+ 'Filter to posts with links (facet links or embeds) pointing to this URL. Server may apply URL normalization or fuzzy matching.',
6214
+ },
6215
+ tag: {
6216
+ type: 'array',
6217
+ items: {
6218
+ type: 'string',
6219
+ maxLength: 640,
6220
+ maxGraphemes: 64,
6221
+ },
6222
+ description:
6223
+ "Filter to posts with the given tag (hashtag), based on rich-text facet or tag field. Do not include the hash (#) prefix. Multiple tags can be specified, with 'AND' matching.",
6224
+ },
6058
6225
  limit: {
6059
6226
  type: 'integer',
6060
6227
  minimum: 1,
@@ -6100,6 +6267,40 @@ export const schemaDict = {
6100
6267
  },
6101
6268
  },
6102
6269
  },
6270
+ AppBskyFeedSendInteractions: {
6271
+ lexicon: 1,
6272
+ id: 'app.bsky.feed.sendInteractions',
6273
+ defs: {
6274
+ main: {
6275
+ type: 'procedure',
6276
+ description:
6277
+ 'Send information about interactions with feed items back to the feed generator that served them.',
6278
+ input: {
6279
+ encoding: 'application/json',
6280
+ schema: {
6281
+ type: 'object',
6282
+ required: ['interactions'],
6283
+ properties: {
6284
+ interactions: {
6285
+ type: 'array',
6286
+ items: {
6287
+ type: 'ref',
6288
+ ref: 'lex:app.bsky.feed.defs#interaction',
6289
+ },
6290
+ },
6291
+ },
6292
+ },
6293
+ },
6294
+ output: {
6295
+ encoding: 'application/json',
6296
+ schema: {
6297
+ type: 'object',
6298
+ properties: {},
6299
+ },
6300
+ },
6301
+ },
6302
+ },
6303
+ },
6103
6304
  AppBskyFeedThreadgate: {
6104
6305
  lexicon: 1,
6105
6306
  id: 'app.bsky.feed.threadgate',
@@ -7706,6 +7907,12 @@ export const schemaDict = {
7706
7907
  description:
7707
7908
  'Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. For typeahead search, only simple term match is supported, not full syntax.',
7708
7909
  },
7910
+ viewer: {
7911
+ type: 'string',
7912
+ format: 'did',
7913
+ description:
7914
+ 'DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking.',
7915
+ },
7709
7916
  typeahead: {
7710
7917
  type: 'boolean',
7711
7918
  description: "If true, acts as fast/simple 'typeahead' query.",
@@ -7771,6 +7978,67 @@ export const schemaDict = {
7771
7978
  description:
7772
7979
  'Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended.',
7773
7980
  },
7981
+ sort: {
7982
+ type: 'string',
7983
+ knownValues: ['top', 'latest'],
7984
+ default: 'latest',
7985
+ description: 'Specifies the ranking order of results.',
7986
+ },
7987
+ since: {
7988
+ type: 'string',
7989
+ description:
7990
+ "Filter results for posts after the indicated datetime (inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYYY-MM-DD).",
7991
+ },
7992
+ until: {
7993
+ type: 'string',
7994
+ description:
7995
+ "Filter results for posts before the indicated datetime (not inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYY-MM-DD).",
7996
+ },
7997
+ mentions: {
7998
+ type: 'string',
7999
+ format: 'at-identifier',
8000
+ description:
8001
+ 'Filter to posts which mention the given account. Handles are resolved to DID before query-time. Only matches rich-text facet mentions.',
8002
+ },
8003
+ author: {
8004
+ type: 'string',
8005
+ format: 'at-identifier',
8006
+ description:
8007
+ 'Filter to posts by the given account. Handles are resolved to DID before query-time.',
8008
+ },
8009
+ lang: {
8010
+ type: 'string',
8011
+ format: 'language',
8012
+ description:
8013
+ 'Filter to posts in the given language. Expected to be based on post language field, though server may override language detection.',
8014
+ },
8015
+ domain: {
8016
+ type: 'string',
8017
+ description:
8018
+ 'Filter to posts with URLs (facet links or embeds) linking to the given domain (hostname). Server may apply hostname normalization.',
8019
+ },
8020
+ url: {
8021
+ type: 'string',
8022
+ format: 'uri',
8023
+ description:
8024
+ 'Filter to posts with links (facet links or embeds) pointing to this URL. Server may apply URL normalization or fuzzy matching.',
8025
+ },
8026
+ tag: {
8027
+ type: 'array',
8028
+ items: {
8029
+ type: 'string',
8030
+ maxLength: 640,
8031
+ maxGraphemes: 64,
8032
+ },
8033
+ description:
8034
+ "Filter to posts with the given tag (hashtag), based on rich-text facet or tag field. Do not include the hash (#) prefix. Multiple tags can be specified, with 'AND' matching.",
8035
+ },
8036
+ viewer: {
8037
+ type: 'string',
8038
+ format: 'did',
8039
+ description:
8040
+ "DID of the account making the request (not included for public/unauthenticated queries). Used for 'from:me' queries.",
8041
+ },
7774
8042
  limit: {
7775
8043
  type: 'integer',
7776
8044
  minimum: 1,
@@ -9318,6 +9586,7 @@ export const ids = {
9318
9586
  AppBskyFeedPost: 'app.bsky.feed.post',
9319
9587
  AppBskyFeedRepost: 'app.bsky.feed.repost',
9320
9588
  AppBskyFeedSearchPosts: 'app.bsky.feed.searchPosts',
9589
+ AppBskyFeedSendInteractions: 'app.bsky.feed.sendInteractions',
9321
9590
  AppBskyFeedThreadgate: 'app.bsky.feed.threadgate',
9322
9591
  AppBskyGraphBlock: 'app.bsky.graph.block',
9323
9592
  AppBskyGraphDefs: 'app.bsky.graph.defs',
@@ -62,6 +62,9 @@ export interface ViewRecord {
62
62
  /** The record data itself. */
63
63
  value: {}
64
64
  labels?: ComAtprotoLabelDefs.Label[]
65
+ replyCount?: number
66
+ repostCount?: number
67
+ likeCount?: number
65
68
  embeds?: (
66
69
  | AppBskyEmbedImages.View
67
70
  | AppBskyEmbedExternal.View
@@ -69,6 +69,8 @@ export interface FeedViewPost {
69
69
  post: PostView
70
70
  reply?: ReplyRef
71
71
  reason?: ReasonRepost | { $type: string; [k: string]: unknown }
72
+ /** Context provided by feed generator that may be passed back alongside interactions. */
73
+ feedContext?: string
72
74
  [k: string]: unknown
73
75
  }
74
76
 
@@ -219,6 +221,7 @@ export interface GeneratorView {
219
221
  descriptionFacets?: AppBskyRichtextFacet.Main[]
220
222
  avatar?: string
221
223
  likeCount?: number
224
+ acceptsInteractions?: boolean
222
225
  labels?: ComAtprotoLabelDefs.Label[]
223
226
  viewer?: GeneratorViewerState
224
227
  indexedAt: string
@@ -257,6 +260,8 @@ export function validateGeneratorViewerState(v: unknown): ValidationResult {
257
260
  export interface SkeletonFeedPost {
258
261
  post: string
259
262
  reason?: SkeletonReasonRepost | { $type: string; [k: string]: unknown }
263
+ /** Context that will be passed through to client and may be passed to feed generator back alongside interactions. */
264
+ feedContext?: string
260
265
  [k: string]: unknown
261
266
  }
262
267
 
@@ -308,3 +313,61 @@ export function isThreadgateView(v: unknown): v is ThreadgateView {
308
313
  export function validateThreadgateView(v: unknown): ValidationResult {
309
314
  return lexicons.validate('app.bsky.feed.defs#threadgateView', v)
310
315
  }
316
+
317
+ export interface Interaction {
318
+ item?: string
319
+ event?:
320
+ | 'app.bsky.feed.defs#requestLess'
321
+ | 'app.bsky.feed.defs#requestMore'
322
+ | 'app.bsky.feed.defs#clickthroughItem'
323
+ | 'app.bsky.feed.defs#clickthroughAuthor'
324
+ | 'app.bsky.feed.defs#clickthroughReposter'
325
+ | 'app.bsky.feed.defs#clickthroughEmbed'
326
+ | 'app.bsky.feed.defs#interactionSeen'
327
+ | 'app.bsky.feed.defs#interactionLike'
328
+ | 'app.bsky.feed.defs#interactionRepost'
329
+ | 'app.bsky.feed.defs#interactionReply'
330
+ | 'app.bsky.feed.defs#interactionQuote'
331
+ | 'app.bsky.feed.defs#interactionShare'
332
+ | (string & {})
333
+ /** Context on a feed item that was orginally supplied by the feed generator on getFeedSkeleton. */
334
+ feedContext?: string
335
+ [k: string]: unknown
336
+ }
337
+
338
+ export function isInteraction(v: unknown): v is Interaction {
339
+ return (
340
+ isObj(v) &&
341
+ hasProp(v, '$type') &&
342
+ v.$type === 'app.bsky.feed.defs#interaction'
343
+ )
344
+ }
345
+
346
+ export function validateInteraction(v: unknown): ValidationResult {
347
+ return lexicons.validate('app.bsky.feed.defs#interaction', v)
348
+ }
349
+
350
+ /** Request that less content like the given feed item be shown in the feed */
351
+ export const REQUESTLESS = 'app.bsky.feed.defs#requestLess'
352
+ /** Request that more content like the given feed item be shown in the feed */
353
+ export const REQUESTMORE = 'app.bsky.feed.defs#requestMore'
354
+ /** User clicked through to the feed item */
355
+ export const CLICKTHROUGHITEM = 'app.bsky.feed.defs#clickthroughItem'
356
+ /** User clicked through to the author of the feed item */
357
+ export const CLICKTHROUGHAUTHOR = 'app.bsky.feed.defs#clickthroughAuthor'
358
+ /** User clicked through to the reposter of the feed item */
359
+ export const CLICKTHROUGHREPOSTER = 'app.bsky.feed.defs#clickthroughReposter'
360
+ /** User clicked through to the embedded content of the feed item */
361
+ export const CLICKTHROUGHEMBED = 'app.bsky.feed.defs#clickthroughEmbed'
362
+ /** Feed item was seen by user */
363
+ export const INTERACTIONSEEN = 'app.bsky.feed.defs#interactionSeen'
364
+ /** User liked the feed item */
365
+ export const INTERACTIONLIKE = 'app.bsky.feed.defs#interactionLike'
366
+ /** User reposted the feed item */
367
+ export const INTERACTIONREPOST = 'app.bsky.feed.defs#interactionRepost'
368
+ /** User replied to the feed item */
369
+ export const INTERACTIONREPLY = 'app.bsky.feed.defs#interactionReply'
370
+ /** User quoted the feed item */
371
+ export const INTERACTIONQUOTE = 'app.bsky.feed.defs#interactionQuote'
372
+ /** User shared the feed item */
373
+ export const INTERACTIONSHARE = 'app.bsky.feed.defs#interactionShare'
@@ -14,6 +14,8 @@ export interface Record {
14
14
  description?: string
15
15
  descriptionFacets?: AppBskyRichtextFacet.Main[]
16
16
  avatar?: BlobRef
17
+ /** Declaration that a feed accepts feedback interactions from a client through app.bsky.feed.sendInteractions */
18
+ acceptsInteractions?: boolean
17
19
  labels?:
18
20
  | ComAtprotoLabelDefs.SelfLabels
19
21
  | { $type: string; [k: string]: unknown }
@@ -12,6 +12,24 @@ import * as AppBskyFeedDefs from './defs'
12
12
  export interface QueryParams {
13
13
  /** Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. */
14
14
  q: string
15
+ /** Specifies the ranking order of results. */
16
+ sort: 'top' | 'latest' | (string & {})
17
+ /** Filter results for posts after the indicated datetime (inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYYY-MM-DD). */
18
+ since?: string
19
+ /** Filter results for posts before the indicated datetime (not inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYY-MM-DD). */
20
+ until?: string
21
+ /** Filter to posts which mention the given account. Handles are resolved to DID before query-time. Only matches rich-text facet mentions. */
22
+ mentions?: string
23
+ /** Filter to posts by the given account. Handles are resolved to DID before query-time. */
24
+ author?: string
25
+ /** Filter to posts in the given language. Expected to be based on post language field, though server may override language detection. */
26
+ lang?: string
27
+ /** Filter to posts with URLs (facet links or embeds) linking to the given domain (hostname). Server may apply hostname normalization. */
28
+ domain?: string
29
+ /** Filter to posts with links (facet links or embeds) pointing to this URL. Server may apply URL normalization or fuzzy matching. */
30
+ url?: string
31
+ /** Filter to posts with the given tag (hashtag), based on rich-text facet or tag field. Do not include the hash (#) prefix. Multiple tags can be specified, with 'AND' matching. */
32
+ tag?: string[]
15
33
  limit: number
16
34
  /** Optional pagination mechanism; may not necessarily allow scrolling through entire result set. */
17
35
  cursor?: string
@@ -0,0 +1,49 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import express from 'express'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { lexicons } from '../../../../lexicons'
7
+ import { isObj, hasProp } from '../../../../util'
8
+ import { CID } from 'multiformats/cid'
9
+ import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
10
+ import * as AppBskyFeedDefs from './defs'
11
+
12
+ export interface QueryParams {}
13
+
14
+ export interface InputSchema {
15
+ interactions: AppBskyFeedDefs.Interaction[]
16
+ [k: string]: unknown
17
+ }
18
+
19
+ export interface OutputSchema {
20
+ [k: string]: unknown
21
+ }
22
+
23
+ export interface HandlerInput {
24
+ encoding: 'application/json'
25
+ body: InputSchema
26
+ }
27
+
28
+ export interface HandlerSuccess {
29
+ encoding: 'application/json'
30
+ body: OutputSchema
31
+ headers?: { [key: string]: string }
32
+ }
33
+
34
+ export interface HandlerError {
35
+ status: number
36
+ message?: string
37
+ }
38
+
39
+ export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
40
+ export type HandlerReqCtx<HA extends HandlerAuth = never> = {
41
+ auth: HA
42
+ params: QueryParams
43
+ input: HandlerInput
44
+ req: express.Request
45
+ res: express.Response
46
+ }
47
+ export type Handler<HA extends HandlerAuth = never> = (
48
+ ctx: HandlerReqCtx<HA>,
49
+ ) => Promise<HandlerOutput> | HandlerOutput
@@ -12,6 +12,8 @@ import * as AppBskyUnspeccedDefs from './defs'
12
12
  export interface QueryParams {
13
13
  /** Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. For typeahead search, only simple term match is supported, not full syntax. */
14
14
  q: string
15
+ /** DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking. */
16
+ viewer?: string
15
17
  /** If true, acts as fast/simple 'typeahead' query. */
16
18
  typeahead?: boolean
17
19
  limit: number
@@ -12,6 +12,26 @@ import * as AppBskyUnspeccedDefs from './defs'
12
12
  export interface QueryParams {
13
13
  /** Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. */
14
14
  q: string
15
+ /** Specifies the ranking order of results. */
16
+ sort: 'top' | 'latest' | (string & {})
17
+ /** Filter results for posts after the indicated datetime (inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYYY-MM-DD). */
18
+ since?: string
19
+ /** Filter results for posts before the indicated datetime (not inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYY-MM-DD). */
20
+ until?: string
21
+ /** Filter to posts which mention the given account. Handles are resolved to DID before query-time. Only matches rich-text facet mentions. */
22
+ mentions?: string
23
+ /** Filter to posts by the given account. Handles are resolved to DID before query-time. */
24
+ author?: string
25
+ /** Filter to posts in the given language. Expected to be based on post language field, though server may override language detection. */
26
+ lang?: string
27
+ /** Filter to posts with URLs (facet links or embeds) linking to the given domain (hostname). Server may apply hostname normalization. */
28
+ domain?: string
29
+ /** Filter to posts with links (facet links or embeds) pointing to this URL. Server may apply URL normalization or fuzzy matching. */
30
+ url?: string
31
+ /** Filter to posts with the given tag (hashtag), based on rich-text facet or tag field. Do not include the hash (#) prefix. Multiple tags can be specified, with 'AND' matching. */
32
+ tag?: string[]
33
+ /** DID of the account making the request (not included for public/unauthenticated queries). Used for 'from:me' queries. */
34
+ viewer?: string
15
35
  limit: number
16
36
  /** Optional pagination mechanism; may not necessarily allow scrolling through entire result set. */
17
37
  cursor?: string
@@ -168,6 +168,9 @@ export class LocalViewer {
168
168
  return {
169
169
  uri: uri.toString(),
170
170
  cid: cid.toString(),
171
+ likeCount: 0, // counts presumed to be 0 directly after post creation
172
+ replyCount: 0,
173
+ repostCount: 0,
171
174
  author,
172
175
  record,
173
176
  embed: embed ?? undefined,
@@ -240,9 +243,7 @@ export class LocalViewer {
240
243
  const collection = new AtUri(embed.record.uri).collection
241
244
  if (collection === ids.AppBskyFeedPost) {
242
245
  const res = await this.appViewAgent.api.app.bsky.feed.getPosts(
243
- {
244
- uris: [embed.record.uri],
245
- },
246
+ { uris: [embed.record.uri] },
246
247
  await this.serviceAuthHeaders(this.did),
247
248
  )
248
249
  const post = res.data.posts[0]
@@ -259,24 +260,20 @@ export class LocalViewer {
259
260
  }
260
261
  } else if (collection === ids.AppBskyFeedGenerator) {
261
262
  const res = await this.appViewAgent.api.app.bsky.feed.getFeedGenerator(
262
- {
263
- feed: embed.record.uri,
264
- },
263
+ { feed: embed.record.uri },
265
264
  await this.serviceAuthHeaders(this.did),
266
265
  )
267
266
  return {
268
- $type: 'app.bsaky.feed.defs#generatorView',
267
+ $type: 'app.bsky.feed.defs#generatorView',
269
268
  ...res.data.view,
270
269
  }
271
270
  } else if (collection === ids.AppBskyGraphList) {
272
271
  const res = await this.appViewAgent.api.app.bsky.graph.getList(
273
- {
274
- list: embed.record.uri,
275
- },
272
+ { list: embed.record.uri },
276
273
  await this.serviceAuthHeaders(this.did),
277
274
  )
278
275
  return {
279
- $type: 'app.bsaky.graph.defs#listView',
276
+ $type: 'app.bsky.graph.defs#listView',
280
277
  ...res.data.list,
281
278
  }
282
279
  }