@atproto/bsky 0.0.8 → 0.0.10

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 (42) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/db/index.js +55 -3
  3. package/dist/db/index.js.map +3 -3
  4. package/dist/index.js +561 -124
  5. package/dist/index.js.map +3 -3
  6. package/dist/lexicon/index.d.ts +6 -2
  7. package/dist/lexicon/lexicons.d.ts +203 -14
  8. package/dist/lexicon/types/app/bsky/actor/searchActors.d.ts +1 -0
  9. package/dist/lexicon/types/app/bsky/actor/searchActorsTypeahead.d.ts +1 -0
  10. package/dist/lexicon/types/app/bsky/{unspecced/applyLabels.d.ts → feed/searchPosts.d.ts} +17 -6
  11. package/dist/lexicon/types/app/bsky/unspecced/defs.d.ts +13 -0
  12. package/dist/lexicon/types/app/bsky/unspecced/searchActorsSkeleton.d.ts +38 -0
  13. package/dist/lexicon/types/app/bsky/unspecced/searchPostsSkeleton.d.ts +37 -0
  14. package/dist/lexicon/types/com/atproto/admin/searchRepos.d.ts +1 -0
  15. package/package.json +5 -6
  16. package/src/api/app/bsky/actor/searchActors.ts +7 -1
  17. package/src/api/app/bsky/actor/searchActorsTypeahead.ts +7 -1
  18. package/src/api/com/atproto/admin/searchRepos.ts +5 -0
  19. package/src/auto-moderator/index.ts +1 -17
  20. package/src/lexicon/index.ts +36 -12
  21. package/src/lexicon/lexicons.ts +229 -23
  22. package/src/lexicon/types/app/bsky/actor/searchActors.ts +3 -0
  23. package/src/lexicon/types/app/bsky/actor/searchActorsTypeahead.ts +3 -0
  24. package/src/lexicon/types/app/bsky/feed/searchPosts.ts +54 -0
  25. package/src/lexicon/types/app/bsky/unspecced/defs.ts +41 -0
  26. package/src/lexicon/types/app/bsky/unspecced/searchActorsSkeleton.ts +56 -0
  27. package/src/lexicon/types/app/bsky/unspecced/searchPostsSkeleton.ts +54 -0
  28. package/src/lexicon/types/com/atproto/admin/searchRepos.ts +2 -0
  29. package/src/services/indexing/plugins/block.ts +1 -1
  30. package/src/services/indexing/plugins/feed-generator.ts +1 -1
  31. package/src/services/indexing/plugins/follow.ts +1 -1
  32. package/src/services/indexing/plugins/like.ts +1 -1
  33. package/src/services/indexing/plugins/list-block.ts +1 -1
  34. package/src/services/indexing/plugins/list-item.ts +1 -1
  35. package/src/services/indexing/plugins/list.ts +1 -1
  36. package/src/services/indexing/plugins/post.ts +1 -1
  37. package/src/services/indexing/plugins/repost.ts +1 -1
  38. package/src/services/indexing/plugins/thread-gate.ts +1 -1
  39. package/src/services/label/index.ts +1 -1
  40. package/dist/services/indexing/util.d.ts +0 -1
  41. package/src/lexicon/types/app/bsky/unspecced/applyLabels.ts +0 -39
  42. package/src/services/indexing/util.ts +0 -16
@@ -89,6 +89,7 @@ import * as AppBskyFeedGetPosts from './types/app/bsky/feed/getPosts'
89
89
  import * as AppBskyFeedGetRepostedBy from './types/app/bsky/feed/getRepostedBy'
90
90
  import * as AppBskyFeedGetSuggestedFeeds from './types/app/bsky/feed/getSuggestedFeeds'
91
91
  import * as AppBskyFeedGetTimeline from './types/app/bsky/feed/getTimeline'
92
+ import * as AppBskyFeedSearchPosts from './types/app/bsky/feed/searchPosts'
92
93
  import * as AppBskyGraphGetBlocks from './types/app/bsky/graph/getBlocks'
93
94
  import * as AppBskyGraphGetFollowers from './types/app/bsky/graph/getFollowers'
94
95
  import * as AppBskyGraphGetFollows from './types/app/bsky/graph/getFollows'
@@ -106,10 +107,11 @@ import * as AppBskyNotificationGetUnreadCount from './types/app/bsky/notificatio
106
107
  import * as AppBskyNotificationListNotifications from './types/app/bsky/notification/listNotifications'
