From 0ba698ca3f5c14e313eb8dd46e30325866a58597 Mon Sep 17 00:00:00 2001 From: Theodor Diaconu Date: Mon, 7 Oct 2024 01:09:02 +0300 Subject: [PATCH] typedoc --- docs/assets/search.js | 2 +- docs/classes/EventManager.html | 4 +- docs/classes/Store.html | 17 +- docs/classes/TaskRunner.html | 9 +- docs/functions/event.html | 2 +- docs/functions/middleware.html | 2 +- docs/functions/resource.html | 2 +- docs/functions/run.html | 2 +- docs/functions/task.html | 2 +- docs/hierarchy.html | 2 +- docs/index.html | 202 ++++++++++++------ docs/interfaces/definitions.IEvent.html | 4 +- .../definitions.IEventDefinition.html | 4 +- docs/interfaces/definitions.IEventMeta.html | 4 +- .../definitions.IHookDefinition.html | 9 +- docs/interfaces/definitions.IMeta.html | 4 +- docs/interfaces/definitions.IMiddleware.html | 4 +- .../definitions.IMiddlewareDefinition.html | 4 +- ...tions.IMiddlewareDefinitionConfigured.html | 4 +- ...definitions.IMiddlewareExecutionInput.html | 4 +- .../definitions.IMiddlewareMeta.html | 4 +- docs/interfaces/definitions.IResource.html | 8 +- .../definitions.IResourceDefinintion.html | 6 +- .../interfaces/definitions.IResourceMeta.html | 4 +- .../definitions.IResourceWithConfig.html | 4 +- docs/interfaces/definitions.ITask.html | 12 +- .../definitions.ITaskDefinition.html | 8 +- docs/interfaces/definitions.ITaskMeta.html | 4 +- docs/modules.html | 4 +- docs/modules/definitions.html | 4 +- .../definitions.AfterInitEventPayload.html | 2 +- .../definitions.AfterRunEventPayload.html | 2 +- .../definitions.BeforeInitEventPayload.html | 2 +- .../definitions.BeforeRunEventPayload.html | 2 +- docs/types/definitions.DependencyMapType.html | 2 +- .../definitions.DependencyValueType.html | 2 +- .../definitions.DependencyValuesType.html | 2 +- docs/types/definitions.EventHandlerType.html | 2 +- .../definitions.OnErrorEventPayload.html | 4 +- docs/types/definitions.RegisterableItems.html | 2 +- docs/variables/definitions.symbols.html | 2 +- docs/variables/globals.html | 2 +- 42 files changed, 228 insertions(+), 143 deletions(-) diff --git a/docs/assets/search.js b/docs/assets/search.js index 15a0b14..b7cba44 100644 --- a/docs/assets/search.js +++ b/docs/assets/search.js @@ -1 +1 @@ -window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAE81dXZPbuLH9L5pXrVYNfs9bbtY3cdXuTcrZyn2Ycm3JEmfMskZSSRzvOi7/9xRBQmo0GmSDpCd5mg8RjQPgoLvRh6S+Ls7H3y+L+4evi0/VYbe4j9Rycdg8l4v7xdP++GGzvyyWi5fzfnG/+Lw5V5sP+/LyY/fJ6mP9vF8sF9v95nIpL4v7xeLb0hhKkyRKr7Z++63+cioHTN1dr0IWl4vT5lweagTo1gmsVXzto/xcHuohuF0fq+vFvV2tOkRzDKvrsjP5Awj7Nkg9g/5QPh7P5dtDVY9DsbIMBAByp8bCtXmsy/MEWLj9fKj2x6eReNqW8yGpN5dPYVy9YTFtJ6GZj8gtHvNnNApYN6Zekr97OcwCcIXNjYUqof9sgJG174T3eHhzPh/P88DtjIW6uBC85/JyfDlvy7FbCLf/b9lGV0zmX2rc/N3G9r1ihosUhZGxy06Nfq/IwoC/mvze2KdtMwb5zeB3RB262a7Xi6dzng2F+jUzFEtnZnDTXOrjeQqQlTEQBmdgafSC/rI5bJ5KKatYcMTOrBgbf/7u5XCYhtCyMiu+/fFp4uxdLUzFldqzdsX0+HLY1tXxcPmx+Xf/ucvdt4wZ85HUlOYHY0f/X2rkudrt9uXvmzOH6PaheHgovUIjezn0Gri135WP1aHSra52no+7l2bp0We91tBx+fLl+cORPS5jY91VjFFEGIws2DP6ehs6XTPt+nZ0eM+rrpm4e2FYGoEENZ0bzf9X9cc/Hw+PFXfSlOKyjMyF0N7DclCm3Vw4GDcgB2M1nh/RX7SrnoTramICOpXcNvrbX8p6c0VUHery/LjZEkj6ojFOxd7XVb0v5V3dmeuHR9oOwtPtrrxsz9WpuTKgc7vVRAj15ukSMvD28vBOrYX9dXP5JFpcc+ErLbDVHbPI9WX3Q3X5oTp8LM9VXe68g78OcIaFt0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BLN4bXakEo75+n657qUtyBXi3ZYL9yydrhhNl0mGs2tcFA749rVIiD/YxUKgoZY9B8rJBKfCa6GTNDad/Yd2TSyLdldbTcbvHmNSTL1ICO+y7164hRYWT11mijXCU2rVvCHUmjSEKhf6mcYG7xYi5PpS4RAba87sI/cSy+w451rsQnKTJwlLI/ujtXQoDMv25f74RLM2RE4l2410UmK08GnnKAqT95naD5iqYXNXUveLuUaY/vNhBNCSqK53kyWkpvJo+oZrQnE9nsu4devbTcsU8mjCk64nTcxwSMxkptqXdSMbODdLZbQimwWhMJVVYc3yeHCOQXhIJmczJDHJnJIlSZ11byELjVw4eceXmkYWtB+Epwn0Sl20Na1xm4Erw79MNp/da0XZHnK80LkM6u0LmhFSnBaur9XkMIObD/uyqstnu9qC/ZNsibmYDAigOQhEZiIjmc+yQ7STGeMILYwP6JXTCCqOgde1Nj9lm7E/WisUFyNZbG3f641Gi3NkYQGdVKMBsdsoNWn3s7jqNCZpTIyzNYqRWgunQhcqnRSywDFLmFA5RsCq8ZglWhuAsmnRVp0DZY4nOJdVVW6WLo/H82a/716ZjqxijyIsWmurT+2reiv9ql5kDyf4whTr8nI6ncuLhStGdjIhrC/PH452UUKh5VAyK/XmyTaBgMTdQprqgMk1km5TCs9uNCsFXBnvWC1Mmf3JaYZPREI/2Vg7d+8cRfCQJXXVCKSzSfiGy5dme8gcDvreT2QOhyth5aCu6r21aRUyEnVLavJJ426SbukTmY/RZXArHiImCkt1jau2xop9CwhwvF8uTtWp3FeHcnH/8P7bt38D6em1gnPAAAA="; \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAE81dXY/bOLL9L+5Xj8dFfffb3jvZ3QAzO4vcwd6HRjBwbHVHiNs2bHdmskH++4UoUS4Wi1JRUvruU7stsXhIHhaLdST66+J8/OOyuH/4uvhUHXaL+0gtF4fNc7m4Xzztjx82+8tiuXg57xf3i8+bc7X5sC8vP7ZXVh+vz/vFcrHdby6X8rK4Xyy+LY2hNEmitLP1++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nEY+b+0XcQKmZN3Ntx4Bcu7HabUmL01Rqik5WkkiMNnE6OZbbZay2DRro/RzOyShmsTZ4KpJjIfYsPAxNwj3LnxqxXgjXU7WiZRkLZVFV0qtItbukyfsNFd3W70p9CMEEYpvmgUr2K5LAZsDvVHCxZ246kMDpmTyJOlJs8sm+nHg7PbsjaTZiFojXYBqiwWa617k26o5ZmMUs7cz/DiKszcHV+udBVEczUTDsHtdFu0AuBIrJMMlCGxMPfZnp/L1pDj9gqzdrdfg0fOCYewa+MFQDYKxuDmw76sruWznV7Cfk8K0I0fAAsPbQd2LimS7VDscMKJ4nE0kcqWa3SSO4KKR91A7NQY2UTsjywU8jPCwKI5Lh8RB8djQo6T9Dsg12DSg6mJZ9edMmW+SYzLNnGlAiEddGrWiXcLnMJZy1rgGAHcDSbpaUQ7tZbxX1t1dr+FZVo2SjdLl8fjebPftz9FgKziJUYod2irT82h1JU+lBrZw2QtZH788nI6ncuLhStGjki48l2+PH842hkUhfpMyVb26+bJNoFoEbcRiglZDBeTloGJjDU0hAasXLZePZL5cn8kneFQM5UNRG3t3J6ui+CheEaBobKMKg7f8JpspodsVqBfGUbmcHQTCUe4uu6tSatQ/0ftkMbtkJqslQlOhckrnfi3FkQ0z4Sb6dpXW23FUxUEVHu/XJyqU7mvDuXi/uH9t2//B9bZEAkTxgAA"; \ No newline at end of file diff --git a/docs/classes/EventManager.html b/docs/classes/EventManager.html index 93d323d..fcfe23c 100644 --- a/docs/classes/EventManager.html +++ b/docs/classes/EventManager.html @@ -1,8 +1,8 @@ -EventManager | @bluelibs/runner - v1.3.0

Constructors

constructor +EventManager | @bluelibs/runner - v1.4.0

Constructors

Accessors

Methods

+

Constructors

Accessors

Methods

diff --git a/docs/classes/Store.html b/docs/classes/Store.html index 30cff39..59986bd 100644 --- a/docs/classes/Store.html +++ b/docs/classes/Store.html @@ -1,7 +1,8 @@ -Store | @bluelibs/runner - v1.3.0

Store class which is used to store all the resources, tasks, middleware and events.

-

Constructors

constructor +Store | @bluelibs/runner - v1.4.0

Store class which is used to store all the resources, tasks, middleware and events.

+

Constructors

Properties

eventManager: EventManager
events: Map<string, EventStoreElementType> = ...
middlewares: Map<string, MiddlewareStoreElementType<any>> = ...
overrides: Map<string,
    | IResource<void, any, any>
    | ITask<any, any, {}, null>
    | IMiddleware<any>
    | IResourceWithConfig<any, any, any>> = ...
resources: Map<string, ResourceStoreElementType<any, any, {}>> = ...
root: ResourceStoreElementType<any, any, {}>
tasks: Map<string, TaskStoreElementType<any, any, any>> = ...

Accessors

Methods

  • middlewares are already stored in their final form and the check for them would be redundant

    -

    Parameters

    • id: string

    Returns void

  • Store the root before beginning registration

    -

    Parameters

    Returns void

  • When this is called, all overrides should have been stored in the "overrides" store.

    -

    Returns void

  • If you want to register something to the store you can use this function.

    -

    Type Parameters

    • C

    Parameters

    Returns void

+

Constructors

Properties

eventManager: EventManager
events: Map<string, EventStoreElementType> = ...
logger: Logger
middlewares: Map<string, MiddlewareStoreElementType<any>> = ...
overrides: Map<string,
    | IResource<void, any, any>
    | ITask<any, any, {}, null>
    | IMiddleware<any>
    | IResourceWithConfig<any, any, any>> = ...
resources: Map<string, ResourceStoreElementType<any, any, {}>> = ...
root: ResourceStoreElementType<any, any, {}>
tasks: Map<string, TaskStoreElementType<any, any, any>> = ...

Accessors

Methods

  • middlewares are already stored in their final form and the check for them would be redundant

    +

    Parameters

    • id: string

    Returns void

  • Store the root before beginning registration

    +

    Parameters

    Returns void

  • When this is called, all overrides should have been stored in the "overrides" store.

    +

    Returns void

  • If you want to register something to the store you can use this function.

    +

    Type Parameters

    • C

    Parameters

    Returns void

