@atproto/dev-env 0.0.0-spaces-alpha-20260818163953
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 +3424 -0
- package/LICENSE.txt +7 -0
- package/README.md +39 -0
- package/bin.js +7 -0
- package/dist/bin-multi-pds.d.ts +2 -0
- package/dist/bin-multi-pds.d.ts.map +1 -0
- package/dist/bin-multi-pds.js +130 -0
- package/dist/bin-multi-pds.js.map +1 -0
- package/dist/bin.d.ts +2 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +56 -0
- package/dist/bin.js.map +1 -0
- package/dist/bsky.d.ts +27 -0
- package/dist/bsky.d.ts.map +1 -0
- package/dist/bsky.js +165 -0
- package/dist/bsky.js.map +1 -0
- package/dist/bsync.d.ts +22 -0
- package/dist/bsync.d.ts.map +1 -0
- package/dist/bsync.js +54 -0
- package/dist/bsync.js.map +1 -0
- package/dist/const.d.ts +4 -0
- package/dist/const.d.ts.map +1 -0
- package/dist/const.js +4 -0
- package/dist/const.js.map +1 -0
- package/dist/env.d.ts +2 -0
- package/dist/env.d.ts.map +1 -0
- package/dist/env.js +10 -0
- package/dist/env.js.map +1 -0
- package/dist/feed-gen.d.ts +15 -0
- package/dist/feed-gen.d.ts.map +1 -0
- package/dist/feed-gen.js +73 -0
- package/dist/feed-gen.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/introspect.d.ts +22 -0
- package/dist/introspect.d.ts.map +1 -0
- package/dist/introspect.js +65 -0
- package/dist/introspect.js.map +1 -0
- package/dist/mock/data.d.ts +3 -0
- package/dist/mock/data.d.ts.map +1 -0
- package/dist/mock/data.js +46 -0
- package/dist/mock/data.js.map +1 -0
- package/dist/mock/img/blur-hash-avatar-b64.d.ts +3 -0
- package/dist/mock/img/blur-hash-avatar-b64.d.ts.map +1 -0
- package/dist/mock/img/blur-hash-avatar-b64.js +2 -0
- package/dist/mock/img/blur-hash-avatar-b64.js.map +1 -0
- package/dist/mock/img/labeled-img-b64.d.ts +3 -0
- package/dist/mock/img/labeled-img-b64.d.ts.map +1 -0
- package/dist/mock/img/labeled-img-b64.js +2 -0
- package/dist/mock/img/labeled-img-b64.js.map +1 -0
- package/dist/mock/index.d.ts +3 -0
- package/dist/mock/index.d.ts.map +1 -0
- package/dist/mock/index.js +574 -0
- package/dist/mock/index.js.map +1 -0
- package/dist/moderator-client.d.ts +58 -0
- package/dist/moderator-client.d.ts.map +1 -0
- package/dist/moderator-client.js +110 -0
- package/dist/moderator-client.js.map +1 -0
- package/dist/network-no-appview.d.ts +21 -0
- package/dist/network-no-appview.d.ts.map +1 -0
- package/dist/network-no-appview.js +74 -0
- package/dist/network-no-appview.js.map +1 -0
- package/dist/network.d.ts +32 -0
- package/dist/network.d.ts.map +1 -0
- package/dist/network.js +190 -0
- package/dist/network.js.map +1 -0
- package/dist/ozone.d.ts +31 -0
- package/dist/ozone.d.ts.map +1 -0
- package/dist/ozone.js +254 -0
- package/dist/ozone.js.map +1 -0
- package/dist/pds.d.ts +23 -0
- package/dist/pds.d.ts.map +1 -0
- package/dist/pds.js +97 -0
- package/dist/pds.js.map +1 -0
- package/dist/plc.d.ts +14 -0
- package/dist/plc.d.ts.map +1 -0
- package/dist/plc.js +28 -0
- package/dist/plc.js.map +1 -0
- package/dist/seed/author-feed.d.ts +4 -0
- package/dist/seed/author-feed.d.ts.map +1 -0
- package/dist/seed/author-feed.js +50 -0
- package/dist/seed/author-feed.js.map +1 -0
- package/dist/seed/basic.d.ts +16 -0
- package/dist/seed/basic.d.ts.map +1 -0
- package/dist/seed/basic.js +113 -0
- package/dist/seed/basic.js.map +1 -0
- package/dist/seed/client.d.ts +151 -0
- package/dist/seed/client.d.ts.map +1 -0
- package/dist/seed/client.js +365 -0
- package/dist/seed/client.js.map +1 -0
- package/dist/seed/follows.d.ts +4 -0
- package/dist/seed/follows.d.ts.map +1 -0
- package/dist/seed/follows.js +55 -0
- package/dist/seed/follows.js.map +1 -0
- package/dist/seed/index.d.ts +11 -0
- package/dist/seed/index.d.ts.map +1 -0
- package/dist/seed/index.js +11 -0
- package/dist/seed/index.js.map +1 -0
- package/dist/seed/likes.d.ts +4 -0
- package/dist/seed/likes.d.ts.map +1 -0
- package/dist/seed/likes.js +37 -0
- package/dist/seed/likes.js.map +1 -0
- package/dist/seed/quotes.d.ts +4 -0
- package/dist/seed/quotes.d.ts.map +1 -0
- package/dist/seed/quotes.js +21 -0
- package/dist/seed/quotes.js.map +1 -0
- package/dist/seed/reposts.d.ts +4 -0
- package/dist/seed/reposts.d.ts.map +1 -0
- package/dist/seed/reposts.js +17 -0
- package/dist/seed/reposts.js.map +1 -0
- package/dist/seed/thread-v2.d.ts +227 -0
- package/dist/seed/thread-v2.d.ts.map +1 -0
- package/dist/seed/thread-v2.js +755 -0
- package/dist/seed/thread-v2.js.map +1 -0
- package/dist/seed/users-bulk.d.ts +3 -0
- package/dist/seed/users-bulk.d.ts.map +1 -0
- package/dist/seed/users-bulk.js +224 -0
- package/dist/seed/users-bulk.js.map +1 -0
- package/dist/seed/users.d.ts +3 -0
- package/dist/seed/users.d.ts.map +1 -0
- package/dist/seed/users.js +45 -0
- package/dist/seed/users.js.map +1 -0
- package/dist/seed/verifications.d.ts +5 -0
- package/dist/seed/verifications.d.ts.map +1 -0
- package/dist/seed/verifications.js +164 -0
- package/dist/seed/verifications.js.map +1 -0
- package/dist/service-profile-lexicon.d.ts +11 -0
- package/dist/service-profile-lexicon.d.ts.map +1 -0
- package/dist/service-profile-lexicon.js +115 -0
- package/dist/service-profile-lexicon.js.map +1 -0
- package/dist/service-profile-ozone.d.ts +18 -0
- package/dist/service-profile-ozone.d.ts.map +1 -0
- package/dist/service-profile-ozone.js +333 -0
- package/dist/service-profile-ozone.js.map +1 -0
- package/dist/service-profile.d.ts +24 -0
- package/dist/service-profile.d.ts.map +1 -0
- package/dist/service-profile.js +61 -0
- package/dist/service-profile.js.map +1 -0
- package/dist/types.d.ts +61 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/util.d.ts +14 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/util.js +86 -0
- package/dist/util.js.map +1 -0
- package/package.json +69 -0
- package/src/bin-multi-pds.ts +166 -0
- package/src/bin.ts +64 -0
- package/src/bsky.ts +198 -0
- package/src/bsync.ts +66 -0
- package/src/const.ts +3 -0
- package/src/env.ts +9 -0
- package/src/feed-gen.ts +96 -0
- package/src/index.ts +17 -0
- package/src/introspect.ts +91 -0
- package/src/mock/data.ts +46 -0
- package/src/mock/img/blur-hash-avatar-b64.ts +1 -0
- package/src/mock/img/labeled-img-b64.ts +1 -0
- package/src/mock/index.ts +702 -0
- package/src/moderator-client.ts +267 -0
- package/src/network-no-appview.ts +89 -0
- package/src/network.ts +243 -0
- package/src/ozone.ts +287 -0
- package/src/pds.ts +118 -0
- package/src/plc.ts +33 -0
- package/src/seed/author-feed.ts +98 -0
- package/src/seed/basic.ts +189 -0
- package/src/seed/client.ts +676 -0
- package/src/seed/follows.ts +57 -0
- package/src/seed/index.ts +11 -0
- package/src/seed/likes.ts +43 -0
- package/src/seed/quotes.ts +53 -0
- package/src/seed/reposts.ts +18 -0
- package/src/seed/thread-v2.ts +925 -0
- package/src/seed/users-bulk.ts +229 -0
- package/src/seed/users.ts +64 -0
- package/src/seed/verifications.ts +254 -0
- package/src/service-profile-lexicon.ts +127 -0
- package/src/service-profile-ozone.ts +375 -0
- package/src/service-profile.ts +95 -0
- package/src/types.ts +68 -0
- package/src/util.ts +118 -0
- package/tsconfig.build.json +25 -0
- package/tsconfig.json +4 -0
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import type { TestBsky } from '../bsky.js'
|
|
2
|
+
import { EXAMPLE_LABELER } from '../const.js'
|
|
3
|
+
import type { TestNetworkNoAppView } from '../network-no-appview.js'
|
|
4
|
+
import { TestNetwork } from '../network.js'
|
|
5
|
+
import type { SeedClient } from './client.js'
|
|
6
|
+
import usersSeed from './users.js'
|
|
7
|
+
|
|
8
|
+
export default async function basicSeed(
|
|
9
|
+
sc: SeedClient<TestNetwork | TestNetworkNoAppView>,
|
|
10
|
+
users = true,
|
|
11
|
+
) {
|
|
12
|
+
if (users) await usersSeed(sc)
|
|
13
|
+
|
|
14
|
+
const alice = sc.dids.alice
|
|
15
|
+
const bob = sc.dids.bob
|
|
16
|
+
const carol = sc.dids.carol
|
|
17
|
+
const dan = sc.dids.dan
|
|
18
|
+
const createdAtMicroseconds = () => ({
|
|
19
|
+
createdAt: new Date().toISOString().replace('Z', '000Z'), // microseconds
|
|
20
|
+
})
|
|
21
|
+
const createdAtTimezone = () => ({
|
|
22
|
+
createdAt: new Date().toISOString().replace('Z', '+00:00'), // iso timezone format
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
await sc.follow(alice, bob)
|
|
26
|
+
await sc.follow(alice, carol)
|
|
27
|
+
await sc.follow(alice, dan)
|
|
28
|
+
await sc.follow(carol, alice)
|
|
29
|
+
await sc.follow(bob, alice)
|
|
30
|
+
await sc.follow(bob, carol, createdAtMicroseconds())
|
|
31
|
+
await sc.follow(dan, bob, createdAtTimezone())
|
|
32
|
+
await sc.post(alice, posts.alice[0], undefined, undefined, undefined, {
|
|
33
|
+
labels: {
|
|
34
|
+
$type: 'com.atproto.label.defs#selfLabels',
|
|
35
|
+
values: [{ val: 'self-label' }],
|
|
36
|
+
},
|
|
37
|
+
})
|
|
38
|
+
await sc.post(bob, posts.bob[0], undefined, undefined, undefined, {
|
|
39
|
+
langs: ['en-US', 'i-klingon'],
|
|
40
|
+
})
|
|
41
|
+
const img1 = await sc.uploadFile(
|
|
42
|
+
carol,
|
|
43
|
+
'../dev-env/assets/key-landscape-small.jpg',
|
|
44
|
+
'image/jpeg',
|
|
45
|
+
)
|
|
46
|
+
const img2 = await sc.uploadFile(
|
|
47
|
+
carol,
|
|
48
|
+
'../dev-env/assets/key-alt.jpg',
|
|
49
|
+
'image/jpeg',
|
|
50
|
+
)
|
|
51
|
+
await sc.post(
|
|
52
|
+
carol,
|
|
53
|
+
posts.carol[0],
|
|
54
|
+
undefined,
|
|
55
|
+
[img1, img2], // Contains both images and a quote
|
|
56
|
+
sc.posts[bob][0].ref,
|
|
57
|
+
)
|
|
58
|
+
await sc.post(dan, posts.dan[0])
|
|
59
|
+
await sc.post(
|
|
60
|
+
dan,
|
|
61
|
+
posts.dan[1],
|
|
62
|
+
[
|
|
63
|
+
{
|
|
64
|
+
index: { byteStart: 0, byteEnd: 18 },
|
|
65
|
+
features: [
|
|
66
|
+
{
|
|
67
|
+
$type: `app.bsky.richtext.facet#mention`,
|
|
68
|
+
did: alice,
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
undefined,
|
|
74
|
+
sc.posts[carol][0].ref, // This post contains an images embed
|
|
75
|
+
)
|
|
76
|
+
await sc.post(
|
|
77
|
+
alice,
|
|
78
|
+
posts.alice[1],
|
|
79
|
+
undefined,
|
|
80
|
+
undefined,
|
|
81
|
+
undefined,
|
|
82
|
+
createdAtMicroseconds(),
|
|
83
|
+
)
|
|
84
|
+
await sc.post(
|
|
85
|
+
bob,
|
|
86
|
+
posts.bob[1],
|
|
87
|
+
undefined,
|
|
88
|
+
undefined,
|
|
89
|
+
undefined,
|
|
90
|
+
createdAtTimezone(),
|
|
91
|
+
)
|
|
92
|
+
await sc.post(
|
|
93
|
+
alice,
|
|
94
|
+
posts.alice[2],
|
|
95
|
+
undefined,
|
|
96
|
+
undefined,
|
|
97
|
+
sc.posts[dan][1].ref, // This post contains a record embed which contains an images embed
|
|
98
|
+
)
|
|
99
|
+
await sc.like(bob, sc.posts[alice][1].ref)
|
|
100
|
+
await sc.like(bob, sc.posts[alice][2].ref)
|
|
101
|
+
await sc.like(carol, sc.posts[alice][1].ref)
|
|
102
|
+
await sc.like(carol, sc.posts[alice][2].ref)
|
|
103
|
+
await sc.like(dan, sc.posts[alice][1].ref)
|
|
104
|
+
await sc.like(alice, sc.posts[carol][0].ref, createdAtMicroseconds())
|
|
105
|
+
await sc.like(bob, sc.posts[carol][0].ref, createdAtTimezone())
|
|
106
|
+
|
|
107
|
+
const replyImg = await sc.uploadFile(
|
|
108
|
+
bob,
|
|
109
|
+
'../dev-env/assets/key-landscape-small.jpg',
|
|
110
|
+
'image/jpeg',
|
|
111
|
+
)
|
|
112
|
+
// must ensure ordering of replies in indexing
|
|
113
|
+
await sc.network.processAll()
|
|
114
|
+
await sc.reply(
|
|
115
|
+
bob,
|
|
116
|
+
sc.posts[alice][1].ref,
|
|
117
|
+
sc.posts[alice][1].ref,
|
|
118
|
+
replies.bob[0],
|
|
119
|
+
undefined,
|
|
120
|
+
[replyImg],
|
|
121
|
+
)
|
|
122
|
+
await sc.reply(
|
|
123
|
+
carol,
|
|
124
|
+
sc.posts[alice][1].ref,
|
|
125
|
+
sc.posts[alice][1].ref,
|
|
126
|
+
replies.carol[0],
|
|
127
|
+
)
|
|
128
|
+
await sc.network.processAll()
|
|
129
|
+
const alicesReplyToBob = await sc.reply(
|
|
130
|
+
alice,
|
|
131
|
+
sc.posts[alice][1].ref,
|
|
132
|
+
sc.replies[bob][0].ref,
|
|
133
|
+
replies.alice[0],
|
|
134
|
+
)
|
|
135
|
+
await sc.repost(carol, sc.posts[dan][1].ref)
|
|
136
|
+
await sc.repost(dan, sc.posts[alice][1].ref)
|
|
137
|
+
await sc.repost(dan, alicesReplyToBob.ref)
|
|
138
|
+
|
|
139
|
+
if (sc.network instanceof TestNetwork) {
|
|
140
|
+
const bsky = sc.network.bsky
|
|
141
|
+
await createLabel(bsky, {
|
|
142
|
+
val: 'test-label',
|
|
143
|
+
uri: sc.posts[alice][2].ref.uriStr,
|
|
144
|
+
cid: sc.posts[alice][2].ref.cidStr,
|
|
145
|
+
})
|
|
146
|
+
await createLabel(bsky, {
|
|
147
|
+
val: 'test-label',
|
|
148
|
+
uri: sc.replies[bob][0].ref.uriStr,
|
|
149
|
+
cid: sc.replies[bob][0].ref.cidStr,
|
|
150
|
+
})
|
|
151
|
+
await createLabel(bsky, {
|
|
152
|
+
val: 'test-label-2',
|
|
153
|
+
uri: sc.replies[bob][0].ref.uriStr,
|
|
154
|
+
cid: sc.replies[bob][0].ref.cidStr,
|
|
155
|
+
})
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return sc
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export const posts = {
|
|
162
|
+
alice: ['hey there', 'again', 'yoohoo label_me'],
|
|
163
|
+
bob: ['bob back at it again!', 'bobby boy here', 'yoohoo'],
|
|
164
|
+
carol: ['hi im carol'],
|
|
165
|
+
dan: ['dan here!', '@alice.bluesky.xyz is the best'],
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export const replies = {
|
|
169
|
+
alice: ['thanks bob'],
|
|
170
|
+
bob: ['hear that label_me label_me_2'],
|
|
171
|
+
carol: ['of course'],
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
const createLabel = async (
|
|
175
|
+
bsky: TestBsky,
|
|
176
|
+
opts: { uri: string; cid: string; val: string },
|
|
177
|
+
) => {
|
|
178
|
+
await bsky.db.db
|
|
179
|
+
.insertInto('label')
|
|
180
|
+
.values({
|
|
181
|
+
uri: opts.uri,
|
|
182
|
+
cid: opts.cid,
|
|
183
|
+
val: opts.val,
|
|
184
|
+
cts: new Date().toISOString(),
|
|
185
|
+
neg: false,
|
|
186
|
+
src: EXAMPLE_LABELER, // this did is also configured on labelsFromIssuerDids
|
|
187
|
+
})
|
|
188
|
+
.execute()
|
|
189
|
+
}
|