@fedify/vocab-runtime 2.1.20 → 2.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/deno.json +1 -1
- package/dist/mod.cjs +130 -9
- package/dist/mod.d.cts +2 -0
- package/dist/mod.d.ts +2 -0
- package/dist/mod.js +130 -9
- package/dist/tests/decimal.test.cjs +1 -1
- package/dist/tests/decimal.test.mjs +1 -1
- package/dist/tests/{docloader-q5_iMqdc.cjs → docloader-CsqLeLhI.cjs} +136 -9
- package/dist/tests/{docloader-BogYGZl9.mjs → docloader-DTEkEfXf.mjs} +131 -10
- package/dist/tests/docloader.test.cjs +27 -2
- package/dist/tests/docloader.test.mjs +27 -2
- package/dist/tests/{request-BVRVT4O8.cjs → request-0j5qU0qi.cjs} +1 -1
- package/dist/tests/{request-CbQFxyK2.mjs → request-W5ez4835.mjs} +1 -1
- package/dist/tests/request.test.cjs +1 -1
- package/dist/tests/request.test.mjs +1 -1
- package/package.json +1 -1
- package/src/contexts/cid-v1.json +114 -0
- package/src/contexts/fep-ef61.json +10 -0
- package/src/contexts/miscellany.json +2 -4
- package/src/contexts.ts +19 -0
- package/src/docloader.test.ts +41 -0
- package/src/docloader.ts +2 -0
package/deno.json
CHANGED
package/dist/mod.cjs
CHANGED
|
@@ -393,6 +393,119 @@ var activitystreams_default = { "@context": {
|
|
|
393
393
|
}
|
|
394
394
|
} };
|
|
395
395
|
//#endregion
|
|
396
|
+
//#region src/contexts/cid-v1.json
|
|
397
|
+
var cid_v1_default = { "@context": {
|
|
398
|
+
"@protected": true,
|
|
399
|
+
"id": "@id",
|
|
400
|
+
"type": "@type",
|
|
401
|
+
"alsoKnownAs": {
|
|
402
|
+
"@id": "https://www.w3.org/ns/activitystreams#alsoKnownAs",
|
|
403
|
+
"@type": "@id"
|
|
404
|
+
},
|
|
405
|
+
"assertionMethod": {
|
|
406
|
+
"@id": "https://w3id.org/security#assertionMethod",
|
|
407
|
+
"@type": "@id",
|
|
408
|
+
"@container": "@set"
|
|
409
|
+
},
|
|
410
|
+
"authentication": {
|
|
411
|
+
"@id": "https://w3id.org/security#authenticationMethod",
|
|
412
|
+
"@type": "@id",
|
|
413
|
+
"@container": "@set"
|
|
414
|
+
},
|
|
415
|
+
"capabilityDelegation": {
|
|
416
|
+
"@id": "https://w3id.org/security#capabilityDelegationMethod",
|
|
417
|
+
"@type": "@id",
|
|
418
|
+
"@container": "@set"
|
|
419
|
+
},
|
|
420
|
+
"capabilityInvocation": {
|
|
421
|
+
"@id": "https://w3id.org/security#capabilityInvocationMethod",
|
|
422
|
+
"@type": "@id",
|
|
423
|
+
"@container": "@set"
|
|
424
|
+
},
|
|
425
|
+
"controller": {
|
|
426
|
+
"@id": "https://w3id.org/security#controller",
|
|
427
|
+
"@type": "@id"
|
|
428
|
+
},
|
|
429
|
+
"keyAgreement": {
|
|
430
|
+
"@id": "https://w3id.org/security#keyAgreementMethod",
|
|
431
|
+
"@type": "@id",
|
|
432
|
+
"@container": "@set"
|
|
433
|
+
},
|
|
434
|
+
"service": {
|
|
435
|
+
"@id": "https://www.w3.org/ns/did#service",
|
|
436
|
+
"@type": "@id",
|
|
437
|
+
"@context": {
|
|
438
|
+
"@protected": true,
|
|
439
|
+
"id": "@id",
|
|
440
|
+
"type": "@type",
|
|
441
|
+
"serviceEndpoint": {
|
|
442
|
+
"@id": "https://www.w3.org/ns/did#serviceEndpoint",
|
|
443
|
+
"@type": "@id"
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
},
|
|
447
|
+
"verificationMethod": {
|
|
448
|
+
"@id": "https://w3id.org/security#verificationMethod",
|
|
449
|
+
"@type": "@id"
|
|
450
|
+
},
|
|
451
|
+
"Multikey": {
|
|
452
|
+
"@id": "https://w3id.org/security#Multikey",
|
|
453
|
+
"@context": {
|
|
454
|
+
"@protected": true,
|
|
455
|
+
"id": "@id",
|
|
456
|
+
"type": "@type",
|
|
457
|
+
"controller": {
|
|
458
|
+
"@id": "https://w3id.org/security#controller",
|
|
459
|
+
"@type": "@id"
|
|
460
|
+
},
|
|
461
|
+
"revoked": {
|
|
462
|
+
"@id": "https://w3id.org/security#revoked",
|
|
463
|
+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
|
|
464
|
+
},
|
|
465
|
+
"expires": {
|
|
466
|
+
"@id": "https://w3id.org/security#expiration",
|
|
467
|
+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
|
|
468
|
+
},
|
|
469
|
+
"publicKeyMultibase": {
|
|
470
|
+
"@id": "https://w3id.org/security#publicKeyMultibase",
|
|
471
|
+
"@type": "https://w3id.org/security#multibase"
|
|
472
|
+
},
|
|
473
|
+
"secretKeyMultibase": {
|
|
474
|
+
"@id": "https://w3id.org/security#secretKeyMultibase",
|
|
475
|
+
"@type": "https://w3id.org/security#multibase"
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
},
|
|
479
|
+
"JsonWebKey": {
|
|
480
|
+
"@id": "https://w3id.org/security#JsonWebKey",
|
|
481
|
+
"@context": {
|
|
482
|
+
"@protected": true,
|
|
483
|
+
"id": "@id",
|
|
484
|
+
"type": "@type",
|
|
485
|
+
"controller": {
|
|
486
|
+
"@id": "https://w3id.org/security#controller",
|
|
487
|
+
"@type": "@id"
|
|
488
|
+
},
|
|
489
|
+
"revoked": {
|
|
490
|
+
"@id": "https://w3id.org/security#revoked",
|
|
491
|
+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
|
|
492
|
+
},
|
|
493
|
+
"expires": {
|
|
494
|
+
"@id": "https://w3id.org/security#expiration",
|
|
495
|
+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
|
|
496
|
+
},
|
|
497
|
+
"publicKeyJwk": {
|
|
498
|
+
"@id": "https://w3id.org/security#publicKeyJwk",
|
|
499
|
+
"@type": "@json"
|
|
500
|
+
},
|
|
501
|
+
"secretKeyJwk": {
|
|
502
|
+
"@id": "https://w3id.org/security#secretKeyJwk",
|
|
503
|
+
"@type": "@json"
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
} };
|
|
508
|
+
//#endregion
|
|
396
509
|
//#region src/contexts/did-v1.json
|
|
397
510
|
var did_v1_default = { "@context": {
|
|
398
511
|
"@protected": true,
|
|
@@ -486,6 +599,16 @@ var fep_5711_default = { "@context": {
|
|
|
486
599
|
}
|
|
487
600
|
} };
|
|
488
601
|
//#endregion
|
|
602
|
+
//#region src/contexts/fep-ef61.json
|
|
603
|
+
var fep_ef61_default = { "@context": {
|
|
604
|
+
"gateways": {
|
|
605
|
+
"@id": "https://w3id.org/fep/ef61/gateways",
|
|
606
|
+
"@type": "@id",
|
|
607
|
+
"@container": "@list"
|
|
608
|
+
},
|
|
609
|
+
"digestMultibase": "https://www.w3.org/ns/credentials/v2#digestMultibase"
|
|
610
|
+
} };
|
|
611
|
+
//#endregion
|
|
489
612
|
//#region src/contexts/gotosocial.json
|
|
490
613
|
var gotosocial_default = { "@context": {
|
|
491
614
|
"xsd": "http://www.w3.org/2001/XMLSchema#",
|
|
@@ -787,18 +910,12 @@ var miscellany_default = { "@context": {
|
|
|
787
910
|
"as": "https://www.w3.org/ns/activitystreams#",
|
|
788
911
|
"xsd": "http://www.w3.org/2001/XMLSchema#",
|
|
789
912
|
"Hashtag": "as:Hashtag",
|
|
790
|
-
"manuallyApprovesFollowers": {
|
|
791
|
-
"@id": "as:manuallyApprovesFollowers",
|
|
792
|
-
"@type": "xsd:boolean"
|
|
793
|
-
},
|
|
913
|
+
"manuallyApprovesFollowers": { "@id": "as:manuallyApprovesFollowers" },
|
|
794
914
|
"movedTo": {
|
|
795
915
|
"@id": "as:movedTo",
|
|
796
916
|
"@type": "@id"
|
|
797
917
|
},
|
|
798
|
-
"sensitive": {
|
|
799
|
-
"@id": "as:sensitive",
|
|
800
|
-
"@type": "xsd:boolean"
|
|
801
|
-
}
|
|
918
|
+
"sensitive": { "@id": "as:sensitive" }
|
|
802
919
|
} };
|
|
803
920
|
//#endregion
|
|
804
921
|
//#region src/contexts/schemaorg.json
|
|
@@ -4397,6 +4514,8 @@ const preloadedContexts = {
|
|
|
4397
4514
|
"http://schema.org/": schemaorg_default,
|
|
4398
4515
|
"https://gotosocial.org/ns": gotosocial_default,
|
|
4399
4516
|
"https://w3id.org/fep/5711": fep_5711_default,
|
|
4517
|
+
"https://www.w3.org/ns/cid/v1": cid_v1_default,
|
|
4518
|
+
"https://w3id.org/fep/ef61": fep_ef61_default,
|
|
4400
4519
|
"https://join-lemmy.org/context.json": join_lemmy_default,
|
|
4401
4520
|
"http://joinmastodon.org/ns": joinmastodon_default,
|
|
4402
4521
|
"https://purl.archive.org/miscellany": miscellany_default
|
|
@@ -4404,7 +4523,7 @@ const preloadedContexts = {
|
|
|
4404
4523
|
//#endregion
|
|
4405
4524
|
//#region deno.json
|
|
4406
4525
|
var name = "@fedify/vocab-runtime";
|
|
4407
|
-
var version = "2.1.
|
|
4526
|
+
var version = "2.1.22";
|
|
4408
4527
|
//#endregion
|
|
4409
4528
|
//#region src/link.ts
|
|
4410
4529
|
const parametersNeedLowerCase = ["rel", "type"];
|
|
@@ -4971,7 +5090,9 @@ async function getRemoteDocument(url, response, fetch) {
|
|
|
4971
5090
|
* - <https://w3id.org/security/v1>
|
|
4972
5091
|
* - <https://w3id.org/security/data-integrity/v1>
|
|
4973
5092
|
* - <https://www.w3.org/ns/did/v1>
|
|
5093
|
+
* - <https://www.w3.org/ns/cid/v1>
|
|
4974
5094
|
* - <https://w3id.org/security/multikey/v1>
|
|
5095
|
+
* - <https://w3id.org/fep/ef61>
|
|
4975
5096
|
* - <https://purl.archive.org/socialweb/webfinger>
|
|
4976
5097
|
* - <http://schema.org/>
|
|
4977
5098
|
* @param options Options for the document loader.
|
package/dist/mod.d.cts
CHANGED
|
@@ -182,7 +182,9 @@ interface GetDocumentLoaderOptions extends DocumentLoaderFactoryOptions {
|
|
|
182
182
|
* - <https://w3id.org/security/v1>
|
|
183
183
|
* - <https://w3id.org/security/data-integrity/v1>
|
|
184
184
|
* - <https://www.w3.org/ns/did/v1>
|
|
185
|
+
* - <https://www.w3.org/ns/cid/v1>
|
|
185
186
|
* - <https://w3id.org/security/multikey/v1>
|
|
187
|
+
* - <https://w3id.org/fep/ef61>
|
|
186
188
|
* - <https://purl.archive.org/socialweb/webfinger>
|
|
187
189
|
* - <http://schema.org/>
|
|
188
190
|
* @param options Options for the document loader.
|
package/dist/mod.d.ts
CHANGED
|
@@ -181,7 +181,9 @@ interface GetDocumentLoaderOptions extends DocumentLoaderFactoryOptions {
|
|
|
181
181
|
* - <https://w3id.org/security/v1>
|
|
182
182
|
* - <https://w3id.org/security/data-integrity/v1>
|
|
183
183
|
* - <https://www.w3.org/ns/did/v1>
|
|
184
|
+
* - <https://www.w3.org/ns/cid/v1>
|
|
184
185
|
* - <https://w3id.org/security/multikey/v1>
|
|
186
|
+
* - <https://w3id.org/fep/ef61>
|
|
185
187
|
* - <https://purl.archive.org/socialweb/webfinger>
|
|
186
188
|
* - <http://schema.org/>
|
|
187
189
|
* @param options Options for the document loader.
|
package/dist/mod.js
CHANGED
|
@@ -389,6 +389,119 @@ var activitystreams_default = { "@context": {
|
|
|
389
389
|
}
|
|
390
390
|
} };
|
|
391
391
|
//#endregion
|
|
392
|
+
//#region src/contexts/cid-v1.json
|
|
393
|
+
var cid_v1_default = { "@context": {
|
|
394
|
+
"@protected": true,
|
|
395
|
+
"id": "@id",
|
|
396
|
+
"type": "@type",
|
|
397
|
+
"alsoKnownAs": {
|
|
398
|
+
"@id": "https://www.w3.org/ns/activitystreams#alsoKnownAs",
|
|
399
|
+
"@type": "@id"
|
|
400
|
+
},
|
|
401
|
+
"assertionMethod": {
|
|
402
|
+
"@id": "https://w3id.org/security#assertionMethod",
|
|
403
|
+
"@type": "@id",
|
|
404
|
+
"@container": "@set"
|
|
405
|
+
},
|
|
406
|
+
"authentication": {
|
|
407
|
+
"@id": "https://w3id.org/security#authenticationMethod",
|
|
408
|
+
"@type": "@id",
|
|
409
|
+
"@container": "@set"
|
|
410
|
+
},
|
|
411
|
+
"capabilityDelegation": {
|
|
412
|
+
"@id": "https://w3id.org/security#capabilityDelegationMethod",
|
|
413
|
+
"@type": "@id",
|
|
414
|
+
"@container": "@set"
|
|
415
|
+
},
|
|
416
|
+
"capabilityInvocation": {
|
|
417
|
+
"@id": "https://w3id.org/security#capabilityInvocationMethod",
|
|
418
|
+
"@type": "@id",
|
|
419
|
+
"@container": "@set"
|
|
420
|
+
},
|
|
421
|
+
"controller": {
|
|
422
|
+
"@id": "https://w3id.org/security#controller",
|
|
423
|
+
"@type": "@id"
|
|
424
|
+
},
|
|
425
|
+
"keyAgreement": {
|
|
426
|
+
"@id": "https://w3id.org/security#keyAgreementMethod",
|
|
427
|
+
"@type": "@id",
|
|
428
|
+
"@container": "@set"
|
|
429
|
+
},
|
|
430
|
+
"service": {
|
|
431
|
+
"@id": "https://www.w3.org/ns/did#service",
|
|
432
|
+
"@type": "@id",
|
|
433
|
+
"@context": {
|
|
434
|
+
"@protected": true,
|
|
435
|
+
"id": "@id",
|
|
436
|
+
"type": "@type",
|
|
437
|
+
"serviceEndpoint": {
|
|
438
|
+
"@id": "https://www.w3.org/ns/did#serviceEndpoint",
|
|
439
|
+
"@type": "@id"
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
},
|
|
443
|
+
"verificationMethod": {
|
|
444
|
+
"@id": "https://w3id.org/security#verificationMethod",
|
|
445
|
+
"@type": "@id"
|
|
446
|
+
},
|
|
447
|
+
"Multikey": {
|
|
448
|
+
"@id": "https://w3id.org/security#Multikey",
|
|
449
|
+
"@context": {
|
|
450
|
+
"@protected": true,
|
|
451
|
+
"id": "@id",
|
|
452
|
+
"type": "@type",
|
|
453
|
+
"controller": {
|
|
454
|
+
"@id": "https://w3id.org/security#controller",
|
|
455
|
+
"@type": "@id"
|
|
456
|
+
},
|
|
457
|
+
"revoked": {
|
|
458
|
+
"@id": "https://w3id.org/security#revoked",
|
|
459
|
+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
|
|
460
|
+
},
|
|
461
|
+
"expires": {
|
|
462
|
+
"@id": "https://w3id.org/security#expiration",
|
|
463
|
+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
|
|
464
|
+
},
|
|
465
|
+
"publicKeyMultibase": {
|
|
466
|
+
"@id": "https://w3id.org/security#publicKeyMultibase",
|
|
467
|
+
"@type": "https://w3id.org/security#multibase"
|
|
468
|
+
},
|
|
469
|
+
"secretKeyMultibase": {
|
|
470
|
+
"@id": "https://w3id.org/security#secretKeyMultibase",
|
|
471
|
+
"@type": "https://w3id.org/security#multibase"
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
},
|
|
475
|
+
"JsonWebKey": {
|
|
476
|
+
"@id": "https://w3id.org/security#JsonWebKey",
|
|
477
|
+
"@context": {
|
|
478
|
+
"@protected": true,
|
|
479
|
+
"id": "@id",
|
|
480
|
+
"type": "@type",
|
|
481
|
+
"controller": {
|
|
482
|
+
"@id": "https://w3id.org/security#controller",
|
|
483
|
+
"@type": "@id"
|
|
484
|
+
},
|
|
485
|
+
"revoked": {
|
|
486
|
+
"@id": "https://w3id.org/security#revoked",
|
|
487
|
+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
|
|
488
|
+
},
|
|
489
|
+
"expires": {
|
|
490
|
+
"@id": "https://w3id.org/security#expiration",
|
|
491
|
+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
|
|
492
|
+
},
|
|
493
|
+
"publicKeyJwk": {
|
|
494
|
+
"@id": "https://w3id.org/security#publicKeyJwk",
|
|
495
|
+
"@type": "@json"
|
|
496
|
+
},
|
|
497
|
+
"secretKeyJwk": {
|
|
498
|
+
"@id": "https://w3id.org/security#secretKeyJwk",
|
|
499
|
+
"@type": "@json"
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
} };
|
|
504
|
+
//#endregion
|
|
392
505
|
//#region src/contexts/did-v1.json
|
|
393
506
|
var did_v1_default = { "@context": {
|
|
394
507
|
"@protected": true,
|
|
@@ -482,6 +595,16 @@ var fep_5711_default = { "@context": {
|
|
|
482
595
|
}
|
|
483
596
|
} };
|
|
484
597
|
//#endregion
|
|
598
|
+
//#region src/contexts/fep-ef61.json
|
|
599
|
+
var fep_ef61_default = { "@context": {
|
|
600
|
+
"gateways": {
|
|
601
|
+
"@id": "https://w3id.org/fep/ef61/gateways",
|
|
602
|
+
"@type": "@id",
|
|
603
|
+
"@container": "@list"
|
|
604
|
+
},
|
|
605
|
+
"digestMultibase": "https://www.w3.org/ns/credentials/v2#digestMultibase"
|
|
606
|
+
} };
|
|
607
|
+
//#endregion
|
|
485
608
|
//#region src/contexts/gotosocial.json
|
|
486
609
|
var gotosocial_default = { "@context": {
|
|
487
610
|
"xsd": "http://www.w3.org/2001/XMLSchema#",
|
|
@@ -783,18 +906,12 @@ var miscellany_default = { "@context": {
|
|
|
783
906
|
"as": "https://www.w3.org/ns/activitystreams#",
|
|
784
907
|
"xsd": "http://www.w3.org/2001/XMLSchema#",
|
|
785
908
|
"Hashtag": "as:Hashtag",
|
|
786
|
-
"manuallyApprovesFollowers": {
|
|
787
|
-
"@id": "as:manuallyApprovesFollowers",
|
|
788
|
-
"@type": "xsd:boolean"
|
|
789
|
-
},
|
|
909
|
+
"manuallyApprovesFollowers": { "@id": "as:manuallyApprovesFollowers" },
|
|
790
910
|
"movedTo": {
|
|
791
911
|
"@id": "as:movedTo",
|
|
792
912
|
"@type": "@id"
|
|
793
913
|
},
|
|
794
|
-
"sensitive": {
|
|
795
|
-
"@id": "as:sensitive",
|
|
796
|
-
"@type": "xsd:boolean"
|
|
797
|
-
}
|
|
914
|
+
"sensitive": { "@id": "as:sensitive" }
|
|
798
915
|
} };
|
|
799
916
|
//#endregion
|
|
800
917
|
//#region src/contexts/schemaorg.json
|
|
@@ -4393,6 +4510,8 @@ const preloadedContexts = {
|
|
|
4393
4510
|
"http://schema.org/": schemaorg_default,
|
|
4394
4511
|
"https://gotosocial.org/ns": gotosocial_default,
|
|
4395
4512
|
"https://w3id.org/fep/5711": fep_5711_default,
|
|
4513
|
+
"https://www.w3.org/ns/cid/v1": cid_v1_default,
|
|
4514
|
+
"https://w3id.org/fep/ef61": fep_ef61_default,
|
|
4396
4515
|
"https://join-lemmy.org/context.json": join_lemmy_default,
|
|
4397
4516
|
"http://joinmastodon.org/ns": joinmastodon_default,
|
|
4398
4517
|
"https://purl.archive.org/miscellany": miscellany_default
|
|
@@ -4400,7 +4519,7 @@ const preloadedContexts = {
|
|
|
4400
4519
|
//#endregion
|
|
4401
4520
|
//#region deno.json
|
|
4402
4521
|
var name = "@fedify/vocab-runtime";
|
|
4403
|
-
var version = "2.1.
|
|
4522
|
+
var version = "2.1.22";
|
|
4404
4523
|
//#endregion
|
|
4405
4524
|
//#region src/link.ts
|
|
4406
4525
|
const parametersNeedLowerCase = ["rel", "type"];
|
|
@@ -4967,7 +5086,9 @@ async function getRemoteDocument(url, response, fetch) {
|
|
|
4967
5086
|
* - <https://w3id.org/security/v1>
|
|
4968
5087
|
* - <https://w3id.org/security/data-integrity/v1>
|
|
4969
5088
|
* - <https://www.w3.org/ns/did/v1>
|
|
5089
|
+
* - <https://www.w3.org/ns/cid/v1>
|
|
4970
5090
|
* - <https://w3id.org/security/multikey/v1>
|
|
5091
|
+
* - <https://w3id.org/fep/ef61>
|
|
4971
5092
|
* - <https://purl.archive.org/socialweb/webfinger>
|
|
4972
5093
|
* - <http://schema.org/>
|
|
4973
5094
|
* @param options Options for the document loader.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require("./chunk-Do9eywBl.cjs");
|
|
2
|
-
const require_request = require("./request-
|
|
2
|
+
const require_request = require("./request-0j5qU0qi.cjs");
|
|
3
3
|
const require_link = require("./link-FguCydMA.cjs");
|
|
4
4
|
const require_url = require("./url-CWU5HT3Y.cjs");
|
|
5
5
|
let _logtape_logtape = require("@logtape/logtape");
|
|
@@ -383,6 +383,119 @@ var activitystreams_default = { "@context": {
|
|
|
383
383
|
}
|
|
384
384
|
} };
|
|
385
385
|
//#endregion
|
|
386
|
+
//#region src/contexts/cid-v1.json
|
|
387
|
+
var cid_v1_default = { "@context": {
|
|
388
|
+
"@protected": true,
|
|
389
|
+
"id": "@id",
|
|
390
|
+
"type": "@type",
|
|
391
|
+
"alsoKnownAs": {
|
|
392
|
+
"@id": "https://www.w3.org/ns/activitystreams#alsoKnownAs",
|
|
393
|
+
"@type": "@id"
|
|
394
|
+
},
|
|
395
|
+
"assertionMethod": {
|
|
396
|
+
"@id": "https://w3id.org/security#assertionMethod",
|
|
397
|
+
"@type": "@id",
|
|
398
|
+
"@container": "@set"
|
|
399
|
+
},
|
|
400
|
+
"authentication": {
|
|
401
|
+
"@id": "https://w3id.org/security#authenticationMethod",
|
|
402
|
+
"@type": "@id",
|
|
403
|
+
"@container": "@set"
|
|
404
|
+
},
|
|
405
|
+
"capabilityDelegation": {
|
|
406
|
+
"@id": "https://w3id.org/security#capabilityDelegationMethod",
|
|
407
|
+
"@type": "@id",
|
|
408
|
+
"@container": "@set"
|
|
409
|
+
},
|
|
410
|
+
"capabilityInvocation": {
|
|
411
|
+
"@id": "https://w3id.org/security#capabilityInvocationMethod",
|
|
412
|
+
"@type": "@id",
|
|
413
|
+
"@container": "@set"
|
|
414
|
+
},
|
|
415
|
+
"controller": {
|
|
416
|
+
"@id": "https://w3id.org/security#controller",
|
|
417
|
+
"@type": "@id"
|
|
418
|
+
},
|
|
419
|
+
"keyAgreement": {
|
|
420
|
+
"@id": "https://w3id.org/security#keyAgreementMethod",
|
|
421
|
+
"@type": "@id",
|
|
422
|
+
"@container": "@set"
|
|
423
|
+
},
|
|
424
|
+
"service": {
|
|
425
|
+
"@id": "https://www.w3.org/ns/did#service",
|
|
426
|
+
"@type": "@id",
|
|
427
|
+
"@context": {
|
|
428
|
+
"@protected": true,
|
|
429
|
+
"id": "@id",
|
|
430
|
+
"type": "@type",
|
|
431
|
+
"serviceEndpoint": {
|
|
432
|
+
"@id": "https://www.w3.org/ns/did#serviceEndpoint",
|
|
433
|
+
"@type": "@id"
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
},
|
|
437
|
+
"verificationMethod": {
|
|
438
|
+
"@id": "https://w3id.org/security#verificationMethod",
|
|
439
|
+
"@type": "@id"
|
|
440
|
+
},
|
|
441
|
+
"Multikey": {
|
|
442
|
+
"@id": "https://w3id.org/security#Multikey",
|
|
443
|
+
"@context": {
|
|
444
|
+
"@protected": true,
|
|
445
|
+
"id": "@id",
|
|
446
|
+
"type": "@type",
|
|
447
|
+
"controller": {
|
|
448
|
+
"@id": "https://w3id.org/security#controller",
|
|
449
|
+
"@type": "@id"
|
|
450
|
+
},
|
|
451
|
+
"revoked": {
|
|
452
|
+
"@id": "https://w3id.org/security#revoked",
|
|
453
|
+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
|
|
454
|
+
},
|
|
455
|
+
"expires": {
|
|
456
|
+
"@id": "https://w3id.org/security#expiration",
|
|
457
|
+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
|
|
458
|
+
},
|
|
459
|
+
"publicKeyMultibase": {
|
|
460
|
+
"@id": "https://w3id.org/security#publicKeyMultibase",
|
|
461
|
+
"@type": "https://w3id.org/security#multibase"
|
|
462
|
+
},
|
|
463
|
+
"secretKeyMultibase": {
|
|
464
|
+
"@id": "https://w3id.org/security#secretKeyMultibase",
|
|
465
|
+
"@type": "https://w3id.org/security#multibase"
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
},
|
|
469
|
+
"JsonWebKey": {
|
|
470
|
+
"@id": "https://w3id.org/security#JsonWebKey",
|
|
471
|
+
"@context": {
|
|
472
|
+
"@protected": true,
|
|
473
|
+
"id": "@id",
|
|
474
|
+
"type": "@type",
|
|
475
|
+
"controller": {
|
|
476
|
+
"@id": "https://w3id.org/security#controller",
|
|
477
|
+
"@type": "@id"
|
|
478
|
+
},
|
|
479
|
+
"revoked": {
|
|
480
|
+
"@id": "https://w3id.org/security#revoked",
|
|
481
|
+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
|
|
482
|
+
},
|
|
483
|
+
"expires": {
|
|
484
|
+
"@id": "https://w3id.org/security#expiration",
|
|
485
|
+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
|
|
486
|
+
},
|
|
487
|
+
"publicKeyJwk": {
|
|
488
|
+
"@id": "https://w3id.org/security#publicKeyJwk",
|
|
489
|
+
"@type": "@json"
|
|
490
|
+
},
|
|
491
|
+
"secretKeyJwk": {
|
|
492
|
+
"@id": "https://w3id.org/security#secretKeyJwk",
|
|
493
|
+
"@type": "@json"
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
} };
|
|
498
|
+
//#endregion
|
|
386
499
|
//#region src/contexts/did-v1.json
|
|
387
500
|
var did_v1_default = { "@context": {
|
|
388
501
|
"@protected": true,
|
|
@@ -476,6 +589,16 @@ var fep_5711_default = { "@context": {
|
|
|
476
589
|
}
|
|
477
590
|
} };
|
|
478
591
|
//#endregion
|
|
592
|
+
//#region src/contexts/fep-ef61.json
|
|
593
|
+
var fep_ef61_default = { "@context": {
|
|
594
|
+
"gateways": {
|
|
595
|
+
"@id": "https://w3id.org/fep/ef61/gateways",
|
|
596
|
+
"@type": "@id",
|
|
597
|
+
"@container": "@list"
|
|
598
|
+
},
|
|
599
|
+
"digestMultibase": "https://www.w3.org/ns/credentials/v2#digestMultibase"
|
|
600
|
+
} };
|
|
601
|
+
//#endregion
|
|
479
602
|
//#region src/contexts/gotosocial.json
|
|
480
603
|
var gotosocial_default = { "@context": {
|
|
481
604
|
"xsd": "http://www.w3.org/2001/XMLSchema#",
|
|
@@ -777,18 +900,12 @@ var miscellany_default = { "@context": {
|
|
|
777
900
|
"as": "https://www.w3.org/ns/activitystreams#",
|
|
778
901
|
"xsd": "http://www.w3.org/2001/XMLSchema#",
|
|
779
902
|
"Hashtag": "as:Hashtag",
|
|
780
|
-
"manuallyApprovesFollowers": {
|
|
781
|
-
"@id": "as:manuallyApprovesFollowers",
|
|
782
|
-
"@type": "xsd:boolean"
|
|
783
|
-
},
|
|
903
|
+
"manuallyApprovesFollowers": { "@id": "as:manuallyApprovesFollowers" },
|
|
784
904
|
"movedTo": {
|
|
785
905
|
"@id": "as:movedTo",
|
|
786
906
|
"@type": "@id"
|
|
787
907
|
},
|
|
788
|
-
"sensitive": {
|
|
789
|
-
"@id": "as:sensitive",
|
|
790
|
-
"@type": "xsd:boolean"
|
|
791
|
-
}
|
|
908
|
+
"sensitive": { "@id": "as:sensitive" }
|
|
792
909
|
} };
|
|
793
910
|
//#endregion
|
|
794
911
|
//#region src/contexts/schemaorg.json
|
|
@@ -4387,6 +4504,8 @@ const preloadedContexts = {
|
|
|
4387
4504
|
"http://schema.org/": schemaorg_default,
|
|
4388
4505
|
"https://gotosocial.org/ns": gotosocial_default,
|
|
4389
4506
|
"https://w3id.org/fep/5711": fep_5711_default,
|
|
4507
|
+
"https://www.w3.org/ns/cid/v1": cid_v1_default,
|
|
4508
|
+
"https://w3id.org/fep/ef61": fep_ef61_default,
|
|
4390
4509
|
"https://join-lemmy.org/context.json": join_lemmy_default,
|
|
4391
4510
|
"http://joinmastodon.org/ns": joinmastodon_default,
|
|
4392
4511
|
"https://purl.archive.org/miscellany": miscellany_default
|
|
@@ -4506,7 +4625,9 @@ async function getRemoteDocument(url, response, fetch) {
|
|
|
4506
4625
|
* - <https://w3id.org/security/v1>
|
|
4507
4626
|
* - <https://w3id.org/security/data-integrity/v1>
|
|
4508
4627
|
* - <https://www.w3.org/ns/did/v1>
|
|
4628
|
+
* - <https://www.w3.org/ns/cid/v1>
|
|
4509
4629
|
* - <https://w3id.org/security/multikey/v1>
|
|
4630
|
+
* - <https://w3id.org/fep/ef61>
|
|
4510
4631
|
* - <https://purl.archive.org/socialweb/webfinger>
|
|
4511
4632
|
* - <http://schema.org/>
|
|
4512
4633
|
* @param options Options for the document loader.
|
|
@@ -4586,6 +4707,12 @@ function getDocumentLoader({ allowPrivateAddress, skipPreloadedContexts, userAge
|
|
|
4586
4707
|
return load;
|
|
4587
4708
|
}
|
|
4588
4709
|
//#endregion
|
|
4710
|
+
Object.defineProperty(exports, "cid_v1_default", {
|
|
4711
|
+
enumerable: true,
|
|
4712
|
+
get: function() {
|
|
4713
|
+
return cid_v1_default;
|
|
4714
|
+
}
|
|
4715
|
+
});
|
|
4589
4716
|
Object.defineProperty(exports, "getDocumentLoader", {
|
|
4590
4717
|
enumerable: true,
|
|
4591
4718
|
get: function() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as name, i as logRequest, n as createActivityPubRequest, o as version, t as FetchError } from "./request-
|
|
1
|
+
import { a as name, i as logRequest, n as createActivityPubRequest, o as version, t as FetchError } from "./request-W5ez4835.mjs";
|
|
2
2
|
import { t as HttpHeaderLink } from "./link-NUUWCdnK.mjs";
|
|
3
3
|
import { o as validatePublicUrl, t as UrlError } from "./url-o0e-aXQY.mjs";
|
|
4
4
|
import { getLogger } from "@logtape/logtape";
|
|
@@ -382,6 +382,119 @@ var activitystreams_default = { "@context": {
|
|
|
382
382
|
}
|
|
383
383
|
} };
|
|
384
384
|
//#endregion
|
|
385
|
+
//#region src/contexts/cid-v1.json
|
|
386
|
+
var cid_v1_default = { "@context": {
|
|
387
|
+
"@protected": true,
|
|
388
|
+
"id": "@id",
|
|
389
|
+
"type": "@type",
|
|
390
|
+
"alsoKnownAs": {
|
|
391
|
+
"@id": "https://www.w3.org/ns/activitystreams#alsoKnownAs",
|
|
392
|
+
"@type": "@id"
|
|
393
|
+
},
|
|
394
|
+
"assertionMethod": {
|
|
395
|
+
"@id": "https://w3id.org/security#assertionMethod",
|
|
396
|
+
"@type": "@id",
|
|
397
|
+
"@container": "@set"
|
|
398
|
+
},
|
|
399
|
+
"authentication": {
|
|
400
|
+
"@id": "https://w3id.org/security#authenticationMethod",
|
|
401
|
+
"@type": "@id",
|
|
402
|
+
"@container": "@set"
|
|
403
|
+
},
|
|
404
|
+
"capabilityDelegation": {
|
|
405
|
+
"@id": "https://w3id.org/security#capabilityDelegationMethod",
|
|
406
|
+
"@type": "@id",
|
|
407
|
+
"@container": "@set"
|
|
408
|
+
},
|
|
409
|
+
"capabilityInvocation": {
|
|
410
|
+
"@id": "https://w3id.org/security#capabilityInvocationMethod",
|
|
411
|
+
"@type": "@id",
|
|
412
|
+
"@container": "@set"
|
|
413
|
+
},
|
|
414
|
+
"controller": {
|
|
415
|
+
"@id": "https://w3id.org/security#controller",
|
|
416
|
+
"@type": "@id"
|
|
417
|
+
},
|
|
418
|
+
"keyAgreement": {
|
|
419
|
+
"@id": "https://w3id.org/security#keyAgreementMethod",
|
|
420
|
+
"@type": "@id",
|
|
421
|
+
"@container": "@set"
|
|
422
|
+
},
|
|
423
|
+
"service": {
|
|
424
|
+
"@id": "https://www.w3.org/ns/did#service",
|
|
425
|
+
"@type": "@id",
|
|
426
|
+
"@context": {
|
|
427
|
+
"@protected": true,
|
|
428
|
+
"id": "@id",
|
|
429
|
+
"type": "@type",
|
|
430
|
+
"serviceEndpoint": {
|
|
431
|
+
"@id": "https://www.w3.org/ns/did#serviceEndpoint",
|
|
432
|
+
"@type": "@id"
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
},
|
|
436
|
+
"verificationMethod": {
|
|
437
|
+
"@id": "https://w3id.org/security#verificationMethod",
|
|
438
|
+
"@type": "@id"
|
|
439
|
+
},
|
|
440
|
+
"Multikey": {
|
|
441
|
+
"@id": "https://w3id.org/security#Multikey",
|
|
442
|
+
"@context": {
|
|
443
|
+
"@protected": true,
|
|
444
|
+
"id": "@id",
|
|
445
|
+
"type": "@type",
|
|
446
|
+
"controller": {
|
|
447
|
+
"@id": "https://w3id.org/security#controller",
|
|
448
|
+
"@type": "@id"
|
|
449
|
+
},
|
|
450
|
+
"revoked": {
|
|
451
|
+
"@id": "https://w3id.org/security#revoked",
|
|
452
|
+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
|
|
453
|
+
},
|
|
454
|
+
"expires": {
|
|
455
|
+
"@id": "https://w3id.org/security#expiration",
|
|
456
|
+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
|
|
457
|
+
},
|
|
458
|
+
"publicKeyMultibase": {
|
|
459
|
+
"@id": "https://w3id.org/security#publicKeyMultibase",
|
|
460
|
+
"@type": "https://w3id.org/security#multibase"
|
|
461
|
+
},
|
|
462
|
+
"secretKeyMultibase": {
|
|
463
|
+
"@id": "https://w3id.org/security#secretKeyMultibase",
|
|
464
|
+
"@type": "https://w3id.org/security#multibase"
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
},
|
|
468
|
+
"JsonWebKey": {
|
|
469
|
+
"@id": "https://w3id.org/security#JsonWebKey",
|
|
470
|
+
"@context": {
|
|
471
|
+
"@protected": true,
|
|
472
|
+
"id": "@id",
|
|
473
|
+
"type": "@type",
|
|
474
|
+
"controller": {
|
|
475
|
+
"@id": "https://w3id.org/security#controller",
|
|
476
|
+
"@type": "@id"
|
|
477
|
+
},
|
|
478
|
+
"revoked": {
|
|
479
|
+
"@id": "https://w3id.org/security#revoked",
|
|
480
|
+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
|
|
481
|
+
},
|
|
482
|
+
"expires": {
|
|
483
|
+
"@id": "https://w3id.org/security#expiration",
|
|
484
|
+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
|
|
485
|
+
},
|
|
486
|
+
"publicKeyJwk": {
|
|
487
|
+
"@id": "https://w3id.org/security#publicKeyJwk",
|
|
488
|
+
"@type": "@json"
|
|
489
|
+
},
|
|
490
|
+
"secretKeyJwk": {
|
|
491
|
+
"@id": "https://w3id.org/security#secretKeyJwk",
|
|
492
|
+
"@type": "@json"
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
} };
|
|
497
|
+
//#endregion
|
|
385
498
|
//#region src/contexts/did-v1.json
|
|
386
499
|
var did_v1_default = { "@context": {
|
|
387
500
|
"@protected": true,
|
|
@@ -475,6 +588,16 @@ var fep_5711_default = { "@context": {
|
|
|
475
588
|
}
|
|
476
589
|
} };
|
|
477
590
|
//#endregion
|
|
591
|
+
//#region src/contexts/fep-ef61.json
|
|
592
|
+
var fep_ef61_default = { "@context": {
|
|
593
|
+
"gateways": {
|
|
594
|
+
"@id": "https://w3id.org/fep/ef61/gateways",
|
|
595
|
+
"@type": "@id",
|
|
596
|
+
"@container": "@list"
|
|
597
|
+
},
|
|
598
|
+
"digestMultibase": "https://www.w3.org/ns/credentials/v2#digestMultibase"
|
|
599
|
+
} };
|
|
600
|
+
//#endregion
|
|
478
601
|
//#region src/contexts/gotosocial.json
|
|
479
602
|
var gotosocial_default = { "@context": {
|
|
480
603
|
"xsd": "http://www.w3.org/2001/XMLSchema#",
|
|
@@ -776,18 +899,12 @@ var miscellany_default = { "@context": {
|
|
|
776
899
|
"as": "https://www.w3.org/ns/activitystreams#",
|
|
777
900
|
"xsd": "http://www.w3.org/2001/XMLSchema#",
|
|
778
901
|
"Hashtag": "as:Hashtag",
|
|
779
|
-
"manuallyApprovesFollowers": {
|
|
780
|
-
"@id": "as:manuallyApprovesFollowers",
|
|
781
|
-
"@type": "xsd:boolean"
|
|
782
|
-
},
|
|
902
|
+
"manuallyApprovesFollowers": { "@id": "as:manuallyApprovesFollowers" },
|
|
783
903
|
"movedTo": {
|
|
784
904
|
"@id": "as:movedTo",
|
|
785
905
|
"@type": "@id"
|
|
786
906
|
},
|
|
787
|
-
"sensitive": {
|
|
788
|
-
"@id": "as:sensitive",
|
|
789
|
-
"@type": "xsd:boolean"
|
|
790
|
-
}
|
|
907
|
+
"sensitive": { "@id": "as:sensitive" }
|
|
791
908
|
} };
|
|
792
909
|
//#endregion
|
|
793
910
|
//#region src/contexts/schemaorg.json
|
|
@@ -4386,6 +4503,8 @@ const preloadedContexts = {
|
|
|
4386
4503
|
"http://schema.org/": schemaorg_default,
|
|
4387
4504
|
"https://gotosocial.org/ns": gotosocial_default,
|
|
4388
4505
|
"https://w3id.org/fep/5711": fep_5711_default,
|
|
4506
|
+
"https://www.w3.org/ns/cid/v1": cid_v1_default,
|
|
4507
|
+
"https://w3id.org/fep/ef61": fep_ef61_default,
|
|
4389
4508
|
"https://join-lemmy.org/context.json": join_lemmy_default,
|
|
4390
4509
|
"http://joinmastodon.org/ns": joinmastodon_default,
|
|
4391
4510
|
"https://purl.archive.org/miscellany": miscellany_default
|
|
@@ -4505,7 +4624,9 @@ async function getRemoteDocument(url, response, fetch) {
|
|
|
4505
4624
|
* - <https://w3id.org/security/v1>
|
|
4506
4625
|
* - <https://w3id.org/security/data-integrity/v1>
|
|
4507
4626
|
* - <https://www.w3.org/ns/did/v1>
|
|
4627
|
+
* - <https://www.w3.org/ns/cid/v1>
|
|
4508
4628
|
* - <https://w3id.org/security/multikey/v1>
|
|
4629
|
+
* - <https://w3id.org/fep/ef61>
|
|
4509
4630
|
* - <https://purl.archive.org/socialweb/webfinger>
|
|
4510
4631
|
* - <http://schema.org/>
|
|
4511
4632
|
* @param options Options for the document loader.
|
|
@@ -4585,4 +4706,4 @@ function getDocumentLoader({ allowPrivateAddress, skipPreloadedContexts, userAge
|
|
|
4585
4706
|
return load;
|
|
4586
4707
|
}
|
|
4587
4708
|
//#endregion
|
|
4588
|
-
export { preloadedContexts as n, getDocumentLoader as t };
|
|
4709
|
+
export { preloadedContexts as n, cid_v1_default as r, getDocumentLoader as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-Do9eywBl.cjs");
|
|
2
|
-
const require_docloader = require("./docloader-
|
|
3
|
-
const require_request = require("./request-
|
|
2
|
+
const require_docloader = require("./docloader-CsqLeLhI.cjs");
|
|
3
|
+
const require_request = require("./request-0j5qU0qi.cjs");
|
|
4
4
|
const require_url = require("./url-CWU5HT3Y.cjs");
|
|
5
5
|
let node_assert = require("node:assert");
|
|
6
6
|
let node_test = require("node:test");
|
|
@@ -1431,6 +1431,31 @@ var esm_default = new class FetchMock {
|
|
|
1431
1431
|
document
|
|
1432
1432
|
});
|
|
1433
1433
|
});
|
|
1434
|
+
esm_default.get("https://www.w3.org/ns/cid/v1", { status: 503 });
|
|
1435
|
+
await t.test("preloaded CID v1 context", async () => {
|
|
1436
|
+
const url = "https://www.w3.org/ns/cid/v1";
|
|
1437
|
+
(0, node_assert.deepStrictEqual)(await fetchDocumentLoader(url), {
|
|
1438
|
+
contextUrl: null,
|
|
1439
|
+
documentUrl: url,
|
|
1440
|
+
document: require_docloader.cid_v1_default
|
|
1441
|
+
});
|
|
1442
|
+
});
|
|
1443
|
+
await t.test("preloaded FEP-ef61 context", async () => {
|
|
1444
|
+
const url = "https://w3id.org/fep/ef61";
|
|
1445
|
+
(0, node_assert.ok)(url in require_docloader.preloadedContexts);
|
|
1446
|
+
(0, node_assert.deepStrictEqual)(await fetchDocumentLoader(url), {
|
|
1447
|
+
contextUrl: null,
|
|
1448
|
+
documentUrl: url,
|
|
1449
|
+
document: { "@context": {
|
|
1450
|
+
gateways: {
|
|
1451
|
+
"@id": "https://w3id.org/fep/ef61/gateways",
|
|
1452
|
+
"@type": "@id",
|
|
1453
|
+
"@container": "@list"
|
|
1454
|
+
},
|
|
1455
|
+
digestMultibase: "https://www.w3.org/ns/credentials/v2#digestMultibase"
|
|
1456
|
+
} }
|
|
1457
|
+
});
|
|
1458
|
+
});
|
|
1434
1459
|
await t.test("deny non-HTTP/HTTPS", async () => {
|
|
1435
1460
|
await (0, node_assert.rejects)(() => fetchDocumentLoader("ftp://localhost"), require_url.UrlError);
|
|
1436
1461
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as preloadedContexts, t as getDocumentLoader } from "./docloader-
|
|
2
|
-
import { t as FetchError } from "./request-
|
|
1
|
+
import { n as preloadedContexts, r as cid_v1_default, t as getDocumentLoader } from "./docloader-DTEkEfXf.mjs";
|
|
2
|
+
import { t as FetchError } from "./request-W5ez4835.mjs";
|
|
3
3
|
import { t as UrlError } from "./url-o0e-aXQY.mjs";
|
|
4
4
|
import { deepStrictEqual, ok, rejects } from "node:assert";
|
|
5
5
|
import { test } from "node:test";
|
|
@@ -1450,6 +1450,31 @@ test("getDocumentLoader()", async (t) => {
|
|
|
1450
1450
|
document
|
|
1451
1451
|
});
|
|
1452
1452
|
});
|
|
1453
|
+
esm_default.get("https://www.w3.org/ns/cid/v1", { status: 503 });
|
|
1454
|
+
await t.test("preloaded CID v1 context", async () => {
|
|
1455
|
+
const url = "https://www.w3.org/ns/cid/v1";
|
|
1456
|
+
deepStrictEqual(await fetchDocumentLoader(url), {
|
|
1457
|
+
contextUrl: null,
|
|
1458
|
+
documentUrl: url,
|
|
1459
|
+
document: cid_v1_default
|
|
1460
|
+
});
|
|
1461
|
+
});
|
|
1462
|
+
await t.test("preloaded FEP-ef61 context", async () => {
|
|
1463
|
+
const url = "https://w3id.org/fep/ef61";
|
|
1464
|
+
ok(url in preloadedContexts);
|
|
1465
|
+
deepStrictEqual(await fetchDocumentLoader(url), {
|
|
1466
|
+
contextUrl: null,
|
|
1467
|
+
documentUrl: url,
|
|
1468
|
+
document: { "@context": {
|
|
1469
|
+
gateways: {
|
|
1470
|
+
"@id": "https://w3id.org/fep/ef61/gateways",
|
|
1471
|
+
"@type": "@id",
|
|
1472
|
+
"@container": "@list"
|
|
1473
|
+
},
|
|
1474
|
+
digestMultibase: "https://www.w3.org/ns/credentials/v2#digestMultibase"
|
|
1475
|
+
} }
|
|
1476
|
+
});
|
|
1477
|
+
});
|
|
1453
1478
|
await t.test("deny non-HTTP/HTTPS", async () => {
|
|
1454
1479
|
await rejects(() => fetchDocumentLoader("ftp://localhost"), UrlError);
|
|
1455
1480
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-Do9eywBl.cjs");
|
|
2
|
-
const require_request = require("./request-
|
|
2
|
+
const require_request = require("./request-0j5qU0qi.cjs");
|
|
3
3
|
let node_assert = require("node:assert");
|
|
4
4
|
let node_test = require("node:test");
|
|
5
5
|
let node_process = require("node:process");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as version, r as getUserAgent } from "./request-
|
|
1
|
+
import { o as version, r as getUserAgent } from "./request-W5ez4835.mjs";
|
|
2
2
|
import { deepStrictEqual } from "node:assert";
|
|
3
3
|
import { test } from "node:test";
|
|
4
4
|
import process from "node:process";
|
package/package.json
CHANGED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@context": {
|
|
3
|
+
"@protected": true,
|
|
4
|
+
"id": "@id",
|
|
5
|
+
"type": "@type",
|
|
6
|
+
|
|
7
|
+
"alsoKnownAs": {
|
|
8
|
+
"@id": "https://www.w3.org/ns/activitystreams#alsoKnownAs",
|
|
9
|
+
"@type": "@id"
|
|
10
|
+
},
|
|
11
|
+
"assertionMethod": {
|
|
12
|
+
"@id": "https://w3id.org/security#assertionMethod",
|
|
13
|
+
"@type": "@id",
|
|
14
|
+
"@container": "@set"
|
|
15
|
+
},
|
|
16
|
+
"authentication": {
|
|
17
|
+
"@id": "https://w3id.org/security#authenticationMethod",
|
|
18
|
+
"@type": "@id",
|
|
19
|
+
"@container": "@set"
|
|
20
|
+
},
|
|
21
|
+
"capabilityDelegation": {
|
|
22
|
+
"@id": "https://w3id.org/security#capabilityDelegationMethod",
|
|
23
|
+
"@type": "@id",
|
|
24
|
+
"@container": "@set"
|
|
25
|
+
},
|
|
26
|
+
"capabilityInvocation": {
|
|
27
|
+
"@id": "https://w3id.org/security#capabilityInvocationMethod",
|
|
28
|
+
"@type": "@id",
|
|
29
|
+
"@container": "@set"
|
|
30
|
+
},
|
|
31
|
+
"controller": {
|
|
32
|
+
"@id": "https://w3id.org/security#controller",
|
|
33
|
+
"@type": "@id"
|
|
34
|
+
},
|
|
35
|
+
"keyAgreement": {
|
|
36
|
+
"@id": "https://w3id.org/security#keyAgreementMethod",
|
|
37
|
+
"@type": "@id",
|
|
38
|
+
"@container": "@set"
|
|
39
|
+
},
|
|
40
|
+
"service": {
|
|
41
|
+
"@id": "https://www.w3.org/ns/did#service",
|
|
42
|
+
"@type": "@id",
|
|
43
|
+
"@context": {
|
|
44
|
+
"@protected": true,
|
|
45
|
+
"id": "@id",
|
|
46
|
+
"type": "@type",
|
|
47
|
+
"serviceEndpoint": {
|
|
48
|
+
"@id": "https://www.w3.org/ns/did#serviceEndpoint",
|
|
49
|
+
"@type": "@id"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"verificationMethod": {
|
|
54
|
+
"@id": "https://w3id.org/security#verificationMethod",
|
|
55
|
+
"@type": "@id"
|
|
56
|
+
},
|
|
57
|
+
"Multikey": {
|
|
58
|
+
"@id": "https://w3id.org/security#Multikey",
|
|
59
|
+
"@context": {
|
|
60
|
+
"@protected": true,
|
|
61
|
+
"id": "@id",
|
|
62
|
+
"type": "@type",
|
|
63
|
+
"controller": {
|
|
64
|
+
"@id": "https://w3id.org/security#controller",
|
|
65
|
+
"@type": "@id"
|
|
66
|
+
},
|
|
67
|
+
"revoked": {
|
|
68
|
+
"@id": "https://w3id.org/security#revoked",
|
|
69
|
+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
|
|
70
|
+
},
|
|
71
|
+
"expires": {
|
|
72
|
+
"@id": "https://w3id.org/security#expiration",
|
|
73
|
+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
|
|
74
|
+
},
|
|
75
|
+
"publicKeyMultibase": {
|
|
76
|
+
"@id": "https://w3id.org/security#publicKeyMultibase",
|
|
77
|
+
"@type": "https://w3id.org/security#multibase"
|
|
78
|
+
},
|
|
79
|
+
"secretKeyMultibase": {
|
|
80
|
+
"@id": "https://w3id.org/security#secretKeyMultibase",
|
|
81
|
+
"@type": "https://w3id.org/security#multibase"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"JsonWebKey": {
|
|
86
|
+
"@id": "https://w3id.org/security#JsonWebKey",
|
|
87
|
+
"@context": {
|
|
88
|
+
"@protected": true,
|
|
89
|
+
"id": "@id",
|
|
90
|
+
"type": "@type",
|
|
91
|
+
"controller": {
|
|
92
|
+
"@id": "https://w3id.org/security#controller",
|
|
93
|
+
"@type": "@id"
|
|
94
|
+
},
|
|
95
|
+
"revoked": {
|
|
96
|
+
"@id": "https://w3id.org/security#revoked",
|
|
97
|
+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
|
|
98
|
+
},
|
|
99
|
+
"expires": {
|
|
100
|
+
"@id": "https://w3id.org/security#expiration",
|
|
101
|
+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
|
|
102
|
+
},
|
|
103
|
+
"publicKeyJwk": {
|
|
104
|
+
"@id": "https://w3id.org/security#publicKeyJwk",
|
|
105
|
+
"@type": "@json"
|
|
106
|
+
},
|
|
107
|
+
"secretKeyJwk": {
|
|
108
|
+
"@id": "https://w3id.org/security#secretKeyJwk",
|
|
109
|
+
"@type": "@json"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -4,16 +4,14 @@
|
|
|
4
4
|
"xsd": "http://www.w3.org/2001/XMLSchema#",
|
|
5
5
|
"Hashtag": "as:Hashtag",
|
|
6
6
|
"manuallyApprovesFollowers": {
|
|
7
|
-
"@id": "as:manuallyApprovesFollowers"
|
|
8
|
-
"@type": "xsd:boolean"
|
|
7
|
+
"@id": "as:manuallyApprovesFollowers"
|
|
9
8
|
},
|
|
10
9
|
"movedTo": {
|
|
11
10
|
"@id": "as:movedTo",
|
|
12
11
|
"@type": "@id"
|
|
13
12
|
},
|
|
14
13
|
"sensitive": {
|
|
15
|
-
"@id": "as:sensitive"
|
|
16
|
-
"@type": "xsd:boolean"
|
|
14
|
+
"@id": "as:sensitive"
|
|
17
15
|
}
|
|
18
16
|
}
|
|
19
17
|
}
|
package/src/contexts.ts
CHANGED
|
@@ -5,8 +5,10 @@
|
|
|
5
5
|
import activitystreams from "./contexts/activitystreams.json" with {
|
|
6
6
|
type: "json",
|
|
7
7
|
};
|
|
8
|
+
import cidV1Context from "./contexts/cid-v1.json" with { type: "json" };
|
|
8
9
|
import didV1 from "./contexts/did-v1.json" with { type: "json" };
|
|
9
10
|
import fep5711 from "./contexts/fep-5711.json" with { type: "json" };
|
|
11
|
+
import fepEf61 from "./contexts/fep-ef61.json" with { type: "json" };
|
|
10
12
|
import gotosocial from "./contexts/gotosocial.json" with { type: "json" };
|
|
11
13
|
import identityV1 from "./contexts/identity-v1.json" with { type: "json" };
|
|
12
14
|
import joinLemmyContext from "./contexts/join-lemmy.json" with { type: "json" };
|
|
@@ -37,6 +39,23 @@ const preloadedContexts: Record<string, unknown> = {
|
|
|
37
39
|
"https://gotosocial.org/ns": gotosocial,
|
|
38
40
|
"https://w3id.org/fep/5711": fep5711,
|
|
39
41
|
|
|
42
|
+
// Controlled Identifiers v1.0 requires JSON-LD processors to treat this
|
|
43
|
+
// context URL as already resolved. We ship the official W3C context so that
|
|
44
|
+
// controlled identifier documents can be processed without depending on the
|
|
45
|
+
// availability of the remote context server.
|
|
46
|
+
// See: https://www.w3.org/TR/cid-1.0/#json-ld-context
|
|
47
|
+
// https://github.com/fedify-dev/fedify/issues/932
|
|
48
|
+
"https://www.w3.org/ns/cid/v1": cidV1Context,
|
|
49
|
+
|
|
50
|
+
// The FEP-ef61 context. The w3id.org URL redirects to Codeberg Pages, which
|
|
51
|
+
// suffers recurring outages; while it is unreachable, every document
|
|
52
|
+
// referencing this URL fails JSON-LD expansion before application handlers
|
|
53
|
+
// run. We ship a built-in copy so that portable objects can be processed
|
|
54
|
+
// without depending on the availability of the remote context server.
|
|
55
|
+
// See: https://w3id.org/fep/ef61
|
|
56
|
+
// https://github.com/fedify-dev/fedify/issues/982
|
|
57
|
+
"https://w3id.org/fep/ef61": fepEf61,
|
|
58
|
+
|
|
40
59
|
// Lemmy's context document is served as application/json without the JSON-LD
|
|
41
60
|
// context Link header. The default document loader treats that as a regular
|
|
42
61
|
// JSON response instead of a JSON-LD context, so every Lemmy activity that
|
package/src/docloader.test.ts
CHANGED
|
@@ -2,6 +2,7 @@ import fetchMock from "fetch-mock";
|
|
|
2
2
|
import { deepStrictEqual, ok, rejects } from "node:assert";
|
|
3
3
|
import { test } from "node:test";
|
|
4
4
|
import preloadedContexts from "./contexts.ts";
|
|
5
|
+
import cidV1Context from "./contexts/cid-v1.json" with { type: "json" };
|
|
5
6
|
import { getDocumentLoader } from "./docloader.ts";
|
|
6
7
|
import { FetchError } from "./request.ts";
|
|
7
8
|
import { UrlError } from "./url.ts";
|
|
@@ -293,6 +294,46 @@ test("getDocumentLoader()", async (t) => {
|
|
|
293
294
|
}
|
|
294
295
|
});
|
|
295
296
|
|
|
297
|
+
// Controlled Identifiers v1.0 requires JSON-LD processors to treat this
|
|
298
|
+
// context URL as already resolved. A temporary W3C outage must not prevent
|
|
299
|
+
// an otherwise valid document from being processed.
|
|
300
|
+
// See: https://www.w3.org/TR/cid-1.0/#json-ld-context
|
|
301
|
+
// https://github.com/fedify-dev/fedify/issues/932
|
|
302
|
+
fetchMock.get("https://www.w3.org/ns/cid/v1", { status: 503 });
|
|
303
|
+
await t.test("preloaded CID v1 context", async () => {
|
|
304
|
+
const url = "https://www.w3.org/ns/cid/v1";
|
|
305
|
+
deepStrictEqual(await fetchDocumentLoader(url), {
|
|
306
|
+
contextUrl: null,
|
|
307
|
+
documentUrl: url,
|
|
308
|
+
document: cidV1Context,
|
|
309
|
+
});
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
// The <https://w3id.org/fep/ef61> URL redirects to a Codeberg Pages host
|
|
313
|
+
// which suffers recurring outages; while it is unreachable, expanding any
|
|
314
|
+
// document referencing it fails before application handlers run. It has to
|
|
315
|
+
// be resolved from the built-in copy rather than over the network.
|
|
316
|
+
// See: https://github.com/fedify-dev/fedify/issues/982
|
|
317
|
+
await t.test("preloaded FEP-ef61 context", async () => {
|
|
318
|
+
const url = "https://w3id.org/fep/ef61";
|
|
319
|
+
ok(url in preloadedContexts);
|
|
320
|
+
deepStrictEqual(await fetchDocumentLoader(url), {
|
|
321
|
+
contextUrl: null,
|
|
322
|
+
documentUrl: url,
|
|
323
|
+
document: {
|
|
324
|
+
"@context": {
|
|
325
|
+
gateways: {
|
|
326
|
+
"@id": "https://w3id.org/fep/ef61/gateways",
|
|
327
|
+
"@type": "@id",
|
|
328
|
+
"@container": "@list",
|
|
329
|
+
},
|
|
330
|
+
digestMultibase:
|
|
331
|
+
"https://www.w3.org/ns/credentials/v2#digestMultibase",
|
|
332
|
+
},
|
|
333
|
+
},
|
|
334
|
+
});
|
|
335
|
+
});
|
|
336
|
+
|
|
296
337
|
await t.test("deny non-HTTP/HTTPS", async () => {
|
|
297
338
|
await rejects(
|
|
298
339
|
() => fetchDocumentLoader("ftp://localhost"),
|
package/src/docloader.ts
CHANGED
|
@@ -277,7 +277,9 @@ export interface GetDocumentLoaderOptions extends DocumentLoaderFactoryOptions {
|
|
|
277
277
|
* - <https://w3id.org/security/v1>
|
|
278
278
|
* - <https://w3id.org/security/data-integrity/v1>
|
|
279
279
|
* - <https://www.w3.org/ns/did/v1>
|
|
280
|
+
* - <https://www.w3.org/ns/cid/v1>
|
|
280
281
|
* - <https://w3id.org/security/multikey/v1>
|
|
282
|
+
* - <https://w3id.org/fep/ef61>
|
|
281
283
|
* - <https://purl.archive.org/socialweb/webfinger>
|
|
282
284
|
* - <http://schema.org/>
|
|
283
285
|
* @param options Options for the document loader.
|