107
108
  import * as AppBskyNotificationRegisterPush from './types/app/bsky/notification/registerPush'
108
109
  import * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen'
109
- import * as AppBskyUnspeccedApplyLabels from './types/app/bsky/unspecced/applyLabels'
110
110
  import * as AppBskyUnspeccedGetPopular from './types/app/bsky/unspecced/getPopular'
111
111
  import * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators'
112
112
  import * as AppBskyUnspeccedGetTimelineSkeleton from './types/app/bsky/unspecced/getTimelineSkeleton'
113
+ import * as AppBskyUnspeccedSearchActorsSkeleton from './types/app/bsky/unspecced/searchActorsSkeleton'
114
+ import * as AppBskyUnspeccedSearchPostsSkeleton from './types/app/bsky/unspecced/searchPostsSkeleton'
113
115
 
114
116
  export const COM_ATPROTO_ADMIN = {
115
117
  DefsTakedown: 'com.atproto.admin.defs#takedown',
@@ -1168,6 +1170,17 @@ export class FeedNS {
1168
1170
  const nsid = 'app.bsky.feed.getTimeline' // @ts-ignore
1169
1171
  return this._server.xrpc.method(nsid, cfg)
1170
1172
  }
1173
+
1174
+ searchPosts<AV extends AuthVerifier>(
1175
+ cfg: ConfigOf<
1176
+ AV,
1177
+ AppBskyFeedSearchPosts.Handler<ExtractAuth<AV>>,
1178
+ AppBskyFeedSearchPosts.HandlerReqCtx<ExtractAuth<AV>>
1179
+ >,
1180
+ ) {
1181
+ const nsid = 'app.bsky.feed.searchPosts' // @ts-ignore
1182
+ return this._server.xrpc.method(nsid, cfg)
1183
+ }
1171
1184
  }
1172
1185
 
