@atproto/ozone 0.1.26 → 0.1.27
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 +10 -0
- package/dist/api/proxied.d.ts.map +1 -1
- package/dist/api/proxied.js +30 -0
- package/dist/api/proxied.js.map +1 -1
- package/dist/lexicon/index.d.ts +7 -0
- package/dist/lexicon/index.d.ts.map +1 -1
- package/dist/lexicon/index.js +13 -0
- package/dist/lexicon/index.js.map +1 -1
- package/dist/lexicon/lexicons.d.ts +332 -0
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +339 -1
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/app/bsky/actor/defs.d.ts +5 -0
- package/dist/lexicon/types/app/bsky/actor/defs.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/actor/defs.js.map +1 -1
- package/dist/lexicon/types/app/bsky/actor/profile.d.ts +3 -0
- package/dist/lexicon/types/app/bsky/actor/profile.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/actor/profile.js.map +1 -1
- package/dist/lexicon/types/app/bsky/graph/defs.d.ts +36 -1
- package/dist/lexicon/types/app/bsky/graph/defs.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/graph/defs.js +23 -1
- package/dist/lexicon/types/app/bsky/graph/defs.js.map +1 -1
- package/dist/lexicon/types/app/bsky/graph/getActorStarterPacks.d.ts +39 -0
- package/dist/lexicon/types/app/bsky/graph/getActorStarterPacks.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/graph/getActorStarterPacks.js +3 -0
- package/dist/lexicon/types/app/bsky/graph/getActorStarterPacks.js.map +1 -0
- package/dist/lexicon/types/app/bsky/graph/getStarterPack.d.ts +37 -0
- package/dist/lexicon/types/app/bsky/graph/getStarterPack.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/graph/getStarterPack.js +3 -0
- package/dist/lexicon/types/app/bsky/graph/getStarterPack.js.map +1 -0
- package/dist/lexicon/types/app/bsky/graph/getStarterPacks.d.ts +36 -0
- package/dist/lexicon/types/app/bsky/graph/getStarterPacks.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/graph/getStarterPacks.js +3 -0
- package/dist/lexicon/types/app/bsky/graph/getStarterPacks.js.map +1 -0
- package/dist/lexicon/types/app/bsky/graph/starterpack.d.ts +25 -0
- package/dist/lexicon/types/app/bsky/graph/starterpack.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/graph/starterpack.js +27 -0
- package/dist/lexicon/types/app/bsky/graph/starterpack.js.map +1 -0
- package/dist/lexicon/types/app/bsky/notification/listNotifications.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/notification/listNotifications.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/notification/listNotifications.js.map +1 -1
- package/dist/lexicon/types/tools/ozone/team/deleteMember.d.ts +1 -1
- package/dist/lexicon/types/tools/ozone/team/deleteMember.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/api/proxied.ts +43 -0
- package/src/lexicon/index.ts +37 -0
- package/src/lexicon/lexicons.ts +341 -1
- package/src/lexicon/types/app/bsky/actor/defs.ts +5 -0
- package/src/lexicon/types/app/bsky/actor/profile.ts +3 -0
- package/src/lexicon/types/app/bsky/graph/defs.ts +58 -0
- package/src/lexicon/types/app/bsky/graph/getActorStarterPacks.ts +49 -0
- package/src/lexicon/types/app/bsky/graph/getStarterPack.ts +47 -0
- package/src/lexicon/types/app/bsky/graph/getStarterPacks.ts +46 -0
- package/src/lexicon/types/app/bsky/graph/starterpack.ts +50 -0
- package/src/lexicon/types/app/bsky/notification/listNotifications.ts +2 -1
- package/src/lexicon/types/tools/ozone/team/deleteMember.ts +1 -1
- package/tests/__snapshots__/get-record.test.ts.snap +2 -0
- package/tests/__snapshots__/get-repo.test.ts.snap +1 -0
- package/tests/__snapshots__/get-starter-pack.test.ts.snap +466 -0
- package/tests/__snapshots__/moderation-events.test.ts.snap +1 -0
- package/tests/__snapshots__/team.test.ts.snap +24 -0
- package/tests/get-starter-pack.test.ts +104 -0
- package/tests/server.test.ts +1 -1
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SeedClient,
|
|
3
|
+
TestNetwork,
|
|
4
|
+
basicSeed,
|
|
5
|
+
TestOzone,
|
|
6
|
+
RecordRef,
|
|
7
|
+
} from '@atproto/dev-env'
|
|
8
|
+
import AtpAgent from '@atproto/api'
|
|
9
|
+
import { forSnapshot } from './_util'
|
|
10
|
+
import { TAKEDOWN_LABEL } from '../src/mod-service'
|
|
11
|
+
|
|
12
|
+
describe('admin get starter pack view', () => {
|
|
13
|
+
let network: TestNetwork
|
|
14
|
+
let ozone: TestOzone
|
|
15
|
+
let agent: AtpAgent
|
|
16
|
+
let sc: SeedClient
|
|
17
|
+
let sp1: RecordRef
|
|
18
|
+
|
|
19
|
+
beforeAll(async () => {
|
|
20
|
+
network = await TestNetwork.create({
|
|
21
|
+
dbPostgresSchema: 'ozone_admin_get_starterpack',
|
|
22
|
+
})
|
|
23
|
+
ozone = network.ozone
|
|
24
|
+
AtpAgent.configure({ appLabelers: [ozone.ctx.cfg.service.did] })
|
|
25
|
+
agent = ozone.getClient()
|
|
26
|
+
sc = network.getSeedClient()
|
|
27
|
+
await basicSeed(sc)
|
|
28
|
+
await network.processAll()
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
afterAll(async () => {
|
|
32
|
+
await network.close()
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
beforeAll(async () => {
|
|
36
|
+
const feedgen = await sc.createFeedGen(
|
|
37
|
+
sc.dids.alice,
|
|
38
|
+
'did:web:example.com',
|
|
39
|
+
"alice's feedgen",
|
|
40
|
+
)
|
|
41
|
+
sp1 = await sc.createStarterPack(
|
|
42
|
+
sc.dids.alice,
|
|
43
|
+
"alice's starter pack",
|
|
44
|
+
[sc.dids.bob, sc.dids.carol, sc.dids.dan],
|
|
45
|
+
[feedgen.uriStr],
|
|
46
|
+
)
|
|
47
|
+
await network.processAll()
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
describe('getStarterPack()', () => {
|
|
51
|
+
it('gets a starterpack by uri', async () => {
|
|
52
|
+
const result = await agent.api.app.bsky.graph.getStarterPack(
|
|
53
|
+
{ starterPack: sp1.uriStr },
|
|
54
|
+
{ headers: await ozone.modHeaders() },
|
|
55
|
+
)
|
|
56
|
+
expect(forSnapshot(result.data)).toMatchSnapshot()
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
it('gets a starterpack while taken down', async () => {
|
|
60
|
+
// Validate that appview returns starterpacks before takedown
|
|
61
|
+
const appviewAgent = network.bsky.getClient()
|
|
62
|
+
const beforeTakedownFromAppview =
|
|
63
|
+
await appviewAgent.api.app.bsky.graph.getStarterPack(
|
|
64
|
+
{ starterPack: sp1.uriStr },
|
|
65
|
+
{ headers: await network.serviceHeaders(sc.dids.alice) },
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
expect(
|
|
69
|
+
forSnapshot(beforeTakedownFromAppview.data.starterPack),
|
|
70
|
+
).toMatchSnapshot()
|
|
71
|
+
|
|
72
|
+
await network.bsky.db.db
|
|
73
|
+
.insertInto('label')
|
|
74
|
+
.values({
|
|
75
|
+
src: ozone.ctx.cfg.service.did,
|
|
76
|
+
uri: sp1.uriStr,
|
|
77
|
+
cid: sp1.cidStr,
|
|
78
|
+
val: TAKEDOWN_LABEL,
|
|
79
|
+
neg: false,
|
|
80
|
+
cts: new Date().toISOString(),
|
|
81
|
+
})
|
|
82
|
+
.execute()
|
|
83
|
+
|
|
84
|
+
const afterTakedownFromOzone =
|
|
85
|
+
await agent.api.app.bsky.graph.getStarterPack(
|
|
86
|
+
{ starterPack: sp1.uriStr },
|
|
87
|
+
{ headers: await ozone.modHeaders() },
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
// validate that ozone returns starterpacks after takedown
|
|
91
|
+
expect(
|
|
92
|
+
forSnapshot(afterTakedownFromOzone.data.starterPack),
|
|
93
|
+
).toMatchSnapshot()
|
|
94
|
+
|
|
95
|
+
// validate that appview does not return starterpack after takedown
|
|
96
|
+
await expect(
|
|
97
|
+
appviewAgent.api.app.bsky.graph.getStarterPack(
|
|
98
|
+
{ starterPack: sp1.uriStr },
|
|
99
|
+
{ headers: await network.serviceHeaders(sc.dids.alice) },
|
|
100
|
+
),
|
|
101
|
+
).rejects.toThrow('Starter pack not found')
|
|
102
|
+
})
|
|
103
|
+
})
|
|
104
|
+
})
|
package/tests/server.test.ts
CHANGED
|
@@ -54,7 +54,7 @@ describe('server', () => {
|
|
|
54
54
|
})
|
|
55
55
|
|
|
56
56
|
it('healthcheck fails when database is unavailable.', async () => {
|
|
57
|
-
//
|
|
57
|
+
// destroy sequencer to release connection that would prevent the db from closing
|
|
58
58
|
await ozone.ctx.sequencer.destroy()
|
|
59
59
|
await ozone.ctx.db.close()
|
|
60
60
|
let error: AxiosError
|