@fedify/fedify 0.10.0-dev.196 → 0.10.0-dev.198

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.
Files changed (42) hide show
  1. package/CHANGES.md +15 -0
  2. package/esm/testing/fixtures/w3id.org/security/data-integrity/v1 +74 -0
  3. package/esm/vocab/accept.yaml +3 -1
  4. package/esm/vocab/activity.yaml +1 -0
  5. package/esm/vocab/add.yaml +3 -1
  6. package/esm/vocab/announce.yaml +1 -0
  7. package/esm/vocab/application.yaml +1 -0
  8. package/esm/vocab/article.yaml +1 -0
  9. package/esm/vocab/audio.yaml +3 -1
  10. package/esm/vocab/block.yaml +3 -1
  11. package/esm/vocab/create.yaml +1 -0
  12. package/esm/vocab/dataintegrityproof.yaml +56 -0
  13. package/esm/vocab/delete.yaml +3 -1
  14. package/esm/vocab/dislike.yaml +3 -1
  15. package/esm/vocab/document.yaml +4 -2
  16. package/esm/vocab/event.yaml +3 -1
  17. package/esm/vocab/flag.yaml +3 -1
  18. package/esm/vocab/follow.yaml +3 -1
  19. package/esm/vocab/group.yaml +1 -0
  20. package/esm/vocab/ignore.yaml +3 -1
  21. package/esm/vocab/intransitiveactivity.yaml +3 -1
  22. package/esm/vocab/like.yaml +3 -1
  23. package/esm/vocab/note.yaml +1 -0
  24. package/esm/vocab/object.yaml +10 -0
  25. package/esm/vocab/organization.yaml +1 -0
  26. package/esm/vocab/page.yaml +3 -1
  27. package/esm/vocab/person.yaml +1 -0
  28. package/esm/vocab/place.yaml +3 -1
  29. package/esm/vocab/profile.yaml +3 -1
  30. package/esm/vocab/reject.yaml +3 -1
  31. package/esm/vocab/relationship.yaml +3 -1
  32. package/esm/vocab/remove.yaml +3 -1
  33. package/esm/vocab/service.yaml +1 -0
  34. package/esm/vocab/tombstone.yaml +3 -1
  35. package/esm/vocab/undo.yaml +4 -2
  36. package/esm/vocab/update.yaml +1 -0
  37. package/esm/vocab/video.yaml +3 -1
  38. package/esm/vocab/vocab.js +632 -36
  39. package/package.json +1 -1
  40. package/types/codegen/type.d.ts.map +1 -1
  41. package/types/vocab/vocab.d.ts +282 -0
  42. package/types/vocab/vocab.d.ts.map +1 -1
@@ -4,6 +4,7 @@ import * as dntShim from "../_dnt.shims.js";
4
4
  // @ts-ignore TS7016
5
5
  import jsonld from "jsonld";
6
6
  import { parseLanguageTag } from "@phensley/language-tag";
7
+ import { decode as decodeMultibase, encode as encodeMultibase, } from "multibase";
7
8
  import { fetchDocumentLoader, } from "../runtime/docloader.js";
8
9
  import { exportMultibaseKey, exportSpki, importMultibaseKey, importSpki, } from "../runtime/key.js";
9
10
  import { LanguageString } from "../runtime/langstr.js";
