@fedify/fedify 0.15.7 → 0.15.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -10029,24 +10029,27 @@ export class Application extends Object {
10029
10029
  }
10030
10030
  }
10031
10031
  if ("inbox" in values && values.inbox != null) {
10032
- if (values.inbox instanceof OrderedCollection || values.inbox instanceof URL) {
10032
+ if (values.inbox instanceof OrderedCollection ||
10033
+ values.inbox instanceof OrderedCollectionPage ||
10034
+ values.inbox instanceof URL) {
10033
10035
  // @ts-ignore: type is checked above.
10034
10036
  this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = [values.inbox];
10035
10037
  }
10036
10038
  else {
10037
10039
  throw new TypeError("The inbox must be of type " +
10038
- "OrderedCollection | URL" + ".");
10040
+ "OrderedCollection | OrderedCollectionPage | URL" + ".");
10039
10041
  }
10040
10042
  }
10041
10043
  if ("outbox" in values && values.outbox != null) {
10042
10044
  if (values.outbox instanceof OrderedCollection ||
10045
+ values.outbox instanceof OrderedCollectionPage ||
10043
10046
  values.outbox instanceof URL) {
10044
10047
  // @ts-ignore: type is checked above.
10045
10048
  this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = [values.outbox];
10046
10049
  }
10047
10050
  else {
10048
10051
  throw new TypeError("The outbox must be of type " +
10049
- "OrderedCollection | URL" + ".");
10052
+ "OrderedCollection | OrderedCollectionPage | URL" + ".");
10050
10053
  }
10051
10054
  }
10052
10055
  if ("following" in values && values.following != null) {
@@ -10316,26 +10319,29 @@ export class Application extends Object {
10316
10319
  clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox =
10317
10320
  this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox;
10318
10321
  if ("inbox" in values && values.inbox != null) {
10319
- if (values.inbox instanceof OrderedCollection || values.inbox instanceof URL) {
10322
+ if (values.inbox instanceof OrderedCollection ||
10323
+ values.inbox instanceof OrderedCollectionPage ||
10324
+ values.inbox instanceof URL) {
10320
10325
  // @ts-ignore: type is checked above.
10321
10326
  clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = [values.inbox];
10322
10327
  }
10323
10328
  else {
10324
10329
  throw new TypeError("The inbox must be of type " +
10325
- "OrderedCollection | URL" + ".");
10330
+ "OrderedCollection | OrderedCollectionPage | URL" + ".");
10326
10331
  }
10327
10332
  }
10328
10333
  clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox =
10329
10334
  this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox;
10330
10335
  if ("outbox" in values && values.outbox != null) {
10331
10336
  if (values.outbox instanceof OrderedCollection ||
10337
+ values.outbox instanceof OrderedCollectionPage ||
10332
10338
  values.outbox instanceof URL) {
10333
10339
  // @ts-ignore: type is checked above.
10334
10340
  clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = [values.outbox];
10335
10341
  }
10336
10342
  else {
10337
10343
  throw new TypeError("The outbox must be of type " +
10338
- "OrderedCollection | URL" + ".");
10344
+ "OrderedCollection | OrderedCollectionPage | URL" + ".");
10339
10345
  }
10340
10346
  }
10341
10347
  clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following =
@@ -10732,8 +10738,18 @@ export class Application extends Object {
10732
10738
  if (!(e instanceof TypeError))
10733
10739
  throw e;
10734
10740
  }
10741
+ try {
10742
+ return await OrderedCollectionPage.fromJsonLd(document, { documentLoader, contextLoader });
10743
+ }
10744
+ catch (e) {
10745
+ if (!(e instanceof TypeError))
10746
+ throw e;
10747
+ }
10735
10748
  throw new TypeError("Expected an object of any type of: " +
10736
- ["https://www.w3.org/ns/activitystreams#OrderedCollection"].join(", "));
10749
+ [
10750
+ "https://www.w3.org/ns/activitystreams#OrderedCollection",
10751
+ "https://www.w3.org/ns/activitystreams#OrderedCollectionPage",
10752
+ ].join(", "));
10737
10753
  }
