@fedify/fedify 0.10.0-dev.197 → 0.10.0-dev.199

Sign up to get free protection for your applications and to get access to all the features.
@@ -57,6 +57,7 @@ export class Object {
57
57
  #_3BLrzmscsjHCw8TF5BHRW9WkPnX8 = [];
58
58
  #_3bNvLMBN1bCJETiTihM3wvi1B2JX = [];
59
59
  #_u8gdcDTtChQ4tbSQMXc4cYWyum7 = [];
60
+ #_42rPnotok1ivQ2RNCKNbeFJgx8b8 = [];
60
61
  /**
61
62
  * Constructs a new instance of Object with the given values.
62
63
  * @param values The values to initialize the instance with.
@@ -267,6 +268,17 @@ export class Object {
267
268
  if ("sensitive" in values && values.sensitive != null) {
268
269
  this.#_u8gdcDTtChQ4tbSQMXc4cYWyum7 = [values.sensitive];
269
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
+ }
270
282
  }
271
283
  /**
272
284
  * Clones this instance, optionally updating it with the given values.
@@ -505,6 +517,18 @@ export class Object {
505
517
  if ("sensitive" in values && values.sensitive != null) {
506
518
  clone.#_u8gdcDTtChQ4tbSQMXc4cYWyum7 = [values.sensitive];
507
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
+ }
508
532
  return clone;
509
533
  }
510
534
  async #fetchAttachment(url, options = {}) {
@@ -1693,6 +1717,71 @@ export class Object {
1693
1717
  return null;
1694
1718
  return this.#_u8gdcDTtChQ4tbSQMXc4cYWyum7[0];
1695
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
+ }
1696
1785
  /**
1697
1786
  * Converts this object to a JSON-LD structure.
1698
1787
  * @returns The JSON-LD representation of this object.
@@ -1958,15 +2047,24 @@ export class Object {
1958
2047
  if (array.length > 0) {
1959
2048
  values["https://www.w3.org/ns/activitystreams#sensitive"] = array;
1960
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;
1961
2056
  values["@type"] = ["https://www.w3.org/ns/activitystreams#Object"];
1962
2057
  if (this.id)
1963
2058
  values["@id"] = this.id.href;
1964
2059
  if (options.expand) {
1965
2060
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
1966
2061
  }
1967
- return await jsonld.compact(values, ["https://www.w3.org/ns/activitystreams", {
1968
- "sensitive": "as:sensitive",
1969
- }], { documentLoader: options.contextLoader });
2062
+ return await jsonld.compact(values, options.context ??
2063
+ [
2064
+ "https://www.w3.org/ns/activitystreams",
2065
+ "https://w3id.org/security/data-integrity/v1",
2066
+ { "sensitive": "as:sensitive" },
2067
+ ], { documentLoader: options.contextLoader });
1970
2068
  }
1971
2069
  /**
1972
2070
  * Converts a JSON-LD structure to an object of this type.
@@ -2895,6 +2993,18 @@ export class Object {
2895
2993
  _u8gdcDTtChQ4tbSQMXc4cYWyum7.push(v["@value"]);
2896
2994
  }
2897
2995
  instance.#_u8gdcDTtChQ4tbSQMXc4cYWyum7 = _u8gdcDTtChQ4tbSQMXc4cYWyum7;
2996
+ const _42rPnotok1ivQ2RNCKNbeFJgx8b8 = [];
2997
+ for (const v of values["https://w3id.org/security#proof"] ?? []) {
2998
+ if (v == null)
2999
+ continue;
3000
+ if (typeof v === "object" && "@id" in v && !("@type" in v) &&
3001
+ globalThis.Object.keys(v).length === 1) {
3002
+ _42rPnotok1ivQ2RNCKNbeFJgx8b8.push(new URL(v["@id"]));
3003
+ continue;
3004
+ }
3005
+ _42rPnotok1ivQ2RNCKNbeFJgx8b8.push(await DataIntegrityProof.fromJsonLd(v, options));
3006
+ }
3007
+ instance.#_42rPnotok1ivQ2RNCKNbeFJgx8b8 = _42rPnotok1ivQ2RNCKNbeFJgx8b8;
2898
3008
  return instance;
2899
3009
  }
2900
3010
  _getCustomInspectProxy() {
@@ -3285,6 +3395,22 @@ export class Object {
3285
3395
  if (_u8gdcDTtChQ4tbSQMXc4cYWyum7.length == 1) {
3286
3396
  proxy.sensitive = _u8gdcDTtChQ4tbSQMXc4cYWyum7[0];
3287
3397
  }
3398
+ const _42rPnotok1ivQ2RNCKNbeFJgx8b8 = this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8
3399
+ // deno-lint-ignore no-explicit-any
3400
+ .map((v) => v instanceof URL
3401
+ ? {
3402
+ [Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(v.href, options),
3403
+ [Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(v.href, options),
3404
+ }
3405
+ : v);
3406
+ if (_42rPnotok1ivQ2RNCKNbeFJgx8b8.length == 1) {
3407
+ proxy.proof = _42rPnotok1ivQ2RNCKNbeFJgx8b8[0];
3408
+ }
3409
+ if (_42rPnotok1ivQ2RNCKNbeFJgx8b8.length > 1 ||
3410
+ !("proof" in proxy) &&
3411
+ _42rPnotok1ivQ2RNCKNbeFJgx8b8.length > 0) {
3412
+ proxy.proofs = _42rPnotok1ivQ2RNCKNbeFJgx8b8;
3413
+ }
3288
3414
  return proxy;
3289
3415
  }
3290
3416
  [Symbol.for("Deno.customInspect")](inspect, options) {
@@ -3346,10 +3472,11 @@ export class Emoji extends Object {
3346
3472
  if (options.expand) {
3347
3473
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
3348
3474
  }
3349
- return await jsonld.compact(values, ["https://www.w3.org/ns/activitystreams", {
3350
- "toot": "http://joinmastodon.org/ns#",
3351
- "Emoji": "toot:Emoji",
3352
- }], { documentLoader: options.contextLoader });
3475
+ return await jsonld.compact(values, options.context ??
3476
+ ["https://www.w3.org/ns/activitystreams", {
3477
+ "toot": "http://joinmastodon.org/ns#",
3478
+ "Emoji": "toot:Emoji",
3479
+ }], { documentLoader: options.contextLoader });
3353
3480
  }
3354
3481
  /**
3355
3482
  * Converts a JSON-LD structure to an object of this type.
@@ -3512,11 +3639,12 @@ export class PropertyValue {
3512
3639
  if (options.expand) {
3513
3640
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
3514
3641
  }
3515
- return await jsonld.compact(values, ["https://www.w3.org/ns/activitystreams", {
3516
- "schema": "http://schema.org#",
3517
- "PropertyValue": "schema:PropertyValue",
3518
- "value": "schema:value",
3519
- }], { documentLoader: options.contextLoader });
3642
+ return await jsonld.compact(values, options.context ??
3643
+ ["https://www.w3.org/ns/activitystreams", {
3644
+ "schema": "http://schema.org#",
3645
+ "PropertyValue": "schema:PropertyValue",
3646
+ "value": "schema:value",
3647
+ }], { documentLoader: options.contextLoader });
3520
3648
  }
3521
3649
  /**
3522
3650
  * Converts a JSON-LD structure to an object of this type.
@@ -3852,7 +3980,7 @@ export class DataIntegrityProof {
3852
3980
  if (options.expand) {
3853
3981
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
3854
3982
  }
3855
- return await jsonld.compact(values, "https://w3id.org/security/data-integrity/v1", { documentLoader: options.contextLoader });
3983
+ return await jsonld.compact(values, options.context ?? "https://w3id.org/security/data-integrity/v1", { documentLoader: options.contextLoader });
3856
3984
  }
3857
3985
  /**
3858
3986
  * Converts a JSON-LD structure to an object of this type.
@@ -4186,7 +4314,7 @@ export class CryptographicKey {
4186
4314
  if (options.expand) {
4187
4315
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
4188
4316
  }
4189
- return await jsonld.compact(values, "https://w3id.org/security/v1", { documentLoader: options.contextLoader });
4317
+ return await jsonld.compact(values, options.context ?? "https://w3id.org/security/v1", { documentLoader: options.contextLoader });
4190
4318
  }
4191
4319
  /**
4192
4320
  * Converts a JSON-LD structure to an object of this type.
@@ -4499,7 +4627,7 @@ export class Multikey {
4499
4627
  if (options.expand) {
4500
4628
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
4501
4629
  }
4502
- return await jsonld.compact(values, "https://w3id.org/security/multikey/v1", { documentLoader: options.contextLoader });
4630
+ return await jsonld.compact(values, options.context ?? "https://w3id.org/security/multikey/v1", { documentLoader: options.contextLoader });
4503
4631
  }
4504
4632
  /**
4505
4633
  * Converts a JSON-LD structure to an object of this type.
@@ -4920,7 +5048,12 @@ export class Activity extends Object {
4920
5048
  if (options.expand) {
4921
5049
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
4922
5050
  }
4923
- return await jsonld.compact(values, ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/v1"], { documentLoader: options.contextLoader });
5051
+ return await jsonld.compact(values, options.context ??
5052
+ [
5053
+ "https://www.w3.org/ns/activitystreams",
5054
+ "https://w3id.org/security/v1",
5055
+ "https://w3id.org/security/data-integrity/v1",
5056
+ ], { documentLoader: options.contextLoader });
4924
5057
  }
4925
5058
  /**
4926
5059
  * Converts a JSON-LD structure to an object of this type.
@@ -5171,7 +5304,11 @@ export class Accept extends Activity {
5171
5304
  if (options.expand) {
5172
5305
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
5173
5306
  }
5174
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
5307
+ return await jsonld.compact(values, options.context ??
5308
+ [
5309
+ "https://www.w3.org/ns/activitystreams",
5310
+ "https://w3id.org/security/data-integrity/v1",
5311
+ ], { documentLoader: options.contextLoader });
5175
5312
  }
5176
5313
  /**
5177
5314
  * Converts a JSON-LD structure to an object of this type.
@@ -5280,7 +5417,11 @@ export class Add extends Activity {
5280
5417
  if (options.expand) {
5281
5418
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
5282
5419
  }
5283
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
5420
+ return await jsonld.compact(values, options.context ??
5421
+ [
5422
+ "https://www.w3.org/ns/activitystreams",
5423
+ "https://w3id.org/security/data-integrity/v1",
5424
+ ], { documentLoader: options.contextLoader });
5284
5425
  }
5285
5426
  /**
5286
5427
  * Converts a JSON-LD structure to an object of this type.
@@ -5388,12 +5529,17 @@ export class Announce extends Activity {
5388
5529
  if (options.expand) {
5389
5530
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
5390
5531
  }
5391
- return await jsonld.compact(values, ["https://www.w3.org/ns/activitystreams", {
5392
- "toot": "http://joinmastodon.org/ns#",
5393
- "sensitive": "as:sensitive",
5394
- "Emoji": "toot:Emoji",
5395
- "Hashtag": "as:Hashtag",
5396
- }], { documentLoader: options.contextLoader });
5532
+ return await jsonld.compact(values, options.context ??
5533
+ [
5534
+ "https://www.w3.org/ns/activitystreams",
5535
+ "https://w3id.org/security/data-integrity/v1",
5536
+ {
5537
+ "toot": "http://joinmastodon.org/ns#",
5538
+ "sensitive": "as:sensitive",
5539
+ "Emoji": "toot:Emoji",
5540
+ "Hashtag": "as:Hashtag",
5541
+ },
5542
+ ], { documentLoader: options.contextLoader });
5397
5543
  }
5398
5544
  /**
5399
5545
  * Converts a JSON-LD structure to an object of this type.
@@ -6264,23 +6410,25 @@ export class Application extends Object {
6264
6410
  if (options.expand) {
6265
6411
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
6266
6412
  }
6267
- return await jsonld.compact(values, [
6268
- "https://www.w3.org/ns/activitystreams",
6269
- "https://w3id.org/security/v1",
6270
- "https://www.w3.org/ns/did/v1",
6271
- "https://w3id.org/security/multikey/v1",
6272
- {
6273
- "manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
6274
- "toot": "http://joinmastodon.org/ns#",
6275
- "discoverable": "toot:discoverable",
6276
- "suspended": "toot:suspended",
6277
- "memorial": "toot:memorial",
6278
- "indexable": "toot:indexable",
6279
- "schema": "http://schema.org#",
6280
- "PropertyValue": "schema:PropertyValue",
6281
- "value": "schema:value",
6282
- },
6283
- ], { documentLoader: options.contextLoader });
6413
+ return await jsonld.compact(values, options.context ??
6414
+ [
6415
+ "https://www.w3.org/ns/activitystreams",
6416
+ "https://w3id.org/security/v1",
6417
+ "https://w3id.org/security/data-integrity/v1",
6418
+ "https://www.w3.org/ns/did/v1",
6419
+ "https://w3id.org/security/multikey/v1",
6420
+ {
6421
+ "manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
6422
+ "toot": "http://joinmastodon.org/ns#",
6423
+ "discoverable": "toot:discoverable",
6424
+ "suspended": "toot:suspended",
6425
+ "memorial": "toot:memorial",
6426
+ "indexable": "toot:indexable",
6427
+ "schema": "http://schema.org#",
6428
+ "PropertyValue": "schema:PropertyValue",
6429
+ "value": "schema:value",
6430
+ },
6431
+ ], { documentLoader: options.contextLoader });
6284
6432
  }
6285
6433
  /**
6286
6434
  * Converts a JSON-LD structure to an object of this type.
@@ -6724,12 +6872,17 @@ export class Article extends Object {
6724
6872
  if (options.expand) {
6725
6873
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
6726
6874
  }
6727
- return await jsonld.compact(values, ["https://www.w3.org/ns/activitystreams", {
6728
- "toot": "http://joinmastodon.org/ns#",
6729
- "sensitive": "as:sensitive",
6730
- "Emoji": "toot:Emoji",
6731
- "Hashtag": "as:Hashtag",
6732
- }], { documentLoader: options.contextLoader });
6875
+ return await jsonld.compact(values, options.context ??
6876
+ [
6877
+ "https://www.w3.org/ns/activitystreams",
6878
+ "https://w3id.org/security/data-integrity/v1",
6879
+ {
6880
+ "toot": "http://joinmastodon.org/ns#",
6881
+ "sensitive": "as:sensitive",
6882
+ "Emoji": "toot:Emoji",
6883
+ "Hashtag": "as:Hashtag",
6884
+ },
6885
+ ], { documentLoader: options.contextLoader });
6733
6886
  }
6734
6887
  /**
6735
6888
  * Converts a JSON-LD structure to an object of this type.
@@ -6887,7 +7040,11 @@ export class Document extends Object {
6887
7040
  if (options.expand) {
6888
7041
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
6889
7042
  }
6890
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
7043
+ return await jsonld.compact(values, options.context ??
7044
+ [
7045
+ "https://www.w3.org/ns/activitystreams",
7046
+ "https://w3id.org/security/data-integrity/v1",
7047
+ ], { documentLoader: options.contextLoader });
6891
7048
  }
6892
7049
  /**
6893
7050
  * Converts a JSON-LD structure to an object of this type.
@@ -7045,7 +7202,11 @@ export class Audio extends Document {
7045
7202
  if (options.expand) {
7046
7203
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
7047
7204
  }
7048
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
7205
+ return await jsonld.compact(values, options.context ??
7206
+ [
7207
+ "https://www.w3.org/ns/activitystreams",
7208
+ "https://w3id.org/security/data-integrity/v1",
7209
+ ], { documentLoader: options.contextLoader });
7049
7210
  }
7050
7211
  /**
7051
7212
  * Converts a JSON-LD structure to an object of this type.
@@ -7152,7 +7313,11 @@ export class Ignore extends Activity {
7152
7313
  if (options.expand) {
7153
7314
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
7154
7315
  }
7155
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
7316
+ return await jsonld.compact(values, options.context ??
7317
+ [
7318
+ "https://www.w3.org/ns/activitystreams",
7319
+ "https://w3id.org/security/data-integrity/v1",
7320
+ ], { documentLoader: options.contextLoader });
7156
7321
  }
7157
7322
  /**
7158
7323
  * Converts a JSON-LD structure to an object of this type.
@@ -7265,7 +7430,11 @@ export class Block extends Ignore {
7265
7430
  if (options.expand) {
7266
7431
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
7267
7432
  }
7268
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
7433
+ return await jsonld.compact(values, options.context ??
7434
+ [
7435
+ "https://www.w3.org/ns/activitystreams",
7436
+ "https://w3id.org/security/data-integrity/v1",
7437
+ ], { documentLoader: options.contextLoader });
7269
7438
  }
7270
7439
  /**
7271
7440
  * Converts a JSON-LD structure to an object of this type.
@@ -7687,7 +7856,7 @@ export class Collection extends Object {
7687
7856
  if (options.expand) {
7688
7857
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
7689
7858
  }
7690
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
7859
+ return await jsonld.compact(values, options.context ?? "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
7691
7860
  }
7692
7861
  /**
7693
7862
  * Converts a JSON-LD structure to an object of this type.
@@ -8244,7 +8413,7 @@ export class CollectionPage extends Collection {
8244
8413
  if (options.expand) {
8245
8414
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
8246
8415
  }
8247
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
8416
+ return await jsonld.compact(values, options.context ?? "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
8248
8417
  }
8249
8418
  /**
8250
8419
  * Converts a JSON-LD structure to an object of this type.
@@ -8480,12 +8649,17 @@ export class Create extends Activity {
8480
8649
  if (options.expand) {
8481
8650
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
8482
8651
  }
8483
- return await jsonld.compact(values, ["https://www.w3.org/ns/activitystreams", {
8484
- "toot": "http://joinmastodon.org/ns#",
8485
- "sensitive": "as:sensitive",
8486
- "Emoji": "toot:Emoji",
8487
- "Hashtag": "as:Hashtag",
8488
- }], { documentLoader: options.contextLoader });
8652
+ return await jsonld.compact(values, options.context ??
8653
+ [
8654
+ "https://www.w3.org/ns/activitystreams",
8655
+ "https://w3id.org/security/data-integrity/v1",
8656
+ {
8657
+ "toot": "http://joinmastodon.org/ns#",
8658
+ "sensitive": "as:sensitive",
8659
+ "Emoji": "toot:Emoji",
8660
+ "Hashtag": "as:Hashtag",
8661
+ },
8662
+ ], { documentLoader: options.contextLoader });
8489
8663
  }
8490
8664
  /**
8491
8665
  * Converts a JSON-LD structure to an object of this type.
@@ -8592,7 +8766,11 @@ export class Delete extends Activity {
8592
8766
  if (options.expand) {
8593
8767
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
8594
8768
  }
8595
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
8769
+ return await jsonld.compact(values, options.context ??
8770
+ [
8771
+ "https://www.w3.org/ns/activitystreams",
8772
+ "https://w3id.org/security/data-integrity/v1",
8773
+ ], { documentLoader: options.contextLoader });
8596
8774
  }
8597
8775
  /**
8598
8776
  * Converts a JSON-LD structure to an object of this type.
@@ -8698,7 +8876,11 @@ export class Dislike extends Activity {
8698
8876
  if (options.expand) {
8699
8877
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
8700
8878
  }
8701
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
8879
+ return await jsonld.compact(values, options.context ??
8880
+ [
8881
+ "https://www.w3.org/ns/activitystreams",
8882
+ "https://w3id.org/security/data-integrity/v1",
8883
+ ], { documentLoader: options.contextLoader });
8702
8884
  }
8703
8885
  /**
8704
8886
  * Converts a JSON-LD structure to an object of this type.
@@ -8972,7 +9154,7 @@ export class Endpoints {
8972
9154
  if (options.expand) {
8973
9155
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
8974
9156
  }
8975
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
9157
+ return await jsonld.compact(values, options.context ?? "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
8976
9158
  }
8977
9159
  /**
8978
9160
  * Converts a JSON-LD structure to an object of this type.
@@ -9192,7 +9374,11 @@ export class Event extends Object {
9192
9374
  if (options.expand) {
9193
9375
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
9194
9376
  }
9195
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
9377
+ return await jsonld.compact(values, options.context ??
9378
+ [
9379
+ "https://www.w3.org/ns/activitystreams",
9380
+ "https://w3id.org/security/data-integrity/v1",
9381
+ ], { documentLoader: options.contextLoader });
9196
9382
  }
9197
9383
  /**
9198
9384
  * Converts a JSON-LD structure to an object of this type.
@@ -9300,7 +9486,11 @@ export class Flag extends Activity {
9300
9486
  if (options.expand) {
9301
9487
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
9302
9488
  }
9303
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
9489
+ return await jsonld.compact(values, options.context ??
9490
+ [
9491
+ "https://www.w3.org/ns/activitystreams",
9492
+ "https://w3id.org/security/data-integrity/v1",
9493
+ ], { documentLoader: options.contextLoader });
9304
9494
  }
9305
9495
  /**
9306
9496
  * Converts a JSON-LD structure to an object of this type.
@@ -9409,7 +9599,11 @@ export class Follow extends Activity {
9409
9599
  if (options.expand) {
9410
9600
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
9411
9601
  }
9412
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
9602
+ return await jsonld.compact(values, options.context ??
9603
+ [
9604
+ "https://www.w3.org/ns/activitystreams",
9605
+ "https://w3id.org/security/data-integrity/v1",
9606
+ ], { documentLoader: options.contextLoader });
9413
9607
  }
9414
9608
  /**
9415
9609
  * Converts a JSON-LD structure to an object of this type.
@@ -10280,23 +10474,25 @@ export class Group extends Object {
10280
10474
  if (options.expand) {
10281
10475
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
10282
10476
  }
10283
- return await jsonld.compact(values, [
10284
- "https://www.w3.org/ns/activitystreams",
10285
- "https://w3id.org/security/v1",
10286
- "https://www.w3.org/ns/did/v1",
10287
- "https://w3id.org/security/multikey/v1",
10288
- {
10289
- "manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
10290
- "toot": "http://joinmastodon.org/ns#",
10291
- "discoverable": "toot:discoverable",
10292
- "suspended": "toot:suspended",
10293
- "memorial": "toot:memorial",
10294
- "indexable": "toot:indexable",
10295
- "schema": "http://schema.org#",
10296
- "PropertyValue": "schema:PropertyValue",
10297
- "value": "schema:value",
10298
- },
10299
- ], { documentLoader: options.contextLoader });
10477
+ return await jsonld.compact(values, options.context ??
10478
+ [
10479
+ "https://www.w3.org/ns/activitystreams",
10480
+ "https://w3id.org/security/v1",
10481
+ "https://w3id.org/security/data-integrity/v1",
10482
+ "https://www.w3.org/ns/did/v1",
10483
+ "https://w3id.org/security/multikey/v1",
10484
+ {
10485
+ "manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
10486
+ "toot": "http://joinmastodon.org/ns#",
10487
+ "discoverable": "toot:discoverable",
10488
+ "suspended": "toot:suspended",
10489
+ "memorial": "toot:memorial",
10490
+ "indexable": "toot:indexable",
10491
+ "schema": "http://schema.org#",
10492
+ "PropertyValue": "schema:PropertyValue",
10493
+ "value": "schema:value",
10494
+ },
10495
+ ], { documentLoader: options.contextLoader });
10300
10496
  }
10301
10497
  /**
10302
10498
  * Converts a JSON-LD structure to an object of this type.
@@ -11046,7 +11242,7 @@ export class Link {
11046
11242
  if (options.expand) {
11047
11243
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
11048
11244
  }
11049
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
11245
+ return await jsonld.compact(values, options.context ?? "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
11050
11246
  }
11051
11247
  /**
11052
11248
  * Converts a JSON-LD structure to an object of this type.
@@ -11393,7 +11589,8 @@ export class Hashtag extends Link {
11393
11589
  if (options.expand) {
11394
11590
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
11395
11591
  }
11396
- return await jsonld.compact(values, ["https://www.w3.org/ns/activitystreams", { "Hashtag": "as:Hashtag" }], { documentLoader: options.contextLoader });
11592
+ return await jsonld.compact(values, options.context ??
11593
+ ["https://www.w3.org/ns/activitystreams", { "Hashtag": "as:Hashtag" }], { documentLoader: options.contextLoader });
11397
11594
  }
11398
11595
  /**
11399
11596
  * Converts a JSON-LD structure to an object of this type.
@@ -11499,7 +11696,7 @@ export class Image extends Document {
11499
11696
  if (options.expand) {
11500
11697
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
11501
11698
  }
11502
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
11699
+ return await jsonld.compact(values, options.context ?? "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
11503
11700
  }
11504
11701
  /**
11505
11702
  * Converts a JSON-LD structure to an object of this type.
@@ -11609,7 +11806,11 @@ export class IntransitiveActivity extends Activity {
11609
11806
  if (options.expand) {
11610
11807
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
11611
11808
  }
11612
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
11809
+ return await jsonld.compact(values, options.context ??
11810
+ [
11811
+ "https://www.w3.org/ns/activitystreams",
11812
+ "https://w3id.org/security/data-integrity/v1",
11813
+ ], { documentLoader: options.contextLoader });
11613
11814
  }
11614
11815
  /**
11615
11816
  * Converts a JSON-LD structure to an object of this type.
@@ -11716,7 +11917,11 @@ export class Like extends Activity {
11716
11917
  if (options.expand) {
11717
11918
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
11718
11919
  }
11719
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
11920
+ return await jsonld.compact(values, options.context ??
11921
+ [
11922
+ "https://www.w3.org/ns/activitystreams",
11923
+ "https://w3id.org/security/data-integrity/v1",
11924
+ ], { documentLoader: options.contextLoader });
11720
11925
  }
11721
11926
  /**
11722
11927
  * Converts a JSON-LD structure to an object of this type.
@@ -11822,7 +12027,7 @@ export class Mention extends Link {
11822
12027
  if (options.expand) {
11823
12028
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
11824
12029
  }
11825
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
12030
+ return await jsonld.compact(values, options.context ?? "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
11826
12031
  }
11827
12032
  /**
11828
12033
  * Converts a JSON-LD structure to an object of this type.
@@ -11929,12 +12134,17 @@ export class Note extends Object {
11929
12134
  if (options.expand) {
11930
12135
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
11931
12136
  }
11932
- return await jsonld.compact(values, ["https://www.w3.org/ns/activitystreams", {
11933
- "toot": "http://joinmastodon.org/ns#",
11934
- "sensitive": "as:sensitive",
11935
- "Emoji": "toot:Emoji",
11936
- "Hashtag": "as:Hashtag",
11937
- }], { documentLoader: options.contextLoader });
12137
+ return await jsonld.compact(values, options.context ??
12138
+ [
12139
+ "https://www.w3.org/ns/activitystreams",
12140
+ "https://w3id.org/security/data-integrity/v1",
12141
+ {
12142
+ "toot": "http://joinmastodon.org/ns#",
12143
+ "sensitive": "as:sensitive",
12144
+ "Emoji": "toot:Emoji",
12145
+ "Hashtag": "as:Hashtag",
12146
+ },
12147
+ ], { documentLoader: options.contextLoader });
11938
12148
  }
11939
12149
  /**
11940
12150
  * Converts a JSON-LD structure to an object of this type.
@@ -12043,7 +12253,7 @@ export class OrderedCollection extends Collection {
12043
12253
  if (options.expand) {
12044
12254
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
12045
12255
  }
12046
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
12256
+ return await jsonld.compact(values, options.context ?? "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
12047
12257
  }
12048
12258
  /**
12049
12259
  * Converts a JSON-LD structure to an object of this type.
@@ -12179,7 +12389,7 @@ export class OrderedCollectionPage extends CollectionPage {
12179
12389
  if (options.expand) {
12180
12390
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
12181
12391
  }
12182
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
12392
+ return await jsonld.compact(values, options.context ?? "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
12183
12393
  }
12184
12394
  /**
12185
12395
  * Converts a JSON-LD structure to an object of this type.
@@ -13069,23 +13279,25 @@ export class Organization extends Object {
13069
13279
  if (options.expand) {
13070
13280
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
13071
13281
  }
13072
- return await jsonld.compact(values, [
13073
- "https://www.w3.org/ns/activitystreams",
13074
- "https://w3id.org/security/v1",
13075
- "https://www.w3.org/ns/did/v1",
13076
- "https://w3id.org/security/multikey/v1",
13077
- {
13078
- "manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
13079
- "toot": "http://joinmastodon.org/ns#",
13080
- "discoverable": "toot:discoverable",
13081
- "suspended": "toot:suspended",
13082
- "memorial": "toot:memorial",
13083
- "indexable": "toot:indexable",
13084
- "schema": "http://schema.org#",
13085
- "PropertyValue": "schema:PropertyValue",
13086
- "value": "schema:value",
13087
- },
13088
- ], { documentLoader: options.contextLoader });
13282
+ return await jsonld.compact(values, options.context ??
13283
+ [
13284
+ "https://www.w3.org/ns/activitystreams",
13285
+ "https://w3id.org/security/v1",
13286
+ "https://w3id.org/security/data-integrity/v1",
13287
+ "https://www.w3.org/ns/did/v1",
13288
+ "https://w3id.org/security/multikey/v1",
13289
+ {
13290
+ "manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
13291
+ "toot": "http://joinmastodon.org/ns#",
13292
+ "discoverable": "toot:discoverable",
13293
+ "suspended": "toot:suspended",
13294
+ "memorial": "toot:memorial",
13295
+ "indexable": "toot:indexable",
13296
+ "schema": "http://schema.org#",
13297
+ "PropertyValue": "schema:PropertyValue",
13298
+ "value": "schema:value",
13299
+ },
13300
+ ], { documentLoader: options.contextLoader });
13089
13301
  }
13090
13302
  /**
13091
13303
  * Converts a JSON-LD structure to an object of this type.
@@ -13529,7 +13741,11 @@ export class Page extends Document {
13529
13741
  if (options.expand) {
13530
13742
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
13531
13743
  }
13532
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
13744
+ return await jsonld.compact(values, options.context ??
13745
+ [
13746
+ "https://www.w3.org/ns/activitystreams",
13747
+ "https://w3id.org/security/data-integrity/v1",
13748
+ ], { documentLoader: options.contextLoader });
13533
13749
  }
13534
13750
  /**
13535
13751
  * Converts a JSON-LD structure to an object of this type.
@@ -14400,23 +14616,25 @@ export class Person extends Object {
14400
14616
  if (options.expand) {
14401
14617
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
14402
14618
  }
14403
- return await jsonld.compact(values, [
14404
- "https://www.w3.org/ns/activitystreams",
14405
- "https://w3id.org/security/v1",
14406
- "https://www.w3.org/ns/did/v1",
14407
- "https://w3id.org/security/multikey/v1",
14408
- {
14409
- "manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
14410
- "toot": "http://joinmastodon.org/ns#",
14411
- "discoverable": "toot:discoverable",
14412
- "suspended": "toot:suspended",
14413
- "memorial": "toot:memorial",
14414
- "indexable": "toot:indexable",
14415
- "schema": "http://schema.org#",
14416
- "PropertyValue": "schema:PropertyValue",
14417
- "value": "schema:value",
14418
- },
14419
- ], { documentLoader: options.contextLoader });
14619
+ return await jsonld.compact(values, options.context ??
14620
+ [
14621
+ "https://www.w3.org/ns/activitystreams",
14622
+ "https://w3id.org/security/v1",
14623
+ "https://w3id.org/security/data-integrity/v1",
14624
+ "https://www.w3.org/ns/did/v1",
14625
+ "https://w3id.org/security/multikey/v1",
14626
+ {
14627
+ "manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
14628
+ "toot": "http://joinmastodon.org/ns#",
14629
+ "discoverable": "toot:discoverable",
14630
+ "suspended": "toot:suspended",
14631
+ "memorial": "toot:memorial",
14632
+ "indexable": "toot:indexable",
14633
+ "schema": "http://schema.org#",
14634
+ "PropertyValue": "schema:PropertyValue",
14635
+ "value": "schema:value",
14636
+ },
14637
+ ], { documentLoader: options.contextLoader });
14420
14638
  }
14421
14639
  /**
14422
14640
  * Converts a JSON-LD structure to an object of this type.
@@ -15020,7 +15238,11 @@ export class Place extends Object {
15020
15238
  if (options.expand) {
15021
15239
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
15022
15240
  }
15023
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
15241
+ return await jsonld.compact(values, options.context ??
15242
+ [
15243
+ "https://www.w3.org/ns/activitystreams",
15244
+ "https://w3id.org/security/data-integrity/v1",
15245
+ ], { documentLoader: options.contextLoader });
15024
15246
  }
15025
15247
  /**
15026
15248
  * Converts a JSON-LD structure to an object of this type.
@@ -15307,7 +15529,11 @@ export class Profile extends Object {
15307
15529
  if (options.expand) {
15308
15530
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
15309
15531
  }
15310
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
15532
+ return await jsonld.compact(values, options.context ??
15533
+ [
15534
+ "https://www.w3.org/ns/activitystreams",
15535
+ "https://w3id.org/security/data-integrity/v1",
15536
+ ], { documentLoader: options.contextLoader });
15311
15537
  }
15312
15538
  /**
15313
15539
  * Converts a JSON-LD structure to an object of this type.
@@ -15437,7 +15663,11 @@ export class Reject extends Activity {
15437
15663
  if (options.expand) {
15438
15664
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
15439
15665
  }
15440
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
15666
+ return await jsonld.compact(values, options.context ??
15667
+ [
15668
+ "https://www.w3.org/ns/activitystreams",
15669
+ "https://w3id.org/security/data-integrity/v1",
15670
+ ], { documentLoader: options.contextLoader });
15441
15671
  }
15442
15672
  /**
15443
15673
  * Converts a JSON-LD structure to an object of this type.
@@ -15805,7 +16035,11 @@ export class Relationship extends Object {
15805
16035
  if (options.expand) {
15806
16036
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
15807
16037
  }
15808
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
16038
+ return await jsonld.compact(values, options.context ??
16039
+ [
16040
+ "https://www.w3.org/ns/activitystreams",
16041
+ "https://w3id.org/security/data-integrity/v1",
16042
+ ], { documentLoader: options.contextLoader });
15809
16043
  }
15810
16044
  /**
15811
16045
  * Converts a JSON-LD structure to an object of this type.
@@ -15992,7 +16226,11 @@ export class Remove extends Activity {
15992
16226
  if (options.expand) {
15993
16227
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
15994
16228
  }
15995
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
16229
+ return await jsonld.compact(values, options.context ??
16230
+ [
16231
+ "https://www.w3.org/ns/activitystreams",
16232
+ "https://w3id.org/security/data-integrity/v1",
16233
+ ], { documentLoader: options.contextLoader });
15996
16234
  }
15997
16235
  /**
15998
16236
  * Converts a JSON-LD structure to an object of this type.
@@ -16863,23 +17101,25 @@ export class Service extends Object {
16863
17101
  if (options.expand) {
16864
17102
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
16865
17103
  }
16866
- return await jsonld.compact(values, [
16867
- "https://www.w3.org/ns/activitystreams",
16868
- "https://w3id.org/security/v1",
16869
- "https://www.w3.org/ns/did/v1",
16870
- "https://w3id.org/security/multikey/v1",
16871
- {
16872
- "manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
16873
- "toot": "http://joinmastodon.org/ns#",
16874
- "discoverable": "toot:discoverable",
16875
- "suspended": "toot:suspended",
16876
- "memorial": "toot:memorial",
16877
- "indexable": "toot:indexable",
16878
- "schema": "http://schema.org#",
16879
- "PropertyValue": "schema:PropertyValue",
16880
- "value": "schema:value",
16881
- },
16882
- ], { documentLoader: options.contextLoader });
17104
+ return await jsonld.compact(values, options.context ??
17105
+ [
17106
+ "https://www.w3.org/ns/activitystreams",
17107
+ "https://w3id.org/security/v1",
17108
+ "https://w3id.org/security/data-integrity/v1",
17109
+ "https://www.w3.org/ns/did/v1",
17110
+ "https://w3id.org/security/multikey/v1",
17111
+ {
17112
+ "manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
17113
+ "toot": "http://joinmastodon.org/ns#",
17114
+ "discoverable": "toot:discoverable",
17115
+ "suspended": "toot:suspended",
17116
+ "memorial": "toot:memorial",
17117
+ "indexable": "toot:indexable",
17118
+ "schema": "http://schema.org#",
17119
+ "PropertyValue": "schema:PropertyValue",
17120
+ "value": "schema:value",
17121
+ },
17122
+ ], { documentLoader: options.contextLoader });
16883
17123
  }
16884
17124
  /**
16885
17125
  * Converts a JSON-LD structure to an object of this type.
@@ -17351,7 +17591,11 @@ export class Tombstone extends Object {
17351
17591
  if (options.expand) {
17352
17592
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
17353
17593
  }
17354
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
17594
+ return await jsonld.compact(values, options.context ??
17595
+ [
17596
+ "https://www.w3.org/ns/activitystreams",
17597
+ "https://w3id.org/security/data-integrity/v1",
17598
+ ], { documentLoader: options.contextLoader });
17355
17599
  }
17356
17600
  /**
17357
17601
  * Converts a JSON-LD structure to an object of this type.
@@ -17481,7 +17725,11 @@ export class Undo extends Activity {
17481
17725
  if (options.expand) {
17482
17726
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
17483
17727
  }
17484
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
17728
+ return await jsonld.compact(values, options.context ??
17729
+ [
17730
+ "https://www.w3.org/ns/activitystreams",
17731
+ "https://w3id.org/security/data-integrity/v1",
17732
+ ], { documentLoader: options.contextLoader });
17485
17733
  }
17486
17734
  /**
17487
17735
  * Converts a JSON-LD structure to an object of this type.
@@ -17591,12 +17839,17 @@ export class Update extends Activity {
17591
17839
  if (options.expand) {
17592
17840
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
17593
17841
  }
17594
- return await jsonld.compact(values, ["https://www.w3.org/ns/activitystreams", {
17595
- "toot": "http://joinmastodon.org/ns#",
17596
- "sensitive": "as:sensitive",
17597
- "Emoji": "toot:Emoji",
17598
- "Hashtag": "as:Hashtag",
17599
- }], { documentLoader: options.contextLoader });
17842
+ return await jsonld.compact(values, options.context ??
17843
+ [
17844
+ "https://www.w3.org/ns/activitystreams",
17845
+ "https://w3id.org/security/data-integrity/v1",
17846
+ {
17847
+ "toot": "http://joinmastodon.org/ns#",
17848
+ "sensitive": "as:sensitive",
17849
+ "Emoji": "toot:Emoji",
17850
+ "Hashtag": "as:Hashtag",
17851
+ },
17852
+ ], { documentLoader: options.contextLoader });
17600
17853
  }
17601
17854
  /**
17602
17855
  * Converts a JSON-LD structure to an object of this type.
@@ -17702,7 +17955,11 @@ export class Video extends Document {
17702
17955
  if (options.expand) {
17703
17956
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
17704
17957
  }
17705
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
17958
+ return await jsonld.compact(values, options.context ??
17959
+ [
17960
+ "https://www.w3.org/ns/activitystreams",
17961
+ "https://w3id.org/security/data-integrity/v1",
17962
+ ], { documentLoader: options.contextLoader });
17706
17963
  }
17707
17964
  /**
17708
17965
  * Converts a JSON-LD structure to an object of this type.