@fedify/testing 2.4.0-dev.2141 → 2.4.0-dev.2155
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/dist/mod.cjs +50 -11
- package/dist/mod.js +50 -11
- package/package.json +4 -4
package/dist/mod.cjs
CHANGED
|
@@ -39,7 +39,7 @@ const noopMeterProvider$1 = { getMeter: () => ({
|
|
|
39
39
|
removeBatchObservableCallback: () => void 0
|
|
40
40
|
}) };
|
|
41
41
|
function createContext(values) {
|
|
42
|
-
const { federation, url = new URL("http://example.com/"), canonicalOrigin, data, documentLoader, contextLoader, verifyPortableObject, meterProvider, tracerProvider, clone, getNodeInfoUri, getActorUri, getPortableActorUri, getObjectUri, getPortableObjectUri, getPortableInboxUri, getCollectionUri, getOutboxUri, getMediaUploaderUri, getInboxUri, getFollowingUri, getFollowersUri, getLikedUri, getFeaturedUri, getFeaturedTagsUri, parseUri, getActorKeyPairs, getDocumentLoader, lookupObject, traverseCollection, lookupNodeInfo, lookupWebFinger, sendActivity, routeActivity, enqueueTask, enqueueTaskMany } = values;
|
|
42
|
+
const { federation, url = new URL("http://example.com/"), canonicalOrigin, data, documentLoader, contextLoader, verifyPortableObject, meterProvider, tracerProvider, clone, getNodeInfoUri, getActorUri, getPortableActorUri, getObjectUri, getPortableObjectUri, getPortableInboxUri, getPortableOutboxUri, getPortableFollowingUri, getPortableFollowersUri, getPortableLikedUri, getPortableFeaturedUri, getPortableFeaturedTagsUri, getPortableCollectionUri, getCollectionUri, getOutboxUri, getMediaUploaderUri, getInboxUri, getFollowingUri, getFollowersUri, getLikedUri, getFeaturedUri, getFeaturedTagsUri, parseUri, getActorKeyPairs, getDocumentLoader, lookupObject, traverseCollection, lookupNodeInfo, lookupWebFinger, sendActivity, routeActivity, enqueueTask, enqueueTaskMany } = values;
|
|
43
43
|
function throwRouterError() {
|
|
44
44
|
throw new _fedify_fedify_federation.RouterError("Not implemented");
|
|
45
45
|
}
|
|
@@ -65,6 +65,13 @@ function createContext(values) {
|
|
|
65
65
|
getObjectUri: getObjectUri ?? throwRouterError,
|
|
66
66
|
getPortableObjectUri: getPortableObjectUri ?? throwRouterError,
|
|
67
67
|
getPortableInboxUri: getPortableInboxUri ?? throwRouterError,
|
|
68
|
+
getPortableOutboxUri: getPortableOutboxUri ?? throwRouterError,
|
|
69
|
+
getPortableFollowingUri: getPortableFollowingUri ?? throwRouterError,
|
|
70
|
+
getPortableFollowersUri: getPortableFollowersUri ?? throwRouterError,
|
|
71
|
+
getPortableLikedUri: getPortableLikedUri ?? throwRouterError,
|
|
72
|
+
getPortableFeaturedUri: getPortableFeaturedUri ?? throwRouterError,
|
|
73
|
+
getPortableFeaturedTagsUri: getPortableFeaturedTagsUri ?? throwRouterError,
|
|
74
|
+
getPortableCollectionUri: getPortableCollectionUri ?? throwRouterError,
|
|
68
75
|
getCollectionUri: getCollectionUri ?? throwRouterError,
|
|
69
76
|
getOutboxUri: getOutboxUri ?? throwRouterError,
|
|
70
77
|
getMediaUploaderUri: getMediaUploaderUri ?? throwRouterError,
|
|
@@ -644,20 +651,24 @@ var MockFederation = class {
|
|
|
644
651
|
this.sentActivities = [];
|
|
645
652
|
}
|
|
646
653
|
setCollectionDispatcher(_name, _itemType, _path, _dispatcher) {
|
|
647
|
-
|
|
648
|
-
setCounter: () =>
|
|
649
|
-
setFirstCursor: () =>
|
|
650
|
-
setLastCursor: () =>
|
|
651
|
-
authorize: () =>
|
|
654
|
+
const setters = {
|
|
655
|
+
setCounter: () => setters,
|
|
656
|
+
setFirstCursor: () => setters,
|
|
657
|
+
setLastCursor: () => setters,
|
|
658
|
+
authorize: () => setters,
|
|
659
|
+
mapPortableOwner: () => setters
|
|
652
660
|
};
|
|
661
|
+
return setters;
|
|
653
662
|
}
|
|
654
663
|
setOrderedCollectionDispatcher(_name, _itemType, _path, _dispatcher) {
|
|
655
|
-
|
|
656
|
-
setCounter: () =>
|
|
657
|
-
setFirstCursor: () =>
|
|
658
|
-
setLastCursor: () =>
|
|
659
|
-
authorize: () =>
|
|
664
|
+
const setters = {
|
|
665
|
+
setCounter: () => setters,
|
|
666
|
+
setFirstCursor: () => setters,
|
|
667
|
+
setLastCursor: () => setters,
|
|
668
|
+
authorize: () => setters,
|
|
669
|
+
mapPortableOwner: () => setters
|
|
660
670
|
};
|
|
671
|
+
return setters;
|
|
661
672
|
}
|
|
662
673
|
};
|
|
663
674
|
/**
|
|
@@ -867,6 +878,34 @@ var MockContext = class MockContext {
|
|
|
867
878
|
const { pathname } = this.getInboxUri(identifier);
|
|
868
879
|
return buildPortableUri(authority, pathname);
|
|
869
880
|
}
|
|
881
|
+
getPortableOutboxUri(identifier, authority) {
|
|
882
|
+
const { pathname } = this.getOutboxUri(identifier);
|
|
883
|
+
return buildPortableUri(authority, pathname);
|
|
884
|
+
}
|
|
885
|
+
getPortableFollowingUri(identifier, authority) {
|
|
886
|
+
const { pathname } = this.getFollowingUri(identifier);
|
|
887
|
+
return buildPortableUri(authority, pathname);
|
|
888
|
+
}
|
|
889
|
+
getPortableFollowersUri(identifier, authority) {
|
|
890
|
+
const { pathname } = this.getFollowersUri(identifier);
|
|
891
|
+
return buildPortableUri(authority, pathname);
|
|
892
|
+
}
|
|
893
|
+
getPortableLikedUri(identifier, authority) {
|
|
894
|
+
const { pathname } = this.getLikedUri(identifier);
|
|
895
|
+
return buildPortableUri(authority, pathname);
|
|
896
|
+
}
|
|
897
|
+
getPortableFeaturedUri(identifier, authority) {
|
|
898
|
+
const { pathname } = this.getFeaturedUri(identifier);
|
|
899
|
+
return buildPortableUri(authority, pathname);
|
|
900
|
+
}
|
|
901
|
+
getPortableFeaturedTagsUri(identifier, authority) {
|
|
902
|
+
const { pathname } = this.getFeaturedTagsUri(identifier);
|
|
903
|
+
return buildPortableUri(authority, pathname);
|
|
904
|
+
}
|
|
905
|
+
getPortableCollectionUri(name, values, authority) {
|
|
906
|
+
const { pathname } = this.getCollectionUri(name, values);
|
|
907
|
+
return buildPortableUri(authority, pathname);
|
|
908
|
+
}
|
|
870
909
|
getOutboxUri(identifier) {
|
|
871
910
|
if (this.federation instanceof MockFederation && this.federation.outboxPath) {
|
|
872
911
|
const path = expandUriTemplate(this.federation.outboxPath, { identifier });
|
package/dist/mod.js
CHANGED
|
@@ -38,7 +38,7 @@ const noopMeterProvider$1 = { getMeter: () => ({
|
|
|
38
38
|
removeBatchObservableCallback: () => void 0
|
|
39
39
|
}) };
|
|
40
40
|
function createContext(values) {
|
|
41
|
-
const { federation, url = new URL("http://example.com/"), canonicalOrigin, data, documentLoader, contextLoader, verifyPortableObject, meterProvider, tracerProvider, clone, getNodeInfoUri, getActorUri, getPortableActorUri, getObjectUri, getPortableObjectUri, getPortableInboxUri, getCollectionUri, getOutboxUri, getMediaUploaderUri, getInboxUri, getFollowingUri, getFollowersUri, getLikedUri, getFeaturedUri, getFeaturedTagsUri, parseUri, getActorKeyPairs, getDocumentLoader, lookupObject: lookupObject$1, traverseCollection: traverseCollection$1, lookupNodeInfo, lookupWebFinger, sendActivity, routeActivity, enqueueTask, enqueueTaskMany } = values;
|
|
41
|
+
const { federation, url = new URL("http://example.com/"), canonicalOrigin, data, documentLoader, contextLoader, verifyPortableObject, meterProvider, tracerProvider, clone, getNodeInfoUri, getActorUri, getPortableActorUri, getObjectUri, getPortableObjectUri, getPortableInboxUri, getPortableOutboxUri, getPortableFollowingUri, getPortableFollowersUri, getPortableLikedUri, getPortableFeaturedUri, getPortableFeaturedTagsUri, getPortableCollectionUri, getCollectionUri, getOutboxUri, getMediaUploaderUri, getInboxUri, getFollowingUri, getFollowersUri, getLikedUri, getFeaturedUri, getFeaturedTagsUri, parseUri, getActorKeyPairs, getDocumentLoader, lookupObject: lookupObject$1, traverseCollection: traverseCollection$1, lookupNodeInfo, lookupWebFinger, sendActivity, routeActivity, enqueueTask, enqueueTaskMany } = values;
|
|
42
42
|
function throwRouterError() {
|
|
43
43
|
throw new RouterError("Not implemented");
|
|
44
44
|
}
|
|
@@ -64,6 +64,13 @@ function createContext(values) {
|
|
|
64
64
|
getObjectUri: getObjectUri ?? throwRouterError,
|
|
65
65
|
getPortableObjectUri: getPortableObjectUri ?? throwRouterError,
|
|
66
66
|
getPortableInboxUri: getPortableInboxUri ?? throwRouterError,
|
|
67
|
+
getPortableOutboxUri: getPortableOutboxUri ?? throwRouterError,
|
|
68
|
+
getPortableFollowingUri: getPortableFollowingUri ?? throwRouterError,
|
|
69
|
+
getPortableFollowersUri: getPortableFollowersUri ?? throwRouterError,
|
|
70
|
+
getPortableLikedUri: getPortableLikedUri ?? throwRouterError,
|
|
71
|
+
getPortableFeaturedUri: getPortableFeaturedUri ?? throwRouterError,
|
|
72
|
+
getPortableFeaturedTagsUri: getPortableFeaturedTagsUri ?? throwRouterError,
|
|
73
|
+
getPortableCollectionUri: getPortableCollectionUri ?? throwRouterError,
|
|
67
74
|
getCollectionUri: getCollectionUri ?? throwRouterError,
|
|
68
75
|
getOutboxUri: getOutboxUri ?? throwRouterError,
|
|
69
76
|
getMediaUploaderUri: getMediaUploaderUri ?? throwRouterError,
|
|
@@ -643,20 +650,24 @@ var MockFederation = class {
|
|
|
643
650
|
this.sentActivities = [];
|
|
644
651
|
}
|
|
645
652
|
setCollectionDispatcher(_name, _itemType, _path, _dispatcher) {
|
|
646
|
-
|
|
647
|
-
setCounter: () =>
|
|
648
|
-
setFirstCursor: () =>
|
|
649
|
-
setLastCursor: () =>
|
|
650
|
-
authorize: () =>
|
|
653
|
+
const setters = {
|
|
654
|
+
setCounter: () => setters,
|
|
655
|
+
setFirstCursor: () => setters,
|
|
656
|
+
setLastCursor: () => setters,
|
|
657
|
+
authorize: () => setters,
|
|
658
|
+
mapPortableOwner: () => setters
|
|
651
659
|
};
|
|
660
|
+
return setters;
|
|
652
661
|
}
|
|
653
662
|
setOrderedCollectionDispatcher(_name, _itemType, _path, _dispatcher) {
|
|
654
|
-
|
|
655
|
-
setCounter: () =>
|
|
656
|
-
setFirstCursor: () =>
|
|
657
|
-
setLastCursor: () =>
|
|
658
|
-
authorize: () =>
|
|
663
|
+
const setters = {
|
|
664
|
+
setCounter: () => setters,
|
|
665
|
+
setFirstCursor: () => setters,
|
|
666
|
+
setLastCursor: () => setters,
|
|
667
|
+
authorize: () => setters,
|
|
668
|
+
mapPortableOwner: () => setters
|
|
659
669
|
};
|
|
670
|
+
return setters;
|
|
660
671
|
}
|
|
661
672
|
};
|
|
662
673
|
/**
|
|
@@ -866,6 +877,34 @@ var MockContext = class MockContext {
|
|
|
866
877
|
const { pathname } = this.getInboxUri(identifier);
|
|
867
878
|
return buildPortableUri(authority, pathname);
|
|
868
879
|
}
|
|
880
|
+
getPortableOutboxUri(identifier, authority) {
|
|
881
|
+
const { pathname } = this.getOutboxUri(identifier);
|
|
882
|
+
return buildPortableUri(authority, pathname);
|
|
883
|
+
}
|
|
884
|
+
getPortableFollowingUri(identifier, authority) {
|
|
885
|
+
const { pathname } = this.getFollowingUri(identifier);
|
|
886
|
+
return buildPortableUri(authority, pathname);
|
|
887
|
+
}
|
|
888
|
+
getPortableFollowersUri(identifier, authority) {
|
|
889
|
+
const { pathname } = this.getFollowersUri(identifier);
|
|
890
|
+
return buildPortableUri(authority, pathname);
|
|
891
|
+
}
|
|
892
|
+
getPortableLikedUri(identifier, authority) {
|
|
893
|
+
const { pathname } = this.getLikedUri(identifier);
|
|
894
|
+
return buildPortableUri(authority, pathname);
|
|
895
|
+
}
|
|
896
|
+
getPortableFeaturedUri(identifier, authority) {
|
|
897
|
+
const { pathname } = this.getFeaturedUri(identifier);
|
|
898
|
+
return buildPortableUri(authority, pathname);
|
|
899
|
+
}
|
|
900
|
+
getPortableFeaturedTagsUri(identifier, authority) {
|
|
901
|
+
const { pathname } = this.getFeaturedTagsUri(identifier);
|
|
902
|
+
return buildPortableUri(authority, pathname);
|
|
903
|
+
}
|
|
904
|
+
getPortableCollectionUri(name, values, authority) {
|
|
905
|
+
const { pathname } = this.getCollectionUri(name, values);
|
|
906
|
+
return buildPortableUri(authority, pathname);
|
|
907
|
+
}
|
|
869
908
|
getOutboxUri(identifier) {
|
|
870
909
|
if (this.federation instanceof MockFederation && this.federation.outboxPath) {
|
|
871
910
|
const path = expandUriTemplate(this.federation.outboxPath, { identifier });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fedify/testing",
|
|
3
|
-
"version": "2.4.0-dev.
|
|
3
|
+
"version": "2.4.0-dev.2155+2ccc5085",
|
|
4
4
|
"description": "Testing utilities for Fedify applications",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fedify",
|
|
@@ -47,13 +47,13 @@
|
|
|
47
47
|
"package.json"
|
|
48
48
|
],
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@fedify/fedify": "^2.4.0-dev.
|
|
50
|
+
"@fedify/fedify": "^2.4.0-dev.2155+2ccc5085"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"es-toolkit": "1.46.1",
|
|
54
54
|
"temporal-polyfill": "^1.0.1",
|
|
55
|
-
"@fedify/vocab": "2.4.0-dev.
|
|
56
|
-
"@fedify/vocab-runtime": "^2.4.0-dev.
|
|
55
|
+
"@fedify/vocab": "2.4.0-dev.2155+2ccc5085",
|
|
56
|
+
"@fedify/vocab-runtime": "^2.4.0-dev.2155+2ccc5085"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@standard-schema/spec": "^1.1.0",
|