attlaz-client 1.64.0 → 1.66.0

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,6 +1,6 @@
1
1
  import { CommandExecutionStatus } from './CommandExecutionStatus.js';
2
2
  export interface CommandExecutionFilter {
3
- status?: CommandExecutionStatus;
4
- type?: string;
3
+ status?: CommandExecutionStatus[];
4
+ type?: string[];
5
5
  requestedBy?: string;
6
6
  }
@@ -1,17 +1,17 @@
1
1
  export declare enum EventType {
2
2
  /** @deprecated * */
3
- TaskExecutionRequested,
3
+ TaskExecutionRequested = "TaskExecutionRequested",
4
4
  /** @deprecated * */
5
- TaskExecutionStarted,
5
+ TaskExecutionStarted = "TaskExecutionStarted",
6
6
  /** @deprecated * */
7
- TaskExecutionFailed,
7
+ TaskExecutionFailed = "TaskExecutionFailed",
8
8
  /** @deprecated * */
9
- TaskExecutionComplete,
9
+ TaskExecutionComplete = "TaskExecutionComplete",
10
10
  /** @deprecated * */
11
- TaskExecutionRetry,
12
- FlowRunRequested,
13
- FlowRunStarted,
14
- FlowRunFailed,
15
- FlowRunComplete,
16
- FlowRunRetry
11
+ TaskExecutionRetry = "TaskExecutionRetry",
12
+ FlowRunRequested = "FlowRunRequested",
13
+ FlowRunStarted = "FlowRunStarted",
14
+ FlowRunFailed = "FlowRunFailed",
15
+ FlowRunComplete = "FlowRunComplete",
16
+ FlowRunRetry = "FlowRunRetry"
17
17
  }
@@ -1,18 +1,18 @@
1
1
  export var EventType;
2
2
  (function (EventType) {
3
3
  /** @deprecated * */
4
- EventType[EventType["TaskExecutionRequested"] = 'TaskExecutionRequested'] = "TaskExecutionRequested";
4
+ EventType["TaskExecutionRequested"] = "TaskExecutionRequested";
5
5
  /** @deprecated * */
6
- EventType[EventType["TaskExecutionStarted"] = 'TaskExecutionStarted'] = "TaskExecutionStarted";
6
+ EventType["TaskExecutionStarted"] = "TaskExecutionStarted";
7
7
  /** @deprecated * */
8
- EventType[EventType["TaskExecutionFailed"] = 'TaskExecutionFailed'] = "TaskExecutionFailed";
8
+ EventType["TaskExecutionFailed"] = "TaskExecutionFailed";
9
9
  /** @deprecated * */
10
- EventType[EventType["TaskExecutionComplete"] = 'TaskExecutionComplete'] = "TaskExecutionComplete";
10
+ EventType["TaskExecutionComplete"] = "TaskExecutionComplete";
11
11
  /** @deprecated * */
12
- EventType[EventType["TaskExecutionRetry"] = 'TaskExecutionRetry'] = "TaskExecutionRetry";
13
- EventType[EventType["FlowRunRequested"] = 'FlowRunRequested'] = "FlowRunRequested";
14
- EventType[EventType["FlowRunStarted"] = 'FlowRunStarted'] = "FlowRunStarted";
15
- EventType[EventType["FlowRunFailed"] = 'FlowRunFailed'] = "FlowRunFailed";
16
- EventType[EventType["FlowRunComplete"] = 'FlowRunComplete'] = "FlowRunComplete";
17
- EventType[EventType["FlowRunRetry"] = 'FlowRunRetry'] = "FlowRunRetry";
12
+ EventType["TaskExecutionRetry"] = "TaskExecutionRetry";
13
+ EventType["FlowRunRequested"] = "FlowRunRequested";
14
+ EventType["FlowRunStarted"] = "FlowRunStarted";
15
+ EventType["FlowRunFailed"] = "FlowRunFailed";
16
+ EventType["FlowRunComplete"] = "FlowRunComplete";
17
+ EventType["FlowRunRetry"] = "FlowRunRetry";
18
18
  })(EventType || (EventType = {}));
