@fatagnus/dink-sdk 2.6.0 → 2.7.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.
- package/dist/index.d.ts +5 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -5
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +124 -64
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +22 -1
- package/dist/types.js.map +1 -1
- package/package.json +5 -1
- package/dist/generated/index.d.ts +0 -8
- package/dist/generated/index.d.ts.map +0 -1
- package/dist/generated/index.js +0 -7
- package/dist/generated/index.js.map +0 -1
- package/dist/generated/jobservice.client.d.ts +0 -19
- package/dist/generated/jobservice.client.d.ts.map +0 -1
- package/dist/generated/jobservice.client.js +0 -39
- package/dist/generated/jobservice.client.js.map +0 -1
- package/dist/generated/jobservice.handler.d.ts +0 -21
- package/dist/generated/jobservice.handler.d.ts.map +0 -1
- package/dist/generated/jobservice.handler.js +0 -62
- package/dist/generated/jobservice.handler.js.map +0 -1
- package/dist/generated/sensorservice.client.d.ts +0 -17
- package/dist/generated/sensorservice.client.d.ts.map +0 -1
- package/dist/generated/sensorservice.client.js +0 -31
- package/dist/generated/sensorservice.client.js.map +0 -1
- package/dist/generated/sensorservice.handler.d.ts +0 -17
- package/dist/generated/sensorservice.handler.d.ts.map +0 -1
- package/dist/generated/sensorservice.handler.js +0 -53
- package/dist/generated/sensorservice.handler.js.map +0 -1
- package/dist/generated/types.d.ts +0 -99
- package/dist/generated/types.d.ts.map +0 -1
- package/dist/generated/types.js +0 -12
- package/dist/generated/types.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export {
|
|
5
|
-
export { CenterClient } from './center/
|
|
6
|
-
export type { ConnectionQuality, ConnectionQualityLevel, ConnectionQualityConfig, ConnectionState, } from './types.js';
|
|
1
|
+
export type { ServiceDefinition, ServiceHandler, ServiceCaller, Subscription, } from './types.js';
|
|
2
|
+
export { extractPayload, wrapResponse } from './types.js';
|
|
3
|
+
export { EdgeClient } from './edge/index.js';
|
|
4
|
+
export { ServiceBuilder } from './edge/service-builder.js';
|
|
5
|
+
export { CenterClient } from './center/index.js';
|
|
7
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,YAAY,EACV,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,YAAY,GACb,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG1D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAG3D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
|
|
1
|
+
// @fatagnus/dink-sdk - TypeScript SDK for Dink edge mesh platform
|
|
2
|
+
// This package provides base types and clients for building edge services.
|
|
3
|
+
// Export helper functions
|
|
4
|
+
export { extractPayload, wrapResponse } from './types.js';
|
|
5
|
+
// Export edge client for connecting edge devices to dinkd
|
|
6
|
+
export { EdgeClient } from './edge/index.js';
|
|
7
|
+
export { ServiceBuilder } from './edge/service-builder.js';
|
|
8
|
+
// Export center client for connecting to dinkd from the center/cloud
|
|
9
|
+
export { CenterClient } from './center/index.js';
|
|
6
10
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,2EAA2E;AAU3E,0BAA0B;AAC1B,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1D,0DAA0D;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,qEAAqE;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,101 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Service definition metadata
|
|
3
|
+
*/
|
|
4
|
+
export interface ServiceDefinition {
|
|
5
|
+
name: string;
|
|
6
|
+
version: string;
|
|
7
|
+
methods: string[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Interface for implementing a service handler on the edge
|
|
11
|
+
*/
|
|
12
|
+
export interface ServiceHandler {
|
|
13
|
+
definition(): ServiceDefinition;
|
|
14
|
+
handleRequest(method: string, data: Uint8Array): Promise<Uint8Array>;
|
|
15
|
+
handleStream?(method: string, data: Uint8Array, emit: (data: Uint8Array) => Promise<void>): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Interface for making RPC calls to edge services
|
|
19
|
+
*/
|
|
20
|
+
export interface ServiceCaller {
|
|
21
|
+
call<Req, Resp>(edgeId: string, service: string, method: string, req: Req): Promise<Resp>;
|
|
22
|
+
subscribe<Req, Resp>(edgeId: string, service: string, method: string, req: Req, handler: (resp: Resp) => void): Promise<Subscription>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Interface for streaming subscriptions
|
|
26
|
+
*/
|
|
27
|
+
export interface Subscription {
|
|
28
|
+
unsubscribe(): void;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Helper to extract payload from dinkd request format.
|
|
32
|
+
* dinkd sends: { payload: {...}, metadata: {...} }
|
|
33
|
+
*/
|
|
34
|
+
export declare function extractPayload<T>(req: unknown): T;
|
|
35
|
+
/**
|
|
36
|
+
* Helper to wrap response in dinkd expected format.
|
|
37
|
+
* dinkd expects: { result: {...}, success: true }
|
|
38
|
+
*/
|
|
39
|
+
export declare function wrapResponse<T>(resp: T): {
|
|
40
|
+
result: T;
|
|
41
|
+
success: boolean;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Connection quality level
|
|
45
|
+
*/
|
|
46
|
+
export type ConnectionQualityLevel = 'excellent' | 'good' | 'fair' | 'poor' | 'unknown';
|
|
47
|
+
/**
|
|
48
|
+
* Connection state
|
|
49
|
+
*/
|
|
50
|
+
export type ConnectionState = 'connecting' | 'connected' | 'reconnecting' | 'disconnected';
|
|
51
|
+
/**
|
|
52
|
+
* Connection quality metrics
|
|
53
|
+
*/
|
|
54
|
+
export interface ConnectionQuality {
|
|
55
|
+
state: ConnectionState;
|
|
56
|
+
latencyMs: number | null;
|
|
57
|
+
avgLatencyMs: number | null;
|
|
58
|
+
messagesSentPerSecond: number;
|
|
59
|
+
messagesReceivedPerSecond: number;
|
|
60
|
+
totalMessagesSent: number;
|
|
61
|
+
totalMessagesReceived: number;
|
|
62
|
+
lastPingAt: number | null;
|
|
63
|
+
qualityLevel: ConnectionQualityLevel;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Configuration for connection quality monitoring
|
|
67
|
+
*/
|
|
68
|
+
export interface ConnectionQualityConfig {
|
|
69
|
+
/** Latency threshold for "excellent" quality in ms (default: 50) */
|
|
70
|
+
excellentLatencyMs?: number;
|
|
71
|
+
/** Latency threshold for "good" quality in ms (default: 150) */
|
|
72
|
+
goodLatencyMs?: number;
|
|
73
|
+
/** Latency threshold for "fair" quality in ms (default: 300) */
|
|
74
|
+
fairLatencyMs?: number;
|
|
75
|
+
/** Ping interval in milliseconds (default: 30000) */
|
|
76
|
+
pingIntervalMs?: number;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Configuration for EdgeClient
|
|
80
|
+
*/
|
|
1
81
|
export interface EdgeConfig {
|
|
2
|
-
|
|
82
|
+
/** Edge API key (required, format: dk_<env>_ed_<appID>_<edgeID>_<random>) */
|
|
3
83
|
apiKey: string;
|
|
84
|
+
/** dinkd server URL (e.g., "nats://localhost:4222") */
|
|
85
|
+
serverUrl: string;
|
|
86
|
+
/** Optional display name for the edge */
|
|
4
87
|
edgeName?: string;
|
|
88
|
+
/** Optional labels for edge discovery */
|
|
5
89
|
labels?: Record<string, string>;
|
|
90
|
+
/** Optional version string */
|
|
6
91
|
version?: string;
|
|
92
|
+
/** Optional hostname (auto-detected in Node.js) */
|
|
7
93
|
hostname?: string;
|
|
94
|
+
/** Optional IP address */
|
|
8
95
|
ipAddress?: string;
|
|
96
|
+
/** Heartbeat interval in ms (default: 30000) */
|
|
9
97
|
heartbeatInterval?: number;
|
|
98
|
+
/** Reconnect wait time in ms (default: 2000) */
|
|
10
99
|
reconnectWait?: number;
|
|
100
|
+
/** Max reconnect attempts, -1 for infinite (default: -1) */
|
|
11
101
|
maxReconnects?: number;
|
|
102
|
+
/** Connection quality configuration */
|
|
103
|
+
qualityConfig?: ConnectionQualityConfig;
|
|
12
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* Configuration for CenterClient
|
|
107
|
+
*/
|
|
13
108
|
export interface CenterConfig {
|
|
109
|
+
/** dinkd server URL (e.g., "nats://localhost:4222") */
|
|
14
110
|
serverUrl: string;
|
|
111
|
+
/** App API key for authentication */
|
|
15
112
|
apiKey?: string;
|
|
113
|
+
/** App ID (optional, defaults to 'platform') */
|
|
16
114
|
appId?: string;
|
|
115
|
+
/** Request timeout in ms (default: 30000) */
|
|
17
116
|
timeout?: number;
|
|
117
|
+
/** Reconnect wait time in ms (default: 2000) */
|
|
18
118
|
reconnectWait?: number;
|
|
119
|
+
/** Max reconnect attempts, -1 for infinite (default: -1) */
|
|
19
120
|
maxReconnects?: number;
|
|
121
|
+
/** Connection quality configuration */
|
|
122
|
+
qualityConfig?: ConnectionQualityConfig;
|
|
20
123
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
methods: string[];
|
|
25
|
-
}
|
|
26
|
-
export interface ServiceHandler {
|
|
27
|
-
definition(): ServiceDefinition;
|
|
28
|
-
handleRequest(method: string, data: Uint8Array): Promise<Uint8Array>;
|
|
29
|
-
handleStream?(method: string, data: Uint8Array, emit: (data: Uint8Array) => Promise<void>): Promise<void>;
|
|
30
|
-
}
|
|
31
|
-
export interface ServiceCaller {
|
|
32
|
-
call<Req, Resp>(edgeId: string, service: string, method: string, req: Req): Promise<Resp>;
|
|
33
|
-
subscribe<Req, Resp>(edgeId: string, service: string, method: string, req: Req, handler: (resp: Resp) => void): Promise<Subscription>;
|
|
34
|
-
}
|
|
35
|
-
export interface Subscription {
|
|
36
|
-
unsubscribe(): void;
|
|
37
|
-
}
|
|
124
|
+
/**
|
|
125
|
+
* Information about a discovered edge
|
|
126
|
+
*/
|
|
38
127
|
export interface EdgeInfo {
|
|
128
|
+
/** Unique edge identifier */
|
|
39
129
|
id: string;
|
|
130
|
+
/** Display name of the edge */
|
|
40
131
|
name: string;
|
|
132
|
+
/** Online status */
|
|
41
133
|
status: 'online' | 'offline';
|
|
134
|
+
/** Labels attached to the edge */
|
|
42
135
|
labels: Record<string, string>;
|
|
136
|
+
/** Services exposed by this edge */
|
|
43
137
|
services: string[];
|
|
44
|
-
lastSeen?: Date;
|
|
45
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* Options for discovering edges
|
|
141
|
+
*/
|
|
46
142
|
export interface DiscoverOptions {
|
|
143
|
+
/** Filter by service name */
|
|
47
144
|
serviceName?: string;
|
|
145
|
+
/** Filter by labels */
|
|
48
146
|
labels?: Record<string, string>;
|
|
147
|
+
/** Only return online edges (default: true) */
|
|
49
148
|
onlineOnly?: boolean;
|
|
50
149
|
}
|
|
150
|
+
/**
|
|
151
|
+
* Options for RPC calls
|
|
152
|
+
*/
|
|
51
153
|
export interface CallOptions {
|
|
154
|
+
/** Request timeout in ms */
|
|
52
155
|
timeout?: number;
|
|
156
|
+
/** Number of retries on failure (default: 0) */
|
|
53
157
|
retries?: number;
|
|
158
|
+
/** Delay between retries in ms (default: 1000) */
|
|
54
159
|
retryDelay?: number;
|
|
55
160
|
}
|
|
56
|
-
/**
|
|
57
|
-
* Quality level for connection health assessment.
|
|
58
|
-
*/
|
|
59
|
-
export type ConnectionQualityLevel = 'excellent' | 'good' | 'fair' | 'poor' | 'unknown';
|
|
60
|
-
/**
|
|
61
|
-
* Connection state for edge/center clients.
|
|
62
|
-
*/
|
|
63
|
-
export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting';
|
|
64
|
-
/**
|
|
65
|
-
* Connection quality metrics.
|
|
66
|
-
* Provides real-time information about the health and performance of the connection.
|
|
67
|
-
*/
|
|
68
|
-
export interface ConnectionQuality {
|
|
69
|
-
/** Current connection state */
|
|
70
|
-
readonly state: ConnectionState;
|
|
71
|
-
/** Round-trip latency in milliseconds (from last ping, or null if never measured) */
|
|
72
|
-
readonly latencyMs: number | null;
|
|
73
|
-
/** Average latency over the measurement window in milliseconds */
|
|
74
|
-
readonly avgLatencyMs: number | null;
|
|
75
|
-
/** Messages sent per second */
|
|
76
|
-
readonly messagesSentPerSecond: number;
|
|
77
|
-
/** Messages received per second */
|
|
78
|
-
readonly messagesReceivedPerSecond: number;
|
|
79
|
-
/** Total messages sent since connection started */
|
|
80
|
-
readonly totalMessagesSent: number;
|
|
81
|
-
/** Total messages received since connection started */
|
|
82
|
-
readonly totalMessagesReceived: number;
|
|
83
|
-
/** Timestamp of last successful ping */
|
|
84
|
-
readonly lastPingAt: number | null;
|
|
85
|
-
/** Quality assessment based on latency thresholds */
|
|
86
|
-
readonly qualityLevel: ConnectionQualityLevel;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Configuration for connection quality monitoring.
|
|
90
|
-
*/
|
|
91
|
-
export interface ConnectionQualityConfig {
|
|
92
|
-
/** Interval in ms between automatic ping measurements (default: 30000, 0 to disable) */
|
|
93
|
-
readonly pingIntervalMs?: number;
|
|
94
|
-
/** Latency threshold in ms for 'excellent' quality (default: 50) */
|
|
95
|
-
readonly excellentLatencyMs?: number;
|
|
96
|
-
/** Latency threshold in ms for 'good' quality (default: 150) */
|
|
97
|
-
readonly goodLatencyMs?: number;
|
|
98
|
-
/** Latency threshold in ms for 'fair' quality (default: 300) */
|
|
99
|
-
readonly fairLatencyMs?: number;
|
|
100
|
-
}
|
|
101
161
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,UAAU,IAAI,iBAAiB,CAAC;IAChC,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACrE,YAAY,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3G;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,GAAG,EAAE,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C;IACvC,aAAa,CAAC,EAAE,uBAAuB,CAAC;CACzC;AAMD;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,6BAA6B;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB;IACpB,MAAM,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC7B,kCAAkC;IAClC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,oCAAoC;IACpC,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,6BAA6B;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uBAAuB;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,+CAA+C;IAC/C,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,4BAA4B;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
package/dist/types.js
CHANGED
|
@@ -1,2 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
// @fatagnus/dink-sdk - Core TypeScript SDK types for dink Edge RPC
|
|
2
|
+
// This file contains base types used by both edge and center clients
|
|
3
|
+
// ============================
|
|
4
|
+
// Helper Functions
|
|
5
|
+
// ============================
|
|
6
|
+
/**
|
|
7
|
+
* Helper to extract payload from dinkd request format.
|
|
8
|
+
* dinkd sends: { payload: {...}, metadata: {...} }
|
|
9
|
+
*/
|
|
10
|
+
export function extractPayload(req) {
|
|
11
|
+
if (req && typeof req === 'object' && 'payload' in req) {
|
|
12
|
+
return (req.payload || {});
|
|
13
|
+
}
|
|
14
|
+
return req;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Helper to wrap response in dinkd expected format.
|
|
18
|
+
* dinkd expects: { result: {...}, success: true }
|
|
19
|
+
*/
|
|
20
|
+
export function wrapResponse(resp) {
|
|
21
|
+
return { result: resp, success: true };
|
|
22
|
+
}
|
|
2
23
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,qEAAqE;AA6CrE,+BAA+B;AAC/B,mBAAmB;AACnB,+BAA+B;AAE/B;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAI,GAAY;IAC5C,IAAI,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,SAAS,IAAI,GAAG,EAAE,CAAC;QACvD,OAAO,CAAE,GAA4B,CAAC,OAAO,IAAI,EAAE,CAAM,CAAC;IAC5D,CAAC;IACD,OAAO,GAAQ,CAAC;AAClB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAI,IAAO;IACrC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACzC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fatagnus/dink-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "TypeScript SDK for Dink edge mesh platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
11
|
"import": "./dist/index.js"
|
|
12
12
|
},
|
|
13
|
+
"./types": {
|
|
14
|
+
"types": "./dist/types.d.ts",
|
|
15
|
+
"import": "./dist/types.js"
|
|
16
|
+
},
|
|
13
17
|
"./edge": {
|
|
14
18
|
"types": "./dist/edge/index.d.ts",
|
|
15
19
|
"import": "./dist/edge/index.js"
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from './types.js';
|
|
2
|
-
export { JobServiceClient, JobServiceDefinition } from './jobservice.client.js';
|
|
3
|
-
export { JobServiceHandler } from './jobservice.handler.js';
|
|
4
|
-
export type { JobServiceServer } from './jobservice.handler.js';
|
|
5
|
-
export { SensorServiceClient, SensorServiceDefinition } from './sensorservice.client.js';
|
|
6
|
-
export { SensorServiceHandler } from './sensorservice.handler.js';
|
|
7
|
-
export type { SensorServiceServer } from './sensorservice.handler.js';
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/generated/index.ts"],"names":[],"mappings":"AAEA,cAAc,YAAY,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,YAAY,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC"}
|
package/dist/generated/index.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// Code generated by dink codegen. DO NOT EDIT.
|
|
2
|
-
export * from './types.js';
|
|
3
|
-
export { JobServiceClient, JobServiceDefinition } from './jobservice.client.js';
|
|
4
|
-
export { JobServiceHandler } from './jobservice.handler.js';
|
|
5
|
-
export { SensorServiceClient, SensorServiceDefinition } from './sensorservice.client.js';
|
|
6
|
-
export { SensorServiceHandler } from './sensorservice.handler.js';
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/generated/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAE/C,cAAc,YAAY,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAG5D,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { ServiceCaller, Subscription } from '../types.js';
|
|
2
|
-
import type { JobStartRequest, JobStartResponse, JobStatusRequest, JobStatusResponse, JobCancelRequest, JobCancelResponse, JobLogsRequest, JobLogLine, JobProgressRequest, JobProgress } from './types.js';
|
|
3
|
-
export declare class JobServiceClient {
|
|
4
|
-
private edgeId;
|
|
5
|
-
private caller;
|
|
6
|
-
constructor(edgeId: string, caller: ServiceCaller);
|
|
7
|
-
getEdgeId(): string;
|
|
8
|
-
Start(req: JobStartRequest): Promise<JobStartResponse>;
|
|
9
|
-
Status(req: JobStatusRequest): Promise<JobStatusResponse>;
|
|
10
|
-
Cancel(req: JobCancelRequest): Promise<JobCancelResponse>;
|
|
11
|
-
StreamLogs(req: JobLogsRequest, handler: (resp: JobLogLine) => void): Promise<Subscription>;
|
|
12
|
-
StreamProgress(req: JobProgressRequest, handler: (resp: JobProgress) => void): Promise<Subscription>;
|
|
13
|
-
}
|
|
14
|
-
export declare const JobServiceDefinition: {
|
|
15
|
-
name: string;
|
|
16
|
-
version: string;
|
|
17
|
-
methods: string[];
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=jobservice.client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jobservice.client.d.ts","sourceRoot":"","sources":["../../src/generated/jobservice.client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,cAAc,EAAE,UAAU,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE3M,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,MAAM,CAAgB;gBAElB,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa;IAKjD,SAAS,IAAI,MAAM;IAKb,KAAK,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAUtD,MAAM,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAUzD,MAAM,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAUzD,UAAU,CAAC,GAAG,EAAE,cAAc,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC;IAW3F,cAAc,CAAC,GAAG,EAAE,kBAAkB,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC;CAW3G;AAED,eAAO,MAAM,oBAAoB;;;;CAUhC,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// Code generated by dink codegen. DO NOT EDIT.
|
|
2
|
-
export class JobServiceClient {
|
|
3
|
-
edgeId;
|
|
4
|
-
caller;
|
|
5
|
-
constructor(edgeId, caller) {
|
|
6
|
-
this.edgeId = edgeId;
|
|
7
|
-
this.caller = caller;
|
|
8
|
-
}
|
|
9
|
-
getEdgeId() {
|
|
10
|
-
return this.edgeId;
|
|
11
|
-
}
|
|
12
|
-
async Start(req) {
|
|
13
|
-
return this.caller.call(this.edgeId, 'JobService', 'Start', req);
|
|
14
|
-
}
|
|
15
|
-
async Status(req) {
|
|
16
|
-
return this.caller.call(this.edgeId, 'JobService', 'Status', req);
|
|
17
|
-
}
|
|
18
|
-
async Cancel(req) {
|
|
19
|
-
return this.caller.call(this.edgeId, 'JobService', 'Cancel', req);
|
|
20
|
-
}
|
|
21
|
-
async StreamLogs(req, handler) {
|
|
22
|
-
return this.caller.subscribe(this.edgeId, 'JobService', 'StreamLogs', req, handler);
|
|
23
|
-
}
|
|
24
|
-
async StreamProgress(req, handler) {
|
|
25
|
-
return this.caller.subscribe(this.edgeId, 'JobService', 'StreamProgress', req, handler);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
export const JobServiceDefinition = {
|
|
29
|
-
name: 'JobService',
|
|
30
|
-
version: '1.0.0',
|
|
31
|
-
methods: [
|
|
32
|
-
'Start',
|
|
33
|
-
'Status',
|
|
34
|
-
'Cancel',
|
|
35
|
-
'StreamLogs',
|
|
36
|
-
'StreamProgress',
|
|
37
|
-
],
|
|
38
|
-
};
|
|
39
|
-
//# sourceMappingURL=jobservice.client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jobservice.client.js","sourceRoot":"","sources":["../../src/generated/jobservice.client.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAK/C,MAAM,OAAO,gBAAgB;IACnB,MAAM,CAAS;IACf,MAAM,CAAgB;IAE9B,YAAY,MAAc,EAAE,MAAqB;QAC/C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAGD,KAAK,CAAC,KAAK,CAAC,GAAoB;QAC9B,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CACrB,IAAI,CAAC,MAAM,EACX,YAAY,EACZ,OAAO,EACP,GAAG,CACJ,CAAC;IACJ,CAAC;IAGD,KAAK,CAAC,MAAM,CAAC,GAAqB;QAChC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CACrB,IAAI,CAAC,MAAM,EACX,YAAY,EACZ,QAAQ,EACR,GAAG,CACJ,CAAC;IACJ,CAAC;IAGD,KAAK,CAAC,MAAM,CAAC,GAAqB;QAChC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CACrB,IAAI,CAAC,MAAM,EACX,YAAY,EACZ,QAAQ,EACR,GAAG,CACJ,CAAC;IACJ,CAAC;IAGD,KAAK,CAAC,UAAU,CAAC,GAAmB,EAAE,OAAmC;QACvE,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAC1B,IAAI,CAAC,MAAM,EACX,YAAY,EACZ,YAAY,EACZ,GAAG,EACH,OAAO,CACR,CAAC;IACJ,CAAC;IAGD,KAAK,CAAC,cAAc,CAAC,GAAuB,EAAE,OAAoC;QAChF,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAC1B,IAAI,CAAC,MAAM,EACX,YAAY,EACZ,gBAAgB,EAChB,GAAG,EACH,OAAO,CACR,CAAC;IACJ,CAAC;CAGF;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,IAAI,EAAE,YAAY;IAClB,OAAO,EAAE,OAAO;IAChB,OAAO,EAAE;QACP,OAAO;QACP,QAAQ;QACR,QAAQ;QACR,YAAY;QACZ,gBAAgB;KACjB;CACF,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { ServiceHandler, ServiceDefinition } from '../types.js';
|
|
2
|
-
import type { JobStartRequest, JobStartResponse, JobStatusRequest, JobStatusResponse, JobCancelRequest, JobCancelResponse, JobLogsRequest, JobLogLine, JobProgressRequest, JobProgress } from './types.js';
|
|
3
|
-
export interface JobServiceServer {
|
|
4
|
-
Start(req: JobStartRequest): Promise<JobStartResponse>;
|
|
5
|
-
Status(req: JobStatusRequest): Promise<JobStatusResponse>;
|
|
6
|
-
Cancel(req: JobCancelRequest): Promise<JobCancelResponse>;
|
|
7
|
-
StreamLogs(req: JobLogsRequest, stream: {
|
|
8
|
-
send: (msg: JobLogLine) => Promise<void>;
|
|
9
|
-
}): Promise<void>;
|
|
10
|
-
StreamProgress(req: JobProgressRequest, stream: {
|
|
11
|
-
send: (msg: JobProgress) => Promise<void>;
|
|
12
|
-
}): Promise<void>;
|
|
13
|
-
}
|
|
14
|
-
export declare class JobServiceHandler implements ServiceHandler {
|
|
15
|
-
private impl;
|
|
16
|
-
constructor(impl: JobServiceServer);
|
|
17
|
-
definition(): ServiceDefinition;
|
|
18
|
-
handleRequest(method: string, data: Uint8Array): Promise<Uint8Array>;
|
|
19
|
-
handleStream(method: string, data: Uint8Array, emit: (data: Uint8Array) => Promise<void>): Promise<void>;
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=jobservice.handler.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jobservice.handler.d.ts","sourceRoot":"","sources":["../../src/generated/jobservice.handler.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,cAAc,EAAE,UAAU,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE3M,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACvD,MAAM,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC1D,MAAM,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC1D,UAAU,CAAC,GAAG,EAAE,cAAc,EAAE,MAAM,EAAE;QAAE,IAAI,EAAE,CAAC,GAAG,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrG,cAAc,CAAC,GAAG,EAAE,kBAAkB,EAAE,MAAM,EAAE;QAAE,IAAI,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/G;AAED,qBAAa,iBAAkB,YAAW,cAAc;IACtD,OAAO,CAAC,IAAI,CAAmB;gBAEnB,IAAI,EAAE,gBAAgB;IAIlC,UAAU,IAAI,iBAAiB;IAczB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IAuBpE,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAsB/G"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
// Code generated by dink codegen. DO NOT EDIT.
|
|
2
|
-
export class JobServiceHandler {
|
|
3
|
-
impl;
|
|
4
|
-
constructor(impl) {
|
|
5
|
-
this.impl = impl;
|
|
6
|
-
}
|
|
7
|
-
definition() {
|
|
8
|
-
return {
|
|
9
|
-
name: 'JobService',
|
|
10
|
-
version: '1.0.0',
|
|
11
|
-
methods: [
|
|
12
|
-
'Start',
|
|
13
|
-
'Status',
|
|
14
|
-
'Cancel',
|
|
15
|
-
'StreamLogs',
|
|
16
|
-
'StreamProgress',
|
|
17
|
-
],
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
async handleRequest(method, data) {
|
|
21
|
-
const decoder = new TextDecoder();
|
|
22
|
-
const encoder = new TextEncoder();
|
|
23
|
-
const req = data.length > 0 ? JSON.parse(decoder.decode(data)) : {};
|
|
24
|
-
switch (method) {
|
|
25
|
-
case 'Start': {
|
|
26
|
-
const resp = await this.impl.Start(req);
|
|
27
|
-
return encoder.encode(JSON.stringify(resp));
|
|
28
|
-
}
|
|
29
|
-
case 'Status': {
|
|
30
|
-
const resp = await this.impl.Status(req);
|
|
31
|
-
return encoder.encode(JSON.stringify(resp));
|
|
32
|
-
}
|
|
33
|
-
case 'Cancel': {
|
|
34
|
-
const resp = await this.impl.Cancel(req);
|
|
35
|
-
return encoder.encode(JSON.stringify(resp));
|
|
36
|
-
}
|
|
37
|
-
default:
|
|
38
|
-
throw new Error(`Unknown method: ${method}`);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
async handleStream(method, data, emit) {
|
|
42
|
-
const decoder = new TextDecoder();
|
|
43
|
-
const encoder = new TextEncoder();
|
|
44
|
-
const req = data.length > 0 ? JSON.parse(decoder.decode(data)) : {};
|
|
45
|
-
const stream = {
|
|
46
|
-
send: async (msg) => {
|
|
47
|
-
await emit(encoder.encode(JSON.stringify(msg)));
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
switch (method) {
|
|
51
|
-
case 'StreamLogs':
|
|
52
|
-
await this.impl.StreamLogs(req, stream);
|
|
53
|
-
break;
|
|
54
|
-
case 'StreamProgress':
|
|
55
|
-
await this.impl.StreamProgress(req, stream);
|
|
56
|
-
break;
|
|
57
|
-
default:
|
|
58
|
-
throw new Error(`Unknown streaming method: ${method}`);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
//# sourceMappingURL=jobservice.handler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jobservice.handler.js","sourceRoot":"","sources":["../../src/generated/jobservice.handler.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAa/C,MAAM,OAAO,iBAAiB;IACpB,IAAI,CAAmB;IAE/B,YAA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AC,CAAC;YAC9C,CAAC;YACD;gBACE,MAAM,IAAI,KAAK,CAAC,mBAAmB,MAAM,EAAE,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,MAAc,EAAE,IAAgB,EAAE,IAAyC;QAC5F,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;QAClC,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;QAClC,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAEpE,MAAM,MAAM,GAAG;YACb,IAAI,EAAE,KAAK,EAAE,GAAY,EAAE,EAAE;gBAC3B,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAClD,CAAC;SACF,CAAC;QAEF,QAAQ,MAAM,EAAE,CAAC;YACjB,KAAK,YAAY;gBACf,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAqB,EAAE,MAAM,CAAC,CAAC;gBAC1D,MAAM;YACR,KAAK,gBAAgB;gBACnB,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,GAAyB,EAAE,MAAM,CAAC,CAAC;gBAClE,MAAM;YACR;gBACE,MAAM,IAAI,KAAK,CAAC,6BAA6B,MAAM,EAAE,CAAC,CAAC;QACzD,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { ServiceCaller, Subscription } from '../types.js';
|
|
2
|
-
import type { ReadTemperatureRequest, Temperature, SetpointRequest, SetpointResponse, StreamReadingsRequest } from './types.js';
|
|
3
|
-
export declare class SensorServiceClient {
|
|
4
|
-
private edgeId;
|
|
5
|
-
private caller;
|
|
6
|
-
constructor(edgeId: string, caller: ServiceCaller);
|
|
7
|
-
getEdgeId(): string;
|
|
8
|
-
ReadTemperature(req: ReadTemperatureRequest): Promise<Temperature>;
|
|
9
|
-
SetSetpoint(req: SetpointRequest): Promise<SetpointResponse>;
|
|
10
|
-
StreamReadings(req: StreamReadingsRequest, handler: (resp: Temperature) => void): Promise<Subscription>;
|
|
11
|
-
}
|
|
12
|
-
export declare const SensorServiceDefinition: {
|
|
13
|
-
name: string;
|
|
14
|
-
version: string;
|
|
15
|
-
methods: string[];
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=sensorservice.client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sensorservice.client.d.ts","sourceRoot":"","sources":["../../src/generated/sensorservice.client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAE,sBAAsB,EAAE,WAAW,EAAE,eAAe,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEhI,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,MAAM,CAAgB;gBAElB,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa;IAKjD,SAAS,IAAI,MAAM;IAKb,eAAe,CAAC,GAAG,EAAE,sBAAsB,GAAG,OAAO,CAAC,WAAW,CAAC;IAUlE,WAAW,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAU5D,cAAc,CAAC,GAAG,EAAE,qBAAqB,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC;CAW9G;AAED,eAAO,MAAM,uBAAuB;;;;CAQnC,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
// Code generated by dink codegen. DO NOT EDIT.
|
|
2
|
-
export class SensorServiceClient {
|
|
3
|
-
edgeId;
|
|
4
|
-
caller;
|
|
5
|
-
constructor(edgeId, caller) {
|
|
6
|
-
this.edgeId = edgeId;
|
|
7
|
-
this.caller = caller;
|
|
8
|
-
}
|
|
9
|
-
getEdgeId() {
|
|
10
|
-
return this.edgeId;
|
|
11
|
-
}
|
|
12
|
-
async ReadTemperature(req) {
|
|
13
|
-
return this.caller.call(this.edgeId, 'SensorService', 'ReadTemperature', req);
|
|
14
|
-
}
|
|
15
|
-
async SetSetpoint(req) {
|
|
16
|
-
return this.caller.call(this.edgeId, 'SensorService', 'SetSetpoint', req);
|
|
17
|
-
}
|
|
18
|
-
async StreamReadings(req, handler) {
|
|
19
|
-
return this.caller.subscribe(this.edgeId, 'SensorService', 'StreamReadings', req, handler);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
export const SensorServiceDefinition = {
|
|
23
|
-
name: 'SensorService',
|
|
24
|
-
version: '1.0.0',
|
|
25
|
-
methods: [
|
|
26
|
-
'ReadTemperature',
|
|
27
|
-
'SetSetpoint',
|
|
28
|
-
'StreamReadings',
|
|
29
|
-
],
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=sensorservice.client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sensorservice.client.js","sourceRoot":"","sources":["../../src/generated/sensorservice.client.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAK/C,MAAM,OAAO,mBAAmB;IACtB,MAAM,CAAS;IACf,MAAM,CAAgB;IAE9B,YAAY,MAAc,EAAE,MAAqB;QAC/C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAGD,KAAK,CAAC,eAAe,CAAC,GAA2B;QAC/C,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CACrB,IAAI,CAAC,MAAM,EACX,eAAe,EACf,iBAAiB,EACjB,GAAG,CACJ,CAAC;IACJ,CAAC;IAGD,KAAK,CAAC,WAAW,CAAC,GAAoB;QACpC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CACrB,IAAI,CAAC,MAAM,EACX,eAAe,EACf,aAAa,EACb,GAAG,CACJ,CAAC;IACJ,CAAC;IAGD,KAAK,CAAC,cAAc,CAAC,GAA0B,EAAE,OAAoC;QACnF,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAC1B,IAAI,CAAC,MAAM,EACX,eAAe,EACf,gBAAgB,EAChB,GAAG,EACH,OAAO,CACR,CAAC;IACJ,CAAC;CAGF;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,IAAI,EAAE,eAAe;IACrB,OAAO,EAAE,OAAO;IAChB,OAAO,EAAE;QACP,iBAAiB;QACjB,aAAa;QACb,gBAAgB;KACjB;CACF,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { ServiceHandler, ServiceDefinition } from '../types.js';
|
|
2
|
-
import type { ReadTemperatureRequest, Temperature, SetpointRequest, SetpointResponse, StreamReadingsRequest } from './types.js';
|
|
3
|
-
export interface SensorServiceServer {
|
|
4
|
-
ReadTemperature(req: ReadTemperatureRequest): Promise<Temperature>;
|
|
5
|
-
SetSetpoint(req: SetpointRequest): Promise<SetpointResponse>;
|
|
6
|
-
StreamReadings(req: StreamReadingsRequest, stream: {
|
|
7
|
-
send: (msg: Temperature) => Promise<void>;
|
|
8
|
-
}): Promise<void>;
|
|
9
|
-
}
|
|
10
|
-
export declare class SensorServiceHandler implements ServiceHandler {
|
|
11
|
-
private impl;
|
|
12
|
-
constructor(impl: SensorServiceServer);
|
|
13
|
-
definition(): ServiceDefinition;
|
|
14
|
-
handleRequest(method: string, data: Uint8Array): Promise<Uint8Array>;
|
|
15
|
-
handleStream(method: string, data: Uint8Array, emit: (data: Uint8Array) => Promise<void>): Promise<void>;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=sensorservice.handler.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sensorservice.handler.d.ts","sourceRoot":"","sources":["../../src/generated/sensorservice.handler.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,KAAK,EAAE,sBAAsB,EAAE,WAAW,EAAE,eAAe,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEhI,MAAM,WAAW,mBAAmB;IAClC,eAAe,CAAC,GAAG,EAAE,sBAAsB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IACnE,WAAW,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC7D,cAAc,CAAC,GAAG,EAAE,qBAAqB,EAAE,MAAM,EAAE;QAAE,IAAI,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClH;AAED,qBAAa,oBAAqB,YAAW,cAAc;IACzD,OAAO,CAAC,IAAI,CAAsB;gBAEtB,IAAI,EAAE,mBAAmB;IAIrC,UAAU,IAAI,iBAAiB;IAYzB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IAmBpE,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAmB/G"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
// Code generated by dink codegen. DO NOT EDIT.
|
|
2
|
-
export class SensorServiceHandler {
|
|
3
|
-
impl;
|
|
4
|
-
constructor(impl) {
|
|
5
|
-
this.impl = impl;
|
|
6
|
-
}
|
|
7
|
-
definition() {
|
|
8
|
-
return {
|
|
9
|
-
name: 'SensorService',
|
|
10
|
-
version: '1.0.0',
|
|
11
|
-
methods: [
|
|
12
|
-
'ReadTemperature',
|
|
13
|
-
'SetSetpoint',
|
|
14
|
-
'StreamReadings',
|
|
15
|
-
],
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
async handleRequest(method, data) {
|
|
19
|
-
const decoder = new TextDecoder();
|
|
20
|
-
const encoder = new TextEncoder();
|
|
21
|
-
const req = data.length > 0 ? JSON.parse(decoder.decode(data)) : {};
|
|
22
|
-
switch (method) {
|
|
23
|
-
case 'ReadTemperature': {
|
|
24
|
-
const resp = await this.impl.ReadTemperature(req);
|
|
25
|
-
return encoder.encode(JSON.stringify(resp));
|
|
26
|
-
}
|
|
27
|
-
case 'SetSetpoint': {
|
|
28
|
-
const resp = await this.impl.SetSetpoint(req);
|
|
29
|
-
return encoder.encode(JSON.stringify(resp));
|
|
30
|
-
}
|
|
31
|
-
default:
|
|
32
|
-
throw new Error(`Unknown method: ${method}`);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
async handleStream(method, data, emit) {
|
|
36
|
-
const decoder = new TextDecoder();
|
|
37
|
-
const encoder = new TextEncoder();
|
|
38
|
-
const req = data.length > 0 ? JSON.parse(decoder.decode(data)) : {};
|
|
39
|
-
const stream = {
|
|
40
|
-
send: async (msg) => {
|
|
41
|
-
await emit(encoder.encode(JSON.stringify(msg)));
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
switch (method) {
|
|
45
|
-
case 'StreamReadings':
|
|
46
|
-
await this.impl.StreamReadings(req, stream);
|
|
47
|
-
break;
|
|
48
|
-
default:
|
|
49
|
-
throw new Error(`Unknown streaming method: ${method}`);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
//# sourceMappingURL=sensorservice.handler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sensorservice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C;IAED,KAAK,CAAC,YAAY,CAAC,MAAc,EAAE,IAAgB,EAAE,IAAyC;QAC5F,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;QAClC,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;QAClC,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAEpE,MAAM,MAAM,GAAG;YACb,IAAI,EAAE,KAAK,EAAE,GAAY,EAAE,EAAE;gBAC3B,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAClD,CAAC;SACF,CAAC;QAEF,QAAQ,MAAM,EAAE,CAAC;YACjB,KAAK,gBAAgB;gBACnB,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,GAA4B,EAAE,MAAM,CAAC,CAAC;gBACrE,MAAM;YACR;gBACE,MAAM,IAAI,KAAK,CAAC,6BAA6B,MAAM,EAAE,CAAC,CAAC;QACzD,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
export declare enum JobStatus {
|
|
2
|
-
JOB_STATUS_UNSPECIFIED = 0,
|
|
3
|
-
JOB_STATUS_PENDING = 1,
|
|
4
|
-
JOB_STATUS_RUNNING = 2,
|
|
5
|
-
JOB_STATUS_COMPLETED = 3,
|
|
6
|
-
JOB_STATUS_FAILED = 4,
|
|
7
|
-
JOB_STATUS_CANCELLED = 5,
|
|
8
|
-
JOB_STATUS_TIMEOUT = 6
|
|
9
|
-
}
|
|
10
|
-
export interface Error {
|
|
11
|
-
code: string;
|
|
12
|
-
message: string;
|
|
13
|
-
details: Record<string, unknown>;
|
|
14
|
-
}
|
|
15
|
-
export interface Metadata {
|
|
16
|
-
requestId: string;
|
|
17
|
-
edgeId: string;
|
|
18
|
-
tags: Record<string, unknown>;
|
|
19
|
-
}
|
|
20
|
-
export interface Empty {
|
|
21
|
-
}
|
|
22
|
-
export interface JobStartRequest {
|
|
23
|
-
jobType: string;
|
|
24
|
-
payload: Record<string, unknown>;
|
|
25
|
-
options: JobOptions;
|
|
26
|
-
}
|
|
27
|
-
export interface JobOptions {
|
|
28
|
-
timeout: number;
|
|
29
|
-
priority: number;
|
|
30
|
-
env: Record<string, unknown>;
|
|
31
|
-
workingDir: string;
|
|
32
|
-
tags: Record<string, unknown>;
|
|
33
|
-
}
|
|
34
|
-
export interface JobStartResponse {
|
|
35
|
-
jobId: string;
|
|
36
|
-
status: JobStatus;
|
|
37
|
-
startedAt: Date;
|
|
38
|
-
}
|
|
39
|
-
export interface JobStatusRequest {
|
|
40
|
-
jobId: string;
|
|
41
|
-
}
|
|
42
|
-
export interface JobStatusResponse {
|
|
43
|
-
jobId: string;
|
|
44
|
-
jobType: string;
|
|
45
|
-
status: JobStatus;
|
|
46
|
-
progress: JobProgress;
|
|
47
|
-
result: Record<string, unknown>;
|
|
48
|
-
error: string;
|
|
49
|
-
startedAt: Date;
|
|
50
|
-
completedAt: Date;
|
|
51
|
-
duration: number;
|
|
52
|
-
}
|
|
53
|
-
export interface JobCancelRequest {
|
|
54
|
-
jobId: string;
|
|
55
|
-
force: boolean;
|
|
56
|
-
}
|
|
57
|
-
export interface JobCancelResponse {
|
|
58
|
-
cancelled: boolean;
|
|
59
|
-
message: string;
|
|
60
|
-
}
|
|
61
|
-
export interface JobLogsRequest {
|
|
62
|
-
jobId: string;
|
|
63
|
-
follow: boolean;
|
|
64
|
-
tail: number;
|
|
65
|
-
}
|
|
66
|
-
export interface JobLogLine {
|
|
67
|
-
timestamp: Date;
|
|
68
|
-
stream: string;
|
|
69
|
-
text: string;
|
|
70
|
-
jobId: string;
|
|
71
|
-
}
|
|
72
|
-
export interface JobProgressRequest {
|
|
73
|
-
jobId: string;
|
|
74
|
-
}
|
|
75
|
-
export interface JobProgress {
|
|
76
|
-
percent: number;
|
|
77
|
-
stage: string;
|
|
78
|
-
message: string;
|
|
79
|
-
details: Record<string, unknown>;
|
|
80
|
-
}
|
|
81
|
-
export interface ReadTemperatureRequest {
|
|
82
|
-
}
|
|
83
|
-
export interface Temperature {
|
|
84
|
-
value: number;
|
|
85
|
-
unit: string;
|
|
86
|
-
timestamp: Date;
|
|
87
|
-
}
|
|
88
|
-
export interface SetpointRequest {
|
|
89
|
-
target: number;
|
|
90
|
-
unit: string;
|
|
91
|
-
}
|
|
92
|
-
export interface SetpointResponse {
|
|
93
|
-
success: boolean;
|
|
94
|
-
previous: number;
|
|
95
|
-
}
|
|
96
|
-
export interface StreamReadingsRequest {
|
|
97
|
-
intervalMs: number;
|
|
98
|
-
}
|
|
99
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/generated/types.ts"],"names":[],"mappings":"AAEA,oBAAY,SAAS;IACnB,sBAAsB,IAAI;IAC1B,kBAAkB,IAAI;IACtB,kBAAkB,IAAI;IACtB,oBAAoB,IAAI;IACxB,iBAAiB,IAAI;IACrB,oBAAoB,IAAI;IACxB,kBAAkB,IAAI;CACvB;AAGD,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,QAAQ;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,KAAK;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,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AE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,sBAAsB;CACtC;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
package/dist/generated/types.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Code generated by dink codegen. DO NOT EDIT.
|
|
2
|
-
export var JobStatus;
|
|
3
|
-
(function (JobStatus) {
|
|
4
|
-
JobStatus[JobStatus["JOB_STATUS_UNSPECIFIED"] = 0] = "JOB_STATUS_UNSPECIFIED";
|
|
5
|
-
JobStatus[JobStatus["JOB_STATUS_PENDING"] = 1] = "JOB_STATUS_PENDING";
|
|
6
|
-
JobStatus[JobStatus["JOB_STATUS_RUNNING"] = 2] = "JOB_STATUS_RUNNING";
|
|
7
|
-
JobStatus[JobStatus["JOB_STATUS_COMPLETED"] = 3] = "JOB_STATUS_COMPLETED";
|
|
8
|
-
JobStatus[JobStatus["JOB_STATUS_FAILED"] = 4] = "JOB_STATUS_FAILED";
|
|
9
|
-
JobStatus[JobStatus["JOB_STATUS_CANCELLED"] = 5] = "JOB_STATUS_CANCELLED";
|
|
10
|
-
JobStatus[JobStatus["JOB_STATUS_TIMEOUT"] = 6] = "JOB_STATUS_TIMEOUT";
|
|
11
|
-
})(JobStatus || (JobStatus = {}));
|
|
12
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/generated/types.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAE/C,MAAM,CAAN,IAAY,SAQX;AARD,WAAY,SAAS;IACnB,6EAA0B,CAAA;IAC1B,qEAAsB,CAAA;IACtB,qEAAsB,CAAA;IACtB,yEAAwB,CAAA;IACxB,mEAAqB,CAAA;IACrB,yEAAwB,CAAA;IACxB,qEAAsB,CAAA;AACxB,CAAC,EARW,SAAS,KAAT,SAAS,QAQpB"}
|