@gokiteam/goki-dev 0.2.0 → 0.2.2
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/Dockerfile.backend +38 -0
- package/Dockerfile.dev +38 -0
- package/Dockerfile.frontend +37 -0
- package/cli/NgrokManager.js +2 -3
- package/config.development +0 -1
- package/docker-compose.dev.yml +81 -0
- package/docker-compose.services.yml +186 -0
- package/docker-compose.yml +233 -0
- package/nginx.conf +41 -0
- package/package.json +27 -21
- package/src/api/httpTraffic/Controllers.js +7 -0
- package/src/api/httpTraffic/Logic.js +28 -0
- package/src/api/httpTraffic/Router.js +1 -0
- package/src/api/httpTraffic/Schemas.js +15 -1
- package/src/api/snapshots/Logic.js +2 -5
- package/src/configs/Application.js +3 -1
- package/src/mcp/tools/httpTraffic.js +20 -1
- package/src/singletons/HttpProxy.js +11 -1
- package/src/singletons/SqliteStore.js +12 -3
- package/ui/Dockerfile.dev +19 -0
- package/client/dist/client.d.ts +0 -332
- package/client/dist/client.js +0 -507
- package/client/dist/helpers.d.ts +0 -62
- package/client/dist/helpers.js +0 -122
- package/client/dist/index.d.ts +0 -59
- package/client/dist/index.js +0 -78
- package/client/dist/package.json +0 -1
- package/client/dist/types.d.ts +0 -280
- package/client/dist/types.js +0 -7
package/client/dist/index.d.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @gokiteam/goki-dev - Client SDK
|
|
3
|
-
*
|
|
4
|
-
* HTTP client for interacting with the Goki Developer Tools platform.
|
|
5
|
-
*
|
|
6
|
-
* @example Simple usage (singleton)
|
|
7
|
-
* ```typescript
|
|
8
|
-
* import { devTools } from '@gokiteam/goki-dev'
|
|
9
|
-
*
|
|
10
|
-
* const traceId = devTools.generateTraceId('user-login-test')
|
|
11
|
-
*
|
|
12
|
-
* // Wait for message
|
|
13
|
-
* const message = await devTools.pubsub.waitForMessage({
|
|
14
|
-
* filter: {
|
|
15
|
-
* topic: 'user-events',
|
|
16
|
-
* predicate: {
|
|
17
|
-
* jsonPath: '$.event',
|
|
18
|
-
* operator: 'equals',
|
|
19
|
-
* value: 'user-login'
|
|
20
|
-
* }
|
|
21
|
-
* },
|
|
22
|
-
* timeout: 5000,
|
|
23
|
-
* traceId
|
|
24
|
-
* })
|
|
25
|
-
*
|
|
26
|
-
* // Verify logs
|
|
27
|
-
* const errors = await devTools.logging.assertNoErrors({ traceId })
|
|
28
|
-
* ```
|
|
29
|
-
*
|
|
30
|
-
* @example Advanced usage (custom instance)
|
|
31
|
-
* ```typescript
|
|
32
|
-
* import { DevToolsClient } from '@gokiteam/goki-dev'
|
|
33
|
-
*
|
|
34
|
-
* const devTools = new DevToolsClient({
|
|
35
|
-
* baseUrl: 'http://custom-host:9000',
|
|
36
|
-
* timeout: 60000
|
|
37
|
-
* })
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
export { DevToolsClient } from './client';
|
|
41
|
-
export * from './types';
|
|
42
|
-
export * from './helpers';
|
|
43
|
-
import { DevToolsClient } from './client';
|
|
44
|
-
/**
|
|
45
|
-
* Default singleton instance of DevToolsClient
|
|
46
|
-
*
|
|
47
|
-
* Configured from environment variables:
|
|
48
|
-
* - DEV_TOOLS_BASE: Base URL (default: http://localhost:9000)
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
* ```typescript
|
|
52
|
-
* import { devTools } from '@gokiteam/goki-dev'
|
|
53
|
-
*
|
|
54
|
-
* const traceId = devTools.generateTraceId('test')
|
|
55
|
-
* const message = await devTools.pubsub.waitForMessage({ ... })
|
|
56
|
-
* const logs = await devTools.logging.getByTrace({ traceId })
|
|
57
|
-
* ```
|
|
58
|
-
*/
|
|
59
|
-
export declare const devTools: DevToolsClient;
|
package/client/dist/index.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @gokiteam/goki-dev - Client SDK
|
|
4
|
-
*
|
|
5
|
-
* HTTP client for interacting with the Goki Developer Tools platform.
|
|
6
|
-
*
|
|
7
|
-
* @example Simple usage (singleton)
|
|
8
|
-
* ```typescript
|
|
9
|
-
* import { devTools } from '@gokiteam/goki-dev'
|
|
10
|
-
*
|
|
11
|
-
* const traceId = devTools.generateTraceId('user-login-test')
|
|
12
|
-
*
|
|
13
|
-
* // Wait for message
|
|
14
|
-
* const message = await devTools.pubsub.waitForMessage({
|
|
15
|
-
* filter: {
|
|
16
|
-
* topic: 'user-events',
|
|
17
|
-
* predicate: {
|
|
18
|
-
* jsonPath: '$.event',
|
|
19
|
-
* operator: 'equals',
|
|
20
|
-
* value: 'user-login'
|
|
21
|
-
* }
|
|
22
|
-
* },
|
|
23
|
-
* timeout: 5000,
|
|
24
|
-
* traceId
|
|
25
|
-
* })
|
|
26
|
-
*
|
|
27
|
-
* // Verify logs
|
|
28
|
-
* const errors = await devTools.logging.assertNoErrors({ traceId })
|
|
29
|
-
* ```
|
|
30
|
-
*
|
|
31
|
-
* @example Advanced usage (custom instance)
|
|
32
|
-
* ```typescript
|
|
33
|
-
* import { DevToolsClient } from '@gokiteam/goki-dev'
|
|
34
|
-
*
|
|
35
|
-
* const devTools = new DevToolsClient({
|
|
36
|
-
* baseUrl: 'http://custom-host:9000',
|
|
37
|
-
* timeout: 60000
|
|
38
|
-
* })
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
42
|
-
if (k2 === undefined) k2 = k;
|
|
43
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
44
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
45
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
46
|
-
}
|
|
47
|
-
Object.defineProperty(o, k2, desc);
|
|
48
|
-
}) : (function(o, m, k, k2) {
|
|
49
|
-
if (k2 === undefined) k2 = k;
|
|
50
|
-
o[k2] = m[k];
|
|
51
|
-
}));
|
|
52
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
53
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
54
|
-
};
|
|
55
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
56
|
-
exports.devTools = exports.DevToolsClient = void 0;
|
|
57
|
-
var client_1 = require("./client");
|
|
58
|
-
Object.defineProperty(exports, "DevToolsClient", { enumerable: true, get: function () { return client_1.DevToolsClient; } });
|
|
59
|
-
__exportStar(require("./types"), exports);
|
|
60
|
-
__exportStar(require("./helpers"), exports);
|
|
61
|
-
// Export default singleton instance for convenience
|
|
62
|
-
const client_2 = require("./client");
|
|
63
|
-
/**
|
|
64
|
-
* Default singleton instance of DevToolsClient
|
|
65
|
-
*
|
|
66
|
-
* Configured from environment variables:
|
|
67
|
-
* - DEV_TOOLS_BASE: Base URL (default: http://localhost:9000)
|
|
68
|
-
*
|
|
69
|
-
* @example
|
|
70
|
-
* ```typescript
|
|
71
|
-
* import { devTools } from '@gokiteam/goki-dev'
|
|
72
|
-
*
|
|
73
|
-
* const traceId = devTools.generateTraceId('test')
|
|
74
|
-
* const message = await devTools.pubsub.waitForMessage({ ... })
|
|
75
|
-
* const logs = await devTools.logging.getByTrace({ traceId })
|
|
76
|
-
* ```
|
|
77
|
-
*/
|
|
78
|
-
exports.devTools = new client_2.DevToolsClient();
|
package/client/dist/package.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"type":"commonjs"}
|
package/client/dist/types.d.ts
DELETED
|
@@ -1,280 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @gokiteam/goki-dev - Type Definitions
|
|
3
|
-
*
|
|
4
|
-
* TypeScript types for the Goki Developer Tools Client SDK
|
|
5
|
-
*/
|
|
6
|
-
export interface StandardResponse<T = any> {
|
|
7
|
-
success: boolean;
|
|
8
|
-
status: number;
|
|
9
|
-
message: string;
|
|
10
|
-
data: T & {
|
|
11
|
-
traceId: string;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
export interface PageOptions {
|
|
15
|
-
limit?: number;
|
|
16
|
-
offset?: number;
|
|
17
|
-
}
|
|
18
|
-
export interface TimeRange {
|
|
19
|
-
start: string;
|
|
20
|
-
end: string;
|
|
21
|
-
}
|
|
22
|
-
export interface PubSubMessage {
|
|
23
|
-
id: string;
|
|
24
|
-
message_id: string;
|
|
25
|
-
data: string;
|
|
26
|
-
attributes?: Record<string, string>;
|
|
27
|
-
ordering_key?: string;
|
|
28
|
-
publish_time: string;
|
|
29
|
-
topic: string;
|
|
30
|
-
sender?: string;
|
|
31
|
-
view_count: number;
|
|
32
|
-
last_viewed_at?: number;
|
|
33
|
-
created_at: number;
|
|
34
|
-
}
|
|
35
|
-
export interface PubSubTopic {
|
|
36
|
-
name: string;
|
|
37
|
-
labels?: Record<string, string>;
|
|
38
|
-
}
|
|
39
|
-
export interface PubSubSubscription {
|
|
40
|
-
name: string;
|
|
41
|
-
topic: string;
|
|
42
|
-
ackDeadlineSeconds: number;
|
|
43
|
-
pushConfig?: Record<string, any>;
|
|
44
|
-
}
|
|
45
|
-
export interface PubSubHistoryFilter {
|
|
46
|
-
topic?: string;
|
|
47
|
-
sender?: string;
|
|
48
|
-
timeRange?: TimeRange;
|
|
49
|
-
}
|
|
50
|
-
export type LogSeverity = 'DEFAULT' | 'DEBUG' | 'INFO' | 'NOTICE' | 'WARNING' | 'ERROR' | 'CRITICAL' | 'ALERT' | 'EMERGENCY';
|
|
51
|
-
export interface LogEntry {
|
|
52
|
-
logName: string;
|
|
53
|
-
resource: {
|
|
54
|
-
type: string;
|
|
55
|
-
labels: Record<string, string>;
|
|
56
|
-
};
|
|
57
|
-
timestamp: string;
|
|
58
|
-
severity: LogSeverity;
|
|
59
|
-
textPayload?: string;
|
|
60
|
-
jsonPayload?: Record<string, any>;
|
|
61
|
-
trace?: string;
|
|
62
|
-
insertId: string;
|
|
63
|
-
}
|
|
64
|
-
export interface LogFilter {
|
|
65
|
-
service?: string;
|
|
66
|
-
severity?: LogSeverity[];
|
|
67
|
-
timeRange?: TimeRange;
|
|
68
|
-
}
|
|
69
|
-
export interface PostgresQueryRequest {
|
|
70
|
-
database: string;
|
|
71
|
-
query: string;
|
|
72
|
-
params?: any[];
|
|
73
|
-
traceId?: string;
|
|
74
|
-
}
|
|
75
|
-
export interface PostgresQueryResponse {
|
|
76
|
-
rows: any[];
|
|
77
|
-
rowCount: number;
|
|
78
|
-
traceId: string;
|
|
79
|
-
}
|
|
80
|
-
export interface RedisKey {
|
|
81
|
-
key: string;
|
|
82
|
-
type: string;
|
|
83
|
-
ttl: number;
|
|
84
|
-
}
|
|
85
|
-
export interface RedisValue {
|
|
86
|
-
key: string;
|
|
87
|
-
type: string;
|
|
88
|
-
value: string;
|
|
89
|
-
ttl: number;
|
|
90
|
-
}
|
|
91
|
-
export interface FirestoreDocument {
|
|
92
|
-
id: string;
|
|
93
|
-
data: Record<string, any>;
|
|
94
|
-
}
|
|
95
|
-
export interface FirestoreQuery {
|
|
96
|
-
field: string;
|
|
97
|
-
op: '==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not-in' | 'array-contains';
|
|
98
|
-
value: any;
|
|
99
|
-
}
|
|
100
|
-
export interface FirestoreWhereClause {
|
|
101
|
-
field: string;
|
|
102
|
-
operator: '==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not-in' | 'array-contains';
|
|
103
|
-
value: any;
|
|
104
|
-
}
|
|
105
|
-
export interface DeleteByQueryRequest {
|
|
106
|
-
collection: string;
|
|
107
|
-
where: FirestoreWhereClause;
|
|
108
|
-
traceId?: string;
|
|
109
|
-
}
|
|
110
|
-
export interface DeleteByQueryResponse {
|
|
111
|
-
deletedCount: number;
|
|
112
|
-
traceId: string;
|
|
113
|
-
}
|
|
114
|
-
export interface DeleteByPrefixRequest {
|
|
115
|
-
collection: string;
|
|
116
|
-
prefix: string;
|
|
117
|
-
traceId?: string;
|
|
118
|
-
}
|
|
119
|
-
export interface DeleteByPrefixResponse {
|
|
120
|
-
deletedCount: number;
|
|
121
|
-
traceId: string;
|
|
122
|
-
}
|
|
123
|
-
export interface DeleteBatchRequest {
|
|
124
|
-
collection: string;
|
|
125
|
-
documentIds: string[];
|
|
126
|
-
traceId?: string;
|
|
127
|
-
}
|
|
128
|
-
export interface DeleteBatchResponse {
|
|
129
|
-
deletedCount: number;
|
|
130
|
-
failedIds: string[];
|
|
131
|
-
traceId: string;
|
|
132
|
-
}
|
|
133
|
-
export interface MqttClientInfo {
|
|
134
|
-
clientId: string;
|
|
135
|
-
connected: boolean;
|
|
136
|
-
connectedAt: string;
|
|
137
|
-
subscriptions: string[];
|
|
138
|
-
}
|
|
139
|
-
export interface MqttMessage {
|
|
140
|
-
clientId: string;
|
|
141
|
-
topic: string;
|
|
142
|
-
payload: string;
|
|
143
|
-
qos: 0 | 1 | 2;
|
|
144
|
-
timestamp: string;
|
|
145
|
-
}
|
|
146
|
-
export interface WaitForMessageRequest {
|
|
147
|
-
filter: {
|
|
148
|
-
topic: string;
|
|
149
|
-
predicate?: {
|
|
150
|
-
jsonPath: string;
|
|
151
|
-
operator: 'equals' | 'notEquals' | 'contains' | 'greaterThan' | 'lessThan';
|
|
152
|
-
value: any;
|
|
153
|
-
};
|
|
154
|
-
sender?: string;
|
|
155
|
-
};
|
|
156
|
-
timeout?: number;
|
|
157
|
-
traceId?: string;
|
|
158
|
-
}
|
|
159
|
-
export interface WaitForMessageResponse {
|
|
160
|
-
message: PubSubMessage;
|
|
161
|
-
foundAt: number;
|
|
162
|
-
traceId: string;
|
|
163
|
-
}
|
|
164
|
-
export interface WaitForLogRequest {
|
|
165
|
-
filter: {
|
|
166
|
-
traceId?: string;
|
|
167
|
-
service?: string;
|
|
168
|
-
severity?: LogSeverity;
|
|
169
|
-
textContains?: string;
|
|
170
|
-
};
|
|
171
|
-
timeout?: number;
|
|
172
|
-
traceId?: string;
|
|
173
|
-
}
|
|
174
|
-
export interface WaitForLogResponse {
|
|
175
|
-
entry: LogEntry;
|
|
176
|
-
foundAt: number;
|
|
177
|
-
traceId: string;
|
|
178
|
-
}
|
|
179
|
-
export interface WaitForConditionRequest {
|
|
180
|
-
type: 'postgres' | 'redis' | 'firestore';
|
|
181
|
-
condition: {
|
|
182
|
-
database?: string;
|
|
183
|
-
query?: string;
|
|
184
|
-
params?: any[];
|
|
185
|
-
key?: string;
|
|
186
|
-
collection?: string;
|
|
187
|
-
documentId?: string;
|
|
188
|
-
expect: Record<string, any>;
|
|
189
|
-
};
|
|
190
|
-
timeout?: number;
|
|
191
|
-
pollInterval?: number;
|
|
192
|
-
traceId?: string;
|
|
193
|
-
}
|
|
194
|
-
export interface WaitForConditionResponse {
|
|
195
|
-
met: boolean;
|
|
196
|
-
foundAt: number;
|
|
197
|
-
actualValue?: any;
|
|
198
|
-
traceId: string;
|
|
199
|
-
}
|
|
200
|
-
export interface AssertMessagePublishedRequest {
|
|
201
|
-
filter: {
|
|
202
|
-
topic: string;
|
|
203
|
-
since?: string;
|
|
204
|
-
dataContains?: string;
|
|
205
|
-
attributesMatch?: Record<string, string>;
|
|
206
|
-
};
|
|
207
|
-
traceId?: string;
|
|
208
|
-
}
|
|
209
|
-
export interface AssertMessagePublishedResponse {
|
|
210
|
-
found: boolean;
|
|
211
|
-
count: number;
|
|
212
|
-
firstMatch?: Partial<PubSubMessage>;
|
|
213
|
-
traceId: string;
|
|
214
|
-
}
|
|
215
|
-
export interface AssertNoErrorsRequest {
|
|
216
|
-
traceId: string;
|
|
217
|
-
sinceTimestamp?: string;
|
|
218
|
-
}
|
|
219
|
-
export interface AssertNoErrorsResponse {
|
|
220
|
-
hasErrors: boolean;
|
|
221
|
-
errorCount: number;
|
|
222
|
-
criticalCount: number;
|
|
223
|
-
errors?: Partial<LogEntry>[];
|
|
224
|
-
traceId: string;
|
|
225
|
-
}
|
|
226
|
-
export interface ClearServiceDataRequest {
|
|
227
|
-
services: ('pubsub' | 'logging' | 'mqtt' | 'redis' | 'postgres' | 'firestore')[];
|
|
228
|
-
keepSystemData?: boolean;
|
|
229
|
-
traceId?: string;
|
|
230
|
-
}
|
|
231
|
-
export interface ClearServiceDataResponse {
|
|
232
|
-
cleared: Record<string, number>;
|
|
233
|
-
traceId: string;
|
|
234
|
-
}
|
|
235
|
-
export interface SchedulerTickRequest {
|
|
236
|
-
traceId?: string;
|
|
237
|
-
}
|
|
238
|
-
export interface SchedulerTickResponse {
|
|
239
|
-
tickTime: string;
|
|
240
|
-
published: boolean;
|
|
241
|
-
traceId: string;
|
|
242
|
-
}
|
|
243
|
-
export interface PlatformStats {
|
|
244
|
-
topics: number;
|
|
245
|
-
subscriptions: number;
|
|
246
|
-
messages: number;
|
|
247
|
-
logEntries: number;
|
|
248
|
-
mqttClients: number;
|
|
249
|
-
mqttMessages: number;
|
|
250
|
-
}
|
|
251
|
-
export interface ExportData {
|
|
252
|
-
pubsub: {
|
|
253
|
-
topics: PubSubTopic[];
|
|
254
|
-
subscriptions: PubSubSubscription[];
|
|
255
|
-
messages: PubSubMessage[];
|
|
256
|
-
};
|
|
257
|
-
logging: {
|
|
258
|
-
entries: LogEntry[];
|
|
259
|
-
};
|
|
260
|
-
mqtt: {
|
|
261
|
-
clients: MqttClientInfo[];
|
|
262
|
-
messages: MqttMessage[];
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
export interface DockerContainer {
|
|
266
|
-
name: string;
|
|
267
|
-
containerName: string;
|
|
268
|
-
displayName: string;
|
|
269
|
-
description: string;
|
|
270
|
-
status: 'running' | 'stopped' | 'created' | 'restarting' | 'paused' | 'unknown';
|
|
271
|
-
statusText: string;
|
|
272
|
-
uptime: string | null;
|
|
273
|
-
ports: number | null;
|
|
274
|
-
image: string;
|
|
275
|
-
capabilities: {
|
|
276
|
-
canStart: boolean;
|
|
277
|
-
canStop: boolean;
|
|
278
|
-
canRestart: boolean;
|
|
279
|
-
};
|
|
280
|
-
}
|