diff --git a/docs/classes/TaskRunner.html b/docs/classes/TaskRunner.html index dd524a8..407d921 100644 --- a/docs/classes/TaskRunner.html +++ b/docs/classes/TaskRunner.html @@ -1,13 +1,14 @@ -TaskRunner | @bluelibs/runner - v1.3.0

Constructors

constructor +TaskRunner | @bluelibs/runner - v1.4.0

Constructors

Properties

eventManager: EventManager
runnerStore: Map<string, ((input: any) => Promise<any>)> = ...
store: Store

Methods

  • Begins the execution of an task. These are registered tasks and all sanity checks have been performed at this stage to ensure consistency of the object. +

Constructors

Properties

eventManager: EventManager
logger: Logger
runnerStore: Map<string, ((input: any) => Promise<any>)> = ...
store: Store

Methods

  • Begins the execution of an task. These are registered tasks and all sanity checks have been performed at this stage to ensure consistency of the object. This function can throw only if any of the event listeners or run function throws

    Type Parameters

    Parameters

    • task: ITask<TInput, TOutput, TDeps, null>

      the task to be run

    • input: TInput

      the input to be passed to the task

    • OptionaltaskDependencies: DependencyValuesType<TDeps>

      optional dependencies to be passed to the task, if not provided, the dependencies will be the ones already computed from the store.

      -

    Returns Promise<undefined | TOutput>

+

Returns Promise<undefined | TOutput>

diff --git a/docs/functions/event.html b/docs/functions/event.html index 084a4fe..a7c26e1 100644 --- a/docs/functions/event.html +++ b/docs/functions/event.html @@ -1 +1 @@ -event | @bluelibs/runner - v1.3.0

Function event

+event | @bluelibs/runner - v1.4.0

Function event

diff --git a/docs/functions/middleware.html b/docs/functions/middleware.html index 489b3f9..444452b 100644 --- a/docs/functions/middleware.html +++ b/docs/functions/middleware.html @@ -1 +1 @@ -middleware | @bluelibs/runner - v1.3.0

Function middleware

+middleware | @bluelibs/runner - v1.4.0

Function middleware

diff --git a/docs/functions/resource.html b/docs/functions/resource.html index 25b1d5f..9742003 100644 --- a/docs/functions/resource.html +++ b/docs/functions/resource.html @@ -1 +1 @@ -resource | @bluelibs/runner - v1.3.0

Function resource

+resource | @bluelibs/runner - v1.4.0

Function resource

diff --git a/docs/functions/run.html b/docs/functions/run.html index 7839437..c5feec5 100644 --- a/docs/functions/run.html +++ b/docs/functions/run.html @@ -1 +1 @@ -run | @bluelibs/runner - v1.3.0
  • Type Parameters

    • C
    • V

    Parameters

    Returns Promise<V>

+run | @bluelibs/runner - v1.4.0
  • Type Parameters

    • C
    • V

    Parameters

    Returns Promise<V>

diff --git a/docs/functions/task.html b/docs/functions/task.html index 346cc13..5c12b61 100644 --- a/docs/functions/task.html +++ b/docs/functions/task.html @@ -1 +1 @@ -task | @bluelibs/runner - v1.3.0
+task | @bluelibs/runner - v1.4.0
diff --git a/docs/hierarchy.html b/docs/hierarchy.html index c651787..dd4646b 100644 --- a/docs/hierarchy.html +++ b/docs/hierarchy.html @@ -1 +1 @@ -@bluelibs/runner - v1.3.0
+@bluelibs/runner - v1.4.0
diff --git a/docs/index.html b/docs/index.html index 4fcc1e0..164c182 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,14 +1,14 @@ -@bluelibs/runner - v1.3.0

@bluelibs/runner - v1.3.0

BlueLibs Runner

+@bluelibs/runner - v1.4.0

@bluelibs/runner - v1.4.0

BlueLibs Runner

Build Status Coverage Status Docs

-

BlueLibs Runner is a framework that provides a functional approach to building applications, whether small or large-scale. Its core concepts include Tasks, Resources, Events, and Middleware. Tasks represent the units of logic, while resources are singletons that provide shared services across the application. Events facilitate communication between different parts of the system, and middleware allows interception and modification of task execution. The framework emphasizes an async-first philosophy, ensuring that all operations are executed asynchronously for smoother application flow.

+

BlueLibs Runner is a framework that provides a functional approach to building applications, whether small or large-scale. Its core concepts include Tasks, Resources, Events, and Middleware. Tasks represent the units of logic, while resources are singletons that provide shared services across the application. Events facilitate communication between different parts of the system, and Middleware allows interception and modification of task execution. The framework emphasizes an async-first philosophy, ensuring that all operations are executed asynchronously for smoother application flow.

  • Tasks: Core units of logic that encapsulate specific tasks. They can depend on resources, other tasks, and event emitters.
  • Resources: Singleton objects providing shared functionality. They can be constants, services, functions. They can depend on other resources, tasks, and event emitters.
  • Events: Facilitate asynchronous communication between different parts of your application. All tasks and resources emit events, allowing you to easily hook. Events can be listened to by tasks, resources, and middleware.
  • -
  • Middleware: Intercept and modify the execution of tasks. They can be used to add additional functionality to your tasks. Middleware can be global or task-specific.
  • +
  • Middleware: Intercept and modify the execution of tasks or initialisation of your resources. They can be used to add additional functionality to your tasks. Middleware can be global or task-specific.

These are the concepts and philosophy:

    @@ -18,37 +18,37 @@
  • Explicit Registration: All tasks, resources, events, and middleware have to be explicitly registered to be used.
  • Dependencies: Tasks, resources, and middleware can have access to each other by depending on one another and event emitters. This is a powerful way to explicitly declare the dependencies.
-

Resources return through async init() their value to the container which can be used throughout the application. Resources might not have a value, they can just register things, like tasks, events, or middleware.

-

Tasks return through async run() function and the value from run, can be used throughout the application.

-

All tasks, resources, events, and middleware have to be explicitly registered to be used. Registration can only be done in resources.

+

Resources return their value to the container using the async init() function, making them available throughout the application.

+

Tasks provide their output through the async run() function, allowing the results to be used across the application.

+

All tasks, resources, events, and middleware must be explicitly registered to be used. Registration can only be done within resources.

npm install @bluelibs/runner
 
-
import { task, run, resource } from "@bluelibs/runner";

const minimal = resource({
async init() {
return "Hello world!";
},
});

run(minimal).then((result) => {
expect(result).toBe("Hello world!");
}); +
import { run, resource } from "@bluelibs/runner";

const minimal = resource({
async init() {
return "Hello world!";
},
});

run(minimal).then((result) => {
expect(result).toBe("Hello world!");
});
-

Resources are singletons. They can be constants, services, functions, etc. They can depend on other resources, tasks, and event emitters.

-

On the other hand, tasks are designed to be trackable units of logic. Like things that handle a specific route on your HTTP server, or any kind of action that is needed from various places. This will allow you to easily track what is happening in your application.

-
import { task, run, resource } from "@bluelibs/runner";

const helloTask = task({
id: "app.hello",
run: async () => console.log("Hello World!"),
});

const app = resource({
id: "app",
register: [helloTask],
dependencies: {
hello: helloTask,
},
async init(_, deps) {
await deps.hello();
},
}); +

Resources are singletons and can include constants, services, functions, and more. They can depend on other resources, tasks, and event emitters.

+

Tasks are designed to be trackable units of logic, such as handling specific routes on your HTTP server or performing actions needed by different parts of the application. This makes it easy to monitor what’s happening in your application.

+
import { task, run, resource } from "@bluelibs/runner";

const helloTask = task({
id: "app.hello",
run: async () => "Hello World!",
});

const app = resource({
id: "app",
register: [helloTask],
dependencies: {
hello: helloTask,
},
async init(_, deps) {
return await deps.hello();
},
});

const result = await run(app); // "Hello World!"
-

It is unrealistic to create a task for everything you're doing in your system, not only it will be tedious for the developer, but it will affect performance unnecessarily. The idea is to think of a task of something that you want trackable as an action, for example:

+

It is unrealistic to create a task for everything you're doing in your system, not only it will be tedious for the developer, but it will affect performance unnecessarily. The idea is to think of a task of something that you want trackable as a higher-level action, for example:

  • "app.user.register" - this is a task, registers the user, returns a token
  • -
  • "app.user.createComment" - this is a task, creates a comment, returns the comment
  • +
  • "app.user.createComment" - this is a task, creates a comment, returns the comment maybe
  • "app.user.updateFriendList" - this task can be re-used from many other tasks or resources as necessary

Resources are more like services, they are singletons, they are meant to be used as a shared functionality across your application. They can be constants, services, functions, etc.

-

Resources can have a dispose() method that can be used for cleanups. This is useful for cleaning up resources like closing database connections, etc. You typically want to use this when you have opened pending connections or you need to do some cleanup or a graceful shutdown.

+

Resources can include a dispose() method for cleanup tasks. This is useful for actions like closing database connections. You should use dispose() when you have open connections or need to perform cleanup during a graceful shutdown.

import { task, run, resource } from "@bluelibs/runner";

const dbResource = resource({
async init(config, deps) {
const db = await connectToDatabase();
return db;
},
// the value returned from init() will be passed to dispose()
async dispose(db, config, deps) {
return db.close();
},
});
-

If you want to call dispose, you have to do it through the global resource called store, as everything is encapsulated.

+

To call dispose(), you need to use the global resource called store, since everything is encapsulated. This allows you to access the internal parts of the system to start the disposal process.

import { task, run, resource, globals } from "@bluelibs/runner";

const app = resource({
id: "app",
register: [dbResource],
dependencies: {
store: globals.resources.store,
},
async init(_, deps) {
// We use the fact that we can reuse the value we got from here
return {
dispose: async () => deps.store.dispose(),
};
},
});

const value = await run(app);
// To begin the disposal process.
await value.dispose();
-

Resources can be configured with a configuration object. This is useful when you want to pass in configuration to them. For example, you're building a library and you're initialising a mailer service, you can pass in the SMTP credentials as a configuration.

-
import { task, run, resource } from "@bluelibs/runner";

type Config = { smtpUrl: string; defaultFrom: string };
const emailerResource = resource({
async init(config: Config) {
// run config checks
return {
sendEmail: async (to: string, subject: string, body: string) => {
// send *email*
},
};
},
});

const app = resource({
id: "app",
register: [
// proper autocompletion is present
emailerResource.with({ smtpUrl: "smtp://localhost", defaultFrom: "" }),
],
}); +

Resources can be set up with a configuration object, which is helpful for passing in specific settings. For example, if you’re building a library and initializing a mailer service, you can provide the SMTP credentials through this configuration.

+
import { task, run, resource } from "@bluelibs/runner";

type Config = { smtpUrl: string; defaultFrom: string };

const emailerResource = resource({
// automatic type inference.
async init(config: Config) {
// todo: perform config checks with a library like zod
return {
sendEmail: async (to: string, subject: string, body: string) => {
// send *email*
},
};
},
});

const app = resource({
id: "app",
register: [
// proper autocompletion is present
emailerResource.with({ smtpUrl: "smtp://localhost", defaultFrom: "" }),
],
});

If by any chance your main app has configs then they will be passed via the second argument of run, like this:

@@ -56,25 +56,52 @@

You can depend on tasks, resources, events and (indirectly) on middleware.

-
import { task, resource, run, event } from "@bluelibs/runner";

const helloWorld = task({
middleware: [logMiddleware],
dependencies: {
userRegisteredEvent,
},
});

const app = resource({
id: "app",
register: [helloWorld, logMiddleware],
dependencies: {
helloWorld,
},
async init(_, deps) {
await deps.helloWorld();
},
});

run(app); +
import { task, resource, run, event } from "@bluelibs/runner";

const helloWorld = task({
middleware: [logMiddleware],
dependencies: {
userRegisteredEvent,
},
async run(_, deps) {
await deps.userRegisteredEvent();
return "Hello World!";
},
});

