@fedify/fedify 1.0.2 → 1.0.3
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/CHANGES.md +9 -0
- package/esm/federation/handler.js +1 -1
- package/esm/vocab/vocab.js +126 -63
- package/esm/webfinger/handler.js +1 -1
- package/package.json +1 -1
- package/types/deps/jsr.io/@std/http/{1.0.7 → 1.0.8}/_negotiation/common.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/http/{1.0.7 → 1.0.8}/_negotiation/encoding.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/http/{1.0.7 → 1.0.8}/_negotiation/language.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/http/{1.0.7 → 1.0.8}/_negotiation/media_type.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/http/{1.0.7 → 1.0.8}/negotiation.d.ts.map +1 -1
- package/types/vocab/vocab.d.ts.map +1 -1
- /package/esm/deps/jsr.io/@std/http/{1.0.7 → 1.0.8}/_negotiation/common.js +0 -0
- /package/esm/deps/jsr.io/@std/http/{1.0.7 → 1.0.8}/_negotiation/encoding.js +0 -0
- /package/esm/deps/jsr.io/@std/http/{1.0.7 → 1.0.8}/_negotiation/language.js +0 -0
- /package/esm/deps/jsr.io/@std/http/{1.0.7 → 1.0.8}/_negotiation/media_type.js +0 -0
- /package/esm/deps/jsr.io/@std/http/{1.0.7 → 1.0.8}/negotiation.js +0 -0
- /package/types/deps/jsr.io/@std/http/{1.0.7 → 1.0.8}/_negotiation/common.d.ts +0 -0
- /package/types/deps/jsr.io/@std/http/{1.0.7 → 1.0.8}/_negotiation/encoding.d.ts +0 -0
- /package/types/deps/jsr.io/@std/http/{1.0.7 → 1.0.8}/_negotiation/language.d.ts +0 -0
- /package/types/deps/jsr.io/@std/http/{1.0.7 → 1.0.8}/_negotiation/media_type.d.ts +0 -0
- /package/types/deps/jsr.io/@std/http/{1.0.7 → 1.0.8}/negotiation.d.ts +0 -0
package/CHANGES.md
CHANGED
@@ -3,6 +3,15 @@
|
|
3
3
|
Fedify changelog
|
4
4
|
================
|
5
5
|
|
6
|
+
Version 1.0.3
|
7
|
+
-------------
|
8
|
+
|
9
|
+
Released on October 17, 2024.
|
10
|
+
|
11
|
+
- Improved compatibility with some implementations (e.g., Nexkey) where
|
12
|
+
some `CryptographicKey` objects are incorrectly typed in JSON-LD objects.
|
13
|
+
|
14
|
+
|
6
15
|
Version 1.0.2
|
7
16
|
-------------
|
8
17
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as dntShim from "../_dnt.shims.js";
|
2
2
|
import { getLogger } from "@logtape/logtape";
|
3
|
-
import { accepts } from "../deps/jsr.io/@std/http/1.0.
|
3
|
+
import { accepts } from "../deps/jsr.io/@std/http/1.0.8/negotiation.js";
|
4
4
|
import { verifyRequest } from "../sig/http.js";
|
5
5
|
import { detachSignature, verifyJsonLd } from "../sig/ld.js";
|
6
6
|
import { doesActorOwnKey } from "../sig/owner.js";
|
package/esm/vocab/vocab.js
CHANGED
@@ -3701,7 +3701,8 @@ export class Object {
|
|
3701
3701
|
// deno-lint-ignore no-explicit-any
|
3702
3702
|
(expanded[0] ?? {});
|
3703
3703
|
}
|
3704
|
-
if ("@type" in values
|
3704
|
+
if ("@type" in values &&
|
3705
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
3705
3706
|
if (values["@type"].includes("http://joinmastodon.org/ns#Emoji")) {
|
3706
3707
|
return await Emoji.fromJsonLd(json, options);
|
3707
3708
|
}
|
@@ -5522,7 +5523,8 @@ export class Emoji extends Object {
|
|
5522
5523
|
// deno-lint-ignore no-explicit-any
|
5523
5524
|
(expanded[0] ?? {});
|
5524
5525
|
}
|
5525
|
-
if ("@type" in values
|
5526
|
+
if ("@type" in values &&
|
5527
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
5526
5528
|
if (!values["@type"].includes("http://joinmastodon.org/ns#Emoji")) {
|
5527
5529
|
throw new TypeError("Invalid type: " + values["@type"]);
|
5528
5530
|
}
|
@@ -5786,7 +5788,8 @@ export class ChatMessage extends Object {
|
|
5786
5788
|
// deno-lint-ignore no-explicit-any
|
5787
5789
|
(expanded[0] ?? {});
|
5788
5790
|
}
|
5789
|
-
if ("@type" in values
|
5791
|
+
if ("@type" in values &&
|
5792
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
5790
5793
|
if (!values["@type"].includes("http://litepub.social/ns#ChatMessage")) {
|
5791
5794
|
throw new TypeError("Invalid type: " + values["@type"]);
|
5792
5795
|
}
|
@@ -6113,7 +6116,8 @@ export class PropertyValue {
|
|
6113
6116
|
// deno-lint-ignore no-explicit-any
|
6114
6117
|
(expanded[0] ?? {});
|
6115
6118
|
}
|
6116
|
-
if ("@type" in values
|
6119
|
+
if ("@type" in values &&
|
6120
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
6117
6121
|
if (!values["@type"].includes("http://schema.org#PropertyValue")) {
|
6118
6122
|
throw new TypeError("Invalid type: " + values["@type"]);
|
6119
6123
|
}
|
@@ -6623,7 +6627,8 @@ export class DataIntegrityProof {
|
|
6623
6627
|
// deno-lint-ignore no-explicit-any
|
6624
6628
|
(expanded[0] ?? {});
|
6625
6629
|
}
|
6626
|
-
if ("@type" in values
|
6630
|
+
if ("@type" in values &&
|
6631
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
6627
6632
|
if (!values["@type"].includes("https://w3id.org/security#DataIntegrityProof")) {
|
6628
6633
|
throw new TypeError("Invalid type: " + values["@type"]);
|
6629
6634
|
}
|
@@ -7155,7 +7160,8 @@ export class CryptographicKey {
|
|
7155
7160
|
// deno-lint-ignore no-explicit-any
|
7156
7161
|
(expanded[0] ?? {});
|
7157
7162
|
}
|
7158
|
-
if ("@type" in values
|
7163
|
+
if ("@type" in values &&
|
7164
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
7159
7165
|
if (!values["@type"].includes("https://w3id.org/security#Key")) {
|
7160
7166
|
throw new TypeError("Invalid type: " + values["@type"]);
|
7161
7167
|
}
|
@@ -7646,7 +7652,8 @@ export class Multikey {
|
|
7646
7652
|
// deno-lint-ignore no-explicit-any
|
7647
7653
|
(expanded[0] ?? {});
|
7648
7654
|
}
|
7649
|
-
if ("@type" in values
|
7655
|
+
if ("@type" in values &&
|
7656
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
7650
7657
|
if (!values["@type"].includes("https://w3id.org/security#Multikey")) {
|
7651
7658
|
throw new TypeError("Invalid type: " + values["@type"]);
|
7652
7659
|
}
|
@@ -8847,7 +8854,8 @@ export class Activity extends Object {
|
|
8847
8854
|
// deno-lint-ignore no-explicit-any
|
8848
8855
|
(expanded[0] ?? {});
|
8849
8856
|
}
|
8850
|
-
if ("@type" in values
|
8857
|
+
if ("@type" in values &&
|
8858
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
8851
8859
|
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Accept")) {
|
8852
8860
|
return await Accept.fromJsonLd(json, options);
|
8853
8861
|
}
|
@@ -9333,7 +9341,8 @@ export class Accept extends Activity {
|
|
9333
9341
|
// deno-lint-ignore no-explicit-any
|
9334
9342
|
(expanded[0] ?? {});
|
9335
9343
|
}
|
9336
|
-
if ("@type" in values
|
9344
|
+
if ("@type" in values &&
|
9345
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
9337
9346
|
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#TentativeAccept")) {
|
9338
9347
|
return await TentativeAccept.fromJsonLd(json, options);
|
9339
9348
|
}
|
@@ -9497,7 +9506,8 @@ export class Add extends Activity {
|
|
9497
9506
|
// deno-lint-ignore no-explicit-any
|
9498
9507
|
(expanded[0] ?? {});
|
9499
9508
|
}
|
9500
|
-
if ("@type" in values
|
9509
|
+
if ("@type" in values &&
|
9510
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
9501
9511
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Add")) {
|
9502
9512
|
throw new TypeError("Invalid type: " + values["@type"]);
|
9503
9513
|
}
|
@@ -9669,7 +9679,8 @@ export class Announce extends Activity {
|
|
9669
9679
|
// deno-lint-ignore no-explicit-any
|
9670
9680
|
(expanded[0] ?? {});
|
9671
9681
|
}
|
9672
|
-
if ("@type" in values
|
9682
|
+
if ("@type" in values &&
|
9683
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
9673
9684
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Announce")) {
|
9674
9685
|
throw new TypeError("Invalid type: " + values["@type"]);
|
9675
9686
|
}
|
@@ -11818,7 +11829,8 @@ export class Application extends Object {
|
|
11818
11829
|
// deno-lint-ignore no-explicit-any
|
11819
11830
|
(expanded[0] ?? {});
|
11820
11831
|
}
|
11821
|
-
if ("@type" in values
|
11832
|
+
if ("@type" in values &&
|
11833
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
11822
11834
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Application")) {
|
11823
11835
|
throw new TypeError("Invalid type: " + values["@type"]);
|
11824
11836
|
}
|
@@ -12590,7 +12602,8 @@ export class IntransitiveActivity extends Activity {
|
|
12590
12602
|
// deno-lint-ignore no-explicit-any
|
12591
12603
|
(expanded[0] ?? {});
|
12592
12604
|
}
|
12593
|
-
if ("@type" in values
|
12605
|
+
if ("@type" in values &&
|
12606
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
12594
12607
|
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Arrive")) {
|
12595
12608
|
return await Arrive.fromJsonLd(json, options);
|
12596
12609
|
}
|
@@ -12759,7 +12772,8 @@ export class Arrive extends IntransitiveActivity {
|
|
12759
12772
|
// deno-lint-ignore no-explicit-any
|
12760
12773
|
(expanded[0] ?? {});
|
12761
12774
|
}
|
12762
|
-
if ("@type" in values
|
12775
|
+
if ("@type" in values &&
|
12776
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
12763
12777
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Arrive")) {
|
12764
12778
|
throw new TypeError("Invalid type: " + values["@type"]);
|
12765
12779
|
}
|
@@ -13021,7 +13035,8 @@ export class Article extends Object {
|
|
13021
13035
|
// deno-lint-ignore no-explicit-any
|
13022
13036
|
(expanded[0] ?? {});
|
13023
13037
|
}
|
13024
|
-
if ("@type" in values
|
13038
|
+
if ("@type" in values &&
|
13039
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
13025
13040
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Article")) {
|
13026
13041
|
throw new TypeError("Invalid type: " + values["@type"]);
|
13027
13042
|
}
|
@@ -13341,7 +13356,8 @@ export class Document extends Object {
|
|
13341
13356
|
// deno-lint-ignore no-explicit-any
|
13342
13357
|
(expanded[0] ?? {});
|
13343
13358
|
}
|
13344
|
-
if ("@type" in values
|
13359
|
+
if ("@type" in values &&
|
13360
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
13345
13361
|
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Audio")) {
|
13346
13362
|
return await Audio.fromJsonLd(json, options);
|
13347
13363
|
}
|
@@ -13579,7 +13595,8 @@ export class Audio extends Document {
|
|
13579
13595
|
// deno-lint-ignore no-explicit-any
|
13580
13596
|
(expanded[0] ?? {});
|
13581
13597
|
}
|
13582
|
-
if ("@type" in values
|
13598
|
+
if ("@type" in values &&
|
13599
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
13583
13600
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Audio")) {
|
13584
13601
|
throw new TypeError("Invalid type: " + values["@type"]);
|
13585
13602
|
}
|
@@ -13738,7 +13755,8 @@ export class Ignore extends Activity {
|
|
13738
13755
|
// deno-lint-ignore no-explicit-any
|
13739
13756
|
(expanded[0] ?? {});
|
13740
13757
|
}
|
13741
|
-
if ("@type" in values
|
13758
|
+
if ("@type" in values &&
|
13759
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
13742
13760
|
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Block")) {
|
13743
13761
|
return await Block.fromJsonLd(json, options);
|
13744
13762
|
}
|
@@ -13902,7 +13920,8 @@ export class Block extends Ignore {
|
|
13902
13920
|
// deno-lint-ignore no-explicit-any
|
13903
13921
|
(expanded[0] ?? {});
|
13904
13922
|
}
|
13905
|
-
if ("@type" in values
|
13923
|
+
if ("@type" in values &&
|
13924
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
13906
13925
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Block")) {
|
13907
13926
|
throw new TypeError("Invalid type: " + values["@type"]);
|
13908
13927
|
}
|
@@ -14585,7 +14604,8 @@ export class Collection extends Object {
|
|
14585
14604
|
// deno-lint-ignore no-explicit-any
|
14586
14605
|
(expanded[0] ?? {});
|
14587
14606
|
}
|
14588
|
-
if ("@type" in values
|
14607
|
+
if ("@type" in values &&
|
14608
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
14589
14609
|
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#CollectionPage")) {
|
14590
14610
|
return await CollectionPage.fromJsonLd(json, options);
|
14591
14611
|
}
|
@@ -15314,7 +15334,8 @@ export class CollectionPage extends Collection {
|
|
15314
15334
|
// deno-lint-ignore no-explicit-any
|
15315
15335
|
(expanded[0] ?? {});
|
15316
15336
|
}
|
15317
|
-
if ("@type" in values
|
15337
|
+
if ("@type" in values &&
|
15338
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
15318
15339
|
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollectionPage")) {
|
15319
15340
|
return await OrderedCollectionPage.fromJsonLd(json, options);
|
15320
15341
|
}
|
@@ -15582,7 +15603,8 @@ export class Create extends Activity {
|
|
15582
15603
|
// deno-lint-ignore no-explicit-any
|
15583
15604
|
(expanded[0] ?? {});
|
15584
15605
|
}
|
15585
|
-
if ("@type" in values
|
15606
|
+
if ("@type" in values &&
|
15607
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
15586
15608
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Create")) {
|
15587
15609
|
throw new TypeError("Invalid type: " + values["@type"]);
|
15588
15610
|
}
|
@@ -15754,7 +15776,8 @@ export class Delete extends Activity {
|
|
15754
15776
|
// deno-lint-ignore no-explicit-any
|
15755
15777
|
(expanded[0] ?? {});
|
15756
15778
|
}
|
15757
|
-
if ("@type" in values
|
15779
|
+
if ("@type" in values &&
|
15780
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
15758
15781
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Delete")) {
|
15759
15782
|
throw new TypeError("Invalid type: " + values["@type"]);
|
15760
15783
|
}
|
@@ -15912,7 +15935,8 @@ export class Dislike extends Activity {
|
|
15912
15935
|
// deno-lint-ignore no-explicit-any
|
15913
15936
|
(expanded[0] ?? {});
|
15914
15937
|
}
|
15915
|
-
if ("@type" in values
|
15938
|
+
if ("@type" in values &&
|
15939
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
15916
15940
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Dislike")) {
|
15917
15941
|
throw new TypeError("Invalid type: " + values["@type"]);
|
15918
15942
|
}
|
@@ -16418,7 +16442,8 @@ export class Endpoints {
|
|
16418
16442
|
// deno-lint-ignore no-explicit-any
|
16419
16443
|
(expanded[0] ?? {});
|
16420
16444
|
}
|
16421
|
-
if ("@type" in values
|
16445
|
+
if ("@type" in values &&
|
16446
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
16422
16447
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Endpoints")) {
|
16423
16448
|
throw new TypeError("Invalid type: " + values["@type"]);
|
16424
16449
|
}
|
@@ -16751,7 +16776,8 @@ export class Event extends Object {
|
|
16751
16776
|
// deno-lint-ignore no-explicit-any
|
16752
16777
|
(expanded[0] ?? {});
|
16753
16778
|
}
|
16754
|
-
if ("@type" in values
|
16779
|
+
if ("@type" in values &&
|
16780
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
16755
16781
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Event")) {
|
16756
16782
|
throw new TypeError("Invalid type: " + values["@type"]);
|
16757
16783
|
}
|
@@ -16911,7 +16937,8 @@ export class Flag extends Activity {
|
|
16911
16937
|
// deno-lint-ignore no-explicit-any
|
16912
16938
|
(expanded[0] ?? {});
|
16913
16939
|
}
|
16914
|
-
if ("@type" in values
|
16940
|
+
if ("@type" in values &&
|
16941
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
16915
16942
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Flag")) {
|
16916
16943
|
throw new TypeError("Invalid type: " + values["@type"]);
|
16917
16944
|
}
|
@@ -17072,7 +17099,8 @@ export class Follow extends Activity {
|
|
17072
17099
|
// deno-lint-ignore no-explicit-any
|
17073
17100
|
(expanded[0] ?? {});
|
17074
17101
|
}
|
17075
|
-
if ("@type" in values
|
17102
|
+
if ("@type" in values &&
|
17103
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
17076
17104
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Follow")) {
|
17077
17105
|
throw new TypeError("Invalid type: " + values["@type"]);
|
17078
17106
|
}
|
@@ -19221,7 +19249,8 @@ export class Group extends Object {
|
|
19221
19249
|
// deno-lint-ignore no-explicit-any
|
19222
19250
|
(expanded[0] ?? {});
|
19223
19251
|
}
|
19224
|
-
if ("@type" in values
|
19252
|
+
if ("@type" in values &&
|
19253
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
19225
19254
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Group")) {
|
19226
19255
|
throw new TypeError("Invalid type: " + values["@type"]);
|
19227
19256
|
}
|
@@ -20579,7 +20608,8 @@ export class Link {
|
|
20579
20608
|
// deno-lint-ignore no-explicit-any
|
20580
20609
|
(expanded[0] ?? {});
|
20581
20610
|
}
|
20582
|
-
if ("@type" in values
|
20611
|
+
if ("@type" in values &&
|
20612
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
20583
20613
|
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Hashtag")) {
|
20584
20614
|
return await Hashtag.fromJsonLd(json, options);
|
20585
20615
|
}
|
@@ -21050,7 +21080,8 @@ export class Hashtag extends Link {
|
|
21050
21080
|
// deno-lint-ignore no-explicit-any
|
21051
21081
|
(expanded[0] ?? {});
|
21052
21082
|
}
|
21053
|
-
if ("@type" in values
|
21083
|
+
if ("@type" in values &&
|
21084
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
21054
21085
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Hashtag")) {
|
21055
21086
|
throw new TypeError("Invalid type: " + values["@type"]);
|
21056
21087
|
}
|
@@ -21218,7 +21249,8 @@ export class Image extends Document {
|
|
21218
21249
|
// deno-lint-ignore no-explicit-any
|
21219
21250
|
(expanded[0] ?? {});
|
21220
21251
|
}
|
21221
|
-
if ("@type" in values
|
21252
|
+
if ("@type" in values &&
|
21253
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
21222
21254
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Image")) {
|
21223
21255
|
throw new TypeError("Invalid type: " + values["@type"]);
|
21224
21256
|
}
|
@@ -21378,7 +21410,8 @@ export class Offer extends Activity {
|
|
21378
21410
|
// deno-lint-ignore no-explicit-any
|
21379
21411
|
(expanded[0] ?? {});
|
21380
21412
|
}
|
21381
|
-
if ("@type" in values
|
21413
|
+
if ("@type" in values &&
|
21414
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
21382
21415
|
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Invite")) {
|
21383
21416
|
return await Invite.fromJsonLd(json, options);
|
21384
21417
|
}
|
@@ -21540,7 +21573,8 @@ export class Invite extends Offer {
|
|
21540
21573
|
// deno-lint-ignore no-explicit-any
|
21541
21574
|
(expanded[0] ?? {});
|
21542
21575
|
}
|
21543
|
-
if ("@type" in values
|
21576
|
+
if ("@type" in values &&
|
21577
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
21544
21578
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Invite")) {
|
21545
21579
|
throw new TypeError("Invalid type: " + values["@type"]);
|
21546
21580
|
}
|
@@ -21699,7 +21733,8 @@ export class Join extends Activity {
|
|
21699
21733
|
// deno-lint-ignore no-explicit-any
|
21700
21734
|
(expanded[0] ?? {});
|
21701
21735
|
}
|
21702
|
-
if ("@type" in values
|
21736
|
+
if ("@type" in values &&
|
21737
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
21703
21738
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Join")) {
|
21704
21739
|
throw new TypeError("Invalid type: " + values["@type"]);
|
21705
21740
|
}
|
@@ -21858,7 +21893,8 @@ export class Leave extends Activity {
|
|
21858
21893
|
// deno-lint-ignore no-explicit-any
|
21859
21894
|
(expanded[0] ?? {});
|
21860
21895
|
}
|
21861
|
-
if ("@type" in values
|
21896
|
+
if ("@type" in values &&
|
21897
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
21862
21898
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Leave")) {
|
21863
21899
|
throw new TypeError("Invalid type: " + values["@type"]);
|
21864
21900
|
}
|
@@ -22017,7 +22053,8 @@ export class Like extends Activity {
|
|
22017
22053
|
// deno-lint-ignore no-explicit-any
|
22018
22054
|
(expanded[0] ?? {});
|
22019
22055
|
}
|
22020
|
-
if ("@type" in values
|
22056
|
+
if ("@type" in values &&
|
22057
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
22021
22058
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Like")) {
|
22022
22059
|
throw new TypeError("Invalid type: " + values["@type"]);
|
22023
22060
|
}
|
@@ -22175,7 +22212,8 @@ export class Listen extends Activity {
|
|
22175
22212
|
// deno-lint-ignore no-explicit-any
|
22176
22213
|
(expanded[0] ?? {});
|
22177
22214
|
}
|
22178
|
-
if ("@type" in values
|
22215
|
+
if ("@type" in values &&
|
22216
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
22179
22217
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Listen")) {
|
22180
22218
|
throw new TypeError("Invalid type: " + values["@type"]);
|
22181
22219
|
}
|
@@ -22332,7 +22370,8 @@ export class Mention extends Link {
|
|
22332
22370
|
// deno-lint-ignore no-explicit-any
|
22333
22371
|
(expanded[0] ?? {});
|
22334
22372
|
}
|
22335
|
-
if ("@type" in values
|
22373
|
+
if ("@type" in values &&
|
22374
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
22336
22375
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Mention")) {
|
22337
22376
|
throw new TypeError("Invalid type: " + values["@type"]);
|
22338
22377
|
}
|
@@ -22492,7 +22531,8 @@ export class Move extends Activity {
|
|
22492
22531
|
// deno-lint-ignore no-explicit-any
|
22493
22532
|
(expanded[0] ?? {});
|
22494
22533
|
}
|
22495
|
-
if ("@type" in values
|
22534
|
+
if ("@type" in values &&
|
22535
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
22496
22536
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Move")) {
|
22497
22537
|
throw new TypeError("Invalid type: " + values["@type"]);
|
22498
22538
|
}
|
@@ -22755,7 +22795,8 @@ export class Note extends Object {
|
|
22755
22795
|
// deno-lint-ignore no-explicit-any
|
22756
22796
|
(expanded[0] ?? {});
|
22757
22797
|
}
|
22758
|
-
if ("@type" in values
|
22798
|
+
if ("@type" in values &&
|
22799
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
22759
22800
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Note")) {
|
22760
22801
|
throw new TypeError("Invalid type: " + values["@type"]);
|
22761
22802
|
}
|
@@ -23102,7 +23143,8 @@ export class OrderedCollection extends Collection {
|
|
23102
23143
|
// deno-lint-ignore no-explicit-any
|
23103
23144
|
(expanded[0] ?? {});
|
23104
23145
|
}
|
23105
|
-
if ("@type" in values
|
23146
|
+
if ("@type" in values &&
|
23147
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
23106
23148
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollection")) {
|
23107
23149
|
throw new TypeError("Invalid type: " + values["@type"]);
|
23108
23150
|
}
|
@@ -23572,7 +23614,8 @@ export class OrderedCollectionPage extends CollectionPage {
|
|
23572
23614
|
// deno-lint-ignore no-explicit-any
|
23573
23615
|
(expanded[0] ?? {});
|
23574
23616
|
}
|
23575
|
-
if ("@type" in values
|
23617
|
+
if ("@type" in values &&
|
23618
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
23576
23619
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollectionPage")) {
|
23577
23620
|
throw new TypeError("Invalid type: " + values["@type"]);
|
23578
23621
|
}
|
@@ -25850,7 +25893,8 @@ export class Organization extends Object {
|
|
25850
25893
|
// deno-lint-ignore no-explicit-any
|
25851
25894
|
(expanded[0] ?? {});
|
25852
25895
|
}
|
25853
|
-
if ("@type" in values
|
25896
|
+
if ("@type" in values &&
|
25897
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
25854
25898
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Organization")) {
|
25855
25899
|
throw new TypeError("Invalid type: " + values["@type"]);
|
25856
25900
|
}
|
@@ -26634,7 +26678,8 @@ export class Page extends Document {
|
|
26634
26678
|
// deno-lint-ignore no-explicit-any
|
26635
26679
|
(expanded[0] ?? {});
|
26636
26680
|
}
|
26637
|
-
if ("@type" in values
|
26681
|
+
if ("@type" in values &&
|
26682
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
26638
26683
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Page")) {
|
26639
26684
|
throw new TypeError("Invalid type: " + values["@type"]);
|
26640
26685
|
}
|
@@ -28783,7 +28828,8 @@ export class Person extends Object {
|
|
28783
28828
|
// deno-lint-ignore no-explicit-any
|
28784
28829
|
(expanded[0] ?? {});
|
28785
28830
|
}
|
28786
|
-
if ("@type" in values
|
28831
|
+
if ("@type" in values &&
|
28832
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
28787
28833
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Person")) {
|
28788
28834
|
throw new TypeError("Invalid type: " + values["@type"]);
|
28789
28835
|
}
|
@@ -29898,7 +29944,8 @@ export class Place extends Object {
|
|
29898
29944
|
// deno-lint-ignore no-explicit-any
|
29899
29945
|
(expanded[0] ?? {});
|
29900
29946
|
}
|
29901
|
-
if ("@type" in values
|
29947
|
+
if ("@type" in values &&
|
29948
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
29902
29949
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Place")) {
|
29903
29950
|
throw new TypeError("Invalid type: " + values["@type"]);
|
29904
29951
|
}
|
@@ -30348,7 +30395,8 @@ export class Profile extends Object {
|
|
30348
30395
|
// deno-lint-ignore no-explicit-any
|
30349
30396
|
(expanded[0] ?? {});
|
30350
30397
|
}
|
30351
|
-
if ("@type" in values
|
30398
|
+
if ("@type" in values &&
|
30399
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
30352
30400
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Profile")) {
|
30353
30401
|
throw new TypeError("Invalid type: " + values["@type"]);
|
30354
30402
|
}
|
@@ -30878,7 +30926,8 @@ export class Question extends IntransitiveActivity {
|
|
30878
30926
|
// deno-lint-ignore no-explicit-any
|
30879
30927
|
(expanded[0] ?? {});
|
30880
30928
|
}
|
30881
|
-
if ("@type" in values
|
30929
|
+
if ("@type" in values &&
|
30930
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
30882
30931
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Question")) {
|
30883
30932
|
throw new TypeError("Invalid type: " + values["@type"]);
|
30884
30933
|
}
|
@@ -31200,7 +31249,8 @@ export class Read extends Activity {
|
|
31200
31249
|
// deno-lint-ignore no-explicit-any
|
31201
31250
|
(expanded[0] ?? {});
|
31202
31251
|
}
|
31203
|
-
if ("@type" in values
|
31252
|
+
if ("@type" in values &&
|
31253
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
31204
31254
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Read")) {
|
31205
31255
|
throw new TypeError("Invalid type: " + values["@type"]);
|
31206
31256
|
}
|
@@ -31359,7 +31409,8 @@ export class Reject extends Activity {
|
|
31359
31409
|
// deno-lint-ignore no-explicit-any
|
31360
31410
|
(expanded[0] ?? {});
|
31361
31411
|
}
|
31362
|
-
if ("@type" in values
|
31412
|
+
if ("@type" in values &&
|
31413
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
31363
31414
|
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#TentativeReject")) {
|
31364
31415
|
return await TentativeReject.fromJsonLd(json, options);
|
31365
31416
|
}
|
@@ -31981,7 +32032,8 @@ export class Relationship extends Object {
|
|
31981
32032
|
// deno-lint-ignore no-explicit-any
|
31982
32033
|
(expanded[0] ?? {});
|
31983
32034
|
}
|
31984
|
-
if ("@type" in values
|
32035
|
+
if ("@type" in values &&
|
32036
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
31985
32037
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Relationship")) {
|
31986
32038
|
throw new TypeError("Invalid type: " + values["@type"]);
|
31987
32039
|
}
|
@@ -32243,7 +32295,8 @@ export class Remove extends Activity {
|
|
32243
32295
|
// deno-lint-ignore no-explicit-any
|
32244
32296
|
(expanded[0] ?? {});
|
32245
32297
|
}
|
32246
|
-
if ("@type" in values
|
32298
|
+
if ("@type" in values &&
|
32299
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
32247
32300
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Remove")) {
|
32248
32301
|
throw new TypeError("Invalid type: " + values["@type"]);
|
32249
32302
|
}
|
@@ -34392,7 +34445,8 @@ export class Service extends Object {
|
|
34392
34445
|
// deno-lint-ignore no-explicit-any
|
34393
34446
|
(expanded[0] ?? {});
|
34394
34447
|
}
|
34395
|
-
if ("@type" in values
|
34448
|
+
if ("@type" in values &&
|
34449
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
34396
34450
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Service")) {
|
34397
34451
|
throw new TypeError("Invalid type: " + values["@type"]);
|
34398
34452
|
}
|
@@ -35313,7 +35367,8 @@ export class Source {
|
|
35313
35367
|
// deno-lint-ignore no-explicit-any
|
35314
35368
|
(expanded[0] ?? {});
|
35315
35369
|
}
|
35316
|
-
if ("@type" in values
|
35370
|
+
if ("@type" in values &&
|
35371
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
35317
35372
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Source")) {
|
35318
35373
|
throw new TypeError("Invalid type: " + values["@type"]);
|
35319
35374
|
}
|
@@ -35537,7 +35592,8 @@ export class TentativeAccept extends Accept {
|
|
35537
35592
|
// deno-lint-ignore no-explicit-any
|
35538
35593
|
(expanded[0] ?? {});
|
35539
35594
|
}
|
35540
|
-
if ("@type" in values
|
35595
|
+
if ("@type" in values &&
|
35596
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
35541
35597
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#TentativeAccept")) {
|
35542
35598
|
throw new TypeError("Invalid type: " + values["@type"]);
|
35543
35599
|
}
|
@@ -35696,7 +35752,8 @@ export class TentativeReject extends Reject {
|
|
35696
35752
|
// deno-lint-ignore no-explicit-any
|
35697
35753
|
(expanded[0] ?? {});
|
35698
35754
|
}
|
35699
|
-
if ("@type" in values
|
35755
|
+
if ("@type" in values &&
|
35756
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
35700
35757
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#TentativeReject")) {
|
35701
35758
|
throw new TypeError("Invalid type: " + values["@type"]);
|
35702
35759
|
}
|
@@ -35925,7 +35982,8 @@ export class Tombstone extends Object {
|
|
35925
35982
|
// deno-lint-ignore no-explicit-any
|
35926
35983
|
(expanded[0] ?? {});
|
35927
35984
|
}
|
35928
|
-
if ("@type" in values
|
35985
|
+
if ("@type" in values &&
|
35986
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
35929
35987
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Tombstone")) {
|
35930
35988
|
throw new TypeError("Invalid type: " + values["@type"]);
|
35931
35989
|
}
|
@@ -36112,7 +36170,8 @@ export class Travel extends IntransitiveActivity {
|
|
36112
36170
|
// deno-lint-ignore no-explicit-any
|
36113
36171
|
(expanded[0] ?? {});
|
36114
36172
|
}
|
36115
|
-
if ("@type" in values
|
36173
|
+
if ("@type" in values &&
|
36174
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
36116
36175
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Travel")) {
|
36117
36176
|
throw new TypeError("Invalid type: " + values["@type"]);
|
36118
36177
|
}
|
@@ -36276,7 +36335,8 @@ export class Undo extends Activity {
|
|
36276
36335
|
// deno-lint-ignore no-explicit-any
|
36277
36336
|
(expanded[0] ?? {});
|
36278
36337
|
}
|
36279
|
-
if ("@type" in values
|
36338
|
+
if ("@type" in values &&
|
36339
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
36280
36340
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Undo")) {
|
36281
36341
|
throw new TypeError("Invalid type: " + values["@type"]);
|
36282
36342
|
}
|
@@ -36461,7 +36521,8 @@ export class Update extends Activity {
|
|
36461
36521
|
// deno-lint-ignore no-explicit-any
|
36462
36522
|
(expanded[0] ?? {});
|
36463
36523
|
}
|
36464
|
-
if ("@type" in values
|
36524
|
+
if ("@type" in values &&
|
36525
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
36465
36526
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Update")) {
|
36466
36527
|
throw new TypeError("Invalid type: " + values["@type"]);
|
36467
36528
|
}
|
@@ -36635,7 +36696,8 @@ export class Video extends Document {
|
|
36635
36696
|
// deno-lint-ignore no-explicit-any
|
36636
36697
|
(expanded[0] ?? {});
|
36637
36698
|
}
|
36638
|
-
if ("@type" in values
|
36699
|
+
if ("@type" in values &&
|
36700
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
36639
36701
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Video")) {
|
36640
36702
|
throw new TypeError("Invalid type: " + values["@type"]);
|
36641
36703
|
}
|
@@ -36793,7 +36855,8 @@ export class View extends Activity {
|
|
36793
36855
|
// deno-lint-ignore no-explicit-any
|
36794
36856
|
(expanded[0] ?? {});
|
36795
36857
|
}
|
36796
|
-
if ("@type" in values
|
36858
|
+
if ("@type" in values &&
|
36859
|
+
!values["@type"].every((t) => t.startsWith("_:"))) {
|
36797
36860
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#View")) {
|
36798
36861
|
throw new TypeError("Invalid type: " + values["@type"]);
|
36799
36862
|
}
|
package/esm/webfinger/handler.js
CHANGED
@@ -24,7 +24,7 @@ export async function handleWebFinger(request, { context, actorDispatcher, actor
|
|
24
24
|
if (e instanceof TypeError) {
|
25
25
|
return new Response("Invalid resource URL.", { status: 400 });
|
26
26
|
}
|
27
|
-
throw
|
27
|
+
throw e;
|
28
28
|
}
|
29
29
|
if (actorDispatcher == null) {
|
30
30
|
logger.error("Actor dispatcher is not set.");
|