@atproto/bsky 0.0.9 → 0.0.11

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 (63) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/config.d.ts +2 -0
  3. package/dist/context.d.ts +3 -0
  4. package/dist/db/index.js +55 -3
  5. package/dist/db/index.js.map +3 -3
  6. package/dist/index.js +1125 -301
  7. package/dist/index.js.map +3 -3
  8. package/dist/lexicon/index.d.ts +14 -2
  9. package/dist/lexicon/lexicons.d.ts +302 -14
  10. package/dist/lexicon/types/app/bsky/actor/searchActors.d.ts +1 -0
  11. package/dist/lexicon/types/app/bsky/actor/searchActorsTypeahead.d.ts +1 -0
  12. package/dist/lexicon/types/app/bsky/feed/searchPosts.d.ts +37 -0
  13. package/dist/lexicon/types/app/bsky/unspecced/defs.d.ts +13 -0
  14. package/dist/lexicon/types/app/bsky/unspecced/searchActorsSkeleton.d.ts +38 -0
  15. package/dist/lexicon/types/app/bsky/unspecced/searchPostsSkeleton.d.ts +37 -0
  16. package/dist/lexicon/types/com/atproto/admin/searchRepos.d.ts +1 -0
  17. package/dist/lexicon/types/com/atproto/server/confirmEmail.d.ts +27 -0
  18. package/dist/lexicon/types/com/atproto/server/createSession.d.ts +1 -0
  19. package/dist/lexicon/types/com/atproto/server/getSession.d.ts +1 -0
  20. package/dist/lexicon/types/com/atproto/server/requestEmailConfirmation.d.ts +19 -0
  21. package/dist/lexicon/types/com/atproto/server/requestEmailUpdate.d.ts +30 -0
  22. package/dist/lexicon/types/{app/bsky/unspecced/applyLabels.d.ts → com/atproto/server/updateEmail.d.ts} +3 -2
  23. package/dist/services/actor/index.d.ts +2 -2
  24. package/dist/services/util/search.d.ts +3 -3
  25. package/package.json +13 -14
  26. package/src/api/app/bsky/actor/searchActors.ts +36 -16
  27. package/src/api/app/bsky/actor/searchActorsTypeahead.ts +24 -11
  28. package/src/api/app/bsky/graph/getSuggestedFollowsByActor.ts +1 -0
  29. package/src/api/com/atproto/admin/searchRepos.ts +6 -4
  30. package/src/auto-moderator/index.ts +1 -17
  31. package/src/config.ts +7 -0
  32. package/src/context.ts +6 -0
  33. package/src/index.ts +5 -0
  34. package/src/lexicon/index.ts +84 -12
  35. package/src/lexicon/lexicons.ts +351 -23
  36. package/src/lexicon/types/app/bsky/actor/searchActors.ts +3 -0
  37. package/src/lexicon/types/app/bsky/actor/searchActorsTypeahead.ts +3 -0
  38. package/src/lexicon/types/app/bsky/feed/searchPosts.ts +54 -0
  39. package/src/lexicon/types/app/bsky/unspecced/defs.ts +41 -0
  40. package/src/lexicon/types/app/bsky/unspecced/searchActorsSkeleton.ts +56 -0
  41. package/src/lexicon/types/app/bsky/unspecced/searchPostsSkeleton.ts +54 -0
  42. package/src/lexicon/types/com/atproto/admin/searchRepos.ts +2 -0
  43. package/src/lexicon/types/{app/bsky/unspecced/applyLabels.ts → com/atproto/server/confirmEmail.ts} +3 -2
  44. package/src/lexicon/types/com/atproto/server/createSession.ts +1 -0
  45. package/src/lexicon/types/com/atproto/server/getSession.ts +1 -0
  46. package/src/lexicon/types/com/atproto/server/requestEmailConfirmation.ts +31 -0
  47. package/src/lexicon/types/com/atproto/server/requestEmailUpdate.ts +43 -0
  48. package/src/lexicon/types/com/atproto/server/updateEmail.ts +41 -0
  49. package/src/services/actor/index.ts +9 -9
  50. package/src/services/indexing/plugins/block.ts +1 -1
  51. package/src/services/indexing/plugins/feed-generator.ts +1 -1
  52. package/src/services/indexing/plugins/follow.ts +1 -1
  53. package/src/services/indexing/plugins/like.ts +1 -1
  54. package/src/services/indexing/plugins/list-block.ts +1 -1
  55. package/src/services/indexing/plugins/list-item.ts +1 -1
  56. package/src/services/indexing/plugins/list.ts +1 -1
  57. package/src/services/indexing/plugins/post.ts +1 -1
  58. package/src/services/indexing/plugins/repost.ts +1 -1
  59. package/src/services/indexing/plugins/thread-gate.ts +1 -1
  60. package/src/services/label/index.ts +1 -1
  61. package/src/services/util/search.ts +24 -23
  62. package/dist/services/indexing/util.d.ts +0 -1
  63. package/src/services/indexing/util.ts +0 -16