1173
1186
  export class GraphNS {
@@ -1388,17 +1401,6 @@ export class UnspeccedNS {
1388
1401
  this._server = server
1389
1402
  }
1390
1403
 
1391
- applyLabels<AV extends AuthVerifier>(
1392
- cfg: ConfigOf<
1393
- AV,
1394
- AppBskyUnspeccedApplyLabels.Handler<ExtractAuth<AV>>,
1395
- AppBskyUnspeccedApplyLabels.HandlerReqCtx<ExtractAuth<AV>>
1396
- >,
1397
- ) {
1398
- const nsid = 'app.bsky.unspecced.applyLabels' // @ts-ignore
1399
- return this._server.xrpc.method(nsid, cfg)
1400
- }
1401
-
1402
1404
  getPopular<AV extends AuthVerifier>(
1403
1405
  cfg: ConfigOf<
1404
1406
  AV,
@@ -1431,6 +1433,28 @@ export class UnspeccedNS {
1431
1433
  const nsid = 'app.bsky.unspecced.getTimelineSkeleton' // @ts-ignore
1432
1434
  return this._server.xrpc.method(nsid, cfg)
1433
1435
  }
1436
+
1437
+ searchActorsSkeleton<AV extends AuthVerifier>(
1438
+ cfg: ConfigOf<
1439
+ AV,
1440
+ AppBskyUnspeccedSearchActorsSkeleton.Handler<ExtractAuth<AV>>,
1441
+ AppBskyUnspeccedSearchActorsSkeleton.HandlerReqCtx<ExtractAuth<AV>>
1442
+ >,
1443
+ ) {
1444
+ const nsid = 'app.bsky.unspecced.searchActorsSkeleton' // @ts-ignore
1445
+ return this._server.xrpc.method(nsid, cfg)
1446
+ }
1447
+
1448
+ searchPostsSkeleton<AV extends AuthVerifier>(
1449
+ cfg: ConfigOf<
1450
+ AV,
1451
+ AppBskyUnspeccedSearchPostsSkeleton.Handler<ExtractAuth<AV>>,
1452
+ AppBskyUnspeccedSearchPostsSkeleton.HandlerReqCtx<ExtractAuth<AV>>
1453
+ >,
1454
+ ) {
1455
+ const nsid = 'app.bsky.unspecced.searchPostsSkeleton' // @ts-ignore
1456
+ return this._server.xrpc.method(nsid, cfg)
1457
+ }
1434
1458
  }
1435
1459
 
1436
1460
  type SharedRateLimitOpts<T> = {
@@ -1113,6 +1113,10 @@ export const schemaDict = {
1113
1113
  properties: {
1114
1114
  term: {
1115
1115
  type: 'string',
1116
+ description: "DEPRECATED: use 'q' instead",
1117
+ },
1118
+ q: {
1119
+ type: 'string',
1116
1120
  },
1117
1121
  invitedBy: {
1118
1122
  type: 'string',
@@ -3998,18 +4002,24 @@ export const schemaDict = {
3998
4002
  defs: {
3999
4003
  main: {
4000
4004
  type: 'query',
4001
- description: 'Find actors matching search criteria.',
4005
+ description: 'Find actors (profiles) matching search criteria.',
4002
4006
  parameters: {
4003
4007
  type: 'params',
4004
4008
  properties: {
4005
4009
  term: {
4006
4010
  type: 'string',
4011
+ description: "DEPRECATED: use 'q' instead",
4012
+ },
4013
+ q: {
4014
+ type: 'string',
4015
+ description:
4016
+ 'search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended',
4007
4017
  },
4008
4018
  limit: {
4009
4019
  type: 'integer',
4010
4020
  minimum: 1,
4011
4021
  maximum: 100,
4012
- default: 50,
4022
+ default: 25,
4013
4023
  },
4014
4024
  cursor: {
4015
4025
  type: 'string',
@@ -4050,12 +4060,17 @@ export const schemaDict = {
4050
4060
  properties: {
4051
4061
  term: {
4052
4062
  type: 'string',
4063
+ description: "DEPRECATED: use 'q' instead",
4064
+ },
4065
+ q: {
4066
+ type: 'string',
4067
+ description: 'search query prefix; not a full query string',
4053
4068
  },
4054
4069
  limit: {
4055
4070
  type: 'integer',
4056
4071
  minimum: 1,
4057
4072
  maximum: 100,
4058
- default: 50,
4073
+ default: 10,
4059
4074
  },
4060
4075
  },
4061
4076
  },
@@ -5713,6 +5728,67 @@ export const schemaDict = {
5713
5728
  },
5714
5729
  },
5715
5730
  },
5731
+ AppBskyFeedSearchPosts: {
5732
+ lexicon: 1,
5733
+ id: 'app.bsky.feed.searchPosts',
5734
+ defs: {
5735
+ main: {
5736
+ type: 'query',
5737
+ description: 'Find posts matching search criteria',
5738
+ parameters: {
5739
+ type: 'params',
5740
+ required: ['q'],
5741
+ properties: {
5742
+ q: {
5743
+ type: 'string',
5744
+ description:
5745
+ 'search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended',
5746
+ },
5747
+ limit: {
5748
+ type: 'integer',
5749
+ minimum: 1,
5750
+ maximum: 100,
5751
+ default: 25,
5752
+ },
5753
+ cursor: {
5754
+ type: 'string',
5755
+ description:
5756
+ 'optional pagination mechanism; may not necessarily allow scrolling through entire result set',
5757
+ },
5758
+ },
5759
+ },
5760
+ output: {
5761
+ encoding: 'application/json',
5762
+ schema: {
5763
+ type: 'object',
5764
+ required: ['posts'],
5765
+ properties: {
5766
+ cursor: {
5767
+ type: 'string',
5768
+ },
5769
+ hitsTotal: {
5770
+ type: 'integer',
5771
+ description:
5772
+ 'count of search hits. optional, may be rounded/truncated, and may not be possible to paginate through all hits',
5773
+ },
5774
+ posts: {
5775
+ type: 'array',
5776
+ items: {
5777
+ type: 'ref',
5778
+ ref: 'lex:app.bsky.feed.defs#postView',
5779
+ },
5780
+ },
5781
+ },
5782
+ },
5783
+ },
5784
+ errors: [
5785
+ {
5786
+ name: 'BadQueryString',
5787
+ },
5788
+ ],
5789
+ },
5790
+ },
5791
+ },
5716
5792
  AppBskyFeedThreadgate: {
5717
5793
  lexicon: 1,
5718
5794
  id: 'app.bsky.feed.threadgate',
@@ -6829,27 +6905,27 @@ export const schemaDict = {
6829
6905
  },
6830
6906
  },
6831
6907
  },
6832
- AppBskyUnspeccedApplyLabels: {
6908
+ AppBskyUnspeccedDefs: {
6833
6909
  lexicon: 1,
6834
- id: 'app.bsky.unspecced.applyLabels',
6910
+ id: 'app.bsky.unspecced.defs',
6835
6911
  defs: {
6836
- main: {
6837
- type: 'procedure',
6838
- description: 'Allow a labeler to apply labels directly.',
6839
- input: {
6840
- encoding: 'application/json',
6841
- schema: {
6842
- type: 'object',
6843
- required: ['labels'],
6844
- properties: {
6845
- labels: {
6846
- type: 'array',
6847
- items: {
6848
- type: 'ref',
6849
- ref: 'lex:com.atproto.label.defs#label',
6850
- },
6851
- },
6852
- },
6912
+ skeletonSearchPost: {
6913
+ type: 'object',
6914
+ required: ['uri'],
6915
+ properties: {
6916
+ uri: {
6917
+ type: 'string',
6918
+ format: 'at-uri',
6919
+ },
6920
+ },
6921
+ },
6922
+ skeletonSearchActor: {
6923
+ type: 'object',
6924
+ required: ['did'],
6925
+ properties: {
6926
+ did: {
6927
+ type: 'string',
6928
+ format: 'did',
6853
6929
  },
6854
6930
  },
6855
6931
  },
@@ -6997,6 +7073,132 @@ export const schemaDict = {
6997
7073
  },
6998
7074
  },
6999
7075
  },
7076
+ AppBskyUnspeccedSearchActorsSkeleton: {
7077
+ lexicon: 1,
7078
+ id: 'app.bsky.unspecced.searchActorsSkeleton',
7079
+ defs: {
7080
+ main: {
7081
+ type: 'query',
7082
+ description: 'Backend Actors (profile) search, returning only skeleton',
7083
+ parameters: {
7084
+ type: 'params',
7085
+ required: ['q'],
7086
+ properties: {
7087
+ q: {
7088
+ type: 'string',
7089
+ description:
7090
+ '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',
7091
+ },
7092
+ typeahead: {
7093
+ type: 'boolean',
7094
+ description: "if true, acts as fast/simple 'typeahead' query",
7095
+ },
7096
+ limit: {
7097
+ type: 'integer',
7098
+ minimum: 1,
7099
+ maximum: 100,
7100
+ default: 25,
7101
+ },
7102
+ cursor: {
7103
+ type: 'string',
7104
+ description:
7105
+ 'optional pagination mechanism; may not necessarily allow scrolling through entire result set',
7106
+ },
7107
+ },
7108
+ },
7109
+ output: {
7110
+ encoding: 'application/json',
7111
+ schema: {
7112
+ type: 'object',
7113
+ required: ['actors'],
7114
+ properties: {
7115
+ cursor: {
7116
+ type: 'string',
7117
+ },
7118
+ hitsTotal: {
7119
+ type: 'integer',
7120
+ description:
7121
+ 'count of search hits. optional, may be rounded/truncated, and may not be possible to paginate through all hits',
7122
+ },
7123
+ actors: {
7124
+ type: 'array',
7125
+ items: {
7126
+ type: 'ref',
7127
+ ref: 'lex:app.bsky.unspecced.defs#skeletonSearchActor',
7128
+ },
7129
+ },
7130
+ },
7131
+ },
7132
+ },
7133
+ errors: [
7134
+ {
7135
+ name: 'BadQueryString',
7136
+ },
7137
+ ],
7138
+ },
7139
+ },
7140
+ },
7141
+ AppBskyUnspeccedSearchPostsSkeleton: {
7142
+ lexicon: 1,
7143
+ id: 'app.bsky.unspecced.searchPostsSkeleton',
7144
+ defs: {
7145
+ main: {
7146
+ type: 'query',
7147
+ description: 'Backend Posts search, returning only skeleton',
7148
+ parameters: {
7149
+ type: 'params',
7150
+ required: ['q'],
7151
+ properties: {
7152
+ q: {
7153
+ type: 'string',
7154
+ description:
7155
+ 'search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended',
7156
+ },
7157
+ limit: {
7158
+ type: 'integer',
7159
+ minimum: 1,
7160
+ maximum: 100,
7161
+ default: 25,
7162
+ },
7163
+ cursor: {
7164
+ type: 'string',
7165
+ description:
7166
+ 'optional pagination mechanism; may not necessarily allow scrolling through entire result set',
7167
+ },
7168
+ },
7169
+ },
7170
+ output: {
7171
+ encoding: 'application/json',
7172
+ schema: {
7173
+ type: 'object',
7174
+ required: ['posts'],
7175
+ properties: {
7176
+ cursor: {
7177
+ type: 'string',
7178
+ },
7179
+ hitsTotal: {
7180
+ type: 'integer',
7181
+ description:
7182
+ 'count of search hits. optional, may be rounded/truncated, and may not be possible to paginate through all hits',
7183
+ },
7184
+ posts: {
7185
+ type: 'array',
7186
+ items: {
7187
+ type: 'ref',
7188
+ ref: 'lex:app.bsky.unspecced.defs#skeletonSearchPost',
7189
+ },
7190
+ },
7191
+ },
7192
+ },
7193
+ },
7194
+ errors: [
7195
+ {
7196
+ name: 'BadQueryString',
7197
+ },
7198
+ ],
7199
+ },
7200
+ },
7201
+ },
7000
7202
  }
7001
7203
  export const schemas: LexiconDoc[] = Object.values(schemaDict) as LexiconDoc[]
7002
7204
  export const lexicons: Lexicons = new Lexicons(schemas)
@@ -7103,6 +7305,7 @@ export const ids = {
7103
7305
  AppBskyFeedLike: 'app.bsky.feed.like',
7104
7306
  AppBskyFeedPost: 'app.bsky.feed.post',
7105
7307
  AppBskyFeedRepost: 'app.bsky.feed.repost',
7308
+ AppBskyFeedSearchPosts: 'app.bsky.feed.searchPosts',
7106
7309
  AppBskyFeedThreadgate: 'app.bsky.feed.threadgate',
7107
7310
  AppBskyGraphBlock: 'app.bsky.graph.block',
7108
7311
  AppBskyGraphDefs: 'app.bsky.graph.defs',
@@ -7130,9 +7333,12 @@ export const ids = {
7130
7333
  AppBskyNotificationRegisterPush: 'app.bsky.notification.registerPush',
7131
7334
  AppBskyNotificationUpdateSeen: 'app.bsky.notification.updateSeen',
7132
7335
  AppBskyRichtextFacet: 'app.bsky.richtext.facet',
7133
- AppBskyUnspeccedApplyLabels: 'app.bsky.unspecced.applyLabels',
7336
+ AppBskyUnspeccedDefs: 'app.bsky.unspecced.defs',
7134
7337
  AppBskyUnspeccedGetPopular: 'app.bsky.unspecced.getPopular',
7135
7338
  AppBskyUnspeccedGetPopularFeedGenerators:
7136
7339
  'app.bsky.unspecced.getPopularFeedGenerators',
7137
7340
  AppBskyUnspeccedGetTimelineSkeleton: 'app.bsky.unspecced.getTimelineSkeleton',
7341
+ AppBskyUnspeccedSearchActorsSkeleton:
7342
+ 'app.bsky.unspecced.searchActorsSkeleton',
7343
+ AppBskyUnspeccedSearchPostsSkeleton: 'app.bsky.unspecced.searchPostsSkeleton',
7138
7344
  }
@@ -10,7 +10,10 @@ import { HandlerAuth } from '@atproto/xrpc-server'
10
10
  import * as AppBskyActorDefs from './defs'
11
11
 
12
12
  export interface QueryParams {
13
+ /** DEPRECATED: use 'q' instead */
13
14
  term?: string
15
+ /** search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended */
16
+ q?: string
14
17
  limit: number
15
18
  cursor?: string
16
19
  }
@@ -10,7 +10,10 @@ import { HandlerAuth } from '@atproto/xrpc-server'
10
10
  import * as AppBskyActorDefs from './defs'
11
11
 
12
12
  export interface QueryParams {
13
+ /** DEPRECATED: use 'q' instead */
13
14
  term?: string
15
+ /** search query prefix; not a full query string */
16
+ q?: string
14
17
  limit: number
15
18
  }
16
19
 
@@ -0,0 +1,54 @@
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 } from '@atproto/xrpc-server'
10
+ import * as AppBskyFeedDefs from './defs'
11
+
12
+ export interface QueryParams {
13
+ /** search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended */
14
+ q: string
15
+ limit: number
16
+ /** optional pagination mechanism; may not necessarily allow scrolling through entire result set */
17
+ cursor?: string
18
+ }
19
+
20
+ export type InputSchema = undefined
21
+
22
+ export interface OutputSchema {
23
+ cursor?: string
24
+ /** count of search hits. optional, may be rounded/truncated, and may not be possible to paginate through all hits */
25
+ hitsTotal?: number
26
+ posts: AppBskyFeedDefs.PostView[]
27
+ [k: string]: unknown
28
+ }
29
+
30
+ export type HandlerInput = undefined
31
+
32
+ export interface HandlerSuccess {
33
+ encoding: 'application/json'
34
+ body: OutputSchema
35
+ headers?: { [key: string]: string }
36
+ }
37
+
38
+ export interface HandlerError {
39
+ status: number
40
+ message?: string
41
+ error?: 'BadQueryString'
42
+ }
43
+
44
+ export type HandlerOutput = HandlerError | HandlerSuccess
45
+ export type HandlerReqCtx<HA extends HandlerAuth = never> = {
46
+ auth: HA
47
+ params: QueryParams
48
+ input: HandlerInput
49
+ req: express.Request
50
+ res: express.Response
51
+ }
52
+ export type Handler<HA extends HandlerAuth = never> = (
53
+ ctx: HandlerReqCtx<HA>,
54
+ ) => Promise<HandlerOutput> | HandlerOutput
@@ -0,0 +1,41 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
5
+ import { lexicons } from '../../../../lexicons'
6
+ import { isObj, hasProp } from '../../../../util'
7
+ import { CID } from 'multiformats/cid'
8
+
9
+ export interface SkeletonSearchPost {
10
+ uri: string
11
+ [k: string]: unknown
12
+ }
13
+
14
+ export function isSkeletonSearchPost(v: unknown): v is SkeletonSearchPost {
15
+ return (
16
+ isObj(v) &&
17
+ hasProp(v, '$type') &&
18
+ v.$type === 'app.bsky.unspecced.defs#skeletonSearchPost'
19
+ )
20
+ }
21
+
22
+ export function validateSkeletonSearchPost(v: unknown): ValidationResult {
23
+ return lexicons.validate('app.bsky.unspecced.defs#skeletonSearchPost', v)
24
+ }
25
+
26
+ export interface SkeletonSearchActor {
27
+ did: string
28
+ [k: string]: unknown
29
+ }
30
+
31
+ export function isSkeletonSearchActor(v: unknown): v is SkeletonSearchActor {
32
+ return (
33
+ isObj(v) &&
34
+ hasProp(v, '$type') &&
35
+ v.$type === 'app.bsky.unspecced.defs#skeletonSearchActor'
36
+ )
37
+ }
38
+
39
+ export function validateSkeletonSearchActor(v: unknown): ValidationResult {
40
+ return lexicons.validate('app.bsky.unspecced.defs#skeletonSearchActor', v)
41
+ }
@@ -0,0 +1,56 @@
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 } from '@atproto/xrpc-server'
10
+ import * as AppBskyUnspeccedDefs from './defs'
11
+
12
+ export interface QueryParams {
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
+ q: string
15
+ /** if true, acts as fast/simple 'typeahead' query */
16
+ typeahead?: boolean
17
+ limit: number
18
+ /** optional pagination mechanism; may not necessarily allow scrolling through entire result set */
19
+ cursor?: string
20
+ }
21
+
22
+ export type InputSchema = undefined
23
+
24
+ export interface OutputSchema {
25
+ cursor?: string
26
+ /** count of search hits. optional, may be rounded/truncated, and may not be possible to paginate through all hits */
27
+ hitsTotal?: number
28
+ actors: AppBskyUnspeccedDefs.SkeletonSearchActor[]
29
+ [k: string]: unknown
30
+ }
31
+
32
+ export type HandlerInput = undefined
33
+
34
+ export interface HandlerSuccess {
35
+ encoding: 'application/json'
36
+ body: OutputSchema
37
+ headers?: { [key: string]: string }
38
+ }
39
+
40
+ export interface HandlerError {
41
+ status: number
42
+ message?: string
43
+ error?: 'BadQueryString'
44
+ }
45
+
46
+ export type HandlerOutput = HandlerError | HandlerSuccess
47
+ export type HandlerReqCtx<HA extends HandlerAuth = never> = {
48
+ auth: HA
49
+ params: QueryParams
50
+ input: HandlerInput
51
+ req: express.Request
52
+ res: express.Response
53
+ }
54
+ export type Handler<HA extends HandlerAuth = never> = (
55
+ ctx: HandlerReqCtx<HA>,
56
+ ) => Promise<HandlerOutput> | HandlerOutput
@@ -0,0 +1,54 @@
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 } from '@atproto/xrpc-server'
10
+ import * as AppBskyUnspeccedDefs from './defs'
11
+
12
+ export interface QueryParams {
13
+ /** search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended */
14
+ q: string
15
+ limit: number
16
+ /** optional pagination mechanism; may not necessarily allow scrolling through entire result set */
17
+ cursor?: string
18
+ }
19
+
20
+ export type InputSchema = undefined
21
+
22
+ export interface OutputSchema {
23
+ cursor?: string
24
+ /** count of search hits. optional, may be rounded/truncated, and may not be possible to paginate through all hits */
25
+ hitsTotal?: number
26
+ posts: AppBskyUnspeccedDefs.SkeletonSearchPost[]
27
+ [k: string]: unknown
28
+ }
29
+
30
+ export type HandlerInput = undefined
31
+
32
+ export interface HandlerSuccess {
33
+ encoding: 'application/json'
34
+ body: OutputSchema
35
+ headers?: { [key: string]: string }
36
+ }
37
+
38
+ export interface HandlerError {
39
+ status: number
40
+ message?: string
41
+ error?: 'BadQueryString'
42
+ }
43
+
44
+ export type HandlerOutput = HandlerError | HandlerSuccess
45
+ export type HandlerReqCtx<HA extends HandlerAuth = never> = {
46
+ auth: HA
47
+ params: QueryParams
48
+ input: HandlerInput
49
+ req: express.Request
50
+ res: express.Response
51
+ }
52
+ export type Handler<HA extends HandlerAuth = never> = (
53
+ ctx: HandlerReqCtx<HA>,
54
+ ) => Promise<HandlerOutput> | HandlerOutput
@@ -10,7 +10,9 @@ import { HandlerAuth } from '@atproto/xrpc-server'
10
10
  import * as ComAtprotoAdminDefs from './defs'
11
11
 
12
12
  export interface QueryParams {
13
+ /** DEPRECATED: use 'q' instead */
13
14
  term?: string
15
+ q?: string
14
16
  invitedBy?: string
15
17
  limit: number
16
18
  cursor?: string
@@ -1,11 +1,11 @@
1
1
  import { Selectable } from 'kysely'
2
2
  import { AtUri } from '@atproto/syntax'
3
+ import { toSimplifiedISOSafe } from '@atproto/common'
3
4
  import { CID } from 'multiformats/cid'
4
5
  import * as Block from '../../../lexicon/types/app/bsky/graph/block'
5
6
  import * as lex from '../../../lexicon/lexicons'
6
7
  import { DatabaseSchema, DatabaseSchemaType } from '../../../db/database-schema'
7
8
  import RecordProcessor from '../processor'
8
- import { toSimplifiedISOSafe } from '../util'
9
9
  import { PrimaryDatabase } from '../../../db'
10
10
  import { BackgroundQueue } from '../../../background'
11
11
  import { NotificationServer } from '../../../notifications'
@@ -1,5 +1,6 @@
1
1
  import { Selectable } from 'kysely'
2
2
  import { AtUri } from '@atproto/syntax'
3
+ import { toSimplifiedISOSafe } from '@atproto/common'
3
4
  import { CID } from 'multiformats/cid'
4
5
  import * as FeedGenerator from '../../../lexicon/types/app/bsky/feed/generator'
5
6
  import * as lex from '../../../lexicon/lexicons'
@@ -7,7 +8,6 @@ import { PrimaryDatabase } from '../../../db'
7
8
  import { DatabaseSchema, DatabaseSchemaType } from '../../../db/database-schema'
8
9
  import { BackgroundQueue } from '../../../background'
9
10
  import RecordProcessor from '../processor'
10
- import { toSimplifiedISOSafe } from '../util'
11
11
  import { NotificationServer } from '../../../notifications'
12
12
 
13
13
  const lexId = lex.ids.AppBskyFeedGenerator