@atproto/pds 0.4.59 → 0.4.60
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +31 -0
- package/dist/api/app/bsky/actor/getProfile.d.ts.map +1 -1
- package/dist/api/app/bsky/actor/getProfile.js +2 -9
- package/dist/api/app/bsky/actor/getProfile.js.map +1 -1
- package/dist/api/app/bsky/actor/getProfiles.d.ts.map +1 -1
- package/dist/api/app/bsky/actor/getProfiles.js +2 -6
- package/dist/api/app/bsky/actor/getProfiles.js.map +1 -1
- package/dist/api/app/bsky/feed/getActorLikes.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/getActorLikes.js +2 -9
- package/dist/api/app/bsky/feed/getActorLikes.js.map +1 -1
- package/dist/api/app/bsky/feed/getAuthorFeed.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/getAuthorFeed.js +2 -9
- package/dist/api/app/bsky/feed/getAuthorFeed.js.map +1 -1
- package/dist/api/app/bsky/feed/getFeed.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/getFeed.js +2 -1
- package/dist/api/app/bsky/feed/getFeed.js.map +1 -1
- package/dist/api/app/bsky/feed/getPostThread.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/getPostThread.js +12 -14
- package/dist/api/app/bsky/feed/getPostThread.js.map +1 -1
- package/dist/api/app/bsky/feed/getTimeline.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/getTimeline.js +2 -6
- package/dist/api/app/bsky/feed/getTimeline.js.map +1 -1
- package/dist/api/com/atproto/repo/getRecord.js +1 -1
- package/dist/api/com/atproto/repo/getRecord.js.map +1 -1
- package/dist/api/com/atproto/server/requestPasswordReset.js +1 -1
- package/dist/api/com/atproto/server/requestPasswordReset.js.map +1 -1
- package/dist/config/config.d.ts +9 -0
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +10 -1
- package/dist/config/config.js.map +1 -1
- package/dist/config/env.d.ts +6 -1
- package/dist/config/env.d.ts.map +1 -1
- package/dist/config/env.js +8 -1
- package/dist/config/env.js.map +1 -1
- package/dist/context.d.ts +6 -2
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +55 -11
- package/dist/context.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lexicon/lexicons.d.ts +33 -0
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +42 -3
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/app/bsky/actor/defs.d.ts +2 -0
- package/dist/lexicon/types/app/bsky/actor/defs.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/actor/defs.js.map +1 -1
- package/dist/lexicon/types/app/bsky/actor/profile.d.ts +1 -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/feed/defs.d.ts +13 -2
- package/dist/lexicon/types/app/bsky/feed/defs.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/defs.js +21 -1
- package/dist/lexicon/types/app/bsky/feed/defs.js.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/getAuthorFeed.d.ts +1 -0
- package/dist/lexicon/types/app/bsky/feed/getAuthorFeed.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/graph/getSuggestedFollowsByActor.d.ts +2 -0
- package/dist/lexicon/types/app/bsky/graph/getSuggestedFollowsByActor.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/unspecced/getSuggestionsSkeleton.d.ts +2 -0
- package/dist/lexicon/types/app/bsky/unspecced/getSuggestionsSkeleton.d.ts.map +1 -1
- package/dist/mailer/index.d.ts +1 -1
- package/dist/mailer/index.d.ts.map +1 -1
- package/dist/mailer/index.js.map +1 -1
- package/dist/mailer/templates/confirm-email.js +1 -1
- package/dist/mailer/templates/confirm-email.js.map +2 -2
- package/dist/mailer/templates/delete-account.js +1 -1
- package/dist/mailer/templates/delete-account.js.map +2 -2
- package/dist/mailer/templates/plc-operation.js +1 -1
- package/dist/mailer/templates/plc-operation.js.map +2 -2
- package/dist/mailer/templates/reset-password.js +1 -1
- package/dist/mailer/templates/reset-password.js.map +2 -2
- package/dist/mailer/templates/update-email.js +1 -1
- package/dist/mailer/templates/update-email.js.map +2 -2
- package/dist/pipethrough.d.ts +26 -26
- package/dist/pipethrough.d.ts.map +1 -1
- package/dist/pipethrough.js +328 -228
- package/dist/pipethrough.js.map +1 -1
- package/dist/read-after-write/util.d.ts +13 -5
- package/dist/read-after-write/util.d.ts.map +1 -1
- package/dist/read-after-write/util.js +37 -22
- package/dist/read-after-write/util.js.map +1 -1
- package/package.json +16 -15
- package/src/api/app/bsky/actor/getProfile.ts +3 -17
- package/src/api/app/bsky/actor/getProfiles.ts +3 -15
- package/src/api/app/bsky/feed/getActorLikes.ts +3 -19
- package/src/api/app/bsky/feed/getAuthorFeed.ts +3 -17
- package/src/api/app/bsky/feed/getFeed.ts +3 -1
- package/src/api/app/bsky/feed/getPostThread.ts +16 -23
- package/src/api/app/bsky/feed/getTimeline.ts +3 -14
- package/src/api/com/atproto/repo/getRecord.ts +1 -1
- package/src/api/com/atproto/server/requestPasswordReset.ts +1 -1
- package/src/config/config.ts +21 -1
- package/src/config/env.ts +20 -2
- package/src/context.ts +62 -17
- package/src/index.ts +1 -0
- package/src/lexicon/lexicons.ts +44 -3
- package/src/lexicon/types/app/bsky/actor/defs.ts +2 -0
- package/src/lexicon/types/app/bsky/actor/profile.ts +1 -0
- package/src/lexicon/types/app/bsky/feed/defs.ts +38 -2
- package/src/lexicon/types/app/bsky/feed/getAuthorFeed.ts +1 -0
- package/src/lexicon/types/app/bsky/graph/getSuggestedFollowsByActor.ts +2 -0
- package/src/lexicon/types/app/bsky/unspecced/getSuggestionsSkeleton.ts +2 -0
- package/src/mailer/index.ts +1 -1
- package/src/mailer/templates/confirm-email.hbs +106 -336
- package/src/mailer/templates/delete-account.hbs +110 -346
- package/src/mailer/templates/plc-operation.hbs +107 -338
- package/src/mailer/templates/reset-password.d.ts +1 -1
- package/src/mailer/templates/reset-password.hbs +108 -344
- package/src/mailer/templates/update-email.hbs +107 -337
- package/src/pipethrough.ts +489 -233
- package/src/read-after-write/util.ts +58 -32
- package/tests/account-deletion.test.ts +1 -1
- package/tests/account.test.ts +2 -2
- package/tests/email-confirmation.test.ts +2 -2
- package/tests/plc-operations.test.ts +1 -1
- package/tests/proxied/proxy-catchall.test.ts +255 -0
- package/tests/proxied/proxy-header.test.ts +31 -1
package/src/context.ts
CHANGED
@@ -1,23 +1,28 @@
|
|
1
1
|
import assert from 'node:assert'
|
2
|
+
import * as undici from 'undici'
|
2
3
|
import * as nodemailer from 'nodemailer'
|
3
4
|
import { Redis } from 'ioredis'
|
4
5
|
import * as plc from '@did-plc/lib'
|
6
|
+
import {
|
7
|
+
Fetch,
|
8
|
+
isUnicastIp,
|
9
|
+
loggedFetch,
|
10
|
+
safeFetchWrap,
|
11
|
+
unicastLookup,
|
12
|
+
} from '@atproto-labs/fetch-node'
|
5
13
|
import * as crypto from '@atproto/crypto'
|
6
14
|
import { IdResolver } from '@atproto/identity'
|
7
15
|
import { AtpAgent } from '@atproto/api'
|
8
16
|
import { KmsKeypair, S3BlobStore } from '@atproto/aws'
|
17
|
+
import { JoseKey, OAuthVerifier } from '@atproto/oauth-provider'
|
18
|
+
import { BlobStore } from '@atproto/repo'
|
9
19
|
import {
|
10
20
|
RateLimiter,
|
11
21
|
RateLimiterCreator,
|
12
22
|
RateLimiterOpts,
|
13
23
|
createServiceAuthHeaders,
|
24
|
+
createServiceJwt,
|
14
25
|
} from '@atproto/xrpc-server'
|
15
|
-
import {
|
16
|
-
JoseKey,
|
17
|
-
Fetch,
|
18
|
-
safeFetchWrap,
|
19
|
-
OAuthVerifier,
|
20
|
-
} from '@atproto/oauth-provider'
|
21
26
|
|
22
27
|
import { ServerConfig, ServerSecrets } from './config'
|
23
28
|
import { PdsOAuthProvider } from './oauth/provider'
|
@@ -29,7 +34,6 @@ import {
|
|
29
34
|
import { fetchLogger } from './logger'
|
30
35
|
import { ServerMailer } from './mailer'
|
31
36
|
import { ModerationMailer } from './mailer/moderation'
|
32
|
-
import { BlobStore } from '@atproto/repo'
|
33
37
|
import { AccountManager } from './account-manager'
|
34
38
|
import { Sequencer } from './sequencer'
|
35
39
|
import { BackgroundQueue } from './background'
|
@@ -59,6 +63,7 @@ export type AppContextOptions = {
|
|
59
63
|
moderationAgent?: AtpAgent
|
60
64
|
reportingAgent?: AtpAgent
|
61
65
|
entrywayAgent?: AtpAgent
|
66
|
+
proxyAgent: undici.Agent
|
62
67
|
safeFetch: Fetch
|
63
68
|
authProvider?: PdsOAuthProvider
|
64
69
|
authVerifier: AuthVerifier
|
@@ -85,6 +90,7 @@ export class AppContext {
|
|
85
90
|
public moderationAgent: AtpAgent | undefined
|
86
91
|
public reportingAgent: AtpAgent | undefined
|
87
92
|
public entrywayAgent: AtpAgent | undefined
|
93
|
+
public proxyAgent: undici.Agent
|
88
94
|
public safeFetch: Fetch
|
89
95
|
public authVerifier: AuthVerifier
|
90
96
|
public authProvider?: PdsOAuthProvider
|
@@ -110,6 +116,7 @@ export class AppContext {
|
|
110
116
|
this.moderationAgent = opts.moderationAgent
|
111
117
|
this.reportingAgent = opts.reportingAgent
|
112
118
|
this.entrywayAgent = opts.entrywayAgent
|
119
|
+
this.proxyAgent = opts.proxyAgent
|
113
120
|
this.safeFetch = opts.safeFetch
|
114
121
|
this.authVerifier = opts.authVerifier
|
115
122
|
this.authProvider = opts.authProvider
|
@@ -256,20 +263,47 @@ export class AppContext {
|
|
256
263
|
appviewCdnUrlPattern: cfg.bskyAppView?.cdnUrlPattern,
|
257
264
|
})
|
258
265
|
|
266
|
+
// An agent for performing HTTP requests based on user provided URLs.
|
267
|
+
const proxyAgent = new undici.Agent({
|
268
|
+
allowH2: cfg.proxy.allowHTTP2, // This is experimental
|
269
|
+
headersTimeout: cfg.proxy.headersTimeout,
|
270
|
+
maxResponseSize: cfg.proxy.maxResponseSize,
|
271
|
+
bodyTimeout: cfg.proxy.bodyTimeout,
|
272
|
+
factory: cfg.proxy.disableSsrfProtection
|
273
|
+
? undefined
|
274
|
+
: (origin, opts) => {
|
275
|
+
const { protocol, hostname } =
|
276
|
+
origin instanceof URL ? origin : new URL(origin)
|
277
|
+
if (protocol !== 'https:') {
|
278
|
+
throw new Error(`Forbidden protocol "${protocol}"`)
|
279
|
+
}
|
280
|
+
if (isUnicastIp(hostname) === false) {
|
281
|
+
throw new Error('Hostname resolved to non-unicast address')
|
282
|
+
}
|
283
|
+
return new undici.Pool(origin, opts)
|
284
|
+
},
|
285
|
+
connect: {
|
286
|
+
lookup: cfg.proxy.disableSsrfProtection ? undefined : unicastLookup,
|
287
|
+
},
|
288
|
+
})
|
289
|
+
|
259
290
|
// A fetch() function that protects against SSRF attacks, large responses &
|
260
291
|
// known bad domains. This function can safely be used to fetch user
|
261
292
|
// provided URLs (unless "disableSsrfProtection" is true, of course).
|
262
|
-
const safeFetch =
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
293
|
+
const safeFetch = loggedFetch({
|
294
|
+
fetch: safeFetchWrap({
|
295
|
+
// Using globalThis.fetch allows safeFetchWrap to use keep-alive. See
|
296
|
+
// unicastFetchWrap().
|
297
|
+
fetch: globalThis.fetch,
|
298
|
+
allowIpHost: false,
|
299
|
+
responseMaxSize: cfg.fetch.maxResponseSize,
|
300
|
+
ssrfProtection: !cfg.fetch.disableSsrfProtection,
|
301
|
+
}),
|
302
|
+
logRequest: ({ method, url }) => {
|
303
|
+
fetchLogger.debug({ method, uri: url }, 'fetch')
|
272
304
|
},
|
305
|
+
logResponse: false,
|
306
|
+
logError: false,
|
273
307
|
})
|
274
308
|
|
275
309
|
const authProvider = cfg.oauth.provider
|
@@ -333,6 +367,7 @@ export class AppContext {
|
|
333
367
|
moderationAgent,
|
334
368
|
reportingAgent,
|
335
369
|
entrywayAgent,
|
370
|
+
proxyAgent,
|
336
371
|
safeFetch,
|
337
372
|
authVerifier,
|
338
373
|
authProvider,
|
@@ -356,6 +391,16 @@ export class AppContext {
|
|
356
391
|
keypair,
|
357
392
|
})
|
358
393
|
}
|
394
|
+
|
395
|
+
async serviceAuthJwt(did: string, aud: string, lxm: string) {
|
396
|
+
const keypair = await this.actorStore.keypair(did)
|
397
|
+
return createServiceJwt({
|
398
|
+
iss: did,
|
399
|
+
aud,
|
400
|
+
lxm,
|
401
|
+
keypair,
|
402
|
+
})
|
403
|
+
}
|
359
404
|
}
|
360
405
|
|
361
406
|
export default AppContext
|
package/src/index.ts
CHANGED
@@ -127,6 +127,7 @@ export class PDS {
|
|
127
127
|
await this.ctx.backgroundQueue.destroy()
|
128
128
|
await this.ctx.accountManager.close()
|
129
129
|
await this.ctx.redisScratch?.quit()
|
130
|
+
await this.ctx.proxyAgent.destroy()
|
130
131
|
clearInterval(this.dbStatsInterval)
|
131
132
|
clearInterval(this.sequencerStatsInterval)
|
132
133
|
}
|
package/src/lexicon/lexicons.ts
CHANGED
@@ -4190,6 +4190,10 @@ export const schemaDict = {
|
|
4190
4190
|
ref: 'lex:com.atproto.label.defs#label',
|
4191
4191
|
},
|
4192
4192
|
},
|
4193
|
+
pinnedPost: {
|
4194
|
+
type: 'ref',
|
4195
|
+
ref: 'lex:com.atproto.repo.strongRef',
|
4196
|
+
},
|
4193
4197
|
},
|
4194
4198
|
},
|
4195
4199
|
profileAssociated: {
|
@@ -4812,6 +4816,10 @@ export const schemaDict = {
|
|
4812
4816
|
type: 'ref',
|
4813
4817
|
ref: 'lex:com.atproto.repo.strongRef',
|
4814
4818
|
},
|
4819
|
+
pinnedPost: {
|
4820
|
+
type: 'ref',
|
4821
|
+
ref: 'lex:com.atproto.repo.strongRef',
|
4822
|
+
},
|
4815
4823
|
createdAt: {
|
4816
4824
|
type: 'string',
|
4817
4825
|
format: 'datetime',
|
@@ -5468,6 +5476,9 @@ export const schemaDict = {
|
|
5468
5476
|
embeddingDisabled: {
|
5469
5477
|
type: 'boolean',
|
5470
5478
|
},
|
5479
|
+
pinned: {
|
5480
|
+
type: 'boolean',
|
5481
|
+
},
|
5471
5482
|
},
|
5472
5483
|
},
|
5473
5484
|
feedViewPost: {
|
@@ -5484,7 +5495,10 @@ export const schemaDict = {
|
|
5484
5495
|
},
|
5485
5496
|
reason: {
|
5486
5497
|
type: 'union',
|
5487
|
-
refs: [
|
5498
|
+
refs: [
|
5499
|
+
'lex:app.bsky.feed.defs#reasonRepost',
|
5500
|
+
'lex:app.bsky.feed.defs#reasonPin',
|
5501
|
+
],
|
5488
5502
|
},
|
5489
5503
|
feedContext: {
|
5490
5504
|
type: 'string',
|
@@ -5536,6 +5550,10 @@ export const schemaDict = {
|
|
5536
5550
|
},
|
5537
5551
|
},
|
5538
5552
|
},
|
5553
|
+
reasonPin: {
|
5554
|
+
type: 'object',
|
5555
|
+
properties: {},
|
5556
|
+
},
|
5539
5557
|
threadViewPost: {
|
5540
5558
|
type: 'object',
|
5541
5559
|
required: ['post'],
|
@@ -5693,7 +5711,10 @@ export const schemaDict = {
|
|
5693
5711
|
},
|
5694
5712
|
reason: {
|
5695
5713
|
type: 'union',
|
5696
|
-
refs: [
|
5714
|
+
refs: [
|
5715
|
+
'lex:app.bsky.feed.defs#skeletonReasonRepost',
|
5716
|
+
'lex:app.bsky.feed.defs#skeletonReasonPin',
|
5717
|
+
],
|
5697
5718
|
},
|
5698
5719
|
feedContext: {
|
5699
5720
|
type: 'string',
|
@@ -5713,6 +5734,10 @@ export const schemaDict = {
|
|
5713
5734
|
},
|
5714
5735
|
},
|
5715
5736
|
},
|
5737
|
+
skeletonReasonPin: {
|
5738
|
+
type: 'object',
|
5739
|
+
properties: {},
|
5740
|
+
},
|
5716
5741
|
threadgateView: {
|
5717
5742
|
type: 'object',
|
5718
5743
|
properties: {
|
@@ -6078,6 +6103,10 @@ export const schemaDict = {
|
|
6078
6103
|
],
|
6079
6104
|
default: 'posts_with_replies',
|
6080
6105
|
},
|
6106
|
+
includePins: {
|
6107
|
+
type: 'boolean',
|
6108
|
+
default: false,
|
6109
|
+
},
|
6081
6110
|
},
|
6082
6111
|
},
|
6083
6112
|
output: {
|
@@ -7162,7 +7191,7 @@ export const schemaDict = {
|
|
7162
7191
|
type: 'record',
|
7163
7192
|
key: 'tid',
|
7164
7193
|
description:
|
7165
|
-
"Record defining interaction gating rules for a thread (aka, reply controls). The record key (rkey) of the threadgate record must match the record key of the thread's root post, and that record must be in the same repository
|
7194
|
+
"Record defining interaction gating rules for a thread (aka, reply controls). The record key (rkey) of the threadgate record must match the record key of the thread's root post, and that record must be in the same repository.",
|
7166
7195
|
record: {
|
7167
7196
|
type: 'object',
|
7168
7197
|
required: ['post', 'createdAt'],
|
@@ -8236,6 +8265,12 @@ export const schemaDict = {
|
|
8236
8265
|
ref: 'lex:app.bsky.actor.defs#profileView',
|
8237
8266
|
},
|
8238
8267
|
},
|
8268
|
+
isFallback: {
|
8269
|
+
type: 'boolean',
|
8270
|
+
description:
|
8271
|
+
'If true, response has fallen-back to generic results, and is not scoped using relativeToDid',
|
8272
|
+
default: false,
|
8273
|
+
},
|
8239
8274
|
},
|
8240
8275
|
},
|
8241
8276
|
},
|
@@ -9192,6 +9227,12 @@ export const schemaDict = {
|
|
9192
9227
|
ref: 'lex:app.bsky.unspecced.defs#skeletonSearchActor',
|
9193
9228
|
},
|
9194
9229
|
},
|
9230
|
+
relativeToDid: {
|
9231
|
+
type: 'string',
|
9232
|
+
format: 'did',
|
9233
|
+
description:
|
9234
|
+
'DID of the account these suggestions are relative to. If this is returned undefined, suggestions are based on the viewer.',
|
9235
|
+
},
|
9195
9236
|
},
|
9196
9237
|
},
|
9197
9238
|
},
|
@@ -7,6 +7,7 @@ import { isObj, hasProp } from '../../../../util'
|
|
7
7
|
import { CID } from 'multiformats/cid'
|
8
8
|
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
|
9
9
|
import * as AppBskyGraphDefs from '../graph/defs'
|
10
|
+
import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'
|
10
11
|
|
11
12
|
export interface ProfileViewBasic {
|
12
13
|
did: string
|
@@ -74,6 +75,7 @@ export interface ProfileViewDetailed {
|
|
74
75
|
createdAt?: string
|
75
76
|
viewer?: ViewerState
|
76
77
|
labels?: ComAtprotoLabelDefs.Label[]
|
78
|
+
pinnedPost?: ComAtprotoRepoStrongRef.Main
|
77
79
|
[k: string]: unknown
|
78
80
|
}
|
79
81
|
|
@@ -55,6 +55,7 @@ export interface ViewerState {
|
|
55
55
|
threadMuted?: boolean
|
56
56
|
replyDisabled?: boolean
|
57
57
|
embeddingDisabled?: boolean
|
58
|
+
pinned?: boolean
|
58
59
|
[k: string]: unknown
|
59
60
|
}
|
60
61
|
|
@@ -73,7 +74,7 @@ export function validateViewerState(v: unknown): ValidationResult {
|
|
73
74
|
export interface FeedViewPost {
|
74
75
|
post: PostView
|
75
76
|
reply?: ReplyRef
|
76
|
-
reason?: ReasonRepost | { $type: string; [k: string]: unknown }
|
77
|
+
reason?: ReasonRepost | ReasonPin | { $type: string; [k: string]: unknown }
|
77
78
|
/** Context provided by feed generator that may be passed back alongside interactions. */
|
78
79
|
feedContext?: string
|
79
80
|
[k: string]: unknown
|
@@ -134,6 +135,22 @@ export function validateReasonRepost(v: unknown): ValidationResult {
|
|
134
135
|
return lexicons.validate('app.bsky.feed.defs#reasonRepost', v)
|
135
136
|
}
|
136
137
|
|
138
|
+
export interface ReasonPin {
|
139
|
+
[k: string]: unknown
|
140
|
+
}
|
141
|
+
|
142
|
+
export function isReasonPin(v: unknown): v is ReasonPin {
|
143
|
+
return (
|
144
|
+
isObj(v) &&
|
145
|
+
hasProp(v, '$type') &&
|
146
|
+
v.$type === 'app.bsky.feed.defs#reasonPin'
|
147
|
+
)
|
148
|
+
}
|
149
|
+
|
150
|
+
export function validateReasonPin(v: unknown): ValidationResult {
|
151
|
+
return lexicons.validate('app.bsky.feed.defs#reasonPin', v)
|
152
|
+
}
|
153
|
+
|
137
154
|
export interface ThreadViewPost {
|
138
155
|
post: PostView
|
139
156
|
parent?:
|
@@ -265,7 +282,10 @@ export function validateGeneratorViewerState(v: unknown): ValidationResult {
|
|
265
282
|
|
266
283
|
export interface SkeletonFeedPost {
|
267
284
|
post: string
|
268
|
-
reason?:
|
285
|
+
reason?:
|
286
|
+
| SkeletonReasonRepost
|
287
|
+
| SkeletonReasonPin
|
288
|
+
| { $type: string; [k: string]: unknown }
|
269
289
|
/** Context that will be passed through to client and may be passed to feed generator back alongside interactions. */
|
270
290
|
feedContext?: string
|
271
291
|
[k: string]: unknown
|
@@ -300,6 +320,22 @@ export function validateSkeletonReasonRepost(v: unknown): ValidationResult {
|
|
300
320
|
return lexicons.validate('app.bsky.feed.defs#skeletonReasonRepost', v)
|
301
321
|
}
|
302
322
|
|
323
|
+
export interface SkeletonReasonPin {
|
324
|
+
[k: string]: unknown
|
325
|
+
}
|
326
|
+
|
327
|
+
export function isSkeletonReasonPin(v: unknown): v is SkeletonReasonPin {
|
328
|
+
return (
|
329
|
+
isObj(v) &&
|
330
|
+
hasProp(v, '$type') &&
|
331
|
+
v.$type === 'app.bsky.feed.defs#skeletonReasonPin'
|
332
|
+
)
|
333
|
+
}
|
334
|
+
|
335
|
+
export function validateSkeletonReasonPin(v: unknown): ValidationResult {
|
336
|
+
return lexicons.validate('app.bsky.feed.defs#skeletonReasonPin', v)
|
337
|
+
}
|
338
|
+
|
303
339
|
export interface ThreadgateView {
|
304
340
|
uri?: string
|
305
341
|
cid?: string
|
@@ -17,6 +17,8 @@ export type InputSchema = undefined
|
|
17
17
|
|
18
18
|
export interface OutputSchema {
|
19
19
|
suggestions: AppBskyActorDefs.ProfileView[]
|
20
|
+
/** If true, response has fallen-back to generic results, and is not scoped using relativeToDid */
|
21
|
+
isFallback?: boolean
|
20
22
|
[k: string]: unknown
|
21
23
|
}
|
22
24
|
|
@@ -23,6 +23,8 @@ export type InputSchema = undefined
|
|
23
23
|
export interface OutputSchema {
|
24
24
|
cursor?: string
|
25
25
|
actors: AppBskyUnspeccedDefs.SkeletonSearchActor[]
|
26
|
+
/** DID of the account these suggestions are relative to. If this is returned undefined, suggestions are based on the viewer. */
|
27
|
+
relativeToDid?: string
|
26
28
|
[k: string]: unknown
|
27
29
|
}
|
28
30
|
|
package/src/mailer/index.ts
CHANGED