@@ -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
@@ -7,12 +7,12 @@ import { lexicons } from '../../../../lexicons'
7
7
  import { isObj, hasProp } from '../../../../util'
8
8
  import { CID } from 'multiformats/cid'
9
9
  import { HandlerAuth } from '@atproto/xrpc-server'
10
- import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
11
10
 
12
11
  export interface QueryParams {}
13
12
 
14
13
  export interface InputSchema {
15
- labels: ComAtprotoLabelDefs.Label[]
14
+ email: string
15
+ token: string
16
16
  [k: string]: unknown
17
17
  }
18
18
 
@@ -24,6 +24,7 @@ export interface HandlerInput {
24
24
  export interface HandlerError {
25
25
  status: number
26
26
  message?: string
27
+ error?: 'AccountNotFound' | 'ExpiredToken' | 'InvalidToken' | 'InvalidEmail'
27
28
  }
28
29
 
29
30
  export type HandlerOutput = HandlerError | void
@@ -23,6 +23,7 @@ export interface OutputSchema {
23
23
  handle: string
24
24
  did: string
25
25
  email?: string
26
+ emailConfirmed?: boolean
26
27
  [k: string]: unknown
27
28
  }
28
29
 
@@ -16,6 +16,7 @@ export interface OutputSchema {
16
16
  handle: string
17
17
  did: string
18
18
  email?: string
19
+ emailConfirmed?: boolean
19
20
  [k: string]: unknown
20
21
  }
21
22
 
@@ -0,0 +1,31 @@
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
+
11
+ export interface QueryParams {}
12
+
13
+ export type InputSchema = undefined
14
+ export type HandlerInput = undefined
15
+
16
+ export interface HandlerError {
17
+ status: number
18
+ message?: string
19
+ }
20
+
21
+ export type HandlerOutput = HandlerError | void
22
+ export type HandlerReqCtx<HA extends HandlerAuth = never> = {
23
+ auth: HA
24
+ params: QueryParams
25
+ input: HandlerInput
26
+ req: express.Request
27
+ res: express.Response
28
+ }
29
+ export type Handler<HA extends HandlerAuth = never> = (
30
+ ctx: HandlerReqCtx<HA>,
31
+ ) => Promise<HandlerOutput> | HandlerOutput
@@ -0,0 +1,43 @@
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
+
11
+ export interface QueryParams {}
12
+
13
+ export type InputSchema = undefined
14
+
15
+ export interface OutputSchema {
16
+ tokenRequired: boolean
17
+ [k: string]: unknown
18
+ }
19
+
20
+ export type HandlerInput = undefined
21
+
22
+ export interface HandlerSuccess {
23
+ encoding: 'application/json'
24
+ body: OutputSchema
25
+ headers?: { [key: string]: string }
26
+ }
27
+
28
+ export interface HandlerError {
29
+ status: number
30
+ message?: string
31
+ }
32
+
33
+ export type HandlerOutput = HandlerError | HandlerSuccess
34
+ export type HandlerReqCtx<HA extends HandlerAuth = never> = {
35
+ auth: HA
36
+ params: QueryParams
37
+ input: HandlerInput
38
+ req: express.Request
39
+ res: express.Response
40
+ }
41
+ export type Handler<HA extends HandlerAuth = never> = (
42
+ ctx: HandlerReqCtx<HA>,
43
+ ) => Promise<HandlerOutput> | HandlerOutput
@@ -0,0 +1,41 @@
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
+
11
+ export interface QueryParams {}
12
+
13
+ export interface InputSchema {
14
+ email: string
15
+ /** Requires a token from com.atproto.sever.requestEmailUpdate if the account's email has been confirmed. */
16
+ token?: string
17
+ [k: string]: unknown
18
+ }
19
+
20
+ export interface HandlerInput {
21
+ encoding: 'application/json'
22
+ body: InputSchema
23
+ }
24
+
25
+ export interface HandlerError {
26
+ status: number
27
+ message?: string
28
+ error?: 'ExpiredToken' | 'InvalidToken' | 'TokenRequired'
29
+ }
30
+
31
+ export type HandlerOutput = HandlerError | void
32
+ export type HandlerReqCtx<HA extends HandlerAuth = never> = {
33
+ auth: HA
34
+ params: QueryParams
35
+ input: HandlerInput
36
+ req: express.Request
37
+ res: express.Response
38
+ }
39
+ export type Handler<HA extends HandlerAuth = never> = (
40
+ ctx: HandlerReqCtx<HA>,
41
+ ) => Promise<HandlerOutput> | HandlerOutput
@@ -83,15 +83,15 @@ export class ActorService {
83
83
  async getSearchResults({
84
84
  cursor,
85
85
  limit = 25,
86
- term = '',
86
+ query = '',
87
87
  includeSoftDeleted,
88
88
  }: {
89
89
  cursor?: string
90
90
  limit?: number
91
- term?: string
91
+ query?: string
92
92
  includeSoftDeleted?: boolean
93
93
  }) {
94
- const searchField = term.startsWith('did:') ? 'did' : 'handle'
94
+ const searchField = query.startsWith('did:') ? 'did' : 'handle'
95
95
  let paginatedBuilder
96
96
  const { ref } = this.db.db.dynamic
97
97
  const paginationOptions = {
@@ -101,10 +101,10 @@ export class ActorService {
101
101
  }
102
102
  let keyset
103
103
 
104
- if (term && searchField === 'handle') {
104
+ if (query && searchField === 'handle') {
105
105
  keyset = new SearchKeyset(sql``, sql``)
106
106
  paginatedBuilder = getUserSearchQuery(this.db, {
107
- term,
107
+ query,
108
108
  includeSoftDeleted,
109
109
  ...paginationOptions,
110
110
  }).select('distance')
@@ -114,10 +114,10 @@ export class ActorService {
114
114
  .select([sql<number>`0`.as('distance')])
115
115
  keyset = new ListKeyset(ref('indexedAt'), ref('did'))
116
116
 
117
- // When searchField === 'did', the term will always be a valid string because
118
- // searchField is set to 'did' after checking that the term is a valid did
119
- if (term && searchField === 'did') {
120
- paginatedBuilder = paginatedBuilder.where('actor.did', '=', term)
117
+ // When searchField === 'did', the query will always be a valid string because
118
+ // searchField is set to 'did' after checking that the query is a valid did
119
+ if (query && searchField === 'did') {
120
+ paginatedBuilder = paginatedBuilder.where('actor.did', '=', query)
121
121
  }
122
122
  paginatedBuilder = paginate(paginatedBuilder, {
123
123
  keyset,
@@ -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
@@ -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 Follow from '../../../lexicon/types/app/bsky/graph/follow'
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 { countAll, excluded } from '../../../db/util'
11
11
  import { BackgroundQueue } from '../../../background'
@@ -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 Like from '../../../lexicon/types/app/bsky/feed/like'
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 { countAll, excluded } from '../../../db/util'
10
10
  import { PrimaryDatabase } from '../../../db'
11
11
  import { BackgroundQueue } from '../../../background'
@@ -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 ListBlock from '../../../lexicon/types/app/bsky/graph/listblock'
5
6
  import * as lex from '../../../lexicon/lexicons'
@@ -8,7 +9,6 @@ import { DatabaseSchema, DatabaseSchemaType } from '../../../db/database-schema'
8
9
  import RecordProcessor from '../processor'
9
10
  import { BackgroundQueue } from '../../../background'
10
11
  import { NotificationServer } from '../../../notifications'
11
- import { toSimplifiedISOSafe } from '../util'
12
12
 
13
13
  const lexId = lex.ids.AppBskyGraphListblock
14
14
  type IndexedListBlock = Selectable<DatabaseSchemaType['list_block']>
@@ -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 ListItem from '../../../lexicon/types/app/bsky/graph/listitem'
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 { InvalidRequestError } from '@atproto/xrpc-server'
10
10
  import { PrimaryDatabase } from '../../../db'
11
11
  import { BackgroundQueue } from '../../../background'
@@ -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 List from '../../../lexicon/types/app/bsky/graph/list'
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,6 +1,7 @@
1
1
  import { Insertable, Selectable, sql } from 'kysely'
2
2
  import { CID } from 'multiformats/cid'
3
3
  import { AtUri } from '@atproto/syntax'
4
+ import { toSimplifiedISOSafe } from '@atproto/common'
4
5
  import { jsonStringToLex } from '@atproto/lexicon'
5
6
  import {
6
7
  Record as PostRecord,
@@ -19,7 +20,6 @@ import * as lex from '../../../lexicon/lexicons'
19
20
  import { DatabaseSchema, DatabaseSchemaType } from '../../../db/database-schema'
20
21
  import RecordProcessor from '../processor'
21
22
  import { Notification } from '../../../db/tables/notification'
22
- import { toSimplifiedISOSafe } from '../util'
23
23
  import { PrimaryDatabase } from '../../../db'
24
24
  import { countAll, excluded } from '../../../db/util'
25
25
  import { BackgroundQueue } from '../../../background'
@@ -1,11 +1,11 @@
1
1
  import { Selectable } from 'kysely'
2
2
  import { CID } from 'multiformats/cid'
3
3
  import { AtUri } from '@atproto/syntax'
4
+ import { toSimplifiedISOSafe } from '@atproto/common'
4
5
  import * as Repost from '../../../lexicon/types/app/bsky/feed/repost'
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 { countAll, excluded } from '../../../db/util'
11
11
  import { BackgroundQueue } from '../../../background'
@@ -1,11 +1,11 @@
1
1
  import { AtUri } from '@atproto/syntax'
2
2
  import { InvalidRequestError } from '@atproto/xrpc-server'
3
+ import { toSimplifiedISOSafe } from '@atproto/common'
3
4
  import { CID } from 'multiformats/cid'
4
5
  import * as Threadgate from '../../../lexicon/types/app/bsky/feed/threadgate'
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,9 +1,9 @@
1
1
  import { sql } from 'kysely'
2
2
  import { AtUri } from '@atproto/syntax'
3
+ import { toSimplifiedISOSafe } from '@atproto/common'
3
4
  import { Database } from '../../db'
4
5
  import { Label, isSelfLabels } from '../../lexicon/types/com/atproto/label/defs'
5
6
  import { ids } from '../../lexicon/lexicons'
6
- import { toSimplifiedISOSafe } from '../indexing/util'
7
7
  import { LabelCache } from '../../label-cache'
8
8
 
9
9
  export type Labels = Record<string, Label[]>