@fedify/vocab 2.4.0-dev.1634 → 2.4.0-pr.934.40

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.
@@ -7,7 +7,6 @@ entity: true
7
7
  description: Represents an organization.
8
8
  defaultContext:
9
9
  - "https://www.w3.org/ns/activitystreams"
10
- - "https://w3id.org/fep/ef61"
11
10
  - "https://w3id.org/security/v1"
12
11
  - "https://w3id.org/security/data-integrity/v1"
13
12
  - "https://www.w3.org/ns/did/v1"
@@ -79,20 +78,6 @@ properties:
79
78
  range:
80
79
  - "https://w3id.org/security#Multikey"
81
80
 
82
- - pluralName: gateways
83
- singularName: gateway
84
- singularAccessor: true
85
- compactName: gateways
86
- uri: "https://w3id.org/fep/ef61/gateways"
87
- container: list
88
- description: |
89
- Gateways where the latest version of this portable actor object can be
90
- retrieved.
91
-
92
- See [FEP-ef61](https://w3id.org/fep/ef61) for details.
93
- range:
94
- - "fedify:gatewayUrl"
95
-
96
81
  - singularName: manuallyApprovesFollowers
97
82
  functional: true
98
83
  compactName: manuallyApprovesFollowers
package/src/page.yaml CHANGED
@@ -7,7 +7,6 @@ entity: true
7
7
  description: Represents a Web Page.
8
8
  defaultContext:
9
9
  - "https://www.w3.org/ns/activitystreams"
10
- - "https://w3id.org/security/data-integrity/v2"
11
- - digestMultibase: "https://www.w3.org/ns/credentials/v2#digestMultibase"
10
+ - "https://w3id.org/security/data-integrity/v1"
12
11
  - "https://gotosocial.org/ns"
13
12
  properties: []
package/src/person.yaml CHANGED
@@ -7,7 +7,6 @@ entity: true
7
7
  description: Represents an individual person.
8
8
  defaultContext:
9
9
  - "https://www.w3.org/ns/activitystreams"
10
- - "https://w3id.org/fep/ef61"
11
10
  - "https://w3id.org/security/v1"
12
11
  - "https://w3id.org/security/data-integrity/v1"
13
12
  - "https://www.w3.org/ns/did/v1"
@@ -79,20 +78,6 @@ properties:
79
78
  range:
80
79
  - "https://w3id.org/security#Multikey"
81
80
 
82
- - pluralName: gateways
83
- singularName: gateway
84
- singularAccessor: true
85
- compactName: gateways
86
- uri: "https://w3id.org/fep/ef61/gateways"
87
- container: list
88
- description: |
89
- Gateways where the latest version of this portable actor object can be
90
- retrieved.
91
-
92
- See [FEP-ef61](https://w3id.org/fep/ef61) for details.
93
- range:
94
- - "fedify:gatewayUrl"
95
-
96
81
  - singularName: manuallyApprovesFollowers
97
82
  functional: true
98
83
  compactName: manuallyApprovesFollowers
@@ -7,8 +7,7 @@ import { Image, Link } from "./vocab.ts";
7
7
  * When an `icon` or `image` property on a vocabulary object contains an
8
8
  * explicit ActivityStreams `Link` rather than an `Image`, this preprocessor
9
9
  * converts it into an `Image` by mapping `href` to `url`, copying
10
- * `mediaType`, `name`, `width`, `height`, and `digestMultibase`, and
11
- * discarding the rest.
10
+ * `mediaType`, `name`, `width`, and `height`, and discarding the rest.
12
11
  *
13
12
  * If the value is not a Link, or the Link has no `href`, it returns
14
13
  * `undefined` so the normal range decoder continues.
@@ -45,6 +44,5 @@ export const normalizeLinkToImage: PropertyPreprocessor<Image> = async (
45
44
  names: link.names != null && link.names.length > 0 ? link.names : undefined,
46
45
  width: link.width,
47
46
  height: link.height,
48
- digestMultibase: link.digestMultibase,
49
47
  });
50
48
  };
package/src/service.yaml CHANGED
@@ -7,7 +7,6 @@ entity: true
7
7
  description: Represents a service of any kind.
8
8
  defaultContext:
9
9
  - "https://www.w3.org/ns/activitystreams"
10
- - "https://w3id.org/fep/ef61"
11
10
  - "https://w3id.org/security/v1"
