@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
|
@@ -64,6 +64,7 @@ export interface ProfileViewDetailed {
|
|
|
64
64
|
followersCount?: number
|
|
65
65
|
followsCount?: number
|
|
66
66
|
postsCount?: number
|
|
67
|
+
associated?: ProfileAssociated
|
|
67
68
|
indexedAt?: string
|
|
68
69
|
viewer?: ViewerState
|
|
69
70
|
labels?: ComAtprotoLabelDefs.Label[]
|
|
@@ -82,6 +83,25 @@ export function validateProfileViewDetailed(v: unknown): ValidationResult {
|
|
|
82
83
|
return lexicons.validate('app.bsky.actor.defs#profileViewDetailed', v)
|
|
83
84
|
}
|
|
84
85
|
|
|
86
|
+
export interface ProfileAssociated {
|
|
87
|
+
lists?: number
|
|
88
|
+
feedgens?: number
|
|
89
|
+
labeler?: boolean
|
|
90
|
+
[k: string]: unknown
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function isProfileAssociated(v: unknown): v is ProfileAssociated {
|
|
94
|
+
return (
|
|
95
|
+
isObj(v) &&
|
|
96
|
+
hasProp(v, '$type') &&
|
|
97
|
+
v.$type === 'app.bsky.actor.defs#profileAssociated'
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function validateProfileAssociated(v: unknown): ValidationResult {
|
|
102
|
+
return lexicons.validate('app.bsky.actor.defs#profileAssociated', v)
|
|
103
|
+
}
|
|
104
|
+
|
|
85
105
|
/** Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests. */
|
|
86
106
|
export interface ViewerState {
|
|
87
107
|
muted?: boolean
|
|
@@ -137,8 +157,10 @@ export function validateAdultContentPref(v: unknown): ValidationResult {
|
|
|
137
157
|
}
|
|
138
158
|
|
|
139
159
|
export interface ContentLabelPref {
|
|
160
|
+
/** Which labeler does this preference apply to? If undefined, applies globally. */
|
|
161
|
+
labelerDid?: string
|
|
140
162
|
label: string
|
|
141
|
-
visibility: 'show' | 'warn' | 'hide' | (string & {})
|
|
163
|
+
visibility: 'ignore' | 'show' | 'warn' | 'hide' | (string & {})
|
|
142
164
|
[k: string]: unknown
|
|
143
165
|
}
|
|
144
166
|
|
|
@@ -315,3 +337,37 @@ export function isHiddenPostsPref(v: unknown): v is HiddenPostsPref {
|
|
|
315
337
|
export function validateHiddenPostsPref(v: unknown): ValidationResult {
|
|
316
338
|
return lexicons.validate('app.bsky.actor.defs#hiddenPostsPref', v)
|
|
317
339
|
}
|
|
340
|
+
|
|
341
|
+
export interface LabelersPref {
|
|
342
|
+
labelers: LabelerPrefItem[]
|
|
343
|
+
[k: string]: unknown
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export function isLabelersPref(v: unknown): v is LabelersPref {
|
|
347
|
+
return (
|
|
348
|
+
isObj(v) &&
|
|
349
|
+
hasProp(v, '$type') &&
|
|
350
|
+
v.$type === 'app.bsky.actor.defs#labelersPref'
|
|
351
|
+
)
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
export function validateLabelersPref(v: unknown): ValidationResult {
|
|
355
|
+
return lexicons.validate('app.bsky.actor.defs#labelersPref', v)
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
export interface LabelerPrefItem {
|
|
359
|
+
did: string
|
|
360
|
+
[k: string]: unknown
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
export function isLabelerPrefItem(v: unknown): v is LabelerPrefItem {
|
|
364
|
+
return (
|
|
365
|
+
isObj(v) &&
|
|
366
|
+
hasProp(v, '$type') &&
|
|
367
|
+
v.$type === 'app.bsky.actor.defs#labelerPrefItem'
|
|
368
|
+
)
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
export function validateLabelerPrefItem(v: unknown): ValidationResult {
|
|
372
|
+
return lexicons.validate('app.bsky.actor.defs#labelerPrefItem', v)
|
|
373
|
+
}
|
|
@@ -8,6 +8,7 @@ import { CID } from 'multiformats/cid'
|
|
|
8
8
|
import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'
|
|
9
9
|
import * as AppBskyFeedDefs from '../feed/defs'
|
|
10
10
|
import * as AppBskyGraphDefs from '../graph/defs'
|
|
11
|
+
import * as AppBskyLabelerDefs from '../labeler/defs'
|
|
11
12
|
import * as AppBskyActorDefs from '../actor/defs'
|
|
12
13
|
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
|
|
13
14
|
import * as AppBskyEmbedImages from './images'
|
|
@@ -39,6 +40,7 @@ export interface View {
|
|
|
39
40
|
| ViewBlocked
|
|
40
41
|
| AppBskyFeedDefs.GeneratorView
|
|
41
42
|
| AppBskyGraphDefs.ListView
|
|
43
|
+
| AppBskyLabelerDefs.LabelerView
|
|
42
44
|
| { $type: string; [k: string]: unknown }
|
|
43
45
|
[k: string]: unknown
|
|
44
46
|
}
|
|
@@ -5,6 +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 ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
|
|
8
9
|
import * as AppBskyActorDefs from '../actor/defs'
|
|
9
10
|
import * as AppBskyRichtextFacet from '../richtext/facet'
|
|
10
11
|
|
|
@@ -14,6 +15,7 @@ export interface ListViewBasic {
|
|
|
14
15
|
name: string
|
|
15
16
|
purpose: ListPurpose
|
|
16
17
|
avatar?: string
|
|
18
|
+
labels?: ComAtprotoLabelDefs.Label[]
|
|
17
19
|
viewer?: ListViewerState
|
|
18
20
|
indexedAt?: string
|
|
19
21
|
[k: string]: unknown
|
|
@@ -40,6 +42,7 @@ export interface ListView {
|
|
|
40
42
|
description?: string
|
|
41
43
|
descriptionFacets?: AppBskyRichtextFacet.Main[]
|
|
42
44
|
avatar?: string
|
|
45
|
+
labels?: ComAtprotoLabelDefs.Label[]
|
|
43
46
|
viewer?: ListViewerState
|
|
44
47
|
indexedAt: string
|
|
45
48
|
[k: string]: unknown
|
|
@@ -0,0 +1,93 @@
|
|
|
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
|
+
import * as AppBskyActorDefs from '../actor/defs'
|
|
9
|
+
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
|
|
10
|
+
|
|
11
|
+
export interface LabelerView {
|
|
12
|
+
uri: string
|
|
13
|
+
cid: string
|
|
14
|
+
creator: AppBskyActorDefs.ProfileView
|
|
15
|
+
likeCount?: number
|
|
16
|
+
viewer?: LabelerViewerState
|
|
17
|
+
indexedAt: string
|
|
18
|
+
labels?: ComAtprotoLabelDefs.Label[]
|
|
19
|
+
[k: string]: unknown
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function isLabelerView(v: unknown): v is LabelerView {
|
|
23
|
+
return (
|
|
24
|
+
isObj(v) &&
|
|
25
|
+
hasProp(v, '$type') &&
|
|
26
|
+
v.$type === 'app.bsky.labeler.defs#labelerView'
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function validateLabelerView(v: unknown): ValidationResult {
|
|
31
|
+
return lexicons.validate('app.bsky.labeler.defs#labelerView', v)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface LabelerViewDetailed {
|
|
35
|
+
uri: string
|
|
36
|
+
cid: string
|
|
37
|
+
creator: AppBskyActorDefs.ProfileView
|
|
38
|
+
policies: LabelerPolicies
|
|
39
|
+
likeCount?: number
|
|
40
|
+
viewer?: LabelerViewerState
|
|
41
|
+
indexedAt: string
|
|
42
|
+
labels?: ComAtprotoLabelDefs.Label[]
|
|
43
|
+
[k: string]: unknown
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function isLabelerViewDetailed(v: unknown): v is LabelerViewDetailed {
|
|
47
|
+
return (
|
|
48
|
+
isObj(v) &&
|
|
49
|
+
hasProp(v, '$type') &&
|
|
50
|
+
v.$type === 'app.bsky.labeler.defs#labelerViewDetailed'
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function validateLabelerViewDetailed(v: unknown): ValidationResult {
|
|
55
|
+
return lexicons.validate('app.bsky.labeler.defs#labelerViewDetailed', v)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface LabelerViewerState {
|
|
59
|
+
like?: string
|
|
60
|
+
[k: string]: unknown
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function isLabelerViewerState(v: unknown): v is LabelerViewerState {
|
|
64
|
+
return (
|
|
65
|
+
isObj(v) &&
|
|
66
|
+
hasProp(v, '$type') &&
|
|
67
|
+
v.$type === 'app.bsky.labeler.defs#labelerViewerState'
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function validateLabelerViewerState(v: unknown): ValidationResult {
|
|
72
|
+
return lexicons.validate('app.bsky.labeler.defs#labelerViewerState', v)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface LabelerPolicies {
|
|
76
|
+
/** The label values which this labeler publishes. May include global or custom labels. */
|
|
77
|
+
labelValues: ComAtprotoLabelDefs.LabelValue[]
|
|
78
|
+
/** Label values created by this labeler and scoped exclusively to it. Labels defined here will override global label definitions for this labeler. */
|
|
79
|
+
labelValueDefinitions?: ComAtprotoLabelDefs.LabelValueDefinition[]
|
|
80
|
+
[k: string]: unknown
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function isLabelerPolicies(v: unknown): v is LabelerPolicies {
|
|
84
|
+
return (
|
|
85
|
+
isObj(v) &&
|
|
86
|
+
hasProp(v, '$type') &&
|
|
87
|
+
v.$type === 'app.bsky.labeler.defs#labelerPolicies'
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function validateLabelerPolicies(v: unknown): ValidationResult {
|
|
92
|
+
return lexicons.validate('app.bsky.labeler.defs#labelerPolicies', v)
|
|
93
|
+
}
|
package/src/lexicon/types/{com/atproto/admin/searchRepos.ts → app/bsky/labeler/getServices.ts}
RENAMED
|
@@ -7,21 +7,21 @@ import { lexicons } from '../../../../lexicons'
|
|
|
7
7
|
import { isObj, hasProp } from '../../../../util'
|
|
8
8
|
import { CID } from 'multiformats/cid'
|
|
9
9
|
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
|
|
10
|
-
import * as
|
|
10
|
+
import * as AppBskyLabelerDefs from './defs'
|
|
11
11
|
|
|
12
12
|
export interface QueryParams {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
q?: string
|
|
16
|
-
limit: number
|
|
17
|
-
cursor?: string
|
|
13
|
+
dids: string[]
|
|
14
|
+
detailed: boolean
|
|
18
15
|
}
|
|
19
16
|
|
|
20
17
|
export type InputSchema = undefined
|
|
21
18
|
|
|
22
19
|
export interface OutputSchema {
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
views: (
|
|
21
|
+
| AppBskyLabelerDefs.LabelerView
|
|
22
|
+
| AppBskyLabelerDefs.LabelerViewDetailed
|
|
23
|
+
| { $type: string; [k: string]: unknown }
|
|
24
|
+
)[]
|
|
25
25
|
[k: string]: unknown
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
import * as AppBskyLabelerDefs from './defs'
|
|
9
|
+
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
|
|
10
|
+
|
|
11
|
+
export interface Record {
|
|
12
|
+
policies: AppBskyLabelerDefs.LabelerPolicies
|
|
13
|
+
labels?:
|
|
14
|
+
| ComAtprotoLabelDefs.SelfLabels
|
|
15
|
+
| { $type: string; [k: string]: unknown }
|
|
16
|
+
createdAt: string
|
|
17
|
+
[k: string]: unknown
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function isRecord(v: unknown): v is Record {
|
|
21
|
+
return (
|
|
22
|
+
isObj(v) &&
|
|
23
|
+
hasProp(v, '$type') &&
|
|
24
|
+
(v.$type === 'app.bsky.labeler.service#main' ||
|
|
25
|
+
v.$type === 'app.bsky.labeler.service')
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function validateRecord(v: unknown): ValidationResult {
|
|
30
|
+
return lexicons.validate('app.bsky.labeler.service#main', v)
|
|
31
|
+
}
|