const app = resource({
id: "app",
// You have to register everything you use.
register: [helloWorld, logMiddleware],
dependencies: {
helloWorld,
},
async init(_, deps) {
await deps.helloWorld();
},
});

run(app);
-

Resources can also depend on other resources and tasks. We have a circular dependency checker which ensures consistency. If a circular dependency is detected, an error will be thrown showing you the exact pathways.

-

Tasks are not limited to this constraint, actions can use depend on each other freely.

+

We have a circular dependency checker to ensure consistency. If a circular dependency is found, an error will be thrown, showing the exact paths involved.

+

Tasks, however, are not bound by this restriction; they can freely depend on each other as needed.

+

The dependencies get injected as follows:

+ + + + + + + + + + + + + + + + + + + + + + + + + +
ComponentInjection Description
tasksInjected as functions with their input argument
resourcesInjected as their return value
eventsInjected as functions with their payload argument
middlewareNot typically injected; used via a middleware: [] array

You emit events when certain things in your app happen, a user registered, a comment has been added, etc. You listen to them through tasks and resources, and you can emit them from tasks and resources through dependencies.

-
import { task, run, event } from "@bluelibs/runner";

const afterRegisterEvent = event<{ userId: string }>({
id: "app.user.afterRegister",
});

const root = resource({
id: "app",
register: [afterRegisterEvent],
dependencies: {
afterRegisterEvent,
},

async init(_, deps) {
// the event becomes a function that you run with the propper payload
await deps.afterRegisterEvent({ userId: string });
},
}); +
import { task, run, event } from "@bluelibs/runner";

const afterRegisterEvent = event<{ userId: string }>({
id: "app.user.afterRegister",
});

const root = resource({
id: "app",
register: [afterRegisterEvent],
dependencies: {
afterRegisterEvent,
},
async init(_, deps) {
// the event becomes a function that you run with the propper payload
await deps.afterRegisterEvent({ userId: string });
},
});
-

There are only 2 ways to listen to events:

-
import { task, run, event } from "@bluelibs/runner";

const afterRegisterEvent = event<{ userId: string }>({
id: "app.user.afterRegister",
});

const helloTask = task({
id: "app.hello",
on: afterRegisterEvent,
run(event) {
console.log("User has been registered!");
},
});

const app = resource({
id: "app",
register: [afterRegisterEvent, helloTask],
dependencies: {
afterRegisterEvent,
},
async init(_, deps) {
await deps.afterRegisterEvent({ userId: "XXX" });
},
}); +

There are only 2 recommended ways to listen to events:

+
import { task, run, event } from "@bluelibs/runner";

const afterRegisterEvent = event<{ userId: string }>({
id: "app.user.afterRegister",
});

const helloTask = task({
id: "app.hello",
on: afterRegisterEvent,
listenerPriority: 0, // this is the order in which the task will be executed when `on` is present
run(event) {
console.log("User has been registered!");
},
});

const app = resource({
id: "app",
register: [afterRegisterEvent, helloTask],
dependencies: {
afterRegisterEvent,
},
async init(_, deps) {
await deps.afterRegisterEvent({ userId: "XXX" });
},
});
-

This can only be applied to a resource().

-
import { task, resource, run, event, global } from "@bluelibs/runner";

const afterRegisterEvent = event<{ userId: string }>({
id: "app.user.registered",
});

const root = resource({
id: "app",
register: [afterRegisterEvent],
dependencies: {},
hooks: [
{
event: global.events.afterInit,
async run(event, deps) {
// both dependencies and event are properly infered through typescript
console.log("User has been registered!");
},
},
],
async init(_, deps) {
deps.afterRegisterEvent({ userId: "XXX" });
},
}); +

This can only be applied to a resource().

+
import { task, resource, run, event, global } from "@bluelibs/runner";

const afterRegisterEvent = event<{ userId: string }>({
id: "app.user.registered",
});

const root = resource({
id: "app",
register: [afterRegisterEvent],
dependencies: {},
hooks: [
{
event: global.events.afterInit,
order: -1000, // event priority, the lower the number, the sooner it will run.
async run(event, deps) {
// both dependencies and event are properly infered through typescript
console.log("User has been registered!");
},
},
],
async init(_, deps) {
await deps.afterRegisterEvent({ userId: "XXX" });
},
});
-

You can listen to all events by using the wildcard *.

+

You can listen to all events by using the wildcard *.

import { task, resource, run, event, global } from "@bluelibs/runner";

const afterRegisterEvent = event<{ userId: string }>({
id: "app.user.registered",
});

const root = resource({
id: "app",
register: [afterRegisterEvent],
dependencies: {},
hooks: [
{
event: "*",
async run(event, deps) {
console.log(
"Generic event detected",
event.id,
event.data,
event.timestamp
);
},
},
],
async init(_, deps) {
deps.afterRegisterEvent({ userId: "XXX" });
},
});
@@ -82,52 +109,81 @@

The hooks from a resource are mostly used for configuration, and blending in the system.

  • hooks are for resources to extend each other, compose functionalities, they are mostly used for configuration and blending in the system.
  • -
  • on is for when you want to perform a task when something happens.
  • +
  • on is for when you want to perform a task when something happens, like send an email, begin processing something, etc.
-

Middleware is a way to intercept the execution of tasks or initialization of resources. It's a powerful way to add additional functionality. First middleware that gets registered is the first that runs, giving it a form of priority, the last middleware that runs is 'closest' to the task, most likely the last element inside middleware array at task level.

+

Middleware intercepts the execution of tasks or the initialization of resources, providing a powerful means to enhance functionality. The order in which middleware is registered dictates its execution priority: the first middleware registered is the first to run, while the last middleware in the middleware array at the task level is the closest to the task itself, executing just before the task completes. (Imagine an onion if you will, with the task at the core.)

import { task, resource, run, event } from "@bluelibs/runner";

const logMiddleware = middleware({
id: "app.middleware.log",
dependencies: {
// inject tasks, resources, eventCallers here.
},
async run(data, deps) {
const { taskDefinition, resourceDefinition, config, next, input } = data;

// The middleware can be for a task or a resource, depending on which you get the right elements.
if (taskDefinition) {
console.log("Before task", taskDefinition.id);
const result = await next(input); // pass the input to the next middleware or task
console.log("After task", taskDefinition.id);
} else {
console.log("Before resource", resourceDefinition.id);
const result = await next(config); // pass the input to the next middleware or task
console.log("After resource", resourceDefinition.id);
}

return result;
},
});

const helloTask = task({
id: "app.hello",
middleware: [logMiddleware],
run(event) {
console.log("User has been registered!");
},
});
-

However, if you want to register a middleware for all tasks and resources, here's how you can do it:

+

If you want to register a middleware for all tasks and resources, here's how you can do it:

import { run, resource } from "@bluelibs/runner";

const logMiddleware = middleware({
id: "app.middleware.log",
// ... rest
});

const root = resource({
id: "app",
register: [logMiddleware.global() /* this will apply to all tasks */],
});
-

The middleware can only be registered once. This means that if you register a middleware as global, you cannot specify it as a task middleware.

+

The middleware can only be registered once. This means that if you register a middleware as global, you cannot specify it as a task middleware. This is to avoid confusion and to keep the system clean.

If an error is thrown in a task, the error will be propagated up to the top runner.

import { task, run, event } from "@bluelibs/runner";

const helloWorld = task({
id: "app.helloWorld",
run() {
throw new Error("Something went wrong");
},
});

const app = resource({
id: "app",
register: [helloWorld],
dependencies: {
helloWorld,
},
async init() {
await helloWorld();
},
});

run(app).catch((err) => {
console.error(err);
});

You can listen to errors via events:

-
const helloWorld = task({
id: "app.onError",
on: helloWorld.events.onError,
run({ error, input, suppress }, deps) {
// this will be called when an error happens

// if you handled the error, and you don't want it propagated to the top, supress the propagation.
suppress();
},
}); +
const helloWorld = task({
id: "app.tasks.helloWorld.onError",
on: helloWorld.events.onError,
run({ error, input, suppress }, deps) {
// this will be called when an error happens

// if you handled the error, and you don't want it propagated to the top, supress the propagation.
suppress();
},
}); +
+ +
const helloWorld = resource({
id: "app.resources.helloWorld.onError",
on: helloWorld.events.onError,
init({ error, input, suppress }, deps) {
// this will be called when an error happens

// if you handled the error, and you don't want it propagated to the top, supress the propagation.
suppress();
},
});
-

You can attach metadata to tasks, resources, events, and middleware.

+

You can attach metadata to tasks, resources, events, and middleware.

import { task, run, event } from "@bluelibs/runner";

const helloWorld = task({
id: "app.helloWorld",
meta: {
title: "Hello World",
description: "This is a hello world task",
tags: ["api"],
},
run() {
return "Hello World!";
},
});
-

This is particularly helpful to use in conjunction with global middlewares, or global events, they can read some meta tag definition and act accordingly.

+

This is particularly helpful to use in conjunction with global middlewares, or global events, they can read some meta tag definition and act accordingly, decorate them or log them.

The interfaces look like this:

export interface IMeta {
title?: string;
description?: string;
tags: string[];
}

export interface ITaskMeta extends IMeta {}
export interface IResourceMeta extends IMeta {}
export interface IEventMeta extends IMeta {}
export interface IMiddlewareMeta extends IMeta {}

Which means you can extend them in your system to add more keys to better describe your actions.

-

We expose direct access to the following internal services:

+

We expose direct access to the following internal services:

  • Store (contains Map()s for events, tasks, resources, middleware configurations)
  • TaskRunner (can run tasks definitions directly and within D.I. context)
  • EventManager (can emit and listen to events)
-

Attention, it is not recommended to use these services directly, but they are exposed for advanced use-cases, for when you do not have any other way.

+

Attention, we do not encourage you to use these services directly, unless you really have to, they are exposed for advanced use-case scenarios.

import { task, run, event, globals } from "@bluelibs/runner";

const helloWorld = task({
id: "app.helloWorld",
dependencies: {
store: globals.resources.store,
taskRunner: globals.resources.taskRunner,
eventManager: globals.resources.eventManager,
}
run(_, deps) {
// you benefit of full autocompletion here
},
});
-

We typically namespace using . like app.helloWorld. This is a convention that we use to make sure that we can easily identify where the task belongs to.

-

When creating special packages the convention is:

-
    -
  • {companyName}.{packageName}.{taskName}
  • -
+

Domain usually is "app", but as your application grows or you plan on building external libraries the naming convention should be: "companyName.packageName".

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeFormat
Tasks{domain}.tasks.{taskName}
Listener Tasks{domain}.tasks.{taskName}.on{EventName}
Resources{domain}.resources.{resourceName}
Events{domain}.events.{eventName}
Middleware{domain}.middleware.{middlewareName}

You can always create helpers for you as you're creating your tasks, resources, middleware:

-
function getNamespace(id) {
return `bluelibs.core.${id}`;
} +
function namespaced(id) {
return `bluelibs.core.${id}`;
}

We need to import all the tasks, resources, events, and middlewares, a convention for their naming is to export them like this

@@ -140,49 +196,49 @@

Now you can freely use any of the tasks, resources, events, and middlewares from the packageName namespace.

This approach is very powerful when you have multiple packages and you want to compose them together.

-

Typically you have an express server (to handle HTTP requests), a database, and a bunch of services. You can define all of these in a single file and run them.

+

Or is it just fantasy?

+

Typically, an application consists of an Express server (to handle HTTP requests), a database, and various services. You can conveniently define all of these components within a single file and execute them together.

import { task, resource, run, event } from "@bluelibs/runner";
import express from "express";

const expressServer = resource({
id: "app.express",
async init() {
const app = express();
app.listen(3000).then(() => {
console.log("Server is running on port 3000");
});

// because we return it you can now access it via dependencies
return app;
},
});

