@atproto/bsky 0.0.9 → 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.
- package/CHANGELOG.md +7 -0
- package/dist/db/index.js +55 -3
- package/dist/db/index.js.map +3 -3
- package/dist/index.js +561 -124
- package/dist/index.js.map +3 -3
- package/dist/lexicon/index.d.ts +6 -2
- package/dist/lexicon/lexicons.d.ts +203 -14
- package/dist/lexicon/types/app/bsky/actor/searchActors.d.ts +1 -0
- package/dist/lexicon/types/app/bsky/actor/searchActorsTypeahead.d.ts +1 -0
- package/dist/lexicon/types/app/bsky/{unspecced/applyLabels.d.ts → feed/searchPosts.d.ts} +17 -6
- package/dist/lexicon/types/app/bsky/unspecced/defs.d.ts +13 -0
- package/dist/lexicon/types/app/bsky/unspecced/searchActorsSkeleton.d.ts +38 -0
- package/dist/lexicon/types/app/bsky/unspecced/searchPostsSkeleton.d.ts +37 -0
- package/dist/lexicon/types/com/atproto/admin/searchRepos.d.ts +1 -0
- package/package.json +5 -6
- package/src/api/app/bsky/actor/searchActors.ts +7 -1
- package/src/api/app/bsky/actor/searchActorsTypeahead.ts +7 -1
- package/src/api/com/atproto/admin/searchRepos.ts +5 -0
- package/src/auto-moderator/index.ts +1 -17
- package/src/lexicon/index.ts +36 -12
- package/src/lexicon/lexicons.ts +229 -23
- package/src/lexicon/types/app/bsky/actor/searchActors.ts +3 -0
- package/src/lexicon/types/app/bsky/actor/searchActorsTypeahead.ts +3 -0
- package/src/lexicon/types/app/bsky/feed/searchPosts.ts +54 -0
- package/src/lexicon/types/app/bsky/unspecced/defs.ts +41 -0
- package/src/lexicon/types/app/bsky/unspecced/searchActorsSkeleton.ts +56 -0
- package/src/lexicon/types/app/bsky/unspecced/searchPostsSkeleton.ts +54 -0
- package/src/lexicon/types/com/atproto/admin/searchRepos.ts +2 -0
- package/src/services/indexing/plugins/block.ts +1 -1
- package/src/services/indexing/plugins/feed-generator.ts +1 -1
- package/src/services/indexing/plugins/follow.ts +1 -1
- package/src/services/indexing/plugins/like.ts +1 -1
- package/src/services/indexing/plugins/list-block.ts +1 -1
- package/src/services/indexing/plugins/list-item.ts +1 -1
- package/src/services/indexing/plugins/list.ts +1 -1
- package/src/services/indexing/plugins/post.ts +1 -1
- package/src/services/indexing/plugins/repost.ts +1 -1
- package/src/services/indexing/plugins/thread-gate.ts +1 -1
- package/src/services/label/index.ts +1 -1
- package/dist/services/indexing/util.d.ts +0 -1
- package/src/lexicon/types/app/bsky/unspecced/applyLabels.ts +0 -39
- package/src/services/indexing/util.ts +0 -16
|
@@ -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[]>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function toSimplifiedISOSafe(dateStr: string): string;
|
|
@@ -1,39 +0,0 @@
|
|
|
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 ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
|
|
11
|
-
|
|
12
|
-
export interface QueryParams {}
|
|
13
|
-
|
|
14
|
-
export interface InputSchema {
|
|
15
|
-
labels: ComAtprotoLabelDefs.Label[]
|
|
16
|
-
[k: string]: unknown
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface HandlerInput {
|
|
20
|
-
encoding: 'application/json'
|
|
21
|
-
body: InputSchema
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface HandlerError {
|
|
25
|
-
status: number
|
|
26
|
-
message?: string
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export type HandlerOutput = HandlerError | void
|
|
30
|
-
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
31
|
-
auth: HA
|
|
32
|
-
params: QueryParams
|
|
33
|
-
input: HandlerInput
|
|
34
|
-
req: express.Request
|
|
35
|
-
res: express.Response
|
|
36
|
-
}
|
|
37
|
-
export type Handler<HA extends HandlerAuth = never> = (
|
|
38
|
-
ctx: HandlerReqCtx<HA>,
|
|
39
|
-
) => Promise<HandlerOutput> | HandlerOutput
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { isValidISODateString } from 'iso-datestring-validator'
|
|
2
|
-
|
|
3
|
-
// Normalize date strings to simplified ISO so that the lexical sort preserves temporal sort.
|
|
4
|
-
// Rather than failing on an invalid date format, returns valid unix epoch.
|
|
5
|
-
export function toSimplifiedISOSafe(dateStr: string) {
|
|
6
|
-
const date = new Date(dateStr)
|
|
7
|
-
if (isNaN(date.getTime())) {
|
|
8
|
-
return new Date(0).toISOString()
|
|
9
|
-
}
|
|
10
|
-
const iso = date.toISOString()
|
|
11
|
-
if (!isValidISODateString(iso)) {
|
|
12
|
-
// Occurs in rare cases, e.g. where resulting UTC year is negative. These also don't preserve lexical sort.
|
|
13
|
-
return new Date(0).toISOString()
|
|
14
|
-
}
|
|
15
|
-
return iso // YYYY-MM-DDTHH:mm:ss.sssZ
|
|
16
|
-
}
|