@atproto/ozone 0.1.160 → 0.1.162
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 +20 -0
- package/LICENSE.txt +1 -1
- package/dist/api/moderation/emitEvent.d.ts.map +1 -1
- package/dist/api/moderation/emitEvent.js +29 -23
- package/dist/api/moderation/emitEvent.js.map +1 -1
- package/dist/daemon/materialized-view-refresher.d.ts.map +1 -1
- package/dist/daemon/materialized-view-refresher.js +8 -1
- package/dist/daemon/materialized-view-refresher.js.map +1 -1
- package/dist/lexicon/index.d.ts +15 -0
- package/dist/lexicon/index.d.ts.map +1 -1
- package/dist/lexicon/index.js +41 -1
- package/dist/lexicon/index.js.map +1 -1
- package/dist/lexicon/lexicons.d.ts +1134 -56
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +603 -26
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/app/bsky/actor/defs.d.ts +35 -1
- package/dist/lexicon/types/app/bsky/actor/defs.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/actor/defs.js +27 -0
- package/dist/lexicon/types/app/bsky/actor/defs.js.map +1 -1
- package/dist/lexicon/types/app/bsky/ageassurance/defs.d.ts +2 -0
- package/dist/lexicon/types/app/bsky/ageassurance/defs.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/ageassurance/defs.js.map +1 -1
- package/dist/lexicon/types/app/bsky/contact/defs.d.ts +10 -0
- package/dist/lexicon/types/app/bsky/contact/defs.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/contact/defs.js +9 -0
- package/dist/lexicon/types/app/bsky/contact/defs.js.map +1 -1
- package/dist/lexicon/types/app/bsky/contact/dismissMatch.d.ts +1 -1
- package/dist/lexicon/types/app/bsky/contact/dismissMatch.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/contact/dismissMatch.js.map +1 -1
- package/dist/lexicon/types/app/bsky/contact/getMatches.d.ts +1 -1
- package/dist/lexicon/types/app/bsky/contact/getMatches.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/contact/getMatches.js.map +1 -1
- package/dist/lexicon/types/app/bsky/contact/getSyncStatus.d.ts +1 -1
- package/dist/lexicon/types/app/bsky/contact/getSyncStatus.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/contact/getSyncStatus.js.map +1 -1
- package/dist/lexicon/types/app/bsky/contact/importContacts.d.ts +1 -1
- package/dist/lexicon/types/app/bsky/contact/importContacts.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/contact/importContacts.js.map +1 -1
- package/dist/lexicon/types/app/bsky/contact/removeData.d.ts +1 -1
- package/dist/lexicon/types/app/bsky/contact/removeData.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/contact/removeData.js.map +1 -1
- package/dist/lexicon/types/app/bsky/contact/sendNotification.d.ts +26 -0
- package/dist/lexicon/types/app/bsky/contact/sendNotification.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/contact/sendNotification.js +7 -0
- package/dist/lexicon/types/app/bsky/contact/sendNotification.js.map +1 -0
- package/dist/lexicon/types/app/bsky/contact/startPhoneVerification.d.ts +1 -1
- package/dist/lexicon/types/app/bsky/contact/startPhoneVerification.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/contact/startPhoneVerification.js.map +1 -1
- package/dist/lexicon/types/app/bsky/contact/verifyPhone.d.ts +1 -1
- package/dist/lexicon/types/app/bsky/contact/verifyPhone.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/contact/verifyPhone.js.map +1 -1
- package/dist/lexicon/types/app/bsky/draft/createDraft.d.ts +27 -0
- package/dist/lexicon/types/app/bsky/draft/createDraft.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/draft/createDraft.js +7 -0
- package/dist/lexicon/types/app/bsky/draft/createDraft.js.map +1 -0
- package/dist/lexicon/types/app/bsky/draft/defs.d.ts +106 -0
- package/dist/lexicon/types/app/bsky/draft/defs.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/draft/defs.js +97 -0
- package/dist/lexicon/types/app/bsky/draft/defs.js.map +1 -0
- package/dist/lexicon/types/app/bsky/draft/deleteDraft.d.ts +14 -0
- package/dist/lexicon/types/app/bsky/draft/deleteDraft.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/draft/deleteDraft.js +7 -0
- package/dist/lexicon/types/app/bsky/draft/deleteDraft.js.map +1 -0
- package/dist/lexicon/types/app/bsky/draft/getDrafts.d.ts +24 -0
- package/dist/lexicon/types/app/bsky/draft/getDrafts.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/draft/getDrafts.js +7 -0
- package/dist/lexicon/types/app/bsky/draft/getDrafts.js.map +1 -0
- package/dist/lexicon/types/app/bsky/draft/updateDraft.d.ts +15 -0
- package/dist/lexicon/types/app/bsky/draft/updateDraft.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/draft/updateDraft.js +7 -0
- package/dist/lexicon/types/app/bsky/draft/updateDraft.js.map +1 -0
- package/dist/lexicon/types/app/bsky/embed/video.d.ts +4 -0
- package/dist/lexicon/types/app/bsky/embed/video.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/embed/video.js.map +1 -1
- package/dist/lexicon/types/app/bsky/notification/listNotifications.d.ts +1 -1
- package/dist/lexicon/types/app/bsky/notification/listNotifications.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/notification/listNotifications.js.map +1 -1
- package/dist/lexicon/types/app/bsky/unspecced/getSuggestedUsers.d.ts +2 -0
- package/dist/lexicon/types/app/bsky/unspecced/getSuggestedUsers.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/unspecced/getSuggestedUsers.js.map +1 -1
- package/dist/lexicon/types/app/bsky/unspecced/getSuggestedUsersSkeleton.d.ts +2 -0
- package/dist/lexicon/types/app/bsky/unspecced/getSuggestedUsersSkeleton.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/unspecced/getSuggestedUsersSkeleton.js.map +1 -1
- package/dist/lexicon/types/com/atproto/server/deleteSession.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/server/deleteSession.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/server/deleteSession.js.map +1 -1
- package/dist/lexicon/types/com/atproto/server/getSession.d.ts +3 -3
- package/dist/lexicon/types/com/atproto/server/getSession.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/server/getSession.js.map +1 -1
- package/dist/lexicon/types/com/atproto/server/refreshSession.d.ts +4 -1
- package/dist/lexicon/types/com/atproto/server/refreshSession.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/server/refreshSession.js.map +1 -1
- package/dist/mod-service/index.d.ts.map +1 -1
- package/dist/mod-service/index.js +10 -4
- package/dist/mod-service/index.js.map +1 -1
- package/dist/mod-service/util.d.ts.map +1 -1
- package/dist/mod-service/util.js +3 -1
- package/dist/mod-service/util.js.map +1 -1
- package/package.json +8 -8
- package/src/api/moderation/emitEvent.ts +33 -25
- package/src/daemon/materialized-view-refresher.ts +9 -3
- package/src/lexicon/index.ts +75 -0
- package/src/lexicon/lexicons.ts +624 -26
- package/src/lexicon/types/app/bsky/actor/defs.ts +63 -0
- package/src/lexicon/types/app/bsky/ageassurance/defs.ts +2 -0
- package/src/lexicon/types/app/bsky/contact/defs.ts +19 -0
- package/src/lexicon/types/app/bsky/contact/dismissMatch.ts +1 -1
- package/src/lexicon/types/app/bsky/contact/getMatches.ts +1 -1
- package/src/lexicon/types/app/bsky/contact/getSyncStatus.ts +1 -1
- package/src/lexicon/types/app/bsky/contact/importContacts.ts +6 -1
- package/src/lexicon/types/app/bsky/contact/removeData.ts +1 -1
- package/src/lexicon/types/app/bsky/contact/sendNotification.ts +44 -0
- package/src/lexicon/types/app/bsky/contact/startPhoneVerification.ts +1 -1
- package/src/lexicon/types/app/bsky/contact/verifyPhone.ts +6 -1
- package/src/lexicon/types/app/bsky/draft/createDraft.ts +46 -0
- package/src/lexicon/types/app/bsky/draft/defs.ts +208 -0
- package/src/lexicon/types/app/bsky/draft/deleteDraft.ts +33 -0
- package/src/lexicon/types/app/bsky/draft/getDrafts.ts +42 -0
- package/src/lexicon/types/app/bsky/draft/updateDraft.ts +34 -0
- package/src/lexicon/types/app/bsky/embed/video.ts +4 -0
- package/src/lexicon/types/app/bsky/notification/listNotifications.ts +1 -0
- package/src/lexicon/types/app/bsky/unspecced/getSuggestedUsers.ts +2 -0
- package/src/lexicon/types/app/bsky/unspecced/getSuggestedUsersSkeleton.ts +2 -0
- package/src/lexicon/types/com/atproto/server/deleteSession.ts +1 -0
- package/src/lexicon/types/com/atproto/server/getSession.ts +1 -1
- package/src/lexicon/types/com/atproto/server/refreshSession.ts +4 -1
- package/src/mod-service/index.ts +12 -5
- package/src/mod-service/util.ts +3 -2
- package/tests/query-labels.test.ts +0 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/tsconfig.tests.tsbuildinfo +0 -1
|
@@ -121,6 +121,7 @@ export interface ProfileAssociated {
|
|
|
121
121
|
labeler?: boolean
|
|
122
122
|
chat?: ProfileAssociatedChat
|
|
123
123
|
activitySubscription?: ProfileAssociatedActivitySubscription
|
|
124
|
+
germ?: ProfileAssociatedGerm
|
|
124
125
|
}
|
|
125
126
|
|
|
126
127
|
const hashProfileAssociated = 'profileAssociated'
|
|
@@ -148,6 +149,22 @@ export function validateProfileAssociatedChat<V>(v: V) {
|
|
|
148
149
|
return validate<ProfileAssociatedChat & V>(v, id, hashProfileAssociatedChat)
|
|
149
150
|
}
|
|
150
151
|
|
|
152
|
+
export interface ProfileAssociatedGerm {
|
|
153
|
+
$type?: 'app.bsky.actor.defs#profileAssociatedGerm'
|
|
154
|
+
messageMeUrl: string
|
|
155
|
+
showButtonTo: 'usersIFollow' | 'everyone' | (string & {})
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const hashProfileAssociatedGerm = 'profileAssociatedGerm'
|
|
159
|
+
|
|
160
|
+
export function isProfileAssociatedGerm<V>(v: V) {
|
|
161
|
+
return is$typed(v, id, hashProfileAssociatedGerm)
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export function validateProfileAssociatedGerm<V>(v: V) {
|
|
165
|
+
return validate<ProfileAssociatedGerm & V>(v, id, hashProfileAssociatedGerm)
|
|
166
|
+
}
|
|
167
|
+
|
|
151
168
|
export interface ProfileAssociatedActivitySubscription {
|
|
152
169
|
$type?: 'app.bsky.actor.defs#profileAssociatedActivitySubscription'
|
|
153
170
|
allowSubscriptions: 'followers' | 'mutuals' | 'none' | (string & {})
|
|
@@ -259,6 +276,7 @@ export type Preferences = (
|
|
|
259
276
|
| $Typed<SavedFeedsPref>
|
|
260
277
|
| $Typed<SavedFeedsPrefV2>
|
|
261
278
|
| $Typed<PersonalDetailsPref>
|
|
279
|
+
| $Typed<DeclaredAgePref>
|
|
262
280
|
| $Typed<FeedViewPref>
|
|
263
281
|
| $Typed<ThreadViewPref>
|
|
264
282
|
| $Typed<InterestsPref>
|
|
@@ -268,6 +286,7 @@ export type Preferences = (
|
|
|
268
286
|
| $Typed<LabelersPref>
|
|
269
287
|
| $Typed<PostInteractionSettingsPref>
|
|
270
288
|
| $Typed<VerificationPrefs>
|
|
289
|
+
| $Typed<LiveEventPreferences>
|
|
271
290
|
| { $type: string }
|
|
272
291
|
)[]
|
|
273
292
|
|
|
@@ -370,6 +389,27 @@ export function validatePersonalDetailsPref<V>(v: V) {
|
|
|
370
389
|
return validate<PersonalDetailsPref & V>(v, id, hashPersonalDetailsPref)
|
|
371
390
|
}
|
|
372
391
|
|
|
392
|
+
/** Read-only preference containing value(s) inferred from the user's declared birthdate. Absence of this preference object in the response indicates that the user has not made a declaration. */
|
|
393
|
+
export interface DeclaredAgePref {
|
|
394
|
+
$type?: 'app.bsky.actor.defs#declaredAgePref'
|
|
395
|
+
/** Indicates if the user has declared that they are over 13 years of age. */
|
|
396
|
+
isOverAge13?: boolean
|
|
397
|
+
/** Indicates if the user has declared that they are over 16 years of age. */
|
|
398
|
+
isOverAge16?: boolean
|
|
399
|
+
/** Indicates if the user has declared that they are over 18 years of age. */
|
|
400
|
+
isOverAge18?: boolean
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
const hashDeclaredAgePref = 'declaredAgePref'
|
|
404
|
+
|
|
405
|
+
export function isDeclaredAgePref<V>(v: V) {
|
|
406
|
+
return is$typed(v, id, hashDeclaredAgePref)
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
export function validateDeclaredAgePref<V>(v: V) {
|
|
410
|
+
return validate<DeclaredAgePref & V>(v, id, hashDeclaredAgePref)
|
|
411
|
+
}
|
|
412
|
+
|
|
373
413
|
export interface FeedViewPref {
|
|
374
414
|
$type?: 'app.bsky.actor.defs#feedViewPref'
|
|
375
415
|
/** The URI of the feed, or an identifier which describes the feed. */
|
|
@@ -596,6 +636,25 @@ export function validateVerificationPrefs<V>(v: V) {
|
|
|
596
636
|
return validate<VerificationPrefs & V>(v, id, hashVerificationPrefs)
|
|
597
637
|
}
|
|
598
638
|
|
|
639
|
+
/** Preferences for live events. */
|
|
640
|
+
export interface LiveEventPreferences {
|
|
641
|
+
$type?: 'app.bsky.actor.defs#liveEventPreferences'
|
|
642
|
+
/** A list of feed IDs that the user has hidden from live events. */
|
|
643
|
+
hiddenFeedIds?: string[]
|
|
644
|
+
/** Whether to hide all feeds from live events. */
|
|
645
|
+
hideAllFeeds: boolean
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
const hashLiveEventPreferences = 'liveEventPreferences'
|
|
649
|
+
|
|
650
|
+
export function isLiveEventPreferences<V>(v: V) {
|
|
651
|
+
return is$typed(v, id, hashLiveEventPreferences)
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
export function validateLiveEventPreferences<V>(v: V) {
|
|
655
|
+
return validate<LiveEventPreferences & V>(v, id, hashLiveEventPreferences)
|
|
656
|
+
}
|
|
657
|
+
|
|
599
658
|
/** Default post interaction settings for the account. These values should be applied as default values when creating new posts. These refs should mirror the threadgate and postgate records exactly. */
|
|
600
659
|
export interface PostInteractionSettingsPref {
|
|
601
660
|
$type?: 'app.bsky.actor.defs#postInteractionSettingsPref'
|
|
@@ -630,6 +689,8 @@ export function validatePostInteractionSettingsPref<V>(v: V) {
|
|
|
630
689
|
|
|
631
690
|
export interface StatusView {
|
|
632
691
|
$type?: 'app.bsky.actor.defs#statusView'
|
|
692
|
+
uri?: string
|
|
693
|
+
cid?: string
|
|
633
694
|
/** The status for the account. */
|
|
634
695
|
status: 'app.bsky.actor.status#live' | (string & {})
|
|
635
696
|
record: { [_ in string]: unknown }
|
|
@@ -638,6 +699,8 @@ export interface StatusView {
|
|
|
638
699
|
expiresAt?: string
|
|
639
700
|
/** True if the status is not expired, false if it is expired. Only present if expiration was set. */
|
|
640
701
|
isActive?: boolean
|
|
702
|
+
/** True if the user's go-live access has been disabled by a moderator, false otherwise. */
|
|
703
|
+
isDisabled?: boolean
|
|
641
704
|
}
|
|
642
705
|
|
|
643
706
|
const hashStatusView = 'statusView'
|
|
@@ -83,6 +83,8 @@ export interface ConfigRegion {
|
|
|
83
83
|
countryCode: string
|
|
84
84
|
/** The ISO 3166-2 region code this configuration applies to. If omitted, the configuration applies to the entire country. */
|
|
85
85
|
regionCode?: string
|
|
86
|
+
/** The minimum age (as a whole integer) required to use Bluesky in this region. */
|
|
87
|
+
minAccessAge: number
|
|
86
88
|
/** The ordered list of Age Assurance rules that apply to this region. Rules should be applied in order, and the first matching rule determines the access level granted. The rules array should always include a default rule as the last item. */
|
|
87
89
|
rules: (
|
|
88
90
|
| $Typed<ConfigRegionRuleDefault>
|
|
@@ -50,3 +50,22 @@ export function isSyncStatus<V>(v: V) {
|
|
|
50
50
|
export function validateSyncStatus<V>(v: V) {
|
|
51
51
|
return validate<SyncStatus & V>(v, id, hashSyncStatus)
|
|
52
52
|
}
|
|
53
|
+
|
|
54
|
+
/** A stash object to be sent via bsync representing a notification to be created. */
|
|
55
|
+
export interface Notification {
|
|
56
|
+
$type?: 'app.bsky.contact.defs#notification'
|
|
57
|
+
/** The DID of who this notification comes from. */
|
|
58
|
+
from: string
|
|
59
|
+
/** The DID of who this notification should go to. */
|
|
60
|
+
to: string
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const hashNotification = 'notification'
|
|
64
|
+
|
|
65
|
+
export function isNotification<V>(v: V) {
|
|
66
|
+
return is$typed(v, id, hashNotification)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function validateNotification<V>(v: V) {
|
|
70
|
+
return validate<Notification & V>(v, id, hashNotification)
|
|
71
|
+
}
|
|
@@ -37,7 +37,7 @@ export interface HandlerSuccess {
|
|
|
37
37
|
export interface HandlerError {
|
|
38
38
|
status: number
|
|
39
39
|
message?: string
|
|
40
|
-
error?: '
|
|
40
|
+
error?: 'InvalidDid' | 'InvalidLimit' | 'InvalidCursor' | 'InternalError'
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
export type HandlerOutput = HandlerError | HandlerSuccess
|
|
@@ -43,7 +43,12 @@ export interface HandlerSuccess {
|
|
|
43
43
|
export interface HandlerError {
|
|
44
44
|
status: number
|
|
45
45
|
message?: string
|
|
46
|
-
error?:
|
|
46
|
+
error?:
|
|
47
|
+
| 'InvalidDid'
|
|
48
|
+
| 'InvalidContacts'
|
|
49
|
+
| 'TooManyContacts'
|
|
50
|
+
| 'InvalidToken'
|
|
51
|
+
| 'InternalError'
|
|
47
52
|
}
|
|
48
53
|
|
|
49
54
|
export type HandlerOutput = HandlerError | HandlerSuccess
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { type ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
5
|
+
import { CID } from 'multiformats/cid'
|
|
6
|
+
import { validate as _validate } from '../../../../lexicons'
|
|
7
|
+
import {
|
|
8
|
+
type $Typed,
|
|
9
|
+
is$typed as _is$typed,
|
|
10
|
+
type OmitKey,
|
|
11
|
+
} from '../../../../util'
|
|
12
|
+
|
|
13
|
+
const is$typed = _is$typed,
|
|
14
|
+
validate = _validate
|
|
15
|
+
const id = 'app.bsky.contact.sendNotification'
|
|
16
|
+
|
|
17
|
+
export type QueryParams = {}
|
|
18
|
+
|
|
19
|
+
export interface InputSchema {
|
|
20
|
+
/** The DID of who this notification comes from. */
|
|
21
|
+
from: string
|
|
22
|
+
/** The DID of who this notification should go to. */
|
|
23
|
+
to: string
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface OutputSchema {}
|
|
27
|
+
|
|
28
|
+
export interface HandlerInput {
|
|
29
|
+
encoding: 'application/json'
|
|
30
|
+
body: InputSchema
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface HandlerSuccess {
|
|
34
|
+
encoding: 'application/json'
|
|
35
|
+
body: OutputSchema
|
|
36
|
+
headers?: { [key: string]: string }
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface HandlerError {
|
|
40
|
+
status: number
|
|
41
|
+
message?: string
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type HandlerOutput = HandlerError | HandlerSuccess
|
|
@@ -37,7 +37,7 @@ export interface HandlerSuccess {
|
|
|
37
37
|
export interface HandlerError {
|
|
38
38
|
status: number
|
|
39
39
|
message?: string
|
|
40
|
-
error?: '
|
|
40
|
+
error?: 'RateLimitExceeded' | 'InvalidDid' | 'InvalidPhone' | 'InternalError'
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
export type HandlerOutput = HandlerError | HandlerSuccess
|
|
@@ -42,7 +42,12 @@ export interface HandlerSuccess {
|
|
|
42
42
|
export interface HandlerError {
|
|
43
43
|
status: number
|
|
44
44
|
message?: string
|
|
45
|
-
error?:
|
|
45
|
+
error?:
|
|
46
|
+
| 'RateLimitExceeded'
|
|
47
|
+
| 'InvalidDid'
|
|
48
|
+
| 'InvalidPhone'
|
|
49
|
+
| 'InvalidCode'
|
|
50
|
+
| 'InternalError'
|
|
46
51
|
}
|
|
47
52
|
|
|
48
53
|
export type HandlerOutput = HandlerError | HandlerSuccess
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { type ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
5
|
+
import { CID } from 'multiformats/cid'
|
|
6
|
+
import { validate as _validate } from '../../../../lexicons'
|
|
7
|
+
import {
|
|
8
|
+
type $Typed,
|
|
9
|
+
is$typed as _is$typed,
|
|
10
|
+
type OmitKey,
|
|
11
|
+
} from '../../../../util'
|
|
12
|
+
import type * as AppBskyDraftDefs from './defs.js'
|
|
13
|
+
|
|
14
|
+
const is$typed = _is$typed,
|
|
15
|
+
validate = _validate
|
|
16
|
+
const id = 'app.bsky.draft.createDraft'
|
|
17
|
+
|
|
18
|
+
export type QueryParams = {}
|
|
19
|
+
|
|
20
|
+
export interface InputSchema {
|
|
21
|
+
draft: AppBskyDraftDefs.Draft
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface OutputSchema {
|
|
25
|
+
/** The ID of the created draft. */
|
|
26
|
+
id: string
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface HandlerInput {
|
|
30
|
+
encoding: 'application/json'
|
|
31
|
+
body: InputSchema
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface HandlerSuccess {
|
|
35
|
+
encoding: 'application/json'
|
|
36
|
+
body: OutputSchema
|
|
37
|
+
headers?: { [key: string]: string }
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface HandlerError {
|
|
41
|
+
status: number
|
|
42
|
+
message?: string
|
|
43
|
+
error?: 'DraftLimitReached'
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export type HandlerOutput = HandlerError | HandlerSuccess
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { type ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
5
|
+
import { CID } from 'multiformats/cid'
|
|
6
|
+
import { validate as _validate } from '../../../../lexicons'
|
|
7
|
+
import {
|
|
8
|
+
type $Typed,
|
|
9
|
+
is$typed as _is$typed,
|
|
10
|
+
type OmitKey,
|
|
11
|
+
} from '../../../../util'
|
|
12
|
+
import type * as AppBskyFeedPostgate from '../feed/postgate.js'
|
|
13
|
+
import type * as AppBskyFeedThreadgate from '../feed/threadgate.js'
|
|
14
|
+
import type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js'
|
|
15
|
+
import type * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef.js'
|
|
16
|
+
|
|
17
|
+
const is$typed = _is$typed,
|
|
18
|
+
validate = _validate
|
|
19
|
+
const id = 'app.bsky.draft.defs'
|
|
20
|
+
|
|
21
|
+
/** A draft with an identifier, used to store drafts in private storage (stash). */
|
|
22
|
+
export interface DraftWithId {
|
|
23
|
+
$type?: 'app.bsky.draft.defs#draftWithId'
|
|
24
|
+
/** A TID to be used as a draft identifier. */
|
|
25
|
+
id: string
|
|
26
|
+
draft: Draft
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const hashDraftWithId = 'draftWithId'
|
|
30
|
+
|
|
31
|
+
export function isDraftWithId<V>(v: V) {
|
|
32
|
+
return is$typed(v, id, hashDraftWithId)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function validateDraftWithId<V>(v: V) {
|
|
36
|
+
return validate<DraftWithId & V>(v, id, hashDraftWithId)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** A draft containing an array of draft posts. */
|
|
40
|
+
export interface Draft {
|
|
41
|
+
$type?: 'app.bsky.draft.defs#draft'
|
|
42
|
+
/** Array of draft posts that compose this draft. */
|
|
43
|
+
posts: DraftPost[]
|
|
44
|
+
/** Indicates human language of posts primary text content. */
|
|
45
|
+
langs?: string[]
|
|
46
|
+
/** Embedding rules for the postgates to be created when this draft is published. */
|
|
47
|
+
postgateEmbeddingRules?: (
|
|
48
|
+
| $Typed<AppBskyFeedPostgate.DisableRule>
|
|
49
|
+
| { $type: string }
|
|
50
|
+
)[]
|
|
51
|
+
/** Allow-rules for the threadgate to be created when this draft is published. */
|
|
52
|
+
threadgateAllow?: (
|
|
53
|
+
| $Typed<AppBskyFeedThreadgate.MentionRule>
|
|
54
|
+
| $Typed<AppBskyFeedThreadgate.FollowerRule>
|
|
55
|
+
| $Typed<AppBskyFeedThreadgate.FollowingRule>
|
|
56
|
+
| $Typed<AppBskyFeedThreadgate.ListRule>
|
|
57
|
+
| { $type: string }
|
|
58
|
+
)[]
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const hashDraft = 'draft'
|
|
62
|
+
|
|
63
|
+
export function isDraft<V>(v: V) {
|
|
64
|
+
return is$typed(v, id, hashDraft)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function validateDraft<V>(v: V) {
|
|
68
|
+
return validate<Draft & V>(v, id, hashDraft)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** One of the posts that compose a draft. */
|
|
72
|
+
export interface DraftPost {
|
|
73
|
+
$type?: 'app.bsky.draft.defs#draftPost'
|
|
74
|
+
/** The primary post content. */
|
|
75
|
+
text: string
|
|
76
|
+
labels?: $Typed<ComAtprotoLabelDefs.SelfLabels> | { $type: string }
|
|
77
|
+
embedImages?: DraftEmbedImage[]
|
|
78
|
+
embedVideos?: DraftEmbedVideo[]
|
|
79
|
+
embedExternals?: DraftEmbedExternal[]
|
|
80
|
+
embedRecords?: DraftEmbedRecord[]
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const hashDraftPost = 'draftPost'
|
|
84
|
+
|
|
85
|
+
export function isDraftPost<V>(v: V) {
|
|
86
|
+
return is$typed(v, id, hashDraftPost)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function validateDraftPost<V>(v: V) {
|
|
90
|
+
return validate<DraftPost & V>(v, id, hashDraftPost)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** View to present drafts data to users. */
|
|
94
|
+
export interface DraftView {
|
|
95
|
+
$type?: 'app.bsky.draft.defs#draftView'
|
|
96
|
+
/** A TID to be used as a draft identifier. */
|
|
97
|
+
id: string
|
|
98
|
+
draft: Draft
|
|
99
|
+
/** The time the draft was created. */
|
|
100
|
+
createdAt: string
|
|
101
|
+
/** The time the draft was last updated. */
|
|
102
|
+
updatedAt: string
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const hashDraftView = 'draftView'
|
|
106
|
+
|
|
107
|
+
export function isDraftView<V>(v: V) {
|
|
108
|
+
return is$typed(v, id, hashDraftView)
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function validateDraftView<V>(v: V) {
|
|
112
|
+
return validate<DraftView & V>(v, id, hashDraftView)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface DraftEmbedLocalRef {
|
|
116
|
+
$type?: 'app.bsky.draft.defs#draftEmbedLocalRef'
|
|
117
|
+
/** Local, on-device ref to file to be embedded. Embeds are currently device-bound for drafts. */
|
|
118
|
+
path: string
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const hashDraftEmbedLocalRef = 'draftEmbedLocalRef'
|
|
122
|
+
|
|
123
|
+
export function isDraftEmbedLocalRef<V>(v: V) {
|
|
124
|
+
return is$typed(v, id, hashDraftEmbedLocalRef)
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export function validateDraftEmbedLocalRef<V>(v: V) {
|
|
128
|
+
return validate<DraftEmbedLocalRef & V>(v, id, hashDraftEmbedLocalRef)
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface DraftEmbedCaption {
|
|
132
|
+
$type?: 'app.bsky.draft.defs#draftEmbedCaption'
|
|
133
|
+
lang: string
|
|
134
|
+
content: string
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const hashDraftEmbedCaption = 'draftEmbedCaption'
|
|
138
|
+
|
|
139
|
+
export function isDraftEmbedCaption<V>(v: V) {
|
|
140
|
+
return is$typed(v, id, hashDraftEmbedCaption)
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export function validateDraftEmbedCaption<V>(v: V) {
|
|
144
|
+
return validate<DraftEmbedCaption & V>(v, id, hashDraftEmbedCaption)
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export interface DraftEmbedImage {
|
|
148
|
+
$type?: 'app.bsky.draft.defs#draftEmbedImage'
|
|
149
|
+
localRef: DraftEmbedLocalRef
|
|
150
|
+
alt?: string
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const hashDraftEmbedImage = 'draftEmbedImage'
|
|
154
|
+
|
|
155
|
+
export function isDraftEmbedImage<V>(v: V) {
|
|
156
|
+
return is$typed(v, id, hashDraftEmbedImage)
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export function validateDraftEmbedImage<V>(v: V) {
|
|
160
|
+
return validate<DraftEmbedImage & V>(v, id, hashDraftEmbedImage)
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export interface DraftEmbedVideo {
|
|
164
|
+
$type?: 'app.bsky.draft.defs#draftEmbedVideo'
|
|
165
|
+
localRef: DraftEmbedLocalRef
|
|
166
|
+
alt?: string
|
|
167
|
+
captions?: DraftEmbedCaption[]
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const hashDraftEmbedVideo = 'draftEmbedVideo'
|
|
171
|
+
|
|
172
|
+
export function isDraftEmbedVideo<V>(v: V) {
|
|
173
|
+
return is$typed(v, id, hashDraftEmbedVideo)
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export function validateDraftEmbedVideo<V>(v: V) {
|
|
177
|
+
return validate<DraftEmbedVideo & V>(v, id, hashDraftEmbedVideo)
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export interface DraftEmbedExternal {
|
|
181
|
+
$type?: 'app.bsky.draft.defs#draftEmbedExternal'
|
|
182
|
+
uri: string
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const hashDraftEmbedExternal = 'draftEmbedExternal'
|
|
186
|
+
|
|
187
|
+
export function isDraftEmbedExternal<V>(v: V) {
|
|
188
|
+
return is$typed(v, id, hashDraftEmbedExternal)
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export function validateDraftEmbedExternal<V>(v: V) {
|
|
192
|
+
return validate<DraftEmbedExternal & V>(v, id, hashDraftEmbedExternal)
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export interface DraftEmbedRecord {
|
|
196
|
+
$type?: 'app.bsky.draft.defs#draftEmbedRecord'
|
|
197
|
+
record: ComAtprotoRepoStrongRef.Main
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const hashDraftEmbedRecord = 'draftEmbedRecord'
|
|
201
|
+
|
|
202
|
+
export function isDraftEmbedRecord<V>(v: V) {
|
|
203
|
+
return is$typed(v, id, hashDraftEmbedRecord)
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export function validateDraftEmbedRecord<V>(v: V) {
|
|
207
|
+
return validate<DraftEmbedRecord & V>(v, id, hashDraftEmbedRecord)
|
|
208
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { type ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
5
|
+
import { CID } from 'multiformats/cid'
|
|
6
|
+
import { validate as _validate } from '../../../../lexicons'
|
|
7
|
+
import {
|
|
8
|
+
type $Typed,
|
|
9
|
+
is$typed as _is$typed,
|
|
10
|
+
type OmitKey,
|
|
11
|
+
} from '../../../../util'
|
|
12
|
+
|
|
13
|
+
const is$typed = _is$typed,
|
|
14
|
+
validate = _validate
|
|
15
|
+
const id = 'app.bsky.draft.deleteDraft'
|
|
16
|
+
|
|
17
|
+
export type QueryParams = {}
|
|
18
|
+
|
|
19
|
+
export interface InputSchema {
|
|
20
|
+
id: string
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface HandlerInput {
|
|
24
|
+
encoding: 'application/json'
|
|
25
|
+
body: InputSchema
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface HandlerError {
|
|
29
|
+
status: number
|
|
30
|
+
message?: string
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type HandlerOutput = HandlerError | void
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { type ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
5
|
+
import { CID } from 'multiformats/cid'
|
|
6
|
+
import { validate as _validate } from '../../../../lexicons'
|
|
7
|
+
import {
|
|
8
|
+
type $Typed,
|
|
9
|
+
is$typed as _is$typed,
|
|
10
|
+
type OmitKey,
|
|
11
|
+
} from '../../../../util'
|
|
12
|
+
import type * as AppBskyDraftDefs from './defs.js'
|
|
13
|
+
|
|
14
|
+
const is$typed = _is$typed,
|
|
15
|
+
validate = _validate
|
|
16
|
+
const id = 'app.bsky.draft.getDrafts'
|
|
17
|
+
|
|
18
|
+
export type QueryParams = {
|
|
19
|
+
limit: number
|
|
20
|
+
cursor?: string
|
|
21
|
+
}
|
|
22
|
+
export type InputSchema = undefined
|
|
23
|
+
|
|
24
|
+
export interface OutputSchema {
|
|
25
|
+
cursor?: string
|
|
26
|
+
drafts: AppBskyDraftDefs.DraftView[]
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type HandlerInput = void
|
|
30
|
+
|
|
31
|
+
export interface HandlerSuccess {
|
|
32
|
+
encoding: 'application/json'
|
|
33
|
+
body: OutputSchema
|
|
34
|
+
headers?: { [key: string]: string }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface HandlerError {
|
|
38
|
+
status: number
|
|
39
|
+
message?: string
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export type HandlerOutput = HandlerError | HandlerSuccess
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { type ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
5
|
+
import { CID } from 'multiformats/cid'
|
|
6
|
+
import { validate as _validate } from '../../../../lexicons'
|
|
7
|
+
import {
|
|
8
|
+
type $Typed,
|
|
9
|
+
is$typed as _is$typed,
|
|
10
|
+
type OmitKey,
|
|
11
|
+
} from '../../../../util'
|
|
12
|
+
import type * as AppBskyDraftDefs from './defs.js'
|
|
13
|
+
|
|
14
|
+
const is$typed = _is$typed,
|
|
15
|
+
validate = _validate
|
|
16
|
+
const id = 'app.bsky.draft.updateDraft'
|
|
17
|
+
|
|
18
|
+
export type QueryParams = {}
|
|
19
|
+
|
|
20
|
+
export interface InputSchema {
|
|
21
|
+
draft: AppBskyDraftDefs.DraftWithId
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface HandlerInput {
|
|
25
|
+
encoding: 'application/json'
|
|
26
|
+
body: InputSchema
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface HandlerError {
|
|
30
|
+
status: number
|
|
31
|
+
message?: string
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type HandlerOutput = HandlerError | void
|
|
@@ -23,6 +23,8 @@ export interface Main {
|
|
|
23
23
|
/** Alt text description of the video, for accessibility. */
|
|
24
24
|
alt?: string
|
|
25
25
|
aspectRatio?: AppBskyEmbedDefs.AspectRatio
|
|
26
|
+
/** A hint to the client about how to present the video. */
|
|
27
|
+
presentation?: 'default' | 'gif' | (string & {})
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
const hashMain = 'main'
|
|
@@ -58,6 +60,8 @@ export interface View {
|
|
|
58
60
|
thumbnail?: string
|
|
59
61
|
alt?: string
|
|
60
62
|
aspectRatio?: AppBskyEmbedDefs.AspectRatio
|
|
63
|
+
/** A hint to the client about how to present the video. */
|
|
64
|
+
presentation?: 'default' | 'gif' | (string & {})
|
|
61
65
|
}
|
|
62
66
|
|
|
63
67
|
const hashView = 'view'
|
|
@@ -24,6 +24,8 @@ export type InputSchema = undefined
|
|
|
24
24
|
|
|
25
25
|
export interface OutputSchema {
|
|
26
26
|
actors: AppBskyActorDefs.ProfileView[]
|
|
27
|
+
/** Snowflake for this recommendation, use when submitting recommendation events. */
|
|
28
|
+
recId?: string
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
export type HandlerInput = void
|