@@ -1,7 +1,8 @@
1
- import { FlowRunStatus } from './FlowRunStatus.js';
1
+ import { ApiRecord } from '../ApiRecord.js';
2
+ import { FlowRunHistoryStatus } from './FlowRunHistoryStatus.js';
2
3
  export declare class FlowRunHistory {
3
4
  id: string;
4
5
  time: Date;
5
- status: FlowRunStatus;
6
- static parse(rawFlowRunHistory: any): FlowRunHistory;
6
+ status: FlowRunHistoryStatus;
7
+ static parse(rawFlowRunHistory: ApiRecord): FlowRunHistory;
7
8
  }
@@ -1,5 +1,5 @@
1
1
  import { Utils } from '../../Utils.js';
2
- import { FlowRunStatus } from './FlowRunStatus.js';
2
+ import { FlowRunHistoryStatus } from './FlowRunHistoryStatus.js';
3
3
  export class FlowRunHistory {
4
4
  id;
5
5
  time;
@@ -8,7 +8,7 @@ export class FlowRunHistory {
8
8
  const flowRunHistory = new FlowRunHistory();
9
9
  flowRunHistory.id = rawFlowRunHistory.id;
10
10
  flowRunHistory.time = Utils.parseRawDate(rawFlowRunHistory.time);
11
- flowRunHistory.status = FlowRunStatus.fromString(rawFlowRunHistory.status);
11
+ flowRunHistory.status = FlowRunHistoryStatus.fromString(rawFlowRunHistory.status);
12
12
  return flowRunHistory;
13
13
  }
14
14
  }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Status values as stored in flow_run_history (distinct from FlowRunStatus, the derived run state).
