@enonic-types/lib-task 8.0.0-B4 → 8.0.0-B5

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/task.d.ts +5 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enonic-types/lib-task",
3
- "version": "8.0.0-B4",
3
+ "version": "8.0.0-B5",
4
4
  "description": "Type definitions for lib-task.",
5
5
  "types": "task.d.ts",
6
6
  "files": [
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "homepage": "https://github.com/enonic/xp/tree/master#readme",
29
29
  "dependencies": {
30
- "@enonic-types/core": "8.0.0-B4"
30
+ "@enonic-types/core": "8.0.0-B5"
31
31
  },
32
32
  "publishConfig": {
33
33
  "access": "public"
package/task.d.ts CHANGED
@@ -28,6 +28,7 @@ export interface ExecuteFunctionParams {
28
28
  * @property {string} application Application containing the callback function to run.
29
29
  * @property {string} user Key of the user that submitted the task.
30
30
  * @property {string} startTime Time when the task was submitted (in ISO-8601 format).
31
+ * @property {string} [node] Identifier of the cluster node where the task is running. Absent when no cluster is configured.
31
32
  * @property {object} progress Progress information provided by the running task.
32
33
  * @property {number} progress.current Latest progress current numeric value.
33
34
  * @property {number} progress.total Latest progress target numeric value.
@@ -55,13 +56,13 @@ export interface SubmitTaskParams<Config extends Record<string, unknown>> {
55
56
  /**
56
57
  * Submits a task to be executed in the background and returns an id representing the task.
57
58
  *
58
- * This function returns immediately. The callback function will be executed asynchronously.
59
+ * This function returns immediately. The task will be executed asynchronously.
59
60
  *
60
61
  * @example-ref examples/task/submitTask.js
61
62
  *
62
63
  * @param {object} params JSON with the parameters.
63
64
  * @param {string} params.descriptor Descriptor of the task to execute.
64
- * @param {string} [params.name] Optional name of the task. If not specified, descriptor name will be used instead.
65
+ * @param {string} [params.name] Optional name of the task. If not specified, the descriptor key will be used instead.
65
66
  * @param {object} [params.config] Configuration parameters to pass to the task to be executed.
66
67
  * The object must be valid according to the schema defined in the form of the task descriptor XML.
67
68
  * @returns {string} Id of the task that will be executed.
@@ -86,7 +87,7 @@ export interface TaskInfo {
86
87
  user: UserKey;
87
88
  startTime: string;
88
89
  progress: TaskProgress;
89
- node: string;
90
+ node?: string;
90
91
  }
91
92
  /**
92
93
  * Returns the list of active tasks with their current state and progress details.
@@ -95,7 +96,7 @@ export interface TaskInfo {
95
96
  *
96
97
  * @param {object} [params] JSON with optional parameters.
97
98
  * @param {string} [params.name] Filter by name.
98
- * @param {object} [params.state] Filter by task state ('WAITING' | 'RUNNING' | 'FINISHED' | 'FAILED').
99
+ * @param {string} [params.state] Filter by task state ('WAITING' | 'RUNNING' | 'FINISHED' | 'FAILED').
99
100
  * @returns {TaskInfo[]} List with task information for every task.
100
101
  */
101
102
  export declare function list(params?: ListTasksParams): TaskInfo[];