@atproto/ozone 0.0.16 → 0.0.17-next.0
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/dist/api/moderation/util.d.ts +1 -1
- package/dist/auth-verifier.d.ts +7 -11
- package/dist/config/config.d.ts +1 -0
- package/dist/config/env.d.ts +1 -2
- package/dist/config/secrets.d.ts +0 -2
- package/dist/daemon/event-pusher.d.ts +2 -0
- package/dist/db/index.js.map +1 -1
- package/dist/db/schema/moderation_subject_status.d.ts +2 -2
- package/dist/index.js +821 -1055
- package/dist/index.js.map +3 -3
- package/dist/lexicon/index.d.ts +8 -0
- package/dist/lexicon/lexicons.d.ts +298 -0
- package/dist/lexicon/types/app/bsky/actor/defs.d.ts +23 -1
- package/dist/lexicon/types/app/bsky/embed/record.d.ts +2 -1
- package/dist/lexicon/types/app/bsky/labeler/defs.d.ts +41 -0
- package/dist/lexicon/types/app/bsky/labeler/getServices.d.ts +36 -0
- package/dist/lexicon/types/app/bsky/labeler/service.d.ts +14 -0
- package/dist/lexicon/types/com/atproto/admin/defs.d.ts +2 -1
- package/dist/lexicon/types/com/atproto/label/defs.d.ts +18 -0
- package/dist/mod-service/index.d.ts +2 -2
- package/package.json +5 -4
- package/src/api/admin/createCommunicationTemplate.ts +1 -1
- package/src/api/admin/deleteCommunicationTemplate.ts +1 -1
- package/src/api/admin/emitModerationEvent.ts +6 -2
- package/src/api/admin/getModerationEvent.ts +1 -1
- package/src/api/admin/getRecord.ts +1 -1
- package/src/api/admin/getRepo.ts +1 -1
- package/src/api/admin/listCommunicationTemplates.ts +1 -1
- package/src/api/admin/queryModerationEvents.ts +1 -1
- package/src/api/admin/queryModerationStatuses.ts +1 -1
- package/src/api/admin/searchRepos.ts +1 -1
- package/src/api/admin/updateCommunicationTemplate.ts +1 -1
- package/src/api/admin/util.ts +1 -1
- package/src/api/moderation/createReport.ts +1 -2
- package/src/api/proxied.ts +8 -8
- package/src/api/temp/fetchLabels.ts +1 -1
- package/src/auth-verifier.ts +19 -29
- package/src/config/config.ts +10 -7
- package/src/config/env.ts +2 -4
- package/src/config/secrets.ts +0 -6
- package/src/context.ts +1 -3
- package/src/daemon/context.ts +2 -2
- package/src/daemon/event-pusher.ts +9 -1
- package/src/db/schema/moderation_subject_status.ts +6 -1
- package/src/lexicon/index.ts +23 -0
- package/src/lexicon/lexicons.ts +327 -1
- package/src/lexicon/types/app/bsky/actor/defs.ts +57 -1
- package/src/lexicon/types/app/bsky/embed/record.ts +2 -0
- package/src/lexicon/types/app/bsky/labeler/defs.ts +93 -0
- package/src/lexicon/types/app/bsky/labeler/getServices.ts +51 -0
- package/src/lexicon/types/app/bsky/labeler/service.ts +31 -0
- package/src/lexicon/types/com/atproto/admin/defs.ts +3 -0
- package/src/lexicon/types/com/atproto/label/defs.ts +68 -0
- package/src/mod-service/index.ts +4 -3
- package/src/mod-service/status.ts +42 -26
- package/tests/__snapshots__/get-record.test.ts.snap +4 -4
- package/tests/__snapshots__/get-repo.test.ts.snap +2 -2
- package/tests/communication-templates.test.ts +7 -7
- package/tests/get-record.test.ts +17 -7
- package/tests/get-repo.test.ts +24 -12
- package/tests/moderation-appeals.test.ts +24 -52
- package/tests/moderation-events.test.ts +87 -130
- package/tests/moderation-status-tags.test.ts +16 -31
- package/tests/moderation-statuses.test.ts +125 -58
- package/tests/moderation.test.ts +140 -287
- package/tests/repo-search.test.ts +11 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { InputSchema as ReportInput } from '../../lexicon/types/com/atproto/moderation/createReport';
|
|
2
2
|
export declare const getReasonType: (reasonType: ReportInput['reasonType']) => string | boolean;
|
|
3
3
|
export declare const getEventType: (type: string) => "com.atproto.admin.defs#modEventTakedown" | "com.atproto.admin.defs#modEventAcknowledge" | "com.atproto.admin.defs#modEventEscalate" | "com.atproto.admin.defs#modEventComment" | "com.atproto.admin.defs#modEventLabel" | "com.atproto.admin.defs#modEventReport" | "com.atproto.admin.defs#modEventMute" | "com.atproto.admin.defs#modEventReverseTakedown" | "com.atproto.admin.defs#modEventEmail" | "com.atproto.admin.defs#modEventResolveAppeal" | "com.atproto.admin.defs#modEventTag";
|
|
4
|
-
export declare const getReviewState: (reviewState?: string) => "com.atproto.admin.defs#reviewOpen" | "com.atproto.admin.defs#reviewEscalated" | "com.atproto.admin.defs#reviewClosed" | undefined;
|
|
4
|
+
export declare const getReviewState: (reviewState?: string) => "com.atproto.admin.defs#reviewOpen" | "com.atproto.admin.defs#reviewEscalated" | "com.atproto.admin.defs#reviewClosed" | "com.atproto.admin.defs#reviewNone" | undefined;
|
package/dist/auth-verifier.d.ts
CHANGED
|
@@ -3,11 +3,11 @@ import { IdResolver } from '@atproto/identity';
|
|
|
3
3
|
type ReqCtx = {
|
|
4
4
|
req: express.Request;
|
|
5
5
|
};
|
|
6
|
-
type
|
|
6
|
+
type AdminTokenOutput = {
|
|
7
7
|
credentials: {
|
|
8
|
-
type: '
|
|
9
|
-
isAdmin:
|
|
10
|
-
isModerator:
|
|
8
|
+
type: 'admin_token';
|
|
9
|
+
isAdmin: true;
|
|
10
|
+
isModerator: true;
|
|
11
11
|
isTriage: true;
|
|
12
12
|
};
|
|
13
13
|
};
|
|
@@ -43,8 +43,6 @@ export type AuthVerifierOpts = {
|
|
|
43
43
|
moderators: string[];
|
|
44
44
|
triage: string[];
|
|
45
45
|
adminPassword: string;
|
|
46
|
-
moderatorPassword: string;
|
|
47
|
-
triagePassword: string;
|
|
48
46
|
};
|
|
49
47
|
export declare class AuthVerifier {
|
|
50
48
|
idResolver: IdResolver;
|
|
@@ -53,15 +51,13 @@ export declare class AuthVerifier {
|
|
|
53
51
|
moderators: string[];
|
|
54
52
|
triage: string[];
|
|
55
53
|
private adminPassword;
|
|
56
|
-
private moderatorPassword;
|
|
57
|
-
private triagePassword;
|
|
58
54
|
constructor(idResolver: IdResolver, opts: AuthVerifierOpts);
|
|
59
|
-
|
|
55
|
+
modOrAdminToken: (reqCtx: ReqCtx) => Promise<ModeratorOutput | AdminTokenOutput>;
|
|
60
56
|
moderator: (reqCtx: ReqCtx) => Promise<ModeratorOutput>;
|
|
61
57
|
standard: (reqCtx: ReqCtx) => Promise<StandardOutput>;
|
|
62
58
|
standardOptional: (reqCtx: ReqCtx) => Promise<StandardOutput | NullOutput>;
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
standardOptionalOrAdminToken: (reqCtx: ReqCtx) => Promise<StandardOutput | AdminTokenOutput | NullOutput>;
|
|
60
|
+
adminToken: (reqCtx: ReqCtx) => Promise<AdminTokenOutput>;
|
|
65
61
|
nullCreds(): NullOutput;
|
|
66
62
|
}
|
|
67
63
|
export declare const getJwtStrFromReq: (req: express.Request) => string | null;
|
package/dist/config/config.d.ts
CHANGED
package/dist/config/env.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export type OzoneEnvironment = {
|
|
|
8
8
|
serverDid?: string;
|
|
9
9
|
appviewUrl?: string;
|
|
10
10
|
appviewDid?: string;
|
|
11
|
+
appviewPushEvents?: boolean;
|
|
11
12
|
pdsUrl?: string;
|
|
12
13
|
pdsDid?: string;
|
|
13
14
|
dbPostgresUrl?: string;
|
|
@@ -21,7 +22,5 @@ export type OzoneEnvironment = {
|
|
|
21
22
|
moderatorDids: string[];
|
|
22
23
|
triageDids: string[];
|
|
23
24
|
adminPassword?: string;
|
|
24
|
-
moderatorPassword?: string;
|
|
25
|
-
triagePassword?: string;
|
|
26
25
|
signingKeyHex?: string;
|
|
27
26
|
};
|
package/dist/config/secrets.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import AtpAgent from '@atproto/api';
|
|
3
3
|
import Database from '../db';
|
|
4
|
+
import { RepoPushEventType } from '../db/schema/repo_push_event';
|
|
4
5
|
type PollState = {
|
|
5
6
|
timer?: NodeJS.Timer;
|
|
6
7
|
promise: Promise<void>;
|
|
@@ -34,6 +35,7 @@ export declare class EventPusher {
|
|
|
34
35
|
};
|
|
35
36
|
});
|
|
36
37
|
start(): void;
|
|
38
|
+
get takedowns(): RepoPushEventType[];
|
|
37
39
|
poll(state: PollState, fn: () => Promise<void>): void;
|
|
38
40
|
processAll(): Promise<void>;
|
|
39
41
|
destroy(): Promise<void>;
|