@twin.org/background-task-models 0.0.1-next.1 → 0.0.1-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,4 @@
1
- import type { IError } from "@twin.org/core";
2
1
  /**
3
- * Interface describing a task handler.
2
+ * Interface describing a task handler, exceptions thrown in the handler will be caught.
4
3
  */
5
- export type BackgroundTaskHandler<T = any, U = any> = (payload: T) => Promise<{
6
- result?: U;
7
- error?: IError;
8
- }>;
4
+ export type BackgroundTaskHandler<T = any, U = any> = (payload: T) => Promise<U>;
package/docs/changelog.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @twin.org/background-task-models - Changelog
2
2
 
3
- ## v0.0.1-next.1
3
+ ## v0.0.1-next.2
4
4
 
5
5
  - Initial Release
@@ -1,8 +1,8 @@
1
1
  # Type Alias: BackgroundTaskHandler()\<T, U\>
2
2
 
3
- > **BackgroundTaskHandler**\<`T`, `U`\>: (`payload`) => `Promise`\<`object`\>
3
+ > **BackgroundTaskHandler**\<`T`, `U`\>: (`payload`) => `Promise`\<`U`\>
4
4
 
5
- Interface describing a task handler.
5
+ Interface describing a task handler, exceptions thrown in the handler will be caught.
6
6
 
7
7
  ## Type Parameters
8
8
 
@@ -16,12 +16,4 @@ Interface describing a task handler.
16
16
 
17
17
  ## Returns
18
18
 
19
- `Promise`\<`object`\>
20
-
21
- ### result?
22
-
23
- > `optional` **result**: `U`
24
-
25
- ### error?
26
-
27
- > `optional` **error**: `IError`
19
+ `Promise`\<`U`\>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/background-task-models",
3
- "version": "0.0.1-next.1",
3
+ "version": "0.0.1-next.2",
4
4
  "description": "Models which define the structure of the background task contracts and connectors",
5
5
  "repository": {
6
6
  "type": "git",