@atproto/bsky 0.0.15 → 0.0.17
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 +18 -0
- package/dist/api/com/atproto/moderation/util.d.ts +4 -3
- package/dist/cache/read-through.d.ts +30 -0
- package/dist/config.d.ts +18 -0
- package/dist/context.d.ts +21 -6
- package/dist/daemon/config.d.ts +15 -0
- package/dist/daemon/context.d.ts +15 -0
- package/dist/daemon/index.d.ts +23 -0
- package/dist/daemon/logger.d.ts +3 -0
- package/dist/daemon/notifications.d.ts +18 -0
- package/dist/daemon/services.d.ts +11 -0
- package/dist/db/database-schema.d.ts +1 -2
- package/dist/db/index.js +41 -1
- package/dist/db/index.js.map +3 -3
- package/dist/db/migrations/20231003T202833377Z-create-moderation-subject-status.d.ts +3 -0
- package/dist/db/migrations/20231205T000257238Z-remove-did-cache.d.ts +3 -0
- package/dist/db/migrations/index.d.ts +2 -0
- package/dist/db/pagination.d.ts +2 -1
- package/dist/db/{periodic-moderation-action-reversal.d.ts → periodic-moderation-event-reversal.d.ts} +3 -5
- package/dist/db/tables/moderation.d.ts +24 -34
- package/dist/did-cache.d.ts +10 -7
- package/dist/feed-gen/types.d.ts +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +4370 -2758
- package/dist/index.js.map +3 -3
- package/dist/indexer/context.d.ts +2 -0
- package/dist/indexer/index.d.ts +1 -0
- package/dist/lexicon/index.d.ts +23 -18
- package/dist/lexicon/lexicons.d.ts +561 -412
- package/dist/lexicon/types/app/bsky/feed/defs.d.ts +1 -7
- package/dist/lexicon/types/app/bsky/graph/defs.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/admin/defs.d.ts +114 -48
- package/dist/lexicon/types/com/atproto/admin/{resolveModerationReports.d.ts → deleteAccount.d.ts} +2 -13
- package/dist/lexicon/types/com/atproto/admin/{takeModerationAction.d.ts → emitModerationEvent.d.ts} +5 -6
- package/dist/lexicon/types/com/atproto/admin/{getModerationAction.d.ts → getModerationEvent.d.ts} +1 -1
- package/dist/lexicon/types/com/atproto/admin/{getModerationActions.d.ts → queryModerationEvents.d.ts} +5 -1
- package/dist/lexicon/types/com/atproto/admin/{getModerationReports.d.ts → queryModerationStatuses.d.ts} +12 -6
- package/dist/lexicon/types/com/atproto/admin/sendEmail.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/{admin/getModerationReport.d.ts → temp/importRepo.d.ts} +10 -7
- package/dist/lexicon/types/com/atproto/temp/pushBlob.d.ts +25 -0
- package/dist/lexicon/types/com/atproto/{admin/reverseModerationAction.d.ts → temp/transferAccount.d.ts} +11 -5
- package/dist/logger.d.ts +1 -0
- package/dist/migrate-moderation-data.d.ts +1 -0
- package/dist/redis.d.ts +10 -1
- package/dist/services/actor/index.d.ts +18 -4
- package/dist/services/actor/views.d.ts +6 -8
- package/dist/services/feed/index.d.ts +7 -4
- package/dist/services/feed/util.d.ts +9 -1
- package/dist/services/feed/views.d.ts +11 -21
- package/dist/services/graph/index.d.ts +5 -29
- package/dist/services/graph/types.d.ts +1 -0
- package/dist/services/index.d.ts +3 -7
- package/dist/services/label/index.d.ts +10 -4
- package/dist/services/moderation/index.d.ts +134 -72
- package/dist/services/moderation/pagination.d.ts +36 -0
- package/dist/services/moderation/status.d.ts +13 -0
- package/dist/services/moderation/types.d.ts +35 -0
- package/dist/services/moderation/views.d.ts +18 -14
- package/dist/services/types.d.ts +3 -0
- package/dist/services/util/notification.d.ts +5 -0
- package/dist/services/util/post.d.ts +6 -6
- package/dist/util/debug.d.ts +1 -1
- package/dist/util/retry.d.ts +1 -6
- package/package.json +11 -11
- package/src/api/app/bsky/feed/getActorFeeds.ts +2 -1
- package/src/api/app/bsky/feed/getActorLikes.ts +1 -3
- package/src/api/app/bsky/feed/getAuthorFeed.ts +1 -3
- package/src/api/app/bsky/feed/getFeed.ts +9 -9
- package/src/api/app/bsky/feed/getFeedGenerator.ts +3 -0
- package/src/api/app/bsky/feed/getFeedGenerators.ts +2 -1
- package/src/api/app/bsky/feed/getListFeed.ts +1 -3
- package/src/api/app/bsky/feed/getPostThread.ts +15 -54
- package/src/api/app/bsky/feed/getPosts.ts +21 -18
- package/src/api/app/bsky/feed/getSuggestedFeeds.ts +2 -1
- package/src/api/app/bsky/feed/getTimeline.ts +1 -3
- package/src/api/app/bsky/feed/searchPosts.ts +20 -17
- package/src/api/app/bsky/graph/getList.ts +6 -3
- package/src/api/app/bsky/graph/getListBlocks.ts +3 -2
- package/src/api/app/bsky/graph/getListMutes.ts +2 -1
- package/src/api/app/bsky/graph/getLists.ts +2 -1
- package/src/api/app/bsky/unspecced/getPopularFeedGenerators.ts +3 -1
- package/src/api/blob-resolver.ts +6 -11
- package/src/api/com/atproto/admin/emitModerationEvent.ts +220 -0
- package/src/api/com/atproto/admin/{getModerationActions.ts → getModerationEvent.ts} +5 -11
- package/src/api/com/atproto/admin/getRecord.ts +1 -0
- package/src/api/com/atproto/admin/{getModerationReports.ts → queryModerationEvents.ts} +13 -16
- package/src/api/com/atproto/admin/queryModerationStatuses.ts +55 -0
- package/src/api/com/atproto/moderation/createReport.ts +9 -7
- package/src/api/com/atproto/moderation/util.ts +38 -20
- package/src/api/index.ts +8 -14
- package/src/auth.ts +29 -21
- package/src/auto-moderator/index.ts +26 -19
- package/src/cache/read-through.ts +151 -0
- package/src/config.ts +90 -1
- package/src/context.ts +11 -7
- package/src/daemon/config.ts +60 -0
- package/src/daemon/context.ts +27 -0
- package/src/daemon/index.ts +78 -0
- package/src/daemon/logger.ts +6 -0
- package/src/daemon/notifications.ts +54 -0
- package/src/daemon/services.ts +22 -0
- package/src/db/database-schema.ts +0 -2
- package/src/db/migrations/20231003T202833377Z-create-moderation-subject-status.ts +123 -0
- package/src/db/migrations/20231205T000257238Z-remove-did-cache.ts +14 -0
- package/src/db/migrations/index.ts +2 -0
- package/src/db/pagination.ts +26 -3
- package/src/db/{periodic-moderation-action-reversal.ts → periodic-moderation-event-reversal.ts} +50 -46
- package/src/db/tables/moderation.ts +35 -52
- package/src/did-cache.ts +33 -56
- package/src/feed-gen/bsky-team.ts +1 -1
- package/src/feed-gen/hot-classic.ts +1 -1
- package/src/feed-gen/index.ts +0 -4
- package/src/feed-gen/mutuals.ts +6 -2
- package/src/feed-gen/types.ts +1 -1
- package/src/index.ts +57 -17
- package/src/indexer/context.ts +5 -0
- package/src/indexer/index.ts +10 -7
- package/src/lexicon/index.ts +80 -67
- package/src/lexicon/lexicons.ts +698 -507
- package/src/lexicon/types/app/bsky/feed/defs.ts +1 -18
- package/src/lexicon/types/app/bsky/graph/defs.ts +1 -0
- package/src/lexicon/types/com/atproto/admin/defs.ts +276 -84
- package/src/lexicon/types/com/atproto/admin/{resolveModerationReports.ts → deleteAccount.ts} +2 -13
- package/src/lexicon/types/com/atproto/admin/{takeModerationAction.ts → emitModerationEvent.ts} +13 -11
- package/src/lexicon/types/com/atproto/admin/{getModerationReport.ts → getModerationEvent.ts} +1 -1
- package/src/lexicon/types/com/atproto/admin/{getModerationActions.ts → queryModerationEvents.ts} +8 -1
- package/src/lexicon/types/com/atproto/admin/{getModerationReports.ts → queryModerationStatuses.ts} +21 -14
- package/src/lexicon/types/com/atproto/admin/sendEmail.ts +1 -0
- package/src/lexicon/types/com/atproto/{admin/getModerationAction.ts → temp/importRepo.ts} +11 -7
- package/src/lexicon/types/com/atproto/temp/pushBlob.ts +39 -0
- package/src/lexicon/types/com/atproto/{admin/reverseModerationAction.ts → temp/transferAccount.ts} +18 -5
- package/src/logger.ts +2 -0
- package/src/migrate-moderation-data.ts +414 -0
- package/src/redis.ts +43 -3
- package/src/services/actor/index.ts +55 -7
- package/src/services/actor/views.ts +18 -21
- package/src/services/feed/index.ts +52 -19
- package/src/services/feed/util.ts +47 -19
- package/src/services/feed/views.ts +87 -13
- package/src/services/graph/index.ts +21 -3
- package/src/services/graph/types.ts +1 -0
- package/src/services/index.ts +14 -14
- package/src/services/indexing/index.ts +7 -10
- package/src/services/indexing/plugins/block.ts +2 -3
- package/src/services/indexing/plugins/feed-generator.ts +2 -3
- package/src/services/indexing/plugins/follow.ts +2 -3
- package/src/services/indexing/plugins/like.ts +2 -3
- package/src/services/indexing/plugins/list-block.ts +2 -3
- package/src/services/indexing/plugins/list-item.ts +2 -3
- package/src/services/indexing/plugins/list.ts +2 -3
- package/src/services/indexing/plugins/post.ts +16 -4
- package/src/services/indexing/plugins/repost.ts +2 -3
- package/src/services/indexing/plugins/thread-gate.ts +2 -3
- package/src/services/label/index.ts +68 -25
- package/src/services/moderation/index.ts +380 -395
- package/src/services/moderation/pagination.ts +96 -0
- package/src/services/moderation/status.ts +241 -0
- package/src/services/moderation/types.ts +49 -0
- package/src/services/moderation/views.ts +278 -329
- package/src/services/types.ts +4 -0
- package/src/services/util/notification.ts +70 -0
- package/src/util/debug.ts +2 -2
- package/src/util/retry.ts +1 -44
- package/tests/__snapshots__/feed-generation.test.ts.snap +322 -6
- package/tests/__snapshots__/indexing.test.ts.snap +0 -6
- package/tests/admin/__snapshots__/get-record.test.ts.snap +30 -132
- package/tests/admin/__snapshots__/get-repo.test.ts.snap +14 -60
- package/tests/admin/__snapshots__/moderation-events.test.ts.snap +146 -0
- package/tests/admin/__snapshots__/moderation-statuses.test.ts.snap +64 -0
- package/tests/admin/__snapshots__/moderation.test.ts.snap +0 -125
- package/tests/admin/get-record.test.ts +5 -9
- package/tests/admin/get-repo.test.ts +10 -12
- package/tests/admin/moderation-events.test.ts +221 -0
- package/tests/admin/moderation-statuses.test.ts +145 -0
- package/tests/admin/moderation.test.ts +512 -860
- package/tests/admin/repo-search.test.ts +3 -3
- package/tests/algos/hot-classic.test.ts +1 -2
- package/tests/auth.test.ts +1 -1
- package/tests/auto-moderator/fuzzy-matcher.test.ts +2 -1
- package/tests/auto-moderator/labeler.test.ts +19 -20
- package/tests/auto-moderator/takedowns.test.ts +61 -28
- package/tests/blob-resolver.test.ts +4 -2
- package/tests/daemon.test.ts +191 -0
- package/tests/did-cache.test.ts +20 -5
- package/tests/feed-generation.test.ts +57 -9
- package/tests/handle-invalidation.test.ts +1 -5
- package/tests/indexing.test.ts +20 -13
- package/tests/redis-cache.test.ts +231 -0
- package/tests/seeds/basic.ts +3 -0
- package/tests/subscription/repo.test.ts +4 -7
- package/tests/views/__snapshots__/block-lists.test.ts.snap +3 -9
- package/tests/views/__snapshots__/blocks.test.ts.snap +0 -9
- package/tests/views/__snapshots__/mute-lists.test.ts.snap +5 -5
- package/tests/views/__snapshots__/mutes.test.ts.snap +0 -3
- package/tests/views/__snapshots__/thread.test.ts.snap +0 -30
- package/tests/views/actor-search.test.ts +2 -3
- package/tests/views/author-feed.test.ts +42 -36
- package/tests/views/follows.test.ts +40 -35
- package/tests/views/list-feed.test.ts +17 -9
- package/tests/views/notifications.test.ts +13 -9
- package/tests/views/profile.test.ts +20 -19
- package/tests/views/thread.test.ts +117 -94
- package/tests/views/threadgating.test.ts +89 -19
- package/tests/views/timeline.test.ts +21 -13
- package/dist/api/com/atproto/admin/resolveModerationReports.d.ts +0 -3
- package/dist/api/com/atproto/admin/reverseModerationAction.d.ts +0 -3
- package/dist/api/com/atproto/admin/takeModerationAction.d.ts +0 -3
- package/dist/db/tables/did-cache.d.ts +0 -10
- package/dist/feed-gen/best-of-follows.d.ts +0 -29
- package/dist/feed-gen/whats-hot.d.ts +0 -29
- package/dist/feed-gen/with-friends.d.ts +0 -3
- package/dist/label-cache.d.ts +0 -19
- package/src/api/com/atproto/admin/getModerationAction.ts +0 -44
- package/src/api/com/atproto/admin/getModerationReport.ts +0 -43
- package/src/api/com/atproto/admin/resolveModerationReports.ts +0 -24
- package/src/api/com/atproto/admin/reverseModerationAction.ts +0 -115
- package/src/api/com/atproto/admin/takeModerationAction.ts +0 -156
- package/src/db/tables/did-cache.ts +0 -13
- package/src/feed-gen/best-of-follows.ts +0 -74
- package/src/feed-gen/whats-hot.ts +0 -101
- package/src/feed-gen/with-friends.ts +0 -39
- package/src/label-cache.ts +0 -90
- package/tests/admin/__snapshots__/get-moderation-action.test.ts.snap +0 -172
- package/tests/admin/__snapshots__/get-moderation-actions.test.ts.snap +0 -178
- package/tests/admin/__snapshots__/get-moderation-report.test.ts.snap +0 -177
- package/tests/admin/__snapshots__/get-moderation-reports.test.ts.snap +0 -307
- package/tests/admin/get-moderation-action.test.ts +0 -100
- package/tests/admin/get-moderation-actions.test.ts +0 -164
- package/tests/admin/get-moderation-report.test.ts +0 -100
- package/tests/admin/get-moderation-reports.test.ts +0 -332
- package/tests/algos/whats-hot.test.ts +0 -118
- package/tests/algos/with-friends.test.ts +0 -145
- /package/dist/api/com/atproto/admin/{getModerationAction.d.ts → emitModerationEvent.d.ts} +0 -0
- /package/dist/api/com/atproto/admin/{getModerationActions.d.ts → getModerationEvent.d.ts} +0 -0
- /package/dist/api/com/atproto/admin/{getModerationReport.d.ts → queryModerationEvents.d.ts} +0 -0
- /package/dist/api/com/atproto/admin/{getModerationReports.d.ts → queryModerationStatuses.d.ts} +0 -0
|
@@ -30,6 +30,7 @@ export declare function validatePostView(v: unknown): ValidationResult;
|
|
|
30
30
|
export interface ViewerState {
|
|
31
31
|
repost?: string;
|
|
32
32
|
like?: string;
|
|
33
|
+
replyDisabled?: boolean;
|
|
33
34
|
[k: string]: unknown;
|
|
34
35
|
}
|
|
35
36
|
export declare function isViewerState(v: unknown): v is ViewerState;
|
|
@@ -75,7 +76,6 @@ export interface ThreadViewPost {
|
|
|
75
76
|
$type: string;
|
|
76
77
|
[k: string]: unknown;
|
|
77
78
|
})[];
|
|
78
|
-
viewer?: ViewerThreadState;
|
|
79
79
|
[k: string]: unknown;
|
|
80
80
|
}
|
|
81
81
|
export declare function isThreadViewPost(v: unknown): v is ThreadViewPost;
|
|
@@ -102,12 +102,6 @@ export interface BlockedAuthor {
|
|
|
102
102
|
}
|
|
103
103
|
export declare function isBlockedAuthor(v: unknown): v is BlockedAuthor;
|
|
104
104
|
export declare function validateBlockedAuthor(v: unknown): ValidationResult;
|
|
105
|
-
export interface ViewerThreadState {
|
|
106
|
-
canReply?: boolean;
|
|
107
|
-
[k: string]: unknown;
|
|
108
|
-
}
|
|
109
|
-
export declare function isViewerThreadState(v: unknown): v is ViewerThreadState;
|
|
110
|
-
export declare function validateViewerThreadState(v: unknown): ValidationResult;
|
|
111
105
|
export interface GeneratorView {
|
|
112
106
|
uri: string;
|
|
113
107
|
cid: string;
|
|
@@ -29,6 +29,7 @@ export interface ListView {
|
|
|
29
29
|
export declare function isListView(v: unknown): v is ListView;
|
|
30
30
|
export declare function validateListView(v: unknown): ValidationResult;
|
|
31
31
|
export interface ListItemView {
|
|
32
|
+
uri: string;
|
|
32
33
|
subject: AppBskyActorDefs.ProfileView;
|
|
33
34
|
[k: string]: unknown;
|
|
34
35
|
}
|
|
@@ -10,71 +10,46 @@ export interface StatusAttr {
|
|
|
10
10
|
}
|
|
11
11
|
export declare function isStatusAttr(v: unknown): v is StatusAttr;
|
|
12
12
|
export declare function validateStatusAttr(v: unknown): ValidationResult;
|
|
13
|
-
export interface
|
|
13
|
+
export interface ModEventView {
|
|
14
14
|
id: number;
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
event: ModEventTakedown | ModEventReverseTakedown | ModEventComment | ModEventReport | ModEventLabel | ModEventAcknowledge | ModEventEscalate | ModEventMute | ModEventEmail | {
|
|
16
|
+
$type: string;
|
|
17
|
+
[k: string]: unknown;
|
|
18
|
+
};
|
|
17
19
|
subject: RepoRef | ComAtprotoRepoStrongRef.Main | {
|
|
18
20
|
$type: string;
|
|
19
21
|
[k: string]: unknown;
|
|
20
22
|
};
|
|
21
23
|
subjectBlobCids: string[];
|
|
22
|
-
createLabelVals?: string[];
|
|
23
|
-
negateLabelVals?: string[];
|
|
24
|
-
reason: string;
|
|
25
24
|
createdBy: string;
|
|
26
25
|
createdAt: string;
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
creatorHandle?: string;
|
|
27
|
+
subjectHandle?: string;
|
|
29
28
|
[k: string]: unknown;
|
|
30
29
|
}
|
|
31
|
-
export declare function
|
|
32
|
-
export declare function
|
|
33
|
-
export interface
|
|
30
|
+
export declare function isModEventView(v: unknown): v is ModEventView;
|
|
31
|
+
export declare function validateModEventView(v: unknown): ValidationResult;
|
|
32
|
+
export interface ModEventViewDetail {
|
|
34
33
|
id: number;
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
event: ModEventTakedown | ModEventReverseTakedown | ModEventComment | ModEventReport | ModEventLabel | ModEventAcknowledge | ModEventEscalate | ModEventMute | {
|
|
35
|
+
$type: string;
|
|
36
|
+
[k: string]: unknown;
|
|
37
|
+
};
|
|
37
38
|
subject: RepoView | RepoViewNotFound | RecordView | RecordViewNotFound | {
|
|
38
39
|
$type: string;
|
|
39
40
|
[k: string]: unknown;
|
|
40
41
|
};
|
|
41
42
|
subjectBlobs: BlobView[];
|
|
42
|
-
createLabelVals?: string[];
|
|
43
|
-
negateLabelVals?: string[];
|
|
44
|
-
reason: string;
|
|
45
43
|
createdBy: string;
|
|
46
44
|
createdAt: string;
|
|
47
|
-
reversal?: ActionReversal;
|
|
48
|
-
resolvedReports: ReportView[];
|
|
49
|
-
[k: string]: unknown;
|
|
50
|
-
}
|
|
51
|
-
export declare function isActionViewDetail(v: unknown): v is ActionViewDetail;
|
|
52
|
-
export declare function validateActionViewDetail(v: unknown): ValidationResult;
|
|
53
|
-
export interface ActionViewCurrent {
|
|
54
|
-
id: number;
|
|
55
|
-
action: ActionType;
|
|
56
|
-
durationInHours?: number;
|
|
57
45
|
[k: string]: unknown;
|
|
58
46
|
}
|
|
59
|
-
export declare function
|
|
60
|
-
export declare function
|
|
61
|
-
export interface ActionReversal {
|
|
62
|
-
reason: string;
|
|
63
|
-
createdBy: string;
|
|
64
|
-
createdAt: string;
|
|
65
|
-
[k: string]: unknown;
|
|
66
|
-
}
|
|
67
|
-
export declare function isActionReversal(v: unknown): v is ActionReversal;
|
|
68
|
-
export declare function validateActionReversal(v: unknown): ValidationResult;
|
|
69
|
-
export declare type ActionType = 'lex:com.atproto.admin.defs#takedown' | 'lex:com.atproto.admin.defs#flag' | 'lex:com.atproto.admin.defs#acknowledge' | 'lex:com.atproto.admin.defs#escalate' | (string & {});
|
|
70
|
-
export declare const TAKEDOWN = "com.atproto.admin.defs#takedown";
|
|
71
|
-
export declare const FLAG = "com.atproto.admin.defs#flag";
|
|
72
|
-
export declare const ACKNOWLEDGE = "com.atproto.admin.defs#acknowledge";
|
|
73
|
-
export declare const ESCALATE = "com.atproto.admin.defs#escalate";
|
|
47
|
+
export declare function isModEventViewDetail(v: unknown): v is ModEventViewDetail;
|
|
48
|
+
export declare function validateModEventViewDetail(v: unknown): ValidationResult;
|
|
74
49
|
export interface ReportView {
|
|
75
50
|
id: number;
|
|
76
51
|
reasonType: ComAtprotoModerationDefs.ReasonType;
|
|
77
|
-
|
|
52
|
+
comment?: string;
|
|
78
53
|
subjectRepoHandle?: string;
|
|
79
54
|
subject: RepoRef | ComAtprotoRepoStrongRef.Main | {
|
|
80
55
|
$type: string;
|
|
@@ -87,17 +62,40 @@ export interface ReportView {
|
|
|
87
62
|
}
|
|
88
63
|
export declare function isReportView(v: unknown): v is ReportView;
|
|
89
64
|
export declare function validateReportView(v: unknown): ValidationResult;
|
|
65
|
+
export interface SubjectStatusView {
|
|
66
|
+
id: number;
|
|
67
|
+
subject: RepoRef | ComAtprotoRepoStrongRef.Main | {
|
|
68
|
+
$type: string;
|
|
69
|
+
[k: string]: unknown;
|
|
70
|
+
};
|
|
71
|
+
subjectBlobCids?: string[];
|
|
72
|
+
subjectRepoHandle?: string;
|
|
73
|
+
updatedAt: string;
|
|
74
|
+
createdAt: string;
|
|
75
|
+
reviewState: SubjectReviewState;
|
|
76
|
+
comment?: string;
|
|
77
|
+
muteUntil?: string;
|
|
78
|
+
lastReviewedBy?: string;
|
|
79
|
+
lastReviewedAt?: string;
|
|
80
|
+
lastReportedAt?: string;
|
|
81
|
+
takendown?: boolean;
|
|
82
|
+
suspendUntil?: string;
|
|
83
|
+
[k: string]: unknown;
|
|
84
|
+
}
|
|
85
|
+
export declare function isSubjectStatusView(v: unknown): v is SubjectStatusView;
|
|
86
|
+
export declare function validateSubjectStatusView(v: unknown): ValidationResult;
|
|
90
87
|
export interface ReportViewDetail {
|
|
91
88
|
id: number;
|
|
92
89
|
reasonType: ComAtprotoModerationDefs.ReasonType;
|
|
93
|
-
|
|
90
|
+
comment?: string;
|
|
94
91
|
subject: RepoView | RepoViewNotFound | RecordView | RecordViewNotFound | {
|
|
95
92
|
$type: string;
|
|
96
93
|
[k: string]: unknown;
|
|
97
94
|
};
|
|
95
|
+
subjectStatus?: SubjectStatusView;
|
|
98
96
|
reportedBy: string;
|
|
99
97
|
createdAt: string;
|
|
100
|
-
resolvedByActions:
|
|
98
|
+
resolvedByActions: ModEventView[];
|
|
101
99
|
[k: string]: unknown;
|
|
102
100
|
}
|
|
103
101
|
export declare function isReportViewDetail(v: unknown): v is ReportViewDetail;
|
|
@@ -199,15 +197,13 @@ export interface RecordViewNotFound {
|
|
|
199
197
|
export declare function isRecordViewNotFound(v: unknown): v is RecordViewNotFound;
|
|
200
198
|
export declare function validateRecordViewNotFound(v: unknown): ValidationResult;
|
|
201
199
|
export interface Moderation {
|
|
202
|
-
|
|
200
|
+
subjectStatus?: SubjectStatusView;
|
|
203
201
|
[k: string]: unknown;
|
|
204
202
|
}
|
|
205
203
|
export declare function isModeration(v: unknown): v is Moderation;
|
|
206
204
|
export declare function validateModeration(v: unknown): ValidationResult;
|
|
207
205
|
export interface ModerationDetail {
|
|
208
|
-
|
|
209
|
-
actions: ActionView[];
|
|
210
|
-
reports: ReportView[];
|
|
206
|
+
subjectStatus?: SubjectStatusView;
|
|
211
207
|
[k: string]: unknown;
|
|
212
208
|
}
|
|
213
209
|
export declare function isModerationDetail(v: unknown): v is ModerationDetail;
|
|
@@ -241,3 +237,73 @@ export interface VideoDetails {
|
|
|
241
237
|
}
|
|
242
238
|
export declare function isVideoDetails(v: unknown): v is VideoDetails;
|
|
243
239
|
export declare function validateVideoDetails(v: unknown): ValidationResult;
|
|
240
|
+
export declare type SubjectReviewState = 'lex:com.atproto.admin.defs#reviewOpen' | 'lex:com.atproto.admin.defs#reviewEscalated' | 'lex:com.atproto.admin.defs#reviewClosed' | (string & {});
|
|
241
|
+
export declare const REVIEWOPEN = "com.atproto.admin.defs#reviewOpen";
|
|
242
|
+
export declare const REVIEWESCALATED = "com.atproto.admin.defs#reviewEscalated";
|
|
243
|
+
export declare const REVIEWCLOSED = "com.atproto.admin.defs#reviewClosed";
|
|
244
|
+
export interface ModEventTakedown {
|
|
245
|
+
comment?: string;
|
|
246
|
+
durationInHours?: number;
|
|
247
|
+
[k: string]: unknown;
|
|
248
|
+
}
|
|
249
|
+
export declare function isModEventTakedown(v: unknown): v is ModEventTakedown;
|
|
250
|
+
export declare function validateModEventTakedown(v: unknown): ValidationResult;
|
|
251
|
+
export interface ModEventReverseTakedown {
|
|
252
|
+
comment?: string;
|
|
253
|
+
[k: string]: unknown;
|
|
254
|
+
}
|
|
255
|
+
export declare function isModEventReverseTakedown(v: unknown): v is ModEventReverseTakedown;
|
|
256
|
+
export declare function validateModEventReverseTakedown(v: unknown): ValidationResult;
|
|
257
|
+
export interface ModEventComment {
|
|
258
|
+
comment: string;
|
|
259
|
+
sticky?: boolean;
|
|
260
|
+
[k: string]: unknown;
|
|
261
|
+
}
|
|
262
|
+
export declare function isModEventComment(v: unknown): v is ModEventComment;
|
|
263
|
+
export declare function validateModEventComment(v: unknown): ValidationResult;
|
|
264
|
+
export interface ModEventReport {
|
|
265
|
+
comment?: string;
|
|
266
|
+
reportType: ComAtprotoModerationDefs.ReasonType;
|
|
267
|
+
[k: string]: unknown;
|
|
268
|
+
}
|
|
269
|
+
export declare function isModEventReport(v: unknown): v is ModEventReport;
|
|
270
|
+
export declare function validateModEventReport(v: unknown): ValidationResult;
|
|
271
|
+
export interface ModEventLabel {
|
|
272
|
+
comment?: string;
|
|
273
|
+
createLabelVals: string[];
|
|
274
|
+
negateLabelVals: string[];
|
|
275
|
+
[k: string]: unknown;
|
|
276
|
+
}
|
|
277
|
+
export declare function isModEventLabel(v: unknown): v is ModEventLabel;
|
|
278
|
+
export declare function validateModEventLabel(v: unknown): ValidationResult;
|
|
279
|
+
export interface ModEventAcknowledge {
|
|
280
|
+
comment?: string;
|
|
281
|
+
[k: string]: unknown;
|
|
282
|
+
}
|
|
283
|
+
export declare function isModEventAcknowledge(v: unknown): v is ModEventAcknowledge;
|
|
284
|
+
export declare function validateModEventAcknowledge(v: unknown): ValidationResult;
|
|
285
|
+
export interface ModEventEscalate {
|
|
286
|
+
comment?: string;
|
|
287
|
+
[k: string]: unknown;
|
|
288
|
+
}
|
|
289
|
+
export declare function isModEventEscalate(v: unknown): v is ModEventEscalate;
|
|
290
|
+
export declare function validateModEventEscalate(v: unknown): ValidationResult;
|
|
291
|
+
export interface ModEventMute {
|
|
292
|
+
comment?: string;
|
|
293
|
+
durationInHours: number;
|
|
294
|
+
[k: string]: unknown;
|
|
295
|
+
}
|
|
296
|
+
export declare function isModEventMute(v: unknown): v is ModEventMute;
|
|
297
|
+
export declare function validateModEventMute(v: unknown): ValidationResult;
|
|
298
|
+
export interface ModEventUnmute {
|
|
299
|
+
comment?: string;
|
|
300
|
+
[k: string]: unknown;
|
|
301
|
+
}
|
|
302
|
+
export declare function isModEventUnmute(v: unknown): v is ModEventUnmute;
|
|
303
|
+
export declare function validateModEventUnmute(v: unknown): ValidationResult;
|
|
304
|
+
export interface ModEventEmail {
|
|
305
|
+
subjectLine: string;
|
|
306
|
+
[k: string]: unknown;
|
|
307
|
+
}
|
|
308
|
+
export declare function isModEventEmail(v: unknown): v is ModEventEmail;
|
|
309
|
+
export declare function validateModEventEmail(v: unknown): ValidationResult;
|
package/dist/lexicon/types/com/atproto/admin/{resolveModerationReports.d.ts → deleteAccount.d.ts}
RENAMED
|
@@ -1,31 +1,20 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
3
|
-
import * as ComAtprotoAdminDefs from './defs';
|
|
4
3
|
export interface QueryParams {
|
|
5
4
|
}
|
|
6
5
|
export interface InputSchema {
|
|
7
|
-
|
|
8
|
-
reportIds: number[];
|
|
9
|
-
createdBy: string;
|
|
6
|
+
did: string;
|
|
10
7
|
[k: string]: unknown;
|
|
11
8
|
}
|
|
12
|
-
export declare type OutputSchema = ComAtprotoAdminDefs.ActionView;
|
|
13
9
|
export interface HandlerInput {
|
|
14
10
|
encoding: 'application/json';
|
|
15
11
|
body: InputSchema;
|
|
16
12
|
}
|
|
17
|
-
export interface HandlerSuccess {
|
|
18
|
-
encoding: 'application/json';
|
|
19
|
-
body: OutputSchema;
|
|
20
|
-
headers?: {
|
|
21
|
-
[key: string]: string;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
13
|
export interface HandlerError {
|
|
25
14
|
status: number;
|
|
26
15
|
message?: string;
|
|
27
16
|
}
|
|
28
|
-
export declare type HandlerOutput = HandlerError |
|
|
17
|
+
export declare type HandlerOutput = HandlerError | void;
|
|
29
18
|
export declare type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
30
19
|
auth: HA;
|
|
31
20
|
params: QueryParams;
|
package/dist/lexicon/types/com/atproto/admin/{takeModerationAction.d.ts → emitModerationEvent.d.ts}
RENAMED
|
@@ -5,20 +5,19 @@ import * as ComAtprotoRepoStrongRef from '../repo/strongRef';
|
|
|
5
5
|
export interface QueryParams {
|
|
6
6
|
}
|
|
7
7
|
export interface InputSchema {
|
|
8
|
-
|
|
8
|
+
event: ComAtprotoAdminDefs.ModEventTakedown | ComAtprotoAdminDefs.ModEventAcknowledge | ComAtprotoAdminDefs.ModEventEscalate | ComAtprotoAdminDefs.ModEventComment | ComAtprotoAdminDefs.ModEventLabel | ComAtprotoAdminDefs.ModEventReport | ComAtprotoAdminDefs.ModEventMute | ComAtprotoAdminDefs.ModEventReverseTakedown | ComAtprotoAdminDefs.ModEventUnmute | ComAtprotoAdminDefs.ModEventEmail | {
|
|
9
|
+
$type: string;
|
|
10
|
+
[k: string]: unknown;
|
|
11
|
+
};
|
|
9
12
|
subject: ComAtprotoAdminDefs.RepoRef | ComAtprotoRepoStrongRef.Main | {
|
|
10
13
|
$type: string;
|
|
11
14
|
[k: string]: unknown;
|
|
12
15
|
};
|
|
13
16
|
subjectBlobCids?: string[];
|
|
14
|
-
createLabelVals?: string[];
|
|
15
|
-
negateLabelVals?: string[];
|
|
16
|
-
reason: string;
|
|
17
|
-
durationInHours?: number;
|
|
18
17
|
createdBy: string;
|
|
19
18
|
[k: string]: unknown;
|
|
20
19
|
}
|
|
21
|
-
export declare type OutputSchema = ComAtprotoAdminDefs.
|
|
20
|
+
export declare type OutputSchema = ComAtprotoAdminDefs.ModEventView;
|
|
22
21
|
export interface HandlerInput {
|
|
23
22
|
encoding: 'application/json';
|
|
24
23
|
body: InputSchema;
|
package/dist/lexicon/types/com/atproto/admin/{getModerationAction.d.ts → getModerationEvent.d.ts}
RENAMED
|
@@ -5,7 +5,7 @@ export interface QueryParams {
|
|
|
5
5
|
id: number;
|
|
6
6
|
}
|
|
7
7
|
export declare type InputSchema = undefined;
|
|
8
|
-
export declare type OutputSchema = ComAtprotoAdminDefs.
|
|
8
|
+
export declare type OutputSchema = ComAtprotoAdminDefs.ModEventViewDetail;
|
|
9
9
|
export declare type HandlerInput = undefined;
|
|
10
10
|
export interface HandlerSuccess {
|
|
11
11
|
encoding: 'application/json';
|
|
@@ -2,14 +2,18 @@ import express from 'express';
|
|
|
2
2
|
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
3
3
|
import * as ComAtprotoAdminDefs from './defs';
|
|
4
4
|
export interface QueryParams {
|
|
5
|
+
types?: string[];
|
|
6
|
+
createdBy?: string;
|
|
7
|
+
sortDirection: 'asc' | 'desc';
|
|
5
8
|
subject?: string;
|
|
9
|
+
includeAllUserRecords: boolean;
|
|
6
10
|
limit: number;
|
|
7
11
|
cursor?: string;
|
|
8
12
|
}
|
|
9
13
|
export declare type InputSchema = undefined;
|
|
10
14
|
export interface OutputSchema {
|
|
11
15
|
cursor?: string;
|
|
12
|
-
|
|
16
|
+
events: ComAtprotoAdminDefs.ModEventView[];
|
|
13
17
|
[k: string]: unknown;
|
|
14
18
|
}
|
|
15
19
|
export declare type HandlerInput = undefined;
|
|
@@ -3,19 +3,25 @@ import { HandlerAuth } from '@atproto/xrpc-server';
|
|
|
3
3
|
import * as ComAtprotoAdminDefs from './defs';
|
|
4
4
|
export interface QueryParams {
|
|
5
5
|
subject?: string;
|
|
6
|
+
comment?: string;
|
|
7
|
+
reportedAfter?: string;
|
|
8
|
+
reportedBefore?: string;
|
|
9
|
+
reviewedAfter?: string;
|
|
10
|
+
reviewedBefore?: string;
|
|
11
|
+
includeMuted?: boolean;
|
|
12
|
+
reviewState?: string;
|
|
6
13
|
ignoreSubjects?: string[];
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
14
|
+
lastReviewedBy?: string;
|
|
15
|
+
sortField: 'lastReviewedAt' | 'lastReportedAt';
|
|
16
|
+
sortDirection: 'asc' | 'desc';
|
|
17
|
+
takendown?: boolean;
|
|
11
18
|
limit: number;
|
|
12
19
|
cursor?: string;
|
|
13
|
-
reverse?: boolean;
|
|
14
20
|
}
|
|
15
21
|
export declare type InputSchema = undefined;
|
|
16
22
|
export interface OutputSchema {
|
|
17
23
|
cursor?: string;
|
|
18
|
-
|
|
24
|
+
subjectStatuses: ComAtprotoAdminDefs.SubjectStatusView[];
|
|
19
25
|
[k: string]: unknown;
|
|
20
26
|
}
|
|
21
27
|
export declare type HandlerInput = undefined;
|
package/dist/lexicon/types/com/atproto/{admin/getModerationReport.d.ts → temp/importRepo.d.ts}
RENAMED
|
@@ -1,15 +1,18 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import express from 'express';
|
|
3
|
+
import stream from 'stream';
|
|
2
4
|
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
3
|
-
import * as ComAtprotoAdminDefs from './defs';
|
|
4
5
|
export interface QueryParams {
|
|
5
|
-
|
|
6
|
+
did: string;
|
|
7
|
+
}
|
|
8
|
+
export declare type InputSchema = string | Uint8Array;
|
|
9
|
+
export interface HandlerInput {
|
|
10
|
+
encoding: 'application/vnd.ipld.car';
|
|
11
|
+
body: stream.Readable;
|
|
6
12
|
}
|
|
7
|
-
export declare type InputSchema = undefined;
|
|
8
|
-
export declare type OutputSchema = ComAtprotoAdminDefs.ReportViewDetail;
|
|
9
|
-
export declare type HandlerInput = undefined;
|
|
10
13
|
export interface HandlerSuccess {
|
|
11
|
-
encoding: '
|
|
12
|
-
body:
|
|
14
|
+
encoding: 'text/plain';
|
|
15
|
+
body: Uint8Array | stream.Readable;
|
|
13
16
|
headers?: {
|
|
14
17
|
[key: string]: string;
|
|
15
18
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import express from 'express';
|
|
3
|
+
import stream from 'stream';
|
|
4
|
+
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
5
|
+
export interface QueryParams {
|
|
6
|
+
did: string;
|
|
7
|
+
}
|
|
8
|
+
export declare type InputSchema = string | Uint8Array;
|
|
9
|
+
export interface HandlerInput {
|
|
10
|
+
encoding: '*/*';
|
|
11
|
+
body: stream.Readable;
|
|
12
|
+
}
|
|
13
|
+
export interface HandlerError {
|
|
14
|
+
status: number;
|
|
15
|
+
message?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare type HandlerOutput = HandlerError | void;
|
|
18
|
+
export declare type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
19
|
+
auth: HA;
|
|
20
|
+
params: QueryParams;
|
|
21
|
+
input: HandlerInput;
|
|
22
|
+
req: express.Request;
|
|
23
|
+
res: express.Response;
|
|
24
|
+
};
|
|
25
|
+
export declare type Handler<HA extends HandlerAuth = never> = (ctx: HandlerReqCtx<HA>) => Promise<HandlerOutput> | HandlerOutput;
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
3
|
-
import * as ComAtprotoAdminDefs from './defs';
|
|
4
3
|
export interface QueryParams {
|
|
5
4
|
}
|
|
6
5
|
export interface InputSchema {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
handle: string;
|
|
7
|
+
did: string;
|
|
8
|
+
plcOp: {};
|
|
9
|
+
[k: string]: unknown;
|
|
10
|
+
}
|
|
11
|
+
export interface OutputSchema {
|
|
12
|
+
accessJwt: string;
|
|
13
|
+
refreshJwt: string;
|
|
14
|
+
handle: string;
|
|
15
|
+
did: string;
|
|
10
16
|
[k: string]: unknown;
|
|
11
17
|
}
|
|
12
|
-
export declare type OutputSchema = ComAtprotoAdminDefs.ActionView;
|
|
13
18
|
export interface HandlerInput {
|
|
14
19
|
encoding: 'application/json';
|
|
15
20
|
body: InputSchema;
|
|
@@ -24,6 +29,7 @@ export interface HandlerSuccess {
|
|
|
24
29
|
export interface HandlerError {
|
|
25
30
|
status: number;
|
|
26
31
|
message?: string;
|
|
32
|
+
error?: 'InvalidHandle' | 'InvalidPassword' | 'InvalidInviteCode' | 'HandleNotAvailable' | 'UnsupportedDomain' | 'UnresolvableDid' | 'IncompatibleDidDoc';
|
|
27
33
|
}
|
|
28
34
|
export declare type HandlerOutput = HandlerError | HandlerSuccess;
|
|
29
35
|
export declare type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
package/dist/logger.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { subsystemLogger } from '@atproto/common';
|
|
2
2
|
export declare const dbLogger: ReturnType<typeof subsystemLogger>;
|
|
3
|
+
export declare const cacheLogger: ReturnType<typeof subsystemLogger>;
|
|
3
4
|
export declare const subLogger: ReturnType<typeof subsystemLogger>;
|
|
4
5
|
export declare const labelerLogger: ReturnType<typeof subsystemLogger>;
|
|
5
6
|
export declare const httpLogger: ReturnType<typeof subsystemLogger>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function MigrateModerationData(): Promise<void>;
|
package/dist/redis.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare class Redis {
|
|
|
4
4
|
driver: RedisDriver;
|
|
5
5
|
namespace?: string;
|
|
6
6
|
constructor(opts: RedisOptions);
|
|
7
|
+
withNamespace(namespace: string): Redis;
|
|
7
8
|
readStreams(streams: StreamRef[], opts: {
|
|
8
9
|
count: number;
|
|
9
10
|
blockMs?: number;
|
|
@@ -17,7 +18,9 @@ export declare class Redis {
|
|
|
17
18
|
trimStream(key: string, cursor: number | string): Promise<void>;
|
|
18
19
|
streamLengths(keys: string[]): Promise<number[]>;
|
|
19
20
|
get(key: string): Promise<string | null>;
|
|
20
|
-
set(key: string, val: string | number): Promise<void>;
|
|
21
|
+
set(key: string, val: string | number, ttlMs?: number): Promise<void>;
|
|
22
|
+
getMulti(keys: string[]): Promise<{}>;
|
|
23
|
+
setMulti(vals: Record<string, string | number>, ttlMs?: number): Promise<void>;
|
|
21
24
|
del(key: string): Promise<number>;
|
|
22
25
|
expire(key: string, seconds: number): Promise<number>;
|
|
23
26
|
zremrangebyscore(key: string, min: number, max: number): Promise<number>;
|
|
@@ -48,5 +51,11 @@ export declare type RedisOptions = ({
|
|
|
48
51
|
}) & {
|
|
49
52
|
password?: string;
|
|
50
53
|
namespace?: string;
|
|
54
|
+
db?: number;
|
|
55
|
+
commandTimeout?: number;
|
|
56
|
+
};
|
|
57
|
+
export declare function addressParts(addr: string, defaultPort?: number): {
|
|
58
|
+
host: string;
|
|
59
|
+
port: number;
|
|
51
60
|
};
|
|
52
61
|
export {};
|
|
@@ -2,16 +2,19 @@ import { Database } from '../../db';
|
|
|
2
2
|
import { ActorViews } from './views';
|
|
3
3
|
import { ImageUriBuilder } from '../../image/uri';
|
|
4
4
|
import { Actor } from '../../db/tables/actor';
|
|
5
|
-
import { LabelCache } from '../../label-cache';
|
|
6
5
|
import { TimeCidKeyset } from '../../db/pagination';
|
|
6
|
+
import { FromDb } from '../types';
|
|
7
|
+
import { GraphService } from '../graph';
|
|
8
|
+
import { LabelService } from '../label';
|
|
7
9
|
export * from './types';
|
|
8
10
|
export declare class ActorService {
|
|
9
11
|
db: Database;
|
|
10
12
|
imgUriBuilder: ImageUriBuilder;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
static creator(imgUriBuilder: ImageUriBuilder, labelCache: LabelCache): (db: Database) => ActorService;
|
|
13
|
+
private graph;
|
|
14
|
+
private label;
|
|
14
15
|
views: ActorViews;
|
|
16
|
+
constructor(db: Database, imgUriBuilder: ImageUriBuilder, graph: FromDb<GraphService>, label: FromDb<LabelService>);
|
|
17
|
+
static creator(imgUriBuilder: ImageUriBuilder, graph: FromDb<GraphService>, label: FromDb<LabelService>): (db: Database) => ActorService;
|
|
15
18
|
getActorDid(handleOrDid: string): Promise<string | null>;
|
|
16
19
|
getActor(handleOrDid: string, includeSoftDeleted?: boolean): Promise<ActorResult | null>;
|
|
17
20
|
getActors(handleOrDids: string[], includeSoftDeleted?: boolean): Promise<ActorResult[]>;
|
|
@@ -25,6 +28,17 @@ export declare class ActorService {
|
|
|
25
28
|
cursor: any;
|
|
26
29
|
}>;
|
|
27
30
|
getRepoRev(did: string | null): Promise<string | null>;
|
|
31
|
+
all(opts?: {
|
|
32
|
+
batchSize?: number;
|
|
33
|
+
forever?: boolean;
|
|
34
|
+
cooldownMs?: number;
|
|
35
|
+
startFromDid?: string;
|
|
36
|
+
}): AsyncGenerator<{
|
|
37
|
+
did: string;
|
|
38
|
+
handle: string | null;
|
|
39
|
+
indexedAt: string;
|
|
40
|
+
takedownId: number | null;
|
|
41
|
+
}, void, unknown>;
|
|
28
42
|
}
|
|
29
43
|
declare type ActorResult = Actor;
|
|
30
44
|
export declare class ListKeyset extends TimeCidKeyset<{
|
|
@@ -4,18 +4,19 @@ import { Actor } from '../../db/tables/actor';
|
|
|
4
4
|
import { ImageUriBuilder } from '../../image/uri';
|
|
5
5
|
import { LabelService, Labels } from '../label';
|
|
6
6
|
import { BlockAndMuteState, GraphService } from '../graph';
|
|
7
|
-
import { LabelCache } from '../../label-cache';
|
|
8
7
|
import { ActorInfoMap, ProfileDetailHydrationState, ProfileHydrationState, ProfileInfoMap, ProfileViewMap } from './types';
|
|
9
8
|
import { ListInfoMap } from '../graph/types';
|
|
9
|
+
import { FromDb } from '../types';
|
|
10
10
|
export declare class ActorViews {
|
|
11
11
|
private db;
|
|
12
12
|
private imgUriBuilder;
|
|
13
|
-
private
|
|
14
|
-
|
|
13
|
+
private graph;
|
|
14
|
+
private label;
|
|
15
15
|
services: {
|
|
16
16
|
label: LabelService;
|
|
17
17
|
graph: GraphService;
|
|
18
18
|
};
|
|
19
|
+
constructor(db: Database, imgUriBuilder: ImageUriBuilder, graph: FromDb<GraphService>, label: FromDb<LabelService>);
|
|
19
20
|
profiles(results: (ActorResult | string)[], viewer: string | null, opts?: {
|
|
20
21
|
includeSoftDeleted?: boolean;
|
|
21
22
|
}): Promise<ActorInfoMap>;
|
|
@@ -48,11 +49,8 @@ export declare class ActorViews {
|
|
|
48
49
|
lists: ListInfoMap;
|
|
49
50
|
labels: Labels;
|
|
50
51
|
bam: BlockAndMuteState;
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
}): ProfileViewMap;
|
|
54
|
-
profileBasicPresentation(dids: string[], state: ProfileHydrationState, opts?: {
|
|
55
|
-
viewer?: string | null;
|
|
52
|
+
}, viewer: string | null): ProfileViewMap;
|
|
53
|
+
profileBasicPresentation(dids: string[], state: ProfileHydrationState, viewer: string | null, opts?: {
|
|
56
54
|
omitLabels?: boolean;
|
|
57
55
|
}): ProfileViewMap;
|
|
58
56
|
}
|
|
@@ -6,20 +6,22 @@ import { LabelService } from '../label';
|
|
|
6
6
|
import { ActorService } from '../actor';
|
|
7
7
|
import { BlockAndMuteState, GraphService, ListInfoMap } from '../graph';
|
|
8
8
|
import { FeedViews } from './views';
|
|
9
|
-
import {
|
|
9
|
+
import { FromDb } from '../types';
|
|
10
10
|
export * from './types';
|
|
11
11
|
export declare class FeedService {
|
|
12
12
|
db: Database;
|
|
13
13
|
imgUriBuilder: ImageUriBuilder;
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
private actor;
|
|
15
|
+
private label;
|
|
16
|
+
private graph;
|
|
16
17
|
views: FeedViews;
|
|
17
18
|
services: {
|
|
18
19
|
label: LabelService;
|
|
19
20
|
actor: ActorService;
|
|
20
21
|
graph: GraphService;
|
|
21
22
|
};
|
|
22
|
-
|
|
23
|
+
constructor(db: Database, imgUriBuilder: ImageUriBuilder, actor: FromDb<ActorService>, label: FromDb<LabelService>, graph: FromDb<GraphService>);
|
|
24
|
+
static creator(imgUriBuilder: ImageUriBuilder, actor: FromDb<ActorService>, label: FromDb<LabelService>, graph: FromDb<GraphService>): (db: Database) => FeedService;
|
|
23
25
|
selectPostQb(): import("kysely/dist/cjs/parser/select-parser").QueryBuilderWithSelection<import("kysely/dist/cjs/parser/table-parser").From<import("../../db/database-schema").DatabaseSchemaType, "post">, "post", {}, "post.uri as uri" | "post.cid as cid" | import("kysely").AliasedRawBuilder<FeedItemType, "type"> | "post.uri as postUri" | "post.creator as originatorDid" | "post.creator as postAuthorDid" | "post.replyParent as replyParent" | "post.replyRoot as replyRoot" | "post.sortAt as sortAt">;
|
|
24
26
|
selectFeedItemQb(): import("kysely/dist/cjs/parser/select-parser").QueryBuilderWithSelection<import("kysely/dist/cjs/parser/table-parser").From<import("../../db/database-schema").DatabaseSchemaType, "feed_item">, "post" | "feed_item", {
|
|
25
27
|
type: "post" | "repost";
|
|
@@ -45,6 +47,7 @@ export declare class FeedService {
|
|
|
45
47
|
getPostInfos(postUris: string[], viewer: string | null): Promise<PostInfoMap>;
|
|
46
48
|
getFeedGeneratorInfos(generatorUris: string[], viewer: string | null): Promise<FeedGenInfoMap>;
|
|
47
49
|
getFeedItems(uris: string[]): Promise<Record<string, FeedRow>>;
|
|
50
|
+
postUrisToFeedItems(uris: string[]): Promise<FeedRow[]>;
|
|
48
51
|
feedItemRefs(items: FeedRow[]): {
|
|
49
52
|
dids: Set<string>;
|
|
50
53
|
uris: Set<string>;
|
|
@@ -5,6 +5,14 @@ export declare const invalidReplyRoot: (reply: ReplyRef, parent: {
|
|
|
5
5
|
record: PostRecord;
|
|
6
6
|
invalidReplyRoot: boolean | null;
|
|
7
7
|
}) => boolean;
|
|
8
|
-
|
|
8
|
+
declare type ParsedThreadGate = {
|
|
9
|
+
canReply?: boolean;
|
|
10
|
+
allowMentions?: boolean;
|
|
11
|
+
allowFollowing?: boolean;
|
|
12
|
+
allowListUris?: string[];
|
|
13
|
+
};
|
|
14
|
+
export declare const parseThreadGate: (replierDid: string, ownerDid: string, rootPost: PostRecord | null, gate: GateRecord | null) => ParsedThreadGate;
|
|
15
|
+
export declare const violatesThreadGate: (db: DatabaseSchema, replierDid: string, ownerDid: string, rootPost: PostRecord | null, gate: GateRecord | null) => Promise<boolean>;
|
|
9
16
|
export declare const postToThreadgateUri: (postUri: string) => string;
|
|
10
17
|
export declare const threadgateToPostUri: (gateUri: string) => string;
|
|
18
|
+
export {};
|