@atproto/ozone 0.1.58 → 0.1.60
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 +21 -0
- package/dist/api/moderation/emitEvent.d.ts.map +1 -1
- package/dist/api/moderation/emitEvent.js +31 -22
- package/dist/api/moderation/emitEvent.js.map +1 -1
- package/dist/lexicon/index.d.ts +2 -0
- package/dist/lexicon/index.d.ts.map +1 -1
- package/dist/lexicon/index.js +4 -0
- package/dist/lexicon/index.js.map +1 -1
- package/dist/lexicon/lexicons.d.ts +150 -0
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +76 -0
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/app/bsky/notification/listNotifications.d.ts +2 -0
- package/dist/lexicon/types/app/bsky/notification/listNotifications.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/notification/listNotifications.js.map +1 -1
- package/dist/lexicon/types/app/bsky/unspecced/defs.d.ts +9 -0
- package/dist/lexicon/types/app/bsky/unspecced/defs.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/unspecced/defs.js +10 -0
- package/dist/lexicon/types/app/bsky/unspecced/defs.js.map +1 -1
- package/dist/lexicon/types/app/bsky/unspecced/getTrendingTopics.d.ts +39 -0
- package/dist/lexicon/types/app/bsky/unspecced/getTrendingTopics.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/unspecced/getTrendingTopics.js +3 -0
- package/dist/lexicon/types/app/bsky/unspecced/getTrendingTopics.js.map +1 -0
- package/package.json +8 -8
- package/src/api/moderation/emitEvent.ts +63 -43
- package/src/lexicon/index.ts +12 -0
- package/src/lexicon/lexicons.ts +78 -0
- package/src/lexicon/types/app/bsky/notification/listNotifications.ts +2 -0
- package/src/lexicon/types/app/bsky/unspecced/defs.ts +20 -0
- package/src/lexicon/types/app/bsky/unspecced/getTrendingTopics.ts +49 -0
- package/tests/ack-all-subjects-of-account.test.ts +1 -1
- package/tests/get-profiles.test.ts +71 -0
- package/tests/protected-tags.test.ts +16 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/tsconfig.tests.tsbuildinfo +1 -1
|
@@ -7,6 +7,8 @@ import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
|
|
7
7
|
import * as AppBskyActorDefs from '../actor/defs';
|
|
8
8
|
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs';
|
|
9
9
|
export interface QueryParams {
|
|
10
|
+
/** Notification reasons to include in response. */
|
|
11
|
+
reasons?: string[];
|
|
10
12
|
limit: number;
|
|
11
13
|
priority?: boolean;
|
|
12
14
|
cursor?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listNotifications.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/app/bsky/notification/listNotifications.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAE,gBAAgB,EAAW,MAAM,kBAAkB,CAAA;AAI5D,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACtE,OAAO,KAAK,gBAAgB,MAAM,eAAe,CAAA;AACjD,OAAO,KAAK,mBAAmB,MAAM,iCAAiC,CAAA;AAEtE,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,MAAM,WAAW,GAAG,SAAS,CAAA;AAEnC,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,aAAa,EAAE,YAAY,EAAE,CAAA;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,CAAC,CAAC,EAAE,MAAM,GAAG,O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,EAAE,mBAAmB,CAAC,KAAK,EAAE,CAAA;IACpC,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACrB;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,YAAY,CAM5D;AAED,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAKjE"}
|
|
1
|
+
{"version":3,"file":"listNotifications.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/app/bsky/notification/listNotifications.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAE,gBAAgB,EAAW,MAAM,kBAAkB,CAAA;AAI5D,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACtE,OAAO,KAAK,gBAAgB,MAAM,eAAe,CAAA;AACjD,OAAO,KAAK,mBAAmB,MAAM,iCAAiC,CAAA;AAEtE,MAAM,WAAW,WAAW;IAC1B,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,MAAM,WAAW,GAAG,SAAS,CAAA;AAEnC,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,aAAa,EAAE,YAAY,EAAE,CAAA;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACrB;AAED,MAAM,MAAM,YAAY,GAAG,SAAS,CAAA;AAEpC,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,IAAI,EAAE,YAAY,CAAA;IA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AI,YAAY,CAM5D;AAED,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAKjE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listNotifications.js","sourceRoot":"","sources":["../../../../../../src/lexicon/types/app/bsky/notification/listNotifications.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"listNotifications.js","sourceRoot":"","sources":["../../../../../../src/lexicon/types/app/bsky/notification/listNotifications.ts"],"names":[],"mappings":";;AA8EA,wCAMC;AAED,oDAKC;AAtFD,mDAA+C;AAC/C,2CAAiD;AAwEjD,SAAgB,cAAc,CAAC,CAAU;IACvC,OAAO,CACL,IAAA,YAAK,EAAC,CAAC,CAAC;QACR,IAAA,cAAO,EAAC,CAAC,EAAE,OAAO,CAAC;QACnB,CAAC,CAAC,KAAK,KAAK,sDAAsD,CACnE,CAAA;AACH,CAAC;AAED,SAAgB,oBAAoB,CAAC,CAAU;IAC7C,OAAO,mBAAQ,CAAC,QAAQ,CACtB,sDAAsD,EACtD,CAAC,CACF,CAAA;AACH,CAAC"}
|
|
@@ -20,4 +20,13 @@ export interface SkeletonSearchStarterPack {
|
|
|
20
20
|
}
|
|
21
21
|
export declare function isSkeletonSearchStarterPack(v: unknown): v is SkeletonSearchStarterPack;
|
|
22
22
|
export declare function validateSkeletonSearchStarterPack(v: unknown): ValidationResult;
|
|
23
|
+
export interface TrendingTopic {
|
|
24
|
+
topic: string;
|
|
25
|
+
displayName?: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
link: string;
|
|
28
|
+
[k: string]: unknown;
|
|
29
|
+
}
|
|
30
|
+
export declare function isTrendingTopic(v: unknown): v is TrendingTopic;
|
|
31
|
+
export declare function validateTrendingTopic(v: unknown): ValidationResult;
|
|
23
32
|
//# sourceMappingURL=defs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defs.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/app/bsky/unspecced/defs.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAW,MAAM,kBAAkB,CAAA;AAK5D,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAA;IACX,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACrB;AAED,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,kBAAkB,CAMxE;AAED,wBAAgB,0BAA0B,CAAC,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAEvE;AAED,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,MAAM,CAAA;IACX,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACrB;AAED,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,mBAAmB,CAM1E;AAED,wBAAgB,2BAA2B,CAAC,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAExE;AAED,MAAM,WAAW,yBAAyB;IACxC,GAAG,EAAE,MAAM,CAAA;IACX,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACrB;AAED,wBAAgB,2BAA2B,CACzC,CAAC,EAAE,OAAO,GACT,CAAC,IAAI,yBAAyB,CAMhC;AAED,wBAAgB,iCAAiC,CAC/C,CAAC,EAAE,OAAO,GACT,gBAAgB,CAKlB"}
|
|
1
|
+
{"version":3,"file":"defs.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/app/bsky/unspecced/defs.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAW,MAAM,kBAAkB,CAAA;AAK5D,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAA;IACX,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACrB;AAED,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,kBAAkB,CAMxE;AAED,wBAAgB,0BAA0B,CAAC,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAEvE;AAED,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,MAAM,CAAA;IACX,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACrB;AAED,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,mBAAmB,CAM1E;AAED,wBAAgB,2BAA2B,CAAC,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAExE;AAED,MAAM,WAAW,yBAAyB;IACxC,GAAG,EAAE,MAAM,CAAA;IACX,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACrB;AAED,wBAAgB,2BAA2B,CACzC,CAAC,EAAE,OAAO,GACT,CAAC,IAAI,yBAAyB,CAMhC;AAED,wBAAgB,iCAAiC,CAC/C,CAAC,EAAE,OAAO,GACT,gBAAgB,CAKlB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACrB;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,aAAa,CAM9D;AAED,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAElE"}
|
|
@@ -6,6 +6,8 @@ exports.isSkeletonSearchActor = isSkeletonSearchActor;
|
|
|
6
6
|
exports.validateSkeletonSearchActor = validateSkeletonSearchActor;
|
|
7
7
|
exports.isSkeletonSearchStarterPack = isSkeletonSearchStarterPack;
|
|
8
8
|
exports.validateSkeletonSearchStarterPack = validateSkeletonSearchStarterPack;
|
|
9
|
+
exports.isTrendingTopic = isTrendingTopic;
|
|
10
|
+
exports.validateTrendingTopic = validateTrendingTopic;
|
|
9
11
|
const lexicons_1 = require("../../../../lexicons");
|
|
10
12
|
const util_1 = require("../../../../util");
|
|
11
13
|
function isSkeletonSearchPost(v) {
|
|
@@ -32,4 +34,12 @@ function isSkeletonSearchStarterPack(v) {
|
|
|
32
34
|
function validateSkeletonSearchStarterPack(v) {
|
|
33
35
|
return lexicons_1.lexicons.validate('app.bsky.unspecced.defs#skeletonSearchStarterPack', v);
|
|
34
36
|
}
|
|
37
|
+
function isTrendingTopic(v) {
|
|
38
|
+
return ((0, util_1.isObj)(v) &&
|
|
39
|
+
(0, util_1.hasProp)(v, '$type') &&
|
|
40
|
+
v.$type === 'app.bsky.unspecced.defs#trendingTopic');
|
|
41
|
+
}
|
|
42
|
+
function validateTrendingTopic(v) {
|
|
43
|
+
return lexicons_1.lexicons.validate('app.bsky.unspecced.defs#trendingTopic', v);
|
|
44
|
+
}
|
|
35
45
|
//# sourceMappingURL=defs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defs.js","sourceRoot":"","sources":["../../../../../../src/lexicon/types/app/bsky/unspecced/defs.ts"],"names":[],"mappings":";;AAaA,oDAMC;AAED,gEAEC;AAOD,sDAMC;AAED,kEAEC;AAOD,kEAQC;AAED,8EAOC;
|
|
1
|
+
{"version":3,"file":"defs.js","sourceRoot":"","sources":["../../../../../../src/lexicon/types/app/bsky/unspecced/defs.ts"],"names":[],"mappings":";;AAaA,oDAMC;AAED,gEAEC;AAOD,sDAMC;AAED,kEAEC;AAOD,kEAQC;AAED,8EAOC;AAUD,0CAMC;AAED,sDAEC;AAhFD,mDAA+C;AAC/C,2CAAiD;AAQjD,SAAgB,oBAAoB,CAAC,CAAU;IAC7C,OAAO,CACL,IAAA,YAAK,EAAC,CAAC,CAAC;QACR,IAAA,cAAO,EAAC,CAAC,EAAE,OAAO,CAAC;QACnB,CAAC,CAAC,KAAK,KAAK,4CAA4C,CACzD,CAAA;AACH,CAAC;AAED,SAAgB,0BAA0B,CAAC,CAAU;IACnD,OAAO,mBAAQ,CAAC,QAAQ,CAAC,4CAA4C,EAAE,CAAC,CAAC,CAAA;AAC3E,CAAC;AAOD,SAAgB,qBAAqB,CAAC,CAAU;IAC9C,OAAO,CACL,IAAA,YAAK,EAAC,CAAC,CAAC;QACR,IAAA,cAAO,EAAC,CAAC,EAAE,OAAO,CAAC;QACnB,CAAC,CAAC,KAAK,KAAK,6CAA6C,CAC1D,CAAA;AACH,CAAC;AAED,SAAgB,2BAA2B,CAAC,CAAU;IACpD,OAAO,mBAAQ,CAAC,QAAQ,CAAC,6CAA6C,EAAE,CAAC,CAAC,CAAA;AAC5E,CAAC;AAOD,SAAgB,2BAA2B,CACzC,CAAU;IAEV,OAAO,CACL,IAAA,YAAK,EAAC,CAAC,CAAC;QACR,IAAA,cAAO,EAAC,CAAC,EAAE,OAAO,CAAC;QACnB,CAAC,CAAC,KAAK,KAAK,mDAAmD,CAChE,CAAA;AACH,CAAC;AAED,SAAgB,iCAAiC,CAC/C,CAAU;IAEV,OAAO,mBAAQ,CAAC,QAAQ,CACtB,mDAAmD,EACnD,CAAC,CACF,CAAA;AACH,CAAC;AAUD,SAAgB,eAAe,CAAC,CAAU;IACxC,OAAO,CACL,IAAA,YAAK,EAAC,CAAC,CAAC;QACR,IAAA,cAAO,EAAC,CAAC,EAAE,OAAO,CAAC;QACnB,CAAC,CAAC,KAAK,KAAK,uCAAuC,CACpD,CAAA;AACH,CAAC;AAED,SAAgB,qBAAqB,CAAC,CAAU;IAC9C,OAAO,mBAAQ,CAAC,QAAQ,CAAC,uCAAuC,EAAE,CAAC,CAAC,CAAA;AACtE,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import express from 'express';
|
|
5
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
|
6
|
+
import * as AppBskyUnspeccedDefs from './defs';
|
|
7
|
+
export interface QueryParams {
|
|
8
|
+
/** DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking. */
|
|
9
|
+
viewer?: string;
|
|
10
|
+
limit: number;
|
|
11
|
+
}
|
|
12
|
+
export type InputSchema = undefined;
|
|
13
|
+
export interface OutputSchema {
|
|
14
|
+
topics: AppBskyUnspeccedDefs.TrendingTopic[];
|
|
15
|
+
suggested: AppBskyUnspeccedDefs.TrendingTopic[];
|
|
16
|
+
[k: string]: unknown;
|
|
17
|
+
}
|
|
18
|
+
export type HandlerInput = undefined;
|
|
19
|
+
export interface HandlerSuccess {
|
|
20
|
+
encoding: 'application/json';
|
|
21
|
+
body: OutputSchema;
|
|
22
|
+
headers?: {
|
|
23
|
+
[key: string]: string;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export interface HandlerError {
|
|
27
|
+
status: number;
|
|
28
|
+
message?: string;
|
|
29
|
+
}
|
|
30
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
|
31
|
+
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
32
|
+
auth: HA;
|
|
33
|
+
params: QueryParams;
|
|
34
|
+
input: HandlerInput;
|
|
35
|
+
req: express.Request;
|
|
36
|
+
res: express.Response;
|
|
37
|
+
};
|
|
38
|
+
export type Handler<HA extends HandlerAuth = never> = (ctx: HandlerReqCtx<HA>) => Promise<HandlerOutput> | HandlerOutput;
|
|
39
|
+
//# sourceMappingURL=getTrendingTopics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTrendingTopics.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/app/bsky/unspecced/getTrendingTopics.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,OAAO,MAAM,SAAS,CAAA;AAK7B,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACtE,OAAO,KAAK,oBAAoB,MAAM,QAAQ,CAAA;AAE9C,MAAM,WAAW,WAAW;IAC1B,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"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/ozone",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.60",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Backend service for moderating the Bluesky network.",
|
|
6
6
|
"keywords": [
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
"structured-headers": "^1.0.1",
|
|
33
33
|
"typed-emitter": "^2.1.0",
|
|
34
34
|
"uint8arrays": "3.0.0",
|
|
35
|
-
"@atproto/api": "^0.13.
|
|
36
|
-
"@atproto/common": "^0.4.
|
|
35
|
+
"@atproto/api": "^0.13.21",
|
|
36
|
+
"@atproto/common": "^0.4.5",
|
|
37
37
|
"@atproto/crypto": "^0.4.2",
|
|
38
38
|
"@atproto/identity": "^0.4.3",
|
|
39
|
-
"@atproto/lexicon": "^0.4.
|
|
39
|
+
"@atproto/lexicon": "^0.4.4",
|
|
40
40
|
"@atproto/syntax": "^0.3.1",
|
|
41
|
-
"@atproto/xrpc": "^0.6.
|
|
42
|
-
"@atproto/xrpc-server": "^0.7.
|
|
41
|
+
"@atproto/xrpc": "^0.6.5",
|
|
42
|
+
"@atproto/xrpc-server": "^0.7.4"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@did-plc/server": "^0.0.1",
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"jest": "^28.1.2",
|
|
53
53
|
"ts-node": "^10.8.2",
|
|
54
54
|
"typescript": "^5.6.3",
|
|
55
|
-
"@atproto/lex-cli": "^0.5.
|
|
56
|
-
"@atproto/pds": "^0.4.
|
|
55
|
+
"@atproto/lex-cli": "^0.5.3",
|
|
56
|
+
"@atproto/pds": "^0.4.77"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"codegen": "lex gen-server --yes ./src/lexicon ../../lexicons/com/atproto/*/* ../../lexicons/app/bsky/*/* ../../lexicons/chat/bsky/*/* ../../lexicons/tools/ozone/*/*",
|
|
@@ -99,49 +99,7 @@ const handleModerationEvent = async ({
|
|
|
99
99
|
)
|
|
100
100
|
|
|
101
101
|
if (protectedTags) {
|
|
102
|
-
status.tags
|
|
103
|
-
if (!Object.hasOwn(protectedTags, tag)) return
|
|
104
|
-
if (
|
|
105
|
-
protectedTags[tag]['moderators'] &&
|
|
106
|
-
!protectedTags[tag]['moderators'].includes(createdBy)
|
|
107
|
-
) {
|
|
108
|
-
throw new InvalidRequestError(
|
|
109
|
-
`Not allowed to action on protected tag: ${tag}`,
|
|
110
|
-
)
|
|
111
|
-
}
|
|
112
|
-
if (protectedTags[tag]['roles']) {
|
|
113
|
-
if (
|
|
114
|
-
auth.credentials.isAdmin &&
|
|
115
|
-
!protectedTags[tag]['roles'].includes(
|
|
116
|
-
'tools.ozone.team.defs#roleAdmin',
|
|
117
|
-
)
|
|
118
|
-
) {
|
|
119
|
-
throw new InvalidRequestError(
|
|
120
|
-
`Not allowed to action on protected tag: ${tag}`,
|
|
121
|
-
)
|
|
122
|
-
}
|
|
123
|
-
if (
|
|
124
|
-
auth.credentials.isModerator &&
|
|
125
|
-
!protectedTags[tag]['roles'].includes(
|
|
126
|
-
'tools.ozone.team.defs#roleModerator',
|
|
127
|
-
)
|
|
128
|
-
) {
|
|
129
|
-
throw new InvalidRequestError(
|
|
130
|
-
`Not allowed to action on protected tag: ${tag}`,
|
|
131
|
-
)
|
|
132
|
-
}
|
|
133
|
-
if (
|
|
134
|
-
auth.credentials.isTriage &&
|
|
135
|
-
!protectedTags[tag]['roles'].includes(
|
|
136
|
-
'tools.ozone.team.defs#roleTriage',
|
|
137
|
-
)
|
|
138
|
-
) {
|
|
139
|
-
throw new InvalidRequestError(
|
|
140
|
-
`Not allowed to action on protected tag: ${tag}`,
|
|
141
|
-
)
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
})
|
|
102
|
+
assertProtectedTagAction(protectedTags, status.tags, createdBy, auth)
|
|
145
103
|
}
|
|
146
104
|
}
|
|
147
105
|
|
|
@@ -291,6 +249,68 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
291
249
|
})
|
|
292
250
|
}
|
|
293
251
|
|
|
252
|
+
const assertProtectedTagAction = (
|
|
253
|
+
protectedTags: ProtectedTagSetting,
|
|
254
|
+
subjectTags: string[],
|
|
255
|
+
actionAuthor: string,
|
|
256
|
+
auth: ModeratorOutput | AdminTokenOutput,
|
|
257
|
+
) => {
|
|
258
|
+
subjectTags.forEach((tag) => {
|
|
259
|
+
if (!Object.hasOwn(protectedTags, tag)) return
|
|
260
|
+
if (
|
|
261
|
+
protectedTags[tag]['moderators'] &&
|
|
262
|
+
!protectedTags[tag]['moderators'].includes(actionAuthor)
|
|
263
|
+
) {
|
|
264
|
+
throw new InvalidRequestError(
|
|
265
|
+
`Not allowed to action on protected tag: ${tag}`,
|
|
266
|
+
)
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
if (protectedTags[tag]['roles']) {
|
|
270
|
+
if (auth.credentials.isAdmin) {
|
|
271
|
+
if (
|
|
272
|
+
protectedTags[tag]['roles'].includes(
|
|
273
|
+
'tools.ozone.team.defs#roleAdmin',
|
|
274
|
+
)
|
|
275
|
+
) {
|
|
276
|
+
return
|
|
277
|
+
}
|
|
278
|
+
throw new InvalidRequestError(
|
|
279
|
+
`Not allowed to action on protected tag: ${tag}`,
|
|
280
|
+
)
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
if (auth.credentials.isModerator) {
|
|
284
|
+
if (
|
|
285
|
+
protectedTags[tag]['roles'].includes(
|
|
286
|
+
'tools.ozone.team.defs#roleModerator',
|
|
287
|
+
)
|
|
288
|
+
) {
|
|
289
|
+
return
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
throw new InvalidRequestError(
|
|
293
|
+
`Not allowed to action on protected tag: ${tag}`,
|
|
294
|
+
)
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
if (auth.credentials.isTriage) {
|
|
298
|
+
if (
|
|
299
|
+
protectedTags[tag]['roles'].includes(
|
|
300
|
+
'tools.ozone.team.defs#roleTriage',
|
|
301
|
+
)
|
|
302
|
+
) {
|
|
303
|
+
return
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
throw new InvalidRequestError(
|
|
307
|
+
`Not allowed to action on protected tag: ${tag}`,
|
|
308
|
+
)
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
})
|
|
312
|
+
}
|
|
313
|
+
|
|
294
314
|
const assertTagAuth = async (
|
|
295
315
|
settingService: SettingService,
|
|
296
316
|
serviceDid: string,
|
package/src/lexicon/index.ts
CHANGED
|
@@ -140,6 +140,7 @@ import * as AppBskyUnspeccedGetConfig from './types/app/bsky/unspecced/getConfig
|
|
|
140
140
|
import * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators'
|
|
141
141
|
import * as AppBskyUnspeccedGetSuggestionsSkeleton from './types/app/bsky/unspecced/getSuggestionsSkeleton'
|
|
142
142
|
import * as AppBskyUnspeccedGetTaggedSuggestions from './types/app/bsky/unspecced/getTaggedSuggestions'
|
|
143
|
+
import * as AppBskyUnspeccedGetTrendingTopics from './types/app/bsky/unspecced/getTrendingTopics'
|
|
143
144
|
import * as AppBskyUnspeccedSearchActorsSkeleton from './types/app/bsky/unspecced/searchActorsSkeleton'
|
|
144
145
|
import * as AppBskyUnspeccedSearchPostsSkeleton from './types/app/bsky/unspecced/searchPostsSkeleton'
|
|
145
146
|
import * as AppBskyUnspeccedSearchStarterPacksSkeleton from './types/app/bsky/unspecced/searchStarterPacksSkeleton'
|
|
@@ -1896,6 +1897,17 @@ export class AppBskyUnspeccedNS {
|
|
|
1896
1897
|
return this._server.xrpc.method(nsid, cfg)
|
|
1897
1898
|
}
|
|
1898
1899
|
|
|
1900
|
+
getTrendingTopics<AV extends AuthVerifier>(
|
|
1901
|
+
cfg: ConfigOf<
|
|
1902
|
+
AV,
|
|
1903
|
+
AppBskyUnspeccedGetTrendingTopics.Handler<ExtractAuth<AV>>,
|
|
1904
|
+
AppBskyUnspeccedGetTrendingTopics.HandlerReqCtx<ExtractAuth<AV>>
|
|
1905
|
+
>,
|
|
1906
|
+
) {
|
|
1907
|
+
const nsid = 'app.bsky.unspecced.getTrendingTopics' // @ts-ignore
|
|
1908
|
+
return this._server.xrpc.method(nsid, cfg)
|
|
1909
|
+
}
|
|
1910
|
+
|
|
1899
1911
|
searchActorsSkeleton<AV extends AuthVerifier>(
|
|
1900
1912
|
cfg: ConfigOf<
|
|
1901
1913
|
AV,
|
package/src/lexicon/lexicons.ts
CHANGED
|
@@ -8944,6 +8944,15 @@ export const schemaDict = {
|
|
|
8944
8944
|
parameters: {
|
|
8945
8945
|
type: 'params',
|
|
8946
8946
|
properties: {
|
|
8947
|
+
reasons: {
|
|
8948
|
+
description: 'Notification reasons to include in response.',
|
|
8949
|
+
type: 'array',
|
|
8950
|
+
items: {
|
|
8951
|
+
type: 'string',
|
|
8952
|
+
description:
|
|
8953
|
+
'A reason that matches the reason property of #notification.',
|
|
8954
|
+
},
|
|
8955
|
+
},
|
|
8947
8956
|
limit: {
|
|
8948
8957
|
type: 'integer',
|
|
8949
8958
|
minimum: 1,
|
|
@@ -9248,6 +9257,24 @@ export const schemaDict = {
|
|
|
9248
9257
|
},
|
|
9249
9258
|
},
|
|
9250
9259
|
},
|
|
9260
|
+
trendingTopic: {
|
|
9261
|
+
type: 'object',
|
|
9262
|
+
required: ['topic', 'link'],
|
|
9263
|
+
properties: {
|
|
9264
|
+
topic: {
|
|
9265
|
+
type: 'string',
|
|
9266
|
+
},
|
|
9267
|
+
displayName: {
|
|
9268
|
+
type: 'string',
|
|
9269
|
+
},
|
|
9270
|
+
description: {
|
|
9271
|
+
type: 'string',
|
|
9272
|
+
},
|
|
9273
|
+
link: {
|
|
9274
|
+
type: 'string',
|
|
9275
|
+
},
|
|
9276
|
+
},
|
|
9277
|
+
},
|
|
9251
9278
|
},
|
|
9252
9279
|
},
|
|
9253
9280
|
AppBskyUnspeccedGetConfig: {
|
|
@@ -9428,6 +9455,56 @@ export const schemaDict = {
|
|
|
9428
9455
|
},
|
|
9429
9456
|
},
|
|
9430
9457
|
},
|
|
9458
|
+
AppBskyUnspeccedGetTrendingTopics: {
|
|
9459
|
+
lexicon: 1,
|
|
9460
|
+
id: 'app.bsky.unspecced.getTrendingTopics',
|
|
9461
|
+
defs: {
|
|
9462
|
+
main: {
|
|
9463
|
+
type: 'query',
|
|
9464
|
+
description: 'Get a list of trending topics',
|
|
9465
|
+
parameters: {
|
|
9466
|
+
type: 'params',
|
|
9467
|
+
properties: {
|
|
9468
|
+
viewer: {
|
|
9469
|
+
type: 'string',
|
|
9470
|
+
format: 'did',
|
|
9471
|
+
description:
|
|
9472
|
+
'DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking.',
|
|
9473
|
+
},
|
|
9474
|
+
limit: {
|
|
9475
|
+
type: 'integer',
|
|
9476
|
+
minimum: 1,
|
|
9477
|
+
maximum: 25,
|
|
9478
|
+
default: 10,
|
|
9479
|
+
},
|
|
9480
|
+
},
|
|
9481
|
+
},
|
|
9482
|
+
output: {
|
|
9483
|
+
encoding: 'application/json',
|
|
9484
|
+
schema: {
|
|
9485
|
+
type: 'object',
|
|
9486
|
+
required: ['topics', 'suggested'],
|
|
9487
|
+
properties: {
|
|
9488
|
+
topics: {
|
|
9489
|
+
type: 'array',
|
|
9490
|
+
items: {
|
|
9491
|
+
type: 'ref',
|
|
9492
|
+
ref: 'lex:app.bsky.unspecced.defs#trendingTopic',
|
|
9493
|
+
},
|
|
9494
|
+
},
|
|
9495
|
+
suggested: {
|
|
9496
|
+
type: 'array',
|
|
9497
|
+
items: {
|
|
9498
|
+
type: 'ref',
|
|
9499
|
+
ref: 'lex:app.bsky.unspecced.defs#trendingTopic',
|
|
9500
|
+
},
|
|
9501
|
+
},
|
|
9502
|
+
},
|
|
9503
|
+
},
|
|
9504
|
+
},
|
|
9505
|
+
},
|
|
9506
|
+
},
|
|
9507
|
+
},
|
|
9431
9508
|
AppBskyUnspeccedSearchActorsSkeleton: {
|
|
9432
9509
|
lexicon: 1,
|
|
9433
9510
|
id: 'app.bsky.unspecced.searchActorsSkeleton',
|
|
@@ -13677,6 +13754,7 @@ export const ids = {
|
|
|
13677
13754
|
'app.bsky.unspecced.getSuggestionsSkeleton',
|
|
13678
13755
|
AppBskyUnspeccedGetTaggedSuggestions:
|
|
13679
13756
|
'app.bsky.unspecced.getTaggedSuggestions',
|
|
13757
|
+
AppBskyUnspeccedGetTrendingTopics: 'app.bsky.unspecced.getTrendingTopics',
|
|
13680
13758
|
AppBskyUnspeccedSearchActorsSkeleton:
|
|
13681
13759
|
'app.bsky.unspecced.searchActorsSkeleton',
|
|
13682
13760
|
AppBskyUnspeccedSearchPostsSkeleton: 'app.bsky.unspecced.searchPostsSkeleton',
|
|
@@ -11,6 +11,8 @@ import * as AppBskyActorDefs from '../actor/defs'
|
|
|
11
11
|
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
|
|
12
12
|
|
|
13
13
|
export interface QueryParams {
|
|
14
|
+
/** Notification reasons to include in response. */
|
|
15
|
+
reasons?: string[]
|
|
14
16
|
limit: number
|
|
15
17
|
priority?: boolean
|
|
16
18
|
cursor?: string
|
|
@@ -63,3 +63,23 @@ export function validateSkeletonSearchStarterPack(
|
|
|
63
63
|
v,
|
|
64
64
|
)
|
|
65
65
|
}
|
|
66
|
+
|
|
67
|
+
export interface TrendingTopic {
|
|
68
|
+
topic: string
|
|
69
|
+
displayName?: string
|
|
70
|
+
description?: string
|
|
71
|
+
link: string
|
|
72
|
+
[k: string]: unknown
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function isTrendingTopic(v: unknown): v is TrendingTopic {
|
|
76
|
+
return (
|
|
77
|
+
isObj(v) &&
|
|
78
|
+
hasProp(v, '$type') &&
|
|
79
|
+
v.$type === 'app.bsky.unspecced.defs#trendingTopic'
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function validateTrendingTopic(v: unknown): ValidationResult {
|
|
84
|
+
return lexicons.validate('app.bsky.unspecced.defs#trendingTopic', v)
|
|
85
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import express from 'express'
|
|
5
|
+
import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
6
|
+
import { lexicons } from '../../../../lexicons'
|
|
7
|
+
import { isObj, hasProp } from '../../../../util'
|
|
8
|
+
import { CID } from 'multiformats/cid'
|
|
9
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
|
|
10
|
+
import * as AppBskyUnspeccedDefs from './defs'
|
|
11
|
+
|
|
12
|
+
export interface QueryParams {
|
|
13
|
+
/** DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking. */
|
|
14
|
+
viewer?: string
|
|
15
|
+
limit: number
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type InputSchema = undefined
|
|
19
|
+
|
|
20
|
+
export interface OutputSchema {
|
|
21
|
+
topics: AppBskyUnspeccedDefs.TrendingTopic[]
|
|
22
|
+
suggested: AppBskyUnspeccedDefs.TrendingTopic[]
|
|
23
|
+
[k: string]: unknown
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type HandlerInput = undefined
|
|
27
|
+
|
|
28
|
+
export interface HandlerSuccess {
|
|
29
|
+
encoding: 'application/json'
|
|
30
|
+
body: OutputSchema
|
|
31
|
+
headers?: { [key: string]: string }
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface HandlerError {
|
|
35
|
+
status: number
|
|
36
|
+
message?: string
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
|
|
40
|
+
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
41
|
+
auth: HA
|
|
42
|
+
params: QueryParams
|
|
43
|
+
input: HandlerInput
|
|
44
|
+
req: express.Request
|
|
45
|
+
res: express.Response
|
|
46
|
+
}
|
|
47
|
+
export type Handler<HA extends HandlerAuth = never> = (
|
|
48
|
+
ctx: HandlerReqCtx<HA>,
|
|
49
|
+
) => Promise<HandlerOutput> | HandlerOutput
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
import { isRepoRef } from '../src/lexicon/types/com/atproto/admin/defs'
|
|
20
20
|
import { ComAtprotoRepoStrongRef } from '@atproto/api'
|
|
21
21
|
|
|
22
|
-
describe('
|
|
22
|
+
describe('acknowledge all subjects of account', () => {
|
|
23
23
|
let network: TestNetwork
|
|
24
24
|
let sc: SeedClient
|
|
25
25
|
let modClient: ModeratorClient
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TestNetwork,
|
|
3
|
+
SeedClient,
|
|
4
|
+
basicSeed,
|
|
5
|
+
ModeratorClient,
|
|
6
|
+
} from '@atproto/dev-env'
|
|
7
|
+
import { ids } from '../src/lexicon/lexicons'
|
|
8
|
+
|
|
9
|
+
describe('get profiles through ozone', () => {
|
|
10
|
+
let network: TestNetwork
|
|
11
|
+
let sc: SeedClient
|
|
12
|
+
let modClient: ModeratorClient
|
|
13
|
+
|
|
14
|
+
const repoSubject = (did: string) => ({
|
|
15
|
+
$type: 'com.atproto.admin.defs#repoRef',
|
|
16
|
+
did,
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
beforeAll(async () => {
|
|
20
|
+
network = await TestNetwork.create({
|
|
21
|
+
dbPostgresSchema: 'ozone_get_profiles',
|
|
22
|
+
})
|
|
23
|
+
sc = network.getSeedClient()
|
|
24
|
+
modClient = network.ozone.getModClient()
|
|
25
|
+
await basicSeed(sc)
|
|
26
|
+
await network.processAll()
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
afterAll(async () => {
|
|
30
|
+
await network.close()
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
it('allows getting profiles by dids for takendown accounts.', async () => {
|
|
34
|
+
const getProfiles = async (actors: string[]) => {
|
|
35
|
+
const { data } = await modClient.agent.app.bsky.actor.getProfiles(
|
|
36
|
+
{ actors },
|
|
37
|
+
{
|
|
38
|
+
headers: await network.ozone.modHeaders(
|
|
39
|
+
'app.bsky.actor.getProfiles',
|
|
40
|
+
'admin',
|
|
41
|
+
),
|
|
42
|
+
},
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
return data.profiles
|
|
46
|
+
}
|
|
47
|
+
const profilesBefore = await getProfiles([sc.dids.bob, sc.dids.carol])
|
|
48
|
+
|
|
49
|
+
await modClient.performTakedown({
|
|
50
|
+
subject: repoSubject(sc.dids.bob),
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
const profilesAfterFromOzone = await getProfiles([
|
|
54
|
+
sc.dids.bob,
|
|
55
|
+
sc.dids.carol,
|
|
56
|
+
])
|
|
57
|
+
|
|
58
|
+
const appviewAgent = network.bsky.getClient()
|
|
59
|
+
const {
|
|
60
|
+
data: { profiles: profilesFromAppview },
|
|
61
|
+
} = await appviewAgent.app.bsky.actor.getProfiles({
|
|
62
|
+
actors: [sc.dids.bob, sc.dids.carol],
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
expect(profilesBefore.length).toEqual(profilesAfterFromOzone.length)
|
|
66
|
+
expect(
|
|
67
|
+
profilesAfterFromOzone.find((p) => p.did === sc.dids.bob),
|
|
68
|
+
).toBeTruthy()
|
|
69
|
+
expect(profilesFromAppview.find((p) => p.did === sc.dids.bob)).toBeFalsy()
|
|
70
|
+
})
|
|
71
|
+
})
|
|
@@ -145,6 +145,22 @@ describe('protected-tags', () => {
|
|
|
145
145
|
},
|
|
146
146
|
}),
|
|
147
147
|
).rejects.toThrow(/Can not manage tag vip/gi)
|
|
148
|
+
|
|
149
|
+
// Verify that since admins are configured to manage this tag, admin actions go through
|
|
150
|
+
const removeTag = await modClient.emitEvent(
|
|
151
|
+
{
|
|
152
|
+
subject: {
|
|
153
|
+
$type: 'com.atproto.admin.defs#repoRef',
|
|
154
|
+
did: sc.dids.bob,
|
|
155
|
+
},
|
|
156
|
+
event: {
|
|
157
|
+
$type: 'tools.ozone.moderation.defs#modEventTakedown',
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
'admin',
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
expect(removeTag.id).toBeTruthy()
|
|
148
164
|
})
|
|
149
165
|
it('only allows configured moderators to add/remove protected tags', async () => {
|
|
150
166
|
await modClient.upsertSettingOption({
|