@comunica/core
Advanced tools
Comparing version 1.19.2 to 1.20.0
@@ -1,4 +0,5 @@ | ||
import { Map } from 'immutable'; | ||
import type { IAction, ActionContext as _ActionContext } from '@comunica/types'; | ||
import type { Bus } from './Bus'; | ||
import type { Logger } from './Logger'; | ||
export type { IAction }; | ||
/** | ||
@@ -103,3 +104,3 @@ * An actor can act on messages of certain types and provide output of a certain type. | ||
* Each bus should describe in its action interface which context entries are possible (non-restrictive) | ||
* and expose a `KEY_CONTEXT_${ENTRY_NAME}` constant for easy reuse. | ||
* and corresponding context keys should be exposed in '@comunica/context-entries' for easy reuse. | ||
* If actors support any specific context entries next to those inherited by the bus action interface, | ||
@@ -115,4 +116,6 @@ * then this should be described in its README file. | ||
* For instance, this context can contain a list of datasources over which operators should query. | ||
* | ||
* @deprecated Use the same type from @comunica/types | ||
*/ | ||
export declare type ActionContext = Map<string, any>; | ||
export declare type ActionContext = _ActionContext; | ||
/** | ||
@@ -133,11 +136,2 @@ * A convenience constructor for {@link ActionContext} based on a given hash. | ||
/** | ||
* Data interface for the type of action. | ||
*/ | ||
export interface IAction { | ||
/** | ||
* The optional input context that is passed through by actors. | ||
*/ | ||
context?: ActionContext; | ||
} | ||
/** | ||
* Data interface for the type of an actor test result. | ||
@@ -144,0 +138,0 @@ */ |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ensureActionContext = exports.ActionContext = exports.Actor = void 0; | ||
const context_entries_1 = require("@comunica/context-entries"); | ||
const immutable_1 = require("immutable"); | ||
const Logger_1 = require("./Logger"); | ||
/** | ||
@@ -48,3 +48,3 @@ * An actor can act on messages of certain types and provide output of a certain type. | ||
static getContextLogger(context) { | ||
return context && context.get(Logger_1.KEY_CONTEXT_LOG); | ||
return context && context.get(context_entries_1.KeysCore.log); | ||
} | ||
@@ -51,0 +51,0 @@ /** |
@@ -59,3 +59,3 @@ "use strict"; | ||
if (actionId) { | ||
const actors = (this.actorsIndex[actionId] || []).concat(this.actorsIndex._undefined_ || []); | ||
const actors = [...this.actorsIndex[actionId] || [], ...this.actorsIndex._undefined_ || []]; | ||
return actors.map((actor) => ({ actor, reply: actor.test(action) })); | ||
@@ -62,0 +62,0 @@ } |
@@ -0,1 +1,2 @@ | ||
import { KeysCore } from '@comunica/context-entries'; | ||
/** | ||
@@ -27,3 +28,4 @@ * A logger accepts messages from different levels | ||
* @value {Logger} A logger. | ||
* @deprecated Import this constant from @comunica/context-entries. | ||
*/ | ||
export declare const KEY_CONTEXT_LOG = "@comunica/core:log"; | ||
export declare const KEY_CONTEXT_LOG = KeysCore.log; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.KEY_CONTEXT_LOG = exports.Logger = void 0; | ||
const context_entries_1 = require("@comunica/context-entries"); | ||
/** | ||
@@ -34,4 +35,5 @@ * A logger accepts messages from different levels | ||
* @value {Logger} A logger. | ||
* @deprecated Import this constant from @comunica/context-entries. | ||
*/ | ||
exports.KEY_CONTEXT_LOG = '@comunica/core:log'; | ||
exports.KEY_CONTEXT_LOG = context_entries_1.KeysCore.log; | ||
//# sourceMappingURL=Logger.js.map |
{ | ||
"name": "@comunica/core", | ||
"version": "1.19.2", | ||
"version": "1.20.0", | ||
"description": "Lightweight, semantic and modular actor framework", | ||
@@ -39,2 +39,4 @@ "lsd:module": true, | ||
"dependencies": { | ||
"@comunica/context-entries": "^1.20.0", | ||
"@comunica/types": "^1.20.0", | ||
"immutable": "^3.8.2" | ||
@@ -64,3 +66,3 @@ }, | ||
}, | ||
"gitHead": "73525f72e616c1f8ee244ea5c64e10e4a6032cf5" | ||
"gitHead": "e939e0abd92972407bd8dc04d8073720efdfe2f1" | ||
} |
@@ -22,7 +22,7 @@ # Comunica Core | ||
* [`Actor`](https://comunica.github.io/comunica/classes/core.actor-1.html): An actor can act on messages of certain types and provide output of a certain type. | ||
* [`Bus`](https://comunica.github.io/comunica/classes/core.bus-1.html): A publish-subscribe bus for sending actions to actors to test whether or not they can run an action. | ||
* [`Mediator`](https://comunica.github.io/comunica/classes/core.mediator-1.html): A mediator can mediate an action over a bus of actors. | ||
* [`ActionObserver`](https://comunica.github.io/comunica/classes/core.actionobserver-1.html): An ActionObserver can passively listen to Actor.run inputs and outputs for all actors on a certain bus. | ||
* [`BusIndexed`](https://comunica.github.io/comunica/classes/core.busindexed-1.html): A bus that indexes identified actors, so that actions with a corresponding identifier can be published more efficiently. | ||
* [`Logger`](https://comunica.github.io/comunica/classes/core.logger-1.html): A logger accepts messages from different levels and emits them in a certain way. | ||
* [`Actor`](https://comunica.github.io/comunica/classes/core.actor.html): An actor can act on messages of certain types and provide output of a certain type. | ||
* [`Bus`](https://comunica.github.io/comunica/classes/core.bus.html): A publish-subscribe bus for sending actions to actors to test whether or not they can run an action. | ||
* [`Mediator`](https://comunica.github.io/comunica/classes/core.mediator.html): A mediator can mediate an action over a bus of actors. | ||
* [`ActionObserver`](https://comunica.github.io/comunica/classes/core.actionobserver.html): An ActionObserver can passively listen to Actor.run inputs and outputs for all actors on a certain bus. | ||
* [`BusIndexed`](https://comunica.github.io/comunica/classes/core.busindexed.html): A bus that indexes identified actors, so that actions with a corresponding identifier can be published more efficiently. | ||
* [`Logger`](https://comunica.github.io/comunica/classes/core.logger.html): A logger accepts messages from different levels and emits them in a certain way. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51497
3
1016
+ Added@comunica/types@^1.20.0
+ Added@comunica/context-entries@1.22.0(transitive)
+ Added@comunica/types@1.22.0(transitive)
+ Added@rdfjs/types@1.1.2(transitive)
+ Added@types/node@22.9.0(transitive)
+ Added@types/sparqljs@3.1.11(transitive)
+ Addedasynciterator@3.9.0(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedhash.js@1.1.7(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedminimalistic-assert@1.0.1(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedrdf-data-factory@1.1.2(transitive)
+ Addedrdf-isomorphic@1.3.1(transitive)
+ Addedrdf-string@1.6.3(transitive)
+ Addedrdf-terms@1.11.0(transitive)
+ Addedsparqlalgebrajs@3.0.3(transitive)
+ Addedsparqljs@3.7.3(transitive)
+ Addedundici-types@6.19.8(transitive)