@fedify/fedify 0.7.0-dev.131 → 0.7.0-dev.133
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of @fedify/fedify might be problematic. Click here for more details.
- package/CHANGES.md +18 -1
- package/esm/federation/handler.js +23 -0
- package/esm/federation/middleware.js +98 -2
- package/esm/vocab/vocab.js +258 -0
- package/package.json +1 -1
- package/types/federation/callback.d.ts +27 -0
- package/types/federation/callback.d.ts.map +1 -1
- package/types/federation/context.d.ts +34 -1
- package/types/federation/context.d.ts.map +1 -1
- package/types/federation/handler.d.ts +11 -1
- package/types/federation/handler.d.ts.map +1 -1
- package/types/federation/middleware.d.ts +121 -7
- package/types/federation/middleware.d.ts.map +1 -1
- package/types/testing/context.d.ts.map +1 -1
- package/types/vocab/vocab.d.ts +172 -0
- package/types/vocab/vocab.d.ts.map +1 -1
package/esm/vocab/vocab.js
CHANGED
@@ -14,6 +14,12 @@ export class PropertyValue {
|
|
14
14
|
get _documentLoader() {
|
15
15
|
return this.#documentLoader;
|
16
16
|
}
|
17
|
+
/**
|
18
|
+
* The type URI of {@link PropertyValue}: `http://schema.org#PropertyValue`.
|
19
|
+
*/
|
20
|
+
static get typeId() {
|
21
|
+
return new URL("http://schema.org#PropertyValue");
|
22
|
+
}
|
17
23
|
#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav = [];
|
18
24
|
#_2cSy2magg4iZ7zLaG8U7DiJMoCkx = [];
|
19
25
|
/**
|
@@ -214,6 +220,12 @@ export class CryptographicKey {
|
|
214
220
|
get _documentLoader() {
|
215
221
|
return this.#documentLoader;
|
216
222
|
}
|
223
|
+
/**
|
224
|
+
* The type URI of {@link CryptographicKey}: `https://w3id.org/security#Key`.
|
225
|
+
*/
|
226
|
+
static get typeId() {
|
227
|
+
return new URL("https://w3id.org/security#Key");
|
228
|
+
}
|
217
229
|
#_5UJq9NDh3ZHgswFwwdVxQvJxdx2 = [];
|
218
230
|
#_2fE2QMDdg6KFGqa4NEC3TmjApSAD = [];
|
219
231
|
/**
|
@@ -498,6 +510,12 @@ export class Object {
|
|
498
510
|
get _documentLoader() {
|
499
511
|
return this.#documentLoader;
|
500
512
|
}
|
513
|
+
/**
|
514
|
+
* The type URI of {@link Object}: `https://www.w3.org/ns/activitystreams#Object`.
|
515
|
+
*/
|
516
|
+
static get typeId() {
|
517
|
+
return new URL("https://www.w3.org/ns/activitystreams#Object");
|
518
|
+
}
|
501
519
|
#_49BipA5dq9eoH8LX8xdsVumveTca = [];
|
502
520
|
#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py = [];
|
503
521
|
#_3ocC3VVi88cEd5sPWL8djkZsvTN6 = [];
|
@@ -3610,6 +3628,12 @@ _a = Object;
|
|
3610
3628
|
* does not carry any specific semantics about the kind of action being taken.
|
3611
3629
|
*/
|
3612
3630
|
export class Activity extends Object {
|
3631
|
+
/**
|
3632
|
+
* The type URI of {@link Activity}: `https://www.w3.org/ns/activitystreams#Activity`.
|
3633
|
+
*/
|
3634
|
+
static get typeId() {
|
3635
|
+
return new URL("https://www.w3.org/ns/activitystreams#Activity");
|
3636
|
+
}
|
3613
3637
|
#_2DjTTboo3CNHU2a2JQqUSE2dbv9D = [];
|
3614
3638
|
#_2MH19yxjn1wnHsNfa5n4JBhJzxyc = [];
|
3615
3639
|
/**
|
@@ -4092,6 +4116,12 @@ export class Activity extends Object {
|
|
4092
4116
|
* has been accepted.
|
4093
4117
|
*/
|
4094
4118
|
export class Accept extends Activity {
|
4119
|
+
/**
|
4120
|
+
* The type URI of {@link Accept}: `https://www.w3.org/ns/activitystreams#Accept`.
|
4121
|
+
*/
|
4122
|
+
static get typeId() {
|
4123
|
+
return new URL("https://www.w3.org/ns/activitystreams#Accept");
|
4124
|
+
}
|
4095
4125
|
/**
|
4096
4126
|
* Constructs a new instance of Accept with the given values.
|
4097
4127
|
* @param values The values to initialize the instance with.
|
@@ -4194,6 +4224,12 @@ export class Accept extends Activity {
|
|
4194
4224
|
* the context from which the `object` originated.
|
4195
4225
|
*/
|
4196
4226
|
export class Add extends Activity {
|
4227
|
+
/**
|
4228
|
+
* The type URI of {@link Add}: `https://www.w3.org/ns/activitystreams#Add`.
|
4229
|
+
*/
|
4230
|
+
static get typeId() {
|
4231
|
+
return new URL("https://www.w3.org/ns/activitystreams#Add");
|
4232
|
+
}
|
4197
4233
|
/**
|
4198
4234
|
* Constructs a new instance of Add with the given values.
|
4199
4235
|
* @param values The values to initialize the instance with.
|
@@ -4295,6 +4331,12 @@ export class Add extends Activity {
|
|
4295
4331
|
* The `origin` typically has no defined meaning.
|
4296
4332
|
*/
|
4297
4333
|
export class Announce extends Activity {
|
4334
|
+
/**
|
4335
|
+
* The type URI of {@link Announce}: `https://www.w3.org/ns/activitystreams#Announce`.
|
4336
|
+
*/
|
4337
|
+
static get typeId() {
|
4338
|
+
return new URL("https://www.w3.org/ns/activitystreams#Announce");
|
4339
|
+
}
|
4298
4340
|
/**
|
4299
4341
|
* Constructs a new instance of Announce with the given values.
|
4300
4342
|
* @param values The values to initialize the instance with.
|
@@ -4394,6 +4436,12 @@ export class Announce extends Activity {
|
|
4394
4436
|
/** Describes a software application.
|
4395
4437
|
*/
|
4396
4438
|
export class Application extends Object {
|
4439
|
+
/**
|
4440
|
+
* The type URI of {@link Application}: `https://www.w3.org/ns/activitystreams#Application`.
|
4441
|
+
*/
|
4442
|
+
static get typeId() {
|
4443
|
+
return new URL("https://www.w3.org/ns/activitystreams#Application");
|
4444
|
+
}
|
4397
4445
|
#_3isuDgRAKSntq9XdbjiNxjwyPZAf = [];
|
4398
4446
|
#_axq166E2eZADq34V4MYUc8KMZdC = [];
|
4399
4447
|
#_36QNc9MxfkKf6h8sEUQSHnV9NZA = [];
|
@@ -5408,6 +5456,12 @@ export class Application extends Object {
|
|
5408
5456
|
/** Represents any kind of multi-paragraph written work.
|
5409
5457
|
*/
|
5410
5458
|
export class Article extends Object {
|
5459
|
+
/**
|
5460
|
+
* The type URI of {@link Article}: `https://www.w3.org/ns/activitystreams#Article`.
|
5461
|
+
*/
|
5462
|
+
static get typeId() {
|
5463
|
+
return new URL("https://www.w3.org/ns/activitystreams#Article");
|
5464
|
+
}
|
5411
5465
|
/**
|
5412
5466
|
* Constructs a new instance of Article with the given values.
|
5413
5467
|
* @param values The values to initialize the instance with.
|
@@ -5507,6 +5561,12 @@ export class Article extends Object {
|
|
5507
5561
|
/** Represents a document of any kind.
|
5508
5562
|
*/
|
5509
5563
|
export class Document extends Object {
|
5564
|
+
/**
|
5565
|
+
* The type URI of {@link Document}: `https://www.w3.org/ns/activitystreams#Document`.
|
5566
|
+
*/
|
5567
|
+
static get typeId() {
|
5568
|
+
return new URL("https://www.w3.org/ns/activitystreams#Document");
|
5569
|
+
}
|
5510
5570
|
/**
|
5511
5571
|
* Constructs a new instance of Document with the given values.
|
5512
5572
|
* @param values The values to initialize the instance with.
|
@@ -5622,6 +5682,12 @@ export class Document extends Object {
|
|
5622
5682
|
/** Represents an audio document of any kind.
|
5623
5683
|
*/
|
5624
5684
|
export class Audio extends Document {
|
5685
|
+
/**
|
5686
|
+
* The type URI of {@link Audio}: `https://www.w3.org/ns/activitystreams#Audio`.
|
5687
|
+
*/
|
5688
|
+
static get typeId() {
|
5689
|
+
return new URL("https://www.w3.org/ns/activitystreams#Audio");
|
5690
|
+
}
|
5625
5691
|
/**
|
5626
5692
|
* Constructs a new instance of Audio with the given values.
|
5627
5693
|
* @param values The values to initialize the instance with.
|
@@ -5722,6 +5788,12 @@ export class Audio extends Document {
|
|
5722
5788
|
* `origin` typically have no defined meaning.
|
5723
5789
|
*/
|
5724
5790
|
export class Ignore extends Activity {
|
5791
|
+
/**
|
5792
|
+
* The type URI of {@link Ignore}: `https://www.w3.org/ns/activitystreams#Ignore`.
|
5793
|
+
*/
|
5794
|
+
static get typeId() {
|
5795
|
+
return new URL("https://www.w3.org/ns/activitystreams#Ignore");
|
5796
|
+
}
|
5725
5797
|
/**
|
5726
5798
|
* Constructs a new instance of Ignore with the given values.
|
5727
5799
|
* @param values The values to initialize the instance with.
|
@@ -5828,6 +5900,12 @@ export class Ignore extends Activity {
|
|
5828
5900
|
* and `origin` typically have no defined meaning.
|
5829
5901
|
*/
|
5830
5902
|
export class Block extends Ignore {
|
5903
|
+
/**
|
5904
|
+
* The type URI of {@link Block}: `https://www.w3.org/ns/activitystreams#Block`.
|
5905
|
+
*/
|
5906
|
+
static get typeId() {
|
5907
|
+
return new URL("https://www.w3.org/ns/activitystreams#Block");
|
5908
|
+
}
|
5831
5909
|
/**
|
5832
5910
|
* Constructs a new instance of Block with the given values.
|
5833
5911
|
* @param values The values to initialize the instance with.
|
@@ -5931,6 +6009,12 @@ export class Block extends Ignore {
|
|
5931
6009
|
* description of the Collection type.
|
5932
6010
|
*/
|
5933
6011
|
export class Collection extends Object {
|
6012
|
+
/**
|
6013
|
+
* The type URI of {@link Collection}: `https://www.w3.org/ns/activitystreams#Collection`.
|
6014
|
+
*/
|
6015
|
+
static get typeId() {
|
6016
|
+
return new URL("https://www.w3.org/ns/activitystreams#Collection");
|
6017
|
+
}
|
5934
6018
|
#_XDbmNDuWHmrhqH712zqtecdbv1V = [];
|
5935
6019
|
#_3UyUdxnyn6cDn53QKrh4MBiearma = [];
|
5936
6020
|
#_J52RqweMe6hhv7RnLJMC8BExTE5 = [];
|
@@ -6552,6 +6636,12 @@ export class Collection extends Object {
|
|
6552
6636
|
* the `CollectionPage` object.
|
6553
6637
|
*/
|
6554
6638
|
export class CollectionPage extends Collection {
|
6639
|
+
/**
|
6640
|
+
* The type URI of {@link CollectionPage}: `https://www.w3.org/ns/activitystreams#CollectionPage`.
|
6641
|
+
*/
|
6642
|
+
static get typeId() {
|
6643
|
+
return new URL("https://www.w3.org/ns/activitystreams#CollectionPage");
|
6644
|
+
}
|
6555
6645
|
#_2kWgBhQKjEauxx8C6qF3ZQamK4Le = [];
|
6556
6646
|
#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY = [];
|
6557
6647
|
#_3b8yG8tDNzQFFEnWhCc13G8eHooA = [];
|
@@ -6983,6 +7073,12 @@ _b = CollectionPage;
|
|
6983
7073
|
/** Indicates that the `actor` has created the `object`.
|
6984
7074
|
*/
|
6985
7075
|
export class Create extends Activity {
|
7076
|
+
/**
|
7077
|
+
* The type URI of {@link Create}: `https://www.w3.org/ns/activitystreams#Create`.
|
7078
|
+
*/
|
7079
|
+
static get typeId() {
|
7080
|
+
return new URL("https://www.w3.org/ns/activitystreams#Create");
|
7081
|
+
}
|
6986
7082
|
/**
|
6987
7083
|
* Constructs a new instance of Create with the given values.
|
6988
7084
|
* @param values The values to initialize the instance with.
|
@@ -7083,6 +7179,12 @@ export class Create extends Activity {
|
|
7083
7179
|
* the `origin` indicates the context from which the `object` was deleted.
|
7084
7180
|
*/
|
7085
7181
|
export class Delete extends Activity {
|
7182
|
+
/**
|
7183
|
+
* The type URI of {@link Delete}: `https://www.w3.org/ns/activitystreams#Delete`.
|
7184
|
+
*/
|
7185
|
+
static get typeId() {
|
7186
|
+
return new URL("https://www.w3.org/ns/activitystreams#Delete");
|
7187
|
+
}
|
7086
7188
|
/**
|
7087
7189
|
* Constructs a new instance of Delete with the given values.
|
7088
7190
|
* @param values The values to initialize the instance with.
|
@@ -7182,6 +7284,12 @@ export class Delete extends Activity {
|
|
7182
7284
|
/** Indicates that the `actor` dislikes the `object`.
|
7183
7285
|
*/
|
7184
7286
|
export class Dislike extends Activity {
|
7287
|
+
/**
|
7288
|
+
* The type URI of {@link Dislike}: `https://www.w3.org/ns/activitystreams#Dislike`.
|
7289
|
+
*/
|
7290
|
+
static get typeId() {
|
7291
|
+
return new URL("https://www.w3.org/ns/activitystreams#Dislike");
|
7292
|
+
}
|
7185
7293
|
/**
|
7186
7294
|
* Constructs a new instance of Dislike with the given values.
|
7187
7295
|
* @param values The values to initialize the instance with.
|
@@ -7286,6 +7394,12 @@ export class Endpoints {
|
|
7286
7394
|
get _documentLoader() {
|
7287
7395
|
return this.#documentLoader;
|
7288
7396
|
}
|
7397
|
+
/**
|
7398
|
+
* The type URI of {@link Endpoints}: `https://www.w3.org/ns/activitystreams#Endpoints`.
|
7399
|
+
*/
|
7400
|
+
static get typeId() {
|
7401
|
+
return new URL("https://www.w3.org/ns/activitystreams#Endpoints");
|
7402
|
+
}
|
7289
7403
|
#_2JCYDbSxEHCCLdBYed33cCETfGyR = [];
|
7290
7404
|
#_25S6UmgzDead8hxL5sQFezZTAusd = [];
|
7291
7405
|
#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3 = [];
|
@@ -7615,6 +7729,12 @@ export class Endpoints {
|
|
7615
7729
|
/** Represents any kind of event.
|
7616
7730
|
*/
|
7617
7731
|
export class Event extends Object {
|
7732
|
+
/**
|
7733
|
+
* The type URI of {@link Event}: `https://www.w3.org/ns/activitystreams#Event`.
|
7734
|
+
*/
|
7735
|
+
static get typeId() {
|
7736
|
+
return new URL("https://www.w3.org/ns/activitystreams#Event");
|
7737
|
+
}
|
7618
7738
|
/**
|
7619
7739
|
* Constructs a new instance of Event with the given values.
|
7620
7740
|
* @param values The values to initialize the instance with.
|
@@ -7716,6 +7836,12 @@ export class Event extends Object {
|
|
7716
7836
|
* inappropriate for any number of reasons.
|
7717
7837
|
*/
|
7718
7838
|
export class Flag extends Activity {
|
7839
|
+
/**
|
7840
|
+
* The type URI of {@link Flag}: `https://www.w3.org/ns/activitystreams#Flag`.
|
7841
|
+
*/
|
7842
|
+
static get typeId() {
|
7843
|
+
return new URL("https://www.w3.org/ns/activitystreams#Flag");
|
7844
|
+
}
|
7719
7845
|
/**
|
7720
7846
|
* Constructs a new instance of Flag with the given values.
|
7721
7847
|
* @param values The values to initialize the instance with.
|
@@ -7818,6 +7944,12 @@ export class Flag extends Activity {
|
|
7818
7944
|
* `origin` typically have no defined meaning.
|
7819
7945
|
*/
|
7820
7946
|
export class Follow extends Activity {
|
7947
|
+
/**
|
7948
|
+
* The type URI of {@link Follow}: `https://www.w3.org/ns/activitystreams#Follow`.
|
7949
|
+
*/
|
7950
|
+
static get typeId() {
|
7951
|
+
return new URL("https://www.w3.org/ns/activitystreams#Follow");
|
7952
|
+
}
|
7821
7953
|
/**
|
7822
7954
|
* Constructs a new instance of Follow with the given values.
|
7823
7955
|
* @param values The values to initialize the instance with.
|
@@ -7917,6 +8049,12 @@ export class Follow extends Activity {
|
|
7917
8049
|
/** Represents a formal or informal collective of Actors.
|
7918
8050
|
*/
|
7919
8051
|
export class Group extends Object {
|
8052
|
+
/**
|
8053
|
+
* The type URI of {@link Group}: `https://www.w3.org/ns/activitystreams#Group`.
|
8054
|
+
*/
|
8055
|
+
static get typeId() {
|
8056
|
+
return new URL("https://www.w3.org/ns/activitystreams#Group");
|
8057
|
+
}
|
7920
8058
|
#_3isuDgRAKSntq9XdbjiNxjwyPZAf = [];
|
7921
8059
|
#_axq166E2eZADq34V4MYUc8KMZdC = [];
|
7922
8060
|
#_36QNc9MxfkKf6h8sEUQSHnV9NZA = [];
|
@@ -8931,6 +9069,12 @@ export class Group extends Object {
|
|
8931
9069
|
/** An image document of any kind.
|
8932
9070
|
*/
|
8933
9071
|
export class Image extends Document {
|
9072
|
+
/**
|
9073
|
+
* The type URI of {@link Image}: `https://www.w3.org/ns/activitystreams#Image`.
|
9074
|
+
*/
|
9075
|
+
static get typeId() {
|
9076
|
+
return new URL("https://www.w3.org/ns/activitystreams#Image");
|
9077
|
+
}
|
8934
9078
|
/**
|
8935
9079
|
* Constructs a new instance of Image with the given values.
|
8936
9080
|
* @param values The values to initialize the instance with.
|
@@ -9032,6 +9176,12 @@ export class Image extends Document {
|
|
9032
9176
|
* inappropriate for these activities.
|
9033
9177
|
*/
|
9034
9178
|
export class IntransitiveActivity extends Activity {
|
9179
|
+
/**
|
9180
|
+
* The type URI of {@link IntransitiveActivity}: `https://www.w3.org/ns/activitystreams#IntransitiveActivity`.
|
9181
|
+
*/
|
9182
|
+
static get typeId() {
|
9183
|
+
return new URL("https://www.w3.org/ns/activitystreams#IntransitiveActivity");
|
9184
|
+
}
|
9035
9185
|
/**
|
9036
9186
|
* Constructs a new instance of IntransitiveActivity with the given values.
|
9037
9187
|
* @param values The values to initialize the instance with.
|
@@ -9134,6 +9284,12 @@ export class IntransitiveActivity extends Activity {
|
|
9134
9284
|
* The `target` and `origin` typically have no defined meaning.
|
9135
9285
|
*/
|
9136
9286
|
export class Like extends Activity {
|
9287
|
+
/**
|
9288
|
+
* The type URI of {@link Like}: `https://www.w3.org/ns/activitystreams#Like`.
|
9289
|
+
*/
|
9290
|
+
static get typeId() {
|
9291
|
+
return new URL("https://www.w3.org/ns/activitystreams#Like");
|
9292
|
+
}
|
9137
9293
|
/**
|
9138
9294
|
* Constructs a new instance of Like with the given values.
|
9139
9295
|
* @param values The values to initialize the instance with.
|
@@ -9245,6 +9401,12 @@ export class Link {
|
|
9245
9401
|
get _documentLoader() {
|
9246
9402
|
return this.#documentLoader;
|
9247
9403
|
}
|
9404
|
+
/**
|
9405
|
+
* The type URI of {@link Link}: `https://www.w3.org/ns/activitystreams#Link`.
|
9406
|
+
*/
|
9407
|
+
static get typeId() {
|
9408
|
+
return new URL("https://www.w3.org/ns/activitystreams#Link");
|
9409
|
+
}
|
9248
9410
|
#_pVjLsybKQdmkjuU7MHjiVmNnuj7 = [];
|
9249
9411
|
#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ = [];
|
9250
9412
|
#_3BLrzmscsjHCw8TF5BHRW9WkPnX8 = [];
|
@@ -9812,6 +9974,12 @@ _c = Link;
|
|
9812
9974
|
/** A specialized {@link Link} that represents an @mention.
|
9813
9975
|
*/
|
9814
9976
|
export class Mention extends Link {
|
9977
|
+
/**
|
9978
|
+
* The type URI of {@link Mention}: `https://www.w3.org/ns/activitystreams#Mention`.
|
9979
|
+
*/
|
9980
|
+
static get typeId() {
|
9981
|
+
return new URL("https://www.w3.org/ns/activitystreams#Mention");
|
9982
|
+
}
|
9815
9983
|
/**
|
9816
9984
|
* Constructs a new instance of Mention with the given values.
|
9817
9985
|
* @param values The values to initialize the instance with.
|
@@ -9912,6 +10080,12 @@ export class Mention extends Link {
|
|
9912
10080
|
* length.
|
9913
10081
|
*/
|
9914
10082
|
export class Note extends Object {
|
10083
|
+
/**
|
10084
|
+
* The type URI of {@link Note}: `https://www.w3.org/ns/activitystreams#Note`.
|
10085
|
+
*/
|
10086
|
+
static get typeId() {
|
10087
|
+
return new URL("https://www.w3.org/ns/activitystreams#Note");
|
10088
|
+
}
|
9915
10089
|
/**
|
9916
10090
|
* Constructs a new instance of Note with the given values.
|
9917
10091
|
* @param values The values to initialize the instance with.
|
@@ -10012,6 +10186,12 @@ export class Note extends Object {
|
|
10012
10186
|
* are assumed to always be strictly ordered.
|
10013
10187
|
*/
|
10014
10188
|
export class OrderedCollection extends Collection {
|
10189
|
+
/**
|
10190
|
+
* The type URI of {@link OrderedCollection}: `https://www.w3.org/ns/activitystreams#OrderedCollection`.
|
10191
|
+
*/
|
10192
|
+
static get typeId() {
|
10193
|
+
return new URL("https://www.w3.org/ns/activitystreams#OrderedCollection");
|
10194
|
+
}
|
10015
10195
|
/**
|
10016
10196
|
* Constructs a new instance of OrderedCollection with the given values.
|
10017
10197
|
* @param values The values to initialize the instance with.
|
@@ -10115,6 +10295,12 @@ export class OrderedCollection extends Collection {
|
|
10115
10295
|
* the `OrderedCollectionPage` object.
|
10116
10296
|
*/
|
10117
10297
|
export class OrderedCollectionPage extends CollectionPage {
|
10298
|
+
/**
|
10299
|
+
* The type URI of {@link OrderedCollectionPage}: `https://www.w3.org/ns/activitystreams#OrderedCollectionPage`.
|
10300
|
+
*/
|
10301
|
+
static get typeId() {
|
10302
|
+
return new URL("https://www.w3.org/ns/activitystreams#OrderedCollectionPage");
|
10303
|
+
}
|
10118
10304
|
#_2W4yinFwqmpneu2h4m1mZ3pcLADd = [];
|
10119
10305
|
/**
|
10120
10306
|
* Constructs a new instance of OrderedCollectionPage with the given values.
|
@@ -10254,6 +10440,12 @@ export class OrderedCollectionPage extends CollectionPage {
|
|
10254
10440
|
/** Represents an organization.
|
10255
10441
|
*/
|
10256
10442
|
export class Organization extends Object {
|
10443
|
+
/**
|
10444
|
+
* The type URI of {@link Organization}: `https://www.w3.org/ns/activitystreams#Organization`.
|
10445
|
+
*/
|
10446
|
+
static get typeId() {
|
10447
|
+
return new URL("https://www.w3.org/ns/activitystreams#Organization");
|
10448
|
+
}
|
10257
10449
|
#_3isuDgRAKSntq9XdbjiNxjwyPZAf = [];
|
10258
10450
|
#_axq166E2eZADq34V4MYUc8KMZdC = [];
|
10259
10451
|
#_36QNc9MxfkKf6h8sEUQSHnV9NZA = [];
|
@@ -11268,6 +11460,12 @@ export class Organization extends Object {
|
|
11268
11460
|
/** Represents a Web Page.
|
11269
11461
|
*/
|
11270
11462
|
export class Page extends Document {
|
11463
|
+
/**
|
11464
|
+
* The type URI of {@link Page}: `https://www.w3.org/ns/activitystreams#Page`.
|
11465
|
+
*/
|
11466
|
+
static get typeId() {
|
11467
|
+
return new URL("https://www.w3.org/ns/activitystreams#Page");
|
11468
|
+
}
|
11271
11469
|
/**
|
11272
11470
|
* Constructs a new instance of Page with the given values.
|
11273
11471
|
* @param values The values to initialize the instance with.
|
@@ -11367,6 +11565,12 @@ export class Page extends Document {
|
|
11367
11565
|
/** Represents an individual person.
|
11368
11566
|
*/
|
11369
11567
|
export class Person extends Object {
|
11568
|
+
/**
|
11569
|
+
* The type URI of {@link Person}: `https://www.w3.org/ns/activitystreams#Person`.
|
11570
|
+
*/
|
11571
|
+
static get typeId() {
|
11572
|
+
return new URL("https://www.w3.org/ns/activitystreams#Person");
|
11573
|
+
}
|
11370
11574
|
#_3isuDgRAKSntq9XdbjiNxjwyPZAf = [];
|
11371
11575
|
#_axq166E2eZADq34V4MYUc8KMZdC = [];
|
11372
11576
|
#_36QNc9MxfkKf6h8sEUQSHnV9NZA = [];
|
@@ -12383,6 +12587,12 @@ export class Person extends Object {
|
|
12383
12587
|
* for additional information.
|
12384
12588
|
*/
|
12385
12589
|
export class Place extends Object {
|
12590
|
+
/**
|
12591
|
+
* The type URI of {@link Place}: `https://www.w3.org/ns/activitystreams#Place`.
|
12592
|
+
*/
|
12593
|
+
static get typeId() {
|
12594
|
+
return new URL("https://www.w3.org/ns/activitystreams#Place");
|
12595
|
+
}
|
12386
12596
|
#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne = [];
|
12387
12597
|
#_3Q6KDcFQUJRRaBux1BL2yp5QWiBi = [];
|
12388
12598
|
#_3g85RoKRnaNjP7DFyLSvsWDg7HGM = [];
|
@@ -12721,6 +12931,12 @@ export class Place extends Object {
|
|
12721
12931
|
* described by the profile.
|
12722
12932
|
*/
|
12723
12933
|
export class Profile extends Object {
|
12934
|
+
/**
|
12935
|
+
* The type URI of {@link Profile}: `https://www.w3.org/ns/activitystreams#Profile`.
|
12936
|
+
*/
|
12937
|
+
static get typeId() {
|
12938
|
+
return new URL("https://www.w3.org/ns/activitystreams#Profile");
|
12939
|
+
}
|
12724
12940
|
#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1 = [];
|
12725
12941
|
/**
|
12726
12942
|
* Constructs a new instance of Profile with the given values.
|
@@ -12899,6 +13115,12 @@ export class Profile extends Object {
|
|
12899
13115
|
* `origin` typically have no defined meaning.
|
12900
13116
|
*/
|
12901
13117
|
export class Reject extends Activity {
|
13118
|
+
/**
|
13119
|
+
* The type URI of {@link Reject}: `https://www.w3.org/ns/activitystreams#Reject`.
|
13120
|
+
*/
|
13121
|
+
static get typeId() {
|
13122
|
+
return new URL("https://www.w3.org/ns/activitystreams#Reject");
|
13123
|
+
}
|
12902
13124
|
/**
|
12903
13125
|
* Constructs a new instance of Reject with the given values.
|
12904
13126
|
* @param values The values to initialize the instance with.
|
@@ -13004,6 +13226,12 @@ export class Reject extends Activity {
|
|
13004
13226
|
* for additional information.
|
13005
13227
|
*/
|
13006
13228
|
export class Relationship extends Object {
|
13229
|
+
/**
|
13230
|
+
* The type URI of {@link Relationship}: `https://www.w3.org/ns/activitystreams#Relationship`.
|
13231
|
+
*/
|
13232
|
+
static get typeId() {
|
13233
|
+
return new URL("https://www.w3.org/ns/activitystreams#Relationship");
|
13234
|
+
}
|
13007
13235
|
#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq = [];
|
13008
13236
|
#_2MH19yxjn1wnHsNfa5n4JBhJzxyc = [];
|
13009
13237
|
#_4Lzz89F9qipAQSGkWyX9DGWiUojG = [];
|
@@ -13431,6 +13659,12 @@ export class Relationship extends Object {
|
|
13431
13659
|
* the `origin` indicates the context from which the `object` is being removed.
|
13432
13660
|
*/
|
13433
13661
|
export class Remove extends Activity {
|
13662
|
+
/**
|
13663
|
+
* The type URI of {@link Remove}: `https://www.w3.org/ns/activitystreams#Remove`.
|
13664
|
+
*/
|
13665
|
+
static get typeId() {
|
13666
|
+
return new URL("https://www.w3.org/ns/activitystreams#Remove");
|
13667
|
+
}
|
13434
13668
|
/**
|
13435
13669
|
* Constructs a new instance of Remove with the given values.
|
13436
13670
|
* @param values The values to initialize the instance with.
|
@@ -13530,6 +13764,12 @@ export class Remove extends Activity {
|
|
13530
13764
|
/** Represents a service of any kind.
|
13531
13765
|
*/
|
13532
13766
|
export class Service extends Object {
|
13767
|
+
/**
|
13768
|
+
* The type URI of {@link Service}: `https://www.w3.org/ns/activitystreams#Service`.
|
13769
|
+
*/
|
13770
|
+
static get typeId() {
|
13771
|
+
return new URL("https://www.w3.org/ns/activitystreams#Service");
|
13772
|
+
}
|
13533
13773
|
#_3isuDgRAKSntq9XdbjiNxjwyPZAf = [];
|
13534
13774
|
#_axq166E2eZADq34V4MYUc8KMZdC = [];
|
13535
13775
|
#_36QNc9MxfkKf6h8sEUQSHnV9NZA = [];
|
@@ -14550,6 +14790,12 @@ export class Service extends Object {
|
|
14550
14790
|
* The `target` and `origin` typically have no defined meaning.
|
14551
14791
|
*/
|
14552
14792
|
export class Undo extends Activity {
|
14793
|
+
/**
|
14794
|
+
* The type URI of {@link Undo}: `https://www.w3.org/ns/activitystreams#Undo`.
|
14795
|
+
*/
|
14796
|
+
static get typeId() {
|
14797
|
+
return new URL("https://www.w3.org/ns/activitystreams#Undo");
|
14798
|
+
}
|
14553
14799
|
/**
|
14554
14800
|
* Constructs a new instance of Undo with the given values.
|
14555
14801
|
* @param values The values to initialize the instance with.
|
@@ -14653,6 +14899,12 @@ export class Undo extends Activity {
|
|
14653
14899
|
* The `target` and `origin` typically have no defined meaning.
|
14654
14900
|
*/
|
14655
14901
|
export class Update extends Activity {
|
14902
|
+
/**
|
14903
|
+
* The type URI of {@link Update}: `https://www.w3.org/ns/activitystreams#Update`.
|
14904
|
+
*/
|
14905
|
+
static get typeId() {
|
14906
|
+
return new URL("https://www.w3.org/ns/activitystreams#Update");
|
14907
|
+
}
|
14656
14908
|
/**
|
14657
14909
|
* Constructs a new instance of Update with the given values.
|
14658
14910
|
* @param values The values to initialize the instance with.
|
@@ -14752,6 +15004,12 @@ export class Update extends Activity {
|
|
14752
15004
|
/** Represents a video document of any kind.
|
14753
15005
|
*/
|
14754
15006
|
export class Video extends Document {
|
15007
|
+
/**
|
15008
|
+
* The type URI of {@link Video}: `https://www.w3.org/ns/activitystreams#Video`.
|
15009
|
+
*/
|
15010
|
+
static get typeId() {
|
15011
|
+
return new URL("https://www.w3.org/ns/activitystreams#Video");
|
15012
|
+
}
|
14755
15013
|
/**
|
14756
15014
|
* Constructs a new instance of Video with the given values.
|
14757
15015
|
* @param values The values to initialize the instance with.
|
package/package.json
CHANGED
@@ -2,6 +2,7 @@ import * as dntShim from "../_dnt.shims.js";
|
|
2
2
|
import type { NodeInfo } from "../nodeinfo/types.js";
|
3
3
|
import type { Actor } from "../vocab/actor.js";
|
4
4
|
import type { Activity, CryptographicKey } from "../vocab/mod.js";
|
5
|
+
import type { Object } from "../vocab/vocab.js";
|
5
6
|
import type { PageItems } from "./collection.js";
|
6
7
|
import type { RequestContext } from "./context.js";
|
7
8
|
/**
|
@@ -22,6 +23,15 @@ export type ActorDispatcher<TContextData> = (context: RequestContext<TContextDat
|
|
22
23
|
* @typeParam TContextData The context data to pass to the {@link Context}.
|
23
24
|
*/
|
24
25
|
export type ActorKeyPairDispatcher<TContextData> = (contextData: TContextData, handle: string) => dntShim.CryptoKeyPair | null | Promise<dntShim.CryptoKeyPair | null>;
|
26
|
+
/**
|
27
|
+
* A callback that dispatches an object.
|
28
|
+
*
|
29
|
+
* @typeParam TContextData The context data to pass to the {@link Context}.
|
30
|
+
* @typeParam TObject The type of object to dispatch.
|
31
|
+
* @typeParam TParam The parameter names of the requested URL.
|
32
|
+
* @since 0.7.0
|
33
|
+
*/
|
34
|
+
export type ObjectDispatcher<TContextData, TObject extends Object, TParam extends string> = (context: RequestContext<TContextData>, values: Record<TParam, string>) => TObject | null | Promise<TObject | null>;
|
25
35
|
/**
|
26
36
|
* A callback that dispatches a collection.
|
27
37
|
*
|
@@ -78,4 +88,21 @@ export type OutboxErrorHandler = (error: Error, activity: Activity | null) => vo
|
|
78
88
|
* @since 0.7.0
|
79
89
|
*/
|
80
90
|
export type AuthorizePredicate<TContextData> = (context: RequestContext<TContextData>, handle: string, signedKey: CryptographicKey | null, signedKeyOwner: Actor | null) => boolean | Promise<boolean>;
|
91
|
+
/**
|
92
|
+
* A callback that determines if a request is authorized or not.
|
93
|
+
*
|
94
|
+
* @typeParam TContextData The context data to pass to the {@link Context}.
|
95
|
+
* @typeParam TParam The parameter names of the requested URL.
|
96
|
+
* @param context The request context.
|
97
|
+
* @param values The parameters of the requested URL.
|
98
|
+
* @param signedKey The key that was used to sign the request, or `null` if
|
99
|
+
* the request was not signed or the signature was invalid.
|
100
|
+
* @param signedKeyOwner The actor that owns the key that was used to sign the
|
101
|
+
* request, or `null` if the request was not signed or the
|
102
|
+
* signature was invalid, or if the key is not associated
|
103
|
+
* with an actor.
|
104
|
+
* @returns `true` if the request is authorized, `false` otherwise.
|
105
|
+
* @since 0.7.0
|
106
|
+
*/
|
107
|
+
export type ObjectAuthorizePredicate<TContextData, TParam extends string> = (context: RequestContext<TContextData>, values: Record<TParam, string>, signedKey: CryptographicKey | null, signedKeyOwner: Actor | null) => boolean | Promise<boolean>;
|
81
108
|
//# sourceMappingURL=callback.d.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I,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAE1B;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAC/B,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,GAAG,IAAI,KACtB,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAE1B;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,kBAAkB,CAAC,YAAY,IAAI,CAC7C,OAAO,EAAE,cAAc,CAAC,YAAY,CAAC,EACrC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,gBAAgB,GAAG,IAAI,EAClC,cAAc,EAAE,KAAK,GAAG,IAAI,KACzB,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAEhC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,wBAAwB,CAAC,YAAY,EAAE,MAAM,SAAS,MAAM,IAAI,CAC1E,OAAO,EAAE,cAAc,CAAC,YAAY,CAAC,EACrC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,SAAS,EAAE,gBAAgB,GAAG,IAAI,EAClC,cAAc,EAAE,KAAK,GAAG,IAAI,KACzB,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC"}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
import * as dntShim from "../_dnt.shims.js";
|
4
4
|
import type { DocumentLoader } from "../runtime/docloader.js";
|
5
5
|
import type { Actor } from "../vocab/actor.js";
|
6
|
-
import type { Activity, CryptographicKey } from "../vocab/mod.js";
|
6
|
+
import type { Activity, CryptographicKey, Object } from "../vocab/mod.js";
|
7
7
|
/**
|
8
8
|
* A context.
|
9
9
|
*/
|
@@ -30,6 +30,18 @@ export interface Context<TContextData> {
|
|
30
30
|
* @throws {RouterError} If no actor dispatcher is available.
|
31
31
|
*/
|
32
32
|
getActorUri(handle: string): URL;
|
33
|
+
/**
|
34
|
+
* Builds the URI of an object with the given class and values.
|
35
|
+
* @param cls The class of the object.
|
36
|
+
* @param values The values to pass to the object dispatcher.
|
37
|
+
* @returns The object's URI.
|
38
|
+
* @throws {RouteError} If no object dispatcher is available for the class.
|
39
|
+
* @throws {TypeError} If values are invalid.
|
40
|
+
* @since 0.7.0
|
41
|
+
*/
|
42
|
+
getObjectUri<TObject extends Object>(cls: (new (...args: any[]) => TObject) & {
|
43
|
+
typeId: URL;
|
44
|
+
}, values: Record<string, string>): URL;
|
33
45
|
/**
|
34
46
|
* Builds the URI of an actor's outbox with the given handle.
|
35
47
|
* @param handle The actor's handle.
|
@@ -131,6 +143,27 @@ export interface RequestContext<TContextData> extends Context<TContextData> {
|
|
131
143
|
* The URL of the request.
|
132
144
|
*/
|
133
145
|
readonly url: URL;
|
146
|
+
/**
|
147
|
+
* Gets an {@link Actor} object for the given handle.
|
148
|
+
* @param handle The actor's handle.
|
149
|
+
* @returns The actor object, or `null` if the actor is not found.
|
150
|
+
* @throws {Error} If no actor dispatcher is available.
|
151
|
+
* @since 0.7.0
|
152
|
+
*/
|
153
|
+
getActor(handle: string): Promise<Actor | null>;
|
154
|
+
/**
|
155
|
+
* Gets an object of the given class with the given values.
|
156
|
+
* @param cls The class to instantiate.
|
157
|
+
* @param values The values to pass to the object dispatcher.
|
158
|
+
* @returns The object of the given class with the given values, or `null`
|
159
|
+
* if the object is not found.
|
160
|
+
* @throws {Error} If no object dispatcher is available for the class.
|
161
|
+
* @throws {TypeError} If values are invalid.
|
162
|
+
* @since 0.7.0
|
163
|
+
*/
|
164
|
+
getObject<TObject extends Object>(cls: (new (...args: any[]) => TObject) & {
|
165
|
+
typeId: URL;
|
166
|
+
}, values: Record<string, string>): Promise<TObject | null>;
|
134
167
|
/**
|
135
168
|
* Gets the public key of the sender, if any exists and it is verified.
|
136
169
|
* Otherwise, `null` is returned.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/federation/context.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,OAAO,MAA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