@atproto/pds 0.4.214 → 0.4.215
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 +15 -0
- package/dist/lexicon/lexicons.d.ts +30 -6
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +15 -0
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/tools/ozone/moderation/defs.d.ts +10 -2
- package/dist/lexicon/types/tools/ozone/moderation/defs.d.ts.map +1 -1
- package/dist/lexicon/types/tools/ozone/moderation/defs.js +9 -0
- package/dist/lexicon/types/tools/ozone/moderation/defs.js.map +1 -1
- package/dist/lexicon/types/tools/ozone/moderation/emitEvent.d.ts +1 -1
- package/dist/lexicon/types/tools/ozone/moderation/emitEvent.d.ts.map +1 -1
- package/dist/lexicon/types/tools/ozone/moderation/emitEvent.js.map +1 -1
- package/package.json +9 -9
- package/src/lexicon/lexicons.ts +16 -0
- package/src/lexicon/types/tools/ozone/moderation/defs.ts +19 -0
- package/src/lexicon/types/tools/ozone/moderation/emitEvent.ts +1 -0
- package/tests/_util.ts +10 -8
- package/tests/proxied/__snapshots__/feedgen.test.ts.snap +6 -6
- package/tests/proxied/__snapshots__/views.test.ts.snap +94 -94
package/tests/_util.ts
CHANGED
|
@@ -57,26 +57,28 @@ export const forSnapshot = (obj: unknown) => {
|
|
|
57
57
|
if (str.match(/^\d+(?:__|::)did:plc/)) {
|
|
58
58
|
return constantDidCursor
|
|
59
59
|
}
|
|
60
|
-
if (str.match(/\/image\/[^/]+\/.+\/did:plc:[^/]+\/[
|
|
61
|
-
// Match image urls (pds)
|
|
60
|
+
if (str.match(/\/image\/[^/]+\/.+\/did:plc:[^/]+\/[^/@]+(?:@[\w]+)?$/)) {
|
|
61
|
+
// Match image urls (pds), stripping optional format suffix (e.g. @webp) for stable snapshots
|
|
62
62
|
const match = str.match(
|
|
63
|
-
/\/image\/([^/]+)\/.+\/(did:plc:[^/]+)\/([
|
|
63
|
+
/\/image\/([^/]+)\/.+\/(did:plc:[^/]+)\/([^/@]+)(?:@[\w]+)?$/,
|
|
64
64
|
)
|
|
65
65
|
if (!match) return str
|
|
66
66
|
const [, sig, did, cid] = match
|
|
67
67
|
return str
|
|
68
68
|
.replace(sig, 'sig()')
|
|
69
69
|
.replace(did, take(users, did))
|
|
70
|
-
.replace(cid, take(cids, cid))
|
|
70
|
+
.replace(new RegExp(`${cid}(?:@\\w+)?`), take(cids, cid))
|
|
71
71
|
}
|
|
72
|
-
if (str.match(/\/img\/[^/]+\/.+\/did:plc:[^/]+\/[
|
|
73
|
-
// Match image urls (bsky w/ presets)
|
|
72
|
+
if (str.match(/\/img\/[^/]+\/.+\/did:plc:[^/]+\/[^/@]+(?:@[\w]+)?$/)) {
|
|
73
|
+
// Match image urls (bsky w/ presets), stripping optional format suffix (e.g. @webp) for stable snapshots
|
|
74
74
|
const match = str.match(
|
|
75
|
-
/\/img\/[^/]+\/.+\/(did:plc:[^/]+)\/([
|
|
75
|
+
/\/img\/[^/]+\/.+\/(did:plc:[^/]+)\/([^/@]+)(?:@[\w]+)?$/,
|
|
76
76
|
)
|
|
77
77
|
if (!match) return str
|
|
78
78
|
const [, did, cid] = match
|
|
79
|
-
return str
|
|
79
|
+
return str
|
|
80
|
+
.replace(did, take(users, did))
|
|
81
|
+
.replace(new RegExp(`${cid}(?:@\\w+)?`), take(cids, cid))
|
|
80
82
|
}
|
|
81
83
|
if (str.startsWith('localhost-')) {
|
|
82
84
|
return 'invite-code'
|
|
@@ -11,7 +11,7 @@ Object {
|
|
|
11
11
|
"allowSubscriptions": "followers",
|
|
12
12
|
},
|
|
13
13
|
},
|
|
14
|
-
"avatar": "https://bsky.public.url/img/avatar/plain/user(1)/cids(1)
|
|
14
|
+
"avatar": "https://bsky.public.url/img/avatar/plain/user(1)/cids(1)",
|
|
15
15
|
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
16
16
|
"did": "user(0)",
|
|
17
17
|
"displayName": "ali",
|
|
@@ -101,13 +101,13 @@ Object {
|
|
|
101
101
|
"images": Array [
|
|
102
102
|
Object {
|
|
103
103
|
"alt": "../dev-env/assets/key-landscape-small.jpg",
|
|
104
|
-
"fullsize": "https://bsky.public.url/img/feed_fullsize/plain/user(3)/cids(4)
|
|
105
|
-
"thumb": "https://bsky.public.url/img/feed_thumbnail/plain/user(3)/cids(4)
|
|
104
|
+
"fullsize": "https://bsky.public.url/img/feed_fullsize/plain/user(3)/cids(4)",
|
|
105
|
+
"thumb": "https://bsky.public.url/img/feed_thumbnail/plain/user(3)/cids(4)",
|
|
106
106
|
},
|
|
107
107
|
Object {
|
|
108
108
|
"alt": "../dev-env/assets/key-alt.jpg",
|
|
109
|
-
"fullsize": "https://bsky.public.url/img/feed_fullsize/plain/user(3)/cids(5)
|
|
110
|
-
"thumb": "https://bsky.public.url/img/feed_thumbnail/plain/user(3)/cids(5)
|
|
109
|
+
"fullsize": "https://bsky.public.url/img/feed_fullsize/plain/user(3)/cids(5)",
|
|
110
|
+
"thumb": "https://bsky.public.url/img/feed_thumbnail/plain/user(3)/cids(5)",
|
|
111
111
|
},
|
|
112
112
|
],
|
|
113
113
|
},
|
|
@@ -120,7 +120,7 @@ Object {
|
|
|
120
120
|
"allowSubscriptions": "followers",
|
|
121
121
|
},
|
|
122
122
|
},
|
|
123
|
-
"avatar": "https://bsky.public.url/img/avatar/plain/user(5)/cids(1)
|
|
123
|
+
"avatar": "https://bsky.public.url/img/avatar/plain/user(5)/cids(1)",
|
|
124
124
|
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
125
125
|
"did": "user(4)",
|
|
126
126
|
"displayName": "bobby",
|