@@ -56,6 +57,7 @@ export class Object {
56
57
  #_3BLrzmscsjHCw8TF5BHRW9WkPnX8 = [];
57
58
  #_3bNvLMBN1bCJETiTihM3wvi1B2JX = [];
58
59
  #_u8gdcDTtChQ4tbSQMXc4cYWyum7 = [];
60
+ #_42rPnotok1ivQ2RNCKNbeFJgx8b8 = [];
59
61
  /**
60
62
  * Constructs a new instance of Object with the given values.
61
63
  * @param values The values to initialize the instance with.
@@ -266,6 +268,17 @@ export class Object {
266
268
  if ("sensitive" in values && values.sensitive != null) {
267
269
  this.#_u8gdcDTtChQ4tbSQMXc4cYWyum7 = [values.sensitive];
268
270
  }
271
+ if ("proof" in values && values.proof != null) {
272
+ this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8 = [values.proof];
273
+ }
274
+ if ("proofs" in values && values.proofs != null) {
275
+ if ("proof" in values &&
276
+ values.proof != null) {
277
+ throw new TypeError("Cannot initialize both proof and " +
278
+ "proofs at the same time.");
279
+ }
280
+ this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8 = values.proofs;
281
+ }
269
282
  }
270
283
  /**
271
284
  * Clones this instance, optionally updating it with the given values.
@@ -504,6 +517,18 @@ export class Object {
504
517
  if ("sensitive" in values && values.sensitive != null) {
505
518
  clone.#_u8gdcDTtChQ4tbSQMXc4cYWyum7 = [values.sensitive];
506
519
  }
520
+ clone.#_42rPnotok1ivQ2RNCKNbeFJgx8b8 = this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8;
521
+ if ("proof" in values && values.proof != null) {
522
+ clone.#_42rPnotok1ivQ2RNCKNbeFJgx8b8 = [values.proof];
523
+ }
524
+ if ("proofs" in values && values.proofs != null) {
525
+ if ("proof" in values &&
526
+ values.proof != null) {
527
+ throw new TypeError("Cannot update both proof and " +
528
+ "proofs at the same time.");
529
+ }
530
+ clone.#_42rPnotok1ivQ2RNCKNbeFJgx8b8 = values.proofs;
531
+ }
507
532
  return clone;
508
533
  }
509
534
  async #fetchAttachment(url, options = {}) {
@@ -1692,6 +1717,71 @@ export class Object {
1692
1717
  return null;
1693
1718
  return this.#_u8gdcDTtChQ4tbSQMXc4cYWyum7[0];
1694
1719
  }
1720
+ async #fetchProof(url, options = {}) {
1721
+ const documentLoader = options.documentLoader ?? this._documentLoader ??
1722
+ fetchDocumentLoader;
1723
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
1724
+ fetchDocumentLoader;
1725
+ const { document } = await documentLoader(url.href);
1726
+ try {
1727
+ return await DataIntegrityProof.fromJsonLd(document, { documentLoader, contextLoader });
1728
+ }
1729
+ catch (e) {
1730
+ if (!(e instanceof TypeError))
1731
+ throw e;
1732
+ }
1733
+ throw new TypeError("Expected an object of any type of: " +
1734
+ ["https://w3id.org/security#DataIntegrityProof"].join(", "));
1735
+ }
1736
+ /**
1737
+ * Similar to
1738
+ * {@link Object.getProof},
1739
+ * but returns its `@id` URL instead of the object itself.
1740
+ */
1741
+ get proofId() {
1742
+ if (this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8.length < 1)
1743
+ return null;
1744
+ const v = this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8[0];
1745
+ if (v instanceof URL)
1746
+ return v;
1747
+ return v.id;
1748
+ }
1749
+ /** A cryptographic proof that can be used to verify the integrity of an object.
1750
+ */
1751
+ async getProof(options = {}) {
1752
+ if (this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8.length < 1)
1753
+ return null;
1754
+ const v = this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8[0];
1755
+ if (v instanceof URL) {
1756
+ const fetched = await this.#fetchProof(v, options);
1757
+ this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8[0] = fetched;
1758
+ return fetched;
1759
+ }
1760
+ return v;
1761
+ }
1762
+ /**
1763
+ * Similar to
1764
+ * {@link Object.getProofs},
1765
+ * but returns their `@id`s instead of the objects themselves.
1766
+ */
1767
+ get proofIds() {
1768
+ return this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8.map((v) => v instanceof URL ? v : v.id).filter((id) => id !== null);
1769
+ }
1770
+ /** A cryptographic proof that can be used to verify the integrity of an object.
1771
+ */
1772
+ async *getProofs(options = {}) {
1773
+ const vs = this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8;
1774
+ for (let i = 0; i < vs.length; i++) {
1775
+ const v = vs[i];
1776
+ if (v instanceof URL) {
1777
+ const fetched = await this.#fetchProof(v, options);
1778
+ vs[i] = fetched;
1779
+ yield fetched;
1780
+ continue;
1781
+ }
1782
+ yield v;
1783
+ }
1784
+ }
1695
1785
  /**
1696
1786
  * Converts this object to a JSON-LD structure.
1697
1787
  * @returns The JSON-LD representation of this object.
@@ -1957,15 +2047,23 @@ export class Object {
1957
2047
  if (array.length > 0) {
1958
2048
  values["https://www.w3.org/ns/activitystreams#sensitive"] = array;
1959
2049
  }
2050
+ array = [];
2051
+ for (const v of this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8) {
2052
+ array.push(v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options));
2053
+ }
2054
+ if (array.length > 0)
2055
+ values["https://w3id.org/security#proof"] = array;
1960
2056
  values["@type"] = ["https://www.w3.org/ns/activitystreams#Object"];
1961
2057
  if (this.id)
1962
2058
  values["@id"] = this.id.href;
1963
2059
  if (options.expand) {
1964
2060
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
1965
2061
  }
1966
- return await jsonld.compact(values, ["https://www.w3.org/ns/activitystreams", {
1967
- "sensitive": "as:sensitive",
1968
- }], { documentLoader: options.contextLoader });
2062
+ return await jsonld.compact(values, [
2063
+ "https://www.w3.org/ns/activitystreams",
2064
+ "https://w3id.org/security/data-integrity/v1",
2065
+ { "sensitive": "as:sensitive" },
2066
+ ], { documentLoader: options.contextLoader });
1969
2067
  }
1970
2068
  /**
1971
2069
  * Converts a JSON-LD structure to an object of this type.
@@ -2894,6 +2992,18 @@ export class Object {
2894
2992
  _u8gdcDTtChQ4tbSQMXc4cYWyum7.push(v["@value"]);
2895
2993
  }
2896
2994
  instance.#_u8gdcDTtChQ4tbSQMXc4cYWyum7 = _u8gdcDTtChQ4tbSQMXc4cYWyum7;
2995
+ const _42rPnotok1ivQ2RNCKNbeFJgx8b8 = [];
2996
+ for (const v of values["https://w3id.org/security#proof"] ?? []) {
2997
+ if (v == null)
2998
+ continue;
2999
+ if (typeof v === "object" && "@id" in v && !("@type" in v) &&
3000
+ globalThis.Object.keys(v).length === 1) {
3001
+ _42rPnotok1ivQ2RNCKNbeFJgx8b8.push(new URL(v["@id"]));
3002
+ continue;
3003
+ }
3004
+ _42rPnotok1ivQ2RNCKNbeFJgx8b8.push(await DataIntegrityProof.fromJsonLd(v, options));
3005
+ }
3006
+ instance.#_42rPnotok1ivQ2RNCKNbeFJgx8b8 = _42rPnotok1ivQ2RNCKNbeFJgx8b8;
2897
3007
  return instance;
2898
3008
  }
2899
3009
  _getCustomInspectProxy() {
@@ -3284,6 +3394,22 @@ export class Object {
3284
3394
  if (_u8gdcDTtChQ4tbSQMXc4cYWyum7.length == 1) {
3285
3395
  proxy.sensitive = _u8gdcDTtChQ4tbSQMXc4cYWyum7[0];
3286
3396
  }
3397
+ const _42rPnotok1ivQ2RNCKNbeFJgx8b8 = this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8
3398
+ // deno-lint-ignore no-explicit-any
3399
+ .map((v) => v instanceof URL
3400
+ ? {
3401
+ [Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(v.href, options),
3402
+ [Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(v.href, options),
3403
+ }
3404
+ : v);
3405
+ if (_42rPnotok1ivQ2RNCKNbeFJgx8b8.length == 1) {
3406
+ proxy.proof = _42rPnotok1ivQ2RNCKNbeFJgx8b8[0];
3407
+ }
3408
+ if (_42rPnotok1ivQ2RNCKNbeFJgx8b8.length > 1 ||
3409
+ !("proof" in proxy) &&
3410
+ _42rPnotok1ivQ2RNCKNbeFJgx8b8.length > 0) {
3411
+ proxy.proofs = _42rPnotok1ivQ2RNCKNbeFJgx8b8;
3412
+ }
3287
3413
  return proxy;
3288
3414
  }
3289
3415
  [Symbol.for("Deno.customInspect")](inspect, options) {
@@ -3631,6 +3757,381 @@ export class PropertyValue {
3631
3757
  return "PropertyValue " + inspect(proxy, options);
3632
3758
  }
3633
3759
  }
3760
+ /** A proof that can be added to any activity or object, allowing recipients to
3761
+ * verify the identity of the actor and the integrity of the data.
3762
+ */
3763
+ export class DataIntegrityProof {
3764
+ #documentLoader;
3765
+ #contextLoader;
3766
+ id;
3767
+ get _documentLoader() {
3768
+ return this.#documentLoader;
3769
+ }
3770
+ get _contextLoader() {
3771
+ return this.#contextLoader;
3772
+ }
3773
+ /**
3774
+ * The type URI of {@link DataIntegrityProof}: `https://w3id.org/security#DataIntegrityProof`.
3775
+ */
3776
+ static get typeId() {
3777
+ return new URL("https://w3id.org/security#DataIntegrityProof");
3778
+ }
3779
+ #_3RurJsa7tnptyqMFR5hDGcP9pMs5 = [];
3780
+ #_2mHVKxqA7zncjveJrDEo3pWpMZqg = [];
3781
+ #_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb = [];
3782
+ #_3CjFK5vfKpX4HQuNh2b18TykoVLq = [];
3783
+ #_5e258TDXtuhaFRPZiGoDfEpjdMr = [];
3784
+ /**
3785
+ * Constructs a new instance of DataIntegrityProof with the given values.
3786
+ * @param values The values to initialize the instance with.
3787
+ * @param options The options to use for initialization.
3788
+ */
3789
+ constructor(values, { documentLoader, contextLoader, } = {}) {
3790
+ this.#documentLoader = documentLoader;
3791
+ this.#contextLoader = contextLoader;
3792
+ this.id = values.id ?? null;
3793
+ if ("cryptosuite" in values && values.cryptosuite != null) {
3794
+ this.#_3RurJsa7tnptyqMFR5hDGcP9pMs5 = [values.cryptosuite];
3795
+ }
3796
+ if ("verificationMethod" in values && values.verificationMethod != null) {
3797
+ this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg = [values.verificationMethod];
3798
+ }
3799
+ if ("proofPurpose" in values && values.proofPurpose != null) {
3800
+ this.#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb = [values.proofPurpose];
3801
+ }
3802
+ if ("proofValue" in values && values.proofValue != null) {
3803
+ this.#_3CjFK5vfKpX4HQuNh2b18TykoVLq = [values.proofValue];
3804
+ }
3805
+ if ("created" in values && values.created != null) {
3806
+ this.#_5e258TDXtuhaFRPZiGoDfEpjdMr = [values.created];
3807
+ }
3808
+ }
3809
+ /**
3810
+ * Clones this instance, optionally updating it with the given values.
3811
+ * @param values The values to update the clone with.
3812
+ * @options The options to use for cloning.
3813
+ * @returns The cloned instance.
3814
+ */
3815
+ clone(values = {}, options = {}) {
3816
+ // @ts-ignore: this.constructor is not recognized as a constructor, but it is.
3817
+ const clone = new this.constructor({ id: values.id }, options);
3818
+ clone.#_3RurJsa7tnptyqMFR5hDGcP9pMs5 = this.#_3RurJsa7tnptyqMFR5hDGcP9pMs5;
3819
+ if ("cryptosuite" in values && values.cryptosuite != null) {
3820
+ clone.#_3RurJsa7tnptyqMFR5hDGcP9pMs5 = [values.cryptosuite];
3821
+ }
3822
+ clone.#_2mHVKxqA7zncjveJrDEo3pWpMZqg = this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg;
3823
+ if ("verificationMethod" in values && values.verificationMethod != null) {
3824
+ clone.#_2mHVKxqA7zncjveJrDEo3pWpMZqg = [values.verificationMethod];
3825
+ }
3826
+ clone.#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb = this.#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb;
3827
+ if ("proofPurpose" in values && values.proofPurpose != null) {
3828
+ clone.#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb = [values.proofPurpose];
3829
+ }
3830
+ clone.#_3CjFK5vfKpX4HQuNh2b18TykoVLq = this.#_3CjFK5vfKpX4HQuNh2b18TykoVLq;
3831
+ if ("proofValue" in values && values.proofValue != null) {
3832
+ clone.#_3CjFK5vfKpX4HQuNh2b18TykoVLq = [values.proofValue];
3833
+ }
3834
+ clone.#_5e258TDXtuhaFRPZiGoDfEpjdMr = this.#_5e258TDXtuhaFRPZiGoDfEpjdMr;
3835
+ if ("created" in values && values.created != null) {
3836
+ clone.#_5e258TDXtuhaFRPZiGoDfEpjdMr = [values.created];
3837
+ }
3838
+ return clone;
3839
+ }
3840
+ /** The cryptographic suite used to create the proof.
3841
+ */
3842
+ get cryptosuite() {
3843
+ if (this.#_3RurJsa7tnptyqMFR5hDGcP9pMs5.length < 1)
3844
+ return null;
3845
+ return this.#_3RurJsa7tnptyqMFR5hDGcP9pMs5[0];
3846
+ }
3847
+ async #fetchVerificationMethod(url, options = {}) {
3848
+ const documentLoader = options.documentLoader ?? this._documentLoader ??
3849
+ fetchDocumentLoader;
3850
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
3851
+ fetchDocumentLoader;
3852
+ const { document } = await documentLoader(url.href);
3853
+ try {
3854
+ return await Multikey.fromJsonLd(document, { documentLoader, contextLoader });
3855
+ }
3856
+ catch (e) {
3857
+ if (!(e instanceof TypeError))
3858
+ throw e;
3859
+ }
3860
+ throw new TypeError("Expected an object of any type of: " +
3861
+ ["https://w3id.org/security#Multikey"].join(", "));
3862
+ }
3863
+ /**
3864
+ * Similar to
3865
+ * {@link DataIntegrityProof.getVerificationMethod},
3866
+ * but returns its `@id` URL instead of the object itself.
3867
+ */
3868
+ get verificationMethodId() {
3869
+ if (this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg.length < 1)
3870
+ return null;
3871
+ const v = this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg[0];
3872
+ if (v instanceof URL)
3873
+ return v;
3874
+ return v.id;
3875
+ }
3876
+ /** A key owned by an actor according to [FEP-521a: Representing actor's public
3877
+ * keys][1].
3878
+ *
3879
+ * [1]: https://codeberg.org/fediverse/fep/src/branch/main/fep/521a/fep-521a.md
3880
+ */
3881
+ async getVerificationMethod(options = {}) {
3882
+ if (this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg.length < 1)
3883
+ return null;
3884
+ const v = this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg[0];
3885
+ if (v instanceof URL) {
3886
+ const fetched = await this.#fetchVerificationMethod(v, options);
3887
+ this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg[0] = fetched;
3888
+ return fetched;
3889
+ }
3890
+ return v;
3891
+ }
3892
+ /** The reason the proof was created.
3893
+ *
3894
+ * - `"assertionMethod"`
3895
+ * - `"authentication"`
3896
+ * - `"capabilityInvocation"`
3897
+ * - `"capabilityDelegation"`
3898
+ * - `"keyAgreement"`
3899
+ */
3900
+ get proofPurpose() {
3901
+ if (this.#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb.length < 1)
3902
+ return null;
3903
+ return this.#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb[0];
3904
+ }
3905
+ /** The proof value.
3906
+ */
3907
+ get proofValue() {
3908
+ if (this.#_3CjFK5vfKpX4HQuNh2b18TykoVLq.length < 1)
3909
+ return null;
3910
+ return this.#_3CjFK5vfKpX4HQuNh2b18TykoVLq[0];
3911
+ }
3912
+ /** The date and time the proof was created.
3913
+ */
3914
+ get created() {
3915
+ if (this.#_5e258TDXtuhaFRPZiGoDfEpjdMr.length < 1)
3916
+ return null;
3917
+ return this.#_5e258TDXtuhaFRPZiGoDfEpjdMr[0];
3918
+ }
3919
+ /**
3920
+ * Converts this object to a JSON-LD structure.
3921
+ * @returns The JSON-LD representation of this object.
3922
+ */
3923
+ async toJsonLd(options = {}) {
3924
+ options = {
3925
+ ...options,
3926
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
3927
+ };
3928
+ // deno-lint-ignore no-unused-vars prefer-const
3929
+ let array;
3930
+ const values = {};
3931
+ array = [];
3932
+ for (const v of this.#_3RurJsa7tnptyqMFR5hDGcP9pMs5) {
3933
+ array.push({ "@value": v });
3934
+ }
3935
+ if (array.length > 0) {
3936
+ values["https://w3id.org/security#cryptosuite"] = array;
3937
+ }
3938
+ array = [];
3939
+ for (const v of this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg) {
3940
+ array.push(v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options));
3941
+ }
3942
+ if (array.length > 0) {
3943
+ values["https://w3id.org/security#verificationMethod"] = array;
3944
+ }
3945
+ array = [];
3946
+ for (const v of this.#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb) {
3947
+ array.push({
3948
+ "@id": "https://w3id.org/security#" + v,
3949
+ });
3950
+ }
3951
+ if (array.length > 0) {
3952
+ values["https://w3id.org/security#proofPurpose"] = array;
3953
+ }
3954
+ array = [];
3955
+ for (const v of this.#_3CjFK5vfKpX4HQuNh2b18TykoVLq) {
3956
+ array.push({
3957
+ "@type": "https://w3id.org/security#multibase",
3958
+ "@value": new TextDecoder().decode(encodeMultibase("base58btc", v)),
3959
+ });
3960
+ }
3961
+ if (array.length > 0) {
3962
+ values["https://w3id.org/security#proofValue"] = array;
3963
+ }
3964
+ array = [];
3965
+ for (const v of this.#_5e258TDXtuhaFRPZiGoDfEpjdMr) {
3966
+ array.push({
3967
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime",
3968
+ "@value": v.toString(),
3969
+ });
3970
+ }
3971
+ if (array.length > 0) {
3972
+ values["https://www.w3.org/ns/activitystreams#published"] = array;
3973
+ }
3974
+ values["@type"] = ["https://w3id.org/security#DataIntegrityProof"];
3975
+ if (this.id)
3976
+ values["@id"] = this.id.href;
3977
+ if (options.expand) {
3978
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
3979
+ }
3980
+ return await jsonld.compact(values, "https://w3id.org/security/data-integrity/v1", { documentLoader: options.contextLoader });
3981
+ }
3982
+ /**
3983
+ * Converts a JSON-LD structure to an object of this type.
3984
+ * @param json The JSON-LD structure to convert.
3985
+ * @returns The object of this type.
3986
+ * @throws {TypeError} If the given `json` is invalid.
3987
+ */
3988
+ static async fromJsonLd(json, options = {}) {
3989
+ if (typeof json === "undefined") {
3990
+ throw new TypeError("Invalid JSON-LD: undefined.");
3991
+ }
3992
+ else if (json === null)
3993
+ throw new TypeError("Invalid JSON-LD: null.");
3994
+ options = {
3995
+ ...options,
3996
+ documentLoader: options.documentLoader ?? fetchDocumentLoader,
3997
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
3998
+ };
3999
+ // deno-lint-ignore no-explicit-any
4000
+ let values;
4001
+ if (globalThis.Object.keys(json).length == 0) {
4002
+ values = {};
4003
+ }
4004
+ else {
4005
+ const expanded = await jsonld.expand(json, {
4006
+ documentLoader: options.contextLoader,
4007
+ keepFreeFloatingNodes: true,
4008
+ });
4009
+ values =
4010
+ // deno-lint-ignore no-explicit-any
4011
+ (expanded[0] ?? {});
4012
+ }
4013
+ if ("@type" in values) {
4014
+ if (!values["@type"].includes("https://w3id.org/security#DataIntegrityProof")) {
4015
+ throw new TypeError("Invalid type: " + values["@type"]);
4016
+ }
4017
+ }
4018
+ const instance = new this({ id: "@id" in values ? new URL(values["@id"]) : undefined }, options);
4019
+ const _3RurJsa7tnptyqMFR5hDGcP9pMs5 = [];
4020
+ for (const v of values["https://w3id.org/security#cryptosuite"] ?? []) {
4021
+ if (v == null)
4022
+ continue;
4023
+ _3RurJsa7tnptyqMFR5hDGcP9pMs5.push(v["@value"]);
4024
+ }
4025
+ instance.#_3RurJsa7tnptyqMFR5hDGcP9pMs5 = _3RurJsa7tnptyqMFR5hDGcP9pMs5;
4026
+ const _2mHVKxqA7zncjveJrDEo3pWpMZqg = [];
4027
+ for (const v of values["https://w3id.org/security#verificationMethod"] ?? []) {
4028
+ if (v == null)
4029
+ continue;
4030
+ if (typeof v === "object" && "@id" in v && !("@type" in v) &&
4031
+ globalThis.Object.keys(v).length === 1) {
4032
+ _2mHVKxqA7zncjveJrDEo3pWpMZqg.push(new URL(v["@id"]));
4033
+ continue;
4034
+ }
4035
+ _2mHVKxqA7zncjveJrDEo3pWpMZqg.push(await Multikey.fromJsonLd(v, options));
4036
+ }
4037
+ instance.#_2mHVKxqA7zncjveJrDEo3pWpMZqg = _2mHVKxqA7zncjveJrDEo3pWpMZqg;
4038
+ const _2AeEnPcAvVrPEuKbpmn9ZKNmWHKb = [];
4039
+ for (const v of values["https://w3id.org/security#proofPurpose"] ?? []) {
4040
+ if (v == null)
4041
+ continue;
4042
+ _2AeEnPcAvVrPEuKbpmn9ZKNmWHKb.push(v["@id"].substring(26));
4043
+ }
4044
+ instance.#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb = _2AeEnPcAvVrPEuKbpmn9ZKNmWHKb;
4045
+ const _3CjFK5vfKpX4HQuNh2b18TykoVLq = [];
4046
+ for (const v of values["https://w3id.org/security#proofValue"] ?? []) {
4047
+ if (v == null)
4048
+ continue;
4049
+ _3CjFK5vfKpX4HQuNh2b18TykoVLq.push(decodeMultibase(v["@value"]));
4050
+ }
4051
+ instance.#_3CjFK5vfKpX4HQuNh2b18TykoVLq = _3CjFK5vfKpX4HQuNh2b18TykoVLq;
4052
+ const _5e258TDXtuhaFRPZiGoDfEpjdMr = [];
4053
+ for (const v of values["https://www.w3.org/ns/activitystreams#published"] ?? []) {
4054
+ if (v == null)
4055
+ continue;
4056
+ _5e258TDXtuhaFRPZiGoDfEpjdMr.push(dntShim.Temporal.Instant.from(v["@value"]));
4057
+ }
4058
+ instance.#_5e258TDXtuhaFRPZiGoDfEpjdMr = _5e258TDXtuhaFRPZiGoDfEpjdMr;
4059
+ return instance;
4060
+ }
4061
+ _getCustomInspectProxy() {
4062
+ const proxy = {};
4063
+ if (this.id != null) {
4064
+ proxy.id = {
4065
+ [Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(this.id.href, options),
4066
+ [Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(this.id.href, options),
4067
+ };
4068
+ }
4069
+ const _3RurJsa7tnptyqMFR5hDGcP9pMs5 = this.#_3RurJsa7tnptyqMFR5hDGcP9pMs5
4070
+ // deno-lint-ignore no-explicit-any
4071
+ .map((v) => v instanceof URL
4072
+ ? {
4073
+ [Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(v.href, options),
4074
+ [Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(v.href, options),
4075
+ }
4076
+ : v);
4077
+ if (_3RurJsa7tnptyqMFR5hDGcP9pMs5.length == 1) {
4078
+ proxy.cryptosuite = _3RurJsa7tnptyqMFR5hDGcP9pMs5[0];
4079
+ }
4080
+ const _2mHVKxqA7zncjveJrDEo3pWpMZqg = this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg
4081
+ // deno-lint-ignore no-explicit-any
4082
+ .map((v) => v instanceof URL
4083
+ ? {
4084
+ [Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(v.href, options),
4085
+ [Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(v.href, options),
4086
+ }
4087
+ : v);
4088
+ if (_2mHVKxqA7zncjveJrDEo3pWpMZqg.length == 1) {
4089
+ proxy.verificationMethod = _2mHVKxqA7zncjveJrDEo3pWpMZqg[0];
4090
+ }
4091
+ const _2AeEnPcAvVrPEuKbpmn9ZKNmWHKb = this.#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb
4092
+ // deno-lint-ignore no-explicit-any
4093
+ .map((v) => v instanceof URL
4094
+ ? {
4095
+ [Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(v.href, options),
4096
+ [Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(v.href, options),
4097
+ }
4098
+ : v);
4099
+ if (_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb.length == 1) {
4100
+ proxy.proofPurpose = _2AeEnPcAvVrPEuKbpmn9ZKNmWHKb[0];
4101
+ }
4102
+ const _3CjFK5vfKpX4HQuNh2b18TykoVLq = this.#_3CjFK5vfKpX4HQuNh2b18TykoVLq
4103
+ // deno-lint-ignore no-explicit-any
4104
+ .map((v) => v instanceof URL
4105
+ ? {
4106
+ [Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(v.href, options),
4107
+ [Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(v.href, options),
4108
+ }
4109
+ : v);
4110
+ if (_3CjFK5vfKpX4HQuNh2b18TykoVLq.length == 1) {
4111
+ proxy.proofValue = _3CjFK5vfKpX4HQuNh2b18TykoVLq[0];
4112
+ }
4113
+ const _5e258TDXtuhaFRPZiGoDfEpjdMr = this.#_5e258TDXtuhaFRPZiGoDfEpjdMr
4114
+ // deno-lint-ignore no-explicit-any
4115
+ .map((v) => v instanceof URL
4116
+ ? {
4117
+ [Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(v.href, options),
4118
+ [Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(v.href, options),
4119
+ }
4120
+ : v);
4121
+ if (_5e258TDXtuhaFRPZiGoDfEpjdMr.length == 1) {
4122
+ proxy.created = _5e258TDXtuhaFRPZiGoDfEpjdMr[0];
4123
+ }
4124
+ return proxy;
4125
+ }
4126
+ [Symbol.for("Deno.customInspect")](inspect, options) {
4127
+ const proxy = this._getCustomInspectProxy();
4128
+ return "DataIntegrityProof " + inspect(proxy, options);
4129
+ }
4130
+ [Symbol.for("nodejs.util.inspect.custom")](_depth, options, inspect) {
4131
+ const proxy = this._getCustomInspectProxy();
4132
+ return "DataIntegrityProof " + inspect(proxy, options);
4133
+ }
4134
+ }
3634
4135
  /** A key owned by an actor.
3635
4136
  */
3636
4137
  export class CryptographicKey {
@@ -4544,7 +5045,11 @@ export class Activity extends Object {
4544
5045
  if (options.expand) {
4545
5046
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
4546
5047
  }
4547
- return await jsonld.compact(values, ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/v1"], { documentLoader: options.contextLoader });
5048
+ return await jsonld.compact(values, [
5049
+ "https://www.w3.org/ns/activitystreams",
5050
+ "https://w3id.org/security/v1",
5051
+ "https://w3id.org/security/data-integrity/v1",
5052
+ ], { documentLoader: options.contextLoader });
4548
5053
  }
4549
5054
  /**
4550
5055
  * Converts a JSON-LD structure to an object of this type.
@@ -4795,7 +5300,10 @@ export class Accept extends Activity {
4795
5300
  if (options.expand) {
4796
5301
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
4797
5302
  }
4798
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
5303
+ return await jsonld.compact(values, [
5304
+ "https://www.w3.org/ns/activitystreams",
5305
+ "https://w3id.org/security/data-integrity/v1",
5306
+ ], { documentLoader: options.contextLoader });
4799
5307
  }
4800
5308
  /**
4801
5309
  * Converts a JSON-LD structure to an object of this type.
@@ -4904,7 +5412,10 @@ export class Add extends Activity {
4904
5412
  if (options.expand) {
4905
5413
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
4906
5414
  }
4907
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
5415
+ return await jsonld.compact(values, [
5416
+ "https://www.w3.org/ns/activitystreams",
5417
+ "https://w3id.org/security/data-integrity/v1",
5418
+ ], { documentLoader: options.contextLoader });
4908
5419
  }
4909
5420
  /**
4910
5421
  * Converts a JSON-LD structure to an object of this type.
@@ -5012,12 +5523,16 @@ export class Announce extends Activity {
5012
5523
  if (options.expand) {
5013
5524
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
5014
5525
  }
5015
- return await jsonld.compact(values, ["https://www.w3.org/ns/activitystreams", {
5526
+ return await jsonld.compact(values, [
5527
+ "https://www.w3.org/ns/activitystreams",
5528
+ "https://w3id.org/security/data-integrity/v1",
5529
+ {
5016
5530
  "toot": "http://joinmastodon.org/ns#",
5017
5531
  "sensitive": "as:sensitive",
5018
5532
  "Emoji": "toot:Emoji",
5019
5533
  "Hashtag": "as:Hashtag",
5020
- }], { documentLoader: options.contextLoader });
5534
+ },
5535
+ ], { documentLoader: options.contextLoader });
5021
5536
  }
5022
5537
  /**
5023
5538
  * Converts a JSON-LD structure to an object of this type.
@@ -5891,6 +6406,7 @@ export class Application extends Object {
5891
6406
  return await jsonld.compact(values, [
5892
6407
  "https://www.w3.org/ns/activitystreams",
5893
6408
  "https://w3id.org/security/v1",
6409
+ "https://w3id.org/security/data-integrity/v1",
5894
6410
  "https://www.w3.org/ns/did/v1",
5895
6411
  "https://w3id.org/security/multikey/v1",
5896
6412
  {
@@ -6348,12 +6864,16 @@ export class Article extends Object {
6348
6864
  if (options.expand) {
6349
6865
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
6350
6866
  }
6351
- return await jsonld.compact(values, ["https://www.w3.org/ns/activitystreams", {
6867
+ return await jsonld.compact(values, [
6868
+ "https://www.w3.org/ns/activitystreams",
6869
+ "https://w3id.org/security/data-integrity/v1",
6870
+ {
6352
6871
  "toot": "http://joinmastodon.org/ns#",
6353
6872
  "sensitive": "as:sensitive",
6354
6873
  "Emoji": "toot:Emoji",
6355
6874
  "Hashtag": "as:Hashtag",
6356
- }], { documentLoader: options.contextLoader });
6875
+ },
6876
+ ], { documentLoader: options.contextLoader });
6357
6877
  }
6358
6878
  /**
6359
6879
  * Converts a JSON-LD structure to an object of this type.
@@ -6511,7 +7031,10 @@ export class Document extends Object {
6511
7031
  if (options.expand) {
6512
7032
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
6513
7033
  }
6514
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
7034
+ return await jsonld.compact(values, [
7035
+ "https://www.w3.org/ns/activitystreams",
7036
+ "https://w3id.org/security/data-integrity/v1",
7037
+ ], { documentLoader: options.contextLoader });
6515
7038
  }
6516
7039
  /**
6517
7040
  * Converts a JSON-LD structure to an object of this type.
@@ -6669,7 +7192,10 @@ export class Audio extends Document {
6669
7192
  if (options.expand) {
6670
7193
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
6671
7194
  }
6672
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
7195
+ return await jsonld.compact(values, [
7196
+ "https://www.w3.org/ns/activitystreams",
7197
+ "https://w3id.org/security/data-integrity/v1",
7198
+ ], { documentLoader: options.contextLoader });
6673
7199
  }
6674
7200
  /**
6675
7201
  * Converts a JSON-LD structure to an object of this type.
@@ -6776,7 +7302,10 @@ export class Ignore extends Activity {
6776
7302
  if (options.expand) {
6777
7303
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
6778
7304
  }
6779
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
7305
+ return await jsonld.compact(values, [
7306
+ "https://www.w3.org/ns/activitystreams",
7307
+ "https://w3id.org/security/data-integrity/v1",
7308
+ ], { documentLoader: options.contextLoader });
6780
7309
  }
6781
7310
  /**
6782
7311
  * Converts a JSON-LD structure to an object of this type.
@@ -6889,7 +7418,10 @@ export class Block extends Ignore {
6889
7418
  if (options.expand) {
6890
7419
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
6891
7420
  }
6892
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
7421
+ return await jsonld.compact(values, [
7422
+ "https://www.w3.org/ns/activitystreams",
7423
+ "https://w3id.org/security/data-integrity/v1",
7424
+ ], { documentLoader: options.contextLoader });
6893
7425
  }
6894
7426
  /**
6895
7427
  * Converts a JSON-LD structure to an object of this type.
@@ -8104,12 +8636,16 @@ export class Create extends Activity {
8104
8636
  if (options.expand) {
8105
8637
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
8106
8638
  }
8107
- return await jsonld.compact(values, ["https://www.w3.org/ns/activitystreams", {
8639
+ return await jsonld.compact(values, [
8640
+ "https://www.w3.org/ns/activitystreams",
8641
+ "https://w3id.org/security/data-integrity/v1",
8642
+ {
8108
8643
  "toot": "http://joinmastodon.org/ns#",
8109
8644
  "sensitive": "as:sensitive",
8110
8645
  "Emoji": "toot:Emoji",
8111
8646
  "Hashtag": "as:Hashtag",
8112
- }], { documentLoader: options.contextLoader });
8647
+ },
8648
+ ], { documentLoader: options.contextLoader });
8113
8649
  }
8114
8650
  /**
8115
8651
  * Converts a JSON-LD structure to an object of this type.
@@ -8216,7 +8752,10 @@ export class Delete extends Activity {
8216
8752
  if (options.expand) {
8217
8753
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
8218
8754
  }
8219
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
8755
+ return await jsonld.compact(values, [
8756
+ "https://www.w3.org/ns/activitystreams",
8757
+ "https://w3id.org/security/data-integrity/v1",
8758
+ ], { documentLoader: options.contextLoader });
8220
8759
  }
8221
8760
  /**
8222
8761
  * Converts a JSON-LD structure to an object of this type.
@@ -8322,7 +8861,10 @@ export class Dislike extends Activity {
8322
8861
  if (options.expand) {
8323
8862
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
8324
8863
  }
8325
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
8864
+ return await jsonld.compact(values, [
8865
+ "https://www.w3.org/ns/activitystreams",
8866
+ "https://w3id.org/security/data-integrity/v1",
8867
+ ], { documentLoader: options.contextLoader });
8326
8868
  }
8327
8869
  /**
8328
8870
  * Converts a JSON-LD structure to an object of this type.
@@ -8816,7 +9358,10 @@ export class Event extends Object {
8816
9358
  if (options.expand) {
8817
9359
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
8818
9360
  }
8819
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
9361
+ return await jsonld.compact(values, [
9362
+ "https://www.w3.org/ns/activitystreams",
9363
+ "https://w3id.org/security/data-integrity/v1",
9364
+ ], { documentLoader: options.contextLoader });
8820
9365
  }
8821
9366
  /**
8822
9367
  * Converts a JSON-LD structure to an object of this type.
@@ -8924,7 +9469,10 @@ export class Flag extends Activity {
8924
9469
  if (options.expand) {
8925
9470
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
8926
9471
  }
8927
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
9472
+ return await jsonld.compact(values, [
9473
+ "https://www.w3.org/ns/activitystreams",
9474
+ "https://w3id.org/security/data-integrity/v1",
9475
+ ], { documentLoader: options.contextLoader });
8928
9476
  }
8929
9477
  /**
8930
9478
  * Converts a JSON-LD structure to an object of this type.
@@ -9033,7 +9581,10 @@ export class Follow extends Activity {
9033
9581
  if (options.expand) {
9034
9582
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
9035
9583
  }
9036
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
9584
+ return await jsonld.compact(values, [
9585
+ "https://www.w3.org/ns/activitystreams",
9586
+ "https://w3id.org/security/data-integrity/v1",
9587
+ ], { documentLoader: options.contextLoader });
9037
9588
  }
9038
9589
  /**
9039
9590
  * Converts a JSON-LD structure to an object of this type.
@@ -9907,6 +10458,7 @@ export class Group extends Object {
9907
10458
  return await jsonld.compact(values, [
9908
10459
  "https://www.w3.org/ns/activitystreams",
9909
10460
  "https://w3id.org/security/v1",
10461
+ "https://w3id.org/security/data-integrity/v1",
9910
10462
  "https://www.w3.org/ns/did/v1",
9911
10463
  "https://w3id.org/security/multikey/v1",
9912
10464
  {
@@ -11233,7 +11785,10 @@ export class IntransitiveActivity extends Activity {
11233
11785
  if (options.expand) {
11234
11786
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
11235
11787
  }
11236
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
11788
+ return await jsonld.compact(values, [
11789
+ "https://www.w3.org/ns/activitystreams",
11790
+ "https://w3id.org/security/data-integrity/v1",
11791
+ ], { documentLoader: options.contextLoader });
11237
11792
  }
11238
11793
  /**
11239
11794
  * Converts a JSON-LD structure to an object of this type.
@@ -11340,7 +11895,10 @@ export class Like extends Activity {
11340
11895
  if (options.expand) {
11341
11896
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
11342
11897
  }
11343
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
11898
+ return await jsonld.compact(values, [
11899
+ "https://www.w3.org/ns/activitystreams",
11900
+ "https://w3id.org/security/data-integrity/v1",
11901
+ ], { documentLoader: options.contextLoader });
11344
11902
  }
11345
11903
  /**
11346
11904
  * Converts a JSON-LD structure to an object of this type.
@@ -11553,12 +12111,16 @@ export class Note extends Object {
11553
12111
  if (options.expand) {
11554
12112
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
11555
12113
  }
11556
- return await jsonld.compact(values, ["https://www.w3.org/ns/activitystreams", {
12114
+ return await jsonld.compact(values, [
12115
+ "https://www.w3.org/ns/activitystreams",
12116
+ "https://w3id.org/security/data-integrity/v1",
12117
+ {
11557
12118
  "toot": "http://joinmastodon.org/ns#",
11558
12119
  "sensitive": "as:sensitive",
11559
12120
  "Emoji": "toot:Emoji",
11560
12121
  "Hashtag": "as:Hashtag",
11561
- }], { documentLoader: options.contextLoader });
12122
+ },
12123
+ ], { documentLoader: options.contextLoader });
11562
12124
  }
11563
12125
  /**
11564
12126
  * Converts a JSON-LD structure to an object of this type.
@@ -12696,6 +13258,7 @@ export class Organization extends Object {
12696
13258
  return await jsonld.compact(values, [
12697
13259
  "https://www.w3.org/ns/activitystreams",
12698
13260
  "https://w3id.org/security/v1",
13261
+ "https://w3id.org/security/data-integrity/v1",
12699
13262
  "https://www.w3.org/ns/did/v1",
12700
13263
  "https://w3id.org/security/multikey/v1",
12701
13264
  {
@@ -13153,7 +13716,10 @@ export class Page extends Document {
13153
13716
  if (options.expand) {
13154
13717
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
13155
13718
  }
13156
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
13719
+ return await jsonld.compact(values, [
13720
+ "https://www.w3.org/ns/activitystreams",
13721
+ "https://w3id.org/security/data-integrity/v1",
13722
+ ], { documentLoader: options.contextLoader });
13157
13723
  }
13158
13724
  /**
13159
13725
  * Converts a JSON-LD structure to an object of this type.
@@ -14027,6 +14593,7 @@ export class Person extends Object {
14027
14593
  return await jsonld.compact(values, [
14028
14594
  "https://www.w3.org/ns/activitystreams",
14029
14595
  "https://w3id.org/security/v1",
14596
+ "https://w3id.org/security/data-integrity/v1",
14030
14597
  "https://www.w3.org/ns/did/v1",
14031
14598
  "https://w3id.org/security/multikey/v1",
14032
14599
  {
@@ -14644,7 +15211,10 @@ export class Place extends Object {
14644
15211
  if (options.expand) {
14645
15212
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
14646
15213
  }
14647
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
15214
+ return await jsonld.compact(values, [
15215
+ "https://www.w3.org/ns/activitystreams",
15216
+ "https://w3id.org/security/data-integrity/v1",
15217
+ ], { documentLoader: options.contextLoader });
14648
15218
  }
14649
15219
  /**
14650
15220
  * Converts a JSON-LD structure to an object of this type.
@@ -14931,7 +15501,10 @@ export class Profile extends Object {
14931
15501
  if (options.expand) {
14932
15502
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
14933
15503
  }
14934
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
15504
+ return await jsonld.compact(values, [
15505
+ "https://www.w3.org/ns/activitystreams",
15506
+ "https://w3id.org/security/data-integrity/v1",
15507
+ ], { documentLoader: options.contextLoader });
14935
15508
  }
14936
15509
  /**
14937
15510
  * Converts a JSON-LD structure to an object of this type.
@@ -15061,7 +15634,10 @@ export class Reject extends Activity {
15061
15634
  if (options.expand) {
15062
15635
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
15063
15636
  }
15064
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
15637
+ return await jsonld.compact(values, [
15638
+ "https://www.w3.org/ns/activitystreams",
15639
+ "https://w3id.org/security/data-integrity/v1",
15640
+ ], { documentLoader: options.contextLoader });
15065
15641
  }
15066
15642
  /**
15067
15643
  * Converts a JSON-LD structure to an object of this type.
@@ -15429,7 +16005,10 @@ export class Relationship extends Object {
15429
16005
  if (options.expand) {
15430
16006
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
15431
16007
  }
15432
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
16008
+ return await jsonld.compact(values, [
16009
+ "https://www.w3.org/ns/activitystreams",
16010
+ "https://w3id.org/security/data-integrity/v1",
16011
+ ], { documentLoader: options.contextLoader });
15433
16012
  }
15434
16013
  /**
15435
16014
  * Converts a JSON-LD structure to an object of this type.
@@ -15616,7 +16195,10 @@ export class Remove extends Activity {
15616
16195
  if (options.expand) {
15617
16196
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
15618
16197
  }
15619
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
16198
+ return await jsonld.compact(values, [
16199
+ "https://www.w3.org/ns/activitystreams",
16200
+ "https://w3id.org/security/data-integrity/v1",
16201
+ ], { documentLoader: options.contextLoader });
15620
16202
  }
15621
16203
  /**
15622
16204
  * Converts a JSON-LD structure to an object of this type.
@@ -16490,6 +17072,7 @@ export class Service extends Object {
16490
17072
  return await jsonld.compact(values, [
16491
17073
  "https://www.w3.org/ns/activitystreams",
16492
17074
  "https://w3id.org/security/v1",
17075
+ "https://w3id.org/security/data-integrity/v1",
16493
17076
  "https://www.w3.org/ns/did/v1",
16494
17077
  "https://w3id.org/security/multikey/v1",
16495
17078
  {
@@ -16975,7 +17558,10 @@ export class Tombstone extends Object {
16975
17558
  if (options.expand) {
16976
17559
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
16977
17560
  }
16978
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
17561
+ return await jsonld.compact(values, [
17562
+ "https://www.w3.org/ns/activitystreams",
17563
+ "https://w3id.org/security/data-integrity/v1",
17564
+ ], { documentLoader: options.contextLoader });
16979
17565
  }
16980
17566
  /**
16981
17567
  * Converts a JSON-LD structure to an object of this type.
@@ -17105,7 +17691,10 @@ export class Undo extends Activity {
17105
17691
  if (options.expand) {
17106
17692
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
17107
17693
  }
17108
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
17694
+ return await jsonld.compact(values, [
17695
+ "https://www.w3.org/ns/activitystreams",
17696
+ "https://w3id.org/security/data-integrity/v1",
17697
+ ], { documentLoader: options.contextLoader });
17109
17698
  }
17110
17699
  /**
17111
17700
  * Converts a JSON-LD structure to an object of this type.
@@ -17215,12 +17804,16 @@ export class Update extends Activity {
17215
17804
  if (options.expand) {
17216
17805
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
17217
17806
  }
17218
- return await jsonld.compact(values, ["https://www.w3.org/ns/activitystreams", {
17807
+ return await jsonld.compact(values, [
17808
+ "https://www.w3.org/ns/activitystreams",
17809
+ "https://w3id.org/security/data-integrity/v1",
17810
+ {
17219
17811
  "toot": "http://joinmastodon.org/ns#",
17220
17812
  "sensitive": "as:sensitive",
17221
17813
  "Emoji": "toot:Emoji",
17222
17814
  "Hashtag": "as:Hashtag",
17223
- }], { documentLoader: options.contextLoader });
17815
+ },
17816
+ ], { documentLoader: options.contextLoader });
17224
17817
  }
17225
17818
  /**
17226
17819
  * Converts a JSON-LD structure to an object of this type.
@@ -17326,7 +17919,10 @@ export class Video extends Document {
17326
17919
  if (options.expand) {
17327
17920
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
17328
17921
  }
17329
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
17922
+ return await jsonld.compact(values, [
17923
+ "https://www.w3.org/ns/activitystreams",
17924
+ "https://w3id.org/security/data-integrity/v1",
17925
+ ], { documentLoader: options.contextLoader });
17330
17926
  }
17331
17927
  /**
17332
17928
  * Converts a JSON-LD structure to an object of this type.