@atproto/bsky 0.3.9 → 0.3.11
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/dist/api/app/bsky/feed/getFeed.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/getFeed.js +14 -6
- package/dist/api/app/bsky/feed/getFeed.js.map +1 -1
- package/dist/context.d.ts +2 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +3 -0
- package/dist/context.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -1
- package/dist/lexicons/tools/ozone/moderation/emitEvent.defs.d.ts +4 -0
- package/dist/lexicons/tools/ozone/moderation/emitEvent.defs.d.ts.map +1 -1
- package/dist/lexicons/tools/ozone/moderation/emitEvent.defs.js +1 -1
- package/dist/lexicons/tools/ozone/moderation/emitEvent.defs.js.map +1 -1
- package/dist/lexicons/tools/ozone/report/closeReports.defs.d.ts +2 -0
- package/dist/lexicons/tools/ozone/report/closeReports.defs.d.ts.map +1 -1
- package/dist/lexicons/tools/ozone/report/closeReports.defs.js +1 -1
- package/dist/lexicons/tools/ozone/report/closeReports.defs.js.map +1 -1
- package/dist/lexicons/tools/ozone/report/createActivity.defs.d.ts +2 -0
- package/dist/lexicons/tools/ozone/report/createActivity.defs.d.ts.map +1 -1
- package/dist/lexicons/tools/ozone/report/createActivity.defs.js +1 -1
- package/dist/lexicons/tools/ozone/report/createActivity.defs.js.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atproto/bsky
|
|
2
2
|
|
|
3
|
+
## 0.3.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#5728](https://github.com/bluesky-social/atproto/pull/5728) [`b931b5e`](https://github.com/bluesky-social/atproto/commit/b931b5e1b703e335a434b3b9d51db17c48aa4a57) Thanks [@haileyok](https://github.com/haileyok)! - Feed generator skeleton requests now use the same outbound request policy as blob requests: endpoints resolved from a feed generator's DID document are fetched over HTTPS only, to public addresses only, re-checked on each redirect hop. Endpoints configured directly (iris, iris staging and the trending feed) are unchanged.
|
|
8
|
+
|
|
9
|
+
- [#5730](https://github.com/bluesky-social/atproto/pull/5730) [`4744b4a`](https://github.com/bluesky-social/atproto/commit/4744b4a2c0d17fed6bf063f2a86bd3b3875ddf1f) Thanks [@haileyok](https://github.com/haileyok)! - Update body-parser to 1.20.9
|
|
10
|
+
- Updated dependencies [[`4744b4a`](https://github.com/bluesky-social/atproto/commit/4744b4a2c0d17fed6bf063f2a86bd3b3875ddf1f)]:
|
|
11
|
+
- @atproto/xrpc-server@0.13.6
|
|
12
|
+
- @atproto-labs/xrpc-utils@0.1.27
|
|
13
|
+
- @atproto/sync@0.4.18
|
|
14
|
+
|
|
15
|
+
## 0.3.10
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [#5724](https://github.com/bluesky-social/atproto/pull/5724) [`123b4e2`](https://github.com/bluesky-social/atproto/commit/123b4e2c76ba25cbcc4833490fbac12cfa237abf) Thanks [@gcwill70](https://github.com/gcwill70)! - Accept optional metadata on report activity creation and bulk closure requests. Preserve moderation tool metadata on event-generated report activities and allow callers to mark those activities as automated.
|
|
20
|
+
- Updated dependencies [[`123b4e2`](https://github.com/bluesky-social/atproto/commit/123b4e2c76ba25cbcc4833490fbac12cfa237abf)]:
|
|
21
|
+
- @atproto/api@0.29.3
|
|
22
|
+
|
|
3
23
|
## 0.3.9
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFeed.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getFeed.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,SAAS,EAIf,MAAM,cAAc,CAAA;AAErB,OAAO,EACL,KAAK,OAAO,IAAI,UAA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E,GAC3C,MAAM,GAAG,SAAS,CAMpB;AA6JD,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,gBAAgB,EAAE,CAAA;IAC7B,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG;IACxC,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA"}
|
|
@@ -182,13 +182,18 @@ const resolveSkeletonEndpoint = async (ctx, params) => {
|
|
|
182
182
|
const { feed } = params;
|
|
183
183
|
const irisUrl = irisUrlForFeed(ctx.cfg, params);
|
|
184
184
|
if (irisUrl) {
|
|
185
|
-
return {
|
|
185
|
+
return {
|
|
186
|
+
endpoint: irisUrl,
|
|
187
|
+
feedDid: await getFeedGenDid(ctx, feed),
|
|
188
|
+
trusted: true,
|
|
189
|
+
};
|
|
186
190
|
}
|
|
187
191
|
const irisStagingUrl = irisStagingUrlForFeed(ctx.cfg, params);
|
|
188
192
|
if (irisStagingUrl) {
|
|
189
193
|
return {
|
|
190
194
|
endpoint: irisStagingUrl,
|
|
191
195
|
feedDid: await getFeedGenDid(ctx, feed),
|
|
196
|
+
trusted: true,
|
|
192
197
|
};
|
|
193
198
|
}
|
|
194
199
|
const feedDid = await getFeedGenDid(ctx, feed);
|
|
@@ -196,8 +201,9 @@ const resolveSkeletonEndpoint = async (ctx, params) => {
|
|
|
196
201
|
throw new InvalidRequestError('could not find feed');
|
|
197
202
|
}
|
|
198
203
|
const trendingIrisUrl = irisUrlForTrendingFeed(ctx.cfg, { feed, feedDid });
|
|
199
|
-
if (trendingIrisUrl)
|
|
200
|
-
return { endpoint: trendingIrisUrl, feedDid };
|
|
204
|
+
if (trendingIrisUrl) {
|
|
205
|
+
return { endpoint: trendingIrisUrl, feedDid, trusted: true };
|
|
206
|
+
}
|
|
201
207
|
let identity;
|
|
202
208
|
try {
|
|
203
209
|
identity = await ctx.dataplane.getIdentityByDid({ did: feedDid });
|
|
@@ -216,7 +222,7 @@ const resolveSkeletonEndpoint = async (ctx, params) => {
|
|
|
216
222
|
if (!fgEndpoint) {
|
|
217
223
|
throw new InvalidRequestError(`invalid feed generator service details in did document: ${feedDid}`);
|
|
218
224
|
}
|
|
219
|
-
return { endpoint: fgEndpoint, feedDid };
|
|
225
|
+
return { endpoint: fgEndpoint, feedDid, trusted: false };
|
|
220
226
|
};
|
|
221
227
|
async function getFeedGenDid(ctx, feed) {
|
|
222
228
|
const found = await ctx.hydrator.feed.getFeedGens([feed], true);
|
|
@@ -224,7 +230,7 @@ async function getFeedGenDid(ctx, feed) {
|
|
|
224
230
|
}
|
|
225
231
|
const skeletonFromFeedGen = async (ctx, params) => {
|
|
226
232
|
const { headers, passthroughHeaders } = params;
|
|
227
|
-
const { endpoint, feedDid } = await resolveSkeletonEndpoint(ctx, params);
|
|
233
|
+
const { endpoint, feedDid, trusted } = await resolveSkeletonEndpoint(ctx, params);
|
|
228
234
|
const requestHeaders = noUndefinedVals({
|
|
229
235
|
...headers,
|
|
230
236
|
...(feedDid && ctx.cfg.bskyFeedgenDids.has(feedDid)
|
|
@@ -232,7 +238,9 @@ const skeletonFromFeedGen = async (ctx, params) => {
|
|
|
232
238
|
: {}),
|
|
233
239
|
});
|
|
234
240
|
// @TODO currently passthrough auth headers from pds
|
|
235
|
-
|
|
241
|
+
// Configured endpoints (iris) are ours. The DID-document path is resolved from
|
|
242
|
+
// another account's record, so only that one goes through the guarded fetch.
|
|
243
|
+
const result = await xrpcSafe(trusted ? endpoint : { service: endpoint, fetch: ctx.federatedFetch }, app.bsky.feed.getFeedSkeleton, {
|
|
236
244
|
strictResponseProcessing: false,
|
|
237
245
|
signal: AbortSignal.any([
|
|
238
246
|
params.signal,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFeed.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getFeed.ts"],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C5D,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;YAC7B,CAAC,CAAC,SAAS;QACf,YAAY,EACV,IAAI,CAAC,MAAM,IAAI,IAAI;YACnB,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;YACzD,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,SAAS;QACf,WAAW,EAAE,IAAI,CAAC,WAAW;KAC9B,CAAC,CAAC,CAAA;IAEH,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAA;IAE1D,OAAO;QACL,GAAG,KAAK;QACR,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS;QACzE,SAAS;QACT,6EAA6E;QAC7E,sEAAsE;QACtE,MAAM,EACJ,SAAS,CAAC,MAAM,KAAK,CAAC,IAAI,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM;KAC1E,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { mapDefined, noUndefinedVals } from '@atproto/common'\nimport {\n type DidString,\n XrpcInvalidResponseError,\n XrpcResponseError,\n xrpcSafe,\n} from '@atproto/lex'\nimport { AtUri } from '@atproto/syntax'\nimport {\n type Headers as HeadersMap,\n InvalidRequestError,\n type Server,\n ServerTimer,\n UpstreamFailureError,\n XRPCError,\n serverTimingHeader,\n} from '@atproto/xrpc-server'\nimport type { ServerConfig } from '../../../../config.js'\nimport type { AppContext } from '../../../../context.js'\nimport {\n Code,\n getServiceEndpoint,\n isDataplaneError,\n unpackIdentityServices,\n} from '../../../../data-plane/index.js'\nimport { Gate } from '../../../../feature-gates/gates.js'\nimport { ANALYTICS_HEADER_DEVICE_ID } from '../../../../feature-gates/index.js'\nimport type { FeedItem } from '../../../../hydration/feed.js'\nimport type { HydrateCtx } from '../../../../hydration/hydrator.js'\nimport { app } from '../../../../lexicons/index.js'\nimport {\n type HydrationFnInput,\n type PresentationFnInput,\n type RulesFnInput,\n type SkeletonFnInput,\n createPipeline,\n} from '../../../../pipeline.js'\nimport type { GetIdentityByDidResponse } from '../../../../proto/bsky_pb.js'\nimport { getAtprotoPassthroughHeaders } from '../../../../util/headers.js'\nimport { BSKY_USER_AGENT, resHeaders } from '../../../util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const getFeed = createPipeline(\n skeleton,\n hydration,\n noBlocksOrMutes,\n presentation,\n )\n server.add(app.bsky.feed.getFeed, {\n auth: ctx.authVerifier.standardOptionalParameterized({\n lxmCheck: (method) => {\n return (\n method === app.bsky.feed.getFeedSkeleton.$lxm ||\n method === app.bsky.feed.getFeed.$lxm\n )\n },\n skipAudCheck: true,\n }),\n handler: async ({ params, auth, req, signal }) => {\n const viewer = auth.credentials.iss\n const stableDeviceId = req.header(ANALYTICS_HEADER_DEVICE_ID) ?? null\n const labelers = ctx.reqLabelers(req)\n const hydrateCtx = await ctx.hydrator.createContext({\n labelers,\n viewer,\n features: ctx.featureGatesClient.scope(\n ctx.featureGatesClient.parseUserContextFromHandler({ viewer, req }),\n ),\n })\n const headers = noUndefinedVals({\n 'user-agent': BSKY_USER_AGENT,\n authorization: req.headers['authorization'],\n 'accept-language': req.headers['accept-language'],\n })\n const passthroughHeaders = getAtprotoPassthroughHeaders(req)\n // @NOTE feed cursors should not be affected by appview swap\n // Do not refill filtered pages. Overfetching from algorithmic feeds can\n // advance their state and prevent omitted items from appearing later.\n const result = await getFeed(\n {\n ...params,\n hydrateCtx,\n stableDeviceId,\n headers,\n passthroughHeaders,\n signal,\n },\n ctx,\n )\n const {\n timerSkele,\n timerHydr,\n resHeaders: feedResHeaders,\n ...body\n } = result\n\n return {\n encoding: 'application/json',\n body,\n headers: {\n ...feedResHeaders,\n ...resHeaders({ labelers: hydrateCtx.labelers }),\n 'server-timing': serverTimingHeader([timerSkele, timerHydr]),\n },\n }\n },\n })\n}\n\nconst skeleton = async (\n inputs: SkeletonFnInput<Context, Params>,\n): Promise<Skeleton> => {\n const { ctx, params } = inputs\n const timerSkele = new ServerTimer('skele').start()\n const {\n feedItems: algoItems,\n reqId,\n cursor,\n resHeaders,\n ...passthrough\n } = await skeletonFromFeedGen(ctx, params)\n\n return {\n cursor,\n items: algoItems,\n reqId,\n timerSkele: timerSkele.stop(),\n timerHydr: new ServerTimer('hydr').start(),\n resHeaders,\n passthrough,\n }\n}\n\nconst hydration = async (\n inputs: HydrationFnInput<Context, Params, Skeleton>,\n) => {\n const { ctx, params, skeleton } = inputs\n const timerHydr = new ServerTimer('hydr').start()\n const hydration = await ctx.hydrator.hydrateFeedItems(\n skeleton.items,\n params.hydrateCtx,\n {\n knownLikers:\n !!params.hydrateCtx.viewer &&\n params.hydrateCtx.features.checkGate(\n params.hydrateCtx.features.Gate.KnownLikersFeedEnable,\n ),\n },\n )\n skeleton.timerHydr = timerHydr.stop()\n return hydration\n}\n\nconst noBlocksOrMutes = (inputs: RulesFnInput<Context, Params, Skeleton>) => {\n const { ctx, skeleton, hydration } = inputs\n skeleton.items = skeleton.items.filter((item) => {\n const bam = ctx.views.feedItemBlocksAndMutes(item, hydration)\n return (\n !bam.authorBlocked &&\n !bam.authorMuted &&\n !bam.authorQuotepostMuted &&\n !bam.originatorBlocked &&\n !bam.originatorMuted &&\n !bam.originatorRepostMuted &&\n !bam.ancestorAuthorBlocked\n )\n })\n\n return skeleton\n}\n\nconst presentation = (\n inputs: PresentationFnInput<Context, Params, Skeleton>,\n) => {\n const { ctx, skeleton, hydration } = inputs\n const feed = mapDefined(skeleton.items, (item) => {\n const post = ctx.views.feedViewPost(item, hydration)\n if (!post) return\n return {\n ...post,\n feedContext: item.feedContext,\n }\n })\n return {\n feed: feed.map((fi) => ({ ...fi, reqId: skeleton.reqId })),\n cursor: skeleton.cursor,\n timerSkele: skeleton.timerSkele,\n timerHydr: skeleton.timerHydr,\n resHeaders: skeleton.resHeaders,\n ...skeleton.passthrough,\n }\n}\n\ntype Context = AppContext\n\ntype Params = app.bsky.feed.getFeed.$Params & {\n hydrateCtx: HydrateCtx\n stableDeviceId: string | null\n headers: HeadersMap\n passthroughHeaders: HeadersMap\n signal: AbortSignal\n}\n\ntype Skeleton = {\n items: AlgoResponseItem[]\n reqId?: string\n passthrough: Record<string, unknown> // pass through additional items in feedgen response\n resHeaders?: HeadersMap\n cursor?: string\n timerSkele: ServerTimer\n timerHydr: ServerTimer\n}\n\n/**\n * Per-feed rollout gates for the iris cutover, keyed by feed rkey.\n * Allowlisted feeds without a dedicated gate (whats-hot) use Gate.IrisFeed.\n */\nconst IRIS_FEED_RKEY_GATES: Record<string, Gate> = {\n 'with-friends': Gate.IrisFeedWithFriendsEnable,\n thevids: Gate.IrisFeedThevidsEnable,\n mutuals: Gate.IrisFeedMutualsEnable,\n 'bsky-team': Gate.IrisFeedBskyTeamEnable,\n 'best-of-follows': Gate.IrisFeedBestOfFollowsEnable,\n followpics: Gate.IrisFeedFollowpicsEnable,\n}\n\n/**\n * Iris' endpoint, when it should serve this request in place of the feed's\n * registered feed generator (seeemore).\n *\n * Logged-in viewers are routed by their per-feed gate. Logged-out viewers\n * have no DID, but the client sends a stable device id (stable_id) that\n * GrowthBook can bucket on, so they are routed by the dedicated\n * Gate.IrisFeedLoggedOutEnable gate instead. Requests without a stable\n * device id are never routed: the feature-gates context falls back to a\n * random id per request, which would flip backends between pages and send a\n * cursor to the backend that did not mint it.\n */\nexport const irisUrlForFeed = (\n cfg: Pick<ServerConfig, 'irisUrl' | 'irisFeedUris'>,\n params: {\n feed: string\n stableDeviceId: string | null\n hydrateCtx: {\n viewer: HydrateCtx['viewer']\n features: Pick<HydrateCtx['features'], 'Gate' | 'checkGate'>\n }\n },\n): string | undefined => {\n const { irisUrl } = cfg\n if (!irisUrl) return\n if (!cfg.irisFeedUris?.has(params.feed)) return\n if (!params.hydrateCtx.viewer) {\n if (!params.stableDeviceId) return\n return params.hydrateCtx.features.checkGate(Gate.IrisFeedLoggedOutEnable)\n ? irisUrl\n : undefined\n }\n const rkey = params.feed.split('/').at(-1)\n const gate = (rkey && IRIS_FEED_RKEY_GATES[rkey]) || Gate.IrisFeed\n if (!params.hydrateCtx.features.checkGate(gate)) {\n return\n }\n return irisUrl\n}\n\n/**\n * Iris staging's endpoint, when it should serve this request in place of the\n * feed's registered feed generator.\n */\nexport const irisStagingUrlForFeed = (\n cfg: Pick<ServerConfig, 'irisStagingUrl' | 'irisStagingFeedUris'>,\n params: { feed: string },\n): string | undefined =>\n cfg.irisStagingFeedUris?.has(params.feed) ? cfg.irisStagingUrl : undefined\n\n/**\n * Iris' local endpoint for configured trending feeds registered to Iris.\n */\nexport function irisUrlForTrendingFeed(\n cfg: Pick<ServerConfig, 'irisUrl' | 'irisServiceDid' | 'trendingFeedDid'>,\n params: { feed: string; feedDid: DidString },\n): string | undefined {\n const { irisUrl, irisServiceDid, trendingFeedDid } = cfg\n if (!irisUrl || !irisServiceDid || !trendingFeedDid) return\n if (params.feedDid !== irisServiceDid) return\n if (new AtUri(params.feed).host !== trendingFeedDid) return\n return irisUrl\n}\n\nconst resolveSkeletonEndpoint = async (\n ctx: Context,\n params: Params,\n): Promise<{ endpoint: string; feedDid?: DidString }> => {\n const { feed } = params\n const irisUrl = irisUrlForFeed(ctx.cfg, params)\n if (irisUrl) {\n return { endpoint: irisUrl, feedDid: await getFeedGenDid(ctx, feed) }\n }\n\n const irisStagingUrl = irisStagingUrlForFeed(ctx.cfg, params)\n if (irisStagingUrl) {\n return {\n endpoint: irisStagingUrl,\n feedDid: await getFeedGenDid(ctx, feed),\n }\n }\n\n const feedDid = await getFeedGenDid(ctx, feed)\n if (!feedDid) {\n throw new InvalidRequestError('could not find feed')\n }\n\n const trendingIrisUrl = irisUrlForTrendingFeed(ctx.cfg, { feed, feedDid })\n if (trendingIrisUrl) return { endpoint: trendingIrisUrl, feedDid }\n\n let identity: GetIdentityByDidResponse\n try {\n identity = await ctx.dataplane.getIdentityByDid({ did: feedDid })\n } catch (err) {\n if (isDataplaneError(err, Code.NotFound)) {\n throw new InvalidRequestError(`could not resolve identity: ${feedDid}`)\n }\n throw err\n }\n\n const services = unpackIdentityServices(identity.services)\n const fgEndpoint = getServiceEndpoint(services, {\n id: 'bsky_fg',\n type: 'BskyFeedGenerator',\n })\n if (!fgEndpoint) {\n throw new InvalidRequestError(\n `invalid feed generator service details in did document: ${feedDid}`,\n )\n }\n\n return { endpoint: fgEndpoint, feedDid }\n}\n\nasync function getFeedGenDid(\n ctx: Context,\n feed: Params['feed'],\n): Promise<DidString | undefined> {\n const found = await ctx.hydrator.feed.getFeedGens([feed], true)\n return found.get(feed)?.record.did\n}\n\nconst skeletonFromFeedGen = async (\n ctx: Context,\n params: Params,\n): Promise<AlgoResponse> => {\n const { headers, passthroughHeaders } = params\n const { endpoint, feedDid } = await resolveSkeletonEndpoint(ctx, params)\n const requestHeaders = noUndefinedVals({\n ...headers,\n ...(feedDid && ctx.cfg.bskyFeedgenDids.has(feedDid)\n ? passthroughHeaders\n : {}),\n })\n\n // @TODO currently passthrough auth headers from pds\n const result = await xrpcSafe(endpoint, app.bsky.feed.getFeedSkeleton, {\n strictResponseProcessing: false,\n signal: AbortSignal.any([\n params.signal,\n AbortSignal.timeout(ctx.cfg.feedGenSkeletonTimeout),\n ]),\n headers: requestHeaders,\n params: {\n feed: params.feed,\n // The feedgen is not guaranteed to honor the limit, but we try it.\n limit: params.limit,\n cursor: params.cursor,\n },\n })\n\n if (!result.success) {\n const cause = result.reason\n\n // Pass through structurally valid XRPC error response (4xx/5xx), such as\n // auth errors\n if (cause instanceof XrpcResponseError) {\n const { status, body } = cause.toDownstreamError()\n throw new XRPCError(status, body.message, body.error, { cause })\n }\n\n // The response does not match the schema\n if (cause instanceof XrpcInvalidResponseError) {\n throw new UpstreamFailureError(\n 'feed provided an invalid response',\n 'InvalidFeedResponse',\n { cause },\n )\n }\n\n // Typically a network error.\n throw new UpstreamFailureError('feed unavailable', undefined, { cause })\n }\n\n const { feed: feedSkele, cursor, ...skele } = result.body\n const feedItems = feedSkele.slice(0, params.limit).map((item) => ({\n post: { uri: item.post },\n repost:\n item.reason != null &&\n app.bsky.feed.defs.skeletonReasonRepost.$isTypeOf(item.reason)\n ? { uri: item.reason.repost }\n : undefined,\n authorPinned:\n item.reason != null &&\n app.bsky.feed.defs.skeletonReasonPin.$isTypeOf(item.reason)\n ? true\n : undefined,\n feedContext: item.feedContext,\n }))\n\n const contentLang = result.headers.get('content-language')\n\n return {\n ...skele,\n resHeaders: contentLang ? { 'content-language': contentLang } : undefined,\n feedItems,\n // An empty feed-generator page ends pagination even if it includes a cursor.\n // Also prevent loops if the custom feed echoes the input cursor back.\n cursor:\n feedSkele.length === 0 || cursor === params.cursor ? undefined : cursor,\n }\n}\n\nexport type AlgoResponse = {\n feedItems: AlgoResponseItem[]\n resHeaders?: HeadersMap\n cursor?: string\n reqId?: string\n}\n\nexport type AlgoResponseItem = FeedItem & {\n feedContext?: string\n}\n"]}
|
|
1
|
+
{"version":3,"file":"getFeed.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getFeed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAC7D,OAAO,EAEL,wBAAwB,EACxB,iBAAiB,EACjB,QAAQ,GACT,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAEL,mBAAmB,EAEnB,WAAW,EACX,oBAAoB,EACpB,SAAS,EACT,kBAAkB,GACnB,MAAM,sBAAsB,CAAA;AAG7B,OAAO,EACL,IAAI,EACJ,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,iCAAiC,CAAA;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAA;AACzD,OAAO,EAAE,0BAA0B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,CAAC,IAAI,CAAC,MAAM,CAAC;YACzD,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,SAAS;QACf,WAAW,EAAE,IAAI,CAAC,WAAW;KAC9B,CAAC,CAAC,CAAA;IAEH,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAA;IAE1D,OAAO;QACL,GAAG,KAAK;QACR,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS;QACzE,SAAS;QACT,6EAA6E;QAC7E,sEAAsE;QACtE,MAAM,EACJ,SAAS,CAAC,MAAM,KAAK,CAAC,IAAI,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM;KAC1E,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { mapDefined, noUndefinedVals } from '@atproto/common'\nimport {\n type DidString,\n XrpcInvalidResponseError,\n XrpcResponseError,\n xrpcSafe,\n} from '@atproto/lex'\nimport { AtUri } from '@atproto/syntax'\nimport {\n type Headers as HeadersMap,\n InvalidRequestError,\n type Server,\n ServerTimer,\n UpstreamFailureError,\n XRPCError,\n serverTimingHeader,\n} from '@atproto/xrpc-server'\nimport type { ServerConfig } from '../../../../config.js'\nimport type { AppContext } from '../../../../context.js'\nimport {\n Code,\n getServiceEndpoint,\n isDataplaneError,\n unpackIdentityServices,\n} from '../../../../data-plane/index.js'\nimport { Gate } from '../../../../feature-gates/gates.js'\nimport { ANALYTICS_HEADER_DEVICE_ID } from '../../../../feature-gates/index.js'\nimport type { FeedItem } from '../../../../hydration/feed.js'\nimport type { HydrateCtx } from '../../../../hydration/hydrator.js'\nimport { app } from '../../../../lexicons/index.js'\nimport {\n type HydrationFnInput,\n type PresentationFnInput,\n type RulesFnInput,\n type SkeletonFnInput,\n createPipeline,\n} from '../../../../pipeline.js'\nimport type { GetIdentityByDidResponse } from '../../../../proto/bsky_pb.js'\nimport { getAtprotoPassthroughHeaders } from '../../../../util/headers.js'\nimport { BSKY_USER_AGENT, resHeaders } from '../../../util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const getFeed = createPipeline(\n skeleton,\n hydration,\n noBlocksOrMutes,\n presentation,\n )\n server.add(app.bsky.feed.getFeed, {\n auth: ctx.authVerifier.standardOptionalParameterized({\n lxmCheck: (method) => {\n return (\n method === app.bsky.feed.getFeedSkeleton.$lxm ||\n method === app.bsky.feed.getFeed.$lxm\n )\n },\n skipAudCheck: true,\n }),\n handler: async ({ params, auth, req, signal }) => {\n const viewer = auth.credentials.iss\n const stableDeviceId = req.header(ANALYTICS_HEADER_DEVICE_ID) ?? null\n const labelers = ctx.reqLabelers(req)\n const hydrateCtx = await ctx.hydrator.createContext({\n labelers,\n viewer,\n features: ctx.featureGatesClient.scope(\n ctx.featureGatesClient.parseUserContextFromHandler({ viewer, req }),\n ),\n })\n const headers = noUndefinedVals({\n 'user-agent': BSKY_USER_AGENT,\n authorization: req.headers['authorization'],\n 'accept-language': req.headers['accept-language'],\n })\n const passthroughHeaders = getAtprotoPassthroughHeaders(req)\n // @NOTE feed cursors should not be affected by appview swap\n // Do not refill filtered pages. Overfetching from algorithmic feeds can\n // advance their state and prevent omitted items from appearing later.\n const result = await getFeed(\n {\n ...params,\n hydrateCtx,\n stableDeviceId,\n headers,\n passthroughHeaders,\n signal,\n },\n ctx,\n )\n const {\n timerSkele,\n timerHydr,\n resHeaders: feedResHeaders,\n ...body\n } = result\n\n return {\n encoding: 'application/json',\n body,\n headers: {\n ...feedResHeaders,\n ...resHeaders({ labelers: hydrateCtx.labelers }),\n 'server-timing': serverTimingHeader([timerSkele, timerHydr]),\n },\n }\n },\n })\n}\n\nconst skeleton = async (\n inputs: SkeletonFnInput<Context, Params>,\n): Promise<Skeleton> => {\n const { ctx, params } = inputs\n const timerSkele = new ServerTimer('skele').start()\n const {\n feedItems: algoItems,\n reqId,\n cursor,\n resHeaders,\n ...passthrough\n } = await skeletonFromFeedGen(ctx, params)\n\n return {\n cursor,\n items: algoItems,\n reqId,\n timerSkele: timerSkele.stop(),\n timerHydr: new ServerTimer('hydr').start(),\n resHeaders,\n passthrough,\n }\n}\n\nconst hydration = async (\n inputs: HydrationFnInput<Context, Params, Skeleton>,\n) => {\n const { ctx, params, skeleton } = inputs\n const timerHydr = new ServerTimer('hydr').start()\n const hydration = await ctx.hydrator.hydrateFeedItems(\n skeleton.items,\n params.hydrateCtx,\n {\n knownLikers:\n !!params.hydrateCtx.viewer &&\n params.hydrateCtx.features.checkGate(\n params.hydrateCtx.features.Gate.KnownLikersFeedEnable,\n ),\n },\n )\n skeleton.timerHydr = timerHydr.stop()\n return hydration\n}\n\nconst noBlocksOrMutes = (inputs: RulesFnInput<Context, Params, Skeleton>) => {\n const { ctx, skeleton, hydration } = inputs\n skeleton.items = skeleton.items.filter((item) => {\n const bam = ctx.views.feedItemBlocksAndMutes(item, hydration)\n return (\n !bam.authorBlocked &&\n !bam.authorMuted &&\n !bam.authorQuotepostMuted &&\n !bam.originatorBlocked &&\n !bam.originatorMuted &&\n !bam.originatorRepostMuted &&\n !bam.ancestorAuthorBlocked\n )\n })\n\n return skeleton\n}\n\nconst presentation = (\n inputs: PresentationFnInput<Context, Params, Skeleton>,\n) => {\n const { ctx, skeleton, hydration } = inputs\n const feed = mapDefined(skeleton.items, (item) => {\n const post = ctx.views.feedViewPost(item, hydration)\n if (!post) return\n return {\n ...post,\n feedContext: item.feedContext,\n }\n })\n return {\n feed: feed.map((fi) => ({ ...fi, reqId: skeleton.reqId })),\n cursor: skeleton.cursor,\n timerSkele: skeleton.timerSkele,\n timerHydr: skeleton.timerHydr,\n resHeaders: skeleton.resHeaders,\n ...skeleton.passthrough,\n }\n}\n\ntype Context = AppContext\n\ntype Params = app.bsky.feed.getFeed.$Params & {\n hydrateCtx: HydrateCtx\n stableDeviceId: string | null\n headers: HeadersMap\n passthroughHeaders: HeadersMap\n signal: AbortSignal\n}\n\ntype Skeleton = {\n items: AlgoResponseItem[]\n reqId?: string\n passthrough: Record<string, unknown> // pass through additional items in feedgen response\n resHeaders?: HeadersMap\n cursor?: string\n timerSkele: ServerTimer\n timerHydr: ServerTimer\n}\n\n/**\n * Per-feed rollout gates for the iris cutover, keyed by feed rkey.\n * Allowlisted feeds without a dedicated gate (whats-hot) use Gate.IrisFeed.\n */\nconst IRIS_FEED_RKEY_GATES: Record<string, Gate> = {\n 'with-friends': Gate.IrisFeedWithFriendsEnable,\n thevids: Gate.IrisFeedThevidsEnable,\n mutuals: Gate.IrisFeedMutualsEnable,\n 'bsky-team': Gate.IrisFeedBskyTeamEnable,\n 'best-of-follows': Gate.IrisFeedBestOfFollowsEnable,\n followpics: Gate.IrisFeedFollowpicsEnable,\n}\n\n/**\n * Iris' endpoint, when it should serve this request in place of the feed's\n * registered feed generator (seeemore).\n *\n * Logged-in viewers are routed by their per-feed gate. Logged-out viewers\n * have no DID, but the client sends a stable device id (stable_id) that\n * GrowthBook can bucket on, so they are routed by the dedicated\n * Gate.IrisFeedLoggedOutEnable gate instead. Requests without a stable\n * device id are never routed: the feature-gates context falls back to a\n * random id per request, which would flip backends between pages and send a\n * cursor to the backend that did not mint it.\n */\nexport const irisUrlForFeed = (\n cfg: Pick<ServerConfig, 'irisUrl' | 'irisFeedUris'>,\n params: {\n feed: string\n stableDeviceId: string | null\n hydrateCtx: {\n viewer: HydrateCtx['viewer']\n features: Pick<HydrateCtx['features'], 'Gate' | 'checkGate'>\n }\n },\n): string | undefined => {\n const { irisUrl } = cfg\n if (!irisUrl) return\n if (!cfg.irisFeedUris?.has(params.feed)) return\n if (!params.hydrateCtx.viewer) {\n if (!params.stableDeviceId) return\n return params.hydrateCtx.features.checkGate(Gate.IrisFeedLoggedOutEnable)\n ? irisUrl\n : undefined\n }\n const rkey = params.feed.split('/').at(-1)\n const gate = (rkey && IRIS_FEED_RKEY_GATES[rkey]) || Gate.IrisFeed\n if (!params.hydrateCtx.features.checkGate(gate)) {\n return\n }\n return irisUrl\n}\n\n/**\n * Iris staging's endpoint, when it should serve this request in place of the\n * feed's registered feed generator.\n */\nexport const irisStagingUrlForFeed = (\n cfg: Pick<ServerConfig, 'irisStagingUrl' | 'irisStagingFeedUris'>,\n params: { feed: string },\n): string | undefined =>\n cfg.irisStagingFeedUris?.has(params.feed) ? cfg.irisStagingUrl : undefined\n\n/**\n * Iris' local endpoint for configured trending feeds registered to Iris.\n */\nexport function irisUrlForTrendingFeed(\n cfg: Pick<ServerConfig, 'irisUrl' | 'irisServiceDid' | 'trendingFeedDid'>,\n params: { feed: string; feedDid: DidString },\n): string | undefined {\n const { irisUrl, irisServiceDid, trendingFeedDid } = cfg\n if (!irisUrl || !irisServiceDid || !trendingFeedDid) return\n if (params.feedDid !== irisServiceDid) return\n if (new AtUri(params.feed).host !== trendingFeedDid) return\n return irisUrl\n}\n\nconst resolveSkeletonEndpoint = async (\n ctx: Context,\n params: Params,\n): Promise<{ endpoint: string; feedDid?: DidString; trusted?: boolean }> => {\n const { feed } = params\n const irisUrl = irisUrlForFeed(ctx.cfg, params)\n if (irisUrl) {\n return {\n endpoint: irisUrl,\n feedDid: await getFeedGenDid(ctx, feed),\n trusted: true,\n }\n }\n\n const irisStagingUrl = irisStagingUrlForFeed(ctx.cfg, params)\n if (irisStagingUrl) {\n return {\n endpoint: irisStagingUrl,\n feedDid: await getFeedGenDid(ctx, feed),\n trusted: true,\n }\n }\n\n const feedDid = await getFeedGenDid(ctx, feed)\n if (!feedDid) {\n throw new InvalidRequestError('could not find feed')\n }\n\n const trendingIrisUrl = irisUrlForTrendingFeed(ctx.cfg, { feed, feedDid })\n if (trendingIrisUrl) {\n return { endpoint: trendingIrisUrl, feedDid, trusted: true }\n }\n\n let identity: GetIdentityByDidResponse\n try {\n identity = await ctx.dataplane.getIdentityByDid({ did: feedDid })\n } catch (err) {\n if (isDataplaneError(err, Code.NotFound)) {\n throw new InvalidRequestError(`could not resolve identity: ${feedDid}`)\n }\n throw err\n }\n\n const services = unpackIdentityServices(identity.services)\n const fgEndpoint = getServiceEndpoint(services, {\n id: 'bsky_fg',\n type: 'BskyFeedGenerator',\n })\n if (!fgEndpoint) {\n throw new InvalidRequestError(\n `invalid feed generator service details in did document: ${feedDid}`,\n )\n }\n\n return { endpoint: fgEndpoint, feedDid, trusted: false }\n}\n\nasync function getFeedGenDid(\n ctx: Context,\n feed: Params['feed'],\n): Promise<DidString | undefined> {\n const found = await ctx.hydrator.feed.getFeedGens([feed], true)\n return found.get(feed)?.record.did\n}\n\nconst skeletonFromFeedGen = async (\n ctx: Context,\n params: Params,\n): Promise<AlgoResponse> => {\n const { headers, passthroughHeaders } = params\n const { endpoint, feedDid, trusted } = await resolveSkeletonEndpoint(\n ctx,\n params,\n )\n const requestHeaders = noUndefinedVals({\n ...headers,\n ...(feedDid && ctx.cfg.bskyFeedgenDids.has(feedDid)\n ? passthroughHeaders\n : {}),\n })\n\n // @TODO currently passthrough auth headers from pds\n // Configured endpoints (iris) are ours. The DID-document path is resolved from\n // another account's record, so only that one goes through the guarded fetch.\n const result = await xrpcSafe(\n trusted ? endpoint : { service: endpoint, fetch: ctx.federatedFetch },\n app.bsky.feed.getFeedSkeleton,\n {\n strictResponseProcessing: false,\n signal: AbortSignal.any([\n params.signal,\n AbortSignal.timeout(ctx.cfg.feedGenSkeletonTimeout),\n ]),\n headers: requestHeaders,\n params: {\n feed: params.feed,\n // The feedgen is not guaranteed to honor the limit, but we try it.\n limit: params.limit,\n cursor: params.cursor,\n },\n },\n )\n\n if (!result.success) {\n const cause = result.reason\n\n // Pass through structurally valid XRPC error response (4xx/5xx), such as\n // auth errors\n if (cause instanceof XrpcResponseError) {\n const { status, body } = cause.toDownstreamError()\n throw new XRPCError(status, body.message, body.error, { cause })\n }\n\n // The response does not match the schema\n if (cause instanceof XrpcInvalidResponseError) {\n throw new UpstreamFailureError(\n 'feed provided an invalid response',\n 'InvalidFeedResponse',\n { cause },\n )\n }\n\n // Typically a network error.\n throw new UpstreamFailureError('feed unavailable', undefined, { cause })\n }\n\n const { feed: feedSkele, cursor, ...skele } = result.body\n const feedItems = feedSkele.slice(0, params.limit).map((item) => ({\n post: { uri: item.post },\n repost:\n item.reason != null &&\n app.bsky.feed.defs.skeletonReasonRepost.$isTypeOf(item.reason)\n ? { uri: item.reason.repost }\n : undefined,\n authorPinned:\n item.reason != null &&\n app.bsky.feed.defs.skeletonReasonPin.$isTypeOf(item.reason)\n ? true\n : undefined,\n feedContext: item.feedContext,\n }))\n\n const contentLang = result.headers.get('content-language')\n\n return {\n ...skele,\n resHeaders: contentLang ? { 'content-language': contentLang } : undefined,\n feedItems,\n // An empty feed-generator page ends pagination even if it includes a cursor.\n // Also prevent loops if the custom feed echoes the input cursor back.\n cursor:\n feedSkele.length === 0 || cursor === params.cursor ? undefined : cursor,\n }\n}\n\nexport type AlgoResponse = {\n feedItems: AlgoResponseItem[]\n resHeaders?: HeadersMap\n cursor?: string\n reqId?: string\n}\n\nexport type AlgoResponseItem = FeedItem & {\n feedContext?: string\n}\n"]}
|
package/dist/context.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ export declare class AppContext {
|
|
|
39
39
|
authVerifier: AuthVerifier;
|
|
40
40
|
featureGatesClient: FeatureGatesClient;
|
|
41
41
|
blobDispatcher: Dispatcher;
|
|
42
|
+
federatedFetch: typeof globalThis.fetch;
|
|
42
43
|
kwsClient: KwsClient | undefined;
|
|
43
44
|
});
|
|
44
45
|
get cfg(): ServerConfig;
|
|
@@ -61,6 +62,7 @@ export declare class AppContext {
|
|
|
61
62
|
get authVerifier(): AuthVerifier;
|
|
62
63
|
get featureGatesClient(): FeatureGatesClient;
|
|
63
64
|
get blobDispatcher(): Dispatcher;
|
|
65
|
+
get federatedFetch(): typeof globalThis.fetch;
|
|
64
66
|
get kwsClient(): KwsClient | undefined;
|
|
65
67
|
reqLabelers(req: express.Request): ParsedLabelers;
|
|
66
68
|
}
|
package/dist/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-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EhC;IAED,IAAI,YAAY,IAAI,MAAM,GAAG,SAAS,CAErC;IAED,IAAI,iBAAiB,IAAI,MAAM,GAAG,SAAS,CAE1C;IAED,IAAI,YAAY,IAAI,MAAM,GAAG,SAAS,CAErC;IAED,IAAI,UAAU,IAAI,MAAM,GAAG,SAAS,CAEnC;IAED,IAAI,QAAQ,IAAI,QAAQ,CAEvB;IAED,IAAI,KAAK,IAAI,KAAK,CAEjB;IAED,IAAI,UAAU,IAAI,OAAO,CAExB;IAED,IAAI,SAAS,IAAI,GAAG,CAAC,MAAM,CAE1B;IAED,IAAI,UAAU,IAAI,UAAU,CAE3B;IAED,IAAI,WAAW,IAAI,WAAW,CAE7B;IAED,IAAI,WAAW,IAAI,WAAW,CAE7B;IAED,IAAI,aAAa,IAAI,aAAa,GAAG,SAAS,CAE7C;IAED,IAAI,aAAa,IAAI,aAAa,GAAG,SAAS,CAE7C;IAED,IAAI,YAAY,IAAI,YAAY,CAE/B;IAED,IAAI,kBAAkB,IAAI,kBAAkB,CAE3C;IAED,IAAI,cAAc,IAAI,UAAU,CAE/B;IAED,IAAI,cAAc,IAAI,OAAO,UAAU,CAAC,KAAK,CAE5C;IAED,IAAI,SAAS,IAAI,SAAS,GAAG,SAAS,CAErC;IAED,WAAW,CAAC,GAAG,EAAE,OAAO,CAAC,OAAO,GAAG,cAAc,CAWhD;CACF"}
|
package/dist/context.js
CHANGED
package/dist/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AAenC,OAAO,EAAE,UAAU,IAAI,GAAG,EAAE,MAAM,aAAa,CAAA;AAG/C,OAAO,EAEL,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,WAAW,CAAA;AAGlB,MAAM,OAAO,UAAU;IACrB,YACU,
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.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O,MAAM,CAAA;IACf,CAAC;CACF","sourcesContent":["import * as plc from '@did-plc/lib'\nimport type { Etcd3 } from 'etcd3'\nimport type express from 'express'\nimport type { Dispatcher } from 'undici'\nimport type { Keypair } from '@atproto/crypto'\nimport type { IdResolver } from '@atproto/identity'\nimport type { Client } from '@atproto/lex'\nimport type { AuthVerifier } from './auth-verifier.js'\nimport type { BsyncClient } from './bsync.js'\nimport type { ServerConfig } from './config.js'\nimport type { CourierClient } from './courier.js'\nimport type { DataPlaneClient, HostList } from './data-plane/client/index.js'\nimport type { FeatureGatesClient } from './feature-gates/index.js'\nimport type { Hydrator } from './hydration/hydrator.js'\nimport type { KwsClient } from './kws.js'\nimport { httpLogger as log } from './logger.js'\nimport type { RolodexClient } from './rolodex.js'\nimport type { StashClient } from './stash.js'\nimport {\n type ParsedLabelers,\n defaultLabelerHeader,\n parseLabelerHeader,\n} from './util.js'\nimport type { Views } from './views/index.js'\n\nexport class AppContext {\n constructor(\n private opts: {\n cfg: ServerConfig\n etcd: Etcd3 | undefined\n dataplane: DataPlaneClient\n dataplaneHostList: HostList\n searchClient: Client | undefined\n suggestionsClient: Client | undefined\n topicsClient: Client | undefined\n irisClient: Client | undefined\n hydrator: Hydrator\n views: Views\n signingKey: Keypair\n idResolver: IdResolver\n bsyncClient: BsyncClient\n stashClient: StashClient\n courierClient: CourierClient | undefined\n rolodexClient: RolodexClient | undefined\n authVerifier: AuthVerifier\n featureGatesClient: FeatureGatesClient\n blobDispatcher: Dispatcher\n federatedFetch: typeof globalThis.fetch\n kwsClient: KwsClient | undefined\n },\n ) {}\n\n get cfg(): ServerConfig {\n return this.opts.cfg\n }\n\n get etcd() {\n return this.opts.etcd\n }\n\n get dataplane(): DataPlaneClient {\n return this.opts.dataplane\n }\n\n get dataplaneHostList(): HostList {\n return this.opts.dataplaneHostList\n }\n\n get searchClient(): Client | undefined {\n return this.opts.searchClient\n }\n\n get suggestionsClient(): Client | undefined {\n return this.opts.suggestionsClient\n }\n\n get topicsClient(): Client | undefined {\n return this.opts.topicsClient\n }\n\n get irisClient(): Client | undefined {\n return this.opts.irisClient\n }\n\n get hydrator(): Hydrator {\n return this.opts.hydrator\n }\n\n get views(): Views {\n return this.opts.views\n }\n\n get signingKey(): Keypair {\n return this.opts.signingKey\n }\n\n get plcClient(): plc.Client {\n return new plc.Client(this.cfg.didPlcUrl)\n }\n\n get idResolver(): IdResolver {\n return this.opts.idResolver\n }\n\n get bsyncClient(): BsyncClient {\n return this.opts.bsyncClient\n }\n\n get stashClient(): StashClient {\n return this.opts.stashClient\n }\n\n get courierClient(): CourierClient | undefined {\n return this.opts.courierClient\n }\n\n get rolodexClient(): RolodexClient | undefined {\n return this.opts.rolodexClient\n }\n\n get authVerifier(): AuthVerifier {\n return this.opts.authVerifier\n }\n\n get featureGatesClient(): FeatureGatesClient {\n return this.opts.featureGatesClient\n }\n\n get blobDispatcher(): Dispatcher {\n return this.opts.blobDispatcher\n }\n\n get federatedFetch(): typeof globalThis.fetch {\n return this.opts.federatedFetch\n }\n\n get kwsClient(): KwsClient | undefined {\n return this.opts.kwsClient\n }\n\n reqLabelers(req: express.Request): ParsedLabelers {\n const val = req.header('atproto-accept-labelers')\n let parsed: ParsedLabelers | null\n try {\n parsed = parseLabelerHeader(val)\n } catch (err) {\n parsed = null\n log.info({ err, val }, 'failed to parse labeler header')\n }\n if (!parsed) return defaultLabelerHeader(this.cfg.labelsFromIssuerDids)\n return parsed\n }\n}\n"]}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAKjC,OAAO,OAAO,MAAM,SAAS,CAAA;AAG7B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA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CAAC,YAAY,CAAC,kBAE1B;CACF;eAEc,WAAW"}
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,7 @@ import { DAY, SECOND } from '@atproto/common';
|
|
|
8
8
|
import { IdResolver } from '@atproto/identity';
|
|
9
9
|
import { Client } from '@atproto/lex';
|
|
10
10
|
import { createServer } from '@atproto/xrpc-server';
|
|
11
|
+
import { safeFetchWrap } from '@atproto-labs/fetch-node';
|
|
11
12
|
import { createBlobDispatcher } from './api/blob-dispatcher.js';
|
|
12
13
|
import API, { blobResolver, external, health, sitemap, wellKnown, } from './api/index.js';
|
|
13
14
|
import { AuthVerifier, createPublicKeyObject } from './auth-verifier.js';
|
|
@@ -189,6 +190,17 @@ export class BskyAppView {
|
|
|
189
190
|
bffJwtSecret,
|
|
190
191
|
});
|
|
191
192
|
const blobDispatcher = createBlobDispatcher(config);
|
|
193
|
+
// Egress to hosts named in DID documents, where the destination is chosen by
|
|
194
|
+
// the account being resolved. Same policy as blobDispatcher: https only,
|
|
195
|
+
// unicast addresses only, re-checked per hop by the dispatcher. Redirects
|
|
196
|
+
// stay enabled because xrpcRequestInit sets `redirect: 'follow'`.
|
|
197
|
+
const federatedFetch = (config.disableSsrfProtection
|
|
198
|
+
? globalThis.fetch
|
|
199
|
+
: safeFetchWrap({
|
|
200
|
+
allowIpHost: false,
|
|
201
|
+
allowImplicitRedirect: true,
|
|
202
|
+
responseMaxSize: 5 * 1024 * 1024,
|
|
203
|
+
}));
|
|
192
204
|
const ctx = new AppContext({
|
|
193
205
|
cfg: config,
|
|
194
206
|
etcd,
|
|
@@ -209,6 +221,7 @@ export class BskyAppView {
|
|
|
209
221
|
authVerifier,
|
|
210
222
|
featureGatesClient,
|
|
211
223
|
blobDispatcher,
|
|
224
|
+
federatedFetch,
|
|
212
225
|
kwsClient,
|
|
213
226
|
});
|
|
214
227
|
const server = createServer([], {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRo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YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC;QACzB,MAAM,IAAI,CAAC,OAAO,EAAE,CAAA;IACtB,CAAC;CACF;AAED,eAAe,WAAW,CAAA","sourcesContent":["import events from 'node:events'\nimport type http from 'node:http'\nimport type { AddressInfo } from 'node:net'\nimport compression from 'compression'\nimport cors from 'cors'\nimport { Etcd3 } from 'etcd3'\nimport express from 'express'\nimport { type HttpTerminator, createHttpTerminator } from 'http-terminator'\nimport { DAY, SECOND } from '@atproto/common'\nimport type { Keypair } from '@atproto/crypto'\nimport { IdResolver } from '@atproto/identity'\nimport { Client } from '@atproto/lex'\nimport { createServer } from '@atproto/xrpc-server'\nimport { createBlobDispatcher } from './api/blob-dispatcher.js'\nimport API, {\n blobResolver,\n external,\n health,\n sitemap,\n wellKnown,\n} from './api/index.js'\nimport { AuthVerifier, createPublicKeyObject } from './auth-verifier.js'\nimport { authWithApiKey as bsyncAuth, createBsyncClient } from './bsync.js'\nimport type { ServerConfig } from './config.js'\nimport { AppContext } from './context.js'\nimport {\n authWithApiKey as courierAuth,\n createCourierClient,\n} from './courier.js'\nimport {\n BasicHostList,\n EtcdHostList,\n createDataPlaneClient,\n} from './data-plane/client/index.js'\nimport * as error from './error.js'\nimport { FeatureGatesClient } from './feature-gates/index.js'\nimport { Hydrator } from './hydration/hydrator.js'\nimport * as imageServer from './image/server.js'\nimport { ImageUriBuilder } from './image/uri.js'\nimport { createKwsClient } from './kws.js'\nimport { loggerMiddleware } from './logger.js'\nimport {\n authWithApiKey as rolodexAuth,\n createRolodexClient,\n} from './rolodex.js'\nimport { createStashClient } from './stash.js'\nimport {\n type UndiciAgent,\n createUndiciAgent,\n dispatcherFetch,\n} from './undici.js'\nimport { Views } from './views/index.js'\nimport { VideoUriBuilder } from './views/util.js'\n\nexport { ServerConfig } from './config.js'\nexport type { ServerConfigValues } from './config.js'\nexport { AppContext } from './context.js'\nexport * from './data-plane/index.js'\nexport { BackgroundQueue } from './data-plane/server/background.js'\nexport { Database } from './data-plane/server/db/index.js'\nexport { Redis } from './redis.js'\n\nexport class BskyAppView {\n public ctx: AppContext\n public app: express.Application\n public server?: http.Server\n private terminator?: HttpTerminator\n private dispatchers: UndiciAgent[]\n\n constructor(opts: {\n ctx: AppContext\n app: express.Application\n dispatchers?: UndiciAgent[]\n }) {\n this.ctx = opts.ctx\n this.app = opts.app\n this.dispatchers = opts.dispatchers ?? []\n }\n\n static create(opts: {\n config: ServerConfig\n signingKey: Keypair\n }): BskyAppView {\n const { config, signingKey } = opts\n const app = express()\n app.set('trust proxy', true)\n app.use(cors({ maxAge: DAY / SECOND }))\n app.use(loggerMiddleware)\n app.use(compression())\n\n // used solely for handle resolution: identity lookups occur on dataplane\n const idResolver = new IdResolver({\n plcUrl: config.didPlcUrl,\n backupNameservers: config.handleResolveNameservers,\n fetch: config.disableSsrfProtection ? globalThis.fetch : undefined,\n })\n\n const imgUriBuilderUrl =\n config.cdnUrl ||\n (config.publicUrl ? `${config.publicUrl}/img` : undefined)\n if (!imgUriBuilderUrl) {\n throw new Error('No image URI builder URL could be determined')\n }\n const imgUriBuilder = new ImageUriBuilder(imgUriBuilderUrl)\n const videoUriBuilder = new VideoUriBuilder({\n playlistUrlPattern:\n config.videoPlaylistUrlPattern ||\n `${config.publicUrl}/vid/%s/%s/playlist.m3u8`,\n thumbnailUrlPattern:\n config.videoThumbnailUrlPattern ||\n `${config.publicUrl}/vid/%s/%s/thumbnail.jpg`,\n })\n\n const searchClient = config.searchUrl\n ? new Client(\n {\n service: config.searchUrl,\n },\n {\n // Trust internal services to send us well-formed responses\n strictResponseProcessing: false,\n validateResponse: config.debugMode,\n },\n )\n : undefined\n\n const suggestionsClient = config.suggestionsUrl\n ? new Client(\n {\n service: config.suggestionsUrl,\n headers: config.suggestionsApiKey\n ? { authorization: `Bearer ${config.suggestionsApiKey}` }\n : undefined,\n },\n {\n // Trust internal services to send us well-formed responses\n strictResponseProcessing: false,\n validateResponse: config.debugMode,\n },\n )\n : undefined\n\n // @NOTE These bound the connection phase (TCP + TLS) only; once connected,\n // the request is not bounded here. They are kept for the lifetime of the\n // service (pooling connections), and closed on `destroy()`.\n // An unused agent holds no socket, so they can be built unconditionally.\n const topicsDispatcher = createUndiciAgent({ connectTimeout: SECOND })\n const irisDispatcher = createUndiciAgent({ connectTimeout: SECOND })\n\n const topicsClient = config.topicsUrl\n ? new Client(\n {\n service: config.topicsUrl,\n headers: config.topicsApiKey\n ? { authorization: `Bearer ${config.topicsApiKey}` }\n : undefined,\n fetch: dispatcherFetch(topicsDispatcher),\n },\n {\n // Trust internal services to send us well-formed responses\n strictResponseProcessing: false,\n validateResponse: config.debugMode,\n },\n )\n : undefined\n\n const irisClient = config.irisUrl\n ? new Client(\n {\n service: config.irisUrl,\n headers: config.irisApiKey\n ? { authorization: `Bearer ${config.irisApiKey}` }\n : undefined,\n fetch: dispatcherFetch(irisDispatcher),\n },\n {\n // Trust internal services to send us well-formed responses\n strictResponseProcessing: false,\n validateResponse: config.debugMode,\n },\n )\n : undefined\n\n const etcd = config.etcdHosts.length\n ? new Etcd3({ hosts: config.etcdHosts })\n : undefined\n\n const dataplaneHostList =\n etcd && config.dataplaneUrlsEtcdKeyPrefix\n ? new EtcdHostList(\n etcd,\n config.dataplaneUrlsEtcdKeyPrefix,\n config.dataplaneUrls,\n )\n : new BasicHostList(config.dataplaneUrls)\n\n const featureGatesClient = new FeatureGatesClient({\n growthBookApiHost: config.growthBookApiHost,\n growthBookClientKey: config.growthBookClientKey,\n eventProxyTrackingEndpoint: config.eventProxyTrackingEndpoint,\n })\n\n const dataplane = createDataPlaneClient(dataplaneHostList, {\n httpVersion: config.dataplaneHttpVersion,\n rejectUnauthorized: !config.dataplaneIgnoreBadTls,\n })\n const hydrator = new Hydrator(dataplane, config.labelsFromIssuerDids, {\n debugFieldAllowedDids: config.debugFieldAllowedDids,\n featureGatesClient,\n needsReviewTagSources: [config.modServiceDid],\n })\n const views = new Views({\n imgUriBuilder: imgUriBuilder,\n videoUriBuilder: videoUriBuilder,\n indexedAtEpoch: config.indexedAtEpoch,\n threadTagsBumpDown: [...config.threadTagsBumpDown],\n threadTagsHide: [...config.threadTagsHide],\n visibilityTagHide: config.visibilityTagHide,\n visibilityTagRankPrefix: config.visibilityTagRankPrefix,\n })\n\n const bsyncClient = createBsyncClient({\n baseUrl: config.bsyncUrl,\n httpVersion: config.bsyncHttpVersion ?? '2',\n nodeOptions: { rejectUnauthorized: !config.bsyncIgnoreBadTls },\n interceptors: config.bsyncApiKey ? [bsyncAuth(config.bsyncApiKey)] : [],\n })\n\n const stashClient = createStashClient(bsyncClient)\n\n const courierClient = config.courierUrl\n ? createCourierClient({\n baseUrl: config.courierUrl,\n httpVersion: config.courierHttpVersion ?? '2',\n nodeOptions: { rejectUnauthorized: !config.courierIgnoreBadTls },\n interceptors: config.courierApiKey\n ? [courierAuth(config.courierApiKey)]\n : [],\n })\n : undefined\n\n const rolodexClient = config.rolodexUrl\n ? createRolodexClient({\n baseUrl: config.rolodexUrl,\n httpVersion: config.rolodexHttpVersion ?? '2',\n nodeOptions: { rejectUnauthorized: !config.rolodexIgnoreBadTls },\n interceptors: config.rolodexApiKey\n ? [rolodexAuth(config.rolodexApiKey)]\n : [],\n })\n : undefined\n\n const kwsClient = config.kws ? createKwsClient(config.kws) : undefined\n\n const entrywayJwtPublicKey = config.entrywayJwtPublicKeyHex\n ? createPublicKeyObject(config.entrywayJwtPublicKeyHex)\n : undefined\n const bffJwtSecret = config.bffJwtSecret\n ? Buffer.from(config.bffJwtSecret, 'utf8')\n : undefined\n const authVerifier = new AuthVerifier(dataplane, {\n ownDid: config.serverDid,\n alternateAudienceDids: config.alternateAudienceDids,\n modServiceDid: config.modServiceDid,\n adminPasses: config.adminPasswords,\n entrywayJwtPublicKey,\n bffJwtSecret,\n })\n\n const blobDispatcher = createBlobDispatcher(config)\n\n const ctx = new AppContext({\n cfg: config,\n etcd,\n dataplane,\n dataplaneHostList,\n searchClient,\n suggestionsClient,\n topicsClient,\n irisClient,\n hydrator,\n views,\n signingKey,\n idResolver,\n bsyncClient,\n stashClient,\n courierClient,\n rolodexClient,\n authVerifier,\n featureGatesClient,\n blobDispatcher,\n kwsClient,\n })\n\n const server = createServer([], {\n validateResponse: config.debugMode,\n payload: {\n jsonLimit: 100 * 1024, // 100kb\n textLimit: 100 * 1024, // 100kb\n blobLimit: 5 * 1024 * 1024, // 5mb\n },\n })\n\n API(server, ctx)\n\n app.use(health.createRouter(ctx))\n app.use(wellKnown.createRouter(ctx))\n app.use(blobResolver.createMiddleware(ctx))\n app.use(imageServer.createMiddleware(ctx, { prefix: '/img/' }))\n\n if (config.dataplaneUrls.length > 0 || config.dataplaneUrlsEtcdKeyPrefix) {\n app.use(sitemap.createRouter(ctx))\n }\n\n app.use(server.router)\n app.use(error.handler)\n app.use('/external', external.createRouter(ctx))\n\n return new BskyAppView({\n ctx,\n app,\n dispatchers: [topicsDispatcher, irisDispatcher],\n })\n }\n\n async start(): Promise<http.Server> {\n if (this.ctx.dataplaneHostList instanceof EtcdHostList) {\n await this.ctx.dataplaneHostList.connect()\n }\n this.ctx.featureGatesClient.start() // lazy, no await\n const server = this.app.listen(this.ctx.cfg.port)\n this.server = server\n server.keepAliveTimeout = 90000\n this.terminator = createHttpTerminator({ server })\n await events.once(server, 'listening')\n const { port } = server.address() as AddressInfo\n this.ctx.cfg.assignPort(port)\n return server\n }\n\n async destroy(): Promise<void> {\n try {\n await this.ctx.featureGatesClient.destroy()\n } finally {\n try {\n await this.terminator?.terminate()\n } finally {\n try {\n await this.ctx.etcd?.close()\n } finally {\n await Promise.all(this.dispatchers.map((d) => d.close()))\n }\n }\n }\n }\n\n async [Symbol.asyncDispose]() {\n await this.destroy()\n }\n}\n\nexport default BskyAppView\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAGhC,OAAO,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oBAAS,CAAC;gBACT,IAAI,CAAC;oBACH,MAAM,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,CAAA;gBAC9B,CAAC;wBAAS,CAAC;oBACT,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;gBAC3D,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC;QACzB,MAAM,IAAI,CAAC,OAAO,EAAE,CAAA;IACtB,CAAC;CACF;AAED,eAAe,WAAW,CAAA","sourcesContent":["import events from 'node:events'\nimport type http from 'node:http'\nimport type { AddressInfo } from 'node:net'\nimport compression from 'compression'\nimport cors from 'cors'\nimport { Etcd3 } from 'etcd3'\nimport express from 'express'\nimport { type HttpTerminator, createHttpTerminator } from 'http-terminator'\nimport { DAY, SECOND } from '@atproto/common'\nimport type { Keypair } from '@atproto/crypto'\nimport { IdResolver } from '@atproto/identity'\nimport { Client } from '@atproto/lex'\nimport { createServer } from '@atproto/xrpc-server'\nimport { safeFetchWrap } from '@atproto-labs/fetch-node'\nimport { createBlobDispatcher } from './api/blob-dispatcher.js'\nimport API, {\n blobResolver,\n external,\n health,\n sitemap,\n wellKnown,\n} from './api/index.js'\nimport { AuthVerifier, createPublicKeyObject } from './auth-verifier.js'\nimport { authWithApiKey as bsyncAuth, createBsyncClient } from './bsync.js'\nimport type { ServerConfig } from './config.js'\nimport { AppContext } from './context.js'\nimport {\n authWithApiKey as courierAuth,\n createCourierClient,\n} from './courier.js'\nimport {\n BasicHostList,\n EtcdHostList,\n createDataPlaneClient,\n} from './data-plane/client/index.js'\nimport * as error from './error.js'\nimport { FeatureGatesClient } from './feature-gates/index.js'\nimport { Hydrator } from './hydration/hydrator.js'\nimport * as imageServer from './image/server.js'\nimport { ImageUriBuilder } from './image/uri.js'\nimport { createKwsClient } from './kws.js'\nimport { loggerMiddleware } from './logger.js'\nimport {\n authWithApiKey as rolodexAuth,\n createRolodexClient,\n} from './rolodex.js'\nimport { createStashClient } from './stash.js'\nimport {\n type UndiciAgent,\n createUndiciAgent,\n dispatcherFetch,\n} from './undici.js'\nimport { Views } from './views/index.js'\nimport { VideoUriBuilder } from './views/util.js'\n\nexport { ServerConfig } from './config.js'\nexport type { ServerConfigValues } from './config.js'\nexport { AppContext } from './context.js'\nexport * from './data-plane/index.js'\nexport { BackgroundQueue } from './data-plane/server/background.js'\nexport { Database } from './data-plane/server/db/index.js'\nexport { Redis } from './redis.js'\n\nexport class BskyAppView {\n public ctx: AppContext\n public app: express.Application\n public server?: http.Server\n private terminator?: HttpTerminator\n private dispatchers: UndiciAgent[]\n\n constructor(opts: {\n ctx: AppContext\n app: express.Application\n dispatchers?: UndiciAgent[]\n }) {\n this.ctx = opts.ctx\n this.app = opts.app\n this.dispatchers = opts.dispatchers ?? []\n }\n\n static create(opts: {\n config: ServerConfig\n signingKey: Keypair\n }): BskyAppView {\n const { config, signingKey } = opts\n const app = express()\n app.set('trust proxy', true)\n app.use(cors({ maxAge: DAY / SECOND }))\n app.use(loggerMiddleware)\n app.use(compression())\n\n // used solely for handle resolution: identity lookups occur on dataplane\n const idResolver = new IdResolver({\n plcUrl: config.didPlcUrl,\n backupNameservers: config.handleResolveNameservers,\n fetch: config.disableSsrfProtection ? globalThis.fetch : undefined,\n })\n\n const imgUriBuilderUrl =\n config.cdnUrl ||\n (config.publicUrl ? `${config.publicUrl}/img` : undefined)\n if (!imgUriBuilderUrl) {\n throw new Error('No image URI builder URL could be determined')\n }\n const imgUriBuilder = new ImageUriBuilder(imgUriBuilderUrl)\n const videoUriBuilder = new VideoUriBuilder({\n playlistUrlPattern:\n config.videoPlaylistUrlPattern ||\n `${config.publicUrl}/vid/%s/%s/playlist.m3u8`,\n thumbnailUrlPattern:\n config.videoThumbnailUrlPattern ||\n `${config.publicUrl}/vid/%s/%s/thumbnail.jpg`,\n })\n\n const searchClient = config.searchUrl\n ? new Client(\n {\n service: config.searchUrl,\n },\n {\n // Trust internal services to send us well-formed responses\n strictResponseProcessing: false,\n validateResponse: config.debugMode,\n },\n )\n : undefined\n\n const suggestionsClient = config.suggestionsUrl\n ? new Client(\n {\n service: config.suggestionsUrl,\n headers: config.suggestionsApiKey\n ? { authorization: `Bearer ${config.suggestionsApiKey}` }\n : undefined,\n },\n {\n // Trust internal services to send us well-formed responses\n strictResponseProcessing: false,\n validateResponse: config.debugMode,\n },\n )\n : undefined\n\n // @NOTE These bound the connection phase (TCP + TLS) only; once connected,\n // the request is not bounded here. They are kept for the lifetime of the\n // service (pooling connections), and closed on `destroy()`.\n // An unused agent holds no socket, so they can be built unconditionally.\n const topicsDispatcher = createUndiciAgent({ connectTimeout: SECOND })\n const irisDispatcher = createUndiciAgent({ connectTimeout: SECOND })\n\n const topicsClient = config.topicsUrl\n ? new Client(\n {\n service: config.topicsUrl,\n headers: config.topicsApiKey\n ? { authorization: `Bearer ${config.topicsApiKey}` }\n : undefined,\n fetch: dispatcherFetch(topicsDispatcher),\n },\n {\n // Trust internal services to send us well-formed responses\n strictResponseProcessing: false,\n validateResponse: config.debugMode,\n },\n )\n : undefined\n\n const irisClient = config.irisUrl\n ? new Client(\n {\n service: config.irisUrl,\n headers: config.irisApiKey\n ? { authorization: `Bearer ${config.irisApiKey}` }\n : undefined,\n fetch: dispatcherFetch(irisDispatcher),\n },\n {\n // Trust internal services to send us well-formed responses\n strictResponseProcessing: false,\n validateResponse: config.debugMode,\n },\n )\n : undefined\n\n const etcd = config.etcdHosts.length\n ? new Etcd3({ hosts: config.etcdHosts })\n : undefined\n\n const dataplaneHostList =\n etcd && config.dataplaneUrlsEtcdKeyPrefix\n ? new EtcdHostList(\n etcd,\n config.dataplaneUrlsEtcdKeyPrefix,\n config.dataplaneUrls,\n )\n : new BasicHostList(config.dataplaneUrls)\n\n const featureGatesClient = new FeatureGatesClient({\n growthBookApiHost: config.growthBookApiHost,\n growthBookClientKey: config.growthBookClientKey,\n eventProxyTrackingEndpoint: config.eventProxyTrackingEndpoint,\n })\n\n const dataplane = createDataPlaneClient(dataplaneHostList, {\n httpVersion: config.dataplaneHttpVersion,\n rejectUnauthorized: !config.dataplaneIgnoreBadTls,\n })\n const hydrator = new Hydrator(dataplane, config.labelsFromIssuerDids, {\n debugFieldAllowedDids: config.debugFieldAllowedDids,\n featureGatesClient,\n needsReviewTagSources: [config.modServiceDid],\n })\n const views = new Views({\n imgUriBuilder: imgUriBuilder,\n videoUriBuilder: videoUriBuilder,\n indexedAtEpoch: config.indexedAtEpoch,\n threadTagsBumpDown: [...config.threadTagsBumpDown],\n threadTagsHide: [...config.threadTagsHide],\n visibilityTagHide: config.visibilityTagHide,\n visibilityTagRankPrefix: config.visibilityTagRankPrefix,\n })\n\n const bsyncClient = createBsyncClient({\n baseUrl: config.bsyncUrl,\n httpVersion: config.bsyncHttpVersion ?? '2',\n nodeOptions: { rejectUnauthorized: !config.bsyncIgnoreBadTls },\n interceptors: config.bsyncApiKey ? [bsyncAuth(config.bsyncApiKey)] : [],\n })\n\n const stashClient = createStashClient(bsyncClient)\n\n const courierClient = config.courierUrl\n ? createCourierClient({\n baseUrl: config.courierUrl,\n httpVersion: config.courierHttpVersion ?? '2',\n nodeOptions: { rejectUnauthorized: !config.courierIgnoreBadTls },\n interceptors: config.courierApiKey\n ? [courierAuth(config.courierApiKey)]\n : [],\n })\n : undefined\n\n const rolodexClient = config.rolodexUrl\n ? createRolodexClient({\n baseUrl: config.rolodexUrl,\n httpVersion: config.rolodexHttpVersion ?? '2',\n nodeOptions: { rejectUnauthorized: !config.rolodexIgnoreBadTls },\n interceptors: config.rolodexApiKey\n ? [rolodexAuth(config.rolodexApiKey)]\n : [],\n })\n : undefined\n\n const kwsClient = config.kws ? createKwsClient(config.kws) : undefined\n\n const entrywayJwtPublicKey = config.entrywayJwtPublicKeyHex\n ? createPublicKeyObject(config.entrywayJwtPublicKeyHex)\n : undefined\n const bffJwtSecret = config.bffJwtSecret\n ? Buffer.from(config.bffJwtSecret, 'utf8')\n : undefined\n const authVerifier = new AuthVerifier(dataplane, {\n ownDid: config.serverDid,\n alternateAudienceDids: config.alternateAudienceDids,\n modServiceDid: config.modServiceDid,\n adminPasses: config.adminPasswords,\n entrywayJwtPublicKey,\n bffJwtSecret,\n })\n\n const blobDispatcher = createBlobDispatcher(config)\n // Egress to hosts named in DID documents, where the destination is chosen by\n // the account being resolved. Same policy as blobDispatcher: https only,\n // unicast addresses only, re-checked per hop by the dispatcher. Redirects\n // stay enabled because xrpcRequestInit sets `redirect: 'follow'`.\n const federatedFetch = (\n config.disableSsrfProtection\n ? globalThis.fetch\n : safeFetchWrap({\n allowIpHost: false,\n allowImplicitRedirect: true,\n responseMaxSize: 5 * 1024 * 1024,\n })\n ) as typeof globalThis.fetch\n\n const ctx = new AppContext({\n cfg: config,\n etcd,\n dataplane,\n dataplaneHostList,\n searchClient,\n suggestionsClient,\n topicsClient,\n irisClient,\n hydrator,\n views,\n signingKey,\n idResolver,\n bsyncClient,\n stashClient,\n courierClient,\n rolodexClient,\n authVerifier,\n featureGatesClient,\n blobDispatcher,\n federatedFetch,\n kwsClient,\n })\n\n const server = createServer([], {\n validateResponse: config.debugMode,\n payload: {\n jsonLimit: 100 * 1024, // 100kb\n textLimit: 100 * 1024, // 100kb\n blobLimit: 5 * 1024 * 1024, // 5mb\n },\n })\n\n API(server, ctx)\n\n app.use(health.createRouter(ctx))\n app.use(wellKnown.createRouter(ctx))\n app.use(blobResolver.createMiddleware(ctx))\n app.use(imageServer.createMiddleware(ctx, { prefix: '/img/' }))\n\n if (config.dataplaneUrls.length > 0 || config.dataplaneUrlsEtcdKeyPrefix) {\n app.use(sitemap.createRouter(ctx))\n }\n\n app.use(server.router)\n app.use(error.handler)\n app.use('/external', external.createRouter(ctx))\n\n return new BskyAppView({\n ctx,\n app,\n dispatchers: [topicsDispatcher, irisDispatcher],\n })\n }\n\n async start(): Promise<http.Server> {\n if (this.ctx.dataplaneHostList instanceof EtcdHostList) {\n await this.ctx.dataplaneHostList.connect()\n }\n this.ctx.featureGatesClient.start() // lazy, no await\n const server = this.app.listen(this.ctx.cfg.port)\n this.server = server\n server.keepAliveTimeout = 90000\n this.terminator = createHttpTerminator({ server })\n await events.once(server, 'listening')\n const { port } = server.address() as AddressInfo\n this.ctx.cfg.assignPort(port)\n return server\n }\n\n async destroy(): Promise<void> {\n try {\n await this.ctx.featureGatesClient.destroy()\n } finally {\n try {\n await this.terminator?.terminate()\n } finally {\n try {\n await this.ctx.etcd?.close()\n } finally {\n await Promise.all(this.dispatchers.map((d) => d.close()))\n }\n }\n }\n }\n\n async [Symbol.asyncDispose]() {\n await this.destroy()\n }\n}\n\nexport default BskyAppView\n"]}
|
|
@@ -62,6 +62,10 @@ type ReportAction = {
|
|
|
62
62
|
* Note to send to reporter(s) when actioning their report
|
|
63
63
|
*/
|
|
64
64
|
"note"?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Set true when the report activities are created by an automated process.
|
|
67
|
+
*/
|
|
68
|
+
"isAutomated"?: boolean;
|
|
65
69
|
};
|
|
66
70
|
export type { ReportAction };
|
|
67
71
|
/** Target specific reports when emitting a moderation event */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emitEvent.defs.d.ts","sourceRoot":"","sources":["../../../../../src/lexicons/tools/ozone/moderation/emitEvent.defs.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AACjC,OAAO,KAAK,cAAc,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,SAAS,MAAM,yCAAyC,CAAC;AACrE,OAAO,KAAK,aAAa,MAAM,6CAA6C,CAAC;AAE7E,QAAA,MAAM,KAAK,qCAAqC,CAAC;AAEjD,KAAK,KAAK,GAAG,OAAO,KAAK,CAAC;AAE1B,OAAO,EAAE,KAAK,EAAE,CAAC;AAEjB,eAAO,MAAM,OAAO,oBA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,EAAE,IAAI,EAAE,CAAC;AAEhB,QAAA,MAAM,IAAI,qCAAQ,CAAC;AAEnB,KAAK,IAAI,GAAG,OAAO,IAAI,CAAC;AAExB,OAAO,EAAE,IAAI,EAAE,CAAC;AAEhB,+DAA+D;AAC/D,KAAK,YAAY,GAAG;IAAE,KAAK,CAAC,EAAE,+CAA+C,CAAC;IAE5E;;OAEG;IACH,KAAK,CAAC,EAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IAElB;;OAEG;IACH,OAAO,CAAC,EAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IAEpB;;OAEG;IACH,KAAK,CAAC,EAAC,OAAO,CAAC;IAEf;;OAEG;IACH,MAAM,CAAC,EAAC,MAAM,CAAC;IAEf;;OAEG;IACH,aAAa,CAAC,EAAC,OAAO,CAAA;CAAE,CAAC;AAE3B,YAAY,EAAE,YAAY,EAAE,CAAC;AAE7B,+DAA+D;AAC/D,QAAA,MAAM,YAAY,+GAA2b,CAAC;AAE9c,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -16,6 +16,6 @@ export { main };
|
|
|
16
16
|
const $lxm = $nsid;
|
|
17
17
|
export { $lxm };
|
|
18
18
|
/** Target specific reports when emitting a moderation event */
|
|
19
|
-
const reportAction = /*#__PURE__*/ l.typedObject($nsid, "reportAction", /*#__PURE__*/ l.object({ "ids": /*#__PURE__*/ l.optional(/*#__PURE__*/ l.array(/*#__PURE__*/ l.integer())), "types": /*#__PURE__*/ l.optional(/*#__PURE__*/ l.array(/*#__PURE__*/ l.string())), "all": /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()), "note": /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()) }));
|
|
19
|
+
const reportAction = /*#__PURE__*/ l.typedObject($nsid, "reportAction", /*#__PURE__*/ l.object({ "ids": /*#__PURE__*/ l.optional(/*#__PURE__*/ l.array(/*#__PURE__*/ l.integer())), "types": /*#__PURE__*/ l.optional(/*#__PURE__*/ l.array(/*#__PURE__*/ l.string())), "all": /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()), "note": /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()), "isAutomated": /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()) }));
|
|
20
20
|
export { reportAction };
|
|
21
21
|
//# sourceMappingURL=emitEvent.defs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emitEvent.defs.js","sourceRoot":"","sources":["../../../../../src/lexicons/tools/ozone/moderation/emitEvent.defs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AACjC,OAAO,KAAK,cAAc,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,SAAS,MAAM,yCAAyC,CAAC;AACrE,OAAO,KAAK,aAAa,MAAM,6CAA6C,CAAC;AAE7E,MAAM,KAAK,GAAG,kCAAkC,CAAC;AAIjD,OAAO,EAAE,KAAK,EAAE,CAAC;AAEjB,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;AAIhD,MAAM,CAAC,MAAM,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC,EAAC,OAAO,EAAC,aAAa,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAkC,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,gBAAgB,CAAQ,CAAC,EAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAqC,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,mBAAmB,CAAQ,CAAC,EAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAkC,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,gBAAgB,CAAQ,CAAC,EAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAiC,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,eAAe,CAAQ,CAAC,EA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AAC,CAAC,MAAM,CAAC,EAAC,KAAK,EAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,EAAE,CAAG,CAAC,EAAC,OAAO,EAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,EAAE,CAAG,CAAC,EAAC,KAAK,EAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,EAAC,CAAC,CAAC,CAAC;AAE5Y,OAAO,EAAE,YAAY,EAAE,CAAC","sourcesContent":["/*\n * THIS FILE WAS GENERATED BY \"@atproto/lex\". DO NOT EDIT.\n */\n\nimport { l } from \"@atproto/lex\";\nimport * as ModerationDefs from \"./defs.defs.js\";\nimport * as AdminDefs from \"../../../com/atproto/admin/defs.defs.js\";\nimport * as RepoStrongRef from \"../../../com/atproto/repo/strongRef.defs.js\";\n\nconst $nsid = \"tools.ozone.moderation.emitEvent\";\n\ntype $nsid = typeof $nsid;\n\nexport { $nsid };\n\nexport const $params = /*#__PURE__*/ l.params();\n\nexport type $Params = l.InferOutput<typeof $params>;\n\nexport const $input = /*#__PURE__*/ l.jsonPayload({\"event\":/*#__PURE__*/ l.typedUnion([/*#__PURE__*/ l.typedRef<ModerationDefs.ModEventTakedown>((() => ModerationDefs.modEventTakedown) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.ModEventAcknowledge>((() => ModerationDefs.modEventAcknowledge) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.ModEventEscalate>((() => ModerationDefs.modEventEscalate) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.ModEventComment>((() => ModerationDefs.modEventComment) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.ModEventLabel>((() => ModerationDefs.modEventLabel) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.ModEventReport>((() => ModerationDefs.modEventReport) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.ModEventMute>((() => ModerationDefs.modEventMute) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.ModEventUnmute>((() => ModerationDefs.modEventUnmute) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.ModEventMuteReporter>((() => ModerationDefs.modEventMuteReporter) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.ModEventUnmuteReporter>((() => ModerationDefs.modEventUnmuteReporter) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.ModEventReverseTakedown>((() => ModerationDefs.modEventReverseTakedown) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.ModEventResolveAppeal>((() => ModerationDefs.modEventResolveAppeal) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.ModEventEmail>((() => ModerationDefs.modEventEmail) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.ModEventDivert>((() => ModerationDefs.modEventDivert) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.ModEventTag>((() => ModerationDefs.modEventTag) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.AccountEvent>((() => ModerationDefs.accountEvent) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.IdentityEvent>((() => ModerationDefs.identityEvent) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.RecordEvent>((() => ModerationDefs.recordEvent) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.ModEventPriorityScore>((() => ModerationDefs.modEventPriorityScore) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.AgeAssuranceEvent>((() => ModerationDefs.ageAssuranceEvent) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.AgeAssuranceOverrideEvent>((() => ModerationDefs.ageAssuranceOverrideEvent) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.AgeAssurancePurgeEvent>((() => ModerationDefs.ageAssurancePurgeEvent) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.RevokeAccountCredentialsEvent>((() => ModerationDefs.revokeAccountCredentialsEvent) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.ScheduleTakedownEvent>((() => ModerationDefs.scheduleTakedownEvent) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.CancelScheduledTakedownEvent>((() => ModerationDefs.cancelScheduledTakedownEvent) as any)], false),\"subject\":/*#__PURE__*/ l.typedUnion([/*#__PURE__*/ l.typedRef<AdminDefs.RepoRef>((() => AdminDefs.repoRef) as any),/*#__PURE__*/ l.typedRef<RepoStrongRef.Main>((() => RepoStrongRef.main) as any)], false),\"subjectBlobCids\":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.array(/*#__PURE__*/ l.string({\"format\":\"cid\"}), )),\"createdBy\":/*#__PURE__*/ l.string({\"format\":\"did\"}),\"modTool\":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.ref<ModerationDefs.ModTool>((() => ModerationDefs.modTool) as any)),\"externalId\":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()),\"reportAction\":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.ref<ReportAction>((() => reportAction) as any))});\n\nexport type $Input<B = l.BinaryData> = l.InferPayload<typeof $input, B>;\nexport type $InputBody<B = l.BinaryData> = l.InferPayloadBody<typeof $input, B>;\n\nexport const $output = /*#__PURE__*/ l.payload(\"application/json\", /*#__PURE__*/ l.ref<ModerationDefs.ModEventView>((() => ModerationDefs.modEventView) as any));\n\nexport type $Output<B = l.BinaryData> = l.InferPayload<typeof $output, B>;\nexport type $OutputBody<B = l.BinaryData> = l.InferPayloadBody<typeof $output, B>;\n\n/** Take a moderation action on an actor. */\nconst main = /*#__PURE__*/ l.procedure($nsid, $params, $input, $output, [\"SubjectHasAction\",\"DuplicateExternalId\"]);\n\nexport { main };\n\nconst $lxm = $nsid;\n\ntype $lxm = typeof $lxm;\n\nexport { $lxm };\n\n/** Target specific reports when emitting a moderation event */\ntype ReportAction = { $type?: \"tools.ozone.moderation.emitEvent#reportAction\";\n\n /**\n * Target specific report IDs\n */\n \"ids\"?:(number)[];\n\n /**\n * Target reports matching these report types on the subject (fully qualified NSIDs)\n */\n \"types\"?:(string)[];\n\n /**\n * Target ALL reports on the subject\n */\n \"all\"?:boolean;\n\n /**\n * Note to send to reporter(s) when actioning their report\n */\n \"note\"?:string };\n\nexport type { ReportAction };\n\n/** Target specific reports when emitting a moderation event */\nconst reportAction = /*#__PURE__*/ l.typedObject<ReportAction>($nsid, \"reportAction\", /*#__PURE__*/ l.object({\"ids\":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.array(/*#__PURE__*/ l.integer(), )),\"types\":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.array(/*#__PURE__*/ l.string(), )),\"all\":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()),\"note\":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.string())}));\n\nexport { reportAction };\n"]}
|
|
1
|
+
{"version":3,"file":"emitEvent.defs.js","sourceRoot":"","sources":["../../../../../src/lexicons/tools/ozone/moderation/emitEvent.defs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AACjC,OAAO,KAAK,cAAc,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,SAAS,MAAM,yCAAyC,CAAC;AACrE,OAAO,KAAK,aAAa,MAAM,6CAA6C,CAAC;AAE7E,MAAM,KAAK,GAAG,kCAAkC,CAAC;AAIjD,OAAO,EAAE,KAAK,EAAE,CAAC;AAEjB,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;AAIhD,MAAM,CAAC,MAAM,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC,EAAC,OAAO,EAAC,aAAa,CAAC,CAAC,CAAC,UAAU,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AAC,CAAC,CAAC;AAKjK,4CAA4C;AAC5C,MAAM,IAAI,GAAG,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,kBAAkB,EAAC,qBAAqB,CAAC,CAAC,CAAC;AAEpH,OAAO,EAAE,IAAI,EAAE,CAAC;AAEhB,MAAM,IAAI,GAAG,KAAK,CAAC;AAInB,OAAO,EAAE,IAAI,EAAE,CAAC;AAgChB,+DAA+D;AAC/D,MAAM,YAAY,GAAG,aAAa,CAAC,CAAC,CAAC,WAAW,CAAe,KAAK,EAAE,cAAc,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,EAAC,KAAK,EAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,EAAE,CAAG,CAAC,EAAC,OAAO,EAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,EAAE,CAAG,CAAC,EAAC,KAAK,EAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,EAAC,aAAa,EAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,EAAC,CAAC,CAAC,CAAC;AAE9c,OAAO,EAAE,YAAY,EAAE,CAAC","sourcesContent":["/*\n * THIS FILE WAS GENERATED BY \"@atproto/lex\". DO NOT EDIT.\n */\n\nimport { l } from \"@atproto/lex\";\nimport * as ModerationDefs from \"./defs.defs.js\";\nimport * as AdminDefs from \"../../../com/atproto/admin/defs.defs.js\";\nimport * as RepoStrongRef from \"../../../com/atproto/repo/strongRef.defs.js\";\n\nconst $nsid = \"tools.ozone.moderation.emitEvent\";\n\ntype $nsid = typeof $nsid;\n\nexport { $nsid };\n\nexport const $params = /*#__PURE__*/ l.params();\n\nexport type $Params = l.InferOutput<typeof $params>;\n\nexport const $input = /*#__PURE__*/ l.jsonPayload({\"event\":/*#__PURE__*/ l.typedUnion([/*#__PURE__*/ l.typedRef<ModerationDefs.ModEventTakedown>((() => ModerationDefs.modEventTakedown) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.ModEventAcknowledge>((() => ModerationDefs.modEventAcknowledge) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.ModEventEscalate>((() => ModerationDefs.modEventEscalate) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.ModEventComment>((() => ModerationDefs.modEventComment) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.ModEventLabel>((() => ModerationDefs.modEventLabel) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.ModEventReport>((() => ModerationDefs.modEventReport) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.ModEventMute>((() => ModerationDefs.modEventMute) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.ModEventUnmute>((() => ModerationDefs.modEventUnmute) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.ModEventMuteReporter>((() => ModerationDefs.modEventMuteReporter) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.ModEventUnmuteReporter>((() => ModerationDefs.modEventUnmuteReporter) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.ModEventReverseTakedown>((() => ModerationDefs.modEventReverseTakedown) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.ModEventResolveAppeal>((() => ModerationDefs.modEventResolveAppeal) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.ModEventEmail>((() => ModerationDefs.modEventEmail) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.ModEventDivert>((() => ModerationDefs.modEventDivert) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.ModEventTag>((() => ModerationDefs.modEventTag) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.AccountEvent>((() => ModerationDefs.accountEvent) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.IdentityEvent>((() => ModerationDefs.identityEvent) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.RecordEvent>((() => ModerationDefs.recordEvent) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.ModEventPriorityScore>((() => ModerationDefs.modEventPriorityScore) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.AgeAssuranceEvent>((() => ModerationDefs.ageAssuranceEvent) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.AgeAssuranceOverrideEvent>((() => ModerationDefs.ageAssuranceOverrideEvent) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.AgeAssurancePurgeEvent>((() => ModerationDefs.ageAssurancePurgeEvent) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.RevokeAccountCredentialsEvent>((() => ModerationDefs.revokeAccountCredentialsEvent) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.ScheduleTakedownEvent>((() => ModerationDefs.scheduleTakedownEvent) as any),/*#__PURE__*/ l.typedRef<ModerationDefs.CancelScheduledTakedownEvent>((() => ModerationDefs.cancelScheduledTakedownEvent) as any)], false),\"subject\":/*#__PURE__*/ l.typedUnion([/*#__PURE__*/ l.typedRef<AdminDefs.RepoRef>((() => AdminDefs.repoRef) as any),/*#__PURE__*/ l.typedRef<RepoStrongRef.Main>((() => RepoStrongRef.main) as any)], false),\"subjectBlobCids\":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.array(/*#__PURE__*/ l.string({\"format\":\"cid\"}), )),\"createdBy\":/*#__PURE__*/ l.string({\"format\":\"did\"}),\"modTool\":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.ref<ModerationDefs.ModTool>((() => ModerationDefs.modTool) as any)),\"externalId\":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()),\"reportAction\":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.ref<ReportAction>((() => reportAction) as any))});\n\nexport type $Input<B = l.BinaryData> = l.InferPayload<typeof $input, B>;\nexport type $InputBody<B = l.BinaryData> = l.InferPayloadBody<typeof $input, B>;\n\nexport const $output = /*#__PURE__*/ l.payload(\"application/json\", /*#__PURE__*/ l.ref<ModerationDefs.ModEventView>((() => ModerationDefs.modEventView) as any));\n\nexport type $Output<B = l.BinaryData> = l.InferPayload<typeof $output, B>;\nexport type $OutputBody<B = l.BinaryData> = l.InferPayloadBody<typeof $output, B>;\n\n/** Take a moderation action on an actor. */\nconst main = /*#__PURE__*/ l.procedure($nsid, $params, $input, $output, [\"SubjectHasAction\",\"DuplicateExternalId\"]);\n\nexport { main };\n\nconst $lxm = $nsid;\n\ntype $lxm = typeof $lxm;\n\nexport { $lxm };\n\n/** Target specific reports when emitting a moderation event */\ntype ReportAction = { $type?: \"tools.ozone.moderation.emitEvent#reportAction\";\n\n /**\n * Target specific report IDs\n */\n \"ids\"?:(number)[];\n\n /**\n * Target reports matching these report types on the subject (fully qualified NSIDs)\n */\n \"types\"?:(string)[];\n\n /**\n * Target ALL reports on the subject\n */\n \"all\"?:boolean;\n\n /**\n * Note to send to reporter(s) when actioning their report\n */\n \"note\"?:string;\n\n /**\n * Set true when the report activities are created by an automated process.\n */\n \"isAutomated\"?:boolean };\n\nexport type { ReportAction };\n\n/** Target specific reports when emitting a moderation event */\nconst reportAction = /*#__PURE__*/ l.typedObject<ReportAction>($nsid, \"reportAction\", /*#__PURE__*/ l.object({\"ids\":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.array(/*#__PURE__*/ l.integer(), )),\"types\":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.array(/*#__PURE__*/ l.string(), )),\"all\":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()),\"note\":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()),\"isAutomated\":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean())}));\n\nexport { reportAction };\n"]}
|
|
@@ -12,6 +12,7 @@ export declare const $input: l.Payload<"application/json", l.ObjectSchema<{
|
|
|
12
12
|
reportTypes: l.OptionalSchema<l.ArraySchema<l.StringSchema<{}>>>;
|
|
13
13
|
internalNote: l.OptionalSchema<l.StringSchema<{}>>;
|
|
14
14
|
isAutomated: l.OptionalSchema<l.WithDefaultSchema<l.BooleanSchema>>;
|
|
15
|
+
meta: l.OptionalSchema<l.LexMapSchema>;
|
|
15
16
|
}>>;
|
|
16
17
|
export type $Input<B = l.BinaryData> = l.InferPayload<typeof $input, B>;
|
|
17
18
|
export type $InputBody<B = l.BinaryData> = l.InferPayloadBody<typeof $input, B>;
|
|
@@ -30,6 +31,7 @@ declare const main: l.Procedure<"tools.ozone.report.closeReports", l.ParamsSchem
|
|
|
30
31
|
reportTypes: l.OptionalSchema<l.ArraySchema<l.StringSchema<{}>>>;
|
|
31
32
|
internalNote: l.OptionalSchema<l.StringSchema<{}>>;
|
|
32
33
|
isAutomated: l.OptionalSchema<l.WithDefaultSchema<l.BooleanSchema>>;
|
|
34
|
+
meta: l.OptionalSchema<l.LexMapSchema>;
|
|
33
35
|
}>>, l.Payload<"application/json", l.ObjectSchema<{
|
|
34
36
|
closedCount: l.IntegerSchema;
|
|
35
37
|
reportIds: l.ArraySchema<l.IntegerSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"closeReports.defs.d.ts","sourceRoot":"","sources":["../../../../../src/lexicons/tools/ozone/report/closeReports.defs.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAEjC,QAAA,MAAM,KAAK,oCAAoC,CAAC;AAEhD,KAAK,KAAK,GAAG,OAAO,KAAK,CAAC;AAE1B,OAAO,EAAE,KAAK,EAAE,CAAC;AAEjB,eAAO,MAAM,OAAO,oBAA2B,CAAC;AAEhD,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,WAAW,CAAC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C;AAExB,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { l } from "@atproto/lex";
|
|
|
5
5
|
const $nsid = "tools.ozone.report.closeReports";
|
|
6
6
|
export { $nsid };
|
|
7
7
|
export const $params = /*#__PURE__*/ l.params();
|
|
8
|
-
export const $input = /*#__PURE__*/ l.jsonPayload({ "subject": /*#__PURE__*/ l.string({ "format": "uri" }), "includeAllOwned": /*#__PURE__*/ l.optional(/*#__PURE__*/ l.withDefault(/*#__PURE__*/ l.boolean(), false)), "reportTypes": /*#__PURE__*/ l.optional(/*#__PURE__*/ l.array(/*#__PURE__*/ l.string())), "internalNote": /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()), "isAutomated": /*#__PURE__*/ l.optional(/*#__PURE__*/ l.withDefault(/*#__PURE__*/ l.boolean(), false)) });
|
|
8
|
+
export const $input = /*#__PURE__*/ l.jsonPayload({ "subject": /*#__PURE__*/ l.string({ "format": "uri" }), "includeAllOwned": /*#__PURE__*/ l.optional(/*#__PURE__*/ l.withDefault(/*#__PURE__*/ l.boolean(), false)), "reportTypes": /*#__PURE__*/ l.optional(/*#__PURE__*/ l.array(/*#__PURE__*/ l.string())), "internalNote": /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()), "isAutomated": /*#__PURE__*/ l.optional(/*#__PURE__*/ l.withDefault(/*#__PURE__*/ l.boolean(), false)), "meta": /*#__PURE__*/ l.optional(/*#__PURE__*/ l.lexMap()) });
|
|
9
9
|
export const $output = /*#__PURE__*/ l.jsonPayload({ "closedCount": /*#__PURE__*/ l.integer(), "reportIds": /*#__PURE__*/ l.array(/*#__PURE__*/ l.integer()) });
|
|
10
10
|
/** Close all reports on a subject matching the given criteria. Reports whose current status does not permit a transition to closed are skipped silently. Intended for automated flows that resolve reports without taking action on the subject. */
|
|
11
11
|
const main = /*#__PURE__*/ l.procedure($nsid, $params, $input, $output);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"closeReports.defs.js","sourceRoot":"","sources":["../../../../../src/lexicons/tools/ozone/report/closeReports.defs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAEjC,MAAM,KAAK,GAAG,iCAAiC,CAAC;AAIhD,OAAO,EAAE,KAAK,EAAE,CAAC;AAEjB,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;AAIhD,MAAM,CAAC,MAAM,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC,EAAC,SAAS,EAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,EAAC,QAAQ,EAAC,KAAK,EAAC,CAAC,EAAC,iBAAiB,EAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,CAAC,EAAC,aAAa,EAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,EAAE,CAAG,CAAC,EAAC,cAAc,EAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,EAAC,aAAa,EAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,CAAC,EAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"closeReports.defs.js","sourceRoot":"","sources":["../../../../../src/lexicons/tools/ozone/report/closeReports.defs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAEjC,MAAM,KAAK,GAAG,iCAAiC,CAAC;AAIhD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C,CAAC,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAExE,OAAO,EAAE,IAAI,EAAE,CAAC;AAEhB,MAAM,IAAI,GAAG,KAAK,CAAC;AAInB,OAAO,EAAE,IAAI,EAAE,CAAC","sourcesContent":["/*\n * THIS FILE WAS GENERATED BY \"@atproto/lex\". DO NOT EDIT.\n */\n\nimport { l } from \"@atproto/lex\";\n\nconst $nsid = \"tools.ozone.report.closeReports\";\n\ntype $nsid = typeof $nsid;\n\nexport { $nsid };\n\nexport const $params = /*#__PURE__*/ l.params();\n\nexport type $Params = l.InferOutput<typeof $params>;\n\nexport const $input = /*#__PURE__*/ l.jsonPayload({\"subject\":/*#__PURE__*/ l.string({\"format\":\"uri\"}),\"includeAllOwned\":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.withDefault(/*#__PURE__*/ l.boolean(), false)),\"reportTypes\":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.array(/*#__PURE__*/ l.string(), )),\"internalNote\":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()),\"isAutomated\":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.withDefault(/*#__PURE__*/ l.boolean(), false)),\"meta\":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.lexMap())});\n\nexport type $Input<B = l.BinaryData> = l.InferPayload<typeof $input, B>;\nexport type $InputBody<B = l.BinaryData> = l.InferPayloadBody<typeof $input, B>;\n\nexport const $output = /*#__PURE__*/ l.jsonPayload({\"closedCount\":/*#__PURE__*/ l.integer(),\"reportIds\":/*#__PURE__*/ l.array(/*#__PURE__*/ l.integer(), )});\n\nexport type $Output<B = l.BinaryData> = l.InferPayload<typeof $output, B>;\nexport type $OutputBody<B = l.BinaryData> = l.InferPayloadBody<typeof $output, B>;\n\n/** Close all reports on a subject matching the given criteria. Reports whose current status does not permit a transition to closed are skipped silently. Intended for automated flows that resolve reports without taking action on the subject. */\nconst main = /*#__PURE__*/ l.procedure($nsid, $params, $input, $output);\n\nexport { main };\n\nconst $lxm = $nsid;\n\ntype $lxm = typeof $lxm;\n\nexport { $lxm };\n"]}
|
|
@@ -12,6 +12,7 @@ export declare const $input: l.Payload<"application/json", l.ObjectSchema<{
|
|
|
12
12
|
internalNote: l.OptionalSchema<l.StringSchema<{}>>;
|
|
13
13
|
publicNote: l.OptionalSchema<l.StringSchema<{}>>;
|
|
14
14
|
isAutomated: l.OptionalSchema<l.WithDefaultSchema<l.BooleanSchema>>;
|
|
15
|
+
meta: l.OptionalSchema<l.LexMapSchema>;
|
|
15
16
|
}>>;
|
|
16
17
|
export type $Input<B = l.BinaryData> = l.InferPayload<typeof $input, B>;
|
|
17
18
|
export type $InputBody<B = l.BinaryData> = l.InferPayloadBody<typeof $input, B>;
|
|
@@ -28,6 +29,7 @@ declare const main: l.Procedure<"tools.ozone.report.createActivity", l.ParamsSch
|
|
|
28
29
|
internalNote: l.OptionalSchema<l.StringSchema<{}>>;
|
|
29
30
|
publicNote: l.OptionalSchema<l.StringSchema<{}>>;
|
|
30
31
|
isAutomated: l.OptionalSchema<l.WithDefaultSchema<l.BooleanSchema>>;
|
|
32
|
+
meta: l.OptionalSchema<l.LexMapSchema>;
|
|
31
33
|
}>>, l.Payload<"application/json", l.ObjectSchema<{
|
|
32
34
|
activity: l.RefSchema<l.Validator<ReportDefs.ReportActivityView, ReportDefs.ReportActivityView>>;
|
|
33
35
|
}>>, readonly ["ReportNotFound", "InvalidStateTransition", "AlreadyInTargetState"]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createActivity.defs.d.ts","sourceRoot":"","sources":["../../../../../src/lexicons/tools/ozone/report/createActivity.defs.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AACjC,OAAO,KAAK,UAAU,MAAM,gBAAgB,CAAC;AAE7C,QAAA,MAAM,KAAK,sCAAsC,CAAC;AAElD,KAAK,KAAK,GAAG,OAAO,KAAK,CA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wIAAwI;AACxI,QAAA,MAAM,IAAI;;;;;;;;;;mFAAiI,CAAC;AAE5I,OAAO,EAAE,IAAI,EAAE,CAAC;AAEhB,QAAA,MAAM,IAAI,sCAAQ,CAAC;AAEnB,KAAK,IAAI,GAAG,OAAO,IAAI,CAAC;AAExB,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
|
@@ -6,7 +6,7 @@ import * as ReportDefs from "./defs.defs.js";
|
|
|
6
6
|
const $nsid = "tools.ozone.report.createActivity";
|
|
7
7
|
export { $nsid };
|
|
8
8
|
export const $params = /*#__PURE__*/ l.params();
|
|
9
|
-
export const $input = /*#__PURE__*/ l.jsonPayload({ "reportId": /*#__PURE__*/ l.optional(/*#__PURE__*/ l.integer()), "eventId": /*#__PURE__*/ l.optional(/*#__PURE__*/ l.integer()), "activity": /*#__PURE__*/ l.typedUnion([/*#__PURE__*/ l.typedRef((() => ReportDefs.queueActivity)), /*#__PURE__*/ l.typedRef((() => ReportDefs.assignmentActivity)), /*#__PURE__*/ l.typedRef((() => ReportDefs.escalationActivity)), /*#__PURE__*/ l.typedRef((() => ReportDefs.closeActivity)), /*#__PURE__*/ l.typedRef((() => ReportDefs.reopenActivity)), /*#__PURE__*/ l.typedRef((() => ReportDefs.noteActivity))], false), "internalNote": /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()), "publicNote": /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()), "isAutomated": /*#__PURE__*/ l.optional(/*#__PURE__*/ l.withDefault(/*#__PURE__*/ l.boolean(), false)) });
|
|
9
|
+
export const $input = /*#__PURE__*/ l.jsonPayload({ "reportId": /*#__PURE__*/ l.optional(/*#__PURE__*/ l.integer()), "eventId": /*#__PURE__*/ l.optional(/*#__PURE__*/ l.integer()), "activity": /*#__PURE__*/ l.typedUnion([/*#__PURE__*/ l.typedRef((() => ReportDefs.queueActivity)), /*#__PURE__*/ l.typedRef((() => ReportDefs.assignmentActivity)), /*#__PURE__*/ l.typedRef((() => ReportDefs.escalationActivity)), /*#__PURE__*/ l.typedRef((() => ReportDefs.closeActivity)), /*#__PURE__*/ l.typedRef((() => ReportDefs.reopenActivity)), /*#__PURE__*/ l.typedRef((() => ReportDefs.noteActivity))], false), "internalNote": /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()), "publicNote": /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()), "isAutomated": /*#__PURE__*/ l.optional(/*#__PURE__*/ l.withDefault(/*#__PURE__*/ l.boolean(), false)), "meta": /*#__PURE__*/ l.optional(/*#__PURE__*/ l.lexMap()) });
|
|
10
10
|
export const $output = /*#__PURE__*/ l.jsonPayload({ "activity": /*#__PURE__*/ l.ref((() => ReportDefs.reportActivityView)) });
|
|
11
11
|
/** Register an activity on a report. For state-change activity types, validates the transition and updates report.status atomically. */
|
|
12
12
|
const main = /*#__PURE__*/ l.procedure($nsid, $params, $input, $output, ["ReportNotFound", "InvalidStateTransition", "AlreadyInTargetState"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createActivity.defs.js","sourceRoot":"","sources":["../../../../../src/lexicons/tools/ozone/report/createActivity.defs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AACjC,OAAO,KAAK,UAAU,MAAM,gBAAgB,CAAC;AAE7C,MAAM,KAAK,GAAG,mCAAmC,CAAC;AAIlD,OAAO,EAAE,KAAK,EAAE,CAAC;AAEjB,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;AAIhD,MAAM,CAAC,MAAM,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC,EAAC,UAAU,EAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,EAAC,SAAS,EAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO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EAAE,CAAC,EAAC,YAAY,EAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,EAAC,aAAa,EAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,CAAC,EAAC,MAAM,EAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,EAAC,CAAC,CAAC;AAKhkC,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC,EAAC,UAAU,EAAC,aAAa,CAAC,CAAC,CAAC,GAAG,CAAgC,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,kBAAkB,CAAQ,CAAC,EAAC,CAAC,CAAC;AAKlK,wIAAwI;AACxI,MAAM,IAAI,GAAG,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,gBAAgB,EAAC,wBAAwB,EAAC,sBAAsB,CAAC,CAAC,CAAC;AAE5I,OAAO,EAAE,IAAI,EAAE,CAAC;AAEhB,MAAM,IAAI,GAAG,KAAK,CAAC;AAInB,OAAO,EAAE,IAAI,EAAE,CAAC","sourcesContent":["/*\n * THIS FILE WAS GENERATED BY \"@atproto/lex\". DO NOT EDIT.\n */\n\nimport { l } from \"@atproto/lex\";\nimport * as ReportDefs from \"./defs.defs.js\";\n\nconst $nsid = \"tools.ozone.report.createActivity\";\n\ntype $nsid = typeof $nsid;\n\nexport { $nsid };\n\nexport const $params = /*#__PURE__*/ l.params();\n\nexport type $Params = l.InferOutput<typeof $params>;\n\nexport const $input = /*#__PURE__*/ l.jsonPayload({\"reportId\":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.integer()),\"eventId\":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.integer()),\"activity\":/*#__PURE__*/ l.typedUnion([/*#__PURE__*/ l.typedRef<ReportDefs.QueueActivity>((() => ReportDefs.queueActivity) as any),/*#__PURE__*/ l.typedRef<ReportDefs.AssignmentActivity>((() => ReportDefs.assignmentActivity) as any),/*#__PURE__*/ l.typedRef<ReportDefs.EscalationActivity>((() => ReportDefs.escalationActivity) as any),/*#__PURE__*/ l.typedRef<ReportDefs.CloseActivity>((() => ReportDefs.closeActivity) as any),/*#__PURE__*/ l.typedRef<ReportDefs.ReopenActivity>((() => ReportDefs.reopenActivity) as any),/*#__PURE__*/ l.typedRef<ReportDefs.NoteActivity>((() => ReportDefs.noteActivity) as any)], false),\"internalNote\":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()),\"publicNote\":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()),\"isAutomated\":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.withDefault(/*#__PURE__*/ l.boolean(), false)),\"meta\":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.lexMap())});\n\nexport type $Input<B = l.BinaryData> = l.InferPayload<typeof $input, B>;\nexport type $InputBody<B = l.BinaryData> = l.InferPayloadBody<typeof $input, B>;\n\nexport const $output = /*#__PURE__*/ l.jsonPayload({\"activity\":/*#__PURE__*/ l.ref<ReportDefs.ReportActivityView>((() => ReportDefs.reportActivityView) as any)});\n\nexport type $Output<B = l.BinaryData> = l.InferPayload<typeof $output, B>;\nexport type $OutputBody<B = l.BinaryData> = l.InferPayloadBody<typeof $output, B>;\n\n/** Register an activity on a report. For state-change activity types, validates the transition and updates report.status atomically. */\nconst main = /*#__PURE__*/ l.procedure($nsid, $params, $input, $output, [\"ReportNotFound\",\"InvalidStateTransition\",\"AlreadyInTargetState\"]);\n\nexport { main };\n\nconst $lxm = $nsid;\n\ntype $lxm = typeof $lxm;\n\nexport { $lxm };\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/bsky",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.11",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Reference implementation of app.bsky App View (Bluesky API)",
|
|
6
6
|
"keywords": [
|
|
@@ -73,17 +73,17 @@
|
|
|
73
73
|
"zod": "3.23.8",
|
|
74
74
|
"@atproto-labs/fetch-node": "^0.4.3",
|
|
75
75
|
"@atproto-labs/opentelemetry-node": "^0.3.1",
|
|
76
|
-
"@atproto-labs/xrpc-utils": "^0.1.
|
|
77
|
-
"@atproto/api": "^0.29.
|
|
76
|
+
"@atproto-labs/xrpc-utils": "^0.1.27",
|
|
77
|
+
"@atproto/api": "^0.29.3",
|
|
78
78
|
"@atproto/common": "^0.8.6",
|
|
79
79
|
"@atproto/crypto": "^0.5.7",
|
|
80
80
|
"@atproto/did": "^0.5.6",
|
|
81
81
|
"@atproto/identity": "^0.5.20",
|
|
82
82
|
"@atproto/lex": "^0.4.2",
|
|
83
|
-
"@atproto/sync": "^0.4.17",
|
|
84
83
|
"@atproto/repo": "^0.11.1",
|
|
84
|
+
"@atproto/sync": "^0.4.18",
|
|
85
85
|
"@atproto/syntax": "^0.7.7",
|
|
86
|
-
"@atproto/xrpc-server": "^0.13.
|
|
86
|
+
"@atproto/xrpc-server": "^0.13.6"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
89
|
"@bufbuild/buf": "^1.73.0",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"@types/pg": "^8.15.5",
|
|
98
98
|
"@types/qs": "^6.15.1",
|
|
99
99
|
"vitest": "^4.1.10",
|
|
100
|
-
"@atproto/pds": "^0.5.
|
|
100
|
+
"@atproto/pds": "^0.5.49"
|
|
101
101
|
},
|
|
102
102
|
"scripts": {
|
|
103
103
|
"codegen:buf": "buf generate ../bsync/proto && buf generate ./proto",
|