3
+ * Notably `started`/`success` here vs `running`/`complete` on FlowRunStatus — reusing FlowRunStatus
4
+ * to parse history rows would throw on those two values and silently drop them.
5
+ */
6
+ export declare enum FlowRunHistoryStatus {
7
+ Pending = "pending",
8
+ Started = "started",
9
+ Success = "success",
10
+ Failed = "failed",
11
+ Stopped = "stopped",
12
+ Canceled = "canceled"
13
+ }
14
+ export declare namespace FlowRunHistoryStatus {
15
+ const fromString: (input: string) => FlowRunHistoryStatus;
16
+ }
@@ -0,0 +1,24 @@
1
+ import { Utils } from '../../Utils.js';
2
+ /**
3
+ * Status values as stored in flow_run_history (distinct from FlowRunStatus, the derived run state).
4
+ * Notably `started`/`success` here vs `running`/`complete` on FlowRunStatus — reusing FlowRunStatus
5
+ * to parse history rows would throw on those two values and silently drop them.
6
+ */
7
+ export var FlowRunHistoryStatus;
8
+ (function (FlowRunHistoryStatus) {
9
+ FlowRunHistoryStatus["Pending"] = "pending";
10
+ FlowRunHistoryStatus["Started"] = "started";
11
+ FlowRunHistoryStatus["Success"] = "success";
12
+ FlowRunHistoryStatus["Failed"] = "failed";
13
+ FlowRunHistoryStatus["Stopped"] = "stopped";
14
+ FlowRunHistoryStatus["Canceled"] = "canceled";
15
+ })(FlowRunHistoryStatus || (FlowRunHistoryStatus = {}));
16
+ (function (FlowRunHistoryStatus) {
17
+ FlowRunHistoryStatus.fromString = (input) => {
18
+ const result = Utils.parseEnum(input, FlowRunHistoryStatus);
19
+ if (result === null) {
20
+ throw new Error('Unable to parse FlowRunHistoryStatus from string: Unknown FlowRunHistoryStatus "' + input + '"');
21
+ }
22
+ return result;
23
+ };
24
+ })(FlowRunHistoryStatus || (FlowRunHistoryStatus = {}));
@@ -0,0 +1,16 @@
1
+ import { ApiRecord } from '../ApiRecord.js';
2
+ import { FlowRunStatus } from './FlowRunStatus.js';
3
+ /**
4
+ * The authoritative lifecycle of a flow run, as derived server-side from its event history
5
+ * (first-terminal-wins). Unlike FlowRunSummary, which reflects the (eventually-consistent) index
6
+ * projection, this is computed directly from the history and is safe for control-flow decisions
7
+ * such as the worker's "is this run already terminal?" tombstone check.
8
+ */
9
+ export declare class FlowRunLifecycle {
10
+ id: string;
11
+ status: FlowRunStatus;
12
+ requested: Date | null;
13
+ started: Date | null;
14
+ ended: Date | null;
15
+ static parse(rawFlowRunLifecycle: ApiRecord): FlowRunLifecycle;
16
+ }
@@ -0,0 +1,24 @@
1
+ import { Utils } from '../../Utils.js';
2
+ import { FlowRunStatus } from './FlowRunStatus.js';
3
+ /**
4
+ * The authoritative lifecycle of a flow run, as derived server-side from its event history
5
+ * (first-terminal-wins). Unlike FlowRunSummary, which reflects the (eventually-consistent) index
6
+ * projection, this is computed directly from the history and is safe for control-flow decisions
7
+ * such as the worker's "is this run already terminal?" tombstone check.
8
+ */
9
+ export class FlowRunLifecycle {
10
+ id;
11
+ status;
12
+ requested;
13
+ started;
14
+ ended;
15
+ static parse(rawFlowRunLifecycle) {
16
+ const lifecycle = new FlowRunLifecycle();
17
+ lifecycle.id = rawFlowRunLifecycle.id;
18
+ lifecycle.status = FlowRunStatus.fromString(rawFlowRunLifecycle.status);
19
+ lifecycle.requested = rawFlowRunLifecycle.requested === null || rawFlowRunLifecycle.requested === undefined ? null : Utils.parseRawDate(rawFlowRunLifecycle.requested);
20
+ lifecycle.started = rawFlowRunLifecycle.started === null || rawFlowRunLifecycle.started === undefined ? null : Utils.parseRawDate(rawFlowRunLifecycle.started);
21
+ lifecycle.ended = rawFlowRunLifecycle.ended === null || rawFlowRunLifecycle.ended === undefined ? null : Utils.parseRawDate(rawFlowRunLifecycle.ended);
22
+ return lifecycle;
23
+ }
24
+ }
@@ -1,11 +1,11 @@
1
1
  export declare enum FlowRunStatus {
2
- Unknown,
3
- Pending,
4
- Canceled,
5
- Running,
6
- Failed,
7
- Stopped,
8
- Complete
2
+ Unknown = "unknown",
3
+ Pending = "pending",
4
+ Canceled = "canceled",
5
+ Running = "running",
6
+ Failed = "failed",
7
+ Stopped = "stopped",
8
+ Complete = "complete"
9
9
  }
