@attlaz/client 1.77.1 → 1.79.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,3 +1,4 @@
1
+ import { DataValueCollection } from '../DataValueCollection.js';
1
2
  import { StateAware } from '../StateAware.js';
2
3
  import { State } from '../State.js';
3
4
  export declare class CodeSourceRunStrategy implements StateAware {
@@ -6,5 +7,6 @@ export declare class CodeSourceRunStrategy implements StateAware {
6
7
  description: string;
7
8
  languageId: string;
8
9
  state: State;
10
+ data: DataValueCollection;
9
11
  static parse(raw: any): CodeSourceRunStrategy;
10
12
  }
@@ -1,3 +1,4 @@
1
+ import { DataValueCollection } from '../DataValueCollection.js';
1
2
  import { State } from '../State.js';
2
3
  export class CodeSourceRunStrategy {
3
4
  id;
@@ -5,6 +6,10 @@ export class CodeSourceRunStrategy {
5
6
  description;
6
7
  languageId;
7
8
  state = State.Active;
9
+ // The strategy's parameter bag. Today it holds `command`; a future non-shell strategy might hold
10
+ // `endpoint`/`port`/etc. Kept as the whole bag so new keys need no model change. Read with
11
+ // `data.get('command')`.
12
+ data = new DataValueCollection();
8
13
  static parse(raw) {
9
14
  const runStrategy = new CodeSourceRunStrategy();
10
15
  runStrategy.id = raw.id;
@@ -12,6 +17,7 @@ export class CodeSourceRunStrategy {
12
17
  runStrategy.description = raw.description;
13
18
  runStrategy.languageId = raw.language;
14
19
  runStrategy.state = State.fromString(raw.state);
20
+ runStrategy.data = DataValueCollection.fromObject(raw.data);
15
21
  return runStrategy;
16
22
  }
17
23
  }
@@ -10,6 +10,13 @@ export declare class FlowRunEndpoint extends Endpoint {
10
10
  getFlowRuns(flowId: string): Promise<CollectionResult<FlowRun>>;
11
11
  getFlowRunSummaries(flowId: string, flowRunStatuses?: FlowRunStatus[] | null, pagination?: CursorPagination | null, projectEnvironmentId?: string | null): Promise<CollectionResult<FlowRunSummary>>;
12
12
  getFlowRunSummary(flowRunId: string): Promise<FlowRunSummary | null>;
13
+ /**
14
+ * Fetch a single flow run by id, including its `arguments` and `logStreamId`. Uses the same
15
+ * endpoint as {@link getFlowRunSummary} but parses the full {@link FlowRun} (the summary model
16
+ * only carries execution stats). Used by the flow-run runtime to resolve the real arguments
17
+ * and the log stream to write to.
18
+ */
19
+ getFlowRun(flowRunId: string): Promise<FlowRun | null>;
13
20
  getFlowRunHistory(flowRunId: string): Promise<CollectionResult<FlowRunHistory>>;
14
21
  /**
15
22
  * Authoritative lifecycle (status derived from history, first-terminal-wins). Prefer this over
@@ -59,6 +59,24 @@ export class FlowRunEndpoint extends Endpoint {
59
59
  throw error;
60
60
  }
61
61
  }
62
+ /**
63
+ * Fetch a single flow run by id, including its `arguments` and `logStreamId`. Uses the same
64
+ * endpoint as {@link getFlowRunSummary} but parses the full {@link FlowRun} (the summary model
65
+ * only carries execution stats). Used by the flow-run runtime to resolve the real arguments
66
+ * and the log stream to write to.
67
+ */
68
+ async getFlowRun(flowRunId) {
69
+ try {
70
+ const result = await this.requestObject('/flowruns/' + flowRunId + '/summaries', null, FlowRun.parse);
71
+ return result.getData();
72
+ }
73
+ catch (error) {
74
+ if (this.httpClient.isDebugEnabled()) {
75
+ console.error('Failed to load flow run: ' + error);
76
+ }
77
+ throw error;
78
+ }
79
+ }
62
80
  async getFlowRunHistory(flowRunId) {
63
81
  const result = await this.requestCollection('/flowruns/' + flowRunId + '/history', FlowRunHistory.parse);
64
82
  return result;
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.77.0";
1
+ export declare const VERSION = "1.79.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "1.77.0";
1
+ export const VERSION = "1.79.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@attlaz/client",
3
- "version": "1.77.1",
3
+ "version": "1.79.0",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",