const setupRoutes = resource({
id: "app.routes",
dependencies: {
expressServer,
},
async init(_, deps) {
deps.expressServer.use("/api", (req, res) => {
res.json({ hello: "world" });
});
},
});

// Just run them, init() will be called everywhere.
const app = resource({
id: "app",
register: [expressServer, setupRoutes],
});

run();
-

The system is smart enough to know which init() to call first. Typically all dependencies are initialised first. If there are circular dependencies, an error will be thrown with the exact paths.

-

There's a resource for that! You can define a resource that holds your business configuration.

+

The system intelligently determines the order in which init() functions should be called, ensuring that all dependencies are initialized first. In the case of circular dependencies, it will throw an error, providing the exact paths to help identify the issue.

+

Or just simple config, you can do it for your business logic, environment variables, etc.

import { resource, run } from "@bluelibs/runner";

// we keep it as const because we will also benefit of type-safety
const businessData = {
pricePerSubscription: 9.99,
};

const businessConfig = resource({
id: "app.config",
async init() {
return businessData;
},
});

const app = resource({
id: "app",
register: [businessConfig],
dependencies: { businessConfig },
async init(_, deps) {
console.log(deps.businessConfig.pricePerSubscription);
},
});

run();
import { task, run, event } from "@bluelibs/runner";

const helloWorld = task({
id: "app.helloWorld",
});

// Each task and constant have their own events
const app = resource({
id: "app",
register: [helloWorld],
hooks: [
{
event: helloWorld.events.beforeRun,
async run(event, deps) {
event.data.input; // read the input
},
},
{
event: helloWorld.events.afterRun,
async run(event, deps) {
event.data.output; // you can read the input or output
},
},
{
event: helloWorld.events.onError,
async run(event, deps) {
event.data.error; // read the error that happened during execution
},
},
],
});

run(app);
-
import { task, run, event } from "@bluelibs/runner";

const businessData = {
pricePerSubscription: 9.99,
};

const businessConfig = resource({
id: "app.config",
async init() {
return businessData; // if you use it as a const you will have full typesafety
},
});

const app = resource({
id: "app",
register: [businessConfig],
hooks: [
{
event: businessConfig.events.beforeInit,
async run(event, deps) {
event.data.config; // read the input
},
},
{
event: businessConfig.events.afterInit,
async run(event, deps) {
event.data.value; // you can read the returned value of the resource
},
},
{
event: businessConfig.events.onError,
async run(event, deps) {
event.data.error; // read the error that happened during initialization
},
},
],
});

run(app); +
import { task, run, event } from "@bluelibs/runner";

const businessData = {
pricePerSubscription: 9.99,
};

const businessConfig = resource({
id: "app.config",
async init() {
return businessData; // if you use it as a const you will have full typesafety
},
});

const app = resource({
id: "app",
register: [businessConfig],
hooks: [
{
event: businessConfig.events.beforeInit,
async run(event, deps) {
event.data.config; // read the input
},
},
{
event: businessConfig.events.afterInit,
async run(event, deps) {
event.data.value; // you can read the returned value of the resource
},
},
{
event: businessConfig.events.onError,
async run(event, deps) {
event.data.error; // read the error that happened during initialization
},
},
],
});

run(app);
-

This is just a "language" of developing applications. It simplifies dependency injection to the barebones, it forces you to think more functional and use classes less.

+

This is just a "language" of developing applications. It simplifies dependency injection to the barebones, it forces you to think more functional and use classes less.

This doesn't mean you shouldn't use classes, just not for hooking things up together.

You can add many services or external things into the runner ecosystem with things like:

-
import { task, run, event } from "@bluelibs/runner";

const expressResource = resource<express.Application>({
id: "app.helloWorld",
run: async (config) => config,
});

const app = resource({
id: "app",
register: [expressResource.with(express())],
init: async (express) => {
express.get("/", (req, res) => {
res.send("Hello World!");
});
},
});

run(app); +
import { task, run, event } from "@bluelibs/runner";

// proxy declaration pattern
const expressResource = resource({
id: "app.helloWorld",
run: async (app: express.Application) => app,
});

const app = resource({
id: "app",
register: [expressResource.with(express())],
dependencies: {
express: expressResource,
},
init: async (_, { express }) => {
express.get("/", (req, res) => {
res.send("Hello World!");
});
},
});

run(app);
-

This shows how easy you encapsulate an external service into the runner ecosystem. This 'pattern' of storing objects like this is not that common because usually they require a configuration with propper options and stuff, not an express instance(), like this:

-
const expressResource = resource({
id: "app.helloWorld",
run: async (config) => {
const app = express();
app.listen(config.port);
return app;
},
});

const app = resource({
id: "app",
register: [expressResource.with({ port: 3000 })],
init: async (express) => {
// type is automagically infered.
express.get("/", (req, res) => {
res.send("Hello World!");
});
},
});

run(app); +

This demonstrates how effortlessly an external service can be encapsulated within the runner ecosystem. This ‘pattern’ of storing objects in this manner is quite unique, as it typically involves configurations with various options, rather than directly using an Express instance like this:

+
type Config = {
port: number;
};

const expressResource = resource({
id: "app.helloWorld",
init: async (config: Config) => {
const app = express();
app.listen(config.port);
return app;
},
});

const app = resource({
id: "app",
register: [expressResource.with({ port: 3000 })],
dependencies: {
express: expressResource,
},
init: async (_, { express }) => {
// type is automagically infered.
express.get("/", (req, res) => {
res.send("Hello World!");
});
},
});

run(app);

By stating dependencies you often don't care about the initialisation order, but sometimes you really do, for example, let's imagine a security service that allows you to inject a custom hashing function let's say to shift from md5 to sha256.

This means your resource needs to provide a way for other resources to update it. The most obvious way is to expose a configuration that allows you to set a custom hasher register: [securityResource.with({ ... })].

But other resources might want to do this dynamically as extensions. This is where hooks come in.

-
import { resource, run, event } from "@bluelibs/runner";

type SecurityOptions = {
hashFunction: (input: string) => string;
};

const securityResource = resource({
id: "app.security",
async init(config: SecurityOptions) {
let hasher = config.hashFunction;
return {
setHasher: (hashFunction: (input: string) => string) => {
hasher = hashFunction;
},
hash: (input: string) => hasher(input),
};
},
});

const app = resource({
id: "app",
register: [securityResource],
hooks: [
{
event: securityResource.events.afterInit,
async run(event, deps) {
const { config, value } = event.data;
const security = value;

security.setHasher((input) => {
// custom implementation here.
});
},
},
],
}); +
import { resource, run, event } from "@bluelibs/runner";

type SecurityOptions = {
hashFunction: (input: string) => string;
};

const securityResource = resource({
id: "app.security",
async init(config: SecurityOptions) {
let hasher = config.hashFunction;
return {
setHasher: (hashFunction: (input: string) => string) => {
hasher = hashFunction;
},
hash: (input: string) => hasher(input),
};
},
});

const app = resource({
id: "app",
register: [securityResource],
hooks: [
{
// careful when you listen on such events and need dependencies, you might not have them computed yet due to how early these events happen in the system.
event: securityResource.events.afterInit,
async run(event, deps) {
const { config, value } = event.data;
const security = value;

security.setHasher((input) => {
// custom implementation here.
});
},
},
],
});
-

Another approach is to create a new event that holds the config and it allows it to be updated.

-
import { resource, run, event } from "@bluelibs/runner";

const securityConfigurationPhaseEvent = event<SecurityOptions>({
id: "app.security.configurationPhase",
});

const securityResource = resource({
id: "app.security",
dependencies: {
securityConfigurationPhaseEvent,
},
async init(config: SecurityOptions) {
// Give the ability to other listeners to modify the configuration
securityConfigurationPhaseEvent(config);

return {
// ... based on config
};
},
});

const app = resource({
id: "app",
register: [securityResource],
hooks: [
{
event: securityConfigurationPhaseEvent,
async run(event, deps) {
const { config } = event.data; // config is SecurityOptions
config.setHasher(newHashFunction);
},
},
],
}); +

Another approach is to create a new event that contains the configuration, providing the flexibility to update it as needed.

+
import { resource, run, event } from "@bluelibs/runner";

const securityConfigurationPhaseEvent = event<SecurityOptions>({
id: "app.security.configurationPhase",
});

const securityResource = resource({
id: "app.security",
dependencies: {
securityConfigurationPhaseEvent,
},
async init(config: SecurityOptions) {
// Give the ability to other listeners to modify the configuration
securityConfigurationPhaseEvent(config);
Objecte.freeze(config);

return {
// ... based on config
};
},
});

const app = resource({
id: "app",
register: [securityResource],
hooks: [
{
event: securityConfigurationPhaseEvent,
async run(event, deps) {
const { config } = event.data; // config is SecurityOptions
config.setHasher(newHashFunction);
},
},
],
});
-

Previously, we explored how we can extend functionality through events. However, sometimes you want to override a resource with a new one or simply swap out a task or a middleware that you import from another package and they don't offer the ability.

+

Previously, we discussed how to extend functionality using events. However, there are times when you need to replace an existing resource with a new one or swap out a task or middleware imported from another package that doesn’t support such changes.

import { resource, run, event } from "@bluelibs/runner";

// This example is for resources but override works for tasks, events, and middleware as well.
const securityResource = resource({
id: "app.security",
async init() {
// returns a security service
},
});

const override = resource({
...securityResource,
init: async () => {
// a new and custom service
},
});

const app = resource({
id: "app",
register: [securityResource], // this resource might be registered by any element in the dependency tree.
overrides: [override],
});
-

Now the securityResource will be overriden by the new one and whenever it's used it will use the new one.

-

Overrides can only happen once and only if the overriden resource is registered. If two resources try to override the same resource, an error will be thrown.

-

We expose through globals a logger that you can use to log things.

-

By default logs are not printed unless a resource listens to the log event. This is by design, when something is logged an event is emitted. You can listen to this event and print the logs.

+

The new securityResource will replace the existing one, ensuring all future references point to the updated version.

+

Overrides work if the resource being overridden is already registered. If multiple resources attempt to override the same one, no error will be thrown. This is a common scenario, where the root resource typically contains the most authoritative overrides. But it's also to be mindful about.

+

We expose through globals a logger that you can use to log things. Essentially what this service does it emits a global.events.log event with an ILog object.

import { task, run, event, globals } from "@bluelibs/runner";

const helloWorld = task({
id: "app.helloWorld",
dependencies: {
logger: globals.resources.logger,
},
run: async (_, { logger }) => {
await logger.info("Hello World!");
// or logger.log(level, data);
},
});
@@ -227,25 +283,39 @@ -

Logs don't get printed by default in this system.

-
import { task, run, event, globals, resource } from "@bluelibs/runner";

const printLog = task({
id: "app.task.printLog",
on: globals.events.log,
dependencies: {
logger: globals.resources.logger,
},
run: async (event, { logger }) => {
logger.print(event);
},
});

const app = resource({
id: "root",
register: [printLog],
});

// Now your app will print all logs +

Logs don't get printed by default. You have to set the print threshold to a certain level. This is useful when you want to print only errors and critical logs in production, but you want to print all logs in development. Your codebase, your rules.

+

To showcase the versatility of the system, here are some ways you could do it:

+
import { task, run, event, globals, resource } from "@bluelibs/runner";

const { logger } = globals.resources;

const printLog = task({
id: "app.task.updatePrintThreshold",
on: logger.events.afterInit,
// Note: logger is
run: async (event, deps) => {
const logger = event.data.value;
logger.setPrintThreshold("trace"); // will print all logs
logger.setPrintThreshold("error"); // will print only "error" and "critical" logs
},
});

const app = resource({
id: "root",
register: [printLog],
});

// Now your app will print all logs +
+ +

You can also achieve this using hooks:

+
resource({
id: "root",
hooks: [
{
// after logger gets initialised as a resource, I'm going to set the print threshold
event: logger.events.afterInit,
async run(event) {
const logger = event.data; // do not depend on the logger
logger.setPrintThreshold("trace");
},
},
],
}); +
+ +

