@@ -49,6 +49,23 @@ import { InboxListenerSet } from "./inbox.ts";
4949import { MemoryKvStore } from "./kv.ts" ;
5050import { createFederation } from "./middleware.ts" ;
5151
52+ const QUOTE_CONTEXT_TERMS = {
53+ QuoteAuthorization : "https://w3id.org/fep/044f#QuoteAuthorization" ,
54+ quote : {
55+ "@id" : "https://w3id.org/fep/044f#quote" ,
56+ "@type" : "@id" ,
57+ } ,
58+ quoteAuthorization : {
59+ "@id" : "https://w3id.org/fep/044f#quoteAuthorization" ,
60+ "@type" : "@id" ,
61+ } ,
62+ } as const ;
63+
64+ const WRAPPER_QUOTE_CONTEXT_TERMS = {
65+ ...QUOTE_CONTEXT_TERMS ,
66+ QuoteRequest : "https://w3id.org/fep/044f#QuoteRequest" ,
67+ } as const ;
68+
5269test ( "handleActor()" , async ( ) => {
5370 const federation = createFederation < void > ( { kv : new MemoryKvStore ( ) } ) ;
5471 let context = createRequestContext < void > ( {
@@ -408,6 +425,7 @@ test("handleObject()", async () => {
408425 _misskey_quote : "misskey:_misskey_quote" ,
409426 fedibird : "http://fedibird.com/ns#" ,
410427 misskey : "https://misskey-hub.net/ns#" ,
428+ ...QUOTE_CONTEXT_TERMS ,
411429 quoteUri : "fedibird:quoteUri" ,
412430 quoteUrl : "as:quoteUrl" ,
413431 emojiReactions : {
@@ -507,6 +525,7 @@ test("handleObject()", async () => {
507525 _misskey_quote : "misskey:_misskey_quote" ,
508526 fedibird : "http://fedibird.com/ns#" ,
509527 misskey : "https://misskey-hub.net/ns#" ,
528+ ...QUOTE_CONTEXT_TERMS ,
510529 quoteUri : "fedibird:quoteUri" ,
511530 quoteUrl : "as:quoteUrl" ,
512531 emojiReactions : {
@@ -698,6 +717,7 @@ test("handleCollection()", async () => {
698717 "@type" : "http://www.w3.org/2001/XMLSchema#nonNegativeInteger" ,
699718 } ,
700719 _misskey_quote : "misskey:_misskey_quote" ,
720+ ...WRAPPER_QUOTE_CONTEXT_TERMS ,
701721 quoteUri : "fedibird:quoteUri" ,
702722 quoteUrl : "as:quoteUrl" ,
703723 emojiReactions : {
@@ -721,6 +741,7 @@ test("handleCollection()", async () => {
721741 sensitive : "as:sensitive" ,
722742 votersCount : "toot:votersCount" ,
723743 _misskey_quote : "misskey:_misskey_quote" ,
744+ ...WRAPPER_QUOTE_CONTEXT_TERMS ,
724745 quoteUri : "fedibird:quoteUri" ,
725746 quoteUrl : "as:quoteUrl" ,
726747 emojiReactions : {
@@ -820,6 +841,7 @@ test("handleCollection()", async () => {
820841 sensitive : "as:sensitive" ,
821842 votersCount : "toot:votersCount" ,
822843 _misskey_quote : "misskey:_misskey_quote" ,
844+ ...WRAPPER_QUOTE_CONTEXT_TERMS ,
823845 quoteUri : "fedibird:quoteUri" ,
824846 quoteUrl : "as:quoteUrl" ,
825847 emojiReactions : {
@@ -890,6 +912,7 @@ test("handleCollection()", async () => {
890912 sensitive : "as:sensitive" ,
891913 votersCount : "toot:votersCount" ,
892914 _misskey_quote : "misskey:_misskey_quote" ,
915+ ...WRAPPER_QUOTE_CONTEXT_TERMS ,
893916 quoteUri : "fedibird:quoteUri" ,
894917 quoteUrl : "as:quoteUrl" ,
895918 emojiReactions : {
@@ -956,6 +979,7 @@ test("handleCollection()", async () => {
956979 sensitive : "as:sensitive" ,
957980 votersCount : "toot:votersCount" ,
958981 _misskey_quote : "misskey:_misskey_quote" ,
982+ ...WRAPPER_QUOTE_CONTEXT_TERMS ,
959983 quoteUri : "fedibird:quoteUri" ,
960984 quoteUrl : "as:quoteUrl" ,
961985 emojiReactions : {
@@ -1026,6 +1050,7 @@ test("handleCollection()", async () => {
10261050 sensitive : "as:sensitive" ,
10271051 votersCount : "toot:votersCount" ,
10281052 _misskey_quote : "misskey:_misskey_quote" ,
1053+ ...WRAPPER_QUOTE_CONTEXT_TERMS ,
10291054 quoteUri : "fedibird:quoteUri" ,
10301055 quoteUrl : "as:quoteUrl" ,
10311056 emojiReactions : {
@@ -1275,6 +1300,7 @@ test("respondWithObject()", async () => {
12751300 _misskey_quote : "misskey:_misskey_quote" ,
12761301 fedibird : "http://fedibird.com/ns#" ,
12771302 misskey : "https://misskey-hub.net/ns#" ,
1303+ ...QUOTE_CONTEXT_TERMS ,
12781304 quoteUri : "fedibird:quoteUri" ,
12791305 quoteUrl : "as:quoteUrl" ,
12801306 emojiReactions : {
@@ -1409,6 +1435,7 @@ test("respondWithObjectIfAcceptable", async () => {
14091435 _misskey_quote : "misskey:_misskey_quote" ,
14101436 fedibird : "http://fedibird.com/ns#" ,
14111437 misskey : "https://misskey-hub.net/ns#" ,
1438+ ...QUOTE_CONTEXT_TERMS ,
14121439 quoteUri : "fedibird:quoteUri" ,
14131440 quoteUrl : "as:quoteUrl" ,
14141441 emojiReactions : {
@@ -1594,6 +1621,7 @@ test("handleCustomCollection()", async () => {
15941621 "@type" : "http://www.w3.org/2001/XMLSchema#nonNegativeInteger" ,
15951622 } ,
15961623 _misskey_quote : "misskey:_misskey_quote" ,
1624+ ...WRAPPER_QUOTE_CONTEXT_TERMS ,
15971625 quoteUri : "fedibird:quoteUri" ,
15981626 quoteUrl : "as:quoteUrl" ,
15991627 emojiReactions : {
@@ -1616,6 +1644,7 @@ test("handleCustomCollection()", async () => {
16161644 sensitive : "as:sensitive" ,
16171645 votersCount : "toot:votersCount" ,
16181646 _misskey_quote : "misskey:_misskey_quote" ,
1647+ ...WRAPPER_QUOTE_CONTEXT_TERMS ,
16191648 quoteUri : "fedibird:quoteUri" ,
16201649 quoteUrl : "as:quoteUrl" ,
16211650 emojiReactions : {
0 commit comments