@atproto/ozone 0.1.113 → 0.1.115
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 +14 -0
- 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/lexicon/lexicons.d.ts +116 -124
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +68 -66
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/app/bsky/unspecced/defs.d.ts +33 -0
- package/dist/lexicon/types/app/bsky/unspecced/defs.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/unspecced/defs.js +36 -0
- package/dist/lexicon/types/app/bsky/unspecced/defs.js.map +1 -1
- package/dist/lexicon/types/app/bsky/unspecced/getPostThreadHiddenV2.d.ts +5 -13
- package/dist/lexicon/types/app/bsky/unspecced/getPostThreadHiddenV2.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/unspecced/getPostThreadHiddenV2.js +0 -9
- package/dist/lexicon/types/app/bsky/unspecced/getPostThreadHiddenV2.js.map +1 -1
- package/dist/lexicon/types/app/bsky/unspecced/getPostThreadV2.d.ts +2 -29
- package/dist/lexicon/types/app/bsky/unspecced/getPostThreadV2.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/unspecced/getPostThreadV2.js +0 -36
- package/dist/lexicon/types/app/bsky/unspecced/getPostThreadV2.js.map +1 -1
- package/dist/lexicon/types/tools/ozone/moderation/defs.d.ts +1 -1
- 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/mod-service/index.d.ts.map +1 -1
- package/dist/mod-service/index.js +5 -21
- package/dist/mod-service/index.js.map +1 -1
- package/dist/mod-service/util.d.ts +10 -0
- package/dist/mod-service/util.d.ts.map +1 -1
- package/dist/mod-service/util.js +25 -1
- package/dist/mod-service/util.js.map +1 -1
- package/dist/mod-service/views.d.ts +6 -2
- package/dist/mod-service/views.d.ts.map +1 -1
- package/dist/mod-service/views.js +46 -15
- package/dist/mod-service/views.js.map +1 -1
- package/package.json +4 -4
- package/src/api/moderation/getRecord.ts +4 -1
- package/src/lexicon/lexicons.ts +74 -71
- package/src/lexicon/types/app/bsky/unspecced/defs.ts +73 -0
- package/src/lexicon/types/app/bsky/unspecced/getPostThreadHiddenV2.ts +5 -22
- package/src/lexicon/types/app/bsky/unspecced/getPostThreadV2.ts +5 -72
- package/src/lexicon/types/tools/ozone/moderation/defs.ts +1 -0
- package/src/mod-service/index.ts +17 -15
- package/src/mod-service/util.ts +24 -0
- package/src/mod-service/views.ts +52 -17
- package/tests/__snapshots__/get-record.test.ts.snap +26 -0
- package/tests/get-record.test.ts +16 -6
package/tests/get-record.test.ts
CHANGED
|
@@ -75,7 +75,7 @@ describe('admin get record view', () => {
|
|
|
75
75
|
})
|
|
76
76
|
|
|
77
77
|
it('gets a record by uri, even when taken down.', async () => {
|
|
78
|
-
const result = await agent.
|
|
78
|
+
const result = await agent.tools.ozone.moderation.getRecord(
|
|
79
79
|
{ uri: sc.posts[sc.dids.alice][0].ref.uriStr },
|
|
80
80
|
{ headers: await ozone.modHeaders(ids.ToolsOzoneModerationGetRecord) },
|
|
81
81
|
)
|
|
@@ -83,7 +83,7 @@ describe('admin get record view', () => {
|
|
|
83
83
|
})
|
|
84
84
|
|
|
85
85
|
it('gets a record by uri and cid.', async () => {
|
|
86
|
-
const result = await agent.
|
|
86
|
+
const result = await agent.tools.ozone.moderation.getRecord(
|
|
87
87
|
{
|
|
88
88
|
uri: sc.posts[sc.dids.alice][0].ref.uriStr,
|
|
89
89
|
cid: sc.posts[sc.dids.alice][0].ref.cidStr,
|
|
@@ -94,7 +94,7 @@ describe('admin get record view', () => {
|
|
|
94
94
|
})
|
|
95
95
|
|
|
96
96
|
it('fails when record does not exist.', async () => {
|
|
97
|
-
const promise = agent.
|
|
97
|
+
const promise = agent.tools.ozone.moderation.getRecord(
|
|
98
98
|
{
|
|
99
99
|
uri: AtUri.make(
|
|
100
100
|
sc.dids.alice,
|
|
@@ -104,17 +104,27 @@ describe('admin get record view', () => {
|
|
|
104
104
|
},
|
|
105
105
|
{ headers: await ozone.modHeaders(ids.ToolsOzoneModerationGetRecord) },
|
|
106
106
|
)
|
|
107
|
-
await expect(promise).rejects.toThrow('
|
|
107
|
+
await expect(promise).rejects.toThrow('Could not locate record')
|
|
108
108
|
})
|
|
109
109
|
|
|
110
110
|
it('fails when record cid does not exist.', async () => {
|
|
111
|
-
const promise = agent.
|
|
111
|
+
const promise = agent.tools.ozone.moderation.getRecord(
|
|
112
112
|
{
|
|
113
113
|
uri: sc.posts[sc.dids.alice][0].ref.uriStr,
|
|
114
114
|
cid: sc.posts[sc.dids.alice][1].ref.cidStr, // Mismatching cid
|
|
115
115
|
},
|
|
116
116
|
{ headers: await ozone.modHeaders(ids.ToolsOzoneModerationGetRecord) },
|
|
117
117
|
)
|
|
118
|
-
await expect(promise).rejects.toThrow('
|
|
118
|
+
await expect(promise).rejects.toThrow('Could not locate record')
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
it('gets record from pds if appview does not have it.', async () => {
|
|
122
|
+
const post = await sc.post(sc.dids.carol, 'this is test')
|
|
123
|
+
const { data: postFromOzone } =
|
|
124
|
+
await agent.tools.ozone.moderation.getRecord(
|
|
125
|
+
{ uri: post.ref.uriStr },
|
|
126
|
+
{ headers: await ozone.modHeaders(ids.ToolsOzoneModerationGetRecord) },
|
|
127
|
+
)
|
|
128
|
+
expect(forSnapshot(postFromOzone)).toMatchSnapshot()
|
|
119
129
|
})
|
|
120
130
|
})
|