attlaz-client 1.65.0 → 1.67.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,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 = {}));
@@ -1,3 +1,4 @@
1
+ import { ApiRecord } from '../ApiRecord.js';
1
2
  import { FlowRunStatus } from './FlowRunStatus.js';
2
3
  /**
3
4
  * The authoritative lifecycle of a flow run, as derived server-side from its event history
@@ -11,5 +12,5 @@ export declare class FlowRunLifecycle {
11
12
  requested: Date | null;
12
13
  started: Date | null;
13
14
  ended: Date | null;
14
- static parse(rawFlowRunLifecycle: any): FlowRunLifecycle;
15
+ static parse(rawFlowRunLifecycle: ApiRecord): FlowRunLifecycle;
15
16
  }
@@ -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) => {
@@ -0,0 +1,13 @@
1
+ import { State } from '../State.js';
2
+ export type UserSummaryType = 'user' | 'system';
3
+ /**
4
+ * Display-safe view of a user (no email/PII). Resolved via UserEndpoint.getSummaries().
5
+ * `state` drives the badge (reuses the global State enum); `null` = not resolvable for this caller.
6
+ * `displayName` is always safe to show ("System", "Removed user", "Unknown user" for the edge cases).
7
+ */
8
+ export declare class UserSummary {
9
+ id: string;
10
+ type: UserSummaryType;
11
+ state: State | null;
12
+ displayName: string;
13
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Display-safe view of a user (no email/PII). Resolved via UserEndpoint.getSummaries().
3
+ * `state` drives the badge (reuses the global State enum); `null` = not resolvable for this caller.
4
+ * `displayName` is always safe to show ("System", "Removed user", "Unknown user" for the edge cases).
5
+ */
6
+ export class UserSummary {
7
+ id;
8
+ type;
9
+ state;
10
+ displayName;
11
+ }
@@ -1,5 +1,6 @@
1
1
  import { UserAuthProvider } from '../Model/User/UserAuthProvider.js';
2
2
  import { User } from '../Model/User/User.js';
3
+ import { UserSummary } from '../Model/User/UserSummary.js';
3
4
  import { CollectionResult } from '../Model/Result/CollectionResult.js';
4
5
  import { Endpoint } from './Endpoint.js';
5
6
  import { UserNotificationSession } from '../Model/User/UserNotificationSession.js';
@@ -7,6 +8,13 @@ import { CursorPagination } from '../Model/Pagination/CursorPagination.js';
7
8
  export declare class UserEndpoint extends Endpoint {
8
9
  getUser(): Promise<User | null>;
9
10
  removeAuthProvider(providerId: string): Promise<boolean>;
11
+ /**
12
+ * Resolve display-safe summaries for a set of user ids (e.g. to show "Requested by" names in a
13
+ * list). The server applies visibility rules and returns tombstones ("Unknown user" / "Removed
14
+ * user") rather than leaking anything the caller isn't allowed to see.
15
+ */
16
+ getSummaries(userIds: string[]): Promise<UserSummary[]>;
17
+ private static parseSummary;
10
18
  getAuthProviders(): Promise<CollectionResult<UserAuthProvider>>;
11
19
  getPermissions(): Promise<CollectionResult<{
12
20
  key: string;
@@ -1,5 +1,6 @@
1
1
  import { UserAuthProvider } from '../Model/User/UserAuthProvider.js';
2
2
  import { User } from '../Model/User/User.js';
3
+ import { UserSummary } from '../Model/User/UserSummary.js';
3
4
  import { Endpoint } from './Endpoint.js';
4
5
  import { UserNotificationSession } from '../Model/User/UserNotificationSession.js';
5
6
  import { QueryString } from '../Http/Data/QueryString.js';
@@ -27,6 +28,28 @@ export class UserEndpoint extends Endpoint {
27
28
  throw e;
28
29
  }
29
30
  }
31
+ /**
32
+ * Resolve display-safe summaries for a set of user ids (e.g. to show "Requested by" names in a
33
+ * list). The server applies visibility rules and returns tombstones ("Unknown user" / "Removed
34
+ * user") rather than leaking anything the caller isn't allowed to see.
35
+ */
36
+ async getSummaries(userIds) {
37
+ if (userIds.length === 0) {
38
+ return [];
39
+ }
40
+ const queryString = new QueryString('/users/summaries');
41
+ queryString.set('id', userIds);
42
+ const result = await this.requestCollection(queryString, UserEndpoint.parseSummary, null, 'GET');
43
+ return result.getData();
44
+ }
45
+ static parseSummary(raw) {
46
+ const summary = new UserSummary();
47
+ summary.id = raw.id;
48
+ summary.type = raw.type;
49
+ summary.state = (raw.state === null || raw.state === undefined) ? null : State.fromString(raw.state);
50
+ summary.displayName = raw.display_name;
51
+ return summary;
52
+ }
30
53
  async getAuthProviders() {
31
54
  const cmd = '/users/auth/providers';
32
55
  const rawAuthProviders = await this.requestCollection(cmd, UserAuthProvider.parse);
package/dist/index.d.ts CHANGED
@@ -118,6 +118,7 @@ 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';
121
122
  export { FlowRunLifecycle } from './Model/Flow/FlowRunLifecycle.js';
122
123
  export { FlowRunResponse } from './Model/Flow/FlowRunResponse.js';
123
124
  export { FlowRunStatus } from './Model/Flow/FlowRunStatus.js';
@@ -128,6 +129,8 @@ export { FlowTemplate } from './Model/Flow/FlowTemplate.js';
128
129
  export { User } from './Model/User/User.js';
129
130
  export { UserAuthProvider } from './Model/User/UserAuthProvider.js';
130
131
  export { UserAction } from './Model/User/UserAction.js';
132
+ export { UserSummary } from './Model/User/UserSummary.js';
133
+ export type { UserSummaryType } from './Model/User/UserSummary.js';
131
134
  export { RunnerImage } from './Model/Runner/RunnerImage.js';
132
135
  export { CommandExecutionHistory } from './Model/Command/CommandExecutionHistory.js';
133
136
  export { CommandExecutionStatus } from './Model/Command/CommandExecutionStatus.js';
package/dist/index.js CHANGED
@@ -106,6 +106,7 @@ 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';
109
110
  export { FlowRunLifecycle } from './Model/Flow/FlowRunLifecycle.js';
110
111
  export { FlowRunResponse } from './Model/Flow/FlowRunResponse.js';
111
112
  export { FlowRunStatus } from './Model/Flow/FlowRunStatus.js';
@@ -116,6 +117,7 @@ export { FlowTemplate } from './Model/Flow/FlowTemplate.js';
116
117
  export { User } from './Model/User/User.js';
117
118
  export { UserAuthProvider } from './Model/User/UserAuthProvider.js';
118
119
  export { UserAction } from './Model/User/UserAction.js';
120
+ export { UserSummary } from './Model/User/UserSummary.js';
119
121
  export { RunnerImage } from './Model/Runner/RunnerImage.js';
120
122
  export { CommandExecutionHistory } from './Model/Command/CommandExecutionHistory.js';
121
123
  export { CommandExecutionStatus } from './Model/Command/CommandExecutionStatus.js';
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.65.0";
1
+ export declare const VERSION = "1.66.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "1.65.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.65.0",
3
+ "version": "1.67.0",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",
@@ -50,7 +50,7 @@
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",