@orkestrel/workflow 0.0.14 → 0.0.15

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.
@@ -2340,6 +2340,7 @@ export declare interface TaskActivity {
2340
2340
  * One complete replacement of a running task's observable activity.
2341
2341
  *
2342
2342
  * @remarks
2343
+ * `note` describes the frame while `progress.message` describes the progress value.
2343
2344
  * Omitted `operations` or `constraints` mean an empty list. Omitted `progress` clears the
2344
2345
  * previous aggregate progress. Use {@link TaskInterface.report} to commit the replacement.
2345
2346
  */
@@ -2867,13 +2868,14 @@ export declare interface TaskOptions {
2867
2868
  * The aggregate progress most recently reported by a running task.
2868
2869
  *
2869
2870
  * @remarks
2870
- * `current` and an optional `total` are finite non-negative numbers; when `total` is present
2871
- * it is at least `current`. `unit` is optional observer-facing text.
2871
+ * `progress` and an optional `total` are finite non-negative numbers; when `total` is present
2872
+ * it is at least `progress`. `message` is optional observer-facing text describing the reported
2873
+ * state.
2872
2874
  */
2873
2875
  export declare interface TaskProgress {
2874
- readonly current: number;
2876
+ readonly progress: number;
2875
2877
  readonly total?: number;
2876
- readonly unit?: string;
2878
+ readonly message?: string;
2877
2879
  }
2878
2880
 
2879
2881
  export declare interface TaskResult {
@@ -2340,6 +2340,7 @@ export declare interface TaskActivity {
2340
2340
  * One complete replacement of a running task's observable activity.
2341
2341
  *
2342
2342
  * @remarks
2343
+ * `note` describes the frame while `progress.message` describes the progress value.
2343
2344
  * Omitted `operations` or `constraints` mean an empty list. Omitted `progress` clears the
2344
2345
  * previous aggregate progress. Use {@link TaskInterface.report} to commit the replacement.
2345
2346
  */
@@ -2867,13 +2868,14 @@ export declare interface TaskOptions {
2867
2868
  * The aggregate progress most recently reported by a running task.
2868
2869
  *
2869
2870
  * @remarks
2870
- * `current` and an optional `total` are finite non-negative numbers; when `total` is present
2871
- * it is at least `current`. `unit` is optional observer-facing text.
2871
+ * `progress` and an optional `total` are finite non-negative numbers; when `total` is present
2872
+ * it is at least `progress`. `message` is optional observer-facing text describing the reported
2873
+ * state.
2872
2874
  */
2873
2875
  export declare interface TaskProgress {
2874
- readonly current: number;
2876
+ readonly progress: number;
2875
2877
  readonly total?: number;
2876
- readonly unit?: string;
2878
+ readonly message?: string;
2877
2879
  }
2878
2880
 
2879
2881
  export declare interface TaskResult {
@@ -243,11 +243,11 @@ function isTaskActivityInput(value) {
243
243
  if (progress !== void 0) {
244
244
  if (!isRecord(progress)) return false;
245
245
  const progressPrototype = Object.getPrototypeOf(progress);
246
- if (progressPrototype !== Object.prototype && progressPrototype !== null || !Object.keys(progress).every((key) => key === "current" || key === "total" || key === "unit")) return false;
247
- const current = progress.current;
246
+ if (progressPrototype !== Object.prototype && progressPrototype !== null || !Object.keys(progress).every((key) => key === "progress" || key === "total" || key === "message")) return false;
247
+ const reported = progress.progress;
248
248
  const total = progress.total;
249
- const unit = progress.unit;
250
- if (!isFiniteNumber(current) || current < 0 || total !== void 0 && (!isFiniteNumber(total) || total < current) || unit !== void 0 && !isNonEmptyString(unit)) return false;
249
+ const message = progress.message;
250
+ if (!isFiniteNumber(reported) || reported < 0 || total !== void 0 && (!isFiniteNumber(total) || total < reported) || message !== void 0 && !isNonEmptyString(message)) return false;
251
251
  }
252
252
  if (operations !== void 0) {
253
253
  if (!isArray(operations)) return false;
@@ -1141,14 +1141,14 @@ function cloneTaskActivity(input, updated) {
1141
1141
  if (progressInput !== void 0) {
1142
1142
  if (!isRecord(progressInput)) throw new WorkflowError("MUTATION", "task activity contains invalid progress");
1143
1143
  const progressPrototype = Object.getPrototypeOf(progressInput);
1144
- if (progressPrototype !== Object.prototype && progressPrototype !== null || !Object.keys(progressInput).every((key) => key === "current" || key === "total" || key === "unit")) throw new WorkflowError("MUTATION", "task activity contains invalid progress");
1145
- const current = progressInput.current;
1144
+ if (progressPrototype !== Object.prototype && progressPrototype !== null || !Object.keys(progressInput).every((key) => key === "progress" || key === "total" || key === "message")) throw new WorkflowError("MUTATION", "task activity contains invalid progress");
1145
+ const reported = progressInput.progress;
1146
1146
  const total = progressInput.total;
1147
- const unit = progressInput.unit;
1147
+ const message = progressInput.message;
1148
1148
  progress = Object.freeze({
1149
- current,
1149
+ progress: reported,
1150
1150
  ...total === void 0 ? {} : { total },
1151
- ...unit === void 0 ? {} : { unit }
1151
+ ...message === void 0 ? {} : { message }
1152
1152
  });
1153
1153
  }
1154
1154
  const constraintInputs = constraintsInput === void 0 ? [] : isArray(constraintsInput) ? [...constraintsInput] : void 0;