@prefecthq/prefect-ui-library 3.11.15 → 3.11.17

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,4 +1,11 @@
1
1
  import { WorkPoolWorkerStatus } from '../models/WorkPoolWorkerStatus';
2
+ type Integration = {
3
+ name: string;
4
+ version: string;
5
+ };
6
+ type Metadata = Record<string, unknown> & {
7
+ integrations?: Integration[];
8
+ };
2
9
  export interface IWorkPoolWorker {
3
10
  readonly id: string;
4
11
  created: Date;
@@ -7,7 +14,9 @@ export interface IWorkPoolWorker {
7
14
  workPoolId: string;
8
15
  lastHeartbeatTime: Date;
9
16
  status: WorkPoolWorkerStatus;
17
+ heartbeatIntervalSeconds: number;
10
18
  clientVersion: string | null;
19
+ metadata: Metadata | null;
11
20
  }
12
21
  export declare class WorkPoolWorker implements IWorkPoolWorker {
13
22
  readonly id: string;
@@ -18,7 +27,9 @@ export declare class WorkPoolWorker implements IWorkPoolWorker {
18
27
  workPoolId: string;
19
28
  lastHeartbeatTime: Date;
20
29
  status: WorkPoolWorkerStatus;
30
+ heartbeatIntervalSeconds: number;
21
31
  clientVersion: string | null;
32
+ metadata: Record<string, unknown> | null;
22
33
  constructor(workPoolWorker: IWorkPoolWorker);
23
34
  }
24
35
  export type PaginatedWorkPoolWorkers = {
@@ -28,3 +39,4 @@ export type PaginatedWorkPoolWorkers = {
28
39
  page: number;
29
40
  pages: number;
30
41
  };
42
+ export {};
@@ -9,6 +9,8 @@ export type WorkPoolWorkerResponse = {
9
9
  last_heartbeat_time: DateString;
10
10
  status: ServerWorkPoolWorkerStatus;
11
11
  client_version?: string | null;
12
+ heartbeat_interval_seconds: number;
13
+ metadata_: Record<string, unknown> | null;
12
14
  };
13
15
  export type WorkPoolWorkerPaginationResponse = {
14
16
  results: WorkPoolWorkerResponse[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prefecthq/prefect-ui-library",
3
- "version": "3.11.15",
3
+ "version": "3.11.17",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,6 +12,8 @@ export const mapWorkPoolWorkerResponseToWorkPoolWorker: MapFunction<WorkPoolWork
12
12
  lastHeartbeatTime: this.map('string', source.last_heartbeat_time, 'Date'),
13
13
  status: this.map('ServerWorkPoolWorkerStatus', source.status, 'WorkPoolWorkerStatus'),
14
14
  clientVersion: source.client_version ? source.client_version : null,
15
+ heartbeatIntervalSeconds: source.heartbeat_interval_seconds,
16
+ metadata: source.metadata_ ? source.metadata_ : null,
15
17
  })
16
18
  }
17
19
 
@@ -11,6 +11,8 @@ export const randomWorker: MockFunction<WorkPoolWorker, [Partial<WorkPoolWorker>
11
11
  lastHeartbeatTime: this.create('date'),
12
12
  status: this.create('workerStatus'),
13
13
  clientVersion: this.create('string'),
14
+ metadata: { 'integrations': [this.create('string'), this.create('string')] },
15
+ heartbeatIntervalSeconds: this.create('number'),
14
16
  ...overrides,
15
17
  })
16
18
  }
@@ -1,5 +1,8 @@
1
1
  import { WorkPoolWorkerStatus } from '@/models/WorkPoolWorkerStatus'
2
2
 
3
+ type Integration = { name: string, version: string }
4
+ type Metadata = Record<string, unknown> & { integrations?: Integration[] }
5
+
3
6
  export interface IWorkPoolWorker {
4
7
  readonly id: string,
5
8
  created: Date,
@@ -8,7 +11,9 @@ export interface IWorkPoolWorker {
8
11
  workPoolId: string,
9
12
  lastHeartbeatTime: Date,
10
13
  status: WorkPoolWorkerStatus,
14
+ heartbeatIntervalSeconds: number,
11
15
  clientVersion: string | null,
16
+ metadata: Metadata | null,
12
17
  }
13
18
 
14
19
  export class WorkPoolWorker implements IWorkPoolWorker {
@@ -20,7 +25,9 @@ export class WorkPoolWorker implements IWorkPoolWorker {
20
25
  public workPoolId: string
21
26
  public lastHeartbeatTime: Date
22
27
  public status: WorkPoolWorkerStatus
28
+ public heartbeatIntervalSeconds: number
23
29
  public clientVersion: string | null
30
+ public metadata: Record<string, unknown> | null
24
31
 
25
32
  public constructor(workPoolWorker: IWorkPoolWorker) {
26
33
  this.id = workPoolWorker.id
@@ -30,7 +37,9 @@ export class WorkPoolWorker implements IWorkPoolWorker {
30
37
  this.workPoolId = workPoolWorker.workPoolId
31
38
  this.lastHeartbeatTime = workPoolWorker.lastHeartbeatTime
32
39
  this.status = workPoolWorker.status
40
+ this.heartbeatIntervalSeconds = workPoolWorker.heartbeatIntervalSeconds
33
41
  this.clientVersion = workPoolWorker.clientVersion
42
+ this.metadata = workPoolWorker.metadata
34
43
  }
35
44
  }
36
45
 
@@ -11,6 +11,8 @@ export type WorkPoolWorkerResponse = {
11
11
  last_heartbeat_time: DateString,
12
12
  status: ServerWorkPoolWorkerStatus,
13
13
  client_version?: string | null,
14
+ heartbeat_interval_seconds: number,
15
+ metadata_: Record<string, unknown> | null,
14
16
  }
15
17
 
16
18
  export type WorkPoolWorkerPaginationResponse = {