@atproto/bsky 0.0.37 → 0.0.39
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 +21 -0
- package/dist/api/app/bsky/feed/getAuthorFeed.d.ts +2 -3
- package/dist/api/app/bsky/feed/getListFeed.d.ts +2 -2
- package/dist/api/app/bsky/feed/getTimeline.d.ts +4 -2
- package/dist/api/app/bsky/labeler/getServices.d.ts +3 -0
- package/dist/api/util.d.ts +9 -2
- package/dist/auth-verifier.d.ts +1 -1
- package/dist/context.d.ts +3 -0
- package/dist/data-plane/server/db/database-schema.d.ts +2 -2
- package/dist/data-plane/server/db/migrations/20240226T225725627Z-labelers.d.ts +3 -0
- package/dist/data-plane/server/db/migrations/index.d.ts +1 -0
- package/dist/data-plane/server/db/tables/labeler.d.ts +13 -0
- package/dist/data-plane/server/indexing/index.d.ts +2 -0
- package/dist/data-plane/server/indexing/plugins/labeler.d.ts +10 -0
- package/dist/data-plane/server/util.d.ts +6 -6
- package/dist/hydration/actor.d.ts +3 -0
- package/dist/hydration/hydrator.d.ts +27 -22
- package/dist/hydration/label.d.ts +23 -9
- package/dist/index.js +4100 -4645
- package/dist/index.js.map +3 -3
- package/dist/lexicon/index.d.ts +7 -27
- package/dist/lexicon/lexicons.d.ts +516 -1463
- package/dist/lexicon/types/app/bsky/actor/defs.d.ts +23 -1
- package/dist/lexicon/types/app/bsky/embed/record.d.ts +2 -1
- package/dist/lexicon/types/app/bsky/feed/defs.d.ts +1 -0
- package/dist/lexicon/types/app/bsky/graph/defs.d.ts +3 -0
- package/dist/lexicon/types/app/bsky/labeler/defs.d.ts +41 -0
- package/dist/lexicon/types/{com/atproto/admin/searchRepos.d.ts → app/bsky/labeler/getServices.d.ts} +7 -7
- package/dist/lexicon/types/app/bsky/labeler/service.d.ts +14 -0
- package/dist/lexicon/types/com/atproto/admin/defs.d.ts +0 -304
- package/dist/lexicon/types/com/atproto/label/defs.d.ts +23 -0
- package/dist/lexicon/types/com/atproto/server/describeServer.d.ts +7 -0
- package/dist/proto/bsky_connect.d.ts +7 -1
- package/dist/proto/bsky_pb.d.ts +25 -0
- package/dist/util.d.ts +7 -0
- package/dist/views/index.d.ts +3 -0
- package/dist/views/types.d.ts +2 -1
- package/package.json +14 -13
- package/proto/bsky.proto +12 -0
- package/src/api/app/bsky/actor/getProfile.ts +21 -17
- package/src/api/app/bsky/actor/getProfiles.ts +16 -7
- package/src/api/app/bsky/actor/getSuggestions.ts +18 -13
- package/src/api/app/bsky/actor/searchActors.ts +9 -5
- package/src/api/app/bsky/actor/searchActorsTypeahead.ts +12 -5
- package/src/api/app/bsky/feed/getActorFeeds.ts +16 -6
- package/src/api/app/bsky/feed/getActorLikes.ts +18 -8
- package/src/api/app/bsky/feed/getAuthorFeed.ts +18 -19
- package/src/api/app/bsky/feed/getFeed.ts +14 -7
- package/src/api/app/bsky/feed/getFeedGenerator.ts +8 -2
- package/src/api/app/bsky/feed/getFeedGenerators.ts +16 -5
- package/src/api/app/bsky/feed/getLikes.ts +13 -6
- package/src/api/app/bsky/feed/getListFeed.ts +13 -7
- package/src/api/app/bsky/feed/getPostThread.ts +15 -8
- package/src/api/app/bsky/feed/getPosts.ts +14 -5
- package/src/api/app/bsky/feed/getRepostedBy.ts +13 -6
- package/src/api/app/bsky/feed/getSuggestedFeeds.ts +8 -2
- package/src/api/app/bsky/feed/getTimeline.ts +14 -8
- package/src/api/app/bsky/feed/searchPosts.ts +9 -5
- package/src/api/app/bsky/graph/getBlocks.ts +10 -9
- package/src/api/app/bsky/graph/getFollowers.ts +23 -15
- package/src/api/app/bsky/graph/getFollows.ts +23 -15
- package/src/api/app/bsky/graph/getList.ts +14 -8
- package/src/api/app/bsky/graph/getListBlocks.ts +10 -7
- package/src/api/app/bsky/graph/getListMutes.ts +10 -7
- package/src/api/app/bsky/graph/getLists.ts +9 -7
- package/src/api/app/bsky/graph/getMutes.ts +10 -8
- package/src/api/app/bsky/graph/getSuggestedFollowsByActor.ts +10 -7
- package/src/api/app/bsky/graph/muteActor.ts +1 -1
- package/src/api/app/bsky/labeler/getServices.ts +46 -0
- package/src/api/app/bsky/notification/listNotifications.ts +12 -8
- package/src/api/app/bsky/unspecced/getPopularFeedGenerators.ts +6 -3
- package/src/api/com/atproto/admin/getAccountInfos.ts +10 -3
- package/src/api/index.ts +2 -0
- package/src/api/util.ts +19 -4
- package/src/auth-verifier.ts +2 -2
- package/src/context.ts +20 -0
- package/src/data-plane/server/db/database-schema.ts +4 -4
- package/src/data-plane/server/db/migrations/20240226T225725627Z-labelers.ts +27 -0
- package/src/data-plane/server/db/migrations/index.ts +1 -0
- package/src/data-plane/server/db/tables/labeler.ts +16 -0
- package/src/data-plane/server/indexing/index.ts +4 -0
- package/src/data-plane/server/indexing/plugins/labeler.ts +77 -0
- package/src/data-plane/server/routes/interactions.ts +17 -1
- package/src/data-plane/server/routes/labels.ts +4 -2
- package/src/data-plane/server/routes/profile.ts +15 -1
- package/src/data-plane/server/routes/records.ts +1 -0
- package/src/hydration/actor.ts +6 -0
- package/src/hydration/hydrator.ts +171 -97
- package/src/hydration/label.ts +106 -20
- package/src/index.ts +1 -3
- package/src/lexicon/index.ts +22 -137
- package/src/lexicon/lexicons.ts +552 -1635
- package/src/lexicon/types/app/bsky/actor/defs.ts +57 -1
- package/src/lexicon/types/app/bsky/embed/record.ts +2 -0
- package/src/lexicon/types/app/bsky/feed/defs.ts +1 -0
- package/src/lexicon/types/app/bsky/graph/defs.ts +3 -0
- package/src/lexicon/types/app/bsky/labeler/defs.ts +93 -0
- package/src/lexicon/types/{com/atproto/admin/searchRepos.ts → app/bsky/labeler/getServices.ts} +8 -8
- package/src/lexicon/types/app/bsky/labeler/service.ts +31 -0
- package/src/lexicon/types/com/atproto/admin/defs.ts +0 -694
- package/src/lexicon/types/com/atproto/label/defs.ts +78 -0
- package/src/lexicon/types/com/atproto/server/describeServer.ts +18 -0
- package/src/proto/bsky_connect.ts +11 -0
- package/src/proto/bsky_pb.ts +146 -0
- package/src/util.ts +44 -0
- package/src/views/index.ts +77 -8
- package/src/views/types.ts +6 -3
- package/tests/__snapshots__/feed-generation.test.ts.snap +12 -45
- package/tests/_util.ts +21 -0
- package/tests/data-plane/__snapshots__/indexing.test.ts.snap +20 -8
- package/tests/label-hydration.test.ts +162 -0
- package/tests/views/__snapshots__/author-feed.test.ts.snap +0 -46
- package/tests/views/__snapshots__/block-lists.test.ts.snap +7 -17
- package/tests/views/__snapshots__/blocks.test.ts.snap +0 -9
- package/tests/views/__snapshots__/labeler-service.test.ts.snap +156 -0
- package/tests/views/__snapshots__/list-feed.test.ts.snap +0 -20
- package/tests/views/__snapshots__/mute-lists.test.ts.snap +10 -18
- package/tests/views/__snapshots__/mutes.test.ts.snap +0 -4
- package/tests/views/__snapshots__/notifications.test.ts.snap +0 -9
- package/tests/views/__snapshots__/posts.test.ts.snap +0 -7
- package/tests/views/__snapshots__/profile.test.ts.snap +40 -6
- package/tests/views/__snapshots__/thread.test.ts.snap +0 -38
- package/tests/views/__snapshots__/threadgating.test.ts.snap +2 -0
- package/tests/views/__snapshots__/timeline.test.ts.snap +0 -145
- package/tests/views/labeler-service.test.ts +156 -0
- package/tests/views/takedown-labels.test.ts +133 -0
- package/tests/views/timeline.test.ts +7 -2
- package/dist/data-plane/server/db/tables/moderation.d.ts +0 -42
- package/dist/lexicon/types/com/atproto/admin/createCommunicationTemplate.d.ts +0 -37
- package/dist/lexicon/types/com/atproto/admin/deleteCommunicationTemplate.d.ts +0 -25
- package/dist/lexicon/types/com/atproto/admin/emitModerationEvent.d.ts +0 -45
- package/dist/lexicon/types/com/atproto/admin/getModerationEvent.d.ts +0 -29
- package/dist/lexicon/types/com/atproto/admin/getRecord.d.ts +0 -31
- package/dist/lexicon/types/com/atproto/admin/getRepo.d.ts +0 -30
- package/dist/lexicon/types/com/atproto/admin/listCommunicationTemplates.d.ts +0 -31
- package/dist/lexicon/types/com/atproto/admin/queryModerationEvents.d.ts +0 -48
- package/dist/lexicon/types/com/atproto/admin/queryModerationStatuses.d.ts +0 -50
- package/dist/lexicon/types/com/atproto/admin/updateCommunicationTemplate.d.ts +0 -39
- package/src/data-plane/server/db/tables/moderation.ts +0 -59
- package/src/lexicon/types/com/atproto/admin/createCommunicationTemplate.ts +0 -54
- package/src/lexicon/types/com/atproto/admin/deleteCommunicationTemplate.ts +0 -38
- package/src/lexicon/types/com/atproto/admin/emitModerationEvent.ts +0 -67
- package/src/lexicon/types/com/atproto/admin/getModerationEvent.ts +0 -41
- package/src/lexicon/types/com/atproto/admin/getRecord.ts +0 -43
- package/src/lexicon/types/com/atproto/admin/getRepo.ts +0 -42
- package/src/lexicon/types/com/atproto/admin/listCommunicationTemplates.ts +0 -44
- package/src/lexicon/types/com/atproto/admin/queryModerationEvents.ts +0 -73
- package/src/lexicon/types/com/atproto/admin/queryModerationStatuses.ts +0 -74
- package/src/lexicon/types/com/atproto/admin/updateCommunicationTemplate.ts +0 -57
|
@@ -5,10 +5,7 @@ import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
|
5
5
|
import { lexicons } from '../../../../lexicons'
|
|
6
6
|
import { isObj, hasProp } from '../../../../util'
|
|
7
7
|
import { CID } from 'multiformats/cid'
|
|
8
|
-
import * as ComAtprotoRepoStrongRef from '../repo/strongRef'
|
|
9
|
-
import * as ComAtprotoModerationDefs from '../moderation/defs'
|
|
10
8
|
import * as ComAtprotoServerDefs from '../server/defs'
|
|
11
|
-
import * as ComAtprotoLabelDefs from '../label/defs'
|
|
12
9
|
|
|
13
10
|
export interface StatusAttr {
|
|
14
11
|
applied: boolean
|
|
@@ -28,232 +25,6 @@ export function validateStatusAttr(v: unknown): ValidationResult {
|
|
|
28
25
|
return lexicons.validate('com.atproto.admin.defs#statusAttr', v)
|
|
29
26
|
}
|
|
30
27
|
|
|
31
|
-
export interface ModEventView {
|
|
32
|
-
id: number
|
|
33
|
-
event:
|
|
34
|
-
| ModEventTakedown
|
|
35
|
-
| ModEventReverseTakedown
|
|
36
|
-
| ModEventComment
|
|
37
|
-
| ModEventReport
|
|
38
|
-
| ModEventLabel
|
|
39
|
-
| ModEventAcknowledge
|
|
40
|
-
| ModEventEscalate
|
|
41
|
-
| ModEventMute
|
|
42
|
-
| ModEventEmail
|
|
43
|
-
| ModEventResolveAppeal
|
|
44
|
-
| { $type: string; [k: string]: unknown }
|
|
45
|
-
subject:
|
|
46
|
-
| RepoRef
|
|
47
|
-
| ComAtprotoRepoStrongRef.Main
|
|
48
|
-
| { $type: string; [k: string]: unknown }
|
|
49
|
-
subjectBlobCids: string[]
|
|
50
|
-
createdBy: string
|
|
51
|
-
createdAt: string
|
|
52
|
-
creatorHandle?: string
|
|
53
|
-
subjectHandle?: string
|
|
54
|
-
[k: string]: unknown
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export function isModEventView(v: unknown): v is ModEventView {
|
|
58
|
-
return (
|
|
59
|
-
isObj(v) &&
|
|
60
|
-
hasProp(v, '$type') &&
|
|
61
|
-
v.$type === 'com.atproto.admin.defs#modEventView'
|
|
62
|
-
)
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export function validateModEventView(v: unknown): ValidationResult {
|
|
66
|
-
return lexicons.validate('com.atproto.admin.defs#modEventView', v)
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export interface ModEventViewDetail {
|
|
70
|
-
id: number
|
|
71
|
-
event:
|
|
72
|
-
| ModEventTakedown
|
|
73
|
-
| ModEventReverseTakedown
|
|
74
|
-
| ModEventComment
|
|
75
|
-
| ModEventReport
|
|
76
|
-
| ModEventLabel
|
|
77
|
-
| ModEventAcknowledge
|
|
78
|
-
| ModEventEscalate
|
|
79
|
-
| ModEventMute
|
|
80
|
-
| ModEventEmail
|
|
81
|
-
| ModEventResolveAppeal
|
|
82
|
-
| { $type: string; [k: string]: unknown }
|
|
83
|
-
subject:
|
|
84
|
-
| RepoView
|
|
85
|
-
| RepoViewNotFound
|
|
86
|
-
| RecordView
|
|
87
|
-
| RecordViewNotFound
|
|
88
|
-
| { $type: string; [k: string]: unknown }
|
|
89
|
-
subjectBlobs: BlobView[]
|
|
90
|
-
createdBy: string
|
|
91
|
-
createdAt: string
|
|
92
|
-
[k: string]: unknown
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export function isModEventViewDetail(v: unknown): v is ModEventViewDetail {
|
|
96
|
-
return (
|
|
97
|
-
isObj(v) &&
|
|
98
|
-
hasProp(v, '$type') &&
|
|
99
|
-
v.$type === 'com.atproto.admin.defs#modEventViewDetail'
|
|
100
|
-
)
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export function validateModEventViewDetail(v: unknown): ValidationResult {
|
|
104
|
-
return lexicons.validate('com.atproto.admin.defs#modEventViewDetail', v)
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export interface ReportView {
|
|
108
|
-
id: number
|
|
109
|
-
reasonType: ComAtprotoModerationDefs.ReasonType
|
|
110
|
-
comment?: string
|
|
111
|
-
subjectRepoHandle?: string
|
|
112
|
-
subject:
|
|
113
|
-
| RepoRef
|
|
114
|
-
| ComAtprotoRepoStrongRef.Main
|
|
115
|
-
| { $type: string; [k: string]: unknown }
|
|
116
|
-
reportedBy: string
|
|
117
|
-
createdAt: string
|
|
118
|
-
resolvedByActionIds: number[]
|
|
119
|
-
[k: string]: unknown
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export function isReportView(v: unknown): v is ReportView {
|
|
123
|
-
return (
|
|
124
|
-
isObj(v) &&
|
|
125
|
-
hasProp(v, '$type') &&
|
|
126
|
-
v.$type === 'com.atproto.admin.defs#reportView'
|
|
127
|
-
)
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export function validateReportView(v: unknown): ValidationResult {
|
|
131
|
-
return lexicons.validate('com.atproto.admin.defs#reportView', v)
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
export interface SubjectStatusView {
|
|
135
|
-
id: number
|
|
136
|
-
subject:
|
|
137
|
-
| RepoRef
|
|
138
|
-
| ComAtprotoRepoStrongRef.Main
|
|
139
|
-
| { $type: string; [k: string]: unknown }
|
|
140
|
-
subjectBlobCids?: string[]
|
|
141
|
-
subjectRepoHandle?: string
|
|
142
|
-
/** Timestamp referencing when the last update was made to the moderation status of the subject */
|
|
143
|
-
updatedAt: string
|
|
144
|
-
/** Timestamp referencing the first moderation status impacting event was emitted on the subject */
|
|
145
|
-
createdAt: string
|
|
146
|
-
reviewState: SubjectReviewState
|
|
147
|
-
/** Sticky comment on the subject. */
|
|
148
|
-
comment?: string
|
|
149
|
-
muteUntil?: string
|
|
150
|
-
lastReviewedBy?: string
|
|
151
|
-
lastReviewedAt?: string
|
|
152
|
-
lastReportedAt?: string
|
|
153
|
-
/** Timestamp referencing when the author of the subject appealed a moderation action */
|
|
154
|
-
lastAppealedAt?: string
|
|
155
|
-
takendown?: boolean
|
|
156
|
-
/** True indicates that the a previously taken moderator action was appealed against, by the author of the content. False indicates last appeal was resolved by moderators. */
|
|
157
|
-
appealed?: boolean
|
|
158
|
-
suspendUntil?: string
|
|
159
|
-
tags?: string[]
|
|
160
|
-
[k: string]: unknown
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
export function isSubjectStatusView(v: unknown): v is SubjectStatusView {
|
|
164
|
-
return (
|
|
165
|
-
isObj(v) &&
|
|
166
|
-
hasProp(v, '$type') &&
|
|
167
|
-
v.$type === 'com.atproto.admin.defs#subjectStatusView'
|
|
168
|
-
)
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
export function validateSubjectStatusView(v: unknown): ValidationResult {
|
|
172
|
-
return lexicons.validate('com.atproto.admin.defs#subjectStatusView', v)
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
export interface ReportViewDetail {
|
|
176
|
-
id: number
|
|
177
|
-
reasonType: ComAtprotoModerationDefs.ReasonType
|
|
178
|
-
comment?: string
|
|
179
|
-
subject:
|
|
180
|
-
| RepoView
|
|
181
|
-
| RepoViewNotFound
|
|
182
|
-
| RecordView
|
|
183
|
-
| RecordViewNotFound
|
|
184
|
-
| { $type: string; [k: string]: unknown }
|
|
185
|
-
subjectStatus?: SubjectStatusView
|
|
186
|
-
reportedBy: string
|
|
187
|
-
createdAt: string
|
|
188
|
-
resolvedByActions: ModEventView[]
|
|
189
|
-
[k: string]: unknown
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
export function isReportViewDetail(v: unknown): v is ReportViewDetail {
|
|
193
|
-
return (
|
|
194
|
-
isObj(v) &&
|
|
195
|
-
hasProp(v, '$type') &&
|
|
196
|
-
v.$type === 'com.atproto.admin.defs#reportViewDetail'
|
|
197
|
-
)
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
export function validateReportViewDetail(v: unknown): ValidationResult {
|
|
201
|
-
return lexicons.validate('com.atproto.admin.defs#reportViewDetail', v)
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
export interface RepoView {
|
|
205
|
-
did: string
|
|
206
|
-
handle: string
|
|
207
|
-
email?: string
|
|
208
|
-
relatedRecords: {}[]
|
|
209
|
-
indexedAt: string
|
|
210
|
-
moderation: Moderation
|
|
211
|
-
invitedBy?: ComAtprotoServerDefs.InviteCode
|
|
212
|
-
invitesDisabled?: boolean
|
|
213
|
-
inviteNote?: string
|
|
214
|
-
[k: string]: unknown
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
export function isRepoView(v: unknown): v is RepoView {
|
|
218
|
-
return (
|
|
219
|
-
isObj(v) &&
|
|
220
|
-
hasProp(v, '$type') &&
|
|
221
|
-
v.$type === 'com.atproto.admin.defs#repoView'
|
|
222
|
-
)
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
export function validateRepoView(v: unknown): ValidationResult {
|
|
226
|
-
return lexicons.validate('com.atproto.admin.defs#repoView', v)
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
export interface RepoViewDetail {
|
|
230
|
-
did: string
|
|
231
|
-
handle: string
|
|
232
|
-
email?: string
|
|
233
|
-
relatedRecords: {}[]
|
|
234
|
-
indexedAt: string
|
|
235
|
-
moderation: ModerationDetail
|
|
236
|
-
labels?: ComAtprotoLabelDefs.Label[]
|
|
237
|
-
invitedBy?: ComAtprotoServerDefs.InviteCode
|
|
238
|
-
invites?: ComAtprotoServerDefs.InviteCode[]
|
|
239
|
-
invitesDisabled?: boolean
|
|
240
|
-
inviteNote?: string
|
|
241
|
-
emailConfirmedAt?: string
|
|
242
|
-
[k: string]: unknown
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
export function isRepoViewDetail(v: unknown): v is RepoViewDetail {
|
|
246
|
-
return (
|
|
247
|
-
isObj(v) &&
|
|
248
|
-
hasProp(v, '$type') &&
|
|
249
|
-
v.$type === 'com.atproto.admin.defs#repoViewDetail'
|
|
250
|
-
)
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
export function validateRepoViewDetail(v: unknown): ValidationResult {
|
|
254
|
-
return lexicons.validate('com.atproto.admin.defs#repoViewDetail', v)
|
|
255
|
-
}
|
|
256
|
-
|
|
257
28
|
export interface AccountView {
|
|
258
29
|
did: string
|
|
259
30
|
handle: string
|
|
@@ -280,23 +51,6 @@ export function validateAccountView(v: unknown): ValidationResult {
|
|
|
280
51
|
return lexicons.validate('com.atproto.admin.defs#accountView', v)
|
|
281
52
|
}
|
|
282
53
|
|
|
283
|
-
export interface RepoViewNotFound {
|
|
284
|
-
did: string
|
|
285
|
-
[k: string]: unknown
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
export function isRepoViewNotFound(v: unknown): v is RepoViewNotFound {
|
|
289
|
-
return (
|
|
290
|
-
isObj(v) &&
|
|
291
|
-
hasProp(v, '$type') &&
|
|
292
|
-
v.$type === 'com.atproto.admin.defs#repoViewNotFound'
|
|
293
|
-
)
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
export function validateRepoViewNotFound(v: unknown): ValidationResult {
|
|
297
|
-
return lexicons.validate('com.atproto.admin.defs#repoViewNotFound', v)
|
|
298
|
-
}
|
|
299
|
-
|
|
300
54
|
export interface RepoRef {
|
|
301
55
|
did: string
|
|
302
56
|
[k: string]: unknown
|
|
@@ -332,451 +86,3 @@ export function isRepoBlobRef(v: unknown): v is RepoBlobRef {
|
|
|
332
86
|
export function validateRepoBlobRef(v: unknown): ValidationResult {
|
|
333
87
|
return lexicons.validate('com.atproto.admin.defs#repoBlobRef', v)
|
|
334
88
|
}
|
|
335
|
-
|
|
336
|
-
export interface RecordView {
|
|
337
|
-
uri: string
|
|
338
|
-
cid: string
|
|
339
|
-
value: {}
|
|
340
|
-
blobCids: string[]
|
|
341
|
-
indexedAt: string
|
|
342
|
-
moderation: Moderation
|
|
343
|
-
repo: RepoView
|
|
344
|
-
[k: string]: unknown
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
export function isRecordView(v: unknown): v is RecordView {
|
|
348
|
-
return (
|
|
349
|
-
isObj(v) &&
|
|
350
|
-
hasProp(v, '$type') &&
|
|
351
|
-
v.$type === 'com.atproto.admin.defs#recordView'
|
|
352
|
-
)
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
export function validateRecordView(v: unknown): ValidationResult {
|
|
356
|
-
return lexicons.validate('com.atproto.admin.defs#recordView', v)
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
export interface RecordViewDetail {
|
|
360
|
-
uri: string
|
|
361
|
-
cid: string
|
|
362
|
-
value: {}
|
|
363
|
-
blobs: BlobView[]
|
|
364
|
-
labels?: ComAtprotoLabelDefs.Label[]
|
|
365
|
-
indexedAt: string
|
|
366
|
-
moderation: ModerationDetail
|
|
367
|
-
repo: RepoView
|
|
368
|
-
[k: string]: unknown
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
export function isRecordViewDetail(v: unknown): v is RecordViewDetail {
|
|
372
|
-
return (
|
|
373
|
-
isObj(v) &&
|
|
374
|
-
hasProp(v, '$type') &&
|
|
375
|
-
v.$type === 'com.atproto.admin.defs#recordViewDetail'
|
|
376
|
-
)
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
export function validateRecordViewDetail(v: unknown): ValidationResult {
|
|
380
|
-
return lexicons.validate('com.atproto.admin.defs#recordViewDetail', v)
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
export interface RecordViewNotFound {
|
|
384
|
-
uri: string
|
|
385
|
-
[k: string]: unknown
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
export function isRecordViewNotFound(v: unknown): v is RecordViewNotFound {
|
|
389
|
-
return (
|
|
390
|
-
isObj(v) &&
|
|
391
|
-
hasProp(v, '$type') &&
|
|
392
|
-
v.$type === 'com.atproto.admin.defs#recordViewNotFound'
|
|
393
|
-
)
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
export function validateRecordViewNotFound(v: unknown): ValidationResult {
|
|
397
|
-
return lexicons.validate('com.atproto.admin.defs#recordViewNotFound', v)
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
export interface Moderation {
|
|
401
|
-
subjectStatus?: SubjectStatusView
|
|
402
|
-
[k: string]: unknown
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
export function isModeration(v: unknown): v is Moderation {
|
|
406
|
-
return (
|
|
407
|
-
isObj(v) &&
|
|
408
|
-
hasProp(v, '$type') &&
|
|
409
|
-
v.$type === 'com.atproto.admin.defs#moderation'
|
|
410
|
-
)
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
export function validateModeration(v: unknown): ValidationResult {
|
|
414
|
-
return lexicons.validate('com.atproto.admin.defs#moderation', v)
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
export interface ModerationDetail {
|
|
418
|
-
subjectStatus?: SubjectStatusView
|
|
419
|
-
[k: string]: unknown
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
export function isModerationDetail(v: unknown): v is ModerationDetail {
|
|
423
|
-
return (
|
|
424
|
-
isObj(v) &&
|
|
425
|
-
hasProp(v, '$type') &&
|
|
426
|
-
v.$type === 'com.atproto.admin.defs#moderationDetail'
|
|
427
|
-
)
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
export function validateModerationDetail(v: unknown): ValidationResult {
|
|
431
|
-
return lexicons.validate('com.atproto.admin.defs#moderationDetail', v)
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
export interface BlobView {
|
|
435
|
-
cid: string
|
|
436
|
-
mimeType: string
|
|
437
|
-
size: number
|
|
438
|
-
createdAt: string
|
|
439
|
-
details?:
|
|
440
|
-
| ImageDetails
|
|
441
|
-
| VideoDetails
|
|
442
|
-
| { $type: string; [k: string]: unknown }
|
|
443
|
-
moderation?: Moderation
|
|
444
|
-
[k: string]: unknown
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
export function isBlobView(v: unknown): v is BlobView {
|
|
448
|
-
return (
|
|
449
|
-
isObj(v) &&
|
|
450
|
-
hasProp(v, '$type') &&
|
|
451
|
-
v.$type === 'com.atproto.admin.defs#blobView'
|
|
452
|
-
)
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
export function validateBlobView(v: unknown): ValidationResult {
|
|
456
|
-
return lexicons.validate('com.atproto.admin.defs#blobView', v)
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
export interface ImageDetails {
|
|
460
|
-
width: number
|
|
461
|
-
height: number
|
|
462
|
-
[k: string]: unknown
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
export function isImageDetails(v: unknown): v is ImageDetails {
|
|
466
|
-
return (
|
|
467
|
-
isObj(v) &&
|
|
468
|
-
hasProp(v, '$type') &&
|
|
469
|
-
v.$type === 'com.atproto.admin.defs#imageDetails'
|
|
470
|
-
)
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
export function validateImageDetails(v: unknown): ValidationResult {
|
|
474
|
-
return lexicons.validate('com.atproto.admin.defs#imageDetails', v)
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
export interface VideoDetails {
|
|
478
|
-
width: number
|
|
479
|
-
height: number
|
|
480
|
-
length: number
|
|
481
|
-
[k: string]: unknown
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
export function isVideoDetails(v: unknown): v is VideoDetails {
|
|
485
|
-
return (
|
|
486
|
-
isObj(v) &&
|
|
487
|
-
hasProp(v, '$type') &&
|
|
488
|
-
v.$type === 'com.atproto.admin.defs#videoDetails'
|
|
489
|
-
)
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
export function validateVideoDetails(v: unknown): ValidationResult {
|
|
493
|
-
return lexicons.validate('com.atproto.admin.defs#videoDetails', v)
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
export type SubjectReviewState =
|
|
497
|
-
| 'lex:com.atproto.admin.defs#reviewOpen'
|
|
498
|
-
| 'lex:com.atproto.admin.defs#reviewEscalated'
|
|
499
|
-
| 'lex:com.atproto.admin.defs#reviewClosed'
|
|
500
|
-
| (string & {})
|
|
501
|
-
|
|
502
|
-
/** Moderator review status of a subject: Open. Indicates that the subject needs to be reviewed by a moderator */
|
|
503
|
-
export const REVIEWOPEN = 'com.atproto.admin.defs#reviewOpen'
|
|
504
|
-
/** Moderator review status of a subject: Escalated. Indicates that the subject was escalated for review by a moderator */
|
|
505
|
-
export const REVIEWESCALATED = 'com.atproto.admin.defs#reviewEscalated'
|
|
506
|
-
/** Moderator review status of a subject: Closed. Indicates that the subject was already reviewed and resolved by a moderator */
|
|
507
|
-
export const REVIEWCLOSED = 'com.atproto.admin.defs#reviewClosed'
|
|
508
|
-
|
|
509
|
-
/** Take down a subject permanently or temporarily */
|
|
510
|
-
export interface ModEventTakedown {
|
|
511
|
-
comment?: string
|
|
512
|
-
/** Indicates how long the takedown should be in effect before automatically expiring. */
|
|
513
|
-
durationInHours?: number
|
|
514
|
-
[k: string]: unknown
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
export function isModEventTakedown(v: unknown): v is ModEventTakedown {
|
|
518
|
-
return (
|
|
519
|
-
isObj(v) &&
|
|
520
|
-
hasProp(v, '$type') &&
|
|
521
|
-
v.$type === 'com.atproto.admin.defs#modEventTakedown'
|
|
522
|
-
)
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
export function validateModEventTakedown(v: unknown): ValidationResult {
|
|
526
|
-
return lexicons.validate('com.atproto.admin.defs#modEventTakedown', v)
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
/** Revert take down action on a subject */
|
|
530
|
-
export interface ModEventReverseTakedown {
|
|
531
|
-
/** Describe reasoning behind the reversal. */
|
|
532
|
-
comment?: string
|
|
533
|
-
[k: string]: unknown
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
export function isModEventReverseTakedown(
|
|
537
|
-
v: unknown,
|
|
538
|
-
): v is ModEventReverseTakedown {
|
|
539
|
-
return (
|
|
540
|
-
isObj(v) &&
|
|
541
|
-
hasProp(v, '$type') &&
|
|
542
|
-
v.$type === 'com.atproto.admin.defs#modEventReverseTakedown'
|
|
543
|
-
)
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
export function validateModEventReverseTakedown(v: unknown): ValidationResult {
|
|
547
|
-
return lexicons.validate('com.atproto.admin.defs#modEventReverseTakedown', v)
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
/** Resolve appeal on a subject */
|
|
551
|
-
export interface ModEventResolveAppeal {
|
|
552
|
-
/** Describe resolution. */
|
|
553
|
-
comment?: string
|
|
554
|
-
[k: string]: unknown
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
export function isModEventResolveAppeal(
|
|
558
|
-
v: unknown,
|
|
559
|
-
): v is ModEventResolveAppeal {
|
|
560
|
-
return (
|
|
561
|
-
isObj(v) &&
|
|
562
|
-
hasProp(v, '$type') &&
|
|
563
|
-
v.$type === 'com.atproto.admin.defs#modEventResolveAppeal'
|
|
564
|
-
)
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
export function validateModEventResolveAppeal(v: unknown): ValidationResult {
|
|
568
|
-
return lexicons.validate('com.atproto.admin.defs#modEventResolveAppeal', v)
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
/** Add a comment to a subject */
|
|
572
|
-
export interface ModEventComment {
|
|
573
|
-
comment: string
|
|
574
|
-
/** Make the comment persistent on the subject */
|
|
575
|
-
sticky?: boolean
|
|
576
|
-
[k: string]: unknown
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
export function isModEventComment(v: unknown): v is ModEventComment {
|
|
580
|
-
return (
|
|
581
|
-
isObj(v) &&
|
|
582
|
-
hasProp(v, '$type') &&
|
|
583
|
-
v.$type === 'com.atproto.admin.defs#modEventComment'
|
|
584
|
-
)
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
export function validateModEventComment(v: unknown): ValidationResult {
|
|
588
|
-
return lexicons.validate('com.atproto.admin.defs#modEventComment', v)
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
/** Report a subject */
|
|
592
|
-
export interface ModEventReport {
|
|
593
|
-
comment?: string
|
|
594
|
-
reportType: ComAtprotoModerationDefs.ReasonType
|
|
595
|
-
[k: string]: unknown
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
export function isModEventReport(v: unknown): v is ModEventReport {
|
|
599
|
-
return (
|
|
600
|
-
isObj(v) &&
|
|
601
|
-
hasProp(v, '$type') &&
|
|
602
|
-
v.$type === 'com.atproto.admin.defs#modEventReport'
|
|
603
|
-
)
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
export function validateModEventReport(v: unknown): ValidationResult {
|
|
607
|
-
return lexicons.validate('com.atproto.admin.defs#modEventReport', v)
|
|
608
|
-
}
|
|
609
|
-
|
|
610
|
-
/** Apply/Negate labels on a subject */
|
|
611
|
-
export interface ModEventLabel {
|
|
612
|
-
comment?: string
|
|
613
|
-
createLabelVals: string[]
|
|
614
|
-
negateLabelVals: string[]
|
|
615
|
-
[k: string]: unknown
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
export function isModEventLabel(v: unknown): v is ModEventLabel {
|
|
619
|
-
return (
|
|
620
|
-
isObj(v) &&
|
|
621
|
-
hasProp(v, '$type') &&
|
|
622
|
-
v.$type === 'com.atproto.admin.defs#modEventLabel'
|
|
623
|
-
)
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
export function validateModEventLabel(v: unknown): ValidationResult {
|
|
627
|
-
return lexicons.validate('com.atproto.admin.defs#modEventLabel', v)
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
export interface ModEventAcknowledge {
|
|
631
|
-
comment?: string
|
|
632
|
-
[k: string]: unknown
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
export function isModEventAcknowledge(v: unknown): v is ModEventAcknowledge {
|
|
636
|
-
return (
|
|
637
|
-
isObj(v) &&
|
|
638
|
-
hasProp(v, '$type') &&
|
|
639
|
-
v.$type === 'com.atproto.admin.defs#modEventAcknowledge'
|
|
640
|
-
)
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
export function validateModEventAcknowledge(v: unknown): ValidationResult {
|
|
644
|
-
return lexicons.validate('com.atproto.admin.defs#modEventAcknowledge', v)
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
export interface ModEventEscalate {
|
|
648
|
-
comment?: string
|
|
649
|
-
[k: string]: unknown
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
export function isModEventEscalate(v: unknown): v is ModEventEscalate {
|
|
653
|
-
return (
|
|
654
|
-
isObj(v) &&
|
|
655
|
-
hasProp(v, '$type') &&
|
|
656
|
-
v.$type === 'com.atproto.admin.defs#modEventEscalate'
|
|
657
|
-
)
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
export function validateModEventEscalate(v: unknown): ValidationResult {
|
|
661
|
-
return lexicons.validate('com.atproto.admin.defs#modEventEscalate', v)
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
/** Mute incoming reports on a subject */
|
|
665
|
-
export interface ModEventMute {
|
|
666
|
-
comment?: string
|
|
667
|
-
/** Indicates how long the subject should remain muted. */
|
|
668
|
-
durationInHours: number
|
|
669
|
-
[k: string]: unknown
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
export function isModEventMute(v: unknown): v is ModEventMute {
|
|
673
|
-
return (
|
|
674
|
-
isObj(v) &&
|
|
675
|
-
hasProp(v, '$type') &&
|
|
676
|
-
v.$type === 'com.atproto.admin.defs#modEventMute'
|
|
677
|
-
)
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
export function validateModEventMute(v: unknown): ValidationResult {
|
|
681
|
-
return lexicons.validate('com.atproto.admin.defs#modEventMute', v)
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
/** Unmute action on a subject */
|
|
685
|
-
export interface ModEventUnmute {
|
|
686
|
-
/** Describe reasoning behind the reversal. */
|
|
687
|
-
comment?: string
|
|
688
|
-
[k: string]: unknown
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
export function isModEventUnmute(v: unknown): v is ModEventUnmute {
|
|
692
|
-
return (
|
|
693
|
-
isObj(v) &&
|
|
694
|
-
hasProp(v, '$type') &&
|
|
695
|
-
v.$type === 'com.atproto.admin.defs#modEventUnmute'
|
|
696
|
-
)
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
export function validateModEventUnmute(v: unknown): ValidationResult {
|
|
700
|
-
return lexicons.validate('com.atproto.admin.defs#modEventUnmute', v)
|
|
701
|
-
}
|
|
702
|
-
|
|
703
|
-
/** Keep a log of outgoing email to a user */
|
|
704
|
-
export interface ModEventEmail {
|
|
705
|
-
/** The subject line of the email sent to the user. */
|
|
706
|
-
subjectLine: string
|
|
707
|
-
/** The content of the email sent to the user. */
|
|
708
|
-
content?: string
|
|
709
|
-
/** Additional comment about the outgoing comm. */
|
|
710
|
-
comment?: string
|
|
711
|
-
[k: string]: unknown
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
export function isModEventEmail(v: unknown): v is ModEventEmail {
|
|
715
|
-
return (
|
|
716
|
-
isObj(v) &&
|
|
717
|
-
hasProp(v, '$type') &&
|
|
718
|
-
v.$type === 'com.atproto.admin.defs#modEventEmail'
|
|
719
|
-
)
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
export function validateModEventEmail(v: unknown): ValidationResult {
|
|
723
|
-
return lexicons.validate('com.atproto.admin.defs#modEventEmail', v)
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
/** Add/Remove a tag on a subject */
|
|
727
|
-
export interface ModEventTag {
|
|
728
|
-
/** Tags to be added to the subject. If already exists, won't be duplicated. */
|
|
729
|
-
add: string[]
|
|
730
|
-
/** Tags to be removed to the subject. Ignores a tag If it doesn't exist, won't be duplicated. */
|
|
731
|
-
remove: string[]
|
|
732
|
-
/** Additional comment about added/removed tags. */
|
|
733
|
-
comment?: string
|
|
734
|
-
[k: string]: unknown
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
export function isModEventTag(v: unknown): v is ModEventTag {
|
|
738
|
-
return (
|
|
739
|
-
isObj(v) &&
|
|
740
|
-
hasProp(v, '$type') &&
|
|
741
|
-
v.$type === 'com.atproto.admin.defs#modEventTag'
|
|
742
|
-
)
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
export function validateModEventTag(v: unknown): ValidationResult {
|
|
746
|
-
return lexicons.validate('com.atproto.admin.defs#modEventTag', v)
|
|
747
|
-
}
|
|
748
|
-
|
|
749
|
-
export interface CommunicationTemplateView {
|
|
750
|
-
id: string
|
|
751
|
-
/** Name of the template. */
|
|
752
|
-
name: string
|
|
753
|
-
/** Content of the template, can contain markdown and variable placeholders. */
|
|
754
|
-
subject?: string
|
|
755
|
-
/** Subject of the message, used in emails. */
|
|
756
|
-
contentMarkdown: string
|
|
757
|
-
disabled: boolean
|
|
758
|
-
/** DID of the user who last updated the template. */
|
|
759
|
-
lastUpdatedBy: string
|
|
760
|
-
createdAt: string
|
|
761
|
-
updatedAt: string
|
|
762
|
-
[k: string]: unknown
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
export function isCommunicationTemplateView(
|
|
766
|
-
v: unknown,
|
|
767
|
-
): v is CommunicationTemplateView {
|
|
768
|
-
return (
|
|
769
|
-
isObj(v) &&
|
|
770
|
-
hasProp(v, '$type') &&
|
|
771
|
-
v.$type === 'com.atproto.admin.defs#communicationTemplateView'
|
|
772
|
-
)
|
|
773
|
-
}
|
|
774
|
-
|
|
775
|
-
export function validateCommunicationTemplateView(
|
|
776
|
-
v: unknown,
|
|
777
|
-
): ValidationResult {
|
|
778
|
-
return lexicons.validate(
|
|
779
|
-
'com.atproto.admin.defs#communicationTemplateView',
|
|
780
|
-
v,
|
|
781
|
-
)
|
|
782
|
-
}
|