1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import Foundation
import XCTest
@testable import OldFella
final class ModerationPreferenceTestState {
var failDefinitions = false
var omitLabeler = false
var malformedDefinitions = false
var clock = Date(timeIntervalSince1970: 1_700_000_000)
}
enum ModerationPreferenceResponses {
static let preferences = """
{
"preferences": [
{
"$type": "app.bsky.actor.defs#adultContentPref",
"enabled": true
},
{
"$type": "app.bsky.actor.defs#contentLabelPref",
"label": "nudity",
"visibility": "hide"
},
{
"$type": "app.bsky.actor.defs#contentLabelPref",
"labelerDid": "did:plc:labels",
"label": "custom",
"visibility": "warn"
},
{
"$type": "app.bsky.actor.defs#labelersPref",
"labelers": [
{
"did": "did:plc:labels"
}
]
},
{
"$type": "app.bsky.actor.defs#mutedWordsPref",
"items": [
{
"value": "spoiler",
"targets": [
"content"
],
"actorTarget": "exclude-following"
}
]
}
]
}
"""
static let definitions = """
{
"views": [
{
"uri": "at://did:plc:labels/app.bsky.labeler.service/self",
"cid": "cid",
"creator": {
"did": "did:plc:labels",
"handle": "labels.example"
},
"indexedAt": "2024-05-06T12:34:56Z",
"policies": {
"labelValues": [
"custom"
],
"labelValueDefinitions": [
{
"identifier": "custom",
"severity": "alert",
"blurs": "content",
"defaultSetting": "inform",
"adultOnly": true,
"locales": [
{
"lang": "en",
"name": "Custom",
"description": "Custom label"
}
]
}
]
}
},
{
"uri": "at://did:plc:ar7c4by46qjdydhdevvrndac/app.bsky.labeler.service/self",
"cid": "cid",
"creator": {
"did": "did:plc:ar7c4by46qjdydhdevvrndac",
"handle": "moderation.bsky.app"
},
"indexedAt": "2024-05-06T12:34:56Z",
"policies": {
"labelValues": [],
"labelValueDefinitions": []
}
}
]
}
"""
}