The logger’s log() function is asynchronous because it handles events. If you want to prevent your system from waiting for log operations to complete, simply omit the await when calling log(). This is useful if you have listeners that send logs to external log storage systems.

+

Additionally, there is a global.events.log event available. You can use this event both to emit log messages and to listen for all log activities.

+
import { task, run, event, globals } from "@bluelibs/runner";

const { logger } = globals.resources;

const shipLogsToWarehouse = task({
id: "app.task.shipLogsToWarehouse",
on: logger.events.log,
dependencies: {
warehouseService: warehouseServiceResource,
},
run: async (event, deps) => {
const log = event.data; // ILog
if (log.level === "error" || log.level === "critical") {
// Ensure no extra log() calls are made here to prevent infinite loops
await deps.warehouseService.push(log);
}
},
}); +
+ +

And yes, this would also work:

+
const task = task({
id: "app.task.logSomething",
dependencies: {
log: globals.events.log,
},
run: async (_, { log }) => {
await log({
level: "info",
data: { anything: "you want" };
timestamp: new Date();
context: "app.task.logSomething"; // optional
})
},
});
-

You can in theory do it in hooks as well, but as specified hooks are mostly used for configuration and blending in the system.

-

The logger's log() function is async as it works with events. If you don't want your system hanging on logs, simply omit the await

-

You can easily test your resources and tasks by running them in a test environment.

-

The only bits that you need to test are the run function and the init functions with the propper dependencies.

+

Fair Warning: If you plan to use the global.events.log event, ensure you avoid creating a circular dependency. This event is emitted by the logger itself. Additionally, some logs are sent before all resources are fully initialized. Therefore, it’s important to carefully review and verify your dependencies to prevent potential issues.

+

Oh yes, testing is a breeze with this system. You can easily test your tasks, resources, and middleware by running them in a test environment. It's designed to be tested.

+

You can easily test your middleware, resources and tasks by running them in a test environment.

+

The only components you need to test are the run function and the init functions, along with their proper dependencies.

import { task, resource } from "@bluelibs/runner";

const helloWorld = task({
id: "app.helloWorld",
run: async () => {
return "Hello World!";
},
});

const helloWorldResource = resource({
id: "app.helloWorldResource",
init: async () => {
return "Hello World!";
},
});

// sample tests for the task
describe("app.helloWorld", () => {
it("should return Hello World!", async () => {
const result = await helloWorld.run(input, dependencies); // pass in the arguments and the mocked dependencies.
expect(result).toBe("Hello World!");
});
});

// sample tests for the resource
describe("app.helloWorldResource", () => {
it("should return Hello World!", async () => {
const result = await helloWorldResource.init(config, dependencies); // pass in the arguments and the mocked dependencies.
expect(result).toBe("Hello World!");
});
});
-

Unit testing can be very simply with mocks, since all dependencies are explicit. However, if you would like to run an integration test, and have a task be tested and within the full container.

+

Unit testing becomes straightforward with mocks, as all dependencies are explicitly defined. However, if you wish to run an integration test, you can have a task tested within the full container environment.

import { task, resource, run, global } from "@bluelibs/runner";

const task = task({
id: "app.myTask",
run: async () => {
return "Hello World!";
},
});

const app = resource({
id: "app",
register: [myTask],
});
-

Then your tests can now be cleaner:

-
describe("app", () => {
it("an example to override a task or resource", async () => {
const testApp = resource({
id: "app.test",
register: [myApp], // wrap your existing app
overrides: [override], // apply the overrides
init: async (_, deps) => {
// you can now test a task simply by depending on it, and running it, then asserting the response of run()
},
});

// Same concept applies for resources as well.

await run(testApp);
});
}); +

Then your tests can now be cleaner, as you can use overrides and a wrapper resource to mock your task.

+
describe("app", () => {
it("an example to override a task or resource", async () => {
const testApp = resource({
id: "app.test",
register: [myApp], // wrap your existing app
overrides: [override], // apply the overrides for "app.myTask"
init: async (_, deps) => {
// you can now test a task simply by depending on it, and running it, then asserting the response of run()
},
});

await run(testApp);
});
});

This package is part of the BlueLibs family. If you enjoy this work, please show your support by starring the main repository.

This project is licensed under the MIT License - see the LICENSE.md file for details.

-
+
diff --git a/docs/interfaces/definitions.IEvent.html b/docs/interfaces/definitions.IEvent.html index e0d2bfa..2010fd6 100644 --- a/docs/interfaces/definitions.IEvent.html +++ b/docs/interfaces/definitions.IEvent.html @@ -1,4 +1,4 @@ -IEvent | @bluelibs/runner - v1.3.0

Interface IEvent<TPayload>

interface IEvent<TPayload> {
    data: TPayload;
    id: string;
    timestamp: Date;
}

Type Parameters

  • TPayload = any

Properties

data +IEvent | @bluelibs/runner - v1.4.0

Interface IEvent<TPayload>

interface IEvent<TPayload> {
    data: TPayload;
    id: string;
    timestamp: Date;
}

Type Parameters

  • TPayload = any

Properties

Properties

data: TPayload
id: string
timestamp: Date
+

Properties

data: TPayload
id: string
timestamp: Date
diff --git a/docs/interfaces/definitions.IEventDefinition.html b/docs/interfaces/definitions.IEventDefinition.html index 8e45649..c068114 100644 --- a/docs/interfaces/definitions.IEventDefinition.html +++ b/docs/interfaces/definitions.IEventDefinition.html @@ -1,3 +1,3 @@ -IEventDefinition | @bluelibs/runner - v1.3.0

Interface IEventDefinition<TPayload>

interface IEventDefinition<TPayload> {
    id: string;
    meta?: IEventMeta;
}

Type Parameters

  • TPayload = void

Properties

id +IEventDefinition | @bluelibs/runner - v1.4.0

Interface IEventDefinition<TPayload>

interface IEventDefinition<TPayload> {
    id: string;
    meta?: IEventMeta;
}

Type Parameters

  • TPayload = void

Properties

Properties

id: string
meta?: IEventMeta
+

Properties

id: string
meta?: IEventMeta
diff --git a/docs/interfaces/definitions.IEventMeta.html b/docs/interfaces/definitions.IEventMeta.html index a2923e8..b016cbd 100644 --- a/docs/interfaces/definitions.IEventMeta.html +++ b/docs/interfaces/definitions.IEventMeta.html @@ -1,4 +1,4 @@ -IEventMeta | @bluelibs/runner - v1.3.0
interface IEventMeta {
    description?: string;
    tags?: string[];
    title?: string;
}

Hierarchy (view full)

Properties

description? +IEventMeta | @bluelibs/runner - v1.4.0
interface IEventMeta {
    description?: string;
    tags?: string[];
    title?: string;
}

Hierarchy (view full)

Properties

description?: string
tags?: string[]
title?: string
+

Properties

description?: string
tags?: string[]
title?: string
diff --git a/docs/interfaces/definitions.IHookDefinition.html b/docs/interfaces/definitions.IHookDefinition.html index e369f25..5ac3d62 100644 --- a/docs/interfaces/definitions.IHookDefinition.html +++ b/docs/interfaces/definitions.IHookDefinition.html @@ -1,3 +1,8 @@ -IHookDefinition | @bluelibs/runner - v1.3.0

Interface IHookDefinition<D, T>

interface IHookDefinition<D, T> {
    event: IEventDefinition<T> | "*";
    run: ((event: IEvent<T>, dependencies: DependencyValuesType<D>) => void | Promise<void>);
}

Type Parameters

Properties

event +IHookDefinition | @bluelibs/runner - v1.4.0

Interface IHookDefinition<D, T, B>

interface IHookDefinition<D, T, B> {
    early?: B;
    event: IEventDefinition<T> | "*";
    order?: number;
    run: ((event: IEvent<T>, dependencies: T extends true
        ? void
        : DependencyValuesType<D>) => void | Promise<void>);
}

Type Parameters

Properties

Properties

event: IEventDefinition<T> | "*"
run: ((event: IEvent<T>, dependencies: DependencyValuesType<D>) => void | Promise<void>)
+

Properties

early?: B

These are hooks that run before any resource instantiation.

+
event: IEventDefinition<T> | "*"
order?: number

The higher the number, the higher the priority. +We recommend using numbers between -1000 and 1000.

+
run: ((event: IEvent<T>, dependencies: T extends true
    ? void
    : DependencyValuesType<D>) => void | Promise<void>)
diff --git a/docs/interfaces/definitions.IMeta.html b/docs/interfaces/definitions.IMeta.html index c318e9e..881b66e 100644 --- a/docs/interfaces/definitions.IMeta.html +++ b/docs/interfaces/definitions.IMeta.html @@ -1,4 +1,4 @@ -IMeta | @bluelibs/runner - v1.3.0
interface IMeta {
    description?: string;
    tags?: string[];
    title?: string;
}

Hierarchy (view full)

Properties

description? +IMeta | @bluelibs/runner - v1.4.0
interface IMeta {
    description?: string;
    tags?: string[];
    title?: string;
}

Hierarchy (view full)

Properties

description?: string
tags?: string[]
title?: string
+

Properties

description?: string
tags?: string[]
title?: string
diff --git a/docs/interfaces/definitions.IMiddleware.html b/docs/interfaces/definitions.IMiddleware.html index 17c9f31..f1cb47f 100644 --- a/docs/interfaces/definitions.IMiddleware.html +++ b/docs/interfaces/definitions.IMiddleware.html @@ -1,6 +1,6 @@ -IMiddleware | @bluelibs/runner - v1.3.0

Interface IMiddleware<TDependencies>

interface IMiddleware<TDependencies> {
    dependencies: TDependencies | (() => TDependencies);
    id: string;
    meta?: IMiddlewareMeta;
    run: ((input: IMiddlewareExecutionInput, dependencies: DependencyValuesType<TDependencies>) => Promise<any>);
    global(): IMiddleware<TDependencies>;
}

Type Parameters

Hierarchy (view full)

Properties

dependencies +IMiddleware | @bluelibs/runner - v1.4.0

Interface IMiddleware<TDependencies>

interface IMiddleware<TDependencies> {
    dependencies: TDependencies | (() => TDependencies);
    id: string;
    meta?: IMiddlewareMeta;
    run: ((input: IMiddlewareExecutionInput, dependencies: DependencyValuesType<TDependencies>) => Promise<any>);
    global(): IMiddleware<TDependencies>;
}

Type Parameters

Hierarchy (view full)

Properties

Methods

Properties

dependencies: TDependencies | (() => TDependencies)
id: string
run: ((input: IMiddlewareExecutionInput, dependencies: DependencyValuesType<TDependencies>) => Promise<any>)

Methods

+

Properties

dependencies: TDependencies | (() => TDependencies)
id: string
run: ((input: IMiddlewareExecutionInput, dependencies: DependencyValuesType<TDependencies>) => Promise<any>)

Methods

diff --git a/docs/interfaces/definitions.IMiddlewareDefinition.html b/docs/interfaces/definitions.IMiddlewareDefinition.html index 7774f10..b09d850 100644 --- a/docs/interfaces/definitions.IMiddlewareDefinition.html +++ b/docs/interfaces/definitions.IMiddlewareDefinition.html @@ -1,5 +1,5 @@ -IMiddlewareDefinition | @bluelibs/runner - v1.3.0

Interface IMiddlewareDefinition<TDependencies>

interface IMiddlewareDefinition<TDependencies> {
    dependencies?: TDependencies | (() => TDependencies);
    id: string;
    meta?: IMiddlewareMeta;
    run: ((input: IMiddlewareExecutionInput, dependencies: DependencyValuesType<TDependencies>) => Promise<any>);
}

Type Parameters

Hierarchy (view full)

Properties

dependencies? +IMiddlewareDefinition | @bluelibs/runner - v1.4.0

Interface IMiddlewareDefinition<TDependencies>

