@comunica/actor-http-proxy 4.5.0 → 5.0.0
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/README.md +1 -1
- package/components/ActorHttpProxy.jsonld +15 -15
- package/components/ProxyHandlerStatic.jsonld +2 -2
- package/components/components.jsonld +1 -1
- package/components/context.jsonld +1 -1
- package/lib/ActorHttpProxy.d.ts +0 -0
- package/lib/ActorHttpProxy.js +2 -0
- package/lib/ActorHttpProxy.js.map +1 -1
- package/lib/ProxyHandlerStatic.d.ts +0 -0
- package/lib/ProxyHandlerStatic.js +1 -0
- package/lib/ProxyHandlerStatic.js.map +1 -1
- package/lib/index.d.ts +0 -0
- package/lib/index.js +0 -0
- package/lib/index.js.map +0 -0
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ After installing, this package can be added to your engine's configuration as fo
|
|
|
23
23
|
{
|
|
24
24
|
"@context": [
|
|
25
25
|
...
|
|
26
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-http-proxy/^
|
|
26
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-http-proxy/^5.0.0/components/context.jsonld"
|
|
27
27
|
],
|
|
28
28
|
"actors": [
|
|
29
29
|
...
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"@context": [
|
|
3
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-http-proxy/^
|
|
4
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^
|
|
5
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-http/^
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-http-proxy/^5.0.0/components/context.jsonld",
|
|
4
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^5.0.0/components/context.jsonld",
|
|
5
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-http/^5.0.0/components/context.jsonld"
|
|
6
6
|
],
|
|
7
7
|
"@id": "npmd:@comunica/actor-http-proxy",
|
|
8
8
|
"components": [
|
|
@@ -40,37 +40,37 @@
|
|
|
40
40
|
"genericTypeInstances": [
|
|
41
41
|
{
|
|
42
42
|
"@type": "ParameterRangeGenericTypeReference",
|
|
43
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
43
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
"@type": "ParameterRangeGenericTypeReference",
|
|
47
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
47
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
"@type": "ParameterRangeGenericTypeReference",
|
|
51
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
51
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
"@type": "ParameterRangeGenericTypeReference",
|
|
55
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
55
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
|
|
56
56
|
}
|
|
57
57
|
]
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
"@type": "ParameterRangeGenericTypeReference",
|
|
61
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
61
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
"@type": "ParameterRangeGenericTypeReference",
|
|
65
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
65
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
66
66
|
},
|
|
67
67
|
{
|
|
68
68
|
"@type": "ParameterRangeGenericTypeReference",
|
|
69
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
69
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
"@type": "ParameterRangeGenericTypeReference",
|
|
73
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
73
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
|
|
74
74
|
}
|
|
75
75
|
]
|
|
76
76
|
},
|
|
@@ -107,19 +107,19 @@
|
|
|
107
107
|
"genericTypeInstances": [
|
|
108
108
|
{
|
|
109
109
|
"@type": "ParameterRangeGenericTypeReference",
|
|
110
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
110
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
111
111
|
},
|
|
112
112
|
{
|
|
113
113
|
"@type": "ParameterRangeGenericTypeReference",
|
|
114
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
114
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
115
115
|
},
|
|
116
116
|
{
|
|
117
117
|
"@type": "ParameterRangeGenericTypeReference",
|
|
118
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
118
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
119
119
|
},
|
|
120
120
|
{
|
|
121
121
|
"@type": "ParameterRangeGenericTypeReference",
|
|
122
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
122
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
|
|
123
123
|
}
|
|
124
124
|
]
|
|
125
125
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"@context": [
|
|
3
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-http-proxy/^
|
|
4
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/types/^
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-http-proxy/^5.0.0/components/context.jsonld",
|
|
4
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/types/^5.0.0/components/context.jsonld"
|
|
5
5
|
],
|
|
6
6
|
"@id": "npmd:@comunica/actor-http-proxy",
|
|
7
7
|
"components": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"@context": [
|
|
3
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-http-proxy/^
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-http-proxy/^5.0.0/components/context.jsonld"
|
|
4
4
|
],
|
|
5
5
|
"@id": "npmd:@comunica/actor-http-proxy",
|
|
6
6
|
"@type": "Module",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^6.0.0/components/context.jsonld",
|
|
4
4
|
{
|
|
5
5
|
"npmd": "https://linkedsoftwaredependencies.org/bundles/npm/",
|
|
6
|
-
"cahp": "npmd:@comunica/actor-http-proxy/^
|
|
6
|
+
"cahp": "npmd:@comunica/actor-http-proxy/^5.0.0/",
|
|
7
7
|
"ActorHttpProxy": {
|
|
8
8
|
"@id": "cahp:components/ActorHttpProxy.jsonld#ActorHttpProxy",
|
|
9
9
|
"@prefix": true,
|
package/lib/ActorHttpProxy.d.ts
CHANGED
|
File without changes
|
package/lib/ActorHttpProxy.js
CHANGED
|
@@ -8,8 +8,10 @@ const core_1 = require("@comunica/core");
|
|
|
8
8
|
* A comunica Proxy Http Actor.
|
|
9
9
|
*/
|
|
10
10
|
class ActorHttpProxy extends bus_http_1.ActorHttp {
|
|
11
|
+
mediatorHttp;
|
|
11
12
|
constructor(args) {
|
|
12
13
|
super(args);
|
|
14
|
+
this.mediatorHttp = args.mediatorHttp;
|
|
13
15
|
}
|
|
14
16
|
async test(action) {
|
|
15
17
|
const proxyHandler = action.context.get(context_entries_1.KeysHttpProxy.httpProxyHandler);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActorHttpProxy.js","sourceRoot":"","sources":["ActorHttpProxy.ts"],"names":[],"mappings":";;;AACA,iDAA+C;AAC/C,+DAA0D;AAE1D,yCAAoD;AAIpD;;GAEG;AACH,MAAa,cAAe,SAAQ,oBAAS;
|
|
1
|
+
{"version":3,"file":"ActorHttpProxy.js","sourceRoot":"","sources":["ActorHttpProxy.ts"],"names":[],"mappings":";;;AACA,iDAA+C;AAC/C,+DAA0D;AAE1D,yCAAoD;AAIpD;;GAEG;AACH,MAAa,cAAe,SAA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AAM,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,EAAE;YACnC,YAAY,EAAE,IAAI;YAClB,UAAU,EAAE,IAAI;YAChB,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,YAAY;SAC7D,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAtCD,wCAsCC","sourcesContent":["import type { IActionHttp, IActorHttpOutput, MediatorHttp, IActorHttpArgs } from '@comunica/bus-http';\nimport { ActorHttp } from '@comunica/bus-http';\nimport { KeysHttpProxy } from '@comunica/context-entries';\nimport type { TestResult } from '@comunica/core';\nimport { failTest, passTest } from '@comunica/core';\nimport type { IMediatorTypeTime } from '@comunica/mediatortype-time';\nimport type { IProxyHandler } from '@comunica/types';\n\n/**\n * A comunica Proxy Http Actor.\n */\nexport class ActorHttpProxy extends ActorHttp {\n public readonly mediatorHttp: MediatorHttp;\n\n public constructor(args: IActorHttpProxyArgs) {\n super(args);\n this.mediatorHttp = args.mediatorHttp;\n }\n\n public async test(action: IActionHttp): Promise<TestResult<IMediatorTypeTime>> {\n const proxyHandler: IProxyHandler | undefined = action.context.get(KeysHttpProxy.httpProxyHandler);\n if (!proxyHandler) {\n return failTest(`Actor ${this.name} could not find a proxy handler in the context.`);\n }\n if (!await proxyHandler.getProxy(action)) {\n return failTest(`Actor ${this.name} could not determine a proxy for the given request.`);\n }\n return passTest({ time: Number.POSITIVE_INFINITY });\n }\n\n public async run(action: IActionHttp): Promise<IActorHttpOutput> {\n const requestedUrl = typeof action.input === 'string' ? action.input : action.input.url;\n const proxyHandler: IProxyHandler = action.context.get(KeysHttpProxy.httpProxyHandler)!;\n\n // Send a request for the modified request\n const output = await this.mediatorHttp.mediate({\n ...await proxyHandler.getProxy(action),\n context: action.context.delete(KeysHttpProxy.httpProxyHandler),\n });\n\n // Modify the response URL\n // use defineProperty to allow modification of unmodifiable objects\n Object.defineProperty(output, 'url', {\n configurable: true,\n enumerable: true,\n get: () => output.headers.get('x-final-url') ?? requestedUrl,\n });\n return output;\n }\n}\n\nexport interface IActorHttpProxyArgs extends IActorHttpArgs {\n /**\n * The HTTP mediator\n */\n mediatorHttp: MediatorHttp;\n}\n"]}
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProxyHandlerStatic.js","sourceRoot":"","sources":["ProxyHandlerStatic.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,MAAa,kBAAkB;
|
|
1
|
+
{"version":3,"file":"ProxyHandlerStatic.js","sourceRoot":"","sources":["ProxyHandlerStatic.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,MAAa,kBAAkB;IACZ,SAAS,CAAS;IAEnC,YAAmB,SAAiB;QAClC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAC,OAAiB;QACrC,OAAO;YACL,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC;SACvC,CAAC;IACJ,CAAC;IAEM,WAAW,CAAC,KAAkB;QACnC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QAChC,CAAC;QACD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACxD,CAAC;CACF;AApBD,gDAoBC","sourcesContent":["import type { IProxyHandler, IRequest } from '@comunica/types';\n\n/**\n * A proxy handler that prefixes all URLs with a given string.\n */\nexport class ProxyHandlerStatic implements IProxyHandler {\n private readonly prefixUrl: string;\n\n public constructor(prefixUrl: string) {\n this.prefixUrl = prefixUrl;\n }\n\n public async getProxy(request: IRequest): Promise<IRequest> {\n return {\n init: request.init,\n input: this.modifyInput(request.input),\n };\n }\n\n public modifyInput(input: RequestInfo): RequestInfo {\n if (typeof input === 'string') {\n return this.prefixUrl + input;\n }\n return new Request(this.prefixUrl + input.url, input);\n }\n}\n"]}
|
package/lib/index.d.ts
CHANGED
|
File without changes
|
package/lib/index.js
CHANGED
|
File without changes
|
package/lib/index.js.map
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@comunica/actor-http-proxy",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "A proxy http actor",
|
|
5
5
|
"lsd:module": true,
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
"build:components": "componentsjs-generator"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@comunica/bus-http": "^
|
|
45
|
-
"@comunica/context-entries": "^
|
|
46
|
-
"@comunica/core": "^
|
|
47
|
-
"@comunica/mediatortype-time": "^
|
|
48
|
-
"@comunica/types": "^
|
|
44
|
+
"@comunica/bus-http": "^5.0.0",
|
|
45
|
+
"@comunica/context-entries": "^5.0.0",
|
|
46
|
+
"@comunica/core": "^5.0.0",
|
|
47
|
+
"@comunica/mediatortype-time": "^5.0.0",
|
|
48
|
+
"@comunica/types": "^5.0.0"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "0b1756fdb9bef014133432489627c1bd71779bd0"
|
|
51
51
|
}
|