@atproto/ozone 0.1.73 → 0.1.75
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 +35 -0
- package/bin/migration-create.ts +2 -2
- package/dist/api/chat/getActorMetadata.d.ts +1 -1
- package/dist/api/chat/getActorMetadata.d.ts.map +1 -1
- package/dist/api/chat/getActorMetadata.js.map +1 -1
- package/dist/api/chat/getMessageContext.d.ts +1 -1
- package/dist/api/chat/getMessageContext.d.ts.map +1 -1
- package/dist/api/chat/getMessageContext.js.map +1 -1
- package/dist/api/chat/index.d.ts +1 -1
- package/dist/api/chat/index.d.ts.map +1 -1
- package/dist/api/communication/createTemplate.d.ts +1 -1
- package/dist/api/communication/createTemplate.d.ts.map +1 -1
- package/dist/api/communication/createTemplate.js.map +1 -1
- package/dist/api/communication/deleteTemplate.d.ts +1 -1
- package/dist/api/communication/deleteTemplate.d.ts.map +1 -1
- package/dist/api/communication/listTemplates.d.ts +1 -1
- package/dist/api/communication/listTemplates.d.ts.map +1 -1
- package/dist/api/communication/updateTemplate.d.ts +1 -1
- package/dist/api/communication/updateTemplate.d.ts.map +1 -1
- package/dist/api/communication/updateTemplate.js.map +1 -1
- package/dist/api/health.d.ts +3 -3
- package/dist/api/health.d.ts.map +1 -1
- package/dist/api/health.js +2 -5
- package/dist/api/health.js.map +1 -1
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +20 -20
- package/dist/api/index.js.map +1 -1
- package/dist/api/label/fetchLabels.d.ts +1 -1
- package/dist/api/label/fetchLabels.d.ts.map +1 -1
- package/dist/api/label/queryLabels.d.ts +1 -1
- package/dist/api/label/queryLabels.d.ts.map +1 -1
- package/dist/api/label/queryLabels.js +1 -1
- package/dist/api/label/queryLabels.js.map +1 -1
- package/dist/api/label/subscribeLabels.d.ts +1 -1
- package/dist/api/label/subscribeLabels.d.ts.map +1 -1
- package/dist/api/label/subscribeLabels.js +2 -5
- package/dist/api/label/subscribeLabels.js.map +1 -1
- package/dist/api/moderation/emitEvent.d.ts +1 -1
- package/dist/api/moderation/emitEvent.d.ts.map +1 -1
- package/dist/api/moderation/emitEvent.js +6 -6
- package/dist/api/moderation/emitEvent.js.map +1 -1
- package/dist/api/moderation/getEvent.d.ts +1 -1
- package/dist/api/moderation/getEvent.d.ts.map +1 -1
- package/dist/api/moderation/getRecord.d.ts +1 -1
- package/dist/api/moderation/getRecord.d.ts.map +1 -1
- package/dist/api/moderation/getRecord.js +1 -1
- package/dist/api/moderation/getRecord.js.map +1 -1
- package/dist/api/moderation/getRecords.d.ts +1 -1
- package/dist/api/moderation/getRecords.d.ts.map +1 -1
- package/dist/api/moderation/getRecords.js +1 -1
- package/dist/api/moderation/getRecords.js.map +1 -1
- package/dist/api/moderation/getRepo.d.ts +1 -1
- package/dist/api/moderation/getRepo.d.ts.map +1 -1
- package/dist/api/moderation/getRepos.d.ts +1 -1
- package/dist/api/moderation/getRepos.d.ts.map +1 -1
- package/dist/api/moderation/queryEvents.d.ts +1 -1
- package/dist/api/moderation/queryEvents.d.ts.map +1 -1
- package/dist/api/moderation/queryStatuses.d.ts +1 -1
- package/dist/api/moderation/queryStatuses.d.ts.map +1 -1
- package/dist/api/moderation/searchRepos.d.ts +1 -1
- package/dist/api/moderation/searchRepos.d.ts.map +1 -1
- package/dist/api/moderation/searchRepos.js.map +1 -1
- package/dist/api/proxied.d.ts +1 -1
- package/dist/api/proxied.d.ts.map +1 -1
- package/dist/api/report/createReport.d.ts +1 -1
- package/dist/api/report/createReport.d.ts.map +1 -1
- package/dist/api/report/createReport.js +6 -6
- package/dist/api/report/createReport.js.map +1 -1
- package/dist/api/server/getConfig.d.ts +1 -1
- package/dist/api/server/getConfig.d.ts.map +1 -1
- package/dist/api/server/getConfig.js.map +1 -1
- package/dist/api/set/addValues.d.ts +1 -1
- package/dist/api/set/addValues.d.ts.map +1 -1
- package/dist/api/set/deleteSet.d.ts +1 -1
- package/dist/api/set/deleteSet.d.ts.map +1 -1
- package/dist/api/set/deleteValues.d.ts +1 -1
- package/dist/api/set/deleteValues.d.ts.map +1 -1
- package/dist/api/set/getValues.d.ts +1 -1
- package/dist/api/set/getValues.d.ts.map +1 -1
- package/dist/api/set/querySets.d.ts +1 -1
- package/dist/api/set/querySets.d.ts.map +1 -1
- package/dist/api/set/upsertSet.d.ts +1 -1
- package/dist/api/set/upsertSet.d.ts.map +1 -1
- package/dist/api/setting/listOptions.d.ts +1 -1
- package/dist/api/setting/listOptions.d.ts.map +1 -1
- package/dist/api/setting/removeOptions.d.ts +1 -1
- package/dist/api/setting/removeOptions.d.ts.map +1 -1
- package/dist/api/setting/upsertOption.d.ts +1 -1
- package/dist/api/setting/upsertOption.d.ts.map +1 -1
- package/dist/api/setting/upsertOption.js +2 -2
- package/dist/api/setting/upsertOption.js.map +1 -1
- package/dist/api/team/addMember.d.ts +1 -1
- package/dist/api/team/addMember.d.ts.map +1 -1
- package/dist/api/team/deleteMember.d.ts +1 -1
- package/dist/api/team/deleteMember.d.ts.map +1 -1
- package/dist/api/team/listMembers.d.ts +1 -1
- package/dist/api/team/listMembers.d.ts.map +1 -1
- package/dist/api/team/updateMember.d.ts +1 -1
- package/dist/api/team/updateMember.d.ts.map +1 -1
- package/dist/api/util.d.ts +4 -4
- package/dist/api/util.d.ts.map +1 -1
- package/dist/api/util.js +4 -1
- package/dist/api/util.js.map +1 -1
- package/dist/api/well-known.d.ts +3 -3
- package/dist/api/well-known.d.ts.map +1 -1
- package/dist/api/well-known.js +2 -5
- package/dist/api/well-known.js.map +1 -1
- package/dist/background.d.ts.map +1 -1
- package/dist/background.js +0 -2
- package/dist/background.js.map +1 -1
- package/dist/communication-service/template.d.ts +1 -1
- package/dist/communication-service/template.d.ts.map +1 -1
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js.map +1 -1
- package/dist/config/secrets.js +3 -3
- package/dist/config/secrets.js.map +1 -1
- package/dist/context.d.ts +9 -10
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +11 -12
- package/dist/context.js.map +1 -1
- package/dist/daemon/blob-diverter.d.ts +2 -2
- package/dist/daemon/blob-diverter.d.ts.map +1 -1
- package/dist/daemon/blob-diverter.js +3 -3
- package/dist/daemon/blob-diverter.js.map +1 -1
- package/dist/daemon/context.d.ts +1 -2
- package/dist/daemon/context.d.ts.map +1 -1
- package/dist/daemon/context.js +6 -7
- package/dist/daemon/context.js.map +1 -1
- package/dist/daemon/event-pusher.d.ts +3 -3
- package/dist/daemon/event-pusher.d.ts.map +1 -1
- package/dist/daemon/event-pusher.js +2 -2
- package/dist/daemon/event-pusher.js.map +1 -1
- package/dist/daemon/event-reverser.d.ts +1 -1
- package/dist/daemon/event-reverser.d.ts.map +1 -1
- package/dist/daemon/event-reverser.js.map +1 -1
- package/dist/daemon/index.d.ts +1 -1
- package/dist/daemon/index.d.ts.map +1 -1
- package/dist/daemon/index.js +2 -5
- package/dist/daemon/index.js.map +1 -1
- package/dist/daemon/materialized-view-refresher.js +1 -1
- package/dist/daemon/materialized-view-refresher.js.map +1 -1
- package/dist/db/index.d.ts +2 -2
- package/dist/db/index.d.ts.map +1 -1
- package/dist/db/index.js +5 -5
- package/dist/db/index.js.map +1 -1
- package/dist/db/migrations/20241220T144630860Z-stats-materialized-views.d.ts.map +1 -1
- package/dist/db/migrations/20241220T144630860Z-stats-materialized-views.js.map +1 -1
- package/dist/db/schema/index.d.ts +11 -11
- package/dist/db/schema/index.d.ts.map +1 -1
- package/dist/db/schema/moderation_subject_status.d.ts +1 -1
- package/dist/db/schema/moderation_subject_status.d.ts.map +1 -1
- package/dist/db/types.d.ts +1 -1
- package/dist/db/types.d.ts.map +1 -1
- package/dist/db/types.js.map +1 -1
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/lexicon/lexicons.d.ts +64 -2
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +36 -0
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/app/bsky/actor/defs.d.ts +19 -1
- package/dist/lexicon/types/app/bsky/actor/defs.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/actor/defs.js +10 -0
- package/dist/lexicon/types/app/bsky/actor/defs.js.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/postgate.d.ts +1 -0
- package/dist/lexicon/types/app/bsky/feed/postgate.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/postgate.js.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/threadgate.d.ts +1 -0
- package/dist/lexicon/types/app/bsky/feed/threadgate.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/threadgate.js.map +1 -1
- package/dist/lexicon/types/tools/ozone/moderation/defs.d.ts +2 -0
- package/dist/lexicon/types/tools/ozone/moderation/defs.d.ts.map +1 -1
- package/dist/lexicon/types/tools/ozone/moderation/defs.js.map +1 -1
- package/dist/logger.js +2 -25
- package/dist/logger.js.map +1 -1
- package/dist/mod-service/index.d.ts +32 -32
- package/dist/mod-service/index.d.ts.map +1 -1
- package/dist/mod-service/index.js +19 -15
- package/dist/mod-service/index.js.map +1 -1
- package/dist/mod-service/status.d.ts +24 -24
- package/dist/mod-service/status.d.ts.map +1 -1
- package/dist/mod-service/status.js +2 -0
- package/dist/mod-service/status.js.map +1 -1
- package/dist/mod-service/subject.d.ts +3 -3
- package/dist/mod-service/subject.d.ts.map +1 -1
- package/dist/mod-service/subject.js.map +1 -1
- package/dist/mod-service/types.d.ts +2 -2
- package/dist/mod-service/types.d.ts.map +1 -1
- package/dist/mod-service/views.d.ts +6 -6
- package/dist/mod-service/views.d.ts.map +1 -1
- package/dist/mod-service/views.js +8 -8
- package/dist/mod-service/views.js.map +1 -1
- package/dist/sequencer/outbox.d.ts +1 -2
- package/dist/sequencer/outbox.d.ts.map +1 -1
- package/dist/sequencer/outbox.js +0 -1
- package/dist/sequencer/outbox.js.map +1 -1
- package/dist/sequencer/sequencer.d.ts +3 -4
- package/dist/sequencer/sequencer.d.ts.map +1 -1
- package/dist/sequencer/sequencer.js +3 -4
- package/dist/sequencer/sequencer.js.map +1 -1
- package/dist/set/service.d.ts +2 -2
- package/dist/set/service.d.ts.map +1 -1
- package/dist/set/service.js.map +1 -1
- package/dist/setting/service.d.ts +3 -3
- package/dist/setting/service.d.ts.map +1 -1
- package/dist/setting/service.js.map +1 -1
- package/dist/setting/validators.d.ts.map +1 -1
- package/dist/setting/validators.js +1 -1
- package/dist/setting/validators.js.map +1 -1
- package/dist/tag-service/embed-tagger.d.ts.map +1 -1
- package/dist/tag-service/embed-tagger.js +1 -1
- package/dist/tag-service/embed-tagger.js.map +1 -1
- package/dist/tag-service/index.d.ts.map +1 -1
- package/dist/tag-service/index.js +1 -1
- package/dist/tag-service/index.js.map +1 -1
- package/dist/tag-service/language-tagger.d.ts.map +1 -1
- package/dist/tag-service/language-tagger.js +1 -1
- package/dist/tag-service/language-tagger.js.map +1 -1
- package/dist/team/index.d.ts +3 -3
- package/dist/team/index.d.ts.map +1 -1
- package/dist/team/index.js +2 -2
- package/dist/team/index.js.map +1 -1
- package/dist/util.d.ts +1 -1
- package/dist/util.d.ts.map +1 -1
- package/dist/util.js +1 -1
- package/dist/util.js.map +1 -1
- package/package.json +14 -11
- package/src/api/chat/getActorMetadata.ts +2 -2
- package/src/api/chat/getMessageContext.ts +2 -2
- package/src/api/chat/index.ts +1 -1
- package/src/api/communication/createTemplate.ts +2 -2
- package/src/api/communication/deleteTemplate.ts +1 -1
- package/src/api/communication/listTemplates.ts +1 -1
- package/src/api/communication/updateTemplate.ts +2 -2
- package/src/api/health.ts +4 -4
- package/src/api/index.ts +21 -21
- package/src/api/label/fetchLabels.ts +1 -1
- package/src/api/label/queryLabels.ts +3 -3
- package/src/api/label/subscribeLabels.ts +3 -3
- package/src/api/moderation/emitEvent.ts +7 -6
- package/src/api/moderation/getEvent.ts +1 -1
- package/src/api/moderation/getRecord.ts +2 -2
- package/src/api/moderation/getRecords.ts +2 -2
- package/src/api/moderation/getRepo.ts +1 -1
- package/src/api/moderation/getRepos.ts +1 -1
- package/src/api/moderation/queryEvents.ts +1 -1
- package/src/api/moderation/queryStatuses.ts +1 -1
- package/src/api/moderation/searchRepos.ts +2 -2
- package/src/api/proxied.ts +1 -1
- package/src/api/report/createReport.ts +5 -5
- package/src/api/server/getConfig.ts +1 -1
- package/src/api/set/addValues.ts +1 -1
- package/src/api/set/deleteSet.ts +1 -1
- package/src/api/set/deleteValues.ts +1 -1
- package/src/api/set/getValues.ts +1 -1
- package/src/api/set/querySets.ts +1 -1
- package/src/api/set/upsertSet.ts +1 -1
- package/src/api/setting/listOptions.ts +1 -1
- package/src/api/setting/removeOptions.ts +2 -2
- package/src/api/setting/upsertOption.ts +5 -5
- package/src/api/team/addMember.ts +1 -1
- package/src/api/team/deleteMember.ts +1 -1
- package/src/api/team/listMembers.ts +1 -1
- package/src/api/team/updateMember.ts +1 -1
- package/src/api/util.ts +14 -11
- package/src/api/well-known.ts +4 -4
- package/src/background.ts +0 -2
- package/src/communication-service/template.ts +1 -1
- package/src/config/config.ts +1 -1
- package/src/config/secrets.ts +1 -1
- package/src/context.ts +13 -14
- package/src/daemon/blob-diverter.ts +7 -8
- package/src/daemon/context.ts +6 -8
- package/src/daemon/event-pusher.ts +6 -6
- package/src/daemon/event-reverser.ts +1 -1
- package/src/daemon/index.ts +1 -1
- package/src/daemon/materialized-view-refresher.ts +1 -1
- package/src/db/index.ts +8 -8
- package/src/db/migrations/20241220T144630860Z-stats-materialized-views.ts +1 -3
- package/src/db/pagination.ts +1 -1
- package/src/db/schema/index.ts +11 -12
- package/src/db/schema/moderation_subject_status.ts +1 -1
- package/src/db/types.ts +1 -1
- package/src/error.ts +1 -1
- package/src/index.ts +11 -11
- package/src/lexicon/lexicons.ts +42 -0
- package/src/lexicon/types/app/bsky/actor/defs.ts +36 -0
- package/src/lexicon/types/app/bsky/feed/postgate.ts +1 -0
- package/src/lexicon/types/app/bsky/feed/threadgate.ts +1 -0
- package/src/lexicon/types/tools/ozone/moderation/defs.ts +2 -0
- package/src/logger.ts +1 -1
- package/src/mod-service/index.ts +39 -33
- package/src/mod-service/status.ts +3 -1
- package/src/mod-service/subject.ts +4 -4
- package/src/mod-service/types.ts +2 -2
- package/src/mod-service/views.ts +18 -18
- package/src/sequencer/outbox.ts +1 -3
- package/src/sequencer/sequencer.ts +5 -7
- package/src/set/service.ts +2 -2
- package/src/setting/service.ts +5 -5
- package/src/setting/validators.ts +1 -1
- package/src/tag-service/embed-tagger.ts +3 -3
- package/src/tag-service/index.ts +3 -3
- package/src/tag-service/language-tagger.ts +1 -2
- package/src/team/index.ts +6 -6
- package/src/util.ts +2 -2
- package/tests/3p-labeler.test.ts +5 -5
- package/tests/__snapshots__/get-record.test.ts.snap +2 -2
- package/tests/__snapshots__/get-records.test.ts.snap +1 -1
- package/tests/__snapshots__/get-repo.test.ts.snap +1 -1
- package/tests/__snapshots__/get-repos.test.ts.snap +1 -1
- package/tests/__snapshots__/moderation-events.test.ts.snap +1 -1
- package/tests/__snapshots__/moderation-statuses.test.ts.snap +6 -6
- package/tests/_util.ts +4 -4
- package/tests/ack-all-subjects-of-account.test.ts +4 -4
- package/tests/blob-divert.test.ts +1 -1
- package/tests/communication-templates.test.ts +1 -1
- package/tests/content-tagger.test.ts +1 -1
- package/tests/get-config.test.ts +1 -1
- package/tests/get-lists.test.ts +4 -4
- package/tests/get-profiles.test.ts +2 -3
- package/tests/get-record.test.ts +4 -4
- package/tests/get-records.test.ts +4 -4
- package/tests/get-repo.test.ts +3 -3
- package/tests/get-repos.test.ts +3 -3
- package/tests/get-starter-pack.test.ts +5 -5
- package/tests/moderation-appeals.test.ts +6 -6
- package/tests/moderation-events.test.ts +4 -4
- package/tests/moderation-status-tags.test.ts +2 -2
- package/tests/moderation-statuses.test.ts +8 -8
- package/tests/moderation.test.ts +39 -13
- package/tests/protected-tags.test.ts +3 -3
- package/tests/query-labels.test.ts +3 -3
- package/tests/record-and-account-events.test.ts +8 -7
- package/tests/repo-search.test.ts +2 -2
- package/tests/report-muting.test.ts +6 -6
- package/tests/sequencer.test.ts +3 -3
- package/tests/server.test.ts +1 -1
- package/tests/sets.test.ts +2 -2
- package/tests/settings.test.ts +2 -2
- package/tests/takedown.test.ts +3 -12
- package/tests/team.test.ts +1 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import assert from 'node:assert'
|
|
2
|
-
import {
|
|
3
|
-
TestNetwork,
|
|
4
|
-
SeedClient,
|
|
5
|
-
basicSeed,
|
|
6
|
-
ModeratorClient,
|
|
7
|
-
} from '@atproto/dev-env'
|
|
8
2
|
import {
|
|
9
3
|
ToolsOzoneModerationDefs,
|
|
10
4
|
ToolsOzoneModerationQueryStatuses,
|
|
11
5
|
} from '@atproto/api'
|
|
12
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
ModeratorClient,
|
|
8
|
+
SeedClient,
|
|
9
|
+
TestNetwork,
|
|
10
|
+
basicSeed,
|
|
11
|
+
} from '@atproto/dev-env'
|
|
13
12
|
import {
|
|
14
13
|
REASONMISLEADING,
|
|
15
14
|
REASONSPAM,
|
|
16
15
|
} from '../src/lexicon/types/com/atproto/moderation/defs'
|
|
17
16
|
import {
|
|
18
|
-
REVIEWOPEN,
|
|
19
17
|
REVIEWNONE,
|
|
18
|
+
REVIEWOPEN,
|
|
20
19
|
} from '../src/lexicon/types/tools/ozone/moderation/defs'
|
|
20
|
+
import { forSnapshot } from './_util'
|
|
21
21
|
|
|
22
22
|
describe('moderation-statuses', () => {
|
|
23
23
|
let network: TestNetwork
|
package/tests/moderation.test.ts
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
|
+
import { AtpAgent, ToolsOzoneModerationEmitEvent } from '@atproto/api'
|
|
2
|
+
import { HOUR } from '@atproto/common'
|
|
1
3
|
import {
|
|
2
|
-
TestNetwork,
|
|
3
|
-
TestOzone,
|
|
4
4
|
ImageRef,
|
|
5
|
+
ModeratorClient,
|
|
5
6
|
RecordRef,
|
|
6
7
|
SeedClient,
|
|
8
|
+
TestNetwork,
|
|
9
|
+
TestOzone,
|
|
7
10
|
basicSeed,
|
|
8
|
-
ModeratorClient,
|
|
9
11
|
} from '@atproto/dev-env'
|
|
10
|
-
import { AtpAgent, ToolsOzoneModerationEmitEvent } from '@atproto/api'
|
|
11
12
|
import { AtUri } from '@atproto/syntax'
|
|
12
|
-
import {
|
|
13
|
+
import { EventReverser } from '../src'
|
|
14
|
+
import { ImageInvalidator } from '../src/image-invalidator'
|
|
15
|
+
import { ids } from '../src/lexicon/lexicons'
|
|
13
16
|
import {
|
|
14
17
|
REASONMISLEADING,
|
|
15
18
|
REASONOTHER,
|
|
@@ -20,10 +23,8 @@ import {
|
|
|
20
23
|
REVIEWCLOSED,
|
|
21
24
|
REVIEWESCALATED,
|
|
22
25
|
} from '../src/lexicon/types/tools/ozone/moderation/defs'
|
|
23
|
-
import { EventReverser } from '../src'
|
|
24
|
-
import { ImageInvalidator } from '../src/image-invalidator'
|
|
25
26
|
import { TAKEDOWN_LABEL } from '../src/mod-service'
|
|
26
|
-
import {
|
|
27
|
+
import { forSnapshot } from './_util'
|
|
27
28
|
|
|
28
29
|
describe('moderation', () => {
|
|
29
30
|
let network: TestNetwork
|
|
@@ -514,6 +515,24 @@ describe('moderation', () => {
|
|
|
514
515
|
await expect(getRepoLabels(sc.dids.bob)).resolves.toEqual(['kittens'])
|
|
515
516
|
})
|
|
516
517
|
|
|
518
|
+
it('creates expiring label', async () => {
|
|
519
|
+
await emitLabelEvent({
|
|
520
|
+
createLabelVals: ['temp'],
|
|
521
|
+
negateLabelVals: [],
|
|
522
|
+
subject: {
|
|
523
|
+
$type: 'com.atproto.admin.defs#repoRef',
|
|
524
|
+
did: sc.dids.bob,
|
|
525
|
+
},
|
|
526
|
+
durationInHours: 24,
|
|
527
|
+
})
|
|
528
|
+
const repo = await getRepo(sc.dids.bob)
|
|
529
|
+
// Losely check that the expiry date is set to above 23 hours from now
|
|
530
|
+
expect(
|
|
531
|
+
`${repo?.labels?.[0].exp}` >
|
|
532
|
+
new Date(Date.now() + 23 * HOUR).toISOString(),
|
|
533
|
+
).toBeTruthy()
|
|
534
|
+
})
|
|
535
|
+
|
|
517
536
|
it('does not allow triage moderators to label.', async () => {
|
|
518
537
|
const attemptLabel = modClient.emitEvent(
|
|
519
538
|
{
|
|
@@ -708,14 +727,16 @@ describe('moderation', () => {
|
|
|
708
727
|
subject: ToolsOzoneModerationEmitEvent.InputSchema['subject']
|
|
709
728
|
createLabelVals: ModEventLabel['createLabelVals']
|
|
710
729
|
negateLabelVals: ModEventLabel['negateLabelVals']
|
|
730
|
+
durationInHours?: ModEventLabel['durationInHours']
|
|
711
731
|
},
|
|
712
732
|
) {
|
|
713
|
-
const { createLabelVals, negateLabelVals } = opts
|
|
733
|
+
const { createLabelVals, negateLabelVals, durationInHours } = opts
|
|
714
734
|
const result = await modClient.emitEvent({
|
|
715
735
|
event: {
|
|
716
736
|
$type: 'tools.ozone.moderation.defs#modEventLabel',
|
|
717
737
|
createLabelVals,
|
|
718
738
|
negateLabelVals,
|
|
739
|
+
durationInHours,
|
|
719
740
|
},
|
|
720
741
|
createdBy: 'did:example:admin',
|
|
721
742
|
reason: 'Y',
|
|
@@ -740,7 +761,7 @@ describe('moderation', () => {
|
|
|
740
761
|
}
|
|
741
762
|
|
|
742
763
|
async function getRecordLabels(uri: string) {
|
|
743
|
-
const result = await agent.
|
|
764
|
+
const result = await agent.tools.ozone.moderation.getRecord(
|
|
744
765
|
{ uri },
|
|
745
766
|
{
|
|
746
767
|
headers: await network.ozone.modHeaders(
|
|
@@ -752,8 +773,8 @@ describe('moderation', () => {
|
|
|
752
773
|
return labels.map((l) => l.val)
|
|
753
774
|
}
|
|
754
775
|
|
|
755
|
-
async function
|
|
756
|
-
const result = await agent.
|
|
776
|
+
async function getRepo(did: string) {
|
|
777
|
+
const result = await agent.tools.ozone.moderation.getRepo(
|
|
757
778
|
{ did },
|
|
758
779
|
{
|
|
759
780
|
headers: await network.ozone.modHeaders(
|
|
@@ -761,7 +782,12 @@ describe('moderation', () => {
|
|
|
761
782
|
),
|
|
762
783
|
},
|
|
763
784
|
)
|
|
764
|
-
|
|
785
|
+
return result.data
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
async function getRepoLabels(did: string) {
|
|
789
|
+
const result = await getRepo(did)
|
|
790
|
+
const labels = result.labels ?? []
|
|
765
791
|
return labels.map((l) => l.val)
|
|
766
792
|
}
|
|
767
793
|
})
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
ModeratorClient,
|
|
3
3
|
SeedClient,
|
|
4
|
+
TestNetwork,
|
|
4
5
|
basicSeed,
|
|
5
|
-
ModeratorClient,
|
|
6
6
|
} from '@atproto/dev-env'
|
|
7
|
-
import { ProtectedTagSettingKey } from '../src/setting/constants'
|
|
8
7
|
import {
|
|
9
8
|
ROLEADMIN,
|
|
10
9
|
ROLEMODERATOR,
|
|
11
10
|
} from '../dist/lexicon/types/tools/ozone/team/defs'
|
|
11
|
+
import { ProtectedTagSettingKey } from '../src/setting/constants'
|
|
12
12
|
|
|
13
13
|
describe('protected-tags', () => {
|
|
14
14
|
let network: TestNetwork
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { AtpAgent } from '@atproto/api'
|
|
2
|
+
import { cborEncode } from '@atproto/common'
|
|
3
|
+
import { Secp256k1Keypair, verifySignature } from '@atproto/crypto'
|
|
2
4
|
import { EXAMPLE_LABELER, TestNetwork } from '@atproto/dev-env'
|
|
3
5
|
import { DisconnectError, Subscription } from '@atproto/xrpc-server'
|
|
4
6
|
import { ids, lexicons } from '../src/lexicon/lexicons'
|
|
5
7
|
import { Label } from '../src/lexicon/types/com/atproto/label/defs'
|
|
6
|
-
import { Secp256k1Keypair, verifySignature } from '@atproto/crypto'
|
|
7
|
-
import { cborEncode } from '@atproto/common'
|
|
8
|
-
import { ModerationService } from '../src/mod-service'
|
|
9
8
|
import {
|
|
10
9
|
OutputSchema as LabelMessage,
|
|
11
10
|
isLabels,
|
|
12
11
|
} from '../src/lexicon/types/com/atproto/label/subscribeLabels'
|
|
12
|
+
import { ModerationService } from '../src/mod-service'
|
|
13
13
|
import { getSigningKeyId } from '../src/util'
|
|
14
14
|
|
|
15
15
|
describe('ozone query labels', () => {
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
TestNetwork,
|
|
3
|
-
SeedClient,
|
|
4
|
-
basicSeed,
|
|
5
|
-
ModeratorClient,
|
|
6
|
-
} from '@atproto/dev-env'
|
|
7
1
|
import {
|
|
8
2
|
ComAtprotoModerationDefs,
|
|
9
3
|
ToolsOzoneModerationDefs,
|
|
4
|
+
ToolsOzoneModerationEmitEvent as EmitModerationEvent,
|
|
10
5
|
} from '@atproto/api'
|
|
6
|
+
import {
|
|
7
|
+
ModeratorClient,
|
|
8
|
+
SeedClient,
|
|
9
|
+
TestNetwork,
|
|
10
|
+
basicSeed,
|
|
11
|
+
} from '@atproto/dev-env'
|
|
11
12
|
import { REVIEWOPEN } from '../src/lexicon/types/tools/ozone/moderation/defs'
|
|
12
|
-
|
|
13
|
+
|
|
13
14
|
describe('record and account events on moderation subjects', () => {
|
|
14
15
|
let network: TestNetwork
|
|
15
16
|
let sc: SeedClient
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { AtpAgent } from '@atproto/api'
|
|
1
2
|
import {
|
|
2
3
|
ModeratorClient,
|
|
3
4
|
SeedClient,
|
|
4
5
|
TestNetwork,
|
|
5
6
|
usersBulkSeed,
|
|
6
7
|
} from '@atproto/dev-env'
|
|
7
|
-
import { AtpAgent } from '@atproto/api'
|
|
8
|
-
import { paginateAll } from './_util'
|
|
9
8
|
import { ids } from '../src/lexicon/lexicons'
|
|
9
|
+
import { paginateAll } from './_util'
|
|
10
10
|
|
|
11
11
|
describe('admin repo search view', () => {
|
|
12
12
|
let network: TestNetwork
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
TestNetwork,
|
|
3
|
-
SeedClient,
|
|
4
|
-
basicSeed,
|
|
5
|
-
ModeratorClient,
|
|
6
|
-
} from '@atproto/dev-env'
|
|
7
1
|
import {
|
|
8
2
|
ComAtprotoModerationDefs,
|
|
9
3
|
ToolsOzoneModerationDefs,
|
|
10
4
|
} from '@atproto/api'
|
|
5
|
+
import {
|
|
6
|
+
ModeratorClient,
|
|
7
|
+
SeedClient,
|
|
8
|
+
TestNetwork,
|
|
9
|
+
basicSeed,
|
|
10
|
+
} from '@atproto/dev-env'
|
|
11
11
|
import {
|
|
12
12
|
REVIEWNONE,
|
|
13
13
|
REVIEWOPEN,
|
package/tests/sequencer.test.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { EXAMPLE_LABELER, TestNetwork } from '@atproto/dev-env'
|
|
2
1
|
import { readFromGenerator, wait } from '@atproto/common'
|
|
3
|
-
import { LabelsEvt, Sequencer } from '../src/sequencer'
|
|
4
|
-
import Outbox from '../src/sequencer/outbox'
|
|
5
2
|
import { randomStr } from '@atproto/crypto'
|
|
3
|
+
import { EXAMPLE_LABELER, TestNetwork } from '@atproto/dev-env'
|
|
6
4
|
import { Label } from '../src/lexicon/types/com/atproto/label/defs'
|
|
5
|
+
import { LabelsEvt, Sequencer } from '../src/sequencer'
|
|
6
|
+
import { Outbox } from '../src/sequencer/outbox'
|
|
7
7
|
|
|
8
8
|
describe('sequencer', () => {
|
|
9
9
|
let network: TestNetwork
|
package/tests/server.test.ts
CHANGED
package/tests/sets.test.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { TestNetwork, SeedClient, basicSeed } from '@atproto/dev-env'
|
|
2
1
|
import AtpAgent, {
|
|
3
2
|
ToolsOzoneSetDefs,
|
|
4
3
|
ToolsOzoneSetQuerySets,
|
|
5
4
|
} from '@atproto/api'
|
|
6
|
-
import {
|
|
5
|
+
import { SeedClient, TestNetwork, basicSeed } from '@atproto/dev-env'
|
|
7
6
|
import { ids } from '../src/lexicon/lexicons'
|
|
7
|
+
import { forSnapshot } from './_util'
|
|
8
8
|
|
|
9
9
|
describe('ozone-sets', () => {
|
|
10
10
|
let network: TestNetwork
|
package/tests/settings.test.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { TestNetwork, SeedClient, basicSeed } from '@atproto/dev-env'
|
|
2
1
|
import AtpAgent, {
|
|
3
2
|
ToolsOzoneSettingListOptions,
|
|
4
3
|
ToolsOzoneSettingUpsertOption,
|
|
5
4
|
} from '@atproto/api'
|
|
6
|
-
import {
|
|
5
|
+
import { SeedClient, TestNetwork, basicSeed } from '@atproto/dev-env'
|
|
7
6
|
import { SettingScope } from '../dist/db/schema/setting'
|
|
7
|
+
import { ids } from '../src/lexicon/lexicons'
|
|
8
8
|
import { forSnapshot } from './_util'
|
|
9
9
|
|
|
10
10
|
describe('ozone-settings', () => {
|
package/tests/takedown.test.ts
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
TestOzone,
|
|
2
|
+
ModeratorClient,
|
|
4
3
|
SeedClient,
|
|
4
|
+
TestNetwork,
|
|
5
5
|
basicSeed,
|
|
6
|
-
ModeratorClient,
|
|
7
6
|
} from '@atproto/dev-env'
|
|
8
|
-
import { AtpAgent } from '@atproto/api'
|
|
9
7
|
|
|
10
8
|
describe('moderation', () => {
|
|
11
9
|
let network: TestNetwork
|
|
12
|
-
|
|
13
|
-
let agent: AtpAgent
|
|
14
|
-
let bskyAgent: AtpAgent
|
|
15
|
-
let pdsAgent: AtpAgent
|
|
10
|
+
|
|
16
11
|
let sc: SeedClient
|
|
17
12
|
let modClient: ModeratorClient
|
|
18
13
|
|
|
@@ -25,10 +20,6 @@ describe('moderation', () => {
|
|
|
25
20
|
network = await TestNetwork.create({
|
|
26
21
|
dbPostgresSchema: 'ozone_takedown',
|
|
27
22
|
})
|
|
28
|
-
ozone = network.ozone
|
|
29
|
-
agent = network.ozone.getClient()
|
|
30
|
-
bskyAgent = network.bsky.getClient()
|
|
31
|
-
pdsAgent = network.pds.getClient()
|
|
32
23
|
sc = network.getSeedClient()
|
|
33
24
|
modClient = network.ozone.getModClient()
|
|
34
25
|
await basicSeed(sc)
|
package/tests/team.test.ts
CHANGED