interface IMiddlewareDefinition<TDependencies> {
    dependencies?: TDependencies | (() => TDependencies);
    id: string;
    meta?: IMiddlewareMeta;
    run: ((input: IMiddlewareExecutionInput, dependencies: DependencyValuesType<TDependencies>) => Promise<any>);
}

Type Parameters

Hierarchy (view full)

Properties

dependencies?: TDependencies | (() => TDependencies)
id: string
run: ((input: IMiddlewareExecutionInput, dependencies: DependencyValuesType<TDependencies>) => Promise<any>)
+

Properties

dependencies?: TDependencies | (() => TDependencies)
id: string
run: ((input: IMiddlewareExecutionInput, dependencies: DependencyValuesType<TDependencies>) => Promise<any>)
diff --git a/docs/interfaces/definitions.IMiddlewareDefinitionConfigured.html b/docs/interfaces/definitions.IMiddlewareDefinitionConfigured.html index 2fa1893..0c445d9 100644 --- a/docs/interfaces/definitions.IMiddlewareDefinitionConfigured.html +++ b/docs/interfaces/definitions.IMiddlewareDefinitionConfigured.html @@ -1,3 +1,3 @@ -IMiddlewareDefinitionConfigured | @bluelibs/runner - v1.3.0

Interface IMiddlewareDefinitionConfigured<C>

interface IMiddlewareDefinitionConfigured<C> {
    config?: C;
    middleware: IMiddleware<C>;
}

Type Parameters

  • C extends Record<string, any> = {}

Properties

config? +IMiddlewareDefinitionConfigured | @bluelibs/runner - v1.4.0

Interface IMiddlewareDefinitionConfigured<C>

interface IMiddlewareDefinitionConfigured<C> {
    config?: C;
    middleware: IMiddleware<C>;
}

Type Parameters

  • C extends Record<string, any> = {}

Properties

Properties

config?: C
middleware: IMiddleware<C>
+

Properties

config?: C
middleware: IMiddleware<C>
diff --git a/docs/interfaces/definitions.IMiddlewareExecutionInput.html b/docs/interfaces/definitions.IMiddlewareExecutionInput.html index d40a9bc..30fb6e8 100644 --- a/docs/interfaces/definitions.IMiddlewareExecutionInput.html +++ b/docs/interfaces/definitions.IMiddlewareExecutionInput.html @@ -1,6 +1,6 @@ -IMiddlewareExecutionInput | @bluelibs/runner - v1.3.0

Interface IMiddlewareExecutionInput

interface IMiddlewareExecutionInput {
    config?: any;
    input?: any;
    next: ((taskInputOrResourceConfig?: any) => Promise<any>);
    resourceDefinition?: IResource<void, any, any>;
    taskDefinition?: ITask<any, any, {}, null>;
}

Properties

config? +IMiddlewareExecutionInput | @bluelibs/runner - v1.4.0

Interface IMiddlewareExecutionInput

interface IMiddlewareExecutionInput {
    config?: any;
    input?: any;
    next: ((taskInputOrResourceConfig?: any) => Promise<any>);
    resourceDefinition?: IResource<void, any, any>;
    taskDefinition?: ITask<any, any, {}, null>;
}

Properties

config?: any
input?: any
next: ((taskInputOrResourceConfig?: any) => Promise<any>)
resourceDefinition?: IResource<void, any, any>
taskDefinition?: ITask<any, any, {}, null>
+

Properties

config?: any
input?: any
next: ((taskInputOrResourceConfig?: any) => Promise<any>)
resourceDefinition?: IResource<void, any, any>
taskDefinition?: ITask<any, any, {}, null>
diff --git a/docs/interfaces/definitions.IMiddlewareMeta.html b/docs/interfaces/definitions.IMiddlewareMeta.html index e6665af..950de1a 100644 --- a/docs/interfaces/definitions.IMiddlewareMeta.html +++ b/docs/interfaces/definitions.IMiddlewareMeta.html @@ -1,4 +1,4 @@ -IMiddlewareMeta | @bluelibs/runner - v1.3.0
interface IMiddlewareMeta {
    description?: string;
    tags?: string[];
    title?: string;
}

Hierarchy (view full)

Properties

description? +IMiddlewareMeta | @bluelibs/runner - v1.4.0
interface IMiddlewareMeta {
    description?: string;
    tags?: string[];
    title?: string;
}

Hierarchy (view full)

Properties

description?: string
tags?: string[]
title?: string
+

Properties

description?: string
tags?: string[]
title?: string
diff --git a/docs/interfaces/definitions.IResource.html b/docs/interfaces/definitions.IResource.html index b06c27f..5688d80 100644 --- a/docs/interfaces/definitions.IResource.html +++ b/docs/interfaces/definitions.IResource.html @@ -1,4 +1,4 @@ -IResource | @bluelibs/runner - v1.3.0

Interface IResource<TConfig, TValue, TDependencies>

interface IResource<TConfig, TValue, TDependencies> {
    dependencies?: TDependencies | ((config: TConfig) => TDependencies);
    dispose?: ((value: TValue, config: TConfig, dependencies: DependencyValuesType<TDependencies>) => Promise<TValue>);
    events: {
        afterInit: IEventDefinition<AfterInitEventPayload<TConfig, TValue>>;
        beforeInit: IEventDefinition<BeforeInitEventPayload<TConfig>>;
        onError: IEventDefinition<OnErrorEventPayload>;
    };
    hooks: IHookDefinition<TDependencies, any>[] | ((config: TConfig) => IHookDefinition<TDependencies, any>[]);
    id: string;
    init?: ((config: TConfig, dependencies: DependencyValuesType<TDependencies>) => Promise<TValue>);
    meta?: IResourceMeta;
    middleware: IMiddlewareDefinition<any>[];
    overrides: (
        | IResource<void, any, any>
        | ITask<any, any, {}, null>
        | IMiddleware<any>
        | IResourceWithConfig<any, any, any>)[];
    register: RegisterableItems[] | ((config: TConfig) => RegisterableItems[]);
    with(config: TConfig): IResourceWithConfig<TConfig, TValue, TDependencies>;
}

Type Parameters

Hierarchy (view full)

Properties

dependencies? +IResource | @bluelibs/runner - v1.4.0

Interface IResource<TConfig, TValue, TDependencies>

interface IResource<TConfig, TValue, TDependencies> {
    dependencies?: TDependencies | ((config: TConfig) => TDependencies);
    dispose?: ((value: TValue, config: TConfig, dependencies: DependencyValuesType<TDependencies>) => Promise<TValue>);
    events: {
        afterInit: IEventDefinition<AfterInitEventPayload<TConfig, TValue>>;
        beforeInit: IEventDefinition<BeforeInitEventPayload<TConfig>>;
        onError: IEventDefinition<OnErrorEventPayload>;
    };
    hooks: IHookDefinition<TDependencies, any, false>[] | ((config: TConfig) => IHookDefinition<TDependencies, any, false>[]);
    id: string;
    init?: ((config: TConfig, dependencies: DependencyValuesType<TDependencies>) => Promise<TValue>);
    meta?: IResourceMeta;
    middleware: IMiddlewareDefinition<any>[];
    overrides: (
        | IResource<void, any, any>
        | ITask<any, any, {}, null>
        | IMiddleware<any>
        | IResourceWithConfig<any, any, any>)[];
    register: RegisterableItems[] | ((config: TConfig) => RegisterableItems[]);
    with(config: TConfig): IResourceWithConfig<TConfig, TValue, TDependencies>;
}

Type Parameters

Hierarchy (view full)

Properties

Methods

Properties

dependencies?: TDependencies | ((config: TConfig) => TDependencies)
dispose?: ((value: TValue, config: TConfig, dependencies: DependencyValuesType<TDependencies>) => Promise<TValue>)

Clean-up function for the resource. This is called when the resource is no longer needed.

+

Properties

dependencies?: TDependencies | ((config: TConfig) => TDependencies)
dispose?: ((value: TValue, config: TConfig, dependencies: DependencyValuesType<TDependencies>) => Promise<TValue>)

Clean-up function for the resource. This is called when the resource is no longer needed.

Type declaration

These events are automatically populated after the task has been defined.

-
hooks: IHookDefinition<TDependencies, any>[] | ((config: TConfig) => IHookDefinition<TDependencies, any>[])
id: string
init?: ((config: TConfig, dependencies: DependencyValuesType<TDependencies>) => Promise<TValue>)
middleware: IMiddlewareDefinition<any>[]
overrides: (
    | IResource<void, any, any>
    | ITask<any, any, {}, null>
    | IMiddleware<any>
    | IResourceWithConfig<any, any, any>)[]
register: RegisterableItems[] | ((config: TConfig) => RegisterableItems[])

Methods

+

Returns Promise<TValue>

These events are automatically populated after the task has been defined.

+
hooks: IHookDefinition<TDependencies, any, false>[] | ((config: TConfig) => IHookDefinition<TDependencies, any, false>[])
id: string
init?: ((config: TConfig, dependencies: DependencyValuesType<TDependencies>) => Promise<TValue>)
middleware: IMiddlewareDefinition<any>[]
overrides: (
    | IResource<void, any, any>
    | ITask<any, any, {}, null>
    | IMiddleware<any>
    | IResourceWithConfig<any, any, any>)[]
register: RegisterableItems[] | ((config: TConfig) => RegisterableItems[])

Methods

diff --git a/docs/interfaces/definitions.IResourceDefinintion.html b/docs/interfaces/definitions.IResourceDefinintion.html index 2c49934..439a715 100644 --- a/docs/interfaces/definitions.IResourceDefinintion.html +++ b/docs/interfaces/definitions.IResourceDefinintion.html @@ -1,4 +1,4 @@ -IResourceDefinintion | @bluelibs/runner - v1.3.0

Interface IResourceDefinintion<TConfig, TValue, TDependencies, THooks>

interface IResourceDefinintion<TConfig, TValue, TDependencies, THooks> {
    dependencies?: TDependencies | ((config: TConfig) => TDependencies);
    dispose?: ((value: TValue, config: TConfig, dependencies: DependencyValuesType<TDependencies>) => Promise<TValue>);
    hooks?: IHookDefinition<TDependencies, THooks>[] | ((config: TConfig) => IHookDefinition<TDependencies, THooks>[]);
    id: string;
    init?: ((config: TConfig, dependencies: DependencyValuesType<TDependencies>) => Promise<TValue>);
    meta?: IResourceMeta;
    middleware?: IMiddlewareDefinition<any>[];
    overrides?: (
        | IResource<void, any, any>
        | ITask<any, any, {}, null>
        | IMiddleware<any>
        | IResourceWithConfig<any, any, any>)[];
    register?: RegisterableItems[] | ((config: TConfig) => RegisterableItems[]);
}

Type Parameters

  • TConfig = void
  • TValue = unknown
  • TDependencies extends DependencyMapType = {}
  • THooks = any

Hierarchy (view full)

Properties

dependencies? +IResourceDefinintion | @bluelibs/runner - v1.4.0

Interface IResourceDefinintion<TConfig, TValue, TDependencies, THooks, TRegisterableItems>

interface IResourceDefinintion<TConfig, TValue, TDependencies, THooks, TRegisterableItems> {
    dependencies?: TDependencies | ((config: TConfig) => TDependencies);
    dispose?: ((value: TValue, config: TConfig, dependencies: DependencyValuesType<TDependencies>) => Promise<TValue>);
    hooks?: IHookDefinition<TDependencies, THooks, false>[] | ((config: TConfig) => IHookDefinition<TDependencies, THooks, false>[]);
    id: string;
    init?: ((config: TConfig, dependencies: DependencyValuesType<TDependencies>) => Promise<TValue>);
    meta?: IResourceMeta;
    middleware?: IMiddlewareDefinition<any>[];
    overrides?: (
        | IResource<void, any, any>
        | ITask<any, any, {}, null>
        | IMiddleware<any>
        | IResourceWithConfig<any, any, any>)[];
    register?: RegisterableItems[] | ((config: TConfig) => RegisterableItems[]);
}

