@fedify/fedify 0.11.0-dev.259 → 0.11.0-dev.260

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.
@@ -3043,12 +3043,28 @@ export class Object {
3043
3043
  if (options.expand) {
3044
3044
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
3045
3045
  }
3046
- return await jsonld.compact(values, options.context ??
3046
+ const docContext = options.context ??
3047
3047
  [
3048
3048
  "https://www.w3.org/ns/activitystreams",
3049
3049
  "https://w3id.org/security/data-integrity/v1",
3050
3050
  { "sensitive": "as:sensitive" },
3051
- ], { documentLoader: options.contextLoader });
3051
+ ];
3052
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
3053
+ if (docContext != null) {
3054
+ // Embed context
3055
+ if ("proof" in compacted &&
3056
+ compacted.proof != null) {
3057
+ if (Array.isArray(compacted.proof)) {
3058
+ for (const element of compacted.proof) {
3059
+ element["@context"] = docContext;
3060
+ }
3061
+ }
3062
+ else {
3063
+ compacted.proof["@context"] = docContext;
3064
+ }
3065
+ }
3066
+ }
3067
+ return compacted;
3052
3068
  }
3053
3069
  /**
3054
3070
  * Converts a JSON-LD structure to an object of this type.
@@ -4699,11 +4715,27 @@ export class Emoji extends Object {
4699
4715
  if (options.expand) {
4700
4716
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
4701
4717
  }
4702
- return await jsonld.compact(values, options.context ??
4718
+ const docContext = options.context ??
4703
4719
  ["https://www.w3.org/ns/activitystreams", {
4704
4720
  "toot": "http://joinmastodon.org/ns#",
4705
4721
  "Emoji": "toot:Emoji",
4706
- }], { documentLoader: options.contextLoader });
4722
+ }];
4723
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
4724
+ if (docContext != null) {
4725
+ // Embed context
4726
+ if ("proof" in compacted &&
4727
+ compacted.proof != null) {
4728
+ if (Array.isArray(compacted.proof)) {
4729
+ for (const element of compacted.proof) {
4730
+ element["@context"] = docContext;
4731
+ }
4732
+ }
4733
+ else {
4734
+ compacted.proof["@context"] = docContext;
4735
+ }
4736
+ }
4737
+ }
4738
+ return compacted;
4707
4739
  }
4708
4740
  /**
4709
4741
  * Converts a JSON-LD structure to an object of this type.
@@ -4904,12 +4936,17 @@ export class PropertyValue {
4904
4936
  if (options.expand) {
4905
4937
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
4906
4938
  }
4907
- return await jsonld.compact(values, options.context ??
4939
+ const docContext = options.context ??
4908
4940
  ["https://www.w3.org/ns/activitystreams", {
4909
4941
  "schema": "http://schema.org#",
4910
4942
  "PropertyValue": "schema:PropertyValue",
4911
4943
  "value": "schema:value",
4912
- }], { documentLoader: options.contextLoader });
4944
+ }];
4945
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
4946
+ if (docContext != null) {
4947
+ // Embed context
4948
+ }
4949
+ return compacted;
4913
4950
  }
4914
4951
  /**
4915
4952
  * Converts a JSON-LD structure to an object of this type.
@@ -5364,7 +5401,13 @@ export class DataIntegrityProof {
5364
5401
  if (options.expand) {
5365
5402
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
5366
5403
  }
5367
- return await jsonld.compact(values, options.context ?? "https://w3id.org/security/data-integrity/v1", { documentLoader: options.contextLoader });
5404
+ const docContext = options.context ??
5405
+ "https://w3id.org/security/data-integrity/v1";
5406
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
5407
+ if (docContext != null) {
5408
+ // Embed context
5409
+ }
5410
+ return compacted;
5368
5411
  }
5369
5412
  /**
5370
5413
  * Converts a JSON-LD structure to an object of this type.
@@ -5789,7 +5832,13 @@ export class CryptographicKey {
5789
5832
  if (options.expand) {
5790
5833
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
5791
5834
  }
5792
- return await jsonld.compact(values, options.context ?? "https://w3id.org/security/v1", { documentLoader: options.contextLoader });
5835
+ const docContext = options.context ??
5836
+ "https://w3id.org/security/v1";
5837
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
5838
+ if (docContext != null) {
5839
+ // Embed context
5840
+ }
5841
+ return compacted;
5793
5842
  }
5794
5843
  /**
5795
5844
  * Converts a JSON-LD structure to an object of this type.
@@ -6176,7 +6225,13 @@ export class Multikey {
6176
6225
  if (options.expand) {
6177
6226
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
6178
6227
  }
6179
- return await jsonld.compact(values, options.context ?? "https://w3id.org/security/multikey/v1", { documentLoader: options.contextLoader });
6228
+ const docContext = options.context ??
6229
+ "https://w3id.org/security/multikey/v1";
6230
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
6231
+ if (docContext != null) {
6232
+ // Embed context
6233
+ }
6234
+ return compacted;
6180
6235
  }
6181
6236
  /**
6182
6237
  * Converts a JSON-LD structure to an object of this type.
@@ -7311,12 +7366,28 @@ export class Activity extends Object {
7311
7366
  if (options.expand) {
7312
7367
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
7313
7368
  }
7314
- return await jsonld.compact(values, options.context ??
7369
+ const docContext = options.context ??
7315
7370
  [
7316
7371
  "https://www.w3.org/ns/activitystreams",
7317
7372
  "https://w3id.org/security/v1",
7318
7373
  "https://w3id.org/security/data-integrity/v1",
7319
- ], { documentLoader: options.contextLoader });
7374
+ ];
7375
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
7376
+ if (docContext != null) {
7377
+ // Embed context
7378
+ if ("proof" in compacted &&
7379
+ compacted.proof != null) {
7380
+ if (Array.isArray(compacted.proof)) {
7381
+ for (const element of compacted.proof) {
7382
+ element["@context"] = docContext;
7383
+ }
7384
+ }
7385
+ else {
7386
+ compacted.proof["@context"] = docContext;
7387
+ }
7388
+ }
7389
+ }
7390
+ return compacted;
7320
7391
  }
7321
7392
  /**
7322
7393
  * Converts a JSON-LD structure to an object of this type.
@@ -7743,11 +7814,27 @@ export class Accept extends Activity {
7743
7814
  if (options.expand) {
7744
7815
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
7745
7816
  }
7746
- return await jsonld.compact(values, options.context ??
7817
+ const docContext = options.context ??
7747
7818
  [
7748
7819
  "https://www.w3.org/ns/activitystreams",
7749
7820
  "https://w3id.org/security/data-integrity/v1",
7750
- ], { documentLoader: options.contextLoader });
7821
+ ];
7822
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
7823
+ if (docContext != null) {
7824
+ // Embed context
7825
+ if ("proof" in compacted &&
7826
+ compacted.proof != null) {
7827
+ if (Array.isArray(compacted.proof)) {
7828
+ for (const element of compacted.proof) {
7829
+ element["@context"] = docContext;
7830
+ }
7831
+ }
7832
+ else {
7833
+ compacted.proof["@context"] = docContext;
7834
+ }
7835
+ }
7836
+ }
7837
+ return compacted;
7751
7838
  }
7752
7839
  /**
7753
7840
  * Converts a JSON-LD structure to an object of this type.
@@ -7856,11 +7943,27 @@ export class Add extends Activity {
7856
7943
  if (options.expand) {
7857
7944
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
7858
7945
  }
7859
- return await jsonld.compact(values, options.context ??
7946
+ const docContext = options.context ??
7860
7947
  [
7861
7948
  "https://www.w3.org/ns/activitystreams",
7862
7949
  "https://w3id.org/security/data-integrity/v1",
7863
- ], { documentLoader: options.contextLoader });
7950
+ ];
7951
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
7952
+ if (docContext != null) {
7953
+ // Embed context
7954
+ if ("proof" in compacted &&
7955
+ compacted.proof != null) {
7956
+ if (Array.isArray(compacted.proof)) {
7957
+ for (const element of compacted.proof) {
7958
+ element["@context"] = docContext;
7959
+ }
7960
+ }
7961
+ else {
7962
+ compacted.proof["@context"] = docContext;
7963
+ }
7964
+ }
7965
+ }
7966
+ return compacted;
7864
7967
  }
7865
7968
  /**
7866
7969
  * Converts a JSON-LD structure to an object of this type.
@@ -7968,7 +8071,7 @@ export class Announce extends Activity {
7968
8071
  if (options.expand) {
7969
8072
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
7970
8073
  }
7971
- return await jsonld.compact(values, options.context ??
8074
+ const docContext = options.context ??
7972
8075
  [
7973
8076
  "https://www.w3.org/ns/activitystreams",
7974
8077
  "https://w3id.org/security/data-integrity/v1",
@@ -7978,7 +8081,23 @@ export class Announce extends Activity {
7978
8081
  "Emoji": "toot:Emoji",
7979
8082
  "Hashtag": "as:Hashtag",
7980
8083
  },
7981
- ], { documentLoader: options.contextLoader });
8084
+ ];
8085
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
8086
+ if (docContext != null) {
8087
+ // Embed context
8088
+ if ("proof" in compacted &&
8089
+ compacted.proof != null) {
8090
+ if (Array.isArray(compacted.proof)) {
8091
+ for (const element of compacted.proof) {
8092
+ element["@context"] = docContext;
8093
+ }
8094
+ }
8095
+ else {
8096
+ compacted.proof["@context"] = docContext;
8097
+ }
8098
+ }
8099
+ }
8100
+ return compacted;
7982
8101
  }
7983
8102
  /**
7984
8103
  * Converts a JSON-LD structure to an object of this type.
@@ -9447,7 +9566,7 @@ export class Application extends Object {
9447
9566
  if (options.expand) {
9448
9567
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
9449
9568
  }
9450
- return await jsonld.compact(values, options.context ??
9569
+ const docContext = options.context ??
9451
9570
  [
9452
9571
  "https://www.w3.org/ns/activitystreams",
9453
9572
  "https://w3id.org/security/v1",
@@ -9467,7 +9586,23 @@ export class Application extends Object {
9467
9586
  "PropertyValue": "schema:PropertyValue",
9468
9587
  "value": "schema:value",
9469
9588
  },
9470
- ], { documentLoader: options.contextLoader });
9589
+ ];
9590
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
9591
+ if (docContext != null) {
9592
+ // Embed context
9593
+ if ("proof" in compacted &&
9594
+ compacted.proof != null) {
9595
+ if (Array.isArray(compacted.proof)) {
9596
+ for (const element of compacted.proof) {
9597
+ element["@context"] = docContext;
9598
+ }
9599
+ }
9600
+ else {
9601
+ compacted.proof["@context"] = docContext;
9602
+ }
9603
+ }
9604
+ }
9605
+ return compacted;
9471
9606
  }
9472
9607
  /**
9473
9608
  * Converts a JSON-LD structure to an object of this type.
@@ -10062,11 +10197,27 @@ export class IntransitiveActivity extends Activity {
10062
10197
  if (options.expand) {
10063
10198
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
10064
10199
  }
10065
- return await jsonld.compact(values, options.context ??
10200
+ const docContext = options.context ??
10066
10201
  [
10067
10202
  "https://www.w3.org/ns/activitystreams",
10068
10203
  "https://w3id.org/security/data-integrity/v1",
10069
- ], { documentLoader: options.contextLoader });
10204
+ ];
10205
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
10206
+ if (docContext != null) {
10207
+ // Embed context
10208
+ if ("proof" in compacted &&
10209
+ compacted.proof != null) {
10210
+ if (Array.isArray(compacted.proof)) {
10211
+ for (const element of compacted.proof) {
10212
+ element["@context"] = docContext;
10213
+ }
10214
+ }
10215
+ else {
10216
+ compacted.proof["@context"] = docContext;
10217
+ }
10218
+ }
10219
+ }
10220
+ return compacted;
10070
10221
  }
10071
10222
  /**
10072
10223
  * Converts a JSON-LD structure to an object of this type.
@@ -10182,11 +10333,27 @@ export class Arrive extends IntransitiveActivity {
10182
10333
  if (options.expand) {
10183
10334
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
10184
10335
  }
10185
- return await jsonld.compact(values, options.context ??
10336
+ const docContext = options.context ??
10186
10337
  [
10187
10338
  "https://www.w3.org/ns/activitystreams",
10188
10339
  "https://w3id.org/security/data-integrity/v1",
10189
- ], { documentLoader: options.contextLoader });
10340
+ ];
10341
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
10342
+ if (docContext != null) {
10343
+ // Embed context
10344
+ if ("proof" in compacted &&
10345
+ compacted.proof != null) {
10346
+ if (Array.isArray(compacted.proof)) {
10347
+ for (const element of compacted.proof) {
10348
+ element["@context"] = docContext;
10349
+ }
10350
+ }
10351
+ else {
10352
+ compacted.proof["@context"] = docContext;
10353
+ }
10354
+ }
10355
+ }
10356
+ return compacted;
10190
10357
  }
10191
10358
  /**
10192
10359
  * Converts a JSON-LD structure to an object of this type.
@@ -10292,7 +10459,7 @@ export class Article extends Object {
10292
10459
  if (options.expand) {
10293
10460
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
10294
10461
  }
10295
- return await jsonld.compact(values, options.context ??
10462
+ const docContext = options.context ??
10296
10463
  [
10297
10464
  "https://www.w3.org/ns/activitystreams",
10298
10465
  "https://w3id.org/security/data-integrity/v1",
@@ -10302,7 +10469,23 @@ export class Article extends Object {
10302
10469
  "Emoji": "toot:Emoji",
10303
10470
  "Hashtag": "as:Hashtag",
10304
10471
  },
10305
- ], { documentLoader: options.contextLoader });
10472
+ ];
10473
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
10474
+ if (docContext != null) {
10475
+ // Embed context
10476
+ if ("proof" in compacted &&
10477
+ compacted.proof != null) {
10478
+ if (Array.isArray(compacted.proof)) {
10479
+ for (const element of compacted.proof) {
10480
+ element["@context"] = docContext;
10481
+ }
10482
+ }
10483
+ else {
10484
+ compacted.proof["@context"] = docContext;
10485
+ }
10486
+ }
10487
+ }
10488
+ return compacted;
10306
10489
  }
10307
10490
  /**
10308
10491
  * Converts a JSON-LD structure to an object of this type.
@@ -10494,11 +10677,27 @@ export class Document extends Object {
10494
10677
  if (options.expand) {
10495
10678
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
10496
10679
  }
10497
- return await jsonld.compact(values, options.context ??
10680
+ const docContext = options.context ??
10498
10681
  [
10499
10682
  "https://www.w3.org/ns/activitystreams",
10500
10683
  "https://w3id.org/security/data-integrity/v1",
10501
- ], { documentLoader: options.contextLoader });
10684
+ ];
10685
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
10686
+ if (docContext != null) {
10687
+ // Embed context
10688
+ if ("proof" in compacted &&
10689
+ compacted.proof != null) {
10690
+ if (Array.isArray(compacted.proof)) {
10691
+ for (const element of compacted.proof) {
10692
+ element["@context"] = docContext;
10693
+ }
10694
+ }
10695
+ else {
10696
+ compacted.proof["@context"] = docContext;
10697
+ }
10698
+ }
10699
+ }
10700
+ return compacted;
10502
10701
  }
10503
10702
  /**
10504
10703
  * Converts a JSON-LD structure to an object of this type.
@@ -10668,11 +10867,27 @@ export class Audio extends Document {
10668
10867
  if (options.expand) {
10669
10868
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
10670
10869
  }
10671
- return await jsonld.compact(values, options.context ??
10870
+ const docContext = options.context ??
10672
10871
  [
10673
10872
  "https://www.w3.org/ns/activitystreams",
10674
10873
  "https://w3id.org/security/data-integrity/v1",
10675
- ], { documentLoader: options.contextLoader });
10874
+ ];
10875
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
10876
+ if (docContext != null) {
10877
+ // Embed context
10878
+ if ("proof" in compacted &&
10879
+ compacted.proof != null) {
10880
+ if (Array.isArray(compacted.proof)) {
10881
+ for (const element of compacted.proof) {
10882
+ element["@context"] = docContext;
10883
+ }
10884
+ }
10885
+ else {
10886
+ compacted.proof["@context"] = docContext;
10887
+ }
10888
+ }
10889
+ }
10890
+ return compacted;
10676
10891
  }
10677
10892
  /**
10678
10893
  * Converts a JSON-LD structure to an object of this type.
@@ -10779,11 +10994,27 @@ export class Ignore extends Activity {
10779
10994
  if (options.expand) {
10780
10995
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
10781
10996
  }
10782
- return await jsonld.compact(values, options.context ??
10997
+ const docContext = options.context ??
10783
10998
  [
10784
10999
  "https://www.w3.org/ns/activitystreams",
10785
11000
  "https://w3id.org/security/data-integrity/v1",
10786
- ], { documentLoader: options.contextLoader });
11001
+ ];
11002
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
11003
+ if (docContext != null) {
11004
+ // Embed context
11005
+ if ("proof" in compacted &&
11006
+ compacted.proof != null) {
11007
+ if (Array.isArray(compacted.proof)) {
11008
+ for (const element of compacted.proof) {
11009
+ element["@context"] = docContext;
11010
+ }
11011
+ }
11012
+ else {
11013
+ compacted.proof["@context"] = docContext;
11014
+ }
11015
+ }
11016
+ }
11017
+ return compacted;
10787
11018
  }
10788
11019
  /**
10789
11020
  * Converts a JSON-LD structure to an object of this type.
@@ -10896,11 +11127,27 @@ export class Block extends Ignore {
10896
11127
  if (options.expand) {
10897
11128
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
10898
11129
  }
10899
- return await jsonld.compact(values, options.context ??
11130
+ const docContext = options.context ??
10900
11131
  [
10901
11132
  "https://www.w3.org/ns/activitystreams",
10902
11133
  "https://w3id.org/security/data-integrity/v1",
10903
- ], { documentLoader: options.contextLoader });
11134
+ ];
11135
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
11136
+ if (docContext != null) {
11137
+ // Embed context
11138
+ if ("proof" in compacted &&
11139
+ compacted.proof != null) {
11140
+ if (Array.isArray(compacted.proof)) {
11141
+ for (const element of compacted.proof) {
11142
+ element["@context"] = docContext;
11143
+ }
11144
+ }
11145
+ else {
11146
+ compacted.proof["@context"] = docContext;
11147
+ }
11148
+ }
11149
+ }
11150
+ return compacted;
10904
11151
  }
10905
11152
  /**
10906
11153
  * Converts a JSON-LD structure to an object of this type.
@@ -11419,7 +11666,7 @@ export class Collection extends Object {
11419
11666
  if (options.expand) {
11420
11667
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
11421
11668
  }
11422
- return await jsonld.compact(values, options.context ??
11669
+ const docContext = options.context ??
11423
11670
  [
11424
11671
  "https://www.w3.org/ns/activitystreams",
11425
11672
  "https://w3id.org/security/data-integrity/v1",
@@ -11429,7 +11676,23 @@ export class Collection extends Object {
11429
11676
  "Emoji": "toot:Emoji",
11430
11677
  "Hashtag": "as:Hashtag",
11431
11678
  },
11432
- ], { documentLoader: options.contextLoader });
11679
+ ];
11680
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
11681
+ if (docContext != null) {
11682
+ // Embed context
11683
+ if ("proof" in compacted &&
11684
+ compacted.proof != null) {
11685
+ if (Array.isArray(compacted.proof)) {
11686
+ for (const element of compacted.proof) {
11687
+ element["@context"] = docContext;
11688
+ }
11689
+ }
11690
+ else {
11691
+ compacted.proof["@context"] = docContext;
11692
+ }
11693
+ }
11694
+ }
11695
+ return compacted;
11433
11696
  }
11434
11697
  /**
11435
11698
  * Converts a JSON-LD structure to an object of this type.
@@ -12016,7 +12279,7 @@ export class CollectionPage extends Collection {
12016
12279
  if (options.expand) {
12017
12280
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
12018
12281
  }
12019
- return await jsonld.compact(values, options.context ??
12282
+ const docContext = options.context ??
12020
12283
  [
12021
12284
  "https://www.w3.org/ns/activitystreams",
12022
12285
  "https://w3id.org/security/data-integrity/v1",
@@ -12026,7 +12289,23 @@ export class CollectionPage extends Collection {
12026
12289
  "Emoji": "toot:Emoji",
12027
12290
  "Hashtag": "as:Hashtag",
12028
12291
  },
12029
- ], { documentLoader: options.contextLoader });
12292
+ ];
12293
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
12294
+ if (docContext != null) {
12295
+ // Embed context
12296
+ if ("proof" in compacted &&
12297
+ compacted.proof != null) {
12298
+ if (Array.isArray(compacted.proof)) {
12299
+ for (const element of compacted.proof) {
12300
+ element["@context"] = docContext;
12301
+ }
12302
+ }
12303
+ else {
12304
+ compacted.proof["@context"] = docContext;
12305
+ }
12306
+ }
12307
+ }
12308
+ return compacted;
12030
12309
  }
12031
12310
  /**
12032
12311
  * Converts a JSON-LD structure to an object of this type.
@@ -12224,7 +12503,7 @@ export class Create extends Activity {
12224
12503
  if (options.expand) {
12225
12504
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
12226
12505
  }
12227
- return await jsonld.compact(values, options.context ??
12506
+ const docContext = options.context ??
12228
12507
  [
12229
12508
  "https://www.w3.org/ns/activitystreams",
12230
12509
  "https://w3id.org/security/data-integrity/v1",
@@ -12234,7 +12513,23 @@ export class Create extends Activity {
12234
12513
  "Emoji": "toot:Emoji",
12235
12514
  "Hashtag": "as:Hashtag",
12236
12515
  },
12237
- ], { documentLoader: options.contextLoader });
12516
+ ];
12517
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
12518
+ if (docContext != null) {
12519
+ // Embed context
12520
+ if ("proof" in compacted &&
12521
+ compacted.proof != null) {
12522
+ if (Array.isArray(compacted.proof)) {
12523
+ for (const element of compacted.proof) {
12524
+ element["@context"] = docContext;
12525
+ }
12526
+ }
12527
+ else {
12528
+ compacted.proof["@context"] = docContext;
12529
+ }
12530
+ }
12531
+ }
12532
+ return compacted;
12238
12533
  }
12239
12534
  /**
12240
12535
  * Converts a JSON-LD structure to an object of this type.
@@ -12341,11 +12636,27 @@ export class Delete extends Activity {
12341
12636
  if (options.expand) {
12342
12637
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
12343
12638
  }
12344
- return await jsonld.compact(values, options.context ??
12639
+ const docContext = options.context ??
12345
12640
  [
12346
12641
  "https://www.w3.org/ns/activitystreams",
12347
12642
  "https://w3id.org/security/data-integrity/v1",
12348
- ], { documentLoader: options.contextLoader });
12643
+ ];
12644
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
12645
+ if (docContext != null) {
12646
+ // Embed context
12647
+ if ("proof" in compacted &&
12648
+ compacted.proof != null) {
12649
+ if (Array.isArray(compacted.proof)) {
12650
+ for (const element of compacted.proof) {
12651
+ element["@context"] = docContext;
12652
+ }
12653
+ }
12654
+ else {
12655
+ compacted.proof["@context"] = docContext;
12656
+ }
12657
+ }
12658
+ }
12659
+ return compacted;
12349
12660
  }
12350
12661
  /**
12351
12662
  * Converts a JSON-LD structure to an object of this type.
@@ -12451,11 +12762,27 @@ export class Dislike extends Activity {
12451
12762
  if (options.expand) {
12452
12763
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
12453
12764
  }
12454
- return await jsonld.compact(values, options.context ??
12765
+ const docContext = options.context ??
12455
12766
  [
12456
12767
  "https://www.w3.org/ns/activitystreams",
12457
12768
  "https://w3id.org/security/data-integrity/v1",
12458
- ], { documentLoader: options.contextLoader });
12769
+ ];
12770
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
12771
+ if (docContext != null) {
12772
+ // Embed context
12773
+ if ("proof" in compacted &&
12774
+ compacted.proof != null) {
12775
+ if (Array.isArray(compacted.proof)) {
12776
+ for (const element of compacted.proof) {
12777
+ element["@context"] = docContext;
12778
+ }
12779
+ }
12780
+ else {
12781
+ compacted.proof["@context"] = docContext;
12782
+ }
12783
+ }
12784
+ }
12785
+ return compacted;
12459
12786
  }
12460
12787
  /**
12461
12788
  * Converts a JSON-LD structure to an object of this type.
@@ -12826,7 +13153,13 @@ export class Endpoints {
12826
13153
  if (options.expand) {
12827
13154
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
12828
13155
  }
12829
- return await jsonld.compact(values, options.context ?? "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
13156
+ const docContext = options.context ??
13157
+ "https://www.w3.org/ns/activitystreams";
13158
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
13159
+ if (docContext != null) {
13160
+ // Embed context
13161
+ }
13162
+ return compacted;
12830
13163
  }
12831
13164
  /**
12832
13165
  * Converts a JSON-LD structure to an object of this type.
@@ -13079,11 +13412,27 @@ export class Event extends Object {
13079
13412
  if (options.expand) {
13080
13413
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
13081
13414
  }
13082
- return await jsonld.compact(values, options.context ??
13415
+ const docContext = options.context ??
13083
13416
  [
13084
13417
  "https://www.w3.org/ns/activitystreams",
13085
13418
  "https://w3id.org/security/data-integrity/v1",
13086
- ], { documentLoader: options.contextLoader });
13419
+ ];
13420
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
13421
+ if (docContext != null) {
13422
+ // Embed context
13423
+ if ("proof" in compacted &&
13424
+ compacted.proof != null) {
13425
+ if (Array.isArray(compacted.proof)) {
13426
+ for (const element of compacted.proof) {
13427
+ element["@context"] = docContext;
13428
+ }
13429
+ }
13430
+ else {
13431
+ compacted.proof["@context"] = docContext;
13432
+ }
13433
+ }
13434
+ }
13435
+ return compacted;
13087
13436
  }
13088
13437
  /**
13089
13438
  * Converts a JSON-LD structure to an object of this type.
@@ -13191,11 +13540,27 @@ export class Flag extends Activity {
13191
13540
  if (options.expand) {
13192
13541
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
13193
13542
  }
13194
- return await jsonld.compact(values, options.context ??
13543
+ const docContext = options.context ??
13195
13544
  [
13196
13545
  "https://www.w3.org/ns/activitystreams",
13197
13546
  "https://w3id.org/security/data-integrity/v1",
13198
- ], { documentLoader: options.contextLoader });
13547
+ ];
13548
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
13549
+ if (docContext != null) {
13550
+ // Embed context
13551
+ if ("proof" in compacted &&
13552
+ compacted.proof != null) {
13553
+ if (Array.isArray(compacted.proof)) {
13554
+ for (const element of compacted.proof) {
13555
+ element["@context"] = docContext;
13556
+ }
13557
+ }
13558
+ else {
13559
+ compacted.proof["@context"] = docContext;
13560
+ }
13561
+ }
13562
+ }
13563
+ return compacted;
13199
13564
  }
13200
13565
  /**
13201
13566
  * Converts a JSON-LD structure to an object of this type.
@@ -13304,11 +13669,27 @@ export class Follow extends Activity {
13304
13669
  if (options.expand) {
13305
13670
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
13306
13671
  }
13307
- return await jsonld.compact(values, options.context ??
13672
+ const docContext = options.context ??
13308
13673
  [
13309
13674
  "https://www.w3.org/ns/activitystreams",
13310
13675
  "https://w3id.org/security/data-integrity/v1",
13311
- ], { documentLoader: options.contextLoader });
13676
+ ];
13677
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
13678
+ if (docContext != null) {
13679
+ // Embed context
13680
+ if ("proof" in compacted &&
13681
+ compacted.proof != null) {
13682
+ if (Array.isArray(compacted.proof)) {
13683
+ for (const element of compacted.proof) {
13684
+ element["@context"] = docContext;
13685
+ }
13686
+ }
13687
+ else {
13688
+ compacted.proof["@context"] = docContext;
13689
+ }
13690
+ }
13691
+ }
13692
+ return compacted;
13312
13693
  }
13313
13694
  /**
13314
13695
  * Converts a JSON-LD structure to an object of this type.
@@ -14777,7 +15158,7 @@ export class Group extends Object {
14777
15158
  if (options.expand) {
14778
15159
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
14779
15160
  }
14780
- return await jsonld.compact(values, options.context ??
15161
+ const docContext = options.context ??
14781
15162
  [
14782
15163
  "https://www.w3.org/ns/activitystreams",
14783
15164
  "https://w3id.org/security/v1",
@@ -14797,7 +15178,23 @@ export class Group extends Object {
14797
15178
  "PropertyValue": "schema:PropertyValue",
14798
15179
  "value": "schema:value",
14799
15180
  },
14800
- ], { documentLoader: options.contextLoader });
15181
+ ];
15182
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
15183
+ if (docContext != null) {
15184
+ // Embed context
15185
+ if ("proof" in compacted &&
15186
+ compacted.proof != null) {
15187
+ if (Array.isArray(compacted.proof)) {
15188
+ for (const element of compacted.proof) {
15189
+ element["@context"] = docContext;
15190
+ }
15191
+ }
15192
+ else {
15193
+ compacted.proof["@context"] = docContext;
15194
+ }
15195
+ }
15196
+ }
15197
+ return compacted;
14801
15198
  }
14802
15199
  /**
14803
15200
  * Converts a JSON-LD structure to an object of this type.
@@ -15870,7 +16267,13 @@ export class Link {
15870
16267
  if (options.expand) {
15871
16268
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
15872
16269
  }
15873
- return await jsonld.compact(values, options.context ?? "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
16270
+ const docContext = options.context ??
16271
+ "https://www.w3.org/ns/activitystreams";
16272
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
16273
+ if (docContext != null) {
16274
+ // Embed context
16275
+ }
16276
+ return compacted;
15874
16277
  }
15875
16278
  /**
15876
16279
  * Converts a JSON-LD structure to an object of this type.
@@ -16272,8 +16675,13 @@ export class Hashtag extends Link {
16272
16675
  if (options.expand) {
16273
16676
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
16274
16677
  }
16275
- return await jsonld.compact(values, options.context ??
16276
- ["https://www.w3.org/ns/activitystreams", { "Hashtag": "as:Hashtag" }], { documentLoader: options.contextLoader });
16678
+ const docContext = options.context ??
16679
+ ["https://www.w3.org/ns/activitystreams", { "Hashtag": "as:Hashtag" }];
16680
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
16681
+ if (docContext != null) {
16682
+ // Embed context
16683
+ }
16684
+ return compacted;
16277
16685
  }
16278
16686
  /**
16279
16687
  * Converts a JSON-LD structure to an object of this type.
@@ -16379,7 +16787,24 @@ export class Image extends Document {
16379
16787
  if (options.expand) {
16380
16788
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
16381
16789
  }
16382
- return await jsonld.compact(values, options.context ?? "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
16790
+ const docContext = options.context ??
16791
+ "https://www.w3.org/ns/activitystreams";
16792
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
16793
+ if (docContext != null) {
16794
+ // Embed context
16795
+ if ("proof" in compacted &&
16796
+ compacted.proof != null) {
16797
+ if (Array.isArray(compacted.proof)) {
16798
+ for (const element of compacted.proof) {
16799
+ element["@context"] = docContext;
16800
+ }
16801
+ }
16802
+ else {
16803
+ compacted.proof["@context"] = docContext;
16804
+ }
16805
+ }
16806
+ }
16807
+ return compacted;
16383
16808
  }
16384
16809
  /**
16385
16810
  * Converts a JSON-LD structure to an object of this type.
@@ -16487,11 +16912,27 @@ export class Offer extends Activity {
16487
16912
  if (options.expand) {
16488
16913
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
16489
16914
  }
16490
- return await jsonld.compact(values, options.context ??
16915
+ const docContext = options.context ??
16491
16916
  [
16492
16917
  "https://www.w3.org/ns/activitystreams",
16493
16918
  "https://w3id.org/security/data-integrity/v1",
16494
- ], { documentLoader: options.contextLoader });
16919
+ ];
16920
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
16921
+ if (docContext != null) {
16922
+ // Embed context
16923
+ if ("proof" in compacted &&
16924
+ compacted.proof != null) {
16925
+ if (Array.isArray(compacted.proof)) {
16926
+ for (const element of compacted.proof) {
16927
+ element["@context"] = docContext;
16928
+ }
16929
+ }
16930
+ else {
16931
+ compacted.proof["@context"] = docContext;
16932
+ }
16933
+ }
16934
+ }
16935
+ return compacted;
16495
16936
  }
16496
16937
  /**
16497
16938
  * Converts a JSON-LD structure to an object of this type.
@@ -16602,11 +17043,27 @@ export class Invite extends Offer {
16602
17043
  if (options.expand) {
16603
17044
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
16604
17045
  }
16605
- return await jsonld.compact(values, options.context ??
17046
+ const docContext = options.context ??
16606
17047
  [
16607
17048
  "https://www.w3.org/ns/activitystreams",
16608
17049
  "https://w3id.org/security/data-integrity/v1",
16609
- ], { documentLoader: options.contextLoader });
17050
+ ];
17051
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
17052
+ if (docContext != null) {
17053
+ // Embed context
17054
+ if ("proof" in compacted &&
17055
+ compacted.proof != null) {
17056
+ if (Array.isArray(compacted.proof)) {
17057
+ for (const element of compacted.proof) {
17058
+ element["@context"] = docContext;
17059
+ }
17060
+ }
17061
+ else {
17062
+ compacted.proof["@context"] = docContext;
17063
+ }
17064
+ }
17065
+ }
17066
+ return compacted;
16610
17067
  }
16611
17068
  /**
16612
17069
  * Converts a JSON-LD structure to an object of this type.
@@ -16713,11 +17170,27 @@ export class Join extends Activity {
16713
17170
  if (options.expand) {
16714
17171
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
16715
17172
  }
16716
- return await jsonld.compact(values, options.context ??
17173
+ const docContext = options.context ??
16717
17174
  [
16718
17175
  "https://www.w3.org/ns/activitystreams",
16719
17176
  "https://w3id.org/security/data-integrity/v1",
16720
- ], { documentLoader: options.contextLoader });
17177
+ ];
17178
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
17179
+ if (docContext != null) {
17180
+ // Embed context
17181
+ if ("proof" in compacted &&
17182
+ compacted.proof != null) {
17183
+ if (Array.isArray(compacted.proof)) {
17184
+ for (const element of compacted.proof) {
17185
+ element["@context"] = docContext;
17186
+ }
17187
+ }
17188
+ else {
17189
+ compacted.proof["@context"] = docContext;
17190
+ }
17191
+ }
17192
+ }
17193
+ return compacted;
16721
17194
  }
16722
17195
  /**
16723
17196
  * Converts a JSON-LD structure to an object of this type.
@@ -16824,11 +17297,27 @@ export class Leave extends Activity {
16824
17297
  if (options.expand) {
16825
17298
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
16826
17299
  }
16827
- return await jsonld.compact(values, options.context ??
17300
+ const docContext = options.context ??
16828
17301
  [
16829
17302
  "https://www.w3.org/ns/activitystreams",
16830
17303
  "https://w3id.org/security/data-integrity/v1",
16831
- ], { documentLoader: options.contextLoader });
17304
+ ];
17305
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
17306
+ if (docContext != null) {
17307
+ // Embed context
17308
+ if ("proof" in compacted &&
17309
+ compacted.proof != null) {
17310
+ if (Array.isArray(compacted.proof)) {
17311
+ for (const element of compacted.proof) {
17312
+ element["@context"] = docContext;
17313
+ }
17314
+ }
17315
+ else {
17316
+ compacted.proof["@context"] = docContext;
17317
+ }
17318
+ }
17319
+ }
17320
+ return compacted;
16832
17321
  }
16833
17322
  /**
16834
17323
  * Converts a JSON-LD structure to an object of this type.
@@ -16935,11 +17424,27 @@ export class Like extends Activity {
16935
17424
  if (options.expand) {
16936
17425
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
16937
17426
  }
16938
- return await jsonld.compact(values, options.context ??
17427
+ const docContext = options.context ??
16939
17428
  [
16940
17429
  "https://www.w3.org/ns/activitystreams",
16941
17430
  "https://w3id.org/security/data-integrity/v1",
16942
- ], { documentLoader: options.contextLoader });
17431
+ ];
17432
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
17433
+ if (docContext != null) {
17434
+ // Embed context
17435
+ if ("proof" in compacted &&
17436
+ compacted.proof != null) {
17437
+ if (Array.isArray(compacted.proof)) {
17438
+ for (const element of compacted.proof) {
17439
+ element["@context"] = docContext;
17440
+ }
17441
+ }
17442
+ else {
17443
+ compacted.proof["@context"] = docContext;
17444
+ }
17445
+ }
17446
+ }
17447
+ return compacted;
16943
17448
  }
16944
17449
  /**
16945
17450
  * Converts a JSON-LD structure to an object of this type.
@@ -17045,11 +17550,27 @@ export class Listen extends Activity {
17045
17550
  if (options.expand) {
17046
17551
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
17047
17552
  }
17048
- return await jsonld.compact(values, options.context ??
17553
+ const docContext = options.context ??
17049
17554
  [
17050
17555
  "https://www.w3.org/ns/activitystreams",
17051
17556
  "https://w3id.org/security/data-integrity/v1",
17052
- ], { documentLoader: options.contextLoader });
17557
+ ];
17558
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
17559
+ if (docContext != null) {
17560
+ // Embed context
17561
+ if ("proof" in compacted &&
17562
+ compacted.proof != null) {
17563
+ if (Array.isArray(compacted.proof)) {
17564
+ for (const element of compacted.proof) {
17565
+ element["@context"] = docContext;
17566
+ }
17567
+ }
17568
+ else {
17569
+ compacted.proof["@context"] = docContext;
17570
+ }
17571
+ }
17572
+ }
17573
+ return compacted;
17053
17574
  }
17054
17575
  /**
17055
17576
  * Converts a JSON-LD structure to an object of this type.
@@ -17155,7 +17676,13 @@ export class Mention extends Link {
17155
17676
  if (options.expand) {
17156
17677
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
17157
17678
  }
17158
- return await jsonld.compact(values, options.context ?? "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
17679
+ const docContext = options.context ??
17680
+ "https://www.w3.org/ns/activitystreams";
17681
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
17682
+ if (docContext != null) {
17683
+ // Embed context
17684
+ }
17685
+ return compacted;
17159
17686
  }
17160
17687
  /**
17161
17688
  * Converts a JSON-LD structure to an object of this type.
@@ -17262,7 +17789,7 @@ export class Note extends Object {
17262
17789
  if (options.expand) {
17263
17790
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
17264
17791
  }
17265
- return await jsonld.compact(values, options.context ??
17792
+ const docContext = options.context ??
17266
17793
  [
17267
17794
  "https://www.w3.org/ns/activitystreams",
17268
17795
  "https://w3id.org/security/data-integrity/v1",
@@ -17272,7 +17799,23 @@ export class Note extends Object {
17272
17799
  "Emoji": "toot:Emoji",
17273
17800
  "Hashtag": "as:Hashtag",
17274
17801
  },
17275
- ], { documentLoader: options.contextLoader });
17802
+ ];
17803
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
17804
+ if (docContext != null) {
17805
+ // Embed context
17806
+ if ("proof" in compacted &&
17807
+ compacted.proof != null) {
17808
+ if (Array.isArray(compacted.proof)) {
17809
+ for (const element of compacted.proof) {
17810
+ element["@context"] = docContext;
17811
+ }
17812
+ }
17813
+ else {
17814
+ compacted.proof["@context"] = docContext;
17815
+ }
17816
+ }
17817
+ }
17818
+ return compacted;
17276
17819
  }
17277
17820
  /**
17278
17821
  * Converts a JSON-LD structure to an object of this type.
@@ -17482,7 +18025,7 @@ export class OrderedCollection extends Collection {
17482
18025
  if (options.expand) {
17483
18026
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
17484
18027
  }
17485
- return await jsonld.compact(values, options.context ??
18028
+ const docContext = options.context ??
17486
18029
  [
17487
18030
  "https://www.w3.org/ns/activitystreams",
17488
18031
  "https://w3id.org/security/data-integrity/v1",
@@ -17492,7 +18035,23 @@ export class OrderedCollection extends Collection {
17492
18035
  "Emoji": "toot:Emoji",
17493
18036
  "Hashtag": "as:Hashtag",
17494
18037
  },
17495
- ], { documentLoader: options.contextLoader });
18038
+ ];
18039
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
18040
+ if (docContext != null) {
18041
+ // Embed context
18042
+ if ("proof" in compacted &&
18043
+ compacted.proof != null) {
18044
+ if (Array.isArray(compacted.proof)) {
18045
+ for (const element of compacted.proof) {
18046
+ element["@context"] = docContext;
18047
+ }
18048
+ }
18049
+ else {
18050
+ compacted.proof["@context"] = docContext;
18051
+ }
18052
+ }
18053
+ }
18054
+ return compacted;
17496
18055
  }
17497
18056
  /**
17498
18057
  * Converts a JSON-LD structure to an object of this type.
@@ -17840,7 +18399,7 @@ export class OrderedCollectionPage extends CollectionPage {
17840
18399
  if (options.expand) {
17841
18400
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
17842
18401
  }
17843
- return await jsonld.compact(values, options.context ??
18402
+ const docContext = options.context ??
17844
18403
  [
17845
18404
  "https://www.w3.org/ns/activitystreams",
17846
18405
  "https://w3id.org/security/data-integrity/v1",
@@ -17850,7 +18409,23 @@ export class OrderedCollectionPage extends CollectionPage {
17850
18409
  "Emoji": "toot:Emoji",
17851
18410
  "Hashtag": "as:Hashtag",
17852
18411
  },
17853
- ], { documentLoader: options.contextLoader });
18412
+ ];
18413
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
18414
+ if (docContext != null) {
18415
+ // Embed context
18416
+ if ("proof" in compacted &&
18417
+ compacted.proof != null) {
18418
+ if (Array.isArray(compacted.proof)) {
18419
+ for (const element of compacted.proof) {
18420
+ element["@context"] = docContext;
18421
+ }
18422
+ }
18423
+ else {
18424
+ compacted.proof["@context"] = docContext;
18425
+ }
18426
+ }
18427
+ }
18428
+ return compacted;
17854
18429
  }
17855
18430
  /**
17856
18431
  * Converts a JSON-LD structure to an object of this type.
@@ -19437,7 +20012,7 @@ export class Organization extends Object {
19437
20012
  if (options.expand) {
19438
20013
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
19439
20014
  }
19440
- return await jsonld.compact(values, options.context ??
20015
+ const docContext = options.context ??
19441
20016
  [
19442
20017
  "https://www.w3.org/ns/activitystreams",
19443
20018
  "https://w3id.org/security/v1",
@@ -19457,7 +20032,23 @@ export class Organization extends Object {
19457
20032
  "PropertyValue": "schema:PropertyValue",
19458
20033
  "value": "schema:value",
19459
20034
  },
19460
- ], { documentLoader: options.contextLoader });
20035
+ ];
20036
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
20037
+ if (docContext != null) {
20038
+ // Embed context
20039
+ if ("proof" in compacted &&
20040
+ compacted.proof != null) {
20041
+ if (Array.isArray(compacted.proof)) {
20042
+ for (const element of compacted.proof) {
20043
+ element["@context"] = docContext;
20044
+ }
20045
+ }
20046
+ else {
20047
+ compacted.proof["@context"] = docContext;
20048
+ }
20049
+ }
20050
+ }
20051
+ return compacted;
19461
20052
  }
19462
20053
  /**
19463
20054
  * Converts a JSON-LD structure to an object of this type.
@@ -20048,11 +20639,27 @@ export class Page extends Document {
20048
20639
  if (options.expand) {
20049
20640
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
20050
20641
  }
20051
- return await jsonld.compact(values, options.context ??
20642
+ const docContext = options.context ??
20052
20643
  [
20053
20644
  "https://www.w3.org/ns/activitystreams",
20054
20645
  "https://w3id.org/security/data-integrity/v1",
20055
- ], { documentLoader: options.contextLoader });
20646
+ ];
20647
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
20648
+ if (docContext != null) {
20649
+ // Embed context
20650
+ if ("proof" in compacted &&
20651
+ compacted.proof != null) {
20652
+ if (Array.isArray(compacted.proof)) {
20653
+ for (const element of compacted.proof) {
20654
+ element["@context"] = docContext;
20655
+ }
20656
+ }
20657
+ else {
20658
+ compacted.proof["@context"] = docContext;
20659
+ }
20660
+ }
20661
+ }
20662
+ return compacted;
20056
20663
  }
20057
20664
  /**
20058
20665
  * Converts a JSON-LD structure to an object of this type.
@@ -21521,7 +22128,7 @@ export class Person extends Object {
21521
22128
  if (options.expand) {
21522
22129
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
21523
22130
  }
21524
- return await jsonld.compact(values, options.context ??
22131
+ const docContext = options.context ??
21525
22132
  [
21526
22133
  "https://www.w3.org/ns/activitystreams",
21527
22134
  "https://w3id.org/security/v1",
@@ -21541,7 +22148,23 @@ export class Person extends Object {
21541
22148
  "PropertyValue": "schema:PropertyValue",
21542
22149
  "value": "schema:value",
21543
22150
  },
21544
- ], { documentLoader: options.contextLoader });
22151
+ ];
22152
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
22153
+ if (docContext != null) {
22154
+ // Embed context
22155
+ if ("proof" in compacted &&
22156
+ compacted.proof != null) {
22157
+ if (Array.isArray(compacted.proof)) {
22158
+ for (const element of compacted.proof) {
22159
+ element["@context"] = docContext;
22160
+ }
22161
+ }
22162
+ else {
22163
+ compacted.proof["@context"] = docContext;
22164
+ }
22165
+ }
22166
+ }
22167
+ return compacted;
21545
22168
  }
21546
22169
  /**
21547
22170
  * Converts a JSON-LD structure to an object of this type.
@@ -22388,11 +23011,27 @@ export class Place extends Object {
22388
23011
  if (options.expand) {
22389
23012
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
22390
23013
  }
22391
- return await jsonld.compact(values, options.context ??
23014
+ const docContext = options.context ??
22392
23015
  [
22393
23016
  "https://www.w3.org/ns/activitystreams",
22394
23017
  "https://w3id.org/security/data-integrity/v1",
22395
- ], { documentLoader: options.contextLoader });
23018
+ ];
23019
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
23020
+ if (docContext != null) {
23021
+ // Embed context
23022
+ if ("proof" in compacted &&
23023
+ compacted.proof != null) {
23024
+ if (Array.isArray(compacted.proof)) {
23025
+ for (const element of compacted.proof) {
23026
+ element["@context"] = docContext;
23027
+ }
23028
+ }
23029
+ else {
23030
+ compacted.proof["@context"] = docContext;
23031
+ }
23032
+ }
23033
+ }
23034
+ return compacted;
22396
23035
  }
22397
23036
  /**
22398
23037
  * Converts a JSON-LD structure to an object of this type.
@@ -22745,11 +23384,27 @@ export class Profile extends Object {
22745
23384
  if (options.expand) {
22746
23385
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
22747
23386
  }
22748
- return await jsonld.compact(values, options.context ??
23387
+ const docContext = options.context ??
22749
23388
  [
22750
23389
  "https://www.w3.org/ns/activitystreams",
22751
23390
  "https://w3id.org/security/data-integrity/v1",
22752
- ], { documentLoader: options.contextLoader });
23391
+ ];
23392
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
23393
+ if (docContext != null) {
23394
+ // Embed context
23395
+ if ("proof" in compacted &&
23396
+ compacted.proof != null) {
23397
+ if (Array.isArray(compacted.proof)) {
23398
+ for (const element of compacted.proof) {
23399
+ element["@context"] = docContext;
23400
+ }
23401
+ }
23402
+ else {
23403
+ compacted.proof["@context"] = docContext;
23404
+ }
23405
+ }
23406
+ }
23407
+ return compacted;
22753
23408
  }
22754
23409
  /**
22755
23410
  * Converts a JSON-LD structure to an object of this type.
@@ -23066,7 +23721,7 @@ export class Question extends IntransitiveActivity {
23066
23721
  if (options.expand) {
23067
23722
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
23068
23723
  }
23069
- return await jsonld.compact(values, options.context ??
23724
+ const docContext = options.context ??
23070
23725
  [
23071
23726
  "https://www.w3.org/ns/activitystreams",
23072
23727
  "https://w3id.org/security/data-integrity/v1",
@@ -23076,7 +23731,23 @@ export class Question extends IntransitiveActivity {
23076
23731
  "Emoji": "toot:Emoji",
23077
23732
  "Hashtag": "as:Hashtag",
23078
23733
  },
23079
- ], { documentLoader: options.contextLoader });
23734
+ ];
23735
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
23736
+ if (docContext != null) {
23737
+ // Embed context
23738
+ if ("proof" in compacted &&
23739
+ compacted.proof != null) {
23740
+ if (Array.isArray(compacted.proof)) {
23741
+ for (const element of compacted.proof) {
23742
+ element["@context"] = docContext;
23743
+ }
23744
+ }
23745
+ else {
23746
+ compacted.proof["@context"] = docContext;
23747
+ }
23748
+ }
23749
+ }
23750
+ return compacted;
23080
23751
  }
23081
23752
  /**
23082
23753
  * Converts a JSON-LD structure to an object of this type.
@@ -23245,11 +23916,27 @@ export class Reject extends Activity {
23245
23916
  if (options.expand) {
23246
23917
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
23247
23918
  }
23248
- return await jsonld.compact(values, options.context ??
23919
+ const docContext = options.context ??
23249
23920
  [
23250
23921
  "https://www.w3.org/ns/activitystreams",
23251
23922
  "https://w3id.org/security/data-integrity/v1",
23252
- ], { documentLoader: options.contextLoader });
23923
+ ];
23924
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
23925
+ if (docContext != null) {
23926
+ // Embed context
23927
+ if ("proof" in compacted &&
23928
+ compacted.proof != null) {
23929
+ if (Array.isArray(compacted.proof)) {
23930
+ for (const element of compacted.proof) {
23931
+ element["@context"] = docContext;
23932
+ }
23933
+ }
23934
+ else {
23935
+ compacted.proof["@context"] = docContext;
23936
+ }
23937
+ }
23938
+ }
23939
+ return compacted;
23253
23940
  }
23254
23941
  /**
23255
23942
  * Converts a JSON-LD structure to an object of this type.
@@ -23745,11 +24432,27 @@ export class Relationship extends Object {
23745
24432
  if (options.expand) {
23746
24433
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
23747
24434
  }
23748
- return await jsonld.compact(values, options.context ??
24435
+ const docContext = options.context ??
23749
24436
  [
23750
24437
  "https://www.w3.org/ns/activitystreams",
23751
24438
  "https://w3id.org/security/data-integrity/v1",
23752
- ], { documentLoader: options.contextLoader });
24439
+ ];
24440
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
24441
+ if (docContext != null) {
24442
+ // Embed context
24443
+ if ("proof" in compacted &&
24444
+ compacted.proof != null) {
24445
+ if (Array.isArray(compacted.proof)) {
24446
+ for (const element of compacted.proof) {
24447
+ element["@context"] = docContext;
24448
+ }
24449
+ }
24450
+ else {
24451
+ compacted.proof["@context"] = docContext;
24452
+ }
24453
+ }
24454
+ }
24455
+ return compacted;
23753
24456
  }
23754
24457
  /**
23755
24458
  * Converts a JSON-LD structure to an object of this type.
@@ -23953,11 +24656,27 @@ export class Remove extends Activity {
23953
24656
  if (options.expand) {
23954
24657
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
23955
24658
  }
23956
- return await jsonld.compact(values, options.context ??
24659
+ const docContext = options.context ??
23957
24660
  [
23958
24661
  "https://www.w3.org/ns/activitystreams",
23959
24662
  "https://w3id.org/security/data-integrity/v1",
23960
- ], { documentLoader: options.contextLoader });
24663
+ ];
24664
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
24665
+ if (docContext != null) {
24666
+ // Embed context
24667
+ if ("proof" in compacted &&
24668
+ compacted.proof != null) {
24669
+ if (Array.isArray(compacted.proof)) {
24670
+ for (const element of compacted.proof) {
24671
+ element["@context"] = docContext;
24672
+ }
24673
+ }
24674
+ else {
24675
+ compacted.proof["@context"] = docContext;
24676
+ }
24677
+ }
24678
+ }
24679
+ return compacted;
23961
24680
  }
23962
24681
  /**
23963
24682
  * Converts a JSON-LD structure to an object of this type.
@@ -25426,7 +26145,7 @@ export class Service extends Object {
25426
26145
  if (options.expand) {
25427
26146
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
25428
26147
  }
25429
- return await jsonld.compact(values, options.context ??
26148
+ const docContext = options.context ??
25430
26149
  [
25431
26150
  "https://www.w3.org/ns/activitystreams",
25432
26151
  "https://w3id.org/security/v1",
@@ -25446,7 +26165,23 @@ export class Service extends Object {
25446
26165
  "PropertyValue": "schema:PropertyValue",
25447
26166
  "value": "schema:value",
25448
26167
  },
25449
- ], { documentLoader: options.contextLoader });
26168
+ ];
26169
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
26170
+ if (docContext != null) {
26171
+ // Embed context
26172
+ if ("proof" in compacted &&
26173
+ compacted.proof != null) {
26174
+ if (Array.isArray(compacted.proof)) {
26175
+ for (const element of compacted.proof) {
26176
+ element["@context"] = docContext;
26177
+ }
26178
+ }
26179
+ else {
26180
+ compacted.proof["@context"] = docContext;
26181
+ }
26182
+ }
26183
+ }
26184
+ return compacted;
25450
26185
  }
25451
26186
  /**
25452
26187
  * Converts a JSON-LD structure to an object of this type.
@@ -26080,11 +26815,27 @@ export class Tombstone extends Object {
26080
26815
  if (options.expand) {
26081
26816
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
26082
26817
  }
26083
- return await jsonld.compact(values, options.context ??
26818
+ const docContext = options.context ??
26084
26819
  [
26085
26820
  "https://www.w3.org/ns/activitystreams",
26086
26821
  "https://w3id.org/security/data-integrity/v1",
26087
- ], { documentLoader: options.contextLoader });
26822
+ ];
26823
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
26824
+ if (docContext != null) {
26825
+ // Embed context
26826
+ if ("proof" in compacted &&
26827
+ compacted.proof != null) {
26828
+ if (Array.isArray(compacted.proof)) {
26829
+ for (const element of compacted.proof) {
26830
+ element["@context"] = docContext;
26831
+ }
26832
+ }
26833
+ else {
26834
+ compacted.proof["@context"] = docContext;
26835
+ }
26836
+ }
26837
+ }
26838
+ return compacted;
26088
26839
  }
26089
26840
  /**
26090
26841
  * Converts a JSON-LD structure to an object of this type.
@@ -26220,11 +26971,27 @@ export class Undo extends Activity {
26220
26971
  if (options.expand) {
26221
26972
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
26222
26973
  }
26223
- return await jsonld.compact(values, options.context ??
26974
+ const docContext = options.context ??
26224
26975
  [
26225
26976
  "https://www.w3.org/ns/activitystreams",
26226
26977
  "https://w3id.org/security/data-integrity/v1",
26227
- ], { documentLoader: options.contextLoader });
26978
+ ];
26979
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
26980
+ if (docContext != null) {
26981
+ // Embed context
26982
+ if ("proof" in compacted &&
26983
+ compacted.proof != null) {
26984
+ if (Array.isArray(compacted.proof)) {
26985
+ for (const element of compacted.proof) {
26986
+ element["@context"] = docContext;
26987
+ }
26988
+ }
26989
+ else {
26990
+ compacted.proof["@context"] = docContext;
26991
+ }
26992
+ }
26993
+ }
26994
+ return compacted;
26228
26995
  }
26229
26996
  /**
26230
26997
  * Converts a JSON-LD structure to an object of this type.
@@ -26334,7 +27101,7 @@ export class Update extends Activity {
26334
27101
  if (options.expand) {
26335
27102
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
26336
27103
  }
26337
- return await jsonld.compact(values, options.context ??
27104
+ const docContext = options.context ??
26338
27105
  [
26339
27106
  "https://www.w3.org/ns/activitystreams",
26340
27107
  "https://w3id.org/security/data-integrity/v1",
@@ -26344,7 +27111,23 @@ export class Update extends Activity {
26344
27111
  "Emoji": "toot:Emoji",
26345
27112
  "Hashtag": "as:Hashtag",
26346
27113
  },
26347
- ], { documentLoader: options.contextLoader });
27114
+ ];
27115
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
27116
+ if (docContext != null) {
27117
+ // Embed context
27118
+ if ("proof" in compacted &&
27119
+ compacted.proof != null) {
27120
+ if (Array.isArray(compacted.proof)) {
27121
+ for (const element of compacted.proof) {
27122
+ element["@context"] = docContext;
27123
+ }
27124
+ }
27125
+ else {
27126
+ compacted.proof["@context"] = docContext;
27127
+ }
27128
+ }
27129
+ }
27130
+ return compacted;
26348
27131
  }
26349
27132
  /**
26350
27133
  * Converts a JSON-LD structure to an object of this type.
@@ -26450,11 +27233,27 @@ export class Video extends Document {
26450
27233
  if (options.expand) {
26451
27234
  return await jsonld.expand(values, { documentLoader: options.contextLoader });
26452
27235
  }
26453
- return await jsonld.compact(values, options.context ??
27236
+ const docContext = options.context ??
26454
27237
  [
26455
27238
  "https://www.w3.org/ns/activitystreams",
26456
27239
  "https://w3id.org/security/data-integrity/v1",
26457
- ], { documentLoader: options.contextLoader });
27240
+ ];
27241
+ const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
27242
+ if (docContext != null) {
27243
+ // Embed context
27244
+ if ("proof" in compacted &&
27245
+ compacted.proof != null) {
27246
+ if (Array.isArray(compacted.proof)) {
27247
+ for (const element of compacted.proof) {
27248
+ element["@context"] = docContext;
27249
+ }
27250
+ }
27251
+ else {
27252
+ compacted.proof["@context"] = docContext;
27253
+ }
27254
+ }
27255
+ }
27256
+ return compacted;
26458
27257
  }
26459
27258
  /**
26460
27259
  * Converts a JSON-LD structure to an object of this type.