12
11
  - "https://w3id.org/security/data-integrity/v1"
13
12
  - "https://www.w3.org/ns/did/v1"
@@ -79,20 +78,6 @@ properties:
79
78
  range:
80
79
  - "https://w3id.org/security#Multikey"
81
80
 
82
- - pluralName: gateways
83
- singularName: gateway
84
- singularAccessor: true
85
- compactName: gateways
86
- uri: "https://w3id.org/fep/ef61/gateways"
87
- container: list
88
- description: |
89
- Gateways where the latest version of this portable actor object can be
90
- retrieved.
91
-
92
- See [FEP-ef61](https://w3id.org/fep/ef61) for details.
93
- range:
94
- - "fedify:gatewayUrl"
95
-
96
81
  - singularName: manuallyApprovesFollowers
97
82
  functional: true
98
83
  compactName: manuallyApprovesFollowers
package/src/video.yaml CHANGED
@@ -7,7 +7,6 @@ entity: true
7
7
  description: Represents a video document of any kind.
8
8
  defaultContext:
9
9
  - "https://www.w3.org/ns/activitystreams"
10
- - "https://w3id.org/security/data-integrity/v2"
11
- - digestMultibase: "https://www.w3.org/ns/credentials/v2#digestMultibase"
10
+ - "https://w3id.org/security/data-integrity/v1"
12
11
  - "https://gotosocial.org/ns"
13
12
  properties: []
package/src/vocab.test.ts CHANGED
@@ -28,7 +28,6 @@ import {
28
28
  Activity,
29
29
  Agreement,
30
30
  Announce,
31
- Application,
32
31
  Collection,
33
32
  Commitment,
34
33
  Create,
@@ -42,9 +41,7 @@ import {
42
41
  FeaturedItem,
43
42
  FeatureRequest,
44
43
  Follow,
45
- Group,
46
44
  Hashtag,
47
- Image,
48
45
  Intent,
49
46
  InteractionPolicy,
50
47
  InteractionRule,
@@ -55,7 +52,6 @@ import {
55
52
  Object,
56
53
  Offer,
57
54
  OrderedCollectionPage,
58
- Organization,
59
55
  Person,
60
56
  Place,
61
57
  Proposal,
@@ -63,7 +59,6 @@ import {
63
59
  QuoteAuthorization,
64
60
  QuoteRequest,
65
61
  Reject,
66
- Service,
67
62
  Source,
68
63
  Tombstone,
69
64
  } from "./vocab.ts";
@@ -628,242 +623,6 @@ test("fromJsonLd() handles portable ActivityPub IRIs", async () => {
628
623
  );
629
624
  });
630
625
 
631
- test("FEP-ef61: actor gateways round-trip as an ordered URI list", async () => {
632
- const actorClasses = [Application, Group, Organization, Person, Service];
633
- const gateways = [
634
- new URL("https://server1.example/"),
635
- new URL("https://server2.example/"),
636
- ];
637
-
638
- for (const ActorClass of actorClasses) {
639
- const actor = await ActorClass.fromJsonLd({
640
- "@context": [
641
- "https://www.w3.org/ns/activitystreams",
642
- "https://w3id.org/fep/ef61",
643
- ],
644
- type: ActorClass.name,
645
- id: "ap+ef61://did:key:z6Mkabc/actor",
646
- gateways: gateways.map((gateway) => gateway.href),
647
- });
648
- deepStrictEqual(actor.gateways, gateways);
649
-
650
- const jsonLd = await actor.toJsonLd() as Record<string, unknown>;
651
- deepStrictEqual(jsonLd.type, ActorClass.name);
652
- deepStrictEqual(jsonLd.gateways, gateways.map((gateway) => gateway.href));
653
-
654
- const restored = await ActorClass.fromJsonLd(jsonLd);
655
- deepStrictEqual(restored.gateways, gateways);
656
- }
657
- });
658
-
659
- test("FEP-ef61: actor gateways preserve single, empty, and invalid cases", async () => {
660
- const singleGateway = new Person({
661
- id: new URL("ap+ef61://did%3Akey%3Az6Mkabc/actor"),
662
- gateways: [new URL("https://server.example/")],
663
- });
664
- deepStrictEqual(
665
- (await singleGateway.toJsonLd() as Record<string, unknown>).gateways,
666
- ["https://server.example/"],
667
- );
668
-
669
- const noGateways = new Person({
670
- id: new URL("ap+ef61://did%3Akey%3Az6Mkabc/actor"),
671
- gateways: [],
672
- });
673
- ok(!("gateways" in (await noGateways.toJsonLd() as Record<string, unknown>)));
674
-
675
- await rejects(
676
- () =>
677
- Person.fromJsonLd({
678
- "@context": [
679
- "https://www.w3.org/ns/activitystreams",
680
- "https://w3id.org/fep/ef61",
681
- ],
682
- type: "Person",
683
- gateways: ["not a uri"],
684
- }),
685
- TypeError,
686
- );
687
- });
688
-
689
- test("FEP-ef61: actor gateways accept @id typed JSON-LD references", async () => {
690
- const actor = await Person.fromJsonLd({
691
- "@context": [
692
- "https://www.w3.org/ns/activitystreams",
693
- {
694
- gateways: {
695
- "@id": "https://w3id.org/fep/ef61/gateways",
696
- "@type": "@id",
697
- "@container": "@list",
698
- },
699
- },
700
- ],
701
- type: "Person",
702
- id: "ap+ef61://did:key:z6Mkabc/actor",
703
- gateways: ["https://gateway.example/"],
704
- });
705
-
706
- deepStrictEqual(actor.gateways, [new URL("https://gateway.example/")]);
707
- });
708
-
709
- test("FEP-ef61: actor gateways must be HTTP(S) base URIs", async () => {
710
- const validGateways = [
711
- new URL("https://server.example/"),
712
- new URL("http://server.example/"),
713
- ];
714
- const actor = new Person({
715
- id: new URL("ap+ef61://did%3Akey%3Az6Mkabc/actor"),
716
- gateways: validGateways,
717
- });
718
- deepStrictEqual(actor.gateways, validGateways);
719
-
720
- for (
721
- const gateway of [
722
- "ftp://server.example/",
723
- "https://user:pass@server.example/",
724
- "https://user@server.example/",
725
- "https://server.example/path",
726
- "https://server.example/?x=1",
727
- "https://server.example/#fragment",
728
- ]
729
- ) {
730
- throws(
731
- () =>
732
- new Person({
733
- id: new URL("ap+ef61://did%3Akey%3Az6Mkabc/actor"),
734
- gateways: [new URL(gateway)],
735
- }),
736
- TypeError,
737
- );
738
-
739
- await rejects(
740
- () =>
741
- Person.fromJsonLd({
742
- "@context": [
743
- "https://www.w3.org/ns/activitystreams",
744
- "https://w3id.org/fep/ef61",
745
- ],
746
- type: "Person",
747
- gateways: [gateway],
748
- }),
749
- TypeError,
750
- );
751
- }
752
- });
753
-
754
- test("FEP-ef61: digestMultibase round-trips on links and media objects", async () => {
755
- const digestMultibase = "zQmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n";
756
-
757
- const link = await Link.fromJsonLd({
758
- "@context": [
759
- "https://www.w3.org/ns/activitystreams",
760
- "https://w3id.org/fep/ef61",
761
- ],
762
- type: "Link",
763
- href: "hl:zQmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n",
764
- digestMultibase,
765
- });
766
- deepStrictEqual(link.digestMultibase, digestMultibase);
767
- deepStrictEqual(
768
- (await link.toJsonLd() as Record<string, unknown>).digestMultibase,
769
- digestMultibase,
770
- );
771
-
772
- for (const cls of [Document, Image]) {
773
- const media = await cls.fromJsonLd({
774
- "@context": [
775
- "https://www.w3.org/ns/activitystreams",
776
- "https://w3id.org/fep/ef61",
777
- ],
778
- type: cls.name,
779
- url: "hl:zQmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n",
780
- mediaType: "image/png",
781
- digestMultibase,
782
- });
783
- deepStrictEqual(media.digestMultibase, digestMultibase);
784
- const jsonLd = await media.toJsonLd() as Record<string, unknown>;
785
- deepStrictEqual(jsonLd.type, cls.name);
786
- deepStrictEqual(jsonLd.digestMultibase, digestMultibase);
787
- }
788
- });
789
-
790
- test("FEP-ef61: digestMultibase avoids Data Integrity context conflicts", async () => {
791
- const digestMultibase = "zQmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n";
792
- const image = new Image({
793
- url: new URL("hl:zQmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n"),
794
- mediaType: "image/png",
795
- digestMultibase,
796
- });
797
-
798
- const expanded = await image.toJsonLd({ format: "expand" });
799
- deepStrictEqual(
800
- (expanded as Record<string, unknown>[])[0][
801
- "https://www.w3.org/ns/credentials/v2#digestMultibase"
802
- ],
803
- [{ "@value": digestMultibase }],
804
- );
805
- ok(
806
- !(
807
- "https://w3id.org/security#digestMultibase" in
808
- (expanded as Record<string, unknown>[])[0]
809
- ),
810
- );
811
-
812
- const compact = await image.toJsonLd() as Record<string, unknown>;
813
- deepStrictEqual(compact.digestMultibase, digestMultibase);
814
- ok(
815
- !(compact["@context"] as unknown[]).includes("https://w3id.org/fep/ef61"),
816
- );
817
- ok(
818
- (compact["@context"] as unknown[]).some((context) =>
819
- context != null && typeof context === "object" &&
820
- (context as Record<string, unknown>).digestMultibase ===
821
- "https://www.w3.org/ns/credentials/v2#digestMultibase"
822
- ),
823
- );
824
- });
825
-
826
- test("FEP-ef61: digestMultibase parses after Data Integrity v1 contexts", async () => {
827
- const digestMultibase = "zQmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n";
828
- const image = await Image.fromJsonLd({
829
- "@context": [
830
- "https://www.w3.org/ns/activitystreams",
831
- "https://w3id.org/security/data-integrity/v1",
832
- "https://w3id.org/fep/ef61",
833
- ],
834
- type: "Image",
835
- url: "hl:zQmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n",
836
- mediaType: "image/png",
837
- digestMultibase,
838
- });
839
-
840
- deepStrictEqual(image.digestMultibase, digestMultibase);
841
- });
842
-
843
- test("FEP-ef61: Link image normalization preserves digestMultibase", async () => {
844
- const digestMultibase = "zQmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n";
845
- const obj = await Object.fromJsonLd({
846
- "@context": [
847
- "https://www.w3.org/ns/activitystreams",
848
- "https://w3id.org/security/data-integrity/v1",
849
- "https://w3id.org/fep/ef61",
850
- ],
851
- type: "Note",
852
- image: {
853
- type: "Link",
854
- href: "hl:zQmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n",
855
- mediaType: "image/png",
856
- digestMultibase,
857
- },
858
- });
859
- const images = [];
860
- for await (const img of obj.getImages()) {
861
- images.push(img);
862
- }
863
-
864
- deepStrictEqual(images[0]?.digestMultibase, digestMultibase);
865
- });
866
-
867
626
  test("fromJsonLd() caches text that mentions portable ActivityPub IRIs", async () => {
868
627
  const noteJson = {
869
628
  "@context": [
@@ -1992,7 +1751,6 @@ test("Person.toJsonLd()", async () => {
1992
1751
  deepStrictEqual(await person.toJsonLd(), {
1993
1752
  "@context": [
1994
1753
  "https://www.w3.org/ns/activitystreams",
1995
- "https://w3id.org/fep/ef61",
1996
1754
  "https://w3id.org/security/v1",
1997
1755
  "https://w3id.org/security/data-integrity/v1",
1998
1756
  "https://www.w3.org/ns/did/v1",
@@ -2773,7 +2531,6 @@ test("InteractionPolicy.canFeature", async () => {
2773
2531
  const expected = {
2774
2532
  "@context": [
2775
2533
  "https://www.w3.org/ns/activitystreams",
2776
- "https://w3id.org/fep/ef61",
2777
2534
  "https://w3id.org/security/v1",
2778
2535
  "https://w3id.org/security/data-integrity/v1",
2779
2536
  "https://www.w3.org/ns/did/v1",
@@ -5023,7 +4780,6 @@ const sampleValues: Record<string, any> = {
5023
4780
  ]),
5024
4781
  "fedify:langTag": new Intl.Locale("en-Latn-US"),
5025
4782
  "fedify:url": new URL("https://fedify.dev/"),
5026
- "fedify:gatewayUrl": new URL("https://gateway.example/"),
5027
4783
  "fedify:publicKey": rsaPublicKey.publicKey,
5028
4784
  "fedify:multibaseKey": ed25519PublicKey.publicKey,
5029
4785
  "fedify:proofPurpose": "assertionMethod",