Type Parameters

  • TConfig = any
  • TValue = unknown
  • TDependencies extends DependencyMapType = {}
  • THooks = any
  • TRegisterableItems = any

Hierarchy (view full)

Properties

dependencies?: TDependencies | ((config: TConfig) => TDependencies)
dispose?: ((value: TValue, config: TConfig, dependencies: DependencyValuesType<TDependencies>) => Promise<TValue>)

Clean-up function for the resource. This is called when the resource is no longer needed.

+

Properties

dependencies?: TDependencies | ((config: TConfig) => TDependencies)
dispose?: ((value: TValue, config: TConfig, dependencies: DependencyValuesType<TDependencies>) => Promise<TValue>)

Clean-up function for the resource. This is called when the resource is no longer needed.

Type declaration

id: string
init?: ((config: TConfig, dependencies: DependencyValuesType<TDependencies>) => Promise<TValue>)
middleware?: IMiddlewareDefinition<any>[]
overrides?: (
    | IResource<void, any, any>
    | ITask<any, any, {}, null>
    | IMiddleware<any>
    | IResourceWithConfig<any, any, any>)[]
register?: RegisterableItems[] | ((config: TConfig) => RegisterableItems[])
+

Returns Promise<TValue>

hooks?: IHookDefinition<TDependencies, THooks, false>[] | ((config: TConfig) => IHookDefinition<TDependencies, THooks, false>[])
id: string
init?: ((config: TConfig, dependencies: DependencyValuesType<TDependencies>) => Promise<TValue>)
middleware?: IMiddlewareDefinition<any>[]
overrides?: (
    | IResource<void, any, any>
    | ITask<any, any, {}, null>
    | IMiddleware<any>
    | IResourceWithConfig<any, any, any>)[]
register?: RegisterableItems[] | ((config: TConfig) => RegisterableItems[])
diff --git a/docs/interfaces/definitions.IResourceMeta.html b/docs/interfaces/definitions.IResourceMeta.html index 6a72c2e..c661092 100644 --- a/docs/interfaces/definitions.IResourceMeta.html +++ b/docs/interfaces/definitions.IResourceMeta.html @@ -1,4 +1,4 @@ -IResourceMeta | @bluelibs/runner - v1.3.0
interface IResourceMeta {
    description?: string;
    tags?: string[];
    title?: string;
}

Hierarchy (view full)

Properties

description? +IResourceMeta | @bluelibs/runner - v1.4.0
interface IResourceMeta {
    description?: string;
    tags?: string[];
    title?: string;
}

Hierarchy (view full)

Properties

description?: string
tags?: string[]
title?: string
+

Properties

description?: string
tags?: string[]
title?: string
diff --git a/docs/interfaces/definitions.IResourceWithConfig.html b/docs/interfaces/definitions.IResourceWithConfig.html index 0248499..f63ded7 100644 --- a/docs/interfaces/definitions.IResourceWithConfig.html +++ b/docs/interfaces/definitions.IResourceWithConfig.html @@ -1,3 +1,3 @@ -IResourceWithConfig | @bluelibs/runner - v1.3.0

Interface IResourceWithConfig<TConfig, TValue, TDependencies>

interface IResourceWithConfig<TConfig, TValue, TDependencies> {
    config: TConfig;
    resource: IResource<TConfig, TValue, TDependencies>;
}

Type Parameters

Properties

config +IResourceWithConfig | @bluelibs/runner - v1.4.0

Interface IResourceWithConfig<TConfig, TValue, TDependencies>

interface IResourceWithConfig<TConfig, TValue, TDependencies> {
    config: TConfig;
    resource: IResource<TConfig, TValue, TDependencies>;
}

Type Parameters

Properties

Properties

config: TConfig
+

Properties

config: TConfig
diff --git a/docs/interfaces/definitions.ITask.html b/docs/interfaces/definitions.ITask.html index b738122..af67f00 100644 --- a/docs/interfaces/definitions.ITask.html +++ b/docs/interfaces/definitions.ITask.html @@ -1,11 +1,15 @@ -ITask | @bluelibs/runner - v1.3.0

Interface ITask<TInput, TOutput, TDependencies, TEventDefinitionInput>

This is the response after the definition has been prepared. TODO: better naming?

-
interface ITask<TInput, TOutput, TDependencies, TEventDefinitionInput> {
    computedDependencies?: DependencyValuesType<TDependencies>;
    dependencies: TDependencies | (() => TDependencies);
    events: {
        afterRun: IEventDefinition<AfterRunEventPayload<TInput, TOutput>>;
        beforeRun: IEventDefinition<BeforeRunEventPayload<TInput>>;
        onError: IEventDefinition<OnErrorEventPayload>;
    };
    id: string;
    meta?: ITaskMeta;
    middleware: IMiddlewareDefinition<any>[];
    on?: IEventDefinition<TEventDefinitionInput>;
    run: ((input: TEventDefinitionInput extends null
        ? TInput
        : TEventDefinitionInput, dependencies: DependencyValuesType<TDependencies>) => TOutput);
}

Type Parameters

  • TInput = any
  • TOutput extends Promise<any> = any
  • TDependencies extends DependencyMapType = {}
  • TEventDefinitionInput = null

Hierarchy (view full)

Properties

computedDependencies? +ITask | @bluelibs/runner - v1.4.0

Interface ITask<TInput, TOutput, TDependencies, TEventDefinitionInput>

This is the response after the definition has been prepared. TODO: better naming?

+
interface ITask<TInput, TOutput, TDependencies, TEventDefinitionInput> {
    computedDependencies?: DependencyValuesType<TDependencies>;
    dependencies: TDependencies | (() => TDependencies);
    events: {
        afterRun: IEventDefinition<AfterRunEventPayload<TInput, TOutput>>;
        beforeRun: IEventDefinition<BeforeRunEventPayload<TInput>>;
        onError: IEventDefinition<OnErrorEventPayload>;
    };
    id: string;
    listenerOrder?: number;
    meta?: ITaskMeta;
    middleware: IMiddlewareDefinition<any>[];
    on?: IEventDefinition<TEventDefinitionInput>;
    run: ((input: TEventDefinitionInput extends null
        ? TInput
        : TEventDefinitionInput, dependencies: DependencyValuesType<TDependencies>) => TOutput);
}

Type Parameters

  • TInput = any
  • TOutput extends Promise<any> = any
  • TDependencies extends DependencyMapType = {}
  • TEventDefinitionInput = null

Hierarchy (view full)

Properties

computedDependencies?: DependencyValuesType<TDependencies>
dependencies: TDependencies | (() => TDependencies)

These events are automatically populated after the task has been defined.

-
id: string
meta?: ITaskMeta
middleware: IMiddlewareDefinition<any>[]
run: ((input: TEventDefinitionInput extends null
    ? TInput
    : TEventDefinitionInput, dependencies: DependencyValuesType<TDependencies>) => TOutput)
+

Properties

computedDependencies?: DependencyValuesType<TDependencies>
dependencies: TDependencies | (() => TDependencies)

These events are automatically populated after the task has been defined.

+
id: string
listenerOrder?: number

This makes sense only when on is specified to provide the order of the execution. +The event with the lowest order will be executed first.

+
meta?: ITaskMeta
middleware: IMiddlewareDefinition<any>[]

Listen to events in a simple way

+
run: ((input: TEventDefinitionInput extends null
    ? TInput
    : TEventDefinitionInput, dependencies: DependencyValuesType<TDependencies>) => TOutput)
diff --git a/docs/interfaces/definitions.ITaskDefinition.html b/docs/interfaces/definitions.ITaskDefinition.html index 1b13b67..f0e01e1 100644 --- a/docs/interfaces/definitions.ITaskDefinition.html +++ b/docs/interfaces/definitions.ITaskDefinition.html @@ -1,7 +1,11 @@ -ITaskDefinition | @bluelibs/runner - v1.3.0

Interface ITaskDefinition<TInput, TOutput, TDependencies, TEventDefinitionInput>

interface ITaskDefinition<TInput, TOutput, TDependencies, TEventDefinitionInput> {
    dependencies?: TDependencies | (() => TDependencies);
    id: string;
    meta?: ITaskMeta;
    middleware?: IMiddlewareDefinition<any>[];
    on?: IEventDefinition<TEventDefinitionInput>;
    run: ((input: TEventDefinitionInput extends null
        ? TInput
        : TEventDefinitionInput, dependencies: DependencyValuesType<TDependencies>) => TOutput);
}

Type Parameters

  • TInput = any
  • TOutput extends Promise<any> = any
  • TDependencies extends DependencyMapType = {}
  • TEventDefinitionInput = null

Hierarchy (view full)

Properties

dependencies? +ITaskDefinition | @bluelibs/runner - v1.4.0

Interface ITaskDefinition<TInput, TOutput, TDependencies, TEventDefinitionInput>

interface ITaskDefinition<TInput, TOutput, TDependencies, TEventDefinitionInput> {
    dependencies?: TDependencies | (() => TDependencies);
    id: string;
    listenerOrder?: number;
    meta?: ITaskMeta;
    middleware?: IMiddlewareDefinition<any>[];
    on?: IEventDefinition<TEventDefinitionInput>;
    run: ((input: TEventDefinitionInput extends null
        ? TInput
        : TEventDefinitionInput, dependencies: DependencyValuesType<TDependencies>) => TOutput);
}

Type Parameters

  • TInput = any
  • TOutput extends Promise<any> = any
  • TDependencies extends DependencyMapType = {}
  • TEventDefinitionInput = null

Hierarchy (view full)

Properties

dependencies?: TDependencies | (() => TDependencies)
id: string
meta?: ITaskMeta
middleware?: IMiddlewareDefinition<any>[]
run: ((input: TEventDefinitionInput extends null
    ? TInput
    : TEventDefinitionInput, dependencies: DependencyValuesType<TDependencies>) => TOutput)
+

Properties

dependencies?: TDependencies | (() => TDependencies)
id: string
listenerOrder?: number

This makes sense only when on is specified to provide the order of the execution. +The event with the lowest order will be executed first.

+
meta?: ITaskMeta
middleware?: IMiddlewareDefinition<any>[]

Listen to events in a simple way

+
run: ((input: TEventDefinitionInput extends null
    ? TInput
    : TEventDefinitionInput, dependencies: DependencyValuesType<TDependencies>) => TOutput)
diff --git a/docs/interfaces/definitions.ITaskMeta.html b/docs/interfaces/definitions.ITaskMeta.html index 6a60c70..f47a29e 100644 --- a/docs/interfaces/definitions.ITaskMeta.html +++ b/docs/interfaces/definitions.ITaskMeta.html @@ -1,4 +1,4 @@ -ITaskMeta | @bluelibs/runner - v1.3.0
interface ITaskMeta {
    description?: string;
    tags?: string[];
    title?: string;
}

Hierarchy (view full)

Properties

description? +ITaskMeta | @bluelibs/runner - v1.4.0
interface ITaskMeta {
    description?: string;
    tags?: string[];
    title?: string;
}

Hierarchy (view full)

Properties

description?: string
tags?: string[]
title?: string
+

Properties

description?: string
tags?: string[]
title?: string
diff --git a/docs/modules.html b/docs/modules.html index 8c62bdc..9f5d06f 100644 --- a/docs/modules.html +++ b/docs/modules.html @@ -1,4 +1,4 @@ -@bluelibs/runner - v1.3.0

@bluelibs/runner - v1.3.0

Index

Namespaces

definitions +@bluelibs/runner - v1.4.0

@bluelibs/runner - v1.4.0

Index

Namespaces

Classes

+
diff --git a/docs/modules/definitions.html b/docs/modules/definitions.html index 53ca4cf..de405e5 100644 --- a/docs/modules/definitions.html +++ b/docs/modules/definitions.html @@ -1,4 +1,4 @@ -definitions | @bluelibs/runner - v1.3.0

Namespace definitions

Index

Interfaces

