@comunica/bus-dereference 4.2.0 → 4.4.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.
|
@@ -66,6 +66,10 @@ export interface IActorDereferenceOutput extends IActorOutput {
|
|
|
66
66
|
* as this may have changed due to redirects.
|
|
67
67
|
*/
|
|
68
68
|
url: string;
|
|
69
|
+
/**
|
|
70
|
+
* BaseIRI, this is used over url when passed to metadata.baseIRI in ActorDereferenceRdfParse.ts
|
|
71
|
+
*/
|
|
72
|
+
baseIRI?: string;
|
|
69
73
|
/**
|
|
70
74
|
* The resulting stream.
|
|
71
75
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActorDereference.js","sourceRoot":"","sources":["ActorDereference.ts"],"names":[],"mappings":";;;AACA,iEAA8D;AAE9D;;;;;;;;;;GAUG;AACH,MAAsB,gBAAiB,SACrC,2CAA6E;IAC7E,4BAA4B;IAC5B;;;;OAIG;IACH,2BAA2B;IAC3B,YAAmB,IAA2B;QAC5C,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAED;;;;;;;;OAQG;IACO,KAAK,CAAC,uBAAuB,CACrC,MAA0B,EAC1B,KAAc,EACd,OAA6B,EAC7B,WAAW,GAAG,CAAC;QAEf,OAAO,IAAI,CAAC,uBAAuB,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC;IAC/G,CAAC;CACF;AA9BD,4CA8BC","sourcesContent":["import type { IAction, IActorArgs, IActorOutput, IActorTest, Mediate } from '@comunica/core';\nimport { ActorDereferenceBase } from './ActorDereferenceBase';\n\n/**\n * A base actor for dereferencing URLs to (generic) streams.\n *\n * Actor types:\n * * Input: IActionDereference: A URL.\n * * Test: <none>\n * * Output: IActorDereferenceOutput: A Readable stream\n *\n * @see IActionDereference\n * @see IActorDereferenceOutput\n */\nexport abstract class ActorDereference extends\n ActorDereferenceBase<IActionDereference, IActorTest, IActorDereferenceOutput> {\n /* eslint-disable max-len */\n /**\n * @param args -\n * \\ @defaultNested {<default_bus> a <cc:components/Bus.jsonld#Bus>} bus\n * \\ @defaultNested {Dereferencing failed: none of the configured actors were able to handle ${action.url}} busFailMessage\n */\n /* eslint-enable max-len */\n public constructor(args: IActorDereferenceArgs) {\n super(args);\n }\n\n /**\n * Handle the given error as a rejection or delegate it to the logger,\n * depending on whether or not hard errors are enabled.\n * @param {IActionDereference} action A dereference action.\n * @param {Error} error An error that has occurred.\n * @param headers Optional HTTP headers to pass.\n * @param {number} requestTime The time it took to request the page in milliseconds.\n * @return {Promise<IActorDereferenceOutput>} A promise that rejects or resolves to an empty output.\n */\n protected async handleDereferenceErrors(\n action: IActionDereference,\n error: unknown,\n headers?: Headers | undefined,\n requestTime = 0,\n ): Promise<IActorDereferenceOutput> {\n return this.dereferenceErrorHandler(action, error, { url: action.url, exists: false, headers, requestTime });\n }\n}\n\nexport interface IActionDereference extends IAction {\n /**\n * The URL to dereference\n */\n url: string;\n /**\n * By default, actors will reject upon receiving non-200 HTTP responses.\n * If this option is true, then all HTTP responses will cause the action to resolve,\n * but some outputs may therefore contain empty quad streams.\n */\n acceptErrors?: boolean;\n /**\n * Optional HTTP method to use.\n * Defaults to GET.\n */\n method?: string;\n /**\n * Optional HTTP headers to pass.\n */\n headers?: Headers;\n /**\n * An optional callback to retrieve the mediaType mappings\n */\n mediaTypes?: () => Promise<Record<string, number> | undefined>;\n}\n\ninterface IReadableClose extends NodeJS.ReadableStream {\n close?: () => void | Promise<void>;\n}\n\nexport interface IActorDereferenceOutput extends IActorOutput {\n /**\n * The page on which the output was found.\n *\n * This is not necessarily the same as the original input url,\n * as this may have changed due to redirects.\n */\n url: string;\n /**\n * The resulting stream.\n */\n data: IReadableClose;\n /**\n * This will always be true, unless `acceptErrors` was set to true in the action and the dereferencing failed.\n */\n exists: boolean;\n /**\n * The time it took to request the page in milliseconds.\n * This is the time until the first byte arrives.\n */\n requestTime: number;\n /**\n * The returned headers of the final URL.\n */\n headers?: Headers;\n /**\n * The mediatype of the source\n */\n mediaType?: string;\n}\n\nexport type IActorDereferenceArgs = IActorArgs<IActionDereference, IActorTest, IActorDereferenceOutput>;\n\nexport type MediatorDereference = Mediate<IActionDereference, IActorDereferenceOutput>;\n"]}
|
|
1
|
+
{"version":3,"file":"ActorDereference.js","sourceRoot":"","sources":["ActorDereference.ts"],"names":[],"mappings":";;;AACA,iEAA8D;AAE9D;;;;;;;;;;GAUG;AACH,MAAsB,gBAAiB,SACrC,2CAA6E;IAC7E,4BAA4B;IAC5B;;;;OAIG;IACH,2BAA2B;IAC3B,YAAmB,IAA2B;QAC5C,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAED;;;;;;;;OAQG;IACO,KAAK,CAAC,uBAAuB,CACrC,MAA0B,EAC1B,KAAc,EACd,OAA6B,EAC7B,WAAW,GAAG,CAAC;QAEf,OAAO,IAAI,CAAC,uBAAuB,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC;IAC/G,CAAC;CACF;AA9BD,4CA8BC","sourcesContent":["import type { IAction, IActorArgs, IActorOutput, IActorTest, Mediate } from '@comunica/core';\nimport { ActorDereferenceBase } from './ActorDereferenceBase';\n\n/**\n * A base actor for dereferencing URLs to (generic) streams.\n *\n * Actor types:\n * * Input: IActionDereference: A URL.\n * * Test: <none>\n * * Output: IActorDereferenceOutput: A Readable stream\n *\n * @see IActionDereference\n * @see IActorDereferenceOutput\n */\nexport abstract class ActorDereference extends\n ActorDereferenceBase<IActionDereference, IActorTest, IActorDereferenceOutput> {\n /* eslint-disable max-len */\n /**\n * @param args -\n * \\ @defaultNested {<default_bus> a <cc:components/Bus.jsonld#Bus>} bus\n * \\ @defaultNested {Dereferencing failed: none of the configured actors were able to handle ${action.url}} busFailMessage\n */\n /* eslint-enable max-len */\n public constructor(args: IActorDereferenceArgs) {\n super(args);\n }\n\n /**\n * Handle the given error as a rejection or delegate it to the logger,\n * depending on whether or not hard errors are enabled.\n * @param {IActionDereference} action A dereference action.\n * @param {Error} error An error that has occurred.\n * @param headers Optional HTTP headers to pass.\n * @param {number} requestTime The time it took to request the page in milliseconds.\n * @return {Promise<IActorDereferenceOutput>} A promise that rejects or resolves to an empty output.\n */\n protected async handleDereferenceErrors(\n action: IActionDereference,\n error: unknown,\n headers?: Headers | undefined,\n requestTime = 0,\n ): Promise<IActorDereferenceOutput> {\n return this.dereferenceErrorHandler(action, error, { url: action.url, exists: false, headers, requestTime });\n }\n}\n\nexport interface IActionDereference extends IAction {\n /**\n * The URL to dereference\n */\n url: string;\n /**\n * By default, actors will reject upon receiving non-200 HTTP responses.\n * If this option is true, then all HTTP responses will cause the action to resolve,\n * but some outputs may therefore contain empty quad streams.\n */\n acceptErrors?: boolean;\n /**\n * Optional HTTP method to use.\n * Defaults to GET.\n */\n method?: string;\n /**\n * Optional HTTP headers to pass.\n */\n headers?: Headers;\n /**\n * An optional callback to retrieve the mediaType mappings\n */\n mediaTypes?: () => Promise<Record<string, number> | undefined>;\n}\n\ninterface IReadableClose extends NodeJS.ReadableStream {\n close?: () => void | Promise<void>;\n}\n\nexport interface IActorDereferenceOutput extends IActorOutput {\n /**\n * The page on which the output was found.\n *\n * This is not necessarily the same as the original input url,\n * as this may have changed due to redirects.\n */\n url: string;\n /**\n * BaseIRI, this is used over url when passed to metadata.baseIRI in ActorDereferenceRdfParse.ts\n */\n baseIRI?: string;\n /**\n * The resulting stream.\n */\n data: IReadableClose;\n /**\n * This will always be true, unless `acceptErrors` was set to true in the action and the dereferencing failed.\n */\n exists: boolean;\n /**\n * The time it took to request the page in milliseconds.\n * This is the time until the first byte arrives.\n */\n requestTime: number;\n /**\n * The returned headers of the final URL.\n */\n headers?: Headers;\n /**\n * The mediatype of the source\n */\n mediaType?: string;\n}\n\nexport type IActorDereferenceArgs = IActorArgs<IActionDereference, IActorTest, IActorDereferenceOutput>;\n\nexport type MediatorDereference = Mediate<IActionDereference, IActorDereferenceOutput>;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@comunica/bus-dereference",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0",
|
|
4
4
|
"description": "A bus for dereferencing a path or URL into a (generic) stream.",
|
|
5
5
|
"lsd:module": true,
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"build:components": "componentsjs-generator"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@comunica/actor-abstract-mediatyped": "^4.
|
|
44
|
-
"@comunica/actor-abstract-parse": "^4.
|
|
45
|
-
"@comunica/context-entries": "^4.
|
|
46
|
-
"@comunica/core": "^4.
|
|
47
|
-
"@comunica/types": "^4.
|
|
43
|
+
"@comunica/actor-abstract-mediatyped": "^4.4.0",
|
|
44
|
+
"@comunica/actor-abstract-parse": "^4.4.0",
|
|
45
|
+
"@comunica/context-entries": "^4.4.0",
|
|
46
|
+
"@comunica/core": "^4.4.0",
|
|
47
|
+
"@comunica/types": "^4.4.0",
|
|
48
48
|
"readable-stream": "^4.5.2"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "27acde56dfe0c1ff1162c1f46818ad752296ca88"
|
|
51
51
|
}
|