@atproto/pds 0.4.37 → 0.4.39
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +19 -0
- package/dist/lexicon/index.d.ts +7 -0
- package/dist/lexicon/index.d.ts.map +1 -1
- package/dist/lexicon/index.js +13 -0
- package/dist/lexicon/index.js.map +1 -1
- package/dist/lexicon/lexicons.d.ts +362 -0
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +371 -2
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/app/bsky/actor/defs.d.ts +22 -1
- package/dist/lexicon/types/app/bsky/actor/defs.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/actor/defs.js +21 -1
- package/dist/lexicon/types/app/bsky/actor/defs.js.map +1 -1
- package/dist/lexicon/types/app/bsky/actor/profile.d.ts +3 -0
- package/dist/lexicon/types/app/bsky/actor/profile.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/actor/profile.js.map +1 -1
- package/dist/lexicon/types/app/bsky/graph/defs.d.ts +36 -1
- package/dist/lexicon/types/app/bsky/graph/defs.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/graph/defs.js +23 -1
- package/dist/lexicon/types/app/bsky/graph/defs.js.map +1 -1
- package/dist/lexicon/types/app/bsky/graph/getActorStarterPacks.d.ts +39 -0
- package/dist/lexicon/types/app/bsky/graph/getActorStarterPacks.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/graph/getActorStarterPacks.js +3 -0
- package/dist/lexicon/types/app/bsky/graph/getActorStarterPacks.js.map +1 -0
- package/dist/lexicon/types/app/bsky/graph/getStarterPack.d.ts +37 -0
- package/dist/lexicon/types/app/bsky/graph/getStarterPack.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/graph/getStarterPack.js +3 -0
- package/dist/lexicon/types/app/bsky/graph/getStarterPack.js.map +1 -0
- package/dist/lexicon/types/app/bsky/graph/getStarterPacks.d.ts +36 -0
- package/dist/lexicon/types/app/bsky/graph/getStarterPacks.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/graph/getStarterPacks.js +3 -0
- package/dist/lexicon/types/app/bsky/graph/getStarterPacks.js.map +1 -0
- package/dist/lexicon/types/app/bsky/graph/starterpack.d.ts +25 -0
- package/dist/lexicon/types/app/bsky/graph/starterpack.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/graph/starterpack.js +27 -0
- package/dist/lexicon/types/app/bsky/graph/starterpack.js.map +1 -0
- package/dist/lexicon/types/app/bsky/notification/listNotifications.d.ts +2 -2
- 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/tools/ozone/team/deleteMember.d.ts +1 -1
- package/dist/lexicon/types/tools/ozone/team/deleteMember.d.ts.map +1 -1
- package/dist/repo/prepare.d.ts.map +1 -1
- package/dist/repo/prepare.js +4 -0
- package/dist/repo/prepare.js.map +1 -1
- package/example.env +5 -5
- package/package.json +5 -5
- package/src/lexicon/index.ts +37 -0
- package/src/lexicon/lexicons.ts +376 -2
- package/src/lexicon/types/app/bsky/actor/defs.ts +44 -0
- package/src/lexicon/types/app/bsky/actor/profile.ts +3 -0
- package/src/lexicon/types/app/bsky/graph/defs.ts +58 -0
- package/src/lexicon/types/app/bsky/graph/getActorStarterPacks.ts +49 -0
- package/src/lexicon/types/app/bsky/graph/getStarterPack.ts +47 -0
- package/src/lexicon/types/app/bsky/graph/getStarterPacks.ts +46 -0
- package/src/lexicon/types/app/bsky/graph/starterpack.ts +50 -0
- package/src/lexicon/types/app/bsky/notification/listNotifications.ts +2 -1
- package/src/lexicon/types/tools/ozone/team/deleteMember.ts +1 -1
- package/src/repo/prepare.ts +3 -0
- package/tests/proxied/__snapshots__/admin.test.ts.snap +3 -0
- package/tests/proxied/__snapshots__/feedgen.test.ts.snap +2 -0
- package/tests/proxied/__snapshots__/views.test.ts.snap +141 -2
@@ -8,6 +8,7 @@ import { CID } from 'multiformats/cid'
|
|
8
8
|
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
|
9
9
|
import * as AppBskyActorDefs from '../actor/defs'
|
10
10
|
import * as AppBskyRichtextFacet from '../richtext/facet'
|
11
|
+
import * as AppBskyFeedDefs from '../feed/defs'
|
11
12
|
|
12
13
|
export interface ListViewBasic {
|
13
14
|
uri: string
|
@@ -15,6 +16,7 @@ export interface ListViewBasic {
|
|
15
16
|
name: string
|
16
17
|
purpose: ListPurpose
|
17
18
|
avatar?: string
|
19
|
+
listItemCount?: number
|
18
20
|
labels?: ComAtprotoLabelDefs.Label[]
|
19
21
|
viewer?: ListViewerState
|
20
22
|
indexedAt?: string
|
@@ -42,6 +44,7 @@ export interface ListView {
|
|
42
44
|
description?: string
|
43
45
|
descriptionFacets?: AppBskyRichtextFacet.Main[]
|
44
46
|
avatar?: string
|
47
|
+
listItemCount?: number
|
45
48
|
labels?: ComAtprotoLabelDefs.Label[]
|
46
49
|
viewer?: ListViewerState
|
47
50
|
indexedAt: string
|
@@ -78,15 +81,70 @@ export function validateListItemView(v: unknown): ValidationResult {
|
|
78
81
|
return lexicons.validate('app.bsky.graph.defs#listItemView', v)
|
79
82
|
}
|
80
83
|
|
84
|
+
export interface StarterPackView {
|
85
|
+
uri: string
|
86
|
+
cid: string
|
87
|
+
record: {}
|
88
|
+
creator: AppBskyActorDefs.ProfileViewBasic
|
89
|
+
list?: ListViewBasic
|
90
|
+
listItemsSample?: ListItemView[]
|
91
|
+
feeds?: AppBskyFeedDefs.GeneratorView[]
|
92
|
+
joinedWeekCount?: number
|
93
|
+
joinedAllTimeCount?: number
|
94
|
+
labels?: ComAtprotoLabelDefs.Label[]
|
95
|
+
indexedAt: string
|
96
|
+
[k: string]: unknown
|
97
|
+
}
|
98
|
+
|
99
|
+
export function isStarterPackView(v: unknown): v is StarterPackView {
|
100
|
+
return (
|
101
|
+
isObj(v) &&
|
102
|
+
hasProp(v, '$type') &&
|
103
|
+
v.$type === 'app.bsky.graph.defs#starterPackView'
|
104
|
+
)
|
105
|
+
}
|
106
|
+
|
107
|
+
export function validateStarterPackView(v: unknown): ValidationResult {
|
108
|
+
return lexicons.validate('app.bsky.graph.defs#starterPackView', v)
|
109
|
+
}
|
110
|
+
|
111
|
+
export interface StarterPackViewBasic {
|
112
|
+
uri: string
|
113
|
+
cid: string
|
114
|
+
record: {}
|
115
|
+
creator: AppBskyActorDefs.ProfileViewBasic
|
116
|
+
listItemCount?: number
|
117
|
+
joinedWeekCount?: number
|
118
|
+
joinedAllTimeCount?: number
|
119
|
+
labels?: ComAtprotoLabelDefs.Label[]
|
120
|
+
indexedAt: string
|
121
|
+
[k: string]: unknown
|
122
|
+
}
|
123
|
+
|
124
|
+
export function isStarterPackViewBasic(v: unknown): v is StarterPackViewBasic {
|
125
|
+
return (
|
126
|
+
isObj(v) &&
|
127
|
+
hasProp(v, '$type') &&
|
128
|
+
v.$type === 'app.bsky.graph.defs#starterPackViewBasic'
|
129
|
+
)
|
130
|
+
}
|
131
|
+
|
132
|
+
export function validateStarterPackViewBasic(v: unknown): ValidationResult {
|
133
|
+
return lexicons.validate('app.bsky.graph.defs#starterPackViewBasic', v)
|
134
|
+
}
|
135
|
+
|
81
136
|
export type ListPurpose =
|
82
137
|
| 'app.bsky.graph.defs#modlist'
|
83
138
|
| 'app.bsky.graph.defs#curatelist'
|
139
|
+
| 'app.bsky.graph.defs#referencelist'
|
84
140
|
| (string & {})
|
85
141
|
|
86
142
|
/** A list of actors to apply an aggregate moderation action (mute/block) on. */
|
87
143
|
export const MODLIST = 'app.bsky.graph.defs#modlist'
|
88
144
|
/** A list of actors used for curation purposes such as list feeds or interaction gating. */
|
89
145
|
export const CURATELIST = 'app.bsky.graph.defs#curatelist'
|
146
|
+
/** A list of actors used for only for reference purposes such as within a starter pack. */
|
147
|
+
export const REFERENCELIST = 'app.bsky.graph.defs#referencelist'
|
90
148
|
|
91
149
|
export interface ListViewerState {
|
92
150
|
muted?: boolean
|
@@ -0,0 +1,49 @@
|
|
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
|
+
import * as AppBskyGraphDefs from './defs'
|
11
|
+
|
12
|
+
export interface QueryParams {
|
13
|
+
actor: string
|
14
|
+
limit: number
|
15
|
+
cursor?: string
|
16
|
+
}
|
17
|
+
|
18
|
+
export type InputSchema = undefined
|
19
|
+
|
20
|
+
export interface OutputSchema {
|
21
|
+
cursor?: string
|
22
|
+
starterPacks: AppBskyGraphDefs.StarterPackViewBasic[]
|
23
|
+
[k: string]: unknown
|
24
|
+
}
|
25
|
+
|
26
|
+
export type HandlerInput = undefined
|
27
|
+
|
28
|
+
export interface HandlerSuccess {
|
29
|
+
encoding: 'application/json'
|
30
|
+
body: OutputSchema
|
31
|
+
headers?: { [key: string]: string }
|
32
|
+
}
|
33
|
+
|
34
|
+
export interface HandlerError {
|
35
|
+
status: number
|
36
|
+
message?: string
|
37
|
+
}
|
38
|
+
|
39
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
|
40
|
+
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
41
|
+
auth: HA
|
42
|
+
params: QueryParams
|
43
|
+
input: HandlerInput
|
44
|
+
req: express.Request
|
45
|
+
res: express.Response
|
46
|
+
}
|
47
|
+
export type Handler<HA extends HandlerAuth = never> = (
|
48
|
+
ctx: HandlerReqCtx<HA>,
|
49
|
+
) => Promise<HandlerOutput> | HandlerOutput
|
@@ -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
|
+
import * as AppBskyGraphDefs from './defs'
|
11
|
+
|
12
|
+
export interface QueryParams {
|
13
|
+
/** Reference (AT-URI) of the starter pack record. */
|
14
|
+
starterPack: string
|
15
|
+
}
|
16
|
+
|
17
|
+
export type InputSchema = undefined
|
18
|
+
|
19
|
+
export interface OutputSchema {
|
20
|
+
starterPack: AppBskyGraphDefs.StarterPackView
|
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,46 @@
|
|
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
|
+
import * as AppBskyGraphDefs from './defs'
|
11
|
+
|
12
|
+
export interface QueryParams {
|
13
|
+
uris: string[]
|
14
|
+
}
|
15
|
+
|
16
|
+
export type InputSchema = undefined
|
17
|
+
|
18
|
+
export interface OutputSchema {
|
19
|
+
starterPacks: AppBskyGraphDefs.StarterPackViewBasic[]
|
20
|
+
[k: string]: unknown
|
21
|
+
}
|
22
|
+
|
23
|
+
export type HandlerInput = undefined
|
24
|
+
|
25
|
+
export interface HandlerSuccess {
|
26
|
+
encoding: 'application/json'
|
27
|
+
body: OutputSchema
|
28
|
+
headers?: { [key: string]: string }
|
29
|
+
}
|
30
|
+
|
31
|
+
export interface HandlerError {
|
32
|
+
status: number
|
33
|
+
message?: string
|
34
|
+
}
|
35
|
+
|
36
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
|
37
|
+
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
38
|
+
auth: HA
|
39
|
+
params: QueryParams
|
40
|
+
input: HandlerInput
|
41
|
+
req: express.Request
|
42
|
+
res: express.Response
|
43
|
+
}
|
44
|
+
export type Handler<HA extends HandlerAuth = never> = (
|
45
|
+
ctx: HandlerReqCtx<HA>,
|
46
|
+
) => Promise<HandlerOutput> | HandlerOutput
|
@@ -0,0 +1,50 @@
|
|
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 AppBskyRichtextFacet from '../richtext/facet'
|
9
|
+
|
10
|
+
export interface Record {
|
11
|
+
/** Display name for starter pack; can not be empty. */
|
12
|
+
name: string
|
13
|
+
description?: string
|
14
|
+
descriptionFacets?: AppBskyRichtextFacet.Main[]
|
15
|
+
/** Reference (AT-URI) to the list record. */
|
16
|
+
list: string
|
17
|
+
feeds?: FeedItem[]
|
18
|
+
createdAt: string
|
19
|
+
[k: string]: unknown
|
20
|
+
}
|
21
|
+
|
22
|
+
export function isRecord(v: unknown): v is Record {
|
23
|
+
return (
|
24
|
+
isObj(v) &&
|
25
|
+
hasProp(v, '$type') &&
|
26
|
+
(v.$type === 'app.bsky.graph.starterpack#main' ||
|
27
|
+
v.$type === 'app.bsky.graph.starterpack')
|
28
|
+
)
|
29
|
+
}
|
30
|
+
|
31
|
+
export function validateRecord(v: unknown): ValidationResult {
|
32
|
+
return lexicons.validate('app.bsky.graph.starterpack#main', v)
|
33
|
+
}
|
34
|
+
|
35
|
+
export interface FeedItem {
|
36
|
+
uri: string
|
37
|
+
[k: string]: unknown
|
38
|
+
}
|
39
|
+
|
40
|
+
export function isFeedItem(v: unknown): v is FeedItem {
|
41
|
+
return (
|
42
|
+
isObj(v) &&
|
43
|
+
hasProp(v, '$type') &&
|
44
|
+
v.$type === 'app.bsky.graph.starterpack#feedItem'
|
45
|
+
)
|
46
|
+
}
|
47
|
+
|
48
|
+
export function validateFeedItem(v: unknown): ValidationResult {
|
49
|
+
return lexicons.validate('app.bsky.graph.starterpack#feedItem', v)
|
50
|
+
}
|
@@ -54,7 +54,7 @@ export interface Notification {
|
|
54
54
|
uri: string
|
55
55
|
cid: string
|
56
56
|
author: AppBskyActorDefs.ProfileView
|
57
|
-
/** Expected values are 'like', 'repost', 'follow', 'mention', 'reply', and '
|
57
|
+
/** Expected values are 'like', 'repost', 'follow', 'mention', 'reply', 'quote', and 'starterpack-joined'. */
|
58
58
|
reason:
|
59
59
|
| 'like'
|
60
60
|
| 'repost'
|
@@ -62,6 +62,7 @@ export interface Notification {
|
|
62
62
|
| 'mention'
|
63
63
|
| 'reply'
|
64
64
|
| 'quote'
|
65
|
+
| 'starterpack-joined'
|
65
66
|
| (string & {})
|
66
67
|
reasonSubject?: string
|
67
68
|
record: {}
|
package/src/repo/prepare.ts
CHANGED
@@ -32,6 +32,7 @@ import {
|
|
32
32
|
} from './types'
|
33
33
|
import * as lex from '../lexicon/lexicons'
|
34
34
|
import { isRecord as isFeedGenerator } from '../lexicon/types/app/bsky/feed/generator'
|
35
|
+
import { isRecord as isStarterPack } from '../lexicon/types/app/bsky/graph/starterpack'
|
35
36
|
import { isRecord as isPost } from '../lexicon/types/app/bsky/feed/post'
|
36
37
|
import { isTag } from '../lexicon/types/app/bsky/richtext/facet'
|
37
38
|
import { isRecord as isList } from '../lexicon/types/app/bsky/graph/list'
|
@@ -208,6 +209,8 @@ function assertNoExplicitSlurs(rkey: string, record: RepoRecord) {
|
|
208
209
|
toCheck += ' ' + record.displayName
|
209
210
|
} else if (isList(record)) {
|
210
211
|
toCheck += ' ' + record.name
|
212
|
+
} else if (isStarterPack(record)) {
|
213
|
+
toCheck += ' ' + record.name
|
211
214
|
} else if (isFeedGenerator(record)) {
|
212
215
|
toCheck += ' ' + rkey
|
213
216
|
toCheck += ' ' + record.displayName
|
@@ -152,6 +152,7 @@ Object {
|
|
152
152
|
},
|
153
153
|
"size": 3976,
|
154
154
|
},
|
155
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
155
156
|
"description": "hi im bob label_me",
|
156
157
|
"displayName": "bobby",
|
157
158
|
},
|
@@ -300,6 +301,7 @@ Object {
|
|
300
301
|
},
|
301
302
|
"size": 3976,
|
302
303
|
},
|
304
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
303
305
|
"description": "hi im bob label_me",
|
304
306
|
"displayName": "bobby",
|
305
307
|
},
|
@@ -360,6 +362,7 @@ Array [
|
|
360
362
|
},
|
361
363
|
"size": 3976,
|
362
364
|
},
|
365
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
363
366
|
"description": "its me!",
|
364
367
|
"displayName": "ali",
|
365
368
|
"labels": Object {
|
@@ -7,6 +7,7 @@ Object {
|
|
7
7
|
"post": Object {
|
8
8
|
"author": Object {
|
9
9
|
"avatar": "https://bsky.public.url/img/avatar/plain/user(1)/cids(1)@jpeg",
|
10
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
10
11
|
"did": "user(0)",
|
11
12
|
"displayName": "ali",
|
12
13
|
"handle": "alice.test",
|
@@ -100,6 +101,7 @@ Object {
|
|
100
101
|
"$type": "app.bsky.embed.record#viewRecord",
|
101
102
|
"author": Object {
|
102
103
|
"avatar": "https://bsky.public.url/img/avatar/plain/user(5)/cids(1)@jpeg",
|
104
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
103
105
|
"did": "user(4)",
|
104
106
|
"displayName": "bobby",
|
105
107
|
"handle": "bob.test",
|