IEvent +definitions | @bluelibs/runner - v1.4.0
+
diff --git a/docs/types/definitions.AfterInitEventPayload.html b/docs/types/definitions.AfterInitEventPayload.html index 48b5ed1..b32f3b8 100644 --- a/docs/types/definitions.AfterInitEventPayload.html +++ b/docs/types/definitions.AfterInitEventPayload.html @@ -1 +1 @@ -AfterInitEventPayload | @bluelibs/runner - v1.3.0

Type Alias AfterInitEventPayload<TConfig, TValue>

AfterInitEventPayload<TConfig, TValue>: {
    config: TConfig;
    value: TValue;
}

Type Parameters

  • TConfig
  • TValue
+AfterInitEventPayload | @bluelibs/runner - v1.4.0

Type Alias AfterInitEventPayload<TConfig, TValue>

AfterInitEventPayload<TConfig, TValue>: {
    config: TConfig;
    value: TValue;
}

Type Parameters

  • TConfig
  • TValue
diff --git a/docs/types/definitions.AfterRunEventPayload.html b/docs/types/definitions.AfterRunEventPayload.html index ccca096..b9a9d8e 100644 --- a/docs/types/definitions.AfterRunEventPayload.html +++ b/docs/types/definitions.AfterRunEventPayload.html @@ -1 +1 @@ -AfterRunEventPayload | @bluelibs/runner - v1.3.0

Type Alias AfterRunEventPayload<TInput, TOutput>

AfterRunEventPayload<TInput, TOutput>: {
    input: TInput;
    output: TOutput;
}

Type Parameters

  • TInput
  • TOutput
+AfterRunEventPayload | @bluelibs/runner - v1.4.0

Type Alias AfterRunEventPayload<TInput, TOutput>

AfterRunEventPayload<TInput, TOutput>: {
    input: TInput;
    output: TOutput;
}

Type Parameters

  • TInput
  • TOutput
diff --git a/docs/types/definitions.BeforeInitEventPayload.html b/docs/types/definitions.BeforeInitEventPayload.html index 3c8da42..505fbab 100644 --- a/docs/types/definitions.BeforeInitEventPayload.html +++ b/docs/types/definitions.BeforeInitEventPayload.html @@ -1 +1 @@ -BeforeInitEventPayload | @bluelibs/runner - v1.3.0

Type Alias BeforeInitEventPayload<TConfig>

BeforeInitEventPayload<TConfig>: {
    config: TConfig;
}

Type Parameters

  • TConfig
+BeforeInitEventPayload | @bluelibs/runner - v1.4.0

Type Alias BeforeInitEventPayload<TConfig>

BeforeInitEventPayload<TConfig>: {
    config: TConfig;
}

Type Parameters

  • TConfig
diff --git a/docs/types/definitions.BeforeRunEventPayload.html b/docs/types/definitions.BeforeRunEventPayload.html index 9fc91e6..56e1d4a 100644 --- a/docs/types/definitions.BeforeRunEventPayload.html +++ b/docs/types/definitions.BeforeRunEventPayload.html @@ -1 +1 @@ -BeforeRunEventPayload | @bluelibs/runner - v1.3.0

Type Alias BeforeRunEventPayload<TInput>

BeforeRunEventPayload<TInput>: {
    input: TInput;
}

Type Parameters

  • TInput
+BeforeRunEventPayload | @bluelibs/runner - v1.4.0

Type Alias BeforeRunEventPayload<TInput>

BeforeRunEventPayload<TInput>: {
    input: TInput;
}

Type Parameters

  • TInput
diff --git a/docs/types/definitions.DependencyMapType.html b/docs/types/definitions.DependencyMapType.html index 7a7d9df..601ddee 100644 --- a/docs/types/definitions.DependencyMapType.html +++ b/docs/types/definitions.DependencyMapType.html @@ -1 +1 @@ -DependencyMapType | @bluelibs/runner - v1.3.0
DependencyMapType: Record<string,
    | ITask
    | IResource
    | IEventDefinition
    | IResourceWithConfig<any, any>>
+DependencyMapType | @bluelibs/runner - v1.4.0
DependencyMapType: Record<string,
    | ITask
    | IResource
    | IEventDefinition
    | IResourceWithConfig<any, any>>
diff --git a/docs/types/definitions.DependencyValueType.html b/docs/types/definitions.DependencyValueType.html index ecab3e2..353b2e7 100644 --- a/docs/types/definitions.DependencyValueType.html +++ b/docs/types/definitions.DependencyValueType.html @@ -1 +1 @@ -DependencyValueType | @bluelibs/runner - v1.3.0

Type Alias DependencyValueType<T>

DependencyValueType<T>: T extends ITask<infer I, infer O, infer D>
    ? ((...args: I extends unknown
        ? []
        : [I]) => O)
    : T extends IResource<any, infer V>
        ? V
        : T extends IEventDefinition<infer P>
            ? ((input: P) => Promise<void> | never)
            : never

Type Parameters

  • T
+DependencyValueType | @bluelibs/runner - v1.4.0

Type Alias DependencyValueType<T>

DependencyValueType<T>: T extends ITask<any, any, any>
    ? TaskDependency<ExtractTaskInput<T>, ExtractTaskOutput<T>>
    : T extends IResource<any, any>
        ? ResourceDependency<ExtractResourceValue<T>>
        : T extends IEventDefinition<any>
            ? EventDependency<ExtractEventParams<T>>
            : never

Type Parameters

  • T
diff --git a/docs/types/definitions.DependencyValuesType.html b/docs/types/definitions.DependencyValuesType.html index 318edf6..dd2fb4c 100644 --- a/docs/types/definitions.DependencyValuesType.html +++ b/docs/types/definitions.DependencyValuesType.html @@ -1 +1 @@ -DependencyValuesType | @bluelibs/runner - v1.3.0

Type Alias DependencyValuesType<T>

DependencyValuesType<T>: {
    [K in keyof T]: DependencyValueType<T[K]>
}

Type Parameters

+DependencyValuesType | @bluelibs/runner - v1.4.0

Type Alias DependencyValuesType<T>

DependencyValuesType<T>: {
    [K in keyof T]: DependencyValueType<T[K]>
}

Type Parameters

diff --git a/docs/types/definitions.EventHandlerType.html b/docs/types/definitions.EventHandlerType.html index c09b135..ee299c1 100644 --- a/docs/types/definitions.EventHandlerType.html +++ b/docs/types/definitions.EventHandlerType.html @@ -1 +1 @@ -EventHandlerType | @bluelibs/runner - v1.3.0

Type Alias EventHandlerType<T>

EventHandlerType<T>: ((event: IEvent<T>) => any | Promise<any>)

Type Parameters

  • T = any
+EventHandlerType | @bluelibs/runner - v1.4.0

Type Alias EventHandlerType<T>

EventHandlerType<T>: ((event: IEvent<T>) => any | Promise<any>)

Type Parameters

  • T = any
diff --git a/docs/types/definitions.OnErrorEventPayload.html b/docs/types/definitions.OnErrorEventPayload.html index 61618bd..92f648d 100644 --- a/docs/types/definitions.OnErrorEventPayload.html +++ b/docs/types/definitions.OnErrorEventPayload.html @@ -1,2 +1,2 @@ -OnErrorEventPayload | @bluelibs/runner - v1.3.0
OnErrorEventPayload: {
    error: any;
    suppress(): void;
}

Type declaration

  • error: any
  • suppress:function
    • This function can be called to suppress the error from being thrown.

      -

      Returns void

+OnErrorEventPayload | @bluelibs/runner - v1.4.0
OnErrorEventPayload: {
    error: any;
    suppress(): void;
}

Type declaration

  • error: any
  • suppress:function
    • This function can be called to suppress the error from being thrown.

      +

      Returns void

diff --git a/docs/types/definitions.RegisterableItems.html b/docs/types/definitions.RegisterableItems.html index f78416f..dc317e1 100644 --- a/docs/types/definitions.RegisterableItems.html +++ b/docs/types/definitions.RegisterableItems.html @@ -1 +1 @@ -RegisterableItems | @bluelibs/runner - v1.3.0
RegisterableItems:
    | IResource<void>
    | IResourceWithConfig<any>
    | ITaskDefinition
    | IMiddlewareDefinition
    | IEventDefinition
+RegisterableItems | @bluelibs/runner - v1.4.0
RegisterableItems:
    | IResourceWithConfig<any>
    | IResource<any>
    | ITaskDefinition
    | IMiddlewareDefinition
    | IEventDefinition
diff --git a/docs/variables/definitions.symbols.html b/docs/variables/definitions.symbols.html index 3eaa383..599fabf 100644 --- a/docs/variables/definitions.symbols.html +++ b/docs/variables/definitions.symbols.html @@ -1 +1 @@ -symbols | @bluelibs/runner - v1.3.0
symbols: {
    event: symbol;
    middleware: symbol;
    middlewareGlobal: symbol;
    resource: symbol;
    resourceWithConfig: symbol;
    task: symbol;
} = ...
+symbols | @bluelibs/runner - v1.4.0
symbols: {
    event: symbol;
    middleware: symbol;
    middlewareGlobal: symbol;
    resource: symbol;
    resourceWithConfig: symbol;
    task: symbol;
} = ...
diff --git a/docs/variables/globals.html b/docs/variables/globals.html index 1598c8a..1951ccf 100644 --- a/docs/variables/globals.html +++ b/docs/variables/globals.html @@ -1 +1 @@ -globals | @bluelibs/runner - v1.3.0

Variable globalsConst

globals: {
    events: {
        afterInit: IEventDefinition<any>;
        beforeInit: IEventDefinition<any>;
        log: IEventDefinition<ILog>;
        resources: {
            afterInit: IEventDefinition<{
                config: any;
                resource: IResource<any, any, any>;
                value: any;
            }>;
            beforeInit: IEventDefinition<{
                config: any;
                resource: IResource<any, any, any>;
            }>;
            onError: IEventDefinition<{
                error: Error;
                resource: IResource<any, any, any>;
                suppress: (() => void);
            }>;
        };
        tasks: {
            afterRun: IEventDefinition<{
                input: any;
                output: any;
                task: ITask<any, any, any, null>;
            }>;
            beforeRun: IEventDefinition<{
                input: any;
                task: ITask<any, any, any, null>;
            }>;
            onError: IEventDefinition<{
                error: any;
                suppress: (() => void);
                task: ITask<any, any, any, null>;
            }>;
        };
    };
    resources: {
        eventManager: IResource<EventManager, EventManager, {}>;
        logger: IResource<Logger, Logger, {}>;
        store: IResource<Store, Store, {}>;
        taskRunner: IResource<TaskRunner, TaskRunner, {}>;
    };
} = ...
+globals | @bluelibs/runner - v1.4.0

Variable globalsConst

globals: {
    events: {
        afterInit: IEventDefinition<any>;
        beforeInit: IEventDefinition<any>;
        log: IEventDefinition<ILog>;
        resources: {
            afterInit: IEventDefinition<{
                config: any;
                resource: IResource<any, any, any>;
                value: any;
            }>;
            beforeInit: IEventDefinition<{
                config: any;
                resource: IResource<any, any, any>;
            }>;
            onError: IEventDefinition<{
                error: Error;
                resource: IResource<any, any, any>;
                suppress: (() => void);
            }>;
        };
        tasks: {
            afterRun: IEventDefinition<{
                input: any;
                output: any;
                task: ITask<any, any, any, null>;
            }>;
            beforeRun: IEventDefinition<{
                input: any;
                task: ITask<any, any, any, null>;
            }>;
            onError: IEventDefinition<{
                error: any;
                suppress: (() => void);
                task: ITask<any, any, any, null>;
            }>;
        };
    };
    resources: {
        eventManager: IResource<EventManager, EventManager, {}>;
        logger: IResource<Logger, Logger, {}>;
        store: IResource<Store, Store, {}>;
        taskRunner: IResource<TaskRunner, TaskRunner, {}>;
    };
} = ...