@atproto/bsky 0.0.30 → 0.0.32
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 +14 -0
- package/dist/db/index.js.map +2 -2
- package/dist/index.js +1315 -587
- package/dist/index.js.map +3 -3
- package/dist/indexer/subscription.d.ts +1 -0
- package/dist/lexicon/index.d.ts +20 -6
- package/dist/lexicon/lexicons.d.ts +449 -110
- package/dist/lexicon/types/app/bsky/actor/defs.d.ts +20 -0
- package/dist/lexicon/types/com/atproto/admin/defs.d.ts +9 -0
- package/dist/lexicon/types/com/atproto/admin/emitModerationEvent.d.ts +1 -1
- package/dist/lexicon/types/com/atproto/admin/queryModerationEvents.d.ts +2 -0
- package/dist/lexicon/types/com/atproto/admin/queryModerationStatuses.d.ts +2 -0
- package/dist/lexicon/types/com/atproto/identity/getRecommendedDidCredentials.d.ts +33 -0
- package/dist/lexicon/types/com/atproto/identity/requestPlcOperationSignature.d.ts +19 -0
- package/dist/lexicon/types/com/atproto/{temp/transferAccount.d.ts → identity/signPlcOperation.d.ts} +6 -8
- package/dist/lexicon/types/com/atproto/identity/submitPlcOperation.d.ts +25 -0
- package/dist/lexicon/types/com/atproto/{temp/pushBlob.d.ts → repo/importRepo.d.ts} +1 -2
- package/dist/lexicon/types/com/atproto/repo/listMissingBlobs.d.ts +41 -0
- package/dist/lexicon/types/com/atproto/server/activateAccount.d.ts +19 -0
- package/dist/lexicon/types/com/atproto/server/checkAccountStatus.d.ts +38 -0
- package/dist/lexicon/types/com/atproto/server/deactivateAccount.d.ts +25 -0
- package/dist/lexicon/types/com/atproto/server/describeServer.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/{temp/importRepo.d.ts → server/getServiceAuth.d.ts} +8 -9
- package/dist/lexicon/types/com/atproto/sync/subscribeRepos.d.ts +9 -1
- package/dist/subscription/util.d.ts +1 -1
- package/package.json +5 -5
- package/src/indexer/subscription.ts +6 -0
- package/src/ingester/subscription.ts +2 -0
- package/src/lexicon/index.ts +124 -36
- package/src/lexicon/lexicons.ts +491 -138
- package/src/lexicon/types/app/bsky/actor/defs.ts +59 -0
- package/src/lexicon/types/app/bsky/feed/post.ts +1 -1
- package/src/lexicon/types/com/atproto/admin/defs.ts +24 -0
- package/src/lexicon/types/com/atproto/admin/emitModerationEvent.ts +1 -0
- package/src/lexicon/types/com/atproto/admin/queryModerationEvents.ts +4 -0
- package/src/lexicon/types/com/atproto/admin/queryModerationStatuses.ts +2 -0
- package/src/lexicon/types/com/atproto/identity/getRecommendedDidCredentials.ts +47 -0
- package/src/lexicon/types/com/atproto/identity/requestPlcOperationSignature.ts +31 -0
- package/src/lexicon/types/com/atproto/{temp/transferAccount.ts → identity/signPlcOperation.ts} +8 -15
- package/src/lexicon/types/com/atproto/identity/submitPlcOperation.ts +38 -0
- package/src/lexicon/types/com/atproto/{temp/pushBlob.ts → repo/importRepo.ts} +2 -5
- package/src/lexicon/types/com/atproto/repo/listMissingBlobs.ts +65 -0
- package/src/lexicon/types/com/atproto/server/activateAccount.ts +31 -0
- package/src/lexicon/types/com/atproto/server/checkAccountStatus.ts +51 -0
- package/src/lexicon/types/com/atproto/server/deactivateAccount.ts +39 -0
- package/src/lexicon/types/com/atproto/server/describeServer.ts +1 -0
- package/src/lexicon/types/com/atproto/{temp/importRepo.ts → server/getServiceAuth.ts} +10 -9
- package/src/lexicon/types/com/atproto/sync/subscribeRepos.ts +24 -3
- package/tests/auto-moderator/labeler.test.ts +4 -1
|
@@ -254,3 +254,62 @@ export function isInterestsPref(v: unknown): v is InterestsPref {
|
|
|
254
254
|
export function validateInterestsPref(v: unknown): ValidationResult {
|
|
255
255
|
return lexicons.validate('app.bsky.actor.defs#interestsPref', v)
|
|
256
256
|
}
|
|
257
|
+
|
|
258
|
+
export type MutedWordTarget = 'content' | 'tag' | (string & {})
|
|
259
|
+
|
|
260
|
+
/** A word that the account owner has muted. */
|
|
261
|
+
export interface MutedWord {
|
|
262
|
+
/** The muted word itself. */
|
|
263
|
+
value: string
|
|
264
|
+
/** The intended targets of the muted word. */
|
|
265
|
+
targets: MutedWordTarget[]
|
|
266
|
+
[k: string]: unknown
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export function isMutedWord(v: unknown): v is MutedWord {
|
|
270
|
+
return (
|
|
271
|
+
isObj(v) &&
|
|
272
|
+
hasProp(v, '$type') &&
|
|
273
|
+
v.$type === 'app.bsky.actor.defs#mutedWord'
|
|
274
|
+
)
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export function validateMutedWord(v: unknown): ValidationResult {
|
|
278
|
+
return lexicons.validate('app.bsky.actor.defs#mutedWord', v)
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export interface MutedWordsPref {
|
|
282
|
+
/** A list of words the account owner has muted. */
|
|
283
|
+
items: MutedWord[]
|
|
284
|
+
[k: string]: unknown
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export function isMutedWordsPref(v: unknown): v is MutedWordsPref {
|
|
288
|
+
return (
|
|
289
|
+
isObj(v) &&
|
|
290
|
+
hasProp(v, '$type') &&
|
|
291
|
+
v.$type === 'app.bsky.actor.defs#mutedWordsPref'
|
|
292
|
+
)
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export function validateMutedWordsPref(v: unknown): ValidationResult {
|
|
296
|
+
return lexicons.validate('app.bsky.actor.defs#mutedWordsPref', v)
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export interface HiddenPostsPref {
|
|
300
|
+
/** A list of URIs of posts the account owner has hidden. */
|
|
301
|
+
items: string[]
|
|
302
|
+
[k: string]: unknown
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
export function isHiddenPostsPref(v: unknown): v is HiddenPostsPref {
|
|
306
|
+
return (
|
|
307
|
+
isObj(v) &&
|
|
308
|
+
hasProp(v, '$type') &&
|
|
309
|
+
v.$type === 'app.bsky.actor.defs#hiddenPostsPref'
|
|
310
|
+
)
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
export function validateHiddenPostsPref(v: unknown): ValidationResult {
|
|
314
|
+
return lexicons.validate('app.bsky.actor.defs#hiddenPostsPref', v)
|
|
315
|
+
}
|
|
@@ -32,7 +32,7 @@ export interface Record {
|
|
|
32
32
|
labels?:
|
|
33
33
|
| ComAtprotoLabelDefs.SelfLabels
|
|
34
34
|
| { $type: string; [k: string]: unknown }
|
|
35
|
-
/** Additional
|
|
35
|
+
/** Additional hashtags, in addition to any included in post text and facets. */
|
|
36
36
|
tags?: string[]
|
|
37
37
|
/** Client-declared timestamp when this post was originally created. */
|
|
38
38
|
createdAt: string
|
|
@@ -156,6 +156,7 @@ export interface SubjectStatusView {
|
|
|
156
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
157
|
appealed?: boolean
|
|
158
158
|
suspendUntil?: string
|
|
159
|
+
tags?: string[]
|
|
159
160
|
[k: string]: unknown
|
|
160
161
|
}
|
|
161
162
|
|
|
@@ -720,6 +721,29 @@ export function validateModEventEmail(v: unknown): ValidationResult {
|
|
|
720
721
|
return lexicons.validate('com.atproto.admin.defs#modEventEmail', v)
|
|
721
722
|
}
|
|
722
723
|
|
|
724
|
+
/** Add/Remove a tag on a subject */
|
|
725
|
+
export interface ModEventTag {
|
|
726
|
+
/** Tags to be added to the subject. If already exists, won't be duplicated. */
|
|
727
|
+
add: string[]
|
|
728
|
+
/** Tags to be removed to the subject. Ignores a tag If it doesn't exist, won't be duplicated. */
|
|
729
|
+
remove: string[]
|
|
730
|
+
/** Additional comment about added/removed tags. */
|
|
731
|
+
comment?: string
|
|
732
|
+
[k: string]: unknown
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
export function isModEventTag(v: unknown): v is ModEventTag {
|
|
736
|
+
return (
|
|
737
|
+
isObj(v) &&
|
|
738
|
+
hasProp(v, '$type') &&
|
|
739
|
+
v.$type === 'com.atproto.admin.defs#modEventTag'
|
|
740
|
+
)
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
export function validateModEventTag(v: unknown): ValidationResult {
|
|
744
|
+
return lexicons.validate('com.atproto.admin.defs#modEventTag', v)
|
|
745
|
+
}
|
|
746
|
+
|
|
723
747
|
export interface CommunicationTemplateView {
|
|
724
748
|
id: string
|
|
725
749
|
/** Name of the template. */
|
|
@@ -24,6 +24,7 @@ export interface InputSchema {
|
|
|
24
24
|
| ComAtprotoAdminDefs.ModEventReverseTakedown
|
|
25
25
|
| ComAtprotoAdminDefs.ModEventUnmute
|
|
26
26
|
| ComAtprotoAdminDefs.ModEventEmail
|
|
27
|
+
| ComAtprotoAdminDefs.ModEventTag
|
|
27
28
|
| { $type: string; [k: string]: unknown }
|
|
28
29
|
subject:
|
|
29
30
|
| ComAtprotoAdminDefs.RepoRef
|
|
@@ -31,6 +31,10 @@ export interface QueryParams {
|
|
|
31
31
|
addedLabels?: string[]
|
|
32
32
|
/** If specified, only events where all of these labels were removed are returned */
|
|
33
33
|
removedLabels?: string[]
|
|
34
|
+
/** If specified, only events where all of these tags were added are returned */
|
|
35
|
+
addedTags?: string[]
|
|
36
|
+
/** If specified, only events where all of these tags were removed are returned */
|
|
37
|
+
removedTags?: string[]
|
|
34
38
|
reportTypes?: string[]
|
|
35
39
|
cursor?: string
|
|
36
40
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import express from 'express'
|
|
5
|
+
import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
6
|
+
import { lexicons } from '../../../../lexicons'
|
|
7
|
+
import { isObj, hasProp } from '../../../../util'
|
|
8
|
+
import { CID } from 'multiformats/cid'
|
|
9
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
|
|
10
|
+
|
|
11
|
+
export interface QueryParams {}
|
|
12
|
+
|
|
13
|
+
export type InputSchema = undefined
|
|
14
|
+
|
|
15
|
+
export interface OutputSchema {
|
|
16
|
+
/** Recommended rotation keys for PLC dids. Should be undefined (or ignored) for did:webs. */
|
|
17
|
+
rotationKeys?: string[]
|
|
18
|
+
alsoKnownAs?: string[]
|
|
19
|
+
verificationMethods?: {}
|
|
20
|
+
services?: {}
|
|
21
|
+
[k: string]: unknown
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type HandlerInput = undefined
|
|
25
|
+
|
|
26
|
+
export interface HandlerSuccess {
|
|
27
|
+
encoding: 'application/json'
|
|
28
|
+
body: OutputSchema
|
|
29
|
+
headers?: { [key: string]: string }
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface HandlerError {
|
|
33
|
+
status: number
|
|
34
|
+
message?: string
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
|
|
38
|
+
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
39
|
+
auth: HA
|
|
40
|
+
params: QueryParams
|
|
41
|
+
input: HandlerInput
|
|
42
|
+
req: express.Request
|
|
43
|
+
res: express.Response
|
|
44
|
+
}
|
|
45
|
+
export type Handler<HA extends HandlerAuth = never> = (
|
|
46
|
+
ctx: HandlerReqCtx<HA>,
|
|
47
|
+
) => Promise<HandlerOutput> | HandlerOutput
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import express from 'express'
|
|
5
|
+
import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
6
|
+
import { lexicons } from '../../../../lexicons'
|
|
7
|
+
import { isObj, hasProp } from '../../../../util'
|
|
8
|
+
import { CID } from 'multiformats/cid'
|
|
9
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
|
|
10
|
+
|
|
11
|
+
export interface QueryParams {}
|
|
12
|
+
|
|
13
|
+
export type InputSchema = undefined
|
|
14
|
+
export type HandlerInput = undefined
|
|
15
|
+
|
|
16
|
+
export interface HandlerError {
|
|
17
|
+
status: number
|
|
18
|
+
message?: string
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type HandlerOutput = HandlerError | void
|
|
22
|
+
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
23
|
+
auth: HA
|
|
24
|
+
params: QueryParams
|
|
25
|
+
input: HandlerInput
|
|
26
|
+
req: express.Request
|
|
27
|
+
res: express.Response
|
|
28
|
+
}
|
|
29
|
+
export type Handler<HA extends HandlerAuth = never> = (
|
|
30
|
+
ctx: HandlerReqCtx<HA>,
|
|
31
|
+
) => Promise<HandlerOutput> | HandlerOutput
|
package/src/lexicon/types/com/atproto/{temp/transferAccount.ts → identity/signPlcOperation.ts}
RENAMED
|
@@ -11,17 +11,18 @@ import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
|
|
|
11
11
|
export interface QueryParams {}
|
|
12
12
|
|
|
13
13
|
export interface InputSchema {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
/** A token received through com.atproto.identity.requestPlcOperationSignature */
|
|
15
|
+
token?: string
|
|
16
|
+
rotationKeys?: string[]
|
|
17
|
+
alsoKnownAs?: string[]
|
|
18
|
+
verificationMethods?: {}
|
|
19
|
+
services?: {}
|
|
17
20
|
[k: string]: unknown
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
export interface OutputSchema {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
handle: string
|
|
24
|
-
did: string
|
|
24
|
+
/** A signed DID PLC operation. */
|
|
25
|
+
operation: {}
|
|
25
26
|
[k: string]: unknown
|
|
26
27
|
}
|
|
27
28
|
|
|
@@ -39,14 +40,6 @@ export interface HandlerSuccess {
|
|
|
39
40
|
export interface HandlerError {
|
|
40
41
|
status: number
|
|
41
42
|
message?: string
|
|
42
|
-
error?:
|
|
43
|
-
| 'InvalidHandle'
|
|
44
|
-
| 'InvalidPassword'
|
|
45
|
-
| 'InvalidInviteCode'
|
|
46
|
-
| 'HandleNotAvailable'
|
|
47
|
-
| 'UnsupportedDomain'
|
|
48
|
-
| 'UnresolvableDid'
|
|
49
|
-
| 'IncompatibleDidDoc'
|
|
50
43
|
}
|
|
51
44
|
|
|
52
45
|
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import express from 'express'
|
|
5
|
+
import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
6
|
+
import { lexicons } from '../../../../lexicons'
|
|
7
|
+
import { isObj, hasProp } from '../../../../util'
|
|
8
|
+
import { CID } from 'multiformats/cid'
|
|
9
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
|
|
10
|
+
|
|
11
|
+
export interface QueryParams {}
|
|
12
|
+
|
|
13
|
+
export interface InputSchema {
|
|
14
|
+
operation: {}
|
|
15
|
+
[k: string]: unknown
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface HandlerInput {
|
|
19
|
+
encoding: 'application/json'
|
|
20
|
+
body: InputSchema
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface HandlerError {
|
|
24
|
+
status: number
|
|
25
|
+
message?: string
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type HandlerOutput = HandlerError | void
|
|
29
|
+
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
30
|
+
auth: HA
|
|
31
|
+
params: QueryParams
|
|
32
|
+
input: HandlerInput
|
|
33
|
+
req: express.Request
|
|
34
|
+
res: express.Response
|
|
35
|
+
}
|
|
36
|
+
export type Handler<HA extends HandlerAuth = never> = (
|
|
37
|
+
ctx: HandlerReqCtx<HA>,
|
|
38
|
+
) => Promise<HandlerOutput> | HandlerOutput
|
|
@@ -9,15 +9,12 @@ import { isObj, hasProp } from '../../../../util'
|
|
|
9
9
|
import { CID } from 'multiformats/cid'
|
|
10
10
|
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
|
|
11
11
|
|
|
12
|
-
export interface QueryParams {
|
|
13
|
-
/** The DID of the repo. */
|
|
14
|
-
did: string
|
|
15
|
-
}
|
|
12
|
+
export interface QueryParams {}
|
|
16
13
|
|
|
17
14
|
export type InputSchema = string | Uint8Array
|
|
18
15
|
|
|
19
16
|
export interface HandlerInput {
|
|
20
|
-
encoding: '
|
|
17
|
+
encoding: 'application/vnd.ipld.car'
|
|
21
18
|
body: stream.Readable
|
|
22
19
|
}
|
|
23
20
|
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import express from 'express'
|
|
5
|
+
import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
6
|
+
import { lexicons } from '../../../../lexicons'
|
|
7
|
+
import { isObj, hasProp } from '../../../../util'
|
|
8
|
+
import { CID } from 'multiformats/cid'
|
|
9
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
|
|
10
|
+
|
|
11
|
+
export interface QueryParams {
|
|
12
|
+
limit: number
|
|
13
|
+
cursor?: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type InputSchema = undefined
|
|
17
|
+
|
|
18
|
+
export interface OutputSchema {
|
|
19
|
+
cursor?: string
|
|
20
|
+
blobs: RecordBlob[]
|
|
21
|
+
[k: string]: unknown
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type HandlerInput = undefined
|
|
25
|
+
|
|
26
|
+
export interface HandlerSuccess {
|
|
27
|
+
encoding: 'application/json'
|
|
28
|
+
body: OutputSchema
|
|
29
|
+
headers?: { [key: string]: string }
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface HandlerError {
|
|
33
|
+
status: number
|
|
34
|
+
message?: string
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
|
|
38
|
+
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
39
|
+
auth: HA
|
|
40
|
+
params: QueryParams
|
|
41
|
+
input: HandlerInput
|
|
42
|
+
req: express.Request
|
|
43
|
+
res: express.Response
|
|
44
|
+
}
|
|
45
|
+
export type Handler<HA extends HandlerAuth = never> = (
|
|
46
|
+
ctx: HandlerReqCtx<HA>,
|
|
47
|
+
) => Promise<HandlerOutput> | HandlerOutput
|
|
48
|
+
|
|
49
|
+
export interface RecordBlob {
|
|
50
|
+
cid: string
|
|
51
|
+
recordUri: string
|
|
52
|
+
[k: string]: unknown
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function isRecordBlob(v: unknown): v is RecordBlob {
|
|
56
|
+
return (
|
|
57
|
+
isObj(v) &&
|
|
58
|
+
hasProp(v, '$type') &&
|
|
59
|
+
v.$type === 'com.atproto.repo.listMissingBlobs#recordBlob'
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function validateRecordBlob(v: unknown): ValidationResult {
|
|
64
|
+
return lexicons.validate('com.atproto.repo.listMissingBlobs#recordBlob', v)
|
|
65
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import express from 'express'
|
|
5
|
+
import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
6
|
+
import { lexicons } from '../../../../lexicons'
|
|
7
|
+
import { isObj, hasProp } from '../../../../util'
|
|
8
|
+
import { CID } from 'multiformats/cid'
|
|
9
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
|
|
10
|
+
|
|
11
|
+
export interface QueryParams {}
|
|
12
|
+
|
|
13
|
+
export type InputSchema = undefined
|
|
14
|
+
export type HandlerInput = undefined
|
|
15
|
+
|
|
16
|
+
export interface HandlerError {
|
|
17
|
+
status: number
|
|
18
|
+
message?: string
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type HandlerOutput = HandlerError | void
|
|
22
|
+
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
23
|
+
auth: HA
|
|
24
|
+
params: QueryParams
|
|
25
|
+
input: HandlerInput
|
|
26
|
+
req: express.Request
|
|
27
|
+
res: express.Response
|
|
28
|
+
}
|
|
29
|
+
export type Handler<HA extends HandlerAuth = never> = (
|
|
30
|
+
ctx: HandlerReqCtx<HA>,
|
|
31
|
+
) => Promise<HandlerOutput> | HandlerOutput
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import express from 'express'
|
|
5
|
+
import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
6
|
+
import { lexicons } from '../../../../lexicons'
|
|
7
|
+
import { isObj, hasProp } from '../../../../util'
|
|
8
|
+
import { CID } from 'multiformats/cid'
|
|
9
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
|
|
10
|
+
|
|
11
|
+
export interface QueryParams {}
|
|
12
|
+
|
|
13
|
+
export type InputSchema = undefined
|
|
14
|
+
|
|
15
|
+
export interface OutputSchema {
|
|
16
|
+
activated: boolean
|
|
17
|
+
validDid: boolean
|
|
18
|
+
repoCommit: string
|
|
19
|
+
repoRev: string
|
|
20
|
+
repoBlocks: number
|
|
21
|
+
indexedRecords: number
|
|
22
|
+
privateStateValues: number
|
|
23
|
+
expectedBlobs: number
|
|
24
|
+
importedBlobs: number
|
|
25
|
+
[k: string]: unknown
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type HandlerInput = undefined
|
|
29
|
+
|
|
30
|
+
export interface HandlerSuccess {
|
|
31
|
+
encoding: 'application/json'
|
|
32
|
+
body: OutputSchema
|
|
33
|
+
headers?: { [key: string]: string }
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface HandlerError {
|
|
37
|
+
status: number
|
|
38
|
+
message?: string
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
|
|
42
|
+
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
43
|
+
auth: HA
|
|
44
|
+
params: QueryParams
|
|
45
|
+
input: HandlerInput
|
|
46
|
+
req: express.Request
|
|
47
|
+
res: express.Response
|
|
48
|
+
}
|
|
49
|
+
export type Handler<HA extends HandlerAuth = never> = (
|
|
50
|
+
ctx: HandlerReqCtx<HA>,
|
|
51
|
+
) => Promise<HandlerOutput> | HandlerOutput
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import express from 'express'
|
|
5
|
+
import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
6
|
+
import { lexicons } from '../../../../lexicons'
|
|
7
|
+
import { isObj, hasProp } from '../../../../util'
|
|
8
|
+
import { CID } from 'multiformats/cid'
|
|
9
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
|
|
10
|
+
|
|
11
|
+
export interface QueryParams {}
|
|
12
|
+
|
|
13
|
+
export interface InputSchema {
|
|
14
|
+
/** A recommendation to server as to how long they should hold onto the deactivated account before deleting. */
|
|
15
|
+
deleteAfter?: string
|
|
16
|
+
[k: string]: unknown
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface HandlerInput {
|
|
20
|
+
encoding: 'application/json'
|
|
21
|
+
body: InputSchema
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface HandlerError {
|
|
25
|
+
status: number
|
|
26
|
+
message?: string
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type HandlerOutput = HandlerError | void
|
|
30
|
+
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
31
|
+
auth: HA
|
|
32
|
+
params: QueryParams
|
|
33
|
+
input: HandlerInput
|
|
34
|
+
req: express.Request
|
|
35
|
+
res: express.Response
|
|
36
|
+
}
|
|
37
|
+
export type Handler<HA extends HandlerAuth = never> = (
|
|
38
|
+
ctx: HandlerReqCtx<HA>,
|
|
39
|
+
) => Promise<HandlerOutput> | HandlerOutput
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* GENERATED CODE - DO NOT MODIFY
|
|
3
3
|
*/
|
|
4
4
|
import express from 'express'
|
|
5
|
-
import stream from 'stream'
|
|
6
5
|
import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
7
6
|
import { lexicons } from '../../../../lexicons'
|
|
8
7
|
import { isObj, hasProp } from '../../../../util'
|
|
@@ -10,20 +9,22 @@ import { CID } from 'multiformats/cid'
|
|
|
10
9
|
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
|
|
11
10
|
|
|
12
11
|
export interface QueryParams {
|
|
13
|
-
/** The DID of the
|
|
14
|
-
|
|
12
|
+
/** The DID of the service that the token will be used to authenticate with */
|
|
13
|
+
aud: string
|
|
15
14
|
}
|
|
16
15
|
|
|
17
|
-
export type InputSchema =
|
|
16
|
+
export type InputSchema = undefined
|
|
18
17
|
|
|
19
|
-
export interface
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
export interface OutputSchema {
|
|
19
|
+
token: string
|
|
20
|
+
[k: string]: unknown
|
|
22
21
|
}
|
|
23
22
|
|
|
23
|
+
export type HandlerInput = undefined
|
|
24
|
+
|
|
24
25
|
export interface HandlerSuccess {
|
|
25
|
-
encoding: '
|
|
26
|
-
body:
|
|
26
|
+
encoding: 'application/json'
|
|
27
|
+
body: OutputSchema
|
|
27
28
|
headers?: { [key: string]: string }
|
|
28
29
|
}
|
|
29
30
|
|
|
@@ -15,6 +15,7 @@ export interface QueryParams {
|
|
|
15
15
|
|
|
16
16
|
export type OutputSchema =
|
|
17
17
|
| Commit
|
|
18
|
+
| Identity
|
|
18
19
|
| Handle
|
|
19
20
|
| Migrate
|
|
20
21
|
| Tombstone
|
|
@@ -71,7 +72,27 @@ export function validateCommit(v: unknown): ValidationResult {
|
|
|
71
72
|
return lexicons.validate('com.atproto.sync.subscribeRepos#commit', v)
|
|
72
73
|
}
|
|
73
74
|
|
|
74
|
-
/** Represents
|
|
75
|
+
/** Represents a change to an account's identity. Could be an updated handle, signing key, or pds hosting endpoint. Serves as a prod to all downstream services to refresh their identity cache. */
|
|
76
|
+
export interface Identity {
|
|
77
|
+
seq: number
|
|
78
|
+
did: string
|
|
79
|
+
time: string
|
|
80
|
+
[k: string]: unknown
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function isIdentity(v: unknown): v is Identity {
|
|
84
|
+
return (
|
|
85
|
+
isObj(v) &&
|
|
86
|
+
hasProp(v, '$type') &&
|
|
87
|
+
v.$type === 'com.atproto.sync.subscribeRepos#identity'
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function validateIdentity(v: unknown): ValidationResult {
|
|
92
|
+
return lexicons.validate('com.atproto.sync.subscribeRepos#identity', v)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** Represents an update of the account's handle, or transition to/from invalid state. NOTE: Will be deprecated in favor of #identity. */
|
|
75
96
|
export interface Handle {
|
|
76
97
|
seq: number
|
|
77
98
|
did: string
|
|
@@ -92,7 +113,7 @@ export function validateHandle(v: unknown): ValidationResult {
|
|
|
92
113
|
return lexicons.validate('com.atproto.sync.subscribeRepos#handle', v)
|
|
93
114
|
}
|
|
94
115
|
|
|
95
|
-
/** Represents an account moving from one PDS instance to another. NOTE: not implemented;
|
|
116
|
+
/** Represents an account moving from one PDS instance to another. NOTE: not implemented; account migration uses #identity instead */
|
|
96
117
|
export interface Migrate {
|
|
97
118
|
seq: number
|
|
98
119
|
did: string
|
|
@@ -113,7 +134,7 @@ export function validateMigrate(v: unknown): ValidationResult {
|
|
|
113
134
|
return lexicons.validate('com.atproto.sync.subscribeRepos#migrate', v)
|
|
114
135
|
}
|
|
115
136
|
|
|
116
|
-
/** Indicates that an account has been deleted. */
|
|
137
|
+
/** Indicates that an account has been deleted. NOTE: may be deprecated in favor of #identity or a future #account event */
|
|
117
138
|
export interface Tombstone {
|
|
118
139
|
seq: number
|
|
119
140
|
did: string
|
|
@@ -39,10 +39,11 @@ describe('labeler', () => {
|
|
|
39
39
|
alice = sc.dids.alice
|
|
40
40
|
const storeBlob = (bytes: Uint8Array) => {
|
|
41
41
|
return pdsCtx.actorStore.transact(alice, async (store) => {
|
|
42
|
-
const
|
|
42
|
+
const metadata = await store.repo.blob.uploadBlobAndGetMetadata(
|
|
43
43
|
'image/jpeg',
|
|
44
44
|
Readable.from([bytes], { objectMode: false }),
|
|
45
45
|
)
|
|
46
|
+
const blobRef = await store.repo.blob.trackUntetheredBlob(metadata)
|
|
46
47
|
const preparedBlobRef = {
|
|
47
48
|
cid: blobRef.ref,
|
|
48
49
|
mimeType: 'image/jpeg',
|
|
@@ -105,6 +106,8 @@ describe('labeler', () => {
|
|
|
105
106
|
types: [],
|
|
106
107
|
addedLabels: [],
|
|
107
108
|
removedLabels: [],
|
|
109
|
+
addedTags: [],
|
|
110
|
+
removedTags: [],
|
|
108
111
|
})
|
|
109
112
|
expect(events.length).toBe(1)
|
|
110
113
|
expect(events[0]).toMatchObject({
|