@fedify/fedify 0.12.0-dev.268 → 0.12.0-dev.276
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGES.md +72 -0
- package/FEDERATION.md +6 -0
- package/esm/runtime/docloader.js +3 -0
- package/esm/runtime/url.js +75 -0
- package/esm/vocab/move.yaml +13 -0
- package/esm/vocab/read.yaml +11 -0
- package/esm/vocab/tentativeaccept.yaml +12 -0
- package/esm/vocab/tentativereject.yaml +12 -0
- package/esm/vocab/travel.yaml +14 -0
- package/esm/vocab/view.yaml +11 -0
- package/esm/vocab/vocab.js +1033 -144
- package/package.json +1 -1
- package/types/runtime/docloader.d.ts.map +1 -1
- package/types/runtime/url.d.ts +11 -0
- package/types/runtime/url.d.ts.map +1 -0
- package/types/runtime/url.test.d.ts.map +1 -0
- package/types/vocab/vocab.d.ts +1095 -110
- package/types/vocab/vocab.d.ts.map +1 -1
package/esm/vocab/vocab.js
CHANGED
@@ -3114,6 +3114,10 @@ export class Object {
|
|
3114
3114
|
delete values["@type"];
|
3115
3115
|
return await Accept.fromJsonLd(values, options);
|
3116
3116
|
}
|
3117
|
+
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#TentativeAccept")) {
|
3118
|
+
delete values["@type"];
|
3119
|
+
return await TentativeAccept.fromJsonLd(values, options);
|
3120
|
+
}
|
3117
3121
|
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Add")) {
|
3118
3122
|
delete values["@type"];
|
3119
3123
|
return await Add.fromJsonLd(values, options);
|
@@ -3162,6 +3166,10 @@ export class Object {
|
|
3162
3166
|
delete values["@type"];
|
3163
3167
|
return await Question.fromJsonLd(values, options);
|
3164
3168
|
}
|
3169
|
+
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Travel")) {
|
3170
|
+
delete values["@type"];
|
3171
|
+
return await Travel.fromJsonLd(values, options);
|
3172
|
+
}
|
3165
3173
|
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Join")) {
|
3166
3174
|
delete values["@type"];
|
3167
3175
|
return await Join.fromJsonLd(values, options);
|
@@ -3178,6 +3186,10 @@ export class Object {
|
|
3178
3186
|
delete values["@type"];
|
3179
3187
|
return await Listen.fromJsonLd(values, options);
|
3180
3188
|
}
|
3189
|
+
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Move")) {
|
3190
|
+
delete values["@type"];
|
3191
|
+
return await Move.fromJsonLd(values, options);
|
3192
|
+
}
|
3181
3193
|
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Offer")) {
|
3182
3194
|
delete values["@type"];
|
3183
3195
|
return await Offer.fromJsonLd(values, options);
|
@@ -3186,10 +3198,18 @@ export class Object {
|
|
3186
3198
|
delete values["@type"];
|
3187
3199
|
return await Invite.fromJsonLd(values, options);
|
3188
3200
|
}
|
3201
|
+
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Read")) {
|
3202
|
+
delete values["@type"];
|
3203
|
+
return await Read.fromJsonLd(values, options);
|
3204
|
+
}
|
3189
3205
|
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Reject")) {
|
3190
3206
|
delete values["@type"];
|
3191
3207
|
return await Reject.fromJsonLd(values, options);
|
3192
3208
|
}
|
3209
|
+
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#TentativeReject")) {
|
3210
|
+
delete values["@type"];
|
3211
|
+
return await TentativeReject.fromJsonLd(values, options);
|
3212
|
+
}
|
3193
3213
|
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Remove")) {
|
3194
3214
|
delete values["@type"];
|
3195
3215
|
return await Remove.fromJsonLd(values, options);
|
@@ -3202,6 +3222,10 @@ export class Object {
|
|
3202
3222
|
delete values["@type"];
|
3203
3223
|
return await Update.fromJsonLd(values, options);
|
3204
3224
|
}
|
3225
|
+
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#View")) {
|
3226
|
+
delete values["@type"];
|
3227
|
+
return await View.fromJsonLd(values, options);
|
3228
|
+
}
|
3205
3229
|
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Application")) {
|
3206
3230
|
delete values["@type"];
|
3207
3231
|
return await Application.fromJsonLd(values, options);
|
@@ -3314,6 +3338,7 @@ export class Object {
|
|
3314
3338
|
"http://litepub.social/ns#ChatMessage",
|
3315
3339
|
"https://www.w3.org/ns/activitystreams#Activity",
|
3316
3340
|
"https://www.w3.org/ns/activitystreams#Accept",
|
3341
|
+
"https://www.w3.org/ns/activitystreams#TentativeAccept",
|
3317
3342
|
"https://www.w3.org/ns/activitystreams#Add",
|
3318
3343
|
"https://www.w3.org/ns/activitystreams#Announce",
|
3319
3344
|
"https://www.w3.org/ns/activitystreams#Create",
|
@@ -3326,16 +3351,21 @@ export class Object {
|
|
3326
3351
|
"https://www.w3.org/ns/activitystreams#IntransitiveActivity",
|
3327
3352
|
"https://www.w3.org/ns/activitystreams#Arrive",
|
3328
3353
|
"https://www.w3.org/ns/activitystreams#Question",
|
3354
|
+
"https://www.w3.org/ns/activitystreams#Travel",
|
3329
3355
|
"https://www.w3.org/ns/activitystreams#Join",
|
3330
3356
|
"https://www.w3.org/ns/activitystreams#Leave",
|
3331
3357
|
"https://www.w3.org/ns/activitystreams#Like",
|
3332
3358
|
"https://www.w3.org/ns/activitystreams#Listen",
|
3359
|
+
"https://www.w3.org/ns/activitystreams#Move",
|
3333
3360
|
"https://www.w3.org/ns/activitystreams#Offer",
|
3334
3361
|
"https://www.w3.org/ns/activitystreams#Invite",
|
3362
|
+
"https://www.w3.org/ns/activitystreams#Read",
|
3335
3363
|
"https://www.w3.org/ns/activitystreams#Reject",
|
3364
|
+
"https://www.w3.org/ns/activitystreams#TentativeReject",
|
3336
3365
|
"https://www.w3.org/ns/activitystreams#Remove",
|
3337
3366
|
"https://www.w3.org/ns/activitystreams#Undo",
|
3338
3367
|
"https://www.w3.org/ns/activitystreams#Update",
|
3368
|
+
"https://www.w3.org/ns/activitystreams#View",
|
3339
3369
|
"https://www.w3.org/ns/activitystreams#Application",
|
3340
3370
|
"https://www.w3.org/ns/activitystreams#Article",
|
3341
3371
|
"https://www.w3.org/ns/activitystreams#Collection",
|
@@ -3482,6 +3512,7 @@ export class Object {
|
|
3482
3512
|
"http://litepub.social/ns#ChatMessage",
|
3483
3513
|
"https://www.w3.org/ns/activitystreams#Activity",
|
3484
3514
|
"https://www.w3.org/ns/activitystreams#Accept",
|
3515
|
+
"https://www.w3.org/ns/activitystreams#TentativeAccept",
|
3485
3516
|
"https://www.w3.org/ns/activitystreams#Add",
|
3486
3517
|
"https://www.w3.org/ns/activitystreams#Announce",
|
3487
3518
|
"https://www.w3.org/ns/activitystreams#Create",
|
@@ -3494,16 +3525,21 @@ export class Object {
|
|
3494
3525
|
"https://www.w3.org/ns/activitystreams#IntransitiveActivity",
|
3495
3526
|
"https://www.w3.org/ns/activitystreams#Arrive",
|
3496
3527
|
"https://www.w3.org/ns/activitystreams#Question",
|
3528
|
+
"https://www.w3.org/ns/activitystreams#Travel",
|
3497
3529
|
"https://www.w3.org/ns/activitystreams#Join",
|
3498
3530
|
"https://www.w3.org/ns/activitystreams#Leave",
|
3499
3531
|
"https://www.w3.org/ns/activitystreams#Like",
|
3500
3532
|
"https://www.w3.org/ns/activitystreams#Listen",
|
3533
|
+
"https://www.w3.org/ns/activitystreams#Move",
|
3501
3534
|
"https://www.w3.org/ns/activitystreams#Offer",
|
3502
3535
|
"https://www.w3.org/ns/activitystreams#Invite",
|
3536
|
+
"https://www.w3.org/ns/activitystreams#Read",
|
3503
3537
|
"https://www.w3.org/ns/activitystreams#Reject",
|
3538
|
+
"https://www.w3.org/ns/activitystreams#TentativeReject",
|
3504
3539
|
"https://www.w3.org/ns/activitystreams#Remove",
|
3505
3540
|
"https://www.w3.org/ns/activitystreams#Undo",
|
3506
3541
|
"https://www.w3.org/ns/activitystreams#Update",
|
3542
|
+
"https://www.w3.org/ns/activitystreams#View",
|
3507
3543
|
"https://www.w3.org/ns/activitystreams#Application",
|
3508
3544
|
"https://www.w3.org/ns/activitystreams#Article",
|
3509
3545
|
"https://www.w3.org/ns/activitystreams#Collection",
|
@@ -3600,6 +3636,7 @@ export class Object {
|
|
3600
3636
|
"http://litepub.social/ns#ChatMessage",
|
3601
3637
|
"https://www.w3.org/ns/activitystreams#Activity",
|
3602
3638
|
"https://www.w3.org/ns/activitystreams#Accept",
|
3639
|
+
"https://www.w3.org/ns/activitystreams#TentativeAccept",
|
3603
3640
|
"https://www.w3.org/ns/activitystreams#Add",
|
3604
3641
|
"https://www.w3.org/ns/activitystreams#Announce",
|
3605
3642
|
"https://www.w3.org/ns/activitystreams#Create",
|
@@ -3612,16 +3649,21 @@ export class Object {
|
|
3612
3649
|
"https://www.w3.org/ns/activitystreams#IntransitiveActivity",
|
3613
3650
|
"https://www.w3.org/ns/activitystreams#Arrive",
|
3614
3651
|
"https://www.w3.org/ns/activitystreams#Question",
|
3652
|
+
"https://www.w3.org/ns/activitystreams#Travel",
|
3615
3653
|
"https://www.w3.org/ns/activitystreams#Join",
|
3616
3654
|
"https://www.w3.org/ns/activitystreams#Leave",
|
3617
3655
|
"https://www.w3.org/ns/activitystreams#Like",
|
3618
3656
|
"https://www.w3.org/ns/activitystreams#Listen",
|
3657
|
+
"https://www.w3.org/ns/activitystreams#Move",
|
3619
3658
|
"https://www.w3.org/ns/activitystreams#Offer",
|
3620
3659
|
"https://www.w3.org/ns/activitystreams#Invite",
|
3660
|
+
"https://www.w3.org/ns/activitystreams#Read",
|
3621
3661
|
"https://www.w3.org/ns/activitystreams#Reject",
|
3662
|
+
"https://www.w3.org/ns/activitystreams#TentativeReject",
|
3622
3663
|
"https://www.w3.org/ns/activitystreams#Remove",
|
3623
3664
|
"https://www.w3.org/ns/activitystreams#Undo",
|
3624
3665
|
"https://www.w3.org/ns/activitystreams#Update",
|
3666
|
+
"https://www.w3.org/ns/activitystreams#View",
|
3625
3667
|
"https://www.w3.org/ns/activitystreams#Application",
|
3626
3668
|
"https://www.w3.org/ns/activitystreams#Article",
|
3627
3669
|
"https://www.w3.org/ns/activitystreams#Collection",
|
@@ -3718,6 +3760,7 @@ export class Object {
|
|
3718
3760
|
"http://litepub.social/ns#ChatMessage",
|
3719
3761
|
"https://www.w3.org/ns/activitystreams#Activity",
|
3720
3762
|
"https://www.w3.org/ns/activitystreams#Accept",
|
3763
|
+
"https://www.w3.org/ns/activitystreams#TentativeAccept",
|
3721
3764
|
"https://www.w3.org/ns/activitystreams#Add",
|
3722
3765
|
"https://www.w3.org/ns/activitystreams#Announce",
|
3723
3766
|
"https://www.w3.org/ns/activitystreams#Create",
|
@@ -3730,16 +3773,21 @@ export class Object {
|
|
3730
3773
|
"https://www.w3.org/ns/activitystreams#IntransitiveActivity",
|
3731
3774
|
"https://www.w3.org/ns/activitystreams#Arrive",
|
3732
3775
|
"https://www.w3.org/ns/activitystreams#Question",
|
3776
|
+
"https://www.w3.org/ns/activitystreams#Travel",
|
3733
3777
|
"https://www.w3.org/ns/activitystreams#Join",
|
3734
3778
|
"https://www.w3.org/ns/activitystreams#Leave",
|
3735
3779
|
"https://www.w3.org/ns/activitystreams#Like",
|
3736
3780
|
"https://www.w3.org/ns/activitystreams#Listen",
|
3781
|
+
"https://www.w3.org/ns/activitystreams#Move",
|
3737
3782
|
"https://www.w3.org/ns/activitystreams#Offer",
|
3738
3783
|
"https://www.w3.org/ns/activitystreams#Invite",
|
3784
|
+
"https://www.w3.org/ns/activitystreams#Read",
|
3739
3785
|
"https://www.w3.org/ns/activitystreams#Reject",
|
3786
|
+
"https://www.w3.org/ns/activitystreams#TentativeReject",
|
3740
3787
|
"https://www.w3.org/ns/activitystreams#Remove",
|
3741
3788
|
"https://www.w3.org/ns/activitystreams#Undo",
|
3742
3789
|
"https://www.w3.org/ns/activitystreams#Update",
|
3790
|
+
"https://www.w3.org/ns/activitystreams#View",
|
3743
3791
|
"https://www.w3.org/ns/activitystreams#Application",
|
3744
3792
|
"https://www.w3.org/ns/activitystreams#Article",
|
3745
3793
|
"https://www.w3.org/ns/activitystreams#Collection",
|
@@ -3800,6 +3848,7 @@ export class Object {
|
|
3800
3848
|
"http://litepub.social/ns#ChatMessage",
|
3801
3849
|
"https://www.w3.org/ns/activitystreams#Activity",
|
3802
3850
|
"https://www.w3.org/ns/activitystreams#Accept",
|
3851
|
+
"https://www.w3.org/ns/activitystreams#TentativeAccept",
|
3803
3852
|
"https://www.w3.org/ns/activitystreams#Add",
|
3804
3853
|
"https://www.w3.org/ns/activitystreams#Announce",
|
3805
3854
|
"https://www.w3.org/ns/activitystreams#Create",
|
@@ -3812,16 +3861,21 @@ export class Object {
|
|
3812
3861
|
"https://www.w3.org/ns/activitystreams#IntransitiveActivity",
|
3813
3862
|
"https://www.w3.org/ns/activitystreams#Arrive",
|
3814
3863
|
"https://www.w3.org/ns/activitystreams#Question",
|
3864
|
+
"https://www.w3.org/ns/activitystreams#Travel",
|
3815
3865
|
"https://www.w3.org/ns/activitystreams#Join",
|
3816
3866
|
"https://www.w3.org/ns/activitystreams#Leave",
|
3817
3867
|
"https://www.w3.org/ns/activitystreams#Like",
|
3818
3868
|
"https://www.w3.org/ns/activitystreams#Listen",
|
3869
|
+
"https://www.w3.org/ns/activitystreams#Move",
|
3819
3870
|
"https://www.w3.org/ns/activitystreams#Offer",
|
3820
3871
|
"https://www.w3.org/ns/activitystreams#Invite",
|
3872
|
+
"https://www.w3.org/ns/activitystreams#Read",
|
3821
3873
|
"https://www.w3.org/ns/activitystreams#Reject",
|
3874
|
+
"https://www.w3.org/ns/activitystreams#TentativeReject",
|
3822
3875
|
"https://www.w3.org/ns/activitystreams#Remove",
|
3823
3876
|
"https://www.w3.org/ns/activitystreams#Undo",
|
3824
3877
|
"https://www.w3.org/ns/activitystreams#Update",
|
3878
|
+
"https://www.w3.org/ns/activitystreams#View",
|
3825
3879
|
"https://www.w3.org/ns/activitystreams#Application",
|
3826
3880
|
"https://www.w3.org/ns/activitystreams#Article",
|
3827
3881
|
"https://www.w3.org/ns/activitystreams#Collection",
|
@@ -3890,6 +3944,7 @@ export class Object {
|
|
3890
3944
|
"http://litepub.social/ns#ChatMessage",
|
3891
3945
|
"https://www.w3.org/ns/activitystreams#Activity",
|
3892
3946
|
"https://www.w3.org/ns/activitystreams#Accept",
|
3947
|
+
"https://www.w3.org/ns/activitystreams#TentativeAccept",
|
3893
3948
|
"https://www.w3.org/ns/activitystreams#Add",
|
3894
3949
|
"https://www.w3.org/ns/activitystreams#Announce",
|
3895
3950
|
"https://www.w3.org/ns/activitystreams#Create",
|
@@ -3902,16 +3957,21 @@ export class Object {
|
|
3902
3957
|
"https://www.w3.org/ns/activitystreams#IntransitiveActivity",
|
3903
3958
|
"https://www.w3.org/ns/activitystreams#Arrive",
|
3904
3959
|
"https://www.w3.org/ns/activitystreams#Question",
|
3960
|
+
"https://www.w3.org/ns/activitystreams#Travel",
|
3905
3961
|
"https://www.w3.org/ns/activitystreams#Join",
|
3906
3962
|
"https://www.w3.org/ns/activitystreams#Leave",
|
3907
3963
|
"https://www.w3.org/ns/activitystreams#Like",
|
3908
3964
|
"https://www.w3.org/ns/activitystreams#Listen",
|
3965
|
+
"https://www.w3.org/ns/activitystreams#Move",
|
3909
3966
|
"https://www.w3.org/ns/activitystreams#Offer",
|
3910
3967
|
"https://www.w3.org/ns/activitystreams#Invite",
|
3968
|
+
"https://www.w3.org/ns/activitystreams#Read",
|
3911
3969
|
"https://www.w3.org/ns/activitystreams#Reject",
|
3970
|
+
"https://www.w3.org/ns/activitystreams#TentativeReject",
|
3912
3971
|
"https://www.w3.org/ns/activitystreams#Remove",
|
3913
3972
|
"https://www.w3.org/ns/activitystreams#Undo",
|
3914
3973
|
"https://www.w3.org/ns/activitystreams#Update",
|
3974
|
+
"https://www.w3.org/ns/activitystreams#View",
|
3915
3975
|
"https://www.w3.org/ns/activitystreams#Application",
|
3916
3976
|
"https://www.w3.org/ns/activitystreams#Article",
|
3917
3977
|
"https://www.w3.org/ns/activitystreams#Collection",
|
@@ -4031,6 +4091,7 @@ export class Object {
|
|
4031
4091
|
"http://litepub.social/ns#ChatMessage",
|
4032
4092
|
"https://www.w3.org/ns/activitystreams#Activity",
|
4033
4093
|
"https://www.w3.org/ns/activitystreams#Accept",
|
4094
|
+
"https://www.w3.org/ns/activitystreams#TentativeAccept",
|
4034
4095
|
"https://www.w3.org/ns/activitystreams#Add",
|
4035
4096
|
"https://www.w3.org/ns/activitystreams#Announce",
|
4036
4097
|
"https://www.w3.org/ns/activitystreams#Create",
|
@@ -4043,16 +4104,21 @@ export class Object {
|
|
4043
4104
|
"https://www.w3.org/ns/activitystreams#IntransitiveActivity",
|
4044
4105
|
"https://www.w3.org/ns/activitystreams#Arrive",
|
4045
4106
|
"https://www.w3.org/ns/activitystreams#Question",
|
4107
|
+
"https://www.w3.org/ns/activitystreams#Travel",
|
4046
4108
|
"https://www.w3.org/ns/activitystreams#Join",
|
4047
4109
|
"https://www.w3.org/ns/activitystreams#Leave",
|
4048
4110
|
"https://www.w3.org/ns/activitystreams#Like",
|
4049
4111
|
"https://www.w3.org/ns/activitystreams#Listen",
|
4112
|
+
"https://www.w3.org/ns/activitystreams#Move",
|
4050
4113
|
"https://www.w3.org/ns/activitystreams#Offer",
|
4051
4114
|
"https://www.w3.org/ns/activitystreams#Invite",
|
4115
|
+
"https://www.w3.org/ns/activitystreams#Read",
|
4052
4116
|
"https://www.w3.org/ns/activitystreams#Reject",
|
4117
|
+
"https://www.w3.org/ns/activitystreams#TentativeReject",
|
4053
4118
|
"https://www.w3.org/ns/activitystreams#Remove",
|
4054
4119
|
"https://www.w3.org/ns/activitystreams#Undo",
|
4055
4120
|
"https://www.w3.org/ns/activitystreams#Update",
|
4121
|
+
"https://www.w3.org/ns/activitystreams#View",
|
4056
4122
|
"https://www.w3.org/ns/activitystreams#Application",
|
4057
4123
|
"https://www.w3.org/ns/activitystreams#Article",
|
4058
4124
|
"https://www.w3.org/ns/activitystreams#Collection",
|
@@ -7571,6 +7637,10 @@ export class Activity extends Object {
|
|
7571
7637
|
delete values["@type"];
|
7572
7638
|
return await Accept.fromJsonLd(values, options);
|
7573
7639
|
}
|
7640
|
+
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#TentativeAccept")) {
|
7641
|
+
delete values["@type"];
|
7642
|
+
return await TentativeAccept.fromJsonLd(values, options);
|
7643
|
+
}
|
7574
7644
|
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Add")) {
|
7575
7645
|
delete values["@type"];
|
7576
7646
|
return await Add.fromJsonLd(values, options);
|
@@ -7619,6 +7689,10 @@ export class Activity extends Object {
|
|
7619
7689
|
delete values["@type"];
|
7620
7690
|
return await Question.fromJsonLd(values, options);
|
7621
7691
|
}
|
7692
|
+
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Travel")) {
|
7693
|
+
delete values["@type"];
|
7694
|
+
return await Travel.fromJsonLd(values, options);
|
7695
|
+
}
|
7622
7696
|
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Join")) {
|
7623
7697
|
delete values["@type"];
|
7624
7698
|
return await Join.fromJsonLd(values, options);
|
@@ -7635,6 +7709,10 @@ export class Activity extends Object {
|
|
7635
7709
|
delete values["@type"];
|
7636
7710
|
return await Listen.fromJsonLd(values, options);
|
7637
7711
|
}
|
7712
|
+
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Move")) {
|
7713
|
+
delete values["@type"];
|
7714
|
+
return await Move.fromJsonLd(values, options);
|
7715
|
+
}
|
7638
7716
|
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Offer")) {
|
7639
7717
|
delete values["@type"];
|
7640
7718
|
return await Offer.fromJsonLd(values, options);
|
@@ -7643,10 +7721,18 @@ export class Activity extends Object {
|
|
7643
7721
|
delete values["@type"];
|
7644
7722
|
return await Invite.fromJsonLd(values, options);
|
7645
7723
|
}
|
7724
|
+
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Read")) {
|
7725
|
+
delete values["@type"];
|
7726
|
+
return await Read.fromJsonLd(values, options);
|
7727
|
+
}
|
7646
7728
|
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Reject")) {
|
7647
7729
|
delete values["@type"];
|
7648
7730
|
return await Reject.fromJsonLd(values, options);
|
7649
7731
|
}
|
7732
|
+
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#TentativeReject")) {
|
7733
|
+
delete values["@type"];
|
7734
|
+
return await TentativeReject.fromJsonLd(values, options);
|
7735
|
+
}
|
7650
7736
|
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Remove")) {
|
7651
7737
|
delete values["@type"];
|
7652
7738
|
return await Remove.fromJsonLd(values, options);
|
@@ -7659,6 +7745,10 @@ export class Activity extends Object {
|
|
7659
7745
|
delete values["@type"];
|
7660
7746
|
return await Update.fromJsonLd(values, options);
|
7661
7747
|
}
|
7748
|
+
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#View")) {
|
7749
|
+
delete values["@type"];
|
7750
|
+
return await View.fromJsonLd(values, options);
|
7751
|
+
}
|
7662
7752
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Activity")) {
|
7663
7753
|
throw new TypeError("Invalid type: " + values["@type"]);
|
7664
7754
|
}
|
@@ -8014,6 +8104,10 @@ export class Accept extends Activity {
|
|
8014
8104
|
(expanded[0] ?? {});
|
8015
8105
|
}
|
8016
8106
|
if ("@type" in values) {
|
8107
|
+
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#TentativeAccept")) {
|
8108
|
+
delete values["@type"];
|
8109
|
+
return await TentativeAccept.fromJsonLd(values, options);
|
8110
|
+
}
|
8017
8111
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Accept")) {
|
8018
8112
|
throw new TypeError("Invalid type: " + values["@type"]);
|
8019
8113
|
}
|
@@ -10405,6 +10499,10 @@ export class IntransitiveActivity extends Activity {
|
|
10405
10499
|
delete values["@type"];
|
10406
10500
|
return await Question.fromJsonLd(values, options);
|
10407
10501
|
}
|
10502
|
+
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Travel")) {
|
10503
|
+
delete values["@type"];
|
10504
|
+
return await Travel.fromJsonLd(values, options);
|
10505
|
+
}
|
10408
10506
|
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#IntransitiveActivity")) {
|
10409
10507
|
throw new TypeError("Invalid type: " + values["@type"]);
|
10410
10508
|
}
|
@@ -11982,6 +12080,7 @@ export class Collection extends Object {
|
|
11982
12080
|
"http://litepub.social/ns#ChatMessage",
|
11983
12081
|
"https://www.w3.org/ns/activitystreams#Activity",
|
11984
12082
|
"https://www.w3.org/ns/activitystreams#Accept",
|
12083
|
+
"https://www.w3.org/ns/activitystreams#TentativeAccept",
|
11985
12084
|
"https://www.w3.org/ns/activitystreams#Add",
|
11986
12085
|
"https://www.w3.org/ns/activitystreams#Announce",
|
11987
12086
|
"https://www.w3.org/ns/activitystreams#Create",
|
@@ -11994,16 +12093,21 @@ export class Collection extends Object {
|
|
11994
12093
|
"https://www.w3.org/ns/activitystreams#IntransitiveActivity",
|
11995
12094
|
"https://www.w3.org/ns/activitystreams#Arrive",
|
11996
12095
|
"https://www.w3.org/ns/activitystreams#Question",
|
12096
|
+
"https://www.w3.org/ns/activitystreams#Travel",
|
11997
12097
|
"https://www.w3.org/ns/activitystreams#Join",
|
11998
12098
|
"https://www.w3.org/ns/activitystreams#Leave",
|
11999
12099
|
"https://www.w3.org/ns/activitystreams#Like",
|
12000
12100
|
"https://www.w3.org/ns/activitystreams#Listen",
|
12101
|
+
"https://www.w3.org/ns/activitystreams#Move",
|
12001
12102
|
"https://www.w3.org/ns/activitystreams#Offer",
|
12002
12103
|
"https://www.w3.org/ns/activitystreams#Invite",
|
12104
|
+
"https://www.w3.org/ns/activitystreams#Read",
|
12003
12105
|
"https://www.w3.org/ns/activitystreams#Reject",
|
12106
|
+
"https://www.w3.org/ns/activitystreams#TentativeReject",
|
12004
12107
|
"https://www.w3.org/ns/activitystreams#Remove",
|
12005
12108
|
"https://www.w3.org/ns/activitystreams#Undo",
|
12006
12109
|
"https://www.w3.org/ns/activitystreams#Update",
|
12110
|
+
"https://www.w3.org/ns/activitystreams#View",
|
12007
12111
|
"https://www.w3.org/ns/activitystreams#Application",
|
12008
12112
|
"https://www.w3.org/ns/activitystreams#Article",
|
12009
12113
|
"https://www.w3.org/ns/activitystreams#Collection",
|
@@ -16601,6 +16705,7 @@ export class Link {
|
|
16601
16705
|
"http://litepub.social/ns#ChatMessage",
|
16602
16706
|
"https://www.w3.org/ns/activitystreams#Activity",
|
16603
16707
|
"https://www.w3.org/ns/activitystreams#Accept",
|
16708
|
+
"https://www.w3.org/ns/activitystreams#TentativeAccept",
|
16604
16709
|
"https://www.w3.org/ns/activitystreams#Add",
|
16605
16710
|
"https://www.w3.org/ns/activitystreams#Announce",
|
16606
16711
|
"https://www.w3.org/ns/activitystreams#Create",
|
@@ -16613,16 +16718,21 @@ export class Link {
|
|
16613
16718
|
"https://www.w3.org/ns/activitystreams#IntransitiveActivity",
|
16614
16719
|
"https://www.w3.org/ns/activitystreams#Arrive",
|
16615
16720
|
"https://www.w3.org/ns/activitystreams#Question",
|
16721
|
+
"https://www.w3.org/ns/activitystreams#Travel",
|
16616
16722
|
"https://www.w3.org/ns/activitystreams#Join",
|
16617
16723
|
"https://www.w3.org/ns/activitystreams#Leave",
|
16618
16724
|
"https://www.w3.org/ns/activitystreams#Like",
|
16619
16725
|
"https://www.w3.org/ns/activitystreams#Listen",
|
16726
|
+
"https://www.w3.org/ns/activitystreams#Move",
|
16620
16727
|
"https://www.w3.org/ns/activitystreams#Offer",
|
16621
16728
|
"https://www.w3.org/ns/activitystreams#Invite",
|
16729
|
+
"https://www.w3.org/ns/activitystreams#Read",
|
16622
16730
|
"https://www.w3.org/ns/activitystreams#Reject",
|
16731
|
+
"https://www.w3.org/ns/activitystreams#TentativeReject",
|
16623
16732
|
"https://www.w3.org/ns/activitystreams#Remove",
|
16624
16733
|
"https://www.w3.org/ns/activitystreams#Undo",
|
16625
16734
|
"https://www.w3.org/ns/activitystreams#Update",
|
16735
|
+
"https://www.w3.org/ns/activitystreams#View",
|
16626
16736
|
"https://www.w3.org/ns/activitystreams#Application",
|
16627
16737
|
"https://www.w3.org/ns/activitystreams#Article",
|
16628
16738
|
"https://www.w3.org/ns/activitystreams#Collection",
|
@@ -17889,6 +17999,134 @@ export class Mention extends Link {
|
|
17889
17999
|
return "Mention " + inspect(proxy, options);
|
17890
18000
|
}
|
17891
18001
|
}
|
18002
|
+
/** Indicates that the `actor` has moved `object` from `origin` to `target`.
|
18003
|
+
* If the `origin` or `target` are not specified,
|
18004
|
+
* either can be determined by context.
|
18005
|
+
*/
|
18006
|
+
export class Move extends Activity {
|
18007
|
+
/**
|
18008
|
+
* The type URI of {@link Move}: `https://www.w3.org/ns/activitystreams#Move`.
|
18009
|
+
*/
|
18010
|
+
static get typeId() {
|
18011
|
+
return new URL("https://www.w3.org/ns/activitystreams#Move");
|
18012
|
+
}
|
18013
|
+
/**
|
18014
|
+
* Constructs a new instance of Move with the given values.
|
18015
|
+
* @param values The values to initialize the instance with.
|
18016
|
+
* @param options The options to use for initialization.
|
18017
|
+
*/
|
18018
|
+
constructor(values, { documentLoader, contextLoader, } = {}) {
|
18019
|
+
super(values, { documentLoader, contextLoader });
|
18020
|
+
}
|
18021
|
+
/**
|
18022
|
+
* Clones this instance, optionally updating it with the given values.
|
18023
|
+
* @param values The values to update the clone with.
|
18024
|
+
* @options The options to use for cloning.
|
18025
|
+
* @returns The cloned instance.
|
18026
|
+
*/
|
18027
|
+
clone(values = {}, options = {}) {
|
18028
|
+
const clone = super.clone(values, options);
|
18029
|
+
return clone;
|
18030
|
+
}
|
18031
|
+
/**
|
18032
|
+
* Converts this object to a JSON-LD structure.
|
18033
|
+
* @returns The JSON-LD representation of this object.
|
18034
|
+
*/
|
18035
|
+
async toJsonLd(options = {}) {
|
18036
|
+
options = {
|
18037
|
+
...options,
|
18038
|
+
contextLoader: options.contextLoader ?? fetchDocumentLoader,
|
18039
|
+
};
|
18040
|
+
// deno-lint-ignore no-unused-vars prefer-const
|
18041
|
+
let array;
|
18042
|
+
const baseValues = await super.toJsonLd({
|
18043
|
+
...options,
|
18044
|
+
expand: true,
|
18045
|
+
});
|
18046
|
+
const values = baseValues[0];
|
18047
|
+
values["@type"] = ["https://www.w3.org/ns/activitystreams#Move"];
|
18048
|
+
if (this.id)
|
18049
|
+
values["@id"] = this.id.href;
|
18050
|
+
if (options.expand) {
|
18051
|
+
return await jsonld.expand(values, { documentLoader: options.contextLoader });
|
18052
|
+
}
|
18053
|
+
const docContext = options.context ??
|
18054
|
+
[
|
18055
|
+
"https://www.w3.org/ns/activitystreams",
|
18056
|
+
"https://w3id.org/security/data-integrity/v1",
|
18057
|
+
];
|
18058
|
+
const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
|
18059
|
+
if (docContext != null) {
|
18060
|
+
// Embed context
|
18061
|
+
if ("proof" in compacted &&
|
18062
|
+
compacted.proof != null) {
|
18063
|
+
if (Array.isArray(compacted.proof)) {
|
18064
|
+
for (const element of compacted.proof) {
|
18065
|
+
element["@context"] = docContext;
|
18066
|
+
}
|
18067
|
+
}
|
18068
|
+
else {
|
18069
|
+
compacted.proof["@context"] = docContext;
|
18070
|
+
}
|
18071
|
+
}
|
18072
|
+
}
|
18073
|
+
return compacted;
|
18074
|
+
}
|
18075
|
+
/**
|
18076
|
+
* Converts a JSON-LD structure to an object of this type.
|
18077
|
+
* @param json The JSON-LD structure to convert.
|
18078
|
+
* @returns The object of this type.
|
18079
|
+
* @throws {TypeError} If the given `json` is invalid.
|
18080
|
+
*/
|
18081
|
+
static async fromJsonLd(json, options = {}) {
|
18082
|
+
if (typeof json === "undefined") {
|
18083
|
+
throw new TypeError("Invalid JSON-LD: undefined.");
|
18084
|
+
}
|
18085
|
+
else if (json === null)
|
18086
|
+
throw new TypeError("Invalid JSON-LD: null.");
|
18087
|
+
options = {
|
18088
|
+
...options,
|
18089
|
+
documentLoader: options.documentLoader ?? fetchDocumentLoader,
|
18090
|
+
contextLoader: options.contextLoader ?? fetchDocumentLoader,
|
18091
|
+
};
|
18092
|
+
// deno-lint-ignore no-explicit-any
|
18093
|
+
let values;
|
18094
|
+
if (globalThis.Object.keys(json).length == 0) {
|
18095
|
+
values = {};
|
18096
|
+
}
|
18097
|
+
else {
|
18098
|
+
const expanded = await jsonld.expand(json, {
|
18099
|
+
documentLoader: options.contextLoader,
|
18100
|
+
keepFreeFloatingNodes: true,
|
18101
|
+
});
|
18102
|
+
values =
|
18103
|
+
// deno-lint-ignore no-explicit-any
|
18104
|
+
(expanded[0] ?? {});
|
18105
|
+
}
|
18106
|
+
if ("@type" in values) {
|
18107
|
+
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Move")) {
|
18108
|
+
throw new TypeError("Invalid type: " + values["@type"]);
|
18109
|
+
}
|
18110
|
+
}
|
18111
|
+
const instance = await super.fromJsonLd(values, options);
|
18112
|
+
if (!(instance instanceof Move)) {
|
18113
|
+
throw new TypeError("Unexpected type: " + instance.constructor.name);
|
18114
|
+
}
|
18115
|
+
return instance;
|
18116
|
+
}
|
18117
|
+
_getCustomInspectProxy() {
|
18118
|
+
const proxy = super._getCustomInspectProxy();
|
18119
|
+
return proxy;
|
18120
|
+
}
|
18121
|
+
[Symbol.for("Deno.customInspect")](inspect, options) {
|
18122
|
+
const proxy = this._getCustomInspectProxy();
|
18123
|
+
return "Move " + inspect(proxy, options);
|
18124
|
+
}
|
18125
|
+
[Symbol.for("nodejs.util.inspect.custom")](_depth, options, inspect) {
|
18126
|
+
const proxy = this._getCustomInspectProxy();
|
18127
|
+
return "Move " + inspect(proxy, options);
|
18128
|
+
}
|
18129
|
+
}
|
17892
18130
|
/** Represents a short written work typically less than a single paragraph in
|
17893
18131
|
* length.
|
17894
18132
|
*/
|
@@ -18266,6 +18504,7 @@ export class OrderedCollection extends Collection {
|
|
18266
18504
|
"http://litepub.social/ns#ChatMessage",
|
18267
18505
|
"https://www.w3.org/ns/activitystreams#Activity",
|
18268
18506
|
"https://www.w3.org/ns/activitystreams#Accept",
|
18507
|
+
"https://www.w3.org/ns/activitystreams#TentativeAccept",
|
18269
18508
|
"https://www.w3.org/ns/activitystreams#Add",
|
18270
18509
|
"https://www.w3.org/ns/activitystreams#Announce",
|
18271
18510
|
"https://www.w3.org/ns/activitystreams#Create",
|
@@ -18278,16 +18517,21 @@ export class OrderedCollection extends Collection {
|
|
18278
18517
|
"https://www.w3.org/ns/activitystreams#IntransitiveActivity",
|
18279
18518
|
"https://www.w3.org/ns/activitystreams#Arrive",
|
18280
18519
|
"https://www.w3.org/ns/activitystreams#Question",
|
18520
|
+
"https://www.w3.org/ns/activitystreams#Travel",
|
18281
18521
|
"https://www.w3.org/ns/activitystreams#Join",
|
18282
18522
|
"https://www.w3.org/ns/activitystreams#Leave",
|
18283
18523
|
"https://www.w3.org/ns/activitystreams#Like",
|
18284
18524
|
"https://www.w3.org/ns/activitystreams#Listen",
|
18525
|
+
"https://www.w3.org/ns/activitystreams#Move",
|
18285
18526
|
"https://www.w3.org/ns/activitystreams#Offer",
|
18286
18527
|
"https://www.w3.org/ns/activitystreams#Invite",
|
18528
|
+
"https://www.w3.org/ns/activitystreams#Read",
|
18287
18529
|
"https://www.w3.org/ns/activitystreams#Reject",
|
18530
|
+
"https://www.w3.org/ns/activitystreams#TentativeReject",
|
18288
18531
|
"https://www.w3.org/ns/activitystreams#Remove",
|
18289
18532
|
"https://www.w3.org/ns/activitystreams#Undo",
|
18290
18533
|
"https://www.w3.org/ns/activitystreams#Update",
|
18534
|
+
"https://www.w3.org/ns/activitystreams#View",
|
18291
18535
|
"https://www.w3.org/ns/activitystreams#Application",
|
18292
18536
|
"https://www.w3.org/ns/activitystreams#Article",
|
18293
18537
|
"https://www.w3.org/ns/activitystreams#Collection",
|
@@ -18641,6 +18885,7 @@ export class OrderedCollectionPage extends CollectionPage {
|
|
18641
18885
|
"http://litepub.social/ns#ChatMessage",
|
18642
18886
|
"https://www.w3.org/ns/activitystreams#Activity",
|
18643
18887
|
"https://www.w3.org/ns/activitystreams#Accept",
|
18888
|
+
"https://www.w3.org/ns/activitystreams#TentativeAccept",
|
18644
18889
|
"https://www.w3.org/ns/activitystreams#Add",
|
18645
18890
|
"https://www.w3.org/ns/activitystreams#Announce",
|
18646
18891
|
"https://www.w3.org/ns/activitystreams#Create",
|
@@ -18653,16 +18898,21 @@ export class OrderedCollectionPage extends CollectionPage {
|
|
18653
18898
|
"https://www.w3.org/ns/activitystreams#IntransitiveActivity",
|
18654
18899
|
"https://www.w3.org/ns/activitystreams#Arrive",
|
18655
18900
|
"https://www.w3.org/ns/activitystreams#Question",
|
18901
|
+
"https://www.w3.org/ns/activitystreams#Travel",
|
18656
18902
|
"https://www.w3.org/ns/activitystreams#Join",
|
18657
18903
|
"https://www.w3.org/ns/activitystreams#Leave",
|
18658
18904
|
"https://www.w3.org/ns/activitystreams#Like",
|
18659
18905
|
"https://www.w3.org/ns/activitystreams#Listen",
|
18906
|
+
"https://www.w3.org/ns/activitystreams#Move",
|
18660
18907
|
"https://www.w3.org/ns/activitystreams#Offer",
|
18661
18908
|
"https://www.w3.org/ns/activitystreams#Invite",
|
18909
|
+
"https://www.w3.org/ns/activitystreams#Read",
|
18662
18910
|
"https://www.w3.org/ns/activitystreams#Reject",
|
18911
|
+
"https://www.w3.org/ns/activitystreams#TentativeReject",
|
18663
18912
|
"https://www.w3.org/ns/activitystreams#Remove",
|
18664
18913
|
"https://www.w3.org/ns/activitystreams#Undo",
|
18665
18914
|
"https://www.w3.org/ns/activitystreams#Update",
|
18915
|
+
"https://www.w3.org/ns/activitystreams#View",
|
18666
18916
|
"https://www.w3.org/ns/activitystreams#Application",
|
18667
18917
|
"https://www.w3.org/ns/activitystreams#Article",
|
18668
18918
|
"https://www.w3.org/ns/activitystreams#Collection",
|
@@ -24018,18 +24268,17 @@ export class Question extends IntransitiveActivity {
|
|
24018
24268
|
return "Question " + inspect(proxy, options);
|
24019
24269
|
}
|
24020
24270
|
}
|
24021
|
-
/** Indicates that the `actor`
|
24022
|
-
* `origin` typically have no defined meaning.
|
24271
|
+
/** Indicates that the `actor` has read the `object`.
|
24023
24272
|
*/
|
24024
|
-
export class
|
24273
|
+
export class Read extends Activity {
|
24025
24274
|
/**
|
24026
|
-
* The type URI of {@link
|
24275
|
+
* The type URI of {@link Read}: `https://www.w3.org/ns/activitystreams#Read`.
|
24027
24276
|
*/
|
24028
24277
|
static get typeId() {
|
24029
|
-
return new URL("https://www.w3.org/ns/activitystreams#
|
24278
|
+
return new URL("https://www.w3.org/ns/activitystreams#Read");
|
24030
24279
|
}
|
24031
24280
|
/**
|
24032
|
-
* Constructs a new instance of
|
24281
|
+
* Constructs a new instance of Read with the given values.
|
24033
24282
|
* @param values The values to initialize the instance with.
|
24034
24283
|
* @param options The options to use for initialization.
|
24035
24284
|
*/
|
@@ -24062,7 +24311,7 @@ export class Reject extends Activity {
|
|
24062
24311
|
expand: true,
|
24063
24312
|
});
|
24064
24313
|
const values = baseValues[0];
|
24065
|
-
values["@type"] = ["https://www.w3.org/ns/activitystreams#
|
24314
|
+
values["@type"] = ["https://www.w3.org/ns/activitystreams#Read"];
|
24066
24315
|
if (this.id)
|
24067
24316
|
values["@id"] = this.id.href;
|
24068
24317
|
if (options.expand) {
|
@@ -24122,12 +24371,12 @@ export class Reject extends Activity {
|
|
24122
24371
|
(expanded[0] ?? {});
|
24123
24372
|
}
|
24124
24373
|
if ("@type" in values) {
|
24125
|
-
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#
|
24374
|
+
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Read")) {
|
24126
24375
|
throw new TypeError("Invalid type: " + values["@type"]);
|
24127
24376
|
}
|
24128
24377
|
}
|
24129
24378
|
const instance = await super.fromJsonLd(values, options);
|
24130
|
-
if (!(instance instanceof
|
24379
|
+
if (!(instance instanceof Read)) {
|
24131
24380
|
throw new TypeError("Unexpected type: " + instance.constructor.name);
|
24132
24381
|
}
|
24133
24382
|
return instance;
|
@@ -24138,101 +24387,30 @@ export class Reject extends Activity {
|
|
24138
24387
|
}
|
24139
24388
|
[Symbol.for("Deno.customInspect")](inspect, options) {
|
24140
24389
|
const proxy = this._getCustomInspectProxy();
|
24141
|
-
return "
|
24390
|
+
return "Read " + inspect(proxy, options);
|
24142
24391
|
}
|
24143
24392
|
[Symbol.for("nodejs.util.inspect.custom")](_depth, options, inspect) {
|
24144
24393
|
const proxy = this._getCustomInspectProxy();
|
24145
|
-
return "
|
24394
|
+
return "Read " + inspect(proxy, options);
|
24146
24395
|
}
|
24147
24396
|
}
|
24148
|
-
/**
|
24149
|
-
*
|
24150
|
-
* are used to identify the connected individuals.
|
24151
|
-
*
|
24152
|
-
* See [5.2 Representing Relationships Between
|
24153
|
-
* Entities](https://www.w3.org/TR/activitystreams-vocabulary/#connections)
|
24154
|
-
* for additional information.
|
24397
|
+
/** Indicates that the `actor` is rejecting the `object`. The `target` and
|
24398
|
+
* `origin` typically have no defined meaning.
|
24155
24399
|
*/
|
24156
|
-
export class
|
24400
|
+
export class Reject extends Activity {
|
24157
24401
|
/**
|
24158
|
-
* The type URI of {@link
|
24402
|
+
* The type URI of {@link Reject}: `https://www.w3.org/ns/activitystreams#Reject`.
|
24159
24403
|
*/
|
24160
24404
|
static get typeId() {
|
24161
|
-
return new URL("https://www.w3.org/ns/activitystreams#
|
24405
|
+
return new URL("https://www.w3.org/ns/activitystreams#Reject");
|
24162
24406
|
}
|
24163
|
-
#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq = [];
|
24164
|
-
#_2MH19yxjn1wnHsNfa5n4JBhJzxyc = [];
|
24165
|
-
#_4Lzz89F9qipAQSGkWyX9DGWiUojG = [];
|
24166
24407
|
/**
|
24167
|
-
* Constructs a new instance of
|
24408
|
+
* Constructs a new instance of Reject with the given values.
|
24168
24409
|
* @param values The values to initialize the instance with.
|
24169
24410
|
* @param options The options to use for initialization.
|
24170
24411
|
*/
|
24171
24412
|
constructor(values, { documentLoader, contextLoader, } = {}) {
|
24172
24413
|
super(values, { documentLoader, contextLoader });
|
24173
|
-
if ("subject" in values && values.subject != null) {
|
24174
|
-
if (values.subject instanceof Object || values.subject instanceof URL) {
|
24175
|
-
// @ts-ignore: type is checked above.
|
24176
|
-
this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq = [values.subject];
|
24177
|
-
}
|
24178
|
-
else {
|
24179
|
-
throw new TypeError("The subject must be of type " +
|
24180
|
-
"Object | URL" + ".");
|
24181
|
-
}
|
24182
|
-
}
|
24183
|
-
if ("object" in values && values.object != null) {
|
24184
|
-
if (values.object instanceof Object || values.object instanceof URL) {
|
24185
|
-
// @ts-ignore: type is checked above.
|
24186
|
-
this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc = [values.object];
|
24187
|
-
}
|
24188
|
-
else {
|
24189
|
-
throw new TypeError("The object must be of type " +
|
24190
|
-
"Object | URL" + ".");
|
24191
|
-
}
|
24192
|
-
}
|
24193
|
-
if ("objects" in values && values.objects != null) {
|
24194
|
-
if ("object" in values &&
|
24195
|
-
values.object != null) {
|
24196
|
-
throw new TypeError("Cannot initialize both object and " +
|
24197
|
-
"objects at the same time.");
|
24198
|
-
}
|
24199
|
-
if (Array.isArray(values.objects) &&
|
24200
|
-
values.objects.every((v) => v instanceof Object || v instanceof URL)) {
|
24201
|
-
// @ts-ignore: type is checked above.
|
24202
|
-
this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc = values.objects;
|
24203
|
-
}
|
24204
|
-
else {
|
24205
|
-
throw new TypeError("The objects must be an array of type " +
|
24206
|
-
"Object | URL" + ".");
|
24207
|
-
}
|
24208
|
-
}
|
24209
|
-
if ("relationship" in values && values.relationship != null) {
|
24210
|
-
if (values.relationship instanceof Object ||
|
24211
|
-
values.relationship instanceof URL) {
|
24212
|
-
// @ts-ignore: type is checked above.
|
24213
|
-
this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG = [values.relationship];
|
24214
|
-
}
|
24215
|
-
else {
|
24216
|
-
throw new TypeError("The relationship must be of type " +
|
24217
|
-
"Object | URL" + ".");
|
24218
|
-
}
|
24219
|
-
}
|
24220
|
-
if ("relationships" in values && values.relationships != null) {
|
24221
|
-
if ("relationship" in values &&
|
24222
|
-
values.relationship != null) {
|
24223
|
-
throw new TypeError("Cannot initialize both relationship and " +
|
24224
|
-
"relationships at the same time.");
|
24225
|
-
}
|
24226
|
-
if (Array.isArray(values.relationships) &&
|
24227
|
-
values.relationships.every((v) => v instanceof Object || v instanceof URL)) {
|
24228
|
-
// @ts-ignore: type is checked above.
|
24229
|
-
this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG = values.relationships;
|
24230
|
-
}
|
24231
|
-
else {
|
24232
|
-
throw new TypeError("The relationships must be an array of type " +
|
24233
|
-
"Object | URL" + ".");
|
24234
|
-
}
|
24235
|
-
}
|
24236
24414
|
}
|
24237
24415
|
/**
|
24238
24416
|
* Clones this instance, optionally updating it with the given values.
|
@@ -24242,24 +24420,226 @@ export class Relationship extends Object {
|
|
24242
24420
|
*/
|
24243
24421
|
clone(values = {}, options = {}) {
|
24244
24422
|
const clone = super.clone(values, options);
|
24245
|
-
clone
|
24246
|
-
|
24247
|
-
|
24248
|
-
|
24249
|
-
|
24250
|
-
|
24251
|
-
|
24252
|
-
|
24253
|
-
|
24254
|
-
|
24255
|
-
}
|
24256
|
-
|
24257
|
-
|
24258
|
-
|
24259
|
-
|
24260
|
-
|
24261
|
-
|
24262
|
-
|
24423
|
+
return clone;
|
24424
|
+
}
|
24425
|
+
/**
|
24426
|
+
* Converts this object to a JSON-LD structure.
|
24427
|
+
* @returns The JSON-LD representation of this object.
|
24428
|
+
*/
|
24429
|
+
async toJsonLd(options = {}) {
|
24430
|
+
options = {
|
24431
|
+
...options,
|
24432
|
+
contextLoader: options.contextLoader ?? fetchDocumentLoader,
|
24433
|
+
};
|
24434
|
+
// deno-lint-ignore no-unused-vars prefer-const
|
24435
|
+
let array;
|
24436
|
+
const baseValues = await super.toJsonLd({
|
24437
|
+
...options,
|
24438
|
+
expand: true,
|
24439
|
+
});
|
24440
|
+
const values = baseValues[0];
|
24441
|
+
values["@type"] = ["https://www.w3.org/ns/activitystreams#Reject"];
|
24442
|
+
if (this.id)
|
24443
|
+
values["@id"] = this.id.href;
|
24444
|
+
if (options.expand) {
|
24445
|
+
return await jsonld.expand(values, { documentLoader: options.contextLoader });
|
24446
|
+
}
|
24447
|
+
const docContext = options.context ??
|
24448
|
+
[
|
24449
|
+
"https://www.w3.org/ns/activitystreams",
|
24450
|
+
"https://w3id.org/security/data-integrity/v1",
|
24451
|
+
];
|
24452
|
+
const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
|
24453
|
+
if (docContext != null) {
|
24454
|
+
// Embed context
|
24455
|
+
if ("proof" in compacted &&
|
24456
|
+
compacted.proof != null) {
|
24457
|
+
if (Array.isArray(compacted.proof)) {
|
24458
|
+
for (const element of compacted.proof) {
|
24459
|
+
element["@context"] = docContext;
|
24460
|
+
}
|
24461
|
+
}
|
24462
|
+
else {
|
24463
|
+
compacted.proof["@context"] = docContext;
|
24464
|
+
}
|
24465
|
+
}
|
24466
|
+
}
|
24467
|
+
return compacted;
|
24468
|
+
}
|
24469
|
+
/**
|
24470
|
+
* Converts a JSON-LD structure to an object of this type.
|
24471
|
+
* @param json The JSON-LD structure to convert.
|
24472
|
+
* @returns The object of this type.
|
24473
|
+
* @throws {TypeError} If the given `json` is invalid.
|
24474
|
+
*/
|
24475
|
+
static async fromJsonLd(json, options = {}) {
|
24476
|
+
if (typeof json === "undefined") {
|
24477
|
+
throw new TypeError("Invalid JSON-LD: undefined.");
|
24478
|
+
}
|
24479
|
+
else if (json === null)
|
24480
|
+
throw new TypeError("Invalid JSON-LD: null.");
|
24481
|
+
options = {
|
24482
|
+
...options,
|
24483
|
+
documentLoader: options.documentLoader ?? fetchDocumentLoader,
|
24484
|
+
contextLoader: options.contextLoader ?? fetchDocumentLoader,
|
24485
|
+
};
|
24486
|
+
// deno-lint-ignore no-explicit-any
|
24487
|
+
let values;
|
24488
|
+
if (globalThis.Object.keys(json).length == 0) {
|
24489
|
+
values = {};
|
24490
|
+
}
|
24491
|
+
else {
|
24492
|
+
const expanded = await jsonld.expand(json, {
|
24493
|
+
documentLoader: options.contextLoader,
|
24494
|
+
keepFreeFloatingNodes: true,
|
24495
|
+
});
|
24496
|
+
values =
|
24497
|
+
// deno-lint-ignore no-explicit-any
|
24498
|
+
(expanded[0] ?? {});
|
24499
|
+
}
|
24500
|
+
if ("@type" in values) {
|
24501
|
+
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#TentativeReject")) {
|
24502
|
+
delete values["@type"];
|
24503
|
+
return await TentativeReject.fromJsonLd(values, options);
|
24504
|
+
}
|
24505
|
+
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Reject")) {
|
24506
|
+
throw new TypeError("Invalid type: " + values["@type"]);
|
24507
|
+
}
|
24508
|
+
}
|
24509
|
+
const instance = await super.fromJsonLd(values, options);
|
24510
|
+
if (!(instance instanceof Reject)) {
|
24511
|
+
throw new TypeError("Unexpected type: " + instance.constructor.name);
|
24512
|
+
}
|
24513
|
+
return instance;
|
24514
|
+
}
|
24515
|
+
_getCustomInspectProxy() {
|
24516
|
+
const proxy = super._getCustomInspectProxy();
|
24517
|
+
return proxy;
|
24518
|
+
}
|
24519
|
+
[Symbol.for("Deno.customInspect")](inspect, options) {
|
24520
|
+
const proxy = this._getCustomInspectProxy();
|
24521
|
+
return "Reject " + inspect(proxy, options);
|
24522
|
+
}
|
24523
|
+
[Symbol.for("nodejs.util.inspect.custom")](_depth, options, inspect) {
|
24524
|
+
const proxy = this._getCustomInspectProxy();
|
24525
|
+
return "Reject " + inspect(proxy, options);
|
24526
|
+
}
|
24527
|
+
}
|
24528
|
+
/** Describes a relationship between two individuals.
|
24529
|
+
* The {@link Relationship.subject} and {@link Relationship.object} properties
|
24530
|
+
* are used to identify the connected individuals.
|
24531
|
+
*
|
24532
|
+
* See [5.2 Representing Relationships Between
|
24533
|
+
* Entities](https://www.w3.org/TR/activitystreams-vocabulary/#connections)
|
24534
|
+
* for additional information.
|
24535
|
+
*/
|
24536
|
+
export class Relationship extends Object {
|
24537
|
+
/**
|
24538
|
+
* The type URI of {@link Relationship}: `https://www.w3.org/ns/activitystreams#Relationship`.
|
24539
|
+
*/
|
24540
|
+
static get typeId() {
|
24541
|
+
return new URL("https://www.w3.org/ns/activitystreams#Relationship");
|
24542
|
+
}
|
24543
|
+
#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq = [];
|
24544
|
+
#_2MH19yxjn1wnHsNfa5n4JBhJzxyc = [];
|
24545
|
+
#_4Lzz89F9qipAQSGkWyX9DGWiUojG = [];
|
24546
|
+
/**
|
24547
|
+
* Constructs a new instance of Relationship with the given values.
|
24548
|
+
* @param values The values to initialize the instance with.
|
24549
|
+
* @param options The options to use for initialization.
|
24550
|
+
*/
|
24551
|
+
constructor(values, { documentLoader, contextLoader, } = {}) {
|
24552
|
+
super(values, { documentLoader, contextLoader });
|
24553
|
+
if ("subject" in values && values.subject != null) {
|
24554
|
+
if (values.subject instanceof Object || values.subject instanceof URL) {
|
24555
|
+
// @ts-ignore: type is checked above.
|
24556
|
+
this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq = [values.subject];
|
24557
|
+
}
|
24558
|
+
else {
|
24559
|
+
throw new TypeError("The subject must be of type " +
|
24560
|
+
"Object | URL" + ".");
|
24561
|
+
}
|
24562
|
+
}
|
24563
|
+
if ("object" in values && values.object != null) {
|
24564
|
+
if (values.object instanceof Object || values.object instanceof URL) {
|
24565
|
+
// @ts-ignore: type is checked above.
|
24566
|
+
this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc = [values.object];
|
24567
|
+
}
|
24568
|
+
else {
|
24569
|
+
throw new TypeError("The object must be of type " +
|
24570
|
+
"Object | URL" + ".");
|
24571
|
+
}
|
24572
|
+
}
|
24573
|
+
if ("objects" in values && values.objects != null) {
|
24574
|
+
if ("object" in values &&
|
24575
|
+
values.object != null) {
|
24576
|
+
throw new TypeError("Cannot initialize both object and " +
|
24577
|
+
"objects at the same time.");
|
24578
|
+
}
|
24579
|
+
if (Array.isArray(values.objects) &&
|
24580
|
+
values.objects.every((v) => v instanceof Object || v instanceof URL)) {
|
24581
|
+
// @ts-ignore: type is checked above.
|
24582
|
+
this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc = values.objects;
|
24583
|
+
}
|
24584
|
+
else {
|
24585
|
+
throw new TypeError("The objects must be an array of type " +
|
24586
|
+
"Object | URL" + ".");
|
24587
|
+
}
|
24588
|
+
}
|
24589
|
+
if ("relationship" in values && values.relationship != null) {
|
24590
|
+
if (values.relationship instanceof Object ||
|
24591
|
+
values.relationship instanceof URL) {
|
24592
|
+
// @ts-ignore: type is checked above.
|
24593
|
+
this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG = [values.relationship];
|
24594
|
+
}
|
24595
|
+
else {
|
24596
|
+
throw new TypeError("The relationship must be of type " +
|
24597
|
+
"Object | URL" + ".");
|
24598
|
+
}
|
24599
|
+
}
|
24600
|
+
if ("relationships" in values && values.relationships != null) {
|
24601
|
+
if ("relationship" in values &&
|
24602
|
+
values.relationship != null) {
|
24603
|
+
throw new TypeError("Cannot initialize both relationship and " +
|
24604
|
+
"relationships at the same time.");
|
24605
|
+
}
|
24606
|
+
if (Array.isArray(values.relationships) &&
|
24607
|
+
values.relationships.every((v) => v instanceof Object || v instanceof URL)) {
|
24608
|
+
// @ts-ignore: type is checked above.
|
24609
|
+
this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG = values.relationships;
|
24610
|
+
}
|
24611
|
+
else {
|
24612
|
+
throw new TypeError("The relationships must be an array of type " +
|
24613
|
+
"Object | URL" + ".");
|
24614
|
+
}
|
24615
|
+
}
|
24616
|
+
}
|
24617
|
+
/**
|
24618
|
+
* Clones this instance, optionally updating it with the given values.
|
24619
|
+
* @param values The values to update the clone with.
|
24620
|
+
* @options The options to use for cloning.
|
24621
|
+
* @returns The cloned instance.
|
24622
|
+
*/
|
24623
|
+
clone(values = {}, options = {}) {
|
24624
|
+
const clone = super.clone(values, options);
|
24625
|
+
clone.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq = this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq;
|
24626
|
+
if ("subject" in values && values.subject != null) {
|
24627
|
+
if (values.subject instanceof Object || values.subject instanceof URL) {
|
24628
|
+
// @ts-ignore: type is checked above.
|
24629
|
+
clone.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq = [values.subject];
|
24630
|
+
}
|
24631
|
+
else {
|
24632
|
+
throw new TypeError("The subject must be of type " +
|
24633
|
+
"Object | URL" + ".");
|
24634
|
+
}
|
24635
|
+
}
|
24636
|
+
clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc;
|
24637
|
+
if ("object" in values && values.object != null) {
|
24638
|
+
if (values.object instanceof Object || values.object instanceof URL) {
|
24639
|
+
// @ts-ignore: type is checked above.
|
24640
|
+
clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc = [values.object];
|
24641
|
+
}
|
24642
|
+
else {
|
24263
24643
|
throw new TypeError("The object must be of type " +
|
24264
24644
|
"Object | URL" + ".");
|
24265
24645
|
}
|
@@ -26875,35 +27255,23 @@ export class Service extends Object {
|
|
26875
27255
|
return "Service " + inspect(proxy, options);
|
26876
27256
|
}
|
26877
27257
|
}
|
26878
|
-
/** A
|
26879
|
-
*
|
26880
|
-
* an object at this position, but it has been deleted.
|
27258
|
+
/** A specialization of {@link Accept} indicating that
|
27259
|
+
* the acceptance is tentative.
|
26881
27260
|
*/
|
26882
|
-
export class
|
27261
|
+
export class TentativeAccept extends Accept {
|
26883
27262
|
/**
|
26884
|
-
* The type URI of {@link
|
27263
|
+
* The type URI of {@link TentativeAccept}: `https://www.w3.org/ns/activitystreams#TentativeAccept`.
|
26885
27264
|
*/
|
26886
27265
|
static get typeId() {
|
26887
|
-
return new URL("https://www.w3.org/ns/activitystreams#
|
27266
|
+
return new URL("https://www.w3.org/ns/activitystreams#TentativeAccept");
|
26888
27267
|
}
|
26889
|
-
#_8g8g4LiVMhFTXskuDEqx4ascxUr = [];
|
26890
27268
|
/**
|
26891
|
-
* Constructs a new instance of
|
27269
|
+
* Constructs a new instance of TentativeAccept with the given values.
|
26892
27270
|
* @param values The values to initialize the instance with.
|
26893
27271
|
* @param options The options to use for initialization.
|
26894
27272
|
*/
|
26895
27273
|
constructor(values, { documentLoader, contextLoader, } = {}) {
|
26896
27274
|
super(values, { documentLoader, contextLoader });
|
26897
|
-
if ("deleted" in values && values.deleted != null) {
|
26898
|
-
if (values.deleted instanceof dntShim.Temporal.Instant) {
|
26899
|
-
// @ts-ignore: type is checked above.
|
26900
|
-
this.#_8g8g4LiVMhFTXskuDEqx4ascxUr = [values.deleted];
|
26901
|
-
}
|
26902
|
-
else {
|
26903
|
-
throw new TypeError("The deleted must be of type " +
|
26904
|
-
"Temporal.Instant" + ".");
|
26905
|
-
}
|
26906
|
-
}
|
26907
27275
|
}
|
26908
27276
|
/**
|
26909
27277
|
* Clones this instance, optionally updating it with the given values.
|
@@ -26913,27 +27281,8 @@ export class Tombstone extends Object {
|
|
26913
27281
|
*/
|
26914
27282
|
clone(values = {}, options = {}) {
|
26915
27283
|
const clone = super.clone(values, options);
|
26916
|
-
clone.#_8g8g4LiVMhFTXskuDEqx4ascxUr = this.#_8g8g4LiVMhFTXskuDEqx4ascxUr;
|
26917
|
-
if ("deleted" in values && values.deleted != null) {
|
26918
|
-
if (values.deleted instanceof dntShim.Temporal.Instant) {
|
26919
|
-
// @ts-ignore: type is checked above.
|
26920
|
-
clone.#_8g8g4LiVMhFTXskuDEqx4ascxUr = [values.deleted];
|
26921
|
-
}
|
26922
|
-
else {
|
26923
|
-
throw new TypeError("The deleted must be of type " +
|
26924
|
-
"Temporal.Instant" + ".");
|
26925
|
-
}
|
26926
|
-
}
|
26927
27284
|
return clone;
|
26928
27285
|
}
|
26929
|
-
/** On a `Tombstone` object, the `deleted` property is a timestamp for when
|
26930
|
-
* the object was deleted.
|
26931
|
-
*/
|
26932
|
-
get deleted() {
|
26933
|
-
if (this.#_8g8g4LiVMhFTXskuDEqx4ascxUr.length < 1)
|
26934
|
-
return null;
|
26935
|
-
return this.#_8g8g4LiVMhFTXskuDEqx4ascxUr[0];
|
26936
|
-
}
|
26937
27286
|
/**
|
26938
27287
|
* Converts this object to a JSON-LD structure.
|
26939
27288
|
* @returns The JSON-LD representation of this object.
|
@@ -26950,7 +27299,292 @@ export class Tombstone extends Object {
|
|
26950
27299
|
expand: true,
|
26951
27300
|
});
|
26952
27301
|
const values = baseValues[0];
|
26953
|
-
|
27302
|
+
values["@type"] = ["https://www.w3.org/ns/activitystreams#TentativeAccept"];
|
27303
|
+
if (this.id)
|
27304
|
+
values["@id"] = this.id.href;
|
27305
|
+
if (options.expand) {
|
27306
|
+
return await jsonld.expand(values, { documentLoader: options.contextLoader });
|
27307
|
+
}
|
27308
|
+
const docContext = options.context ??
|
27309
|
+
[
|
27310
|
+
"https://www.w3.org/ns/activitystreams",
|
27311
|
+
"https://w3id.org/security/data-integrity/v1",
|
27312
|
+
];
|
27313
|
+
const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
|
27314
|
+
if (docContext != null) {
|
27315
|
+
// Embed context
|
27316
|
+
if ("proof" in compacted &&
|
27317
|
+
compacted.proof != null) {
|
27318
|
+
if (Array.isArray(compacted.proof)) {
|
27319
|
+
for (const element of compacted.proof) {
|
27320
|
+
element["@context"] = docContext;
|
27321
|
+
}
|
27322
|
+
}
|
27323
|
+
else {
|
27324
|
+
compacted.proof["@context"] = docContext;
|
27325
|
+
}
|
27326
|
+
}
|
27327
|
+
}
|
27328
|
+
return compacted;
|
27329
|
+
}
|
27330
|
+
/**
|
27331
|
+
* Converts a JSON-LD structure to an object of this type.
|
27332
|
+
* @param json The JSON-LD structure to convert.
|
27333
|
+
* @returns The object of this type.
|
27334
|
+
* @throws {TypeError} If the given `json` is invalid.
|
27335
|
+
*/
|
27336
|
+
static async fromJsonLd(json, options = {}) {
|
27337
|
+
if (typeof json === "undefined") {
|
27338
|
+
throw new TypeError("Invalid JSON-LD: undefined.");
|
27339
|
+
}
|
27340
|
+
else if (json === null)
|
27341
|
+
throw new TypeError("Invalid JSON-LD: null.");
|
27342
|
+
options = {
|
27343
|
+
...options,
|
27344
|
+
documentLoader: options.documentLoader ?? fetchDocumentLoader,
|
27345
|
+
contextLoader: options.contextLoader ?? fetchDocumentLoader,
|
27346
|
+
};
|
27347
|
+
// deno-lint-ignore no-explicit-any
|
27348
|
+
let values;
|
27349
|
+
if (globalThis.Object.keys(json).length == 0) {
|
27350
|
+
values = {};
|
27351
|
+
}
|
27352
|
+
else {
|
27353
|
+
const expanded = await jsonld.expand(json, {
|
27354
|
+
documentLoader: options.contextLoader,
|
27355
|
+
keepFreeFloatingNodes: true,
|
27356
|
+
});
|
27357
|
+
values =
|
27358
|
+
// deno-lint-ignore no-explicit-any
|
27359
|
+
(expanded[0] ?? {});
|
27360
|
+
}
|
27361
|
+
if ("@type" in values) {
|
27362
|
+
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#TentativeAccept")) {
|
27363
|
+
throw new TypeError("Invalid type: " + values["@type"]);
|
27364
|
+
}
|
27365
|
+
}
|
27366
|
+
const instance = await super.fromJsonLd(values, options);
|
27367
|
+
if (!(instance instanceof TentativeAccept)) {
|
27368
|
+
throw new TypeError("Unexpected type: " + instance.constructor.name);
|
27369
|
+
}
|
27370
|
+
return instance;
|
27371
|
+
}
|
27372
|
+
_getCustomInspectProxy() {
|
27373
|
+
const proxy = super._getCustomInspectProxy();
|
27374
|
+
return proxy;
|
27375
|
+
}
|
27376
|
+
[Symbol.for("Deno.customInspect")](inspect, options) {
|
27377
|
+
const proxy = this._getCustomInspectProxy();
|
27378
|
+
return "TentativeAccept " + inspect(proxy, options);
|
27379
|
+
}
|
27380
|
+
[Symbol.for("nodejs.util.inspect.custom")](_depth, options, inspect) {
|
27381
|
+
const proxy = this._getCustomInspectProxy();
|
27382
|
+
return "TentativeAccept " + inspect(proxy, options);
|
27383
|
+
}
|
27384
|
+
}
|
27385
|
+
/** A specialization of {@link Reject} in which
|
27386
|
+
* the rejection is considered tentative.
|
27387
|
+
*/
|
27388
|
+
export class TentativeReject extends Reject {
|
27389
|
+
/**
|
27390
|
+
* The type URI of {@link TentativeReject}: `https://www.w3.org/ns/activitystreams#TentativeReject`.
|
27391
|
+
*/
|
27392
|
+
static get typeId() {
|
27393
|
+
return new URL("https://www.w3.org/ns/activitystreams#TentativeReject");
|
27394
|
+
}
|
27395
|
+
/**
|
27396
|
+
* Constructs a new instance of TentativeReject with the given values.
|
27397
|
+
* @param values The values to initialize the instance with.
|
27398
|
+
* @param options The options to use for initialization.
|
27399
|
+
*/
|
27400
|
+
constructor(values, { documentLoader, contextLoader, } = {}) {
|
27401
|
+
super(values, { documentLoader, contextLoader });
|
27402
|
+
}
|
27403
|
+
/**
|
27404
|
+
* Clones this instance, optionally updating it with the given values.
|
27405
|
+
* @param values The values to update the clone with.
|
27406
|
+
* @options The options to use for cloning.
|
27407
|
+
* @returns The cloned instance.
|
27408
|
+
*/
|
27409
|
+
clone(values = {}, options = {}) {
|
27410
|
+
const clone = super.clone(values, options);
|
27411
|
+
return clone;
|
27412
|
+
}
|
27413
|
+
/**
|
27414
|
+
* Converts this object to a JSON-LD structure.
|
27415
|
+
* @returns The JSON-LD representation of this object.
|
27416
|
+
*/
|
27417
|
+
async toJsonLd(options = {}) {
|
27418
|
+
options = {
|
27419
|
+
...options,
|
27420
|
+
contextLoader: options.contextLoader ?? fetchDocumentLoader,
|
27421
|
+
};
|
27422
|
+
// deno-lint-ignore no-unused-vars prefer-const
|
27423
|
+
let array;
|
27424
|
+
const baseValues = await super.toJsonLd({
|
27425
|
+
...options,
|
27426
|
+
expand: true,
|
27427
|
+
});
|
27428
|
+
const values = baseValues[0];
|
27429
|
+
values["@type"] = ["https://www.w3.org/ns/activitystreams#TentativeReject"];
|
27430
|
+
if (this.id)
|
27431
|
+
values["@id"] = this.id.href;
|
27432
|
+
if (options.expand) {
|
27433
|
+
return await jsonld.expand(values, { documentLoader: options.contextLoader });
|
27434
|
+
}
|
27435
|
+
const docContext = options.context ??
|
27436
|
+
[
|
27437
|
+
"https://www.w3.org/ns/activitystreams",
|
27438
|
+
"https://w3id.org/security/data-integrity/v1",
|
27439
|
+
];
|
27440
|
+
const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
|
27441
|
+
if (docContext != null) {
|
27442
|
+
// Embed context
|
27443
|
+
if ("proof" in compacted &&
|
27444
|
+
compacted.proof != null) {
|
27445
|
+
if (Array.isArray(compacted.proof)) {
|
27446
|
+
for (const element of compacted.proof) {
|
27447
|
+
element["@context"] = docContext;
|
27448
|
+
}
|
27449
|
+
}
|
27450
|
+
else {
|
27451
|
+
compacted.proof["@context"] = docContext;
|
27452
|
+
}
|
27453
|
+
}
|
27454
|
+
}
|
27455
|
+
return compacted;
|
27456
|
+
}
|
27457
|
+
/**
|
27458
|
+
* Converts a JSON-LD structure to an object of this type.
|
27459
|
+
* @param json The JSON-LD structure to convert.
|
27460
|
+
* @returns The object of this type.
|
27461
|
+
* @throws {TypeError} If the given `json` is invalid.
|
27462
|
+
*/
|
27463
|
+
static async fromJsonLd(json, options = {}) {
|
27464
|
+
if (typeof json === "undefined") {
|
27465
|
+
throw new TypeError("Invalid JSON-LD: undefined.");
|
27466
|
+
}
|
27467
|
+
else if (json === null)
|
27468
|
+
throw new TypeError("Invalid JSON-LD: null.");
|
27469
|
+
options = {
|
27470
|
+
...options,
|
27471
|
+
documentLoader: options.documentLoader ?? fetchDocumentLoader,
|
27472
|
+
contextLoader: options.contextLoader ?? fetchDocumentLoader,
|
27473
|
+
};
|
27474
|
+
// deno-lint-ignore no-explicit-any
|
27475
|
+
let values;
|
27476
|
+
if (globalThis.Object.keys(json).length == 0) {
|
27477
|
+
values = {};
|
27478
|
+
}
|
27479
|
+
else {
|
27480
|
+
const expanded = await jsonld.expand(json, {
|
27481
|
+
documentLoader: options.contextLoader,
|
27482
|
+
keepFreeFloatingNodes: true,
|
27483
|
+
});
|
27484
|
+
values =
|
27485
|
+
// deno-lint-ignore no-explicit-any
|
27486
|
+
(expanded[0] ?? {});
|
27487
|
+
}
|
27488
|
+
if ("@type" in values) {
|
27489
|
+
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#TentativeReject")) {
|
27490
|
+
throw new TypeError("Invalid type: " + values["@type"]);
|
27491
|
+
}
|
27492
|
+
}
|
27493
|
+
const instance = await super.fromJsonLd(values, options);
|
27494
|
+
if (!(instance instanceof TentativeReject)) {
|
27495
|
+
throw new TypeError("Unexpected type: " + instance.constructor.name);
|
27496
|
+
}
|
27497
|
+
return instance;
|
27498
|
+
}
|
27499
|
+
_getCustomInspectProxy() {
|
27500
|
+
const proxy = super._getCustomInspectProxy();
|
27501
|
+
return proxy;
|
27502
|
+
}
|
27503
|
+
[Symbol.for("Deno.customInspect")](inspect, options) {
|
27504
|
+
const proxy = this._getCustomInspectProxy();
|
27505
|
+
return "TentativeReject " + inspect(proxy, options);
|
27506
|
+
}
|
27507
|
+
[Symbol.for("nodejs.util.inspect.custom")](_depth, options, inspect) {
|
27508
|
+
const proxy = this._getCustomInspectProxy();
|
27509
|
+
return "TentativeReject " + inspect(proxy, options);
|
27510
|
+
}
|
27511
|
+
}
|
27512
|
+
/** A `Tombstone` represents a content object that has been deleted.
|
27513
|
+
* It can be used in {@link Collection}s to signify that there used to be
|
27514
|
+
* an object at this position, but it has been deleted.
|
27515
|
+
*/
|
27516
|
+
export class Tombstone extends Object {
|
27517
|
+
/**
|
27518
|
+
* The type URI of {@link Tombstone}: `https://www.w3.org/ns/activitystreams#Tombstone`.
|
27519
|
+
*/
|
27520
|
+
static get typeId() {
|
27521
|
+
return new URL("https://www.w3.org/ns/activitystreams#Tombstone");
|
27522
|
+
}
|
27523
|
+
#_8g8g4LiVMhFTXskuDEqx4ascxUr = [];
|
27524
|
+
/**
|
27525
|
+
* Constructs a new instance of Tombstone with the given values.
|
27526
|
+
* @param values The values to initialize the instance with.
|
27527
|
+
* @param options The options to use for initialization.
|
27528
|
+
*/
|
27529
|
+
constructor(values, { documentLoader, contextLoader, } = {}) {
|
27530
|
+
super(values, { documentLoader, contextLoader });
|
27531
|
+
if ("deleted" in values && values.deleted != null) {
|
27532
|
+
if (values.deleted instanceof dntShim.Temporal.Instant) {
|
27533
|
+
// @ts-ignore: type is checked above.
|
27534
|
+
this.#_8g8g4LiVMhFTXskuDEqx4ascxUr = [values.deleted];
|
27535
|
+
}
|
27536
|
+
else {
|
27537
|
+
throw new TypeError("The deleted must be of type " +
|
27538
|
+
"Temporal.Instant" + ".");
|
27539
|
+
}
|
27540
|
+
}
|
27541
|
+
}
|
27542
|
+
/**
|
27543
|
+
* Clones this instance, optionally updating it with the given values.
|
27544
|
+
* @param values The values to update the clone with.
|
27545
|
+
* @options The options to use for cloning.
|
27546
|
+
* @returns The cloned instance.
|
27547
|
+
*/
|
27548
|
+
clone(values = {}, options = {}) {
|
27549
|
+
const clone = super.clone(values, options);
|
27550
|
+
clone.#_8g8g4LiVMhFTXskuDEqx4ascxUr = this.#_8g8g4LiVMhFTXskuDEqx4ascxUr;
|
27551
|
+
if ("deleted" in values && values.deleted != null) {
|
27552
|
+
if (values.deleted instanceof dntShim.Temporal.Instant) {
|
27553
|
+
// @ts-ignore: type is checked above.
|
27554
|
+
clone.#_8g8g4LiVMhFTXskuDEqx4ascxUr = [values.deleted];
|
27555
|
+
}
|
27556
|
+
else {
|
27557
|
+
throw new TypeError("The deleted must be of type " +
|
27558
|
+
"Temporal.Instant" + ".");
|
27559
|
+
}
|
27560
|
+
}
|
27561
|
+
return clone;
|
27562
|
+
}
|
27563
|
+
/** On a `Tombstone` object, the `deleted` property is a timestamp for when
|
27564
|
+
* the object was deleted.
|
27565
|
+
*/
|
27566
|
+
get deleted() {
|
27567
|
+
if (this.#_8g8g4LiVMhFTXskuDEqx4ascxUr.length < 1)
|
27568
|
+
return null;
|
27569
|
+
return this.#_8g8g4LiVMhFTXskuDEqx4ascxUr[0];
|
27570
|
+
}
|
27571
|
+
/**
|
27572
|
+
* Converts this object to a JSON-LD structure.
|
27573
|
+
* @returns The JSON-LD representation of this object.
|
27574
|
+
*/
|
27575
|
+
async toJsonLd(options = {}) {
|
27576
|
+
options = {
|
27577
|
+
...options,
|
27578
|
+
contextLoader: options.contextLoader ?? fetchDocumentLoader,
|
27579
|
+
};
|
27580
|
+
// deno-lint-ignore no-unused-vars prefer-const
|
27581
|
+
let array;
|
27582
|
+
const baseValues = await super.toJsonLd({
|
27583
|
+
...options,
|
27584
|
+
expand: true,
|
27585
|
+
});
|
27586
|
+
const values = baseValues[0];
|
27587
|
+
array = [];
|
26954
27588
|
for (const v of this.#_8g8g4LiVMhFTXskuDEqx4ascxUr) {
|
26955
27589
|
const element = {
|
26956
27590
|
"@type": "http://www.w3.org/2001/XMLSchema#dateTime",
|
@@ -27068,6 +27702,135 @@ export class Tombstone extends Object {
|
|
27068
27702
|
return "Tombstone " + inspect(proxy, options);
|
27069
27703
|
}
|
27070
27704
|
}
|
27705
|
+
/** Indicates that the `actor` is traveling to `target` from `origin`.
|
27706
|
+
* `Travel` is an `IntransitiveObject` whose `actor` specifies the direct object.
|
27707
|
+
* If the `target` or `origin` are not specified,
|
27708
|
+
* either can be determined by context.
|
27709
|
+
*/
|
27710
|
+
export class Travel extends IntransitiveActivity {
|
27711
|
+
/**
|
27712
|
+
* The type URI of {@link Travel}: `https://www.w3.org/ns/activitystreams#Travel`.
|
27713
|
+
*/
|
27714
|
+
static get typeId() {
|
27715
|
+
return new URL("https://www.w3.org/ns/activitystreams#Travel");
|
27716
|
+
}
|
27717
|
+
/**
|
27718
|
+
* Constructs a new instance of Travel with the given values.
|
27719
|
+
* @param values The values to initialize the instance with.
|
27720
|
+
* @param options The options to use for initialization.
|
27721
|
+
*/
|
27722
|
+
constructor(values, { documentLoader, contextLoader, } = {}) {
|
27723
|
+
super(values, { documentLoader, contextLoader });
|
27724
|
+
}
|
27725
|
+
/**
|
27726
|
+
* Clones this instance, optionally updating it with the given values.
|
27727
|
+
* @param values The values to update the clone with.
|
27728
|
+
* @options The options to use for cloning.
|
27729
|
+
* @returns The cloned instance.
|
27730
|
+
*/
|
27731
|
+
clone(values = {}, options = {}) {
|
27732
|
+
const clone = super.clone(values, options);
|
27733
|
+
return clone;
|
27734
|
+
}
|
27735
|
+
/**
|
27736
|
+
* Converts this object to a JSON-LD structure.
|
27737
|
+
* @returns The JSON-LD representation of this object.
|
27738
|
+
*/
|
27739
|
+
async toJsonLd(options = {}) {
|
27740
|
+
options = {
|
27741
|
+
...options,
|
27742
|
+
contextLoader: options.contextLoader ?? fetchDocumentLoader,
|
27743
|
+
};
|
27744
|
+
// deno-lint-ignore no-unused-vars prefer-const
|
27745
|
+
let array;
|
27746
|
+
const baseValues = await super.toJsonLd({
|
27747
|
+
...options,
|
27748
|
+
expand: true,
|
27749
|
+
});
|
27750
|
+
const values = baseValues[0];
|
27751
|
+
values["@type"] = ["https://www.w3.org/ns/activitystreams#Travel"];
|
27752
|
+
if (this.id)
|
27753
|
+
values["@id"] = this.id.href;
|
27754
|
+
if (options.expand) {
|
27755
|
+
return await jsonld.expand(values, { documentLoader: options.contextLoader });
|
27756
|
+
}
|
27757
|
+
const docContext = options.context ??
|
27758
|
+
[
|
27759
|
+
"https://www.w3.org/ns/activitystreams",
|
27760
|
+
"https://w3id.org/security/data-integrity/v1",
|
27761
|
+
];
|
27762
|
+
const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
|
27763
|
+
if (docContext != null) {
|
27764
|
+
// Embed context
|
27765
|
+
if ("proof" in compacted &&
|
27766
|
+
compacted.proof != null) {
|
27767
|
+
if (Array.isArray(compacted.proof)) {
|
27768
|
+
for (const element of compacted.proof) {
|
27769
|
+
element["@context"] = docContext;
|
27770
|
+
}
|
27771
|
+
}
|
27772
|
+
else {
|
27773
|
+
compacted.proof["@context"] = docContext;
|
27774
|
+
}
|
27775
|
+
}
|
27776
|
+
}
|
27777
|
+
return compacted;
|
27778
|
+
}
|
27779
|
+
/**
|
27780
|
+
* Converts a JSON-LD structure to an object of this type.
|
27781
|
+
* @param json The JSON-LD structure to convert.
|
27782
|
+
* @returns The object of this type.
|
27783
|
+
* @throws {TypeError} If the given `json` is invalid.
|
27784
|
+
*/
|
27785
|
+
static async fromJsonLd(json, options = {}) {
|
27786
|
+
if (typeof json === "undefined") {
|
27787
|
+
throw new TypeError("Invalid JSON-LD: undefined.");
|
27788
|
+
}
|
27789
|
+
else if (json === null)
|
27790
|
+
throw new TypeError("Invalid JSON-LD: null.");
|
27791
|
+
options = {
|
27792
|
+
...options,
|
27793
|
+
documentLoader: options.documentLoader ?? fetchDocumentLoader,
|
27794
|
+
contextLoader: options.contextLoader ?? fetchDocumentLoader,
|
27795
|
+
};
|
27796
|
+
// deno-lint-ignore no-explicit-any
|
27797
|
+
let values;
|
27798
|
+
if (globalThis.Object.keys(json).length == 0) {
|
27799
|
+
values = {};
|
27800
|
+
}
|
27801
|
+
else {
|
27802
|
+
const expanded = await jsonld.expand(json, {
|
27803
|
+
documentLoader: options.contextLoader,
|
27804
|
+
keepFreeFloatingNodes: true,
|
27805
|
+
});
|
27806
|
+
values =
|
27807
|
+
// deno-lint-ignore no-explicit-any
|
27808
|
+
(expanded[0] ?? {});
|
27809
|
+
}
|
27810
|
+
if ("@type" in values) {
|
27811
|
+
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Travel")) {
|
27812
|
+
throw new TypeError("Invalid type: " + values["@type"]);
|
27813
|
+
}
|
27814
|
+
}
|
27815
|
+
const instance = await super.fromJsonLd(values, options);
|
27816
|
+
if (!(instance instanceof Travel)) {
|
27817
|
+
throw new TypeError("Unexpected type: " + instance.constructor.name);
|
27818
|
+
}
|
27819
|
+
return instance;
|
27820
|
+
}
|
27821
|
+
_getCustomInspectProxy() {
|
27822
|
+
const proxy = super._getCustomInspectProxy();
|
27823
|
+
return proxy;
|
27824
|
+
}
|
27825
|
+
[Symbol.for("Deno.customInspect")](inspect, options) {
|
27826
|
+
const proxy = this._getCustomInspectProxy();
|
27827
|
+
return "Travel " + inspect(proxy, options);
|
27828
|
+
}
|
27829
|
+
[Symbol.for("nodejs.util.inspect.custom")](_depth, options, inspect) {
|
27830
|
+
const proxy = this._getCustomInspectProxy();
|
27831
|
+
return "Travel " + inspect(proxy, options);
|
27832
|
+
}
|
27833
|
+
}
|
27071
27834
|
/** Indicates that the `actor` is undoing the `object`. In most cases,
|
27072
27835
|
* the `object` will be an {@link Activity} describing some previously performed
|
27073
27836
|
* action (for instance, a person may have previously "liked" an article but,
|
@@ -27463,3 +28226,129 @@ export class Video extends Document {
|
|
27463
28226
|
return "Video " + inspect(proxy, options);
|
27464
28227
|
}
|
27465
28228
|
}
|
28229
|
+
/** Indicates that the `actor` has viewed the object.
|
28230
|
+
*/
|
28231
|
+
export class View extends Activity {
|
28232
|
+
/**
|
28233
|
+
* The type URI of {@link View}: `https://www.w3.org/ns/activitystreams#View`.
|
28234
|
+
*/
|
28235
|
+
static get typeId() {
|
28236
|
+
return new URL("https://www.w3.org/ns/activitystreams#View");
|
28237
|
+
}
|
28238
|
+
/**
|
28239
|
+
* Constructs a new instance of View with the given values.
|
28240
|
+
* @param values The values to initialize the instance with.
|
28241
|
+
* @param options The options to use for initialization.
|
28242
|
+
*/
|
28243
|
+
constructor(values, { documentLoader, contextLoader, } = {}) {
|
28244
|
+
super(values, { documentLoader, contextLoader });
|
28245
|
+
}
|
28246
|
+
/**
|
28247
|
+
* Clones this instance, optionally updating it with the given values.
|
28248
|
+
* @param values The values to update the clone with.
|
28249
|
+
* @options The options to use for cloning.
|
28250
|
+
* @returns The cloned instance.
|
28251
|
+
*/
|
28252
|
+
clone(values = {}, options = {}) {
|
28253
|
+
const clone = super.clone(values, options);
|
28254
|
+
return clone;
|
28255
|
+
}
|
28256
|
+
/**
|
28257
|
+
* Converts this object to a JSON-LD structure.
|
28258
|
+
* @returns The JSON-LD representation of this object.
|
28259
|
+
*/
|
28260
|
+
async toJsonLd(options = {}) {
|
28261
|
+
options = {
|
28262
|
+
...options,
|
28263
|
+
contextLoader: options.contextLoader ?? fetchDocumentLoader,
|
28264
|
+
};
|
28265
|
+
// deno-lint-ignore no-unused-vars prefer-const
|
28266
|
+
let array;
|
28267
|
+
const baseValues = await super.toJsonLd({
|
28268
|
+
...options,
|
28269
|
+
expand: true,
|
28270
|
+
});
|
28271
|
+
const values = baseValues[0];
|
28272
|
+
values["@type"] = ["https://www.w3.org/ns/activitystreams#View"];
|
28273
|
+
if (this.id)
|
28274
|
+
values["@id"] = this.id.href;
|
28275
|
+
if (options.expand) {
|
28276
|
+
return await jsonld.expand(values, { documentLoader: options.contextLoader });
|
28277
|
+
}
|
28278
|
+
const docContext = options.context ??
|
28279
|
+
[
|
28280
|
+
"https://www.w3.org/ns/activitystreams",
|
28281
|
+
"https://w3id.org/security/data-integrity/v1",
|
28282
|
+
];
|
28283
|
+
const compacted = await jsonld.compact(values, docContext, { documentLoader: options.contextLoader });
|
28284
|
+
if (docContext != null) {
|
28285
|
+
// Embed context
|
28286
|
+
if ("proof" in compacted &&
|
28287
|
+
compacted.proof != null) {
|
28288
|
+
if (Array.isArray(compacted.proof)) {
|
28289
|
+
for (const element of compacted.proof) {
|
28290
|
+
element["@context"] = docContext;
|
28291
|
+
}
|
28292
|
+
}
|
28293
|
+
else {
|
28294
|
+
compacted.proof["@context"] = docContext;
|
28295
|
+
}
|
28296
|
+
}
|
28297
|
+
}
|
28298
|
+
return compacted;
|
28299
|
+
}
|
28300
|
+
/**
|
28301
|
+
* Converts a JSON-LD structure to an object of this type.
|
28302
|
+
* @param json The JSON-LD structure to convert.
|
28303
|
+
* @returns The object of this type.
|
28304
|
+
* @throws {TypeError} If the given `json` is invalid.
|
28305
|
+
*/
|
28306
|
+
static async fromJsonLd(json, options = {}) {
|
28307
|
+
if (typeof json === "undefined") {
|
28308
|
+
throw new TypeError("Invalid JSON-LD: undefined.");
|
28309
|
+
}
|
28310
|
+
else if (json === null)
|
28311
|
+
throw new TypeError("Invalid JSON-LD: null.");
|
28312
|
+
options = {
|
28313
|
+
...options,
|
28314
|
+
documentLoader: options.documentLoader ?? fetchDocumentLoader,
|
28315
|
+
contextLoader: options.contextLoader ?? fetchDocumentLoader,
|
28316
|
+
};
|
28317
|
+
// deno-lint-ignore no-explicit-any
|
28318
|
+
let values;
|
28319
|
+
if (globalThis.Object.keys(json).length == 0) {
|
28320
|
+
values = {};
|
28321
|
+
}
|
28322
|
+
else {
|
28323
|
+
const expanded = await jsonld.expand(json, {
|
28324
|
+
documentLoader: options.contextLoader,
|
28325
|
+
keepFreeFloatingNodes: true,
|
28326
|
+
});
|
28327
|
+
values =
|
28328
|
+
// deno-lint-ignore no-explicit-any
|
28329
|
+
(expanded[0] ?? {});
|
28330
|
+
}
|
28331
|
+
if ("@type" in values) {
|
28332
|
+
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#View")) {
|
28333
|
+
throw new TypeError("Invalid type: " + values["@type"]);
|
28334
|
+
}
|
28335
|
+
}
|
28336
|
+
const instance = await super.fromJsonLd(values, options);
|
28337
|
+
if (!(instance instanceof View)) {
|
28338
|
+
throw new TypeError("Unexpected type: " + instance.constructor.name);
|
28339
|
+
}
|
28340
|
+
return instance;
|
28341
|
+
}
|
28342
|
+
_getCustomInspectProxy() {
|
28343
|
+
const proxy = super._getCustomInspectProxy();
|
28344
|
+
return proxy;
|
28345
|
+
}
|
28346
|
+
[Symbol.for("Deno.customInspect")](inspect, options) {
|
28347
|
+
const proxy = this._getCustomInspectProxy();
|
28348
|
+
return "View " + inspect(proxy, options);
|
28349
|
+
}
|
28350
|
+
[Symbol.for("nodejs.util.inspect.custom")](_depth, options, inspect) {
|
28351
|
+
const proxy = this._getCustomInspectProxy();
|
28352
|
+
return "View " + inspect(proxy, options);
|
28353
|
+
}
|
28354
|
+
}
|