10
10
  export declare namespace FlowRunStatus {
11
11
  const fromString: (input: string) => FlowRunStatus;
@@ -1,13 +1,13 @@
1
1
  import { Utils } from '../../Utils.js';
2
2
  export var FlowRunStatus;
3
3
  (function (FlowRunStatus) {
4
- FlowRunStatus[FlowRunStatus["Unknown"] = 'unknown'] = "Unknown";
5
- FlowRunStatus[FlowRunStatus["Pending"] = 'pending'] = "Pending";
6
- FlowRunStatus[FlowRunStatus["Canceled"] = 'canceled'] = "Canceled";
7
- FlowRunStatus[FlowRunStatus["Running"] = 'running'] = "Running";
8
- FlowRunStatus[FlowRunStatus["Failed"] = 'failed'] = "Failed";
9
- FlowRunStatus[FlowRunStatus["Stopped"] = 'stopped'] = "Stopped";
10
- FlowRunStatus[FlowRunStatus["Complete"] = 'complete'] = "Complete";
4
+ FlowRunStatus["Unknown"] = "unknown";
5
+ FlowRunStatus["Pending"] = "pending";
6
+ FlowRunStatus["Canceled"] = "canceled";
7
+ FlowRunStatus["Running"] = "running";
8
+ FlowRunStatus["Failed"] = "failed";
9
+ FlowRunStatus["Stopped"] = "stopped";
10
+ FlowRunStatus["Complete"] = "complete";
11
11
  })(FlowRunStatus || (FlowRunStatus = {}));
12
12
  (function (FlowRunStatus) {
13
13
  FlowRunStatus.fromString = (input) => {
@@ -9,10 +9,10 @@ export class CommandExecutionEndpoint extends Endpoint {
9
9
  const queryString = new QueryString('/system/command-executions');
10
10
  queryString.addPagination(pagination);
11
11
  if (filter !== null) {
12
- if (filter.status !== undefined) {
12
+ if (filter.status !== undefined && filter.status.length > 0) {
13
13
  queryString.set('status', filter.status);
14
14
  }
15
- if (filter.type !== undefined) {
15
+ if (filter.type !== undefined && filter.type.length > 0) {
16
16
  queryString.set('type', filter.type);
17
17
  }
18
18
  if (filter.requestedBy !== undefined) {
@@ -2,6 +2,7 @@ import { FlowRun } from '../Model/Flow/FlowRun.js';
2
2
  import { FlowRunStatus } from '../Model/Flow/FlowRunStatus.js';
3
3
  import { FlowRunSummary } from '../Model/Flow/FlowRunSummary.js';
4
4
  import { FlowRunHistory } from '../Model/Flow/FlowRunHistory.js';
5
+ import { FlowRunLifecycle } from '../Model/Flow/FlowRunLifecycle.js';
5
6
  import { CollectionResult } from '../Model/Result/CollectionResult.js';
6
7
  import { CursorPagination } from '../Model/Pagination/CursorPagination.js';
7
8
  import { Endpoint } from './Endpoint.js';
@@ -10,5 +11,11 @@ export declare class FlowRunEndpoint extends Endpoint {
10
11
  getFlowRunSummaries(flowId: string, flowRunStatuses?: FlowRunStatus[] | null, pagination?: CursorPagination | null, projectEnvironmentId?: string | null): Promise<CollectionResult<FlowRunSummary>>;
11
12
  getFlowRunSummary(flowRunId: string): Promise<FlowRunSummary | null>;
12
13
  getFlowRunHistory(flowRunId: string): Promise<CollectionResult<FlowRunHistory>>;
14
+ /**
15
+ * Authoritative lifecycle (status derived from history, first-terminal-wins). Prefer this over
16
+ * getFlowRunSummary for control-flow decisions (e.g. the worker tombstone), since the summary
17
+ * reflects the eventually-consistent index projection which can lag the history.
18
+ */
19
+ getFlowRunLifecycle(flowRunId: string): Promise<FlowRunLifecycle | null>;
13
20
  updateFlowRun(flowRunId: string, status: FlowRunStatus, time?: Date | null): Promise<FlowRun>;
14
21
  }
@@ -1,6 +1,7 @@
1
1
  import { FlowRun } from '../Model/Flow/FlowRun.js';
2
2
  import { FlowRunSummary } from '../Model/Flow/FlowRunSummary.js';
3
3
  import { FlowRunHistory } from '../Model/Flow/FlowRunHistory.js';
4
+ import { FlowRunLifecycle } from '../Model/Flow/FlowRunLifecycle.js';
4
5
  import { QueryString } from '../Http/Data/QueryString.js';
5
6
  import { Endpoint } from './Endpoint.js';
6
7
  export class FlowRunEndpoint extends Endpoint {
@@ -62,6 +63,15 @@ export class FlowRunEndpoint extends Endpoint {
62
63
  const result = await this.requestCollection('/flowruns/' + flowRunId + '/history', FlowRunHistory.parse);
63
64
  return result;
64
65
  }
66
+ /**
67
+ * Authoritative lifecycle (status derived from history, first-terminal-wins). Prefer this over
68
+ * getFlowRunSummary for control-flow decisions (e.g. the worker tombstone), since the summary
69
+ * reflects the eventually-consistent index projection which can lag the history.
70
+ */
71
+ async getFlowRunLifecycle(flowRunId) {
72
+ const result = await this.requestObject('/flowruns/' + flowRunId + '/lifecycle', null, FlowRunLifecycle.parse);
73
+ return result.getData();
74
+ }
65
75
  async updateFlowRun(flowRunId, status, time = null) {
66
76
  if (flowRunId.length === 0) {
67
77
  throw new Error('Flow run id cannot be empty');
package/dist/index.d.ts CHANGED
@@ -118,6 +118,8 @@ export { StateAware } from './Model/StateAware.js';
118
118
  export { Flow } from './Model/Flow/Flow.js';
119
119
  export { FlowRun } from './Model/Flow/FlowRun.js';
120
120
  export { FlowRunHistory } from './Model/Flow/FlowRunHistory.js';
121
+ export { FlowRunHistoryStatus } from './Model/Flow/FlowRunHistoryStatus.js';
122
+ export { FlowRunLifecycle } from './Model/Flow/FlowRunLifecycle.js';
121
123
  export { FlowRunResponse } from './Model/Flow/FlowRunResponse.js';
122
124
  export { FlowRunStatus } from './Model/Flow/FlowRunStatus.js';
123
125
  export { FlowRunSummary } from './Model/Flow/FlowRunSummary.js';
package/dist/index.js CHANGED
@@ -106,6 +106,8 @@ export { State } from './Model/State.js';
106
106
  export { Flow } from './Model/Flow/Flow.js';
107
107
  export { FlowRun } from './Model/Flow/FlowRun.js';
108
108
  export { FlowRunHistory } from './Model/Flow/FlowRunHistory.js';
109
+ export { FlowRunHistoryStatus } from './Model/Flow/FlowRunHistoryStatus.js';
110
+ export { FlowRunLifecycle } from './Model/Flow/FlowRunLifecycle.js';
109
111
  export { FlowRunResponse } from './Model/Flow/FlowRunResponse.js';
110
112
  export { FlowRunStatus } from './Model/Flow/FlowRunStatus.js';
111
113
  export { FlowRunSummary } from './Model/Flow/FlowRunSummary.js';
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.64.0";
1
+ export declare const VERSION = "1.66.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "1.64.0";
1
+ export const VERSION = "1.66.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attlaz-client",
3
- "version": "1.64.0",
3
+ "version": "1.66.0",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",
@@ -50,12 +50,12 @@
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/jest": "^30.0.0",
53
- "@types/node": "^25.9.1",
53
+ "@types/node": "^25.9.2",
54
54
  "@typescript-eslint/eslint-plugin": "^8.59.3",
55
55
  "@typescript-eslint/parser": "^8.59.3",
56
56
  "eslint": "^9.39.4",
57
57
  "eslint-config-attlaz-base": "^1.8.0",
58
- "eslint-import-resolver-typescript": "^4.4.4",
58
+ "eslint-import-resolver-typescript": "^4.4.5",
59
59
  "eslint-plugin-import": "^2.32.0",
60
60
  "eslint-plugin-jsdoc": "^62.9.0",
61
61
  "eslint-plugin-prefer-arrow": "^1.2.3",