10738
10754
  /**
10739
10755
  * Similar to
@@ -10799,8 +10815,18 @@ export class Application extends Object {
10799
10815
  if (!(e instanceof TypeError))
10800
10816
  throw e;
10801
10817
  }
10818
+ try {
10819
+ return await OrderedCollectionPage.fromJsonLd(document, { documentLoader, contextLoader });
10820
+ }
10821
+ catch (e) {
10822
+ if (!(e instanceof TypeError))
10823
+ throw e;
10824
+ }
10802
10825
  throw new TypeError("Expected an object of any type of: " +
10803
- ["https://www.w3.org/ns/activitystreams#OrderedCollection"].join(", "));
10826
+ [
10827
+ "https://www.w3.org/ns/activitystreams#OrderedCollection",
10828
+ "https://www.w3.org/ns/activitystreams#OrderedCollectionPage",
10829
+ ].join(", "));
10804
10830
  }
10805
10831
  /**
10806
10832
  * Similar to
@@ -11435,11 +11461,19 @@ export class Application extends Object {
11435
11461
  }
11436
11462
  compactItems = [];
11437
11463
  for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) {
11438
- const item = v instanceof URL ? v.href : await v.toJsonLd({
11439
- ...options,
11440
- format: undefined,
11441
- context: undefined,
11442
- });
11464
+ const item = v instanceof URL
11465
+ ? v.href
11466
+ : v instanceof OrderedCollection
11467
+ ? await v.toJsonLd({
11468
+ ...options,
11469
+ format: undefined,
11470
+ context: undefined,
11471
+ })
11472
+ : await v.toJsonLd({
11473
+ ...options,
11474
+ format: undefined,
11475
+ context: undefined,
11476
+ });
11443
11477
  compactItems.push(item);
11444
11478
  }
11445
11479
  if (compactItems.length > 0) {
@@ -11449,11 +11483,19 @@ export class Application extends Object {
11449
11483
  }
11450
11484
  compactItems = [];
11451
11485
  for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) {
11452
- const item = v instanceof URL ? v.href : await v.toJsonLd({
11453
- ...options,
11454
- format: undefined,
11455
- context: undefined,
11456
- });
11486
+ const item = v instanceof URL
11487
+ ? v.href
11488
+ : v instanceof OrderedCollection
11489
+ ? await v.toJsonLd({
11490
+ ...options,
11491
+ format: undefined,
11492
+ context: undefined,
11493
+ })
11494
+ : await v.toJsonLd({
11495
+ ...options,
11496
+ format: undefined,
11497
+ context: undefined,
11498
+ });
11457
11499
  compactItems.push(item);
11458
11500
  }
11459
11501
  if (compactItems.length > 0) {
@@ -11720,7 +11762,9 @@ export class Application extends Object {
11720
11762
  for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) {
11721
11763
  const element = v instanceof URL
11722
11764
  ? { "@id": v.href }
11723
- : await v.toJsonLd(options);
11765
+ : v instanceof OrderedCollection
11766
+ ? await v.toJsonLd(options)
11767
+ : await v.toJsonLd(options);
11724
11768
  array.push(element);
11725
11769
  }
11726
11770
  if (array.length > 0) {
@@ -11731,7 +11775,9 @@ export class Application extends Object {
11731
11775
  for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) {
11732
11776
  const element = v instanceof URL
11733
11777
  ? { "@id": v.href }
11734
- : await v.toJsonLd(options);
11778
+ : v instanceof OrderedCollection
11779
+ ? await v.toJsonLd(options)
11780
+ : await v.toJsonLd(options);
11735
11781
  array.push(element);
11736
11782
  }
11737
11783
  if (array.length > 0) {
@@ -12056,7 +12102,18 @@ export class Application extends Object {
12056
12102
  _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push(new URL(v["@id"]));
12057
12103
  continue;
12058
12104
  }
12059
- _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push(await OrderedCollection.fromJsonLd(v, options));
12105
+ const decoded = typeof v === "object" && "@type" in v &&
12106
+ Array.isArray(v["@type"]) &&
12107
+ v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollection")
12108
+ ? await OrderedCollection.fromJsonLd(v, options)
12109
+ : typeof v === "object" && "@type" in v &&
12110
+ Array.isArray(v["@type"]) &&
12111
+ v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollectionPage")
12112
+ ? await OrderedCollectionPage.fromJsonLd(v, options)
12113
+ : undefined;
12114
+ if (typeof decoded === "undefined")
12115
+ continue;
12116
+ _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push(decoded);
12060
12117
  }
12061
12118
  instance.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox =
12062
12119
  _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox;
@@ -12075,7 +12132,18 @@ export class Application extends Object {
12075
12132
  _41QwhqJouoLg3h8dRPKat21brynC_outbox.push(new URL(v["@id"]));
12076
12133
  continue;
12077
12134
  }
12078
- _41QwhqJouoLg3h8dRPKat21brynC_outbox.push(await OrderedCollection.fromJsonLd(v, options));
12135
+ const decoded = typeof v === "object" && "@type" in v &&
12136
+ Array.isArray(v["@type"]) &&
12137
+ v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollection")
12138
+ ? await OrderedCollection.fromJsonLd(v, options)
12139
+ : typeof v === "object" && "@type" in v &&
12140
+ Array.isArray(v["@type"]) &&
12141
+ v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollectionPage")
12142
+ ? await OrderedCollectionPage.fromJsonLd(v, options)
12143
+ : undefined;
12144
+ if (typeof decoded === "undefined")
12145
+ continue;
12146
+ _41QwhqJouoLg3h8dRPKat21brynC_outbox.push(decoded);
12079
12147
  }
12080
12148
  instance.#_41QwhqJouoLg3h8dRPKat21brynC_outbox =
12081
12149
  _41QwhqJouoLg3h8dRPKat21brynC_outbox;
@@ -17503,24 +17571,27 @@ export class Group extends Object {
17503
17571
  }
17504
17572
  }
17505
17573
  if ("inbox" in values && values.inbox != null) {
17506
- if (values.inbox instanceof OrderedCollection || values.inbox instanceof URL) {
17574
+ if (values.inbox instanceof OrderedCollection ||
17575
+ values.inbox instanceof OrderedCollectionPage ||
17576
+ values.inbox instanceof URL) {
17507
17577
  // @ts-ignore: type is checked above.
17508
17578
  this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = [values.inbox];
17509
17579
  }
17510
17580
  else {
17511
17581
  throw new TypeError("The inbox must be of type " +
17512
- "OrderedCollection | URL" + ".");
17582
+ "OrderedCollection | OrderedCollectionPage | URL" + ".");
17513
17583
  }
17514
17584
  }
17515
17585
  if ("outbox" in values && values.outbox != null) {
17516
17586
  if (values.outbox instanceof OrderedCollection ||
17587
+ values.outbox instanceof OrderedCollectionPage ||
17517
17588
  values.outbox instanceof URL) {
17518
17589
  // @ts-ignore: type is checked above.
17519
17590
  this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = [values.outbox];
17520
17591
  }
17521
17592
  else {
17522
17593
  throw new TypeError("The outbox must be of type " +
17523
- "OrderedCollection | URL" + ".");
17594
+ "OrderedCollection | OrderedCollectionPage | URL" + ".");
17524
17595
  }
17525
17596
  }
17526
17597
  if ("following" in values && values.following != null) {
@@ -17790,26 +17861,29 @@ export class Group extends Object {
17790
17861
  clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox =
17791
17862
  this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox;
17792
17863
  if ("inbox" in values && values.inbox != null) {
17793
- if (values.inbox instanceof OrderedCollection || values.inbox instanceof URL) {
17864
+ if (values.inbox instanceof OrderedCollection ||
17865
+ values.inbox instanceof OrderedCollectionPage ||
17866
+ values.inbox instanceof URL) {
17794
17867
  // @ts-ignore: type is checked above.
17795
17868
  clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = [values.inbox];
17796
17869
  }
17797
17870
  else {
17798
17871
  throw new TypeError("The inbox must be of type " +
17799
- "OrderedCollection | URL" + ".");
17872
+ "OrderedCollection | OrderedCollectionPage | URL" + ".");
17800
17873
  }
17801
17874
  }
17802
17875
  clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox =
17803
17876
  this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox;
17804
17877
  if ("outbox" in values && values.outbox != null) {
17805
17878
  if (values.outbox instanceof OrderedCollection ||
17879
+ values.outbox instanceof OrderedCollectionPage ||
17806
17880
  values.outbox instanceof URL) {
17807
17881
  // @ts-ignore: type is checked above.
17808
17882
  clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = [values.outbox];
17809
17883
  }
17810
17884
  else {
17811
17885
  throw new TypeError("The outbox must be of type " +
17812
- "OrderedCollection | URL" + ".");
17886
+ "OrderedCollection | OrderedCollectionPage | URL" + ".");
17813
17887
  }
17814
17888
  }
17815
17889
  clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following =
@@ -18206,8 +18280,18 @@ export class Group extends Object {
18206
18280
  if (!(e instanceof TypeError))
18207
18281
  throw e;
18208
18282
  }
18283
+ try {
18284
+ return await OrderedCollectionPage.fromJsonLd(document, { documentLoader, contextLoader });
18285
+ }
18286
+ catch (e) {
18287
+ if (!(e instanceof TypeError))
18288
+ throw e;
18289
+ }
18209
18290
  throw new TypeError("Expected an object of any type of: " +
18210
- ["https://www.w3.org/ns/activitystreams#OrderedCollection"].join(", "));
18291
+ [
18292
+ "https://www.w3.org/ns/activitystreams#OrderedCollection",
18293
+ "https://www.w3.org/ns/activitystreams#OrderedCollectionPage",
18294
+ ].join(", "));
18211
18295
  }
18212
18296
  /**
18213
18297
  * Similar to
@@ -18273,8 +18357,18 @@ export class Group extends Object {
18273
18357
  if (!(e instanceof TypeError))
18274
18358
  throw e;
18275
18359
  }
18360
+ try {
18361
+ return await OrderedCollectionPage.fromJsonLd(document, { documentLoader, contextLoader });
18362
+ }
18363
+ catch (e) {
18364
+ if (!(e instanceof TypeError))
18365
+ throw e;
18366
+ }
18276
18367
  throw new TypeError("Expected an object of any type of: " +
18277
- ["https://www.w3.org/ns/activitystreams#OrderedCollection"].join(", "));
18368
+ [
18369
+ "https://www.w3.org/ns/activitystreams#OrderedCollection",
18370
+ "https://www.w3.org/ns/activitystreams#OrderedCollectionPage",
18371
+ ].join(", "));
18278
18372
  }
18279
18373
  /**
18280
18374
  * Similar to
@@ -18909,11 +19003,19 @@ export class Group extends Object {
18909
19003
  }
18910
19004
  compactItems = [];
18911
19005
  for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) {
18912
- const item = v instanceof URL ? v.href : await v.toJsonLd({
18913
- ...options,
18914
- format: undefined,
18915
- context: undefined,
18916
- });
19006
+ const item = v instanceof URL
19007
+ ? v.href
19008
+ : v instanceof OrderedCollection
19009
+ ? await v.toJsonLd({
19010
+ ...options,
19011
+ format: undefined,
19012
+ context: undefined,
19013
+ })
19014
+ : await v.toJsonLd({
19015
+ ...options,
19016
+ format: undefined,
19017
+ context: undefined,
19018
+ });
18917
19019
  compactItems.push(item);
18918
19020
  }
18919
19021
  if (compactItems.length > 0) {
@@ -18923,11 +19025,19 @@ export class Group extends Object {
18923
19025
  }
18924
19026
  compactItems = [];
18925
19027
  for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) {
18926
- const item = v instanceof URL ? v.href : await v.toJsonLd({
18927
- ...options,
18928
- format: undefined,
18929
- context: undefined,
18930
- });
19028
+ const item = v instanceof URL
19029
+ ? v.href
19030
+ : v instanceof OrderedCollection
19031
+ ? await v.toJsonLd({
19032
+ ...options,
19033
+ format: undefined,
19034
+ context: undefined,
19035
+ })
19036
+ : await v.toJsonLd({
19037
+ ...options,
19038
+ format: undefined,
19039
+ context: undefined,
19040
+ });
18931
19041
  compactItems.push(item);
18932
19042
  }
18933
19043
  if (compactItems.length > 0) {
@@ -19194,7 +19304,9 @@ export class Group extends Object {
19194
19304
  for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) {
19195
19305
  const element = v instanceof URL
19196
19306
  ? { "@id": v.href }
19197
- : await v.toJsonLd(options);
19307
+ : v instanceof OrderedCollection
19308
+ ? await v.toJsonLd(options)
19309
+ : await v.toJsonLd(options);
19198
19310
  array.push(element);
19199
19311
  }
19200
19312
  if (array.length > 0) {
@@ -19205,7 +19317,9 @@ export class Group extends Object {
19205
19317
  for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) {
19206
19318
  const element = v instanceof URL
19207
19319
  ? { "@id": v.href }
19208
- : await v.toJsonLd(options);
19320
+ : v instanceof OrderedCollection
19321
+ ? await v.toJsonLd(options)
19322
+ : await v.toJsonLd(options);
19209
19323
  array.push(element);
19210
19324
  }
19211
19325
  if (array.length > 0) {
@@ -19530,7 +19644,18 @@ export class Group extends Object {
19530
19644
  _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push(new URL(v["@id"]));
19531
19645
  continue;
19532
19646
  }
19533
- _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push(await OrderedCollection.fromJsonLd(v, options));
19647
+ const decoded = typeof v === "object" && "@type" in v &&
19648
+ Array.isArray(v["@type"]) &&
19649
+ v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollection")
19650
+ ? await OrderedCollection.fromJsonLd(v, options)
19651
+ : typeof v === "object" && "@type" in v &&
19652
+ Array.isArray(v["@type"]) &&
19653
+ v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollectionPage")
19654
+ ? await OrderedCollectionPage.fromJsonLd(v, options)
19655
+ : undefined;
19656
+ if (typeof decoded === "undefined")
19657
+ continue;
19658
+ _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push(decoded);
19534
19659
  }
19535
19660
  instance.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox =
19536
19661
  _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox;
@@ -19549,7 +19674,18 @@ export class Group extends Object {
19549
19674
  _41QwhqJouoLg3h8dRPKat21brynC_outbox.push(new URL(v["@id"]));
19550
19675
  continue;
19551
19676
  }
19552
- _41QwhqJouoLg3h8dRPKat21brynC_outbox.push(await OrderedCollection.fromJsonLd(v, options));
19677
+ const decoded = typeof v === "object" && "@type" in v &&
19678
+ Array.isArray(v["@type"]) &&
19679
+ v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollection")
19680
+ ? await OrderedCollection.fromJsonLd(v, options)
19681
+ : typeof v === "object" && "@type" in v &&
19682
+ Array.isArray(v["@type"]) &&
19683
+ v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollectionPage")
19684
+ ? await OrderedCollectionPage.fromJsonLd(v, options)
19685
+ : undefined;
19686
+ if (typeof decoded === "undefined")
19687
+ continue;
19688
+ _41QwhqJouoLg3h8dRPKat21brynC_outbox.push(decoded);
19553
19689
  }
19554
19690
  instance.#_41QwhqJouoLg3h8dRPKat21brynC_outbox =
19555
19691
  _41QwhqJouoLg3h8dRPKat21brynC_outbox;
@@ -24162,24 +24298,27 @@ export class Organization extends Object {
24162
24298
  }
24163
24299
  }
24164
24300
  if ("inbox" in values && values.inbox != null) {
24165
- if (values.inbox instanceof OrderedCollection || values.inbox instanceof URL) {
24301
+ if (values.inbox instanceof OrderedCollection ||
24302
+ values.inbox instanceof OrderedCollectionPage ||
24303
+ values.inbox instanceof URL) {
24166
24304
  // @ts-ignore: type is checked above.
24167
24305
  this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = [values.inbox];
24168
24306
  }
24169
24307
  else {
24170
24308
  throw new TypeError("The inbox must be of type " +
24171
- "OrderedCollection | URL" + ".");
24309
+ "OrderedCollection | OrderedCollectionPage | URL" + ".");
24172
24310
  }
24173
24311
  }
24174
24312
  if ("outbox" in values && values.outbox != null) {
24175
24313
  if (values.outbox instanceof OrderedCollection ||
24314
+ values.outbox instanceof OrderedCollectionPage ||
24176
24315
  values.outbox instanceof URL) {
24177
24316
  // @ts-ignore: type is checked above.
24178
24317
  this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = [values.outbox];
24179
24318
  }
24180
24319
  else {
24181
24320
  throw new TypeError("The outbox must be of type " +
24182
- "OrderedCollection | URL" + ".");
24321
+ "OrderedCollection | OrderedCollectionPage | URL" + ".");
24183
24322
  }
24184
24323
  }
24185
24324
  if ("following" in values && values.following != null) {
@@ -24449,26 +24588,29 @@ export class Organization extends Object {
24449
24588
  clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox =
24450
24589
  this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox;
24451
24590
  if ("inbox" in values && values.inbox != null) {
24452
- if (values.inbox instanceof OrderedCollection || values.inbox instanceof URL) {
24591
+ if (values.inbox instanceof OrderedCollection ||
24592
+ values.inbox instanceof OrderedCollectionPage ||
24593
+ values.inbox instanceof URL) {
24453
24594
  // @ts-ignore: type is checked above.
24454
24595
  clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = [values.inbox];
24455
24596
  }
24456
24597
  else {
24457
24598
  throw new TypeError("The inbox must be of type " +
24458
- "OrderedCollection | URL" + ".");
24599
+ "OrderedCollection | OrderedCollectionPage | URL" + ".");
24459
24600
  }
24460
24601
  }
24461
24602
  clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox =
24462
24603
  this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox;
24463
24604
  if ("outbox" in values && values.outbox != null) {
24464
24605
  if (values.outbox instanceof OrderedCollection ||
24606
+ values.outbox instanceof OrderedCollectionPage ||
24465
24607
  values.outbox instanceof URL) {
24466
24608
  // @ts-ignore: type is checked above.
24467
24609
  clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = [values.outbox];
24468
24610
  }
24469
24611
  else {
24470
24612
  throw new TypeError("The outbox must be of type " +
24471
- "OrderedCollection | URL" + ".");
24613
+ "OrderedCollection | OrderedCollectionPage | URL" + ".");
24472
24614
  }
24473
24615
  }
24474
24616
  clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following =
@@ -24865,8 +25007,18 @@ export class Organization extends Object {
24865
25007
  if (!(e instanceof TypeError))
24866
25008
  throw e;
24867
25009
  }
25010
+ try {
25011
+ return await OrderedCollectionPage.fromJsonLd(document, { documentLoader, contextLoader });
25012
+ }
25013
+ catch (e) {
25014
+ if (!(e instanceof TypeError))
25015
+ throw e;
25016
+ }
24868
25017
  throw new TypeError("Expected an object of any type of: " +
24869
- ["https://www.w3.org/ns/activitystreams#OrderedCollection"].join(", "));
25018
+ [
25019
+ "https://www.w3.org/ns/activitystreams#OrderedCollection",
25020
+ "https://www.w3.org/ns/activitystreams#OrderedCollectionPage",
25021
+ ].join(", "));
24870
25022
  }
24871
25023
  /**
24872
25024
  * Similar to
@@ -24932,8 +25084,18 @@ export class Organization extends Object {
24932
25084
  if (!(e instanceof TypeError))
24933
25085
  throw e;
24934
25086
  }
25087
+ try {
25088
+ return await OrderedCollectionPage.fromJsonLd(document, { documentLoader, contextLoader });
25089
+ }
25090
+ catch (e) {
25091
+ if (!(e instanceof TypeError))
25092
+ throw e;
25093
+ }
24935
25094
  throw new TypeError("Expected an object of any type of: " +
24936
- ["https://www.w3.org/ns/activitystreams#OrderedCollection"].join(", "));
25095
+ [
25096
+ "https://www.w3.org/ns/activitystreams#OrderedCollection",
25097
+ "https://www.w3.org/ns/activitystreams#OrderedCollectionPage",
25098
+ ].join(", "));
24937
25099
  }
24938
25100
  /**
24939
25101
  * Similar to
@@ -25568,11 +25730,19 @@ export class Organization extends Object {
25568
25730
  }
25569
25731
  compactItems = [];
25570
25732
  for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) {
25571
- const item = v instanceof URL ? v.href : await v.toJsonLd({
25572
- ...options,
25573
- format: undefined,
25574
- context: undefined,
25575
- });
25733
+ const item = v instanceof URL
25734
+ ? v.href
25735
+ : v instanceof OrderedCollection
25736
+ ? await v.toJsonLd({
25737
+ ...options,
25738
+ format: undefined,
25739
+ context: undefined,
25740
+ })
25741
+ : await v.toJsonLd({
25742
+ ...options,
25743
+ format: undefined,
25744
+ context: undefined,
25745
+ });
25576
25746
  compactItems.push(item);
25577
25747
  }
25578
25748
  if (compactItems.length > 0) {
@@ -25582,11 +25752,19 @@ export class Organization extends Object {
25582
25752
  }
25583
25753
  compactItems = [];
25584
25754
  for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) {
25585
- const item = v instanceof URL ? v.href : await v.toJsonLd({
25586
- ...options,
25587
- format: undefined,
25588
- context: undefined,
25589
- });
25755
+ const item = v instanceof URL
25756
+ ? v.href
25757
+ : v instanceof OrderedCollection
25758
+ ? await v.toJsonLd({
25759
+ ...options,
25760
+ format: undefined,
25761
+ context: undefined,
25762
+ })
25763
+ : await v.toJsonLd({
25764
+ ...options,
25765
+ format: undefined,
25766
+ context: undefined,
25767
+ });
25590
25768
  compactItems.push(item);
25591
25769
  }
25592
25770
  if (compactItems.length > 0) {
@@ -25853,7 +26031,9 @@ export class Organization extends Object {
25853
26031
  for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) {
25854
26032
  const element = v instanceof URL
25855
26033
  ? { "@id": v.href }
25856
- : await v.toJsonLd(options);
26034
+ : v instanceof OrderedCollection
26035
+ ? await v.toJsonLd(options)
26036
+ : await v.toJsonLd(options);
25857
26037
  array.push(element);
25858
26038
  }
25859
26039
  if (array.length > 0) {
@@ -25864,7 +26044,9 @@ export class Organization extends Object {
25864
26044
  for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) {
25865
26045
  const element = v instanceof URL
25866
26046
  ? { "@id": v.href }
25867
- : await v.toJsonLd(options);
26047
+ : v instanceof OrderedCollection
26048
+ ? await v.toJsonLd(options)
26049
+ : await v.toJsonLd(options);
25868
26050
  array.push(element);
25869
26051
  }
25870
26052
  if (array.length > 0) {
@@ -26189,7 +26371,18 @@ export class Organization extends Object {
26189
26371
  _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push(new URL(v["@id"]));
26190
26372
  continue;
26191
26373
  }
26192
- _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push(await OrderedCollection.fromJsonLd(v, options));
26374
+ const decoded = typeof v === "object" && "@type" in v &&
26375
+ Array.isArray(v["@type"]) &&
26376
+ v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollection")
26377
+ ? await OrderedCollection.fromJsonLd(v, options)
26378
+ : typeof v === "object" && "@type" in v &&
26379
+ Array.isArray(v["@type"]) &&
26380
+ v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollectionPage")
26381
+ ? await OrderedCollectionPage.fromJsonLd(v, options)
26382
+ : undefined;
26383
+ if (typeof decoded === "undefined")
26384
+ continue;
26385
+ _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push(decoded);
26193
26386
  }
26194
26387
  instance.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox =
26195
26388
  _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox;
@@ -26208,7 +26401,18 @@ export class Organization extends Object {
26208
26401
  _41QwhqJouoLg3h8dRPKat21brynC_outbox.push(new URL(v["@id"]));
26209
26402
  continue;
26210
26403
  }
26211
- _41QwhqJouoLg3h8dRPKat21brynC_outbox.push(await OrderedCollection.fromJsonLd(v, options));
26404
+ const decoded = typeof v === "object" && "@type" in v &&
26405
+ Array.isArray(v["@type"]) &&
26406
+ v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollection")
26407
+ ? await OrderedCollection.fromJsonLd(v, options)
26408
+ : typeof v === "object" && "@type" in v &&
26409
+ Array.isArray(v["@type"]) &&
26410
+ v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollectionPage")
26411
+ ? await OrderedCollectionPage.fromJsonLd(v, options)
26412
+ : undefined;
26413
+ if (typeof decoded === "undefined")
26414
+ continue;
26415
+ _41QwhqJouoLg3h8dRPKat21brynC_outbox.push(decoded);
26212
26416
  }
26213
26417
  instance.#_41QwhqJouoLg3h8dRPKat21brynC_outbox =
26214
26418
  _41QwhqJouoLg3h8dRPKat21brynC_outbox;
@@ -27013,24 +27217,27 @@ export class Person extends Object {
27013
27217
  }
27014
27218
  }
27015
27219
  if ("inbox" in values && values.inbox != null) {
27016
- if (values.inbox instanceof OrderedCollection || values.inbox instanceof URL) {
27220
+ if (values.inbox instanceof OrderedCollection ||
27221
+ values.inbox instanceof OrderedCollectionPage ||
27222
+ values.inbox instanceof URL) {
27017
27223
  // @ts-ignore: type is checked above.
27018
27224
  this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = [values.inbox];
27019
27225
  }
27020
27226
  else {
27021
27227
  throw new TypeError("The inbox must be of type " +
27022
- "OrderedCollection | URL" + ".");
27228
+ "OrderedCollection | OrderedCollectionPage | URL" + ".");
27023
27229
  }
27024
27230
  }
27025
27231
  if ("outbox" in values && values.outbox != null) {
27026
27232
  if (values.outbox instanceof OrderedCollection ||
27233
+ values.outbox instanceof OrderedCollectionPage ||
27027
27234
  values.outbox instanceof URL) {
27028
27235
  // @ts-ignore: type is checked above.
27029
27236
  this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = [values.outbox];
27030
27237
  }
27031
27238
  else {
27032
27239
  throw new TypeError("The outbox must be of type " +
27033
- "OrderedCollection | URL" + ".");
27240
+ "OrderedCollection | OrderedCollectionPage | URL" + ".");
27034
27241
  }
27035
27242
  }
27036
27243
  if ("following" in values && values.following != null) {
@@ -27300,26 +27507,29 @@ export class Person extends Object {
27300
27507
  clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox =
27301
27508
  this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox;
27302
27509
  if ("inbox" in values && values.inbox != null) {
27303
- if (values.inbox instanceof OrderedCollection || values.inbox instanceof URL) {
27510
+ if (values.inbox instanceof OrderedCollection ||
27511
+ values.inbox instanceof OrderedCollectionPage ||
27512
+ values.inbox instanceof URL) {
27304
27513
  // @ts-ignore: type is checked above.
27305
27514
  clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = [values.inbox];
27306
27515
  }
27307
27516
  else {
27308
27517
  throw new TypeError("The inbox must be of type " +
27309
- "OrderedCollection | URL" + ".");
27518
+ "OrderedCollection | OrderedCollectionPage | URL" + ".");
27310
27519
  }
27311
27520
  }
27312
27521
  clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox =
27313
27522
  this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox;
27314
27523
  if ("outbox" in values && values.outbox != null) {
27315
27524
  if (values.outbox instanceof OrderedCollection ||
27525
+ values.outbox instanceof OrderedCollectionPage ||
27316
27526
  values.outbox instanceof URL) {
27317
27527
  // @ts-ignore: type is checked above.
27318
27528
  clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = [values.outbox];
27319
27529
  }
27320
27530
  else {
27321
27531
  throw new TypeError("The outbox must be of type " +
27322
- "OrderedCollection | URL" + ".");
27532
+ "OrderedCollection | OrderedCollectionPage | URL" + ".");
27323
27533
  }
27324
27534
  }
27325
27535
  clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following =
@@ -27716,8 +27926,18 @@ export class Person extends Object {
27716
27926
  if (!(e instanceof TypeError))
27717
27927
  throw e;
27718
27928
  }
27929
+ try {
27930
+ return await OrderedCollectionPage.fromJsonLd(document, { documentLoader, contextLoader });
27931
+ }
27932
+ catch (e) {
27933
+ if (!(e instanceof TypeError))
27934
+ throw e;
27935
+ }
27719
27936
  throw new TypeError("Expected an object of any type of: " +
27720
- ["https://www.w3.org/ns/activitystreams#OrderedCollection"].join(", "));
27937
+ [
27938
+ "https://www.w3.org/ns/activitystreams#OrderedCollection",
27939
+ "https://www.w3.org/ns/activitystreams#OrderedCollectionPage",
27940
+ ].join(", "));
27721
27941
  }
27722
27942
  /**
27723
27943
  * Similar to
@@ -27783,8 +28003,18 @@ export class Person extends Object {
27783
28003
  if (!(e instanceof TypeError))
27784
28004
  throw e;
27785
28005
  }
28006
+ try {
28007
+ return await OrderedCollectionPage.fromJsonLd(document, { documentLoader, contextLoader });
28008
+ }
28009
+ catch (e) {
28010
+ if (!(e instanceof TypeError))
28011
+ throw e;
28012
+ }
27786
28013
  throw new TypeError("Expected an object of any type of: " +
27787
- ["https://www.w3.org/ns/activitystreams#OrderedCollection"].join(", "));
28014
+ [
28015
+ "https://www.w3.org/ns/activitystreams#OrderedCollection",
28016
+ "https://www.w3.org/ns/activitystreams#OrderedCollectionPage",
28017
+ ].join(", "));
27788
28018
  }
27789
28019
  /**
27790
28020
  * Similar to
@@ -28419,11 +28649,19 @@ export class Person extends Object {
28419
28649
  }
28420
28650
  compactItems = [];
28421
28651
  for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) {
28422
- const item = v instanceof URL ? v.href : await v.toJsonLd({
28423
- ...options,
28424
- format: undefined,
28425
- context: undefined,
28426
- });
28652
+ const item = v instanceof URL
28653
+ ? v.href
28654
+ : v instanceof OrderedCollection
28655
+ ? await v.toJsonLd({
28656
+ ...options,
28657
+ format: undefined,
28658
+ context: undefined,
28659
+ })
28660
+ : await v.toJsonLd({
28661
+ ...options,
28662
+ format: undefined,
28663
+ context: undefined,
28664
+ });
28427
28665
  compactItems.push(item);
28428
28666
  }
28429
28667
  if (compactItems.length > 0) {
@@ -28433,11 +28671,19 @@ export class Person extends Object {
28433
28671
  }
28434
28672
  compactItems = [];
28435
28673
  for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) {
28436
- const item = v instanceof URL ? v.href : await v.toJsonLd({
28437
- ...options,
28438
- format: undefined,
28439
- context: undefined,
28440
- });
28674
+ const item = v instanceof URL
28675
+ ? v.href
28676
+ : v instanceof OrderedCollection
28677
+ ? await v.toJsonLd({
28678
+ ...options,
28679
+ format: undefined,
28680
+ context: undefined,
28681
+ })
28682
+ : await v.toJsonLd({
28683
+ ...options,
28684
+ format: undefined,
28685
+ context: undefined,
28686
+ });
28441
28687
  compactItems.push(item);
28442
28688
  }
28443
28689
  if (compactItems.length > 0) {
@@ -28704,7 +28950,9 @@ export class Person extends Object {
28704
28950
  for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) {
28705
28951
  const element = v instanceof URL
28706
28952
  ? { "@id": v.href }
28707
- : await v.toJsonLd(options);
28953
+ : v instanceof OrderedCollection
28954
+ ? await v.toJsonLd(options)
28955
+ : await v.toJsonLd(options);
28708
28956
  array.push(element);
28709
28957
  }
28710
28958
  if (array.length > 0) {
@@ -28715,7 +28963,9 @@ export class Person extends Object {
28715
28963
  for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) {
28716
28964
  const element = v instanceof URL
28717
28965
  ? { "@id": v.href }
28718
- : await v.toJsonLd(options);
28966
+ : v instanceof OrderedCollection
28967
+ ? await v.toJsonLd(options)
28968
+ : await v.toJsonLd(options);
28719
28969
  array.push(element);
28720
28970
  }
28721
28971
  if (array.length > 0) {
@@ -29040,7 +29290,18 @@ export class Person extends Object {
29040
29290
  _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push(new URL(v["@id"]));
29041
29291
  continue;
29042
29292
  }
29043
- _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push(await OrderedCollection.fromJsonLd(v, options));
29293
+ const decoded = typeof v === "object" && "@type" in v &&
29294
+ Array.isArray(v["@type"]) &&
29295
+ v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollection")
29296
+ ? await OrderedCollection.fromJsonLd(v, options)
29297
+ : typeof v === "object" && "@type" in v &&
29298
+ Array.isArray(v["@type"]) &&
29299
+ v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollectionPage")
29300
+ ? await OrderedCollectionPage.fromJsonLd(v, options)
29301
+ : undefined;
29302
+ if (typeof decoded === "undefined")
29303
+ continue;
29304
+ _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push(decoded);
29044
29305
  }
29045
29306
  instance.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox =
29046
29307
  _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox;
@@ -29059,7 +29320,18 @@ export class Person extends Object {
29059
29320
  _41QwhqJouoLg3h8dRPKat21brynC_outbox.push(new URL(v["@id"]));
29060
29321
  continue;
29061
29322
  }
29062
- _41QwhqJouoLg3h8dRPKat21brynC_outbox.push(await OrderedCollection.fromJsonLd(v, options));
29323
+ const decoded = typeof v === "object" && "@type" in v &&
29324
+ Array.isArray(v["@type"]) &&
29325
+ v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollection")
29326
+ ? await OrderedCollection.fromJsonLd(v, options)
29327
+ : typeof v === "object" && "@type" in v &&
29328
+ Array.isArray(v["@type"]) &&
29329
+ v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollectionPage")
29330
+ ? await OrderedCollectionPage.fromJsonLd(v, options)
29331
+ : undefined;
29332
+ if (typeof decoded === "undefined")
29333
+ continue;
29334
+ _41QwhqJouoLg3h8dRPKat21brynC_outbox.push(decoded);
29063
29335
  }
29064
29336
  instance.#_41QwhqJouoLg3h8dRPKat21brynC_outbox =
29065
29337
  _41QwhqJouoLg3h8dRPKat21brynC_outbox;
@@ -32680,24 +32952,27 @@ export class Service extends Object {
32680
32952
  }
32681
32953
  }
32682
32954
  if ("inbox" in values && values.inbox != null) {
32683
- if (values.inbox instanceof OrderedCollection || values.inbox instanceof URL) {
32955
+ if (values.inbox instanceof OrderedCollection ||
32956
+ values.inbox instanceof OrderedCollectionPage ||
32957
+ values.inbox instanceof URL) {
32684
32958
  // @ts-ignore: type is checked above.
32685
32959
  this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = [values.inbox];
32686
32960
  }
32687
32961
  else {
32688
32962
  throw new TypeError("The inbox must be of type " +
32689
- "OrderedCollection | URL" + ".");
32963
+ "OrderedCollection | OrderedCollectionPage | URL" + ".");
32690
32964
  }
32691
32965
  }
32692
32966
  if ("outbox" in values && values.outbox != null) {
32693
32967
  if (values.outbox instanceof OrderedCollection ||
32968
+ values.outbox instanceof OrderedCollectionPage ||
32694
32969
  values.outbox instanceof URL) {
32695
32970
  // @ts-ignore: type is checked above.
32696
32971
  this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = [values.outbox];
32697
32972
  }
32698
32973
  else {
32699
32974
  throw new TypeError("The outbox must be of type " +
32700
- "OrderedCollection | URL" + ".");
32975
+ "OrderedCollection | OrderedCollectionPage | URL" + ".");
32701
32976
  }
32702
32977
  }
32703
32978
  if ("following" in values && values.following != null) {
@@ -32967,26 +33242,29 @@ export class Service extends Object {
32967
33242
  clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox =
32968
33243
  this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox;
32969
33244
  if ("inbox" in values && values.inbox != null) {
32970
- if (values.inbox instanceof OrderedCollection || values.inbox instanceof URL) {
33245
+ if (values.inbox instanceof OrderedCollection ||
33246
+ values.inbox instanceof OrderedCollectionPage ||
33247
+ values.inbox instanceof URL) {
32971
33248
  // @ts-ignore: type is checked above.
32972
33249
  clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = [values.inbox];
32973
33250
  }
32974
33251
  else {
32975
33252
  throw new TypeError("The inbox must be of type " +
32976
- "OrderedCollection | URL" + ".");
33253
+ "OrderedCollection | OrderedCollectionPage | URL" + ".");
32977
33254
  }
32978
33255
  }
32979
33256
  clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox =
32980
33257
  this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox;
32981
33258
  if ("outbox" in values && values.outbox != null) {
32982
33259
  if (values.outbox instanceof OrderedCollection ||
33260
+ values.outbox instanceof OrderedCollectionPage ||
32983
33261
  values.outbox instanceof URL) {
32984
33262
  // @ts-ignore: type is checked above.
32985
33263
  clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = [values.outbox];
32986
33264
  }
32987
33265
  else {
32988
33266
  throw new TypeError("The outbox must be of type " +
32989
- "OrderedCollection | URL" + ".");
33267
+ "OrderedCollection | OrderedCollectionPage | URL" + ".");
32990
33268
  }
32991
33269
  }
32992
33270
  clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following =
@@ -33383,8 +33661,18 @@ export class Service extends Object {
33383
33661
  if (!(e instanceof TypeError))
33384
33662
  throw e;
33385
33663
  }
33664
+ try {
33665
+ return await OrderedCollectionPage.fromJsonLd(document, { documentLoader, contextLoader });
33666
+ }
33667
+ catch (e) {
33668
+ if (!(e instanceof TypeError))
33669
+ throw e;
33670
+ }
33386
33671
  throw new TypeError("Expected an object of any type of: " +
33387
- ["https://www.w3.org/ns/activitystreams#OrderedCollection"].join(", "));
33672
+ [
33673
+ "https://www.w3.org/ns/activitystreams#OrderedCollection",
33674
+ "https://www.w3.org/ns/activitystreams#OrderedCollectionPage",
33675
+ ].join(", "));
33388
33676
  }
33389
33677
  /**
33390
33678
  * Similar to
@@ -33450,8 +33738,18 @@ export class Service extends Object {
33450
33738
  if (!(e instanceof TypeError))
33451
33739
  throw e;
33452
33740
  }
33741
+ try {
33742
+ return await OrderedCollectionPage.fromJsonLd(document, { documentLoader, contextLoader });
33743
+ }
33744
+ catch (e) {
33745
+ if (!(e instanceof TypeError))
33746
+ throw e;
33747
+ }
33453
33748
  throw new TypeError("Expected an object of any type of: " +
33454
- ["https://www.w3.org/ns/activitystreams#OrderedCollection"].join(", "));
33749
+ [
33750
+ "https://www.w3.org/ns/activitystreams#OrderedCollection",
33751
+ "https://www.w3.org/ns/activitystreams#OrderedCollectionPage",
33752
+ ].join(", "));
33455
33753
  }
33456
33754
  /**
33457
33755
  * Similar to
@@ -34086,11 +34384,19 @@ export class Service extends Object {
34086
34384
  }
34087
34385
  compactItems = [];
34088
34386
  for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) {
34089
- const item = v instanceof URL ? v.href : await v.toJsonLd({
34090
- ...options,
34091
- format: undefined,
34092
- context: undefined,
34093
- });
34387
+ const item = v instanceof URL
34388
+ ? v.href
34389
+ : v instanceof OrderedCollection
34390
+ ? await v.toJsonLd({
34391
+ ...options,
34392
+ format: undefined,
34393
+ context: undefined,
34394
+ })
34395
+ : await v.toJsonLd({
34396
+ ...options,
34397
+ format: undefined,
34398
+ context: undefined,
34399
+ });
34094
34400
  compactItems.push(item);
34095
34401
  }
34096
34402
  if (compactItems.length > 0) {
@@ -34100,11 +34406,19 @@ export class Service extends Object {
34100
34406
  }
34101
34407
  compactItems = [];
34102
34408
  for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) {
34103
- const item = v instanceof URL ? v.href : await v.toJsonLd({
34104
- ...options,
34105
- format: undefined,
34106
- context: undefined,
34107
- });
34409
+ const item = v instanceof URL
34410
+ ? v.href
34411
+ : v instanceof OrderedCollection
34412
+ ? await v.toJsonLd({
34413
+ ...options,
34414
+ format: undefined,
34415
+ context: undefined,
34416
+ })
34417
+ : await v.toJsonLd({
34418
+ ...options,
34419
+ format: undefined,
34420
+ context: undefined,
34421
+ });
34108
34422
  compactItems.push(item);
34109
34423
  }
34110
34424
  if (compactItems.length > 0) {
@@ -34371,7 +34685,9 @@ export class Service extends Object {
34371
34685
  for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) {
34372
34686
  const element = v instanceof URL
34373
34687
  ? { "@id": v.href }
34374
- : await v.toJsonLd(options);
34688
+ : v instanceof OrderedCollection
34689
+ ? await v.toJsonLd(options)
34690
+ : await v.toJsonLd(options);
34375
34691
  array.push(element);
34376
34692
  }
34377
34693
  if (array.length > 0) {
@@ -34382,7 +34698,9 @@ export class Service extends Object {
34382
34698
  for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) {
34383
34699
  const element = v instanceof URL
34384
34700
  ? { "@id": v.href }
34385
- : await v.toJsonLd(options);
34701
+ : v instanceof OrderedCollection
34702
+ ? await v.toJsonLd(options)
34703
+ : await v.toJsonLd(options);
34386
34704
  array.push(element);
34387
34705
  }
34388
34706
  if (array.length > 0) {
@@ -34707,7 +35025,18 @@ export class Service extends Object {
34707
35025
  _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push(new URL(v["@id"]));
34708
35026
  continue;
34709
35027
  }
34710
- _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push(await OrderedCollection.fromJsonLd(v, options));
35028
+ const decoded = typeof v === "object" && "@type" in v &&
35029
+ Array.isArray(v["@type"]) &&
35030
+ v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollection")
35031
+ ? await OrderedCollection.fromJsonLd(v, options)
35032
+ : typeof v === "object" && "@type" in v &&
35033
+ Array.isArray(v["@type"]) &&
35034
+ v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollectionPage")
35035
+ ? await OrderedCollectionPage.fromJsonLd(v, options)
35036
+ : undefined;
35037
+ if (typeof decoded === "undefined")
35038
+ continue;
35039
+ _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push(decoded);
34711
35040
  }
34712
35041
  instance.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox =
34713
35042
  _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox;
@@ -34726,7 +35055,18 @@ export class Service extends Object {
34726
35055
  _41QwhqJouoLg3h8dRPKat21brynC_outbox.push(new URL(v["@id"]));
34727
35056
  continue;
34728
35057
  }
34729
- _41QwhqJouoLg3h8dRPKat21brynC_outbox.push(await OrderedCollection.fromJsonLd(v, options));
35058
+ const decoded = typeof v === "object" && "@type" in v &&
35059
+ Array.isArray(v["@type"]) &&
35060
+ v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollection")
35061
+ ? await OrderedCollection.fromJsonLd(v, options)
35062
+ : typeof v === "object" && "@type" in v &&
35063
+ Array.isArray(v["@type"]) &&
35064
+ v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollectionPage")
35065
+ ? await OrderedCollectionPage.fromJsonLd(v, options)
35066
+ : undefined;
35067
+ if (typeof decoded === "undefined")
35068
+ continue;
35069
+ _41QwhqJouoLg3h8dRPKat21brynC_outbox.push(decoded);
34730
35070
  }
34731
35071
  instance.#_41QwhqJouoLg3h8dRPKat21brynC_outbox =
34732
35072
  _41QwhqJouoLg3h8dRPKat21brynC_outbox;