@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
package/dist/lexicon/index.d.ts
CHANGED
|
@@ -119,6 +119,7 @@ import * as AppBskyGraphMuteActor from './types/app/bsky/graph/muteActor';
|
|
|
119
119
|
import * as AppBskyGraphMuteActorList from './types/app/bsky/graph/muteActorList';
|
|
120
120
|
import * as AppBskyGraphUnmuteActor from './types/app/bsky/graph/unmuteActor';
|
|
121
121
|
import * as AppBskyGraphUnmuteActorList from './types/app/bsky/graph/unmuteActorList';
|
|
122
|
+
import * as AppBskyLabelerGetServices from './types/app/bsky/labeler/getServices';
|
|
122
123
|
import * as AppBskyNotificationGetUnreadCount from './types/app/bsky/notification/getUnreadCount';
|
|
123
124
|
import * as AppBskyNotificationListNotifications from './types/app/bsky/notification/listNotifications';
|
|
124
125
|
import * as AppBskyNotificationRegisterPush from './types/app/bsky/notification/registerPush';
|
|
@@ -131,6 +132,7 @@ export declare const COM_ATPROTO_ADMIN: {
|
|
|
131
132
|
DefsReviewOpen: string;
|
|
132
133
|
DefsReviewEscalated: string;
|
|
133
134
|
DefsReviewClosed: string;
|
|
135
|
+
DefsReviewNone: string;
|
|
134
136
|
};
|
|
135
137
|
export declare const COM_ATPROTO_MODERATION: {
|
|
136
138
|
DefsReasonSpam: string;
|
|
@@ -295,6 +297,7 @@ export declare class AppBskyNS {
|
|
|
295
297
|
embed: AppBskyEmbedNS;
|
|
296
298
|
feed: AppBskyFeedNS;
|
|
297
299
|
graph: AppBskyGraphNS;
|
|
300
|
+
labeler: AppBskyLabelerNS;
|
|
298
301
|
notification: AppBskyNotificationNS;
|
|
299
302
|
richtext: AppBskyRichtextNS;
|
|
300
303
|
unspecced: AppBskyUnspeccedNS;
|
|
@@ -353,6 +356,11 @@ export declare class AppBskyGraphNS {
|
|
|
353
356
|
unmuteActor<AV extends AuthVerifier>(cfg: ConfigOf<AV, AppBskyGraphUnmuteActor.Handler<ExtractAuth<AV>>, AppBskyGraphUnmuteActor.HandlerReqCtx<ExtractAuth<AV>>>): void;
|
|
354
357
|
unmuteActorList<AV extends AuthVerifier>(cfg: ConfigOf<AV, AppBskyGraphUnmuteActorList.Handler<ExtractAuth<AV>>, AppBskyGraphUnmuteActorList.HandlerReqCtx<ExtractAuth<AV>>>): void;
|
|
355
358
|
}
|
|
359
|
+
export declare class AppBskyLabelerNS {
|
|
360
|
+
_server: Server;
|
|
361
|
+
constructor(server: Server);
|
|
362
|
+
getServices<AV extends AuthVerifier>(cfg: ConfigOf<AV, AppBskyLabelerGetServices.Handler<ExtractAuth<AV>>, AppBskyLabelerGetServices.HandlerReqCtx<ExtractAuth<AV>>>): void;
|
|
363
|
+
}
|
|
356
364
|
export declare class AppBskyNotificationNS {
|
|
357
365
|
_server: Server;
|
|
358
366
|
constructor(server: Server);
|
|
@@ -647,6 +647,10 @@ export declare const schemaDict: {
|
|
|
647
647
|
type: string;
|
|
648
648
|
description: string;
|
|
649
649
|
};
|
|
650
|
+
reviewNone: {
|
|
651
|
+
type: string;
|
|
652
|
+
description: string;
|
|
653
|
+
};
|
|
650
654
|
modEventTakedown: {
|
|
651
655
|
type: string;
|
|
652
656
|
description: string;
|
|
@@ -2066,6 +2070,64 @@ export declare const schemaDict: {
|
|
|
2066
2070
|
};
|
|
2067
2071
|
};
|
|
2068
2072
|
};
|
|
2073
|
+
labelValueDefinition: {
|
|
2074
|
+
type: string;
|
|
2075
|
+
description: string;
|
|
2076
|
+
required: string[];
|
|
2077
|
+
properties: {
|
|
2078
|
+
identifier: {
|
|
2079
|
+
type: string;
|
|
2080
|
+
description: string;
|
|
2081
|
+
maxLength: number;
|
|
2082
|
+
maxGraphemes: number;
|
|
2083
|
+
};
|
|
2084
|
+
severity: {
|
|
2085
|
+
type: string;
|
|
2086
|
+
description: string;
|
|
2087
|
+
knownValues: string[];
|
|
2088
|
+
};
|
|
2089
|
+
blurs: {
|
|
2090
|
+
type: string;
|
|
2091
|
+
description: string;
|
|
2092
|
+
knownValues: string[];
|
|
2093
|
+
};
|
|
2094
|
+
locales: {
|
|
2095
|
+
type: string;
|
|
2096
|
+
items: {
|
|
2097
|
+
type: string;
|
|
2098
|
+
ref: string;
|
|
2099
|
+
};
|
|
2100
|
+
};
|
|
2101
|
+
};
|
|
2102
|
+
};
|
|
2103
|
+
labelValueDefinitionStrings: {
|
|
2104
|
+
type: string;
|
|
2105
|
+
description: string;
|
|
2106
|
+
required: string[];
|
|
2107
|
+
properties: {
|
|
2108
|
+
lang: {
|
|
2109
|
+
type: string;
|
|
2110
|
+
description: string;
|
|
2111
|
+
format: string;
|
|
2112
|
+
};
|
|
2113
|
+
name: {
|
|
2114
|
+
type: string;
|
|
2115
|
+
description: string;
|
|
2116
|
+
maxGraphemes: number;
|
|
2117
|
+
maxLength: number;
|
|
2118
|
+
};
|
|
2119
|
+
description: {
|
|
2120
|
+
type: string;
|
|
2121
|
+
description: string;
|
|
2122
|
+
maxGraphemes: number;
|
|
2123
|
+
maxLength: number;
|
|
2124
|
+
};
|
|
2125
|
+
};
|
|
2126
|
+
};
|
|
2127
|
+
labelValue: {
|
|
2128
|
+
type: string;
|
|
2129
|
+
knownValues: string[];
|
|
2130
|
+
};
|
|
2069
2131
|
};
|
|
2070
2132
|
};
|
|
2071
2133
|
ComAtprotoLabelQueryLabels: {
|
|
@@ -4608,6 +4670,10 @@ export declare const schemaDict: {
|
|
|
4608
4670
|
postsCount: {
|
|
4609
4671
|
type: string;
|
|
4610
4672
|
};
|
|
4673
|
+
associated: {
|
|
4674
|
+
type: string;
|
|
4675
|
+
ref: string;
|
|
4676
|
+
};
|
|
4611
4677
|
indexedAt: {
|
|
4612
4678
|
type: string;
|
|
4613
4679
|
format: string;
|
|
@@ -4625,6 +4691,20 @@ export declare const schemaDict: {
|
|
|
4625
4691
|
};
|
|
4626
4692
|
};
|
|
4627
4693
|
};
|
|
4694
|
+
profileAssociated: {
|
|
4695
|
+
type: string;
|
|
4696
|
+
properties: {
|
|
4697
|
+
lists: {
|
|
4698
|
+
type: string;
|
|
4699
|
+
};
|
|
4700
|
+
feedgens: {
|
|
4701
|
+
type: string;
|
|
4702
|
+
};
|
|
4703
|
+
labeler: {
|
|
4704
|
+
type: string;
|
|
4705
|
+
};
|
|
4706
|
+
};
|
|
4707
|
+
};
|
|
4628
4708
|
viewerState: {
|
|
4629
4709
|
type: string;
|
|
4630
4710
|
description: string;
|
|
@@ -4678,6 +4758,11 @@ export declare const schemaDict: {
|
|
|
4678
4758
|
type: string;
|
|
4679
4759
|
required: string[];
|
|
4680
4760
|
properties: {
|
|
4761
|
+
labelerDid: {
|
|
4762
|
+
type: string;
|
|
4763
|
+
description: string;
|
|
4764
|
+
format: string;
|
|
4765
|
+
};
|
|
4681
4766
|
label: {
|
|
4682
4767
|
type: string;
|
|
4683
4768
|
};
|
|
@@ -4836,6 +4921,29 @@ export declare const schemaDict: {
|
|
|
4836
4921
|
};
|
|
4837
4922
|
};
|
|
4838
4923
|
};
|
|
4924
|
+
modsPref: {
|
|
4925
|
+
type: string;
|
|
4926
|
+
required: string[];
|
|
4927
|
+
properties: {
|
|
4928
|
+
mods: {
|
|
4929
|
+
type: string;
|
|
4930
|
+
items: {
|
|
4931
|
+
type: string;
|
|
4932
|
+
ref: string;
|
|
4933
|
+
};
|
|
4934
|
+
};
|
|
4935
|
+
};
|
|
4936
|
+
};
|
|
4937
|
+
modPrefItem: {
|
|
4938
|
+
type: string;
|
|
4939
|
+
required: string[];
|
|
4940
|
+
properties: {
|
|
4941
|
+
did: {
|
|
4942
|
+
type: string;
|
|
4943
|
+
format: string;
|
|
4944
|
+
};
|
|
4945
|
+
};
|
|
4946
|
+
};
|
|
4839
4947
|
};
|
|
4840
4948
|
};
|
|
4841
4949
|
AppBskyActorGetPreferences: {
|
|
@@ -7720,6 +7828,193 @@ export declare const schemaDict: {
|
|
|
7720
7828
|
};
|
|
7721
7829
|
};
|
|
7722
7830
|
};
|
|
7831
|
+
AppBskyLabelerDefs: {
|
|
7832
|
+
lexicon: number;
|
|
7833
|
+
id: string;
|
|
7834
|
+
defs: {
|
|
7835
|
+
labelerView: {
|
|
7836
|
+
type: string;
|
|
7837
|
+
required: string[];
|
|
7838
|
+
properties: {
|
|
7839
|
+
uri: {
|
|
7840
|
+
type: string;
|
|
7841
|
+
format: string;
|
|
7842
|
+
};
|
|
7843
|
+
cid: {
|
|
7844
|
+
type: string;
|
|
7845
|
+
format: string;
|
|
7846
|
+
};
|
|
7847
|
+
creator: {
|
|
7848
|
+
type: string;
|
|
7849
|
+
ref: string;
|
|
7850
|
+
};
|
|
7851
|
+
likeCount: {
|
|
7852
|
+
type: string;
|
|
7853
|
+
minimum: number;
|
|
7854
|
+
};
|
|
7855
|
+
viewer: {
|
|
7856
|
+
type: string;
|
|
7857
|
+
ref: string;
|
|
7858
|
+
};
|
|
7859
|
+
indexedAt: {
|
|
7860
|
+
type: string;
|
|
7861
|
+
format: string;
|
|
7862
|
+
};
|
|
7863
|
+
labels: {
|
|
7864
|
+
type: string;
|
|
7865
|
+
items: {
|
|
7866
|
+
type: string;
|
|
7867
|
+
ref: string;
|
|
7868
|
+
};
|
|
7869
|
+
};
|
|
7870
|
+
};
|
|
7871
|
+
};
|
|
7872
|
+
labelerViewDetailed: {
|
|
7873
|
+
type: string;
|
|
7874
|
+
required: string[];
|
|
7875
|
+
properties: {
|
|
7876
|
+
uri: {
|
|
7877
|
+
type: string;
|
|
7878
|
+
format: string;
|
|
7879
|
+
};
|
|
7880
|
+
cid: {
|
|
7881
|
+
type: string;
|
|
7882
|
+
format: string;
|
|
7883
|
+
};
|
|
7884
|
+
creator: {
|
|
7885
|
+
type: string;
|
|
7886
|
+
ref: string;
|
|
7887
|
+
};
|
|
7888
|
+
policies: {
|
|
7889
|
+
type: string;
|
|
7890
|
+
ref: string;
|
|
7891
|
+
};
|
|
7892
|
+
likeCount: {
|
|
7893
|
+
type: string;
|
|
7894
|
+
minimum: number;
|
|
7895
|
+
};
|
|
7896
|
+
viewer: {
|
|
7897
|
+
type: string;
|
|
7898
|
+
ref: string;
|
|
7899
|
+
};
|
|
7900
|
+
indexedAt: {
|
|
7901
|
+
type: string;
|
|
7902
|
+
format: string;
|
|
7903
|
+
};
|
|
7904
|
+
labels: {
|
|
7905
|
+
type: string;
|
|
7906
|
+
items: {
|
|
7907
|
+
type: string;
|
|
7908
|
+
ref: string;
|
|
7909
|
+
};
|
|
7910
|
+
};
|
|
7911
|
+
};
|
|
7912
|
+
};
|
|
7913
|
+
labelerViewerState: {
|
|
7914
|
+
type: string;
|
|
7915
|
+
properties: {
|
|
7916
|
+
like: {
|
|
7917
|
+
type: string;
|
|
7918
|
+
format: string;
|
|
7919
|
+
};
|
|
7920
|
+
};
|
|
7921
|
+
};
|
|
7922
|
+
labelerPolicies: {
|
|
7923
|
+
type: string;
|
|
7924
|
+
required: string[];
|
|
7925
|
+
properties: {
|
|
7926
|
+
labelValues: {
|
|
7927
|
+
type: string;
|
|
7928
|
+
description: string;
|
|
7929
|
+
items: {
|
|
7930
|
+
type: string;
|
|
7931
|
+
ref: string;
|
|
7932
|
+
};
|
|
7933
|
+
};
|
|
7934
|
+
labelValueDefinitions: {
|
|
7935
|
+
type: string;
|
|
7936
|
+
description: string;
|
|
7937
|
+
items: {
|
|
7938
|
+
type: string;
|
|
7939
|
+
ref: string;
|
|
7940
|
+
};
|
|
7941
|
+
};
|
|
7942
|
+
};
|
|
7943
|
+
};
|
|
7944
|
+
};
|
|
7945
|
+
};
|
|
7946
|
+
AppBskyLabelerGetServices: {
|
|
7947
|
+
lexicon: number;
|
|
7948
|
+
id: string;
|
|
7949
|
+
defs: {
|
|
7950
|
+
main: {
|
|
7951
|
+
type: string;
|
|
7952
|
+
description: string;
|
|
7953
|
+
parameters: {
|
|
7954
|
+
type: string;
|
|
7955
|
+
required: string[];
|
|
7956
|
+
properties: {
|
|
7957
|
+
dids: {
|
|
7958
|
+
type: string;
|
|
7959
|
+
items: {
|
|
7960
|
+
type: string;
|
|
7961
|
+
format: string;
|
|
7962
|
+
};
|
|
7963
|
+
};
|
|
7964
|
+
detailed: {
|
|
7965
|
+
type: string;
|
|
7966
|
+
default: boolean;
|
|
7967
|
+
};
|
|
7968
|
+
};
|
|
7969
|
+
};
|
|
7970
|
+
output: {
|
|
7971
|
+
encoding: string;
|
|
7972
|
+
schema: {
|
|
7973
|
+
type: string;
|
|
7974
|
+
required: string[];
|
|
7975
|
+
properties: {
|
|
7976
|
+
views: {
|
|
7977
|
+
type: string;
|
|
7978
|
+
items: {
|
|
7979
|
+
type: string;
|
|
7980
|
+
refs: string[];
|
|
7981
|
+
};
|
|
7982
|
+
};
|
|
7983
|
+
};
|
|
7984
|
+
};
|
|
7985
|
+
};
|
|
7986
|
+
};
|
|
7987
|
+
};
|
|
7988
|
+
};
|
|
7989
|
+
AppBskyLabelerService: {
|
|
7990
|
+
lexicon: number;
|
|
7991
|
+
id: string;
|
|
7992
|
+
defs: {
|
|
7993
|
+
main: {
|
|
7994
|
+
type: string;
|
|
7995
|
+
description: string;
|
|
7996
|
+
key: string;
|
|
7997
|
+
record: {
|
|
7998
|
+
type: string;
|
|
7999
|
+
required: string[];
|
|
8000
|
+
properties: {
|
|
8001
|
+
policies: {
|
|
8002
|
+
type: string;
|
|
8003
|
+
ref: string;
|
|
8004
|
+
};
|
|
8005
|
+
labels: {
|
|
8006
|
+
type: string;
|
|
8007
|
+
refs: string[];
|
|
8008
|
+
};
|
|
8009
|
+
createdAt: {
|
|
8010
|
+
type: string;
|
|
8011
|
+
format: string;
|
|
8012
|
+
};
|
|
8013
|
+
};
|
|
8014
|
+
};
|
|
8015
|
+
};
|
|
8016
|
+
};
|
|
8017
|
+
};
|
|
7723
8018
|
AppBskyNotificationGetUnreadCount: {
|
|
7724
8019
|
lexicon: number;
|
|
7725
8020
|
id: string;
|
|
@@ -8357,6 +8652,9 @@ export declare const ids: {
|
|
|
8357
8652
|
AppBskyGraphMuteActorList: string;
|
|
8358
8653
|
AppBskyGraphUnmuteActor: string;
|
|
8359
8654
|
AppBskyGraphUnmuteActorList: string;
|
|
8655
|
+
AppBskyLabelerDefs: string;
|
|
8656
|
+
AppBskyLabelerGetServices: string;
|
|
8657
|
+
AppBskyLabelerService: string;
|
|
8360
8658
|
AppBskyNotificationGetUnreadCount: string;
|
|
8361
8659
|
AppBskyNotificationListNotifications: string;
|
|
8362
8660
|
AppBskyNotificationRegisterPush: string;
|
|
@@ -35,6 +35,7 @@ export interface ProfileViewDetailed {
|
|
|
35
35
|
followersCount?: number;
|
|
36
36
|
followsCount?: number;
|
|
37
37
|
postsCount?: number;
|
|
38
|
+
associated?: ProfileAssociated;
|
|
38
39
|
indexedAt?: string;
|
|
39
40
|
viewer?: ViewerState;
|
|
40
41
|
labels?: ComAtprotoLabelDefs.Label[];
|
|
@@ -42,6 +43,14 @@ export interface ProfileViewDetailed {
|
|
|
42
43
|
}
|
|
43
44
|
export declare function isProfileViewDetailed(v: unknown): v is ProfileViewDetailed;
|
|
44
45
|
export declare function validateProfileViewDetailed(v: unknown): ValidationResult;
|
|
46
|
+
export interface ProfileAssociated {
|
|
47
|
+
lists?: number;
|
|
48
|
+
feedgens?: number;
|
|
49
|
+
labeler?: boolean;
|
|
50
|
+
[k: string]: unknown;
|
|
51
|
+
}
|
|
52
|
+
export declare function isProfileAssociated(v: unknown): v is ProfileAssociated;
|
|
53
|
+
export declare function validateProfileAssociated(v: unknown): ValidationResult;
|
|
45
54
|
export interface ViewerState {
|
|
46
55
|
muted?: boolean;
|
|
47
56
|
mutedByList?: AppBskyGraphDefs.ListViewBasic;
|
|
@@ -65,8 +74,9 @@ export interface AdultContentPref {
|
|
|
65
74
|
export declare function isAdultContentPref(v: unknown): v is AdultContentPref;
|
|
66
75
|
export declare function validateAdultContentPref(v: unknown): ValidationResult;
|
|
67
76
|
export interface ContentLabelPref {
|
|
77
|
+
labelerDid?: string;
|
|
68
78
|
label: string;
|
|
69
|
-
visibility: 'show' | 'warn' | 'hide' | (string & {});
|
|
79
|
+
visibility: 'ignore' | 'show' | 'warn' | 'hide' | (string & {});
|
|
70
80
|
[k: string]: unknown;
|
|
71
81
|
}
|
|
72
82
|
export declare function isContentLabelPref(v: unknown): v is ContentLabelPref;
|
|
@@ -129,3 +139,15 @@ export interface HiddenPostsPref {
|
|
|
129
139
|
}
|
|
130
140
|
export declare function isHiddenPostsPref(v: unknown): v is HiddenPostsPref;
|
|
131
141
|
export declare function validateHiddenPostsPref(v: unknown): ValidationResult;
|
|
142
|
+
export interface ModsPref {
|
|
143
|
+
mods: ModPrefItem[];
|
|
144
|
+
[k: string]: unknown;
|
|
145
|
+
}
|
|
146
|
+
export declare function isModsPref(v: unknown): v is ModsPref;
|
|
147
|
+
export declare function validateModsPref(v: unknown): ValidationResult;
|
|
148
|
+
export interface ModPrefItem {
|
|
149
|
+
did: string;
|
|
150
|
+
[k: string]: unknown;
|
|
151
|
+
}
|
|
152
|
+
export declare function isModPrefItem(v: unknown): v is ModPrefItem;
|
|
153
|
+
export declare function validateModPrefItem(v: unknown): ValidationResult;
|
|
@@ -2,6 +2,7 @@ import { ValidationResult } from '@atproto/lexicon';
|
|
|
2
2
|
import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef';
|
|
3
3
|
import * as AppBskyFeedDefs from '../feed/defs';
|
|
4
4
|
import * as AppBskyGraphDefs from '../graph/defs';
|
|
5
|
+
import * as AppBskyLabelerDefs from '../labeler/defs';
|
|
5
6
|
import * as AppBskyActorDefs from '../actor/defs';
|
|
6
7
|
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs';
|
|
7
8
|
import * as AppBskyEmbedImages from './images';
|
|
@@ -14,7 +15,7 @@ export interface Main {
|
|
|
14
15
|
export declare function isMain(v: unknown): v is Main;
|
|
15
16
|
export declare function validateMain(v: unknown): ValidationResult;
|
|
16
17
|
export interface View {
|
|
17
|
-
record: ViewRecord | ViewNotFound | ViewBlocked | AppBskyFeedDefs.GeneratorView | AppBskyGraphDefs.ListView | {
|
|
18
|
+
record: ViewRecord | ViewNotFound | ViewBlocked | AppBskyFeedDefs.GeneratorView | AppBskyGraphDefs.ListView | AppBskyLabelerDefs.LabelerView | {
|
|
18
19
|
$type: string;
|
|
19
20
|
[k: string]: unknown;
|
|
20
21
|
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ValidationResult } from '@atproto/lexicon';
|
|
2
|
+
import * as AppBskyActorDefs from '../actor/defs';
|
|
3
|
+
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs';
|
|
4
|
+
export interface LabelerView {
|
|
5
|
+
uri: string;
|
|
6
|
+
cid: string;
|
|
7
|
+
creator: AppBskyActorDefs.ProfileView;
|
|
8
|
+
likeCount?: number;
|
|
9
|
+
viewer?: LabelerViewerState;
|
|
10
|
+
indexedAt: string;
|
|
11
|
+
labels?: ComAtprotoLabelDefs.Label[];
|
|
12
|
+
[k: string]: unknown;
|
|
13
|
+
}
|
|
14
|
+
export declare function isLabelerView(v: unknown): v is LabelerView;
|
|
15
|
+
export declare function validateLabelerView(v: unknown): ValidationResult;
|
|
16
|
+
export interface LabelerViewDetailed {
|
|
17
|
+
uri: string;
|
|
18
|
+
cid: string;
|
|
19
|
+
creator: AppBskyActorDefs.ProfileView;
|
|
20
|
+
policies: LabelerPolicies;
|
|
21
|
+
likeCount?: number;
|
|
22
|
+
viewer?: LabelerViewerState;
|
|
23
|
+
indexedAt: string;
|
|
24
|
+
labels?: ComAtprotoLabelDefs.Label[];
|
|
25
|
+
[k: string]: unknown;
|
|
26
|
+
}
|
|
27
|
+
export declare function isLabelerViewDetailed(v: unknown): v is LabelerViewDetailed;
|
|
28
|
+
export declare function validateLabelerViewDetailed(v: unknown): ValidationResult;
|
|
29
|
+
export interface LabelerViewerState {
|
|
30
|
+
like?: string;
|
|
31
|
+
[k: string]: unknown;
|
|
32
|
+
}
|
|
33
|
+
export declare function isLabelerViewerState(v: unknown): v is LabelerViewerState;
|
|
34
|
+
export declare function validateLabelerViewerState(v: unknown): ValidationResult;
|
|
35
|
+
export interface LabelerPolicies {
|
|
36
|
+
labelValues: ComAtprotoLabelDefs.LabelValue[];
|
|
37
|
+
labelValueDefinitions?: ComAtprotoLabelDefs.LabelValueDefinition[];
|
|
38
|
+
[k: string]: unknown;
|
|
39
|
+
}
|
|
40
|
+
export declare function isLabelerPolicies(v: unknown): v is LabelerPolicies;
|
|
41
|
+
export declare function validateLabelerPolicies(v: unknown): ValidationResult;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import express from 'express';
|
|
2
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
|
3
|
+
import * as AppBskyLabelerDefs from './defs';
|
|
4
|
+
export interface QueryParams {
|
|
5
|
+
dids: string[];
|
|
6
|
+
detailed: boolean;
|
|
7
|
+
}
|
|
8
|
+
export type InputSchema = undefined;
|
|
9
|
+
export interface OutputSchema {
|
|
10
|
+
views: (AppBskyLabelerDefs.LabelerView | AppBskyLabelerDefs.LabelerViewDetailed | {
|
|
11
|
+
$type: string;
|
|
12
|
+
[k: string]: unknown;
|
|
13
|
+
})[];
|
|
14
|
+
[k: string]: unknown;
|
|
15
|
+
}
|
|
16
|
+
export type HandlerInput = undefined;
|
|
17
|
+
export interface HandlerSuccess {
|
|
18
|
+
encoding: 'application/json';
|
|
19
|
+
body: OutputSchema;
|
|
20
|
+
headers?: {
|
|
21
|
+
[key: string]: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface HandlerError {
|
|
25
|
+
status: number;
|
|
26
|
+
message?: string;
|
|
27
|
+
}
|
|
28
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
|
29
|
+
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
30
|
+
auth: HA;
|
|
31
|
+
params: QueryParams;
|
|
32
|
+
input: HandlerInput;
|
|
33
|
+
req: express.Request;
|
|
34
|
+
res: express.Response;
|
|
35
|
+
};
|
|
36
|
+
export type Handler<HA extends HandlerAuth = never> = (ctx: HandlerReqCtx<HA>) => Promise<HandlerOutput> | HandlerOutput;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ValidationResult } from '@atproto/lexicon';
|
|
2
|
+
import * as AppBskyLabelerDefs from './defs';
|
|
3
|
+
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs';
|
|
4
|
+
export interface Record {
|
|
5
|
+
policies: AppBskyLabelerDefs.LabelerPolicies;
|
|
6
|
+
labels?: ComAtprotoLabelDefs.SelfLabels | {
|
|
7
|
+
$type: string;
|
|
8
|
+
[k: string]: unknown;
|
|
9
|
+
};
|
|
10
|
+
createdAt: string;
|
|
11
|
+
[k: string]: unknown;
|
|
12
|
+
}
|
|
13
|
+
export declare function isRecord(v: unknown): v is Record;
|
|
14
|
+
export declare function validateRecord(v: unknown): ValidationResult;
|
|
@@ -241,10 +241,11 @@ export interface VideoDetails {
|
|
|
241
241
|
}
|
|
242
242
|
export declare function isVideoDetails(v: unknown): v is VideoDetails;
|
|
243
243
|
export declare function validateVideoDetails(v: unknown): ValidationResult;
|
|
244
|
-
export type SubjectReviewState = 'lex:com.atproto.admin.defs#reviewOpen' | 'lex:com.atproto.admin.defs#reviewEscalated' | 'lex:com.atproto.admin.defs#reviewClosed' | (string & {});
|
|
244
|
+
export type SubjectReviewState = 'lex:com.atproto.admin.defs#reviewOpen' | 'lex:com.atproto.admin.defs#reviewEscalated' | 'lex:com.atproto.admin.defs#reviewClosed' | 'lex:com.atproto.admin.defs#reviewNone' | (string & {});
|
|
245
245
|
export declare const REVIEWOPEN = "com.atproto.admin.defs#reviewOpen";
|
|
246
246
|
export declare const REVIEWESCALATED = "com.atproto.admin.defs#reviewEscalated";
|
|
247
247
|
export declare const REVIEWCLOSED = "com.atproto.admin.defs#reviewClosed";
|
|
248
|
+
export declare const REVIEWNONE = "com.atproto.admin.defs#reviewNone";
|
|
248
249
|
export interface ModEventTakedown {
|
|
249
250
|
comment?: string;
|
|
250
251
|
durationInHours?: number;
|
|
@@ -22,3 +22,21 @@ export interface SelfLabel {
|
|
|
22
22
|
}
|
|
23
23
|
export declare function isSelfLabel(v: unknown): v is SelfLabel;
|
|
24
24
|
export declare function validateSelfLabel(v: unknown): ValidationResult;
|
|
25
|
+
export interface LabelValueDefinition {
|
|
26
|
+
identifier: string;
|
|
27
|
+
severity: 'inform' | 'alert' | 'none' | (string & {});
|
|
28
|
+
blurs: 'content' | 'media' | 'none' | (string & {});
|
|
29
|
+
locales: LabelValueDefinitionStrings[];
|
|
30
|
+
[k: string]: unknown;
|
|
31
|
+
}
|
|
32
|
+
export declare function isLabelValueDefinition(v: unknown): v is LabelValueDefinition;
|
|
33
|
+
export declare function validateLabelValueDefinition(v: unknown): ValidationResult;
|
|
34
|
+
export interface LabelValueDefinitionStrings {
|
|
35
|
+
lang: string;
|
|
36
|
+
name: string;
|
|
37
|
+
description: string;
|
|
38
|
+
[k: string]: unknown;
|
|
39
|
+
}
|
|
40
|
+
export declare function isLabelValueDefinitionStrings(v: unknown): v is LabelValueDefinitionStrings;
|
|
41
|
+
export declare function validateLabelValueDefinitionStrings(v: unknown): ValidationResult;
|
|
42
|
+
export type LabelValue = '!hide' | '!no-promote' | '!warn' | '!no-unauthenticated' | 'dmca-violation' | 'doxxing' | 'porn' | 'sexual' | 'nudity' | 'nsfl' | 'gore' | (string & {});
|
|
@@ -64,7 +64,7 @@ export declare class ModerationService {
|
|
|
64
64
|
did: string;
|
|
65
65
|
createdAt: string;
|
|
66
66
|
updatedAt: string;
|
|
67
|
-
reviewState: "com.atproto.admin.defs#reviewOpen" | "com.atproto.admin.defs#reviewEscalated" | "com.atproto.admin.defs#reviewClosed";
|
|
67
|
+
reviewState: "com.atproto.admin.defs#reviewOpen" | "com.atproto.admin.defs#reviewEscalated" | "com.atproto.admin.defs#reviewClosed" | "com.atproto.admin.defs#reviewNone";
|
|
68
68
|
blobCids: string[] | null;
|
|
69
69
|
comment: string | null;
|
|
70
70
|
lastReportedAt: string | null;
|
|
@@ -150,7 +150,7 @@ export declare class ModerationService {
|
|
|
150
150
|
did: string;
|
|
151
151
|
createdAt: string;
|
|
152
152
|
updatedAt: string;
|
|
153
|
-
reviewState: "com.atproto.admin.defs#reviewOpen" | "com.atproto.admin.defs#reviewEscalated" | "com.atproto.admin.defs#reviewClosed";
|
|
153
|
+
reviewState: "com.atproto.admin.defs#reviewOpen" | "com.atproto.admin.defs#reviewEscalated" | "com.atproto.admin.defs#reviewClosed" | "com.atproto.admin.defs#reviewNone";
|
|
154
154
|
blobCids: string[] | null;
|
|
155
155
|
comment: string | null;
|
|
156
156
|
lastReportedAt: string | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/ozone",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17-next.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Backend service for moderating the Bluesky network.",
|
|
6
6
|
"keywords": [
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
"uint8arrays": "3.0.0",
|
|
33
33
|
"@atproto/api": "^0.10.5",
|
|
34
34
|
"@atproto/common": "^0.3.3",
|
|
35
|
-
"@atproto/crypto": "^0.3.0",
|
|
36
35
|
"@atproto/identity": "^0.3.2",
|
|
37
36
|
"@atproto/lexicon": "^0.3.2",
|
|
37
|
+
"@atproto/xrpc-server": "^0.4.3",
|
|
38
38
|
"@atproto/syntax": "^0.2.0",
|
|
39
|
-
"@atproto/
|
|
39
|
+
"@atproto/crypto": "^0.3.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@did-plc/server": "^0.0.1",
|
|
@@ -46,8 +46,9 @@
|
|
|
46
46
|
"@types/pg": "^8.6.6",
|
|
47
47
|
"@types/qs": "^6.9.7",
|
|
48
48
|
"axios": "^0.27.2",
|
|
49
|
-
"
|
|
49
|
+
"nodemailer": "^6.8.0",
|
|
50
50
|
"@atproto/dev-env": "^0.2.37",
|
|
51
|
+
"@atproto/api": "^0.10.5",
|
|
51
52
|
"@atproto/lex-cli": "^0.3.1",
|
|
52
53
|
"@atproto/pds": "^0.4.5",
|
|
53
54
|
"@atproto/xrpc": "^0.4.2"
|
|
@@ -4,7 +4,7 @@ import AppContext from '../../context'
|
|
|
4
4
|
|
|
5
5
|
export default function (server: Server, ctx: AppContext) {
|
|
6
6
|
server.com.atproto.admin.createCommunicationTemplate({
|
|
7
|
-
auth: ctx.authVerifier.
|
|
7
|
+
auth: ctx.authVerifier.modOrAdminToken,
|
|
8
8
|
handler: async ({ input, auth }) => {
|
|
9
9
|
const access = auth.credentials
|
|
10
10
|
const db = ctx.db
|
|
@@ -4,7 +4,7 @@ import AppContext from '../../context'
|
|
|
4
4
|
|
|
5
5
|
export default function (server: Server, ctx: AppContext) {
|
|
6
6
|
server.com.atproto.admin.deleteCommunicationTemplate({
|
|
7
|
-
auth: ctx.authVerifier.
|
|
7
|
+
auth: ctx.authVerifier.modOrAdminToken,
|
|
8
8
|
handler: async ({ input, auth }) => {
|
|
9
9
|
const access = auth.credentials
|
|
10
10
|
const db = ctx.db
|
|
@@ -13,12 +13,16 @@ import { retryHttp } from '../../util'
|
|
|
13
13
|
|
|
14
14
|
export default function (server: Server, ctx: AppContext) {
|
|
15
15
|
server.com.atproto.admin.emitModerationEvent({
|
|
16
|
-
auth: ctx.authVerifier.
|
|
16
|
+
auth: ctx.authVerifier.modOrAdminToken,
|
|
17
17
|
handler: async ({ input, auth }) => {
|
|
18
18
|
const access = auth.credentials
|
|
19
|
+
const createdBy =
|
|
20
|
+
auth.credentials.type === 'moderator'
|
|
21
|
+
? auth.credentials.iss
|
|
22
|
+
: input.body.createdBy
|
|
19
23
|
const db = ctx.db
|
|
20
24
|
const moderationService = ctx.modService(db)
|
|
21
|
-
const {
|
|
25
|
+
const { event } = input.body
|
|
22
26
|
const isTakedownEvent = isModEventTakedown(event)
|
|
23
27
|
const isReverseTakedownEvent = isModEventReverseTakedown(event)
|
|
24
28
|
const isLabelEvent = isModEventLabel(event)
|