@fedify/vocab 2.2.11 → 2.2.13
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/deno.json +1 -1
- package/dist/mod.cjs +217 -217
- package/dist/mod.js +217 -217
- package/dist-tests/actor.test.mjs +23 -23
- package/dist-tests/{deno-CxKlGUsX.mjs → deno-BetyHytq.mjs} +2 -2
- package/dist-tests/lookup.test.mjs +2 -2
- package/dist-tests/type.test.mjs +1 -1
- package/dist-tests/{vocab-latLVf4r.mjs → vocab-DJjWQkE9.mjs} +216 -216
- package/dist-tests/vocab.test.mjs +1 -1
- package/package.json +4 -4
- package/src/actor.test.ts +23 -22
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
globalThis.addEventListener = () => {};
|
|
3
|
-
import { A as vocab_exports, C as QuoteAuthorization, D as Tombstone, E as Source, S as Question, _ as OrderedCollectionPage, a as Create, b as Place, c as Endpoints, d as Hashtag, f as InteractionPolicy, g as Object$1, h as Note, i as Collection, l as Follow, m as Link, n as Announce, o as CryptographicKey, p as InteractionRule, s as Delete, t as Activity, w as QuoteRequest, x as PropertyValue, y as Person } from "./vocab-
|
|
3
|
+
import { A as vocab_exports, C as QuoteAuthorization, D as Tombstone, E as Source, S as Question, _ as OrderedCollectionPage, a as Create, b as Place, c as Endpoints, d as Hashtag, f as InteractionPolicy, g as Object$1, h as Note, i as Collection, l as Follow, m as Link, n as Announce, o as CryptographicKey, p as InteractionRule, s as Delete, t as Activity, w as QuoteRequest, x as PropertyValue, y as Person } from "./vocab-DJjWQkE9.mjs";
|
|
4
4
|
import { t as assertInstanceOf } from "./utils-CE8Dk5hm.mjs";
|
|
5
5
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
6
6
|
import { deepStrictEqual, notDeepStrictEqual, ok, rejects, throws } from "node:assert/strict";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fedify/vocab",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.13",
|
|
4
4
|
"homepage": "https://fedify.dev/",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"es-toolkit": "1.43.0",
|
|
47
47
|
"jsonld": "^9.0.0",
|
|
48
48
|
"pkijs": "^3.3.3",
|
|
49
|
-
"@fedify/
|
|
50
|
-
"@fedify/
|
|
51
|
-
"@fedify/vocab-
|
|
49
|
+
"@fedify/webfinger": "2.2.13",
|
|
50
|
+
"@fedify/vocab-runtime": "2.2.13",
|
|
51
|
+
"@fedify/vocab-tools": "2.2.13"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/node": "^22.17.0",
|
package/src/actor.test.ts
CHANGED
|
@@ -99,45 +99,46 @@ test({
|
|
|
99
99
|
async fn(t) {
|
|
100
100
|
fetchMock.spyGlobal();
|
|
101
101
|
|
|
102
|
+
// Node validates addresses before fetch; public IP literals avoid DNS.
|
|
102
103
|
fetchMock.get(
|
|
103
|
-
"begin:https://
|
|
104
|
+
"begin:https://1.1.1.1/.well-known/webfinger?",
|
|
104
105
|
{
|
|
105
|
-
body: { subject: "acct:johndoe@
|
|
106
|
+
body: { subject: "acct:johndoe@1.1.1.1" },
|
|
106
107
|
headers: { "Content-Type": "application/jrd+json" },
|
|
107
108
|
},
|
|
108
109
|
);
|
|
109
110
|
|
|
110
|
-
const actorId = new URL("https://
|
|
111
|
+
const actorId = new URL("https://1.1.1.1/@john");
|
|
111
112
|
const actor = new Person({
|
|
112
113
|
id: actorId,
|
|
113
114
|
preferredUsername: "john",
|
|
114
115
|
});
|
|
115
116
|
|
|
116
117
|
await t.step("WebFinger subject", async () => {
|
|
117
|
-
deepStrictEqual(await getActorHandle(actor), "@johndoe@
|
|
118
|
+
deepStrictEqual(await getActorHandle(actor), "@johndoe@1.1.1.1");
|
|
118
119
|
deepStrictEqual(
|
|
119
120
|
await getActorHandle(actor, { trimLeadingAt: true }),
|
|
120
|
-
"johndoe@
|
|
121
|
+
"johndoe@1.1.1.1",
|
|
121
122
|
);
|
|
122
123
|
deepStrictEqual(
|
|
123
124
|
await getActorHandle(actorId),
|
|
124
|
-
"@johndoe@
|
|
125
|
+
"@johndoe@1.1.1.1",
|
|
125
126
|
);
|
|
126
127
|
deepStrictEqual(
|
|
127
128
|
await getActorHandle(actorId, { trimLeadingAt: true }),
|
|
128
|
-
"johndoe@
|
|
129
|
+
"johndoe@1.1.1.1",
|
|
129
130
|
);
|
|
130
131
|
});
|
|
131
132
|
|
|
132
133
|
fetchMock.removeRoutes();
|
|
133
134
|
fetchMock.get(
|
|
134
|
-
"begin:https://
|
|
135
|
+
"begin:https://1.1.1.1/.well-known/webfinger?",
|
|
135
136
|
{
|
|
136
137
|
body: {
|
|
137
|
-
subject: "https://
|
|
138
|
+
subject: "https://1.1.1.1/@john",
|
|
138
139
|
aliases: [
|
|
139
|
-
"acct:john@
|
|
140
|
-
"acct:johndoe@
|
|
140
|
+
"acct:john@8.8.8.8",
|
|
141
|
+
"acct:johndoe@1.1.1.1",
|
|
141
142
|
],
|
|
142
143
|
},
|
|
143
144
|
headers: { "Content-Type": "application/jrd+json" },
|
|
@@ -145,28 +146,28 @@ test({
|
|
|
145
146
|
);
|
|
146
147
|
|
|
147
148
|
await t.step("WebFinger aliases", async () => {
|
|
148
|
-
deepStrictEqual(await getActorHandle(actor), "@johndoe@
|
|
149
|
+
deepStrictEqual(await getActorHandle(actor), "@johndoe@1.1.1.1");
|
|
149
150
|
deepStrictEqual(
|
|
150
151
|
await getActorHandle(actor, { trimLeadingAt: true }),
|
|
151
|
-
"johndoe@
|
|
152
|
+
"johndoe@1.1.1.1",
|
|
152
153
|
);
|
|
153
154
|
deepStrictEqual(
|
|
154
155
|
await getActorHandle(actorId),
|
|
155
|
-
"@johndoe@
|
|
156
|
+
"@johndoe@1.1.1.1",
|
|
156
157
|
);
|
|
157
158
|
deepStrictEqual(
|
|
158
159
|
await getActorHandle(actorId, { trimLeadingAt: true }),
|
|
159
|
-
"johndoe@
|
|
160
|
+
"johndoe@1.1.1.1",
|
|
160
161
|
);
|
|
161
162
|
});
|
|
162
163
|
|
|
163
164
|
fetchMock.get(
|
|
164
|
-
"begin:https://
|
|
165
|
+
"begin:https://8.8.8.8/.well-known/webfinger?",
|
|
165
166
|
{
|
|
166
167
|
body: {
|
|
167
|
-
subject: "acct:john@
|
|
168
|
+
subject: "acct:john@8.8.8.8",
|
|
168
169
|
aliases: [
|
|
169
|
-
"https://
|
|
170
|
+
"https://1.1.1.1/@john",
|
|
170
171
|
],
|
|
171
172
|
},
|
|
172
173
|
headers: { "Content-Type": "application/jrd+json" },
|
|
@@ -174,18 +175,18 @@ test({
|
|
|
174
175
|
);
|
|
175
176
|
|
|
176
177
|
await t.step("cross-origin WebFinger resources", async () => {
|
|
177
|
-
deepStrictEqual(await getActorHandle(actor), "@john@
|
|
178
|
+
deepStrictEqual(await getActorHandle(actor), "@john@8.8.8.8");
|
|
178
179
|
});
|
|
179
180
|
|
|
180
181
|
fetchMock.removeRoutes();
|
|
181
182
|
fetchMock.get(
|
|
182
|
-
"begin:https://
|
|
183
|
+
"begin:https://1.1.1.1/.well-known/webfinger?",
|
|
183
184
|
{ status: 404 },
|
|
184
185
|
);
|
|
185
186
|
|
|
186
187
|
await t.step("no WebFinger", async () => {
|
|
187
|
-
deepStrictEqual(await getActorHandle(actor), "@john@
|
|
188
|
-
rejects(() => getActorHandle(actorId), TypeError);
|
|
188
|
+
deepStrictEqual(await getActorHandle(actor), "@john@1.1.1.1");
|
|
189
|
+
await rejects(() => getActorHandle(actorId), TypeError);
|
|
189
190
|
});
|
|
190
191
|
|
|
191
192
|
fetchMock.hardReset();
|