@taico/events 0.2.9 → 0.2.11
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.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/types/worker-events.d.ts +42 -0
- package/dist/types/worker-events.js +17 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Worker Wire Event Types for WebSocket Communication
|
|
3
|
+
*
|
|
4
|
+
* These types define the structure of events sent between backend and frontend
|
|
5
|
+
* via WebSocket for the Workers domain. They serve as a contract between the
|
|
6
|
+
* backend gateway and frontend consumers.
|
|
7
|
+
*
|
|
8
|
+
* Import these types in both backend (for emission) and frontend (for reception)
|
|
9
|
+
* to ensure type safety across the wire protocol.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Wire event names for Workers domain
|
|
13
|
+
* These are the stable, external event identifiers sent over the wire protocol.
|
|
14
|
+
*/
|
|
15
|
+
export declare const WorkerWireEvents: {
|
|
16
|
+
readonly WORKER_SEEN: "worker.seen";
|
|
17
|
+
};
|
|
18
|
+
export type WorkerWireEventName = (typeof WorkerWireEvents)[keyof typeof WorkerWireEvents];
|
|
19
|
+
/**
|
|
20
|
+
* Worker structure as sent over the wire
|
|
21
|
+
* Matches WorkerResponseDto from backend
|
|
22
|
+
*/
|
|
23
|
+
export interface WorkerWirePayload {
|
|
24
|
+
id: string;
|
|
25
|
+
oauthClientId: string;
|
|
26
|
+
lastSeenAt: string;
|
|
27
|
+
harnesses: string[];
|
|
28
|
+
createdAt: string;
|
|
29
|
+
updatedAt: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Worker seen event
|
|
33
|
+
* Emitted when a worker is seen (connects, sends heartbeat, or executes)
|
|
34
|
+
*/
|
|
35
|
+
export interface WorkerSeenWireEvent {
|
|
36
|
+
worker: WorkerWirePayload;
|
|
37
|
+
occurredAt: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Union type of all worker wire events
|
|
41
|
+
*/
|
|
42
|
+
export type WorkerWireEvent = WorkerSeenWireEvent;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Worker Wire Event Types for WebSocket Communication
|
|
3
|
+
*
|
|
4
|
+
* These types define the structure of events sent between backend and frontend
|
|
5
|
+
* via WebSocket for the Workers domain. They serve as a contract between the
|
|
6
|
+
* backend gateway and frontend consumers.
|
|
7
|
+
*
|
|
8
|
+
* Import these types in both backend (for emission) and frontend (for reception)
|
|
9
|
+
* to ensure type safety across the wire protocol.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Wire event names for Workers domain
|
|
13
|
+
* These are the stable, external event identifiers sent over the wire protocol.
|
|
14
|
+
*/
|
|
15
|
+
export const WorkerWireEvents = {
|
|
16
|
+
WORKER_SEEN: 'worker.seen',
|
|
17
|
+
};
|