@dbx-tools/shared-lakebox 0.0.0-stage → 0.9.132
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/LICENSE +202 -0
- package/README.md +87 -2
- package/index.ts +12 -0
- package/lib/index.d.ts +8 -0
- package/lib/index.js +10 -0
- package/lib/src/client.d.ts +37 -0
- package/lib/src/client.js +49 -0
- package/lib/src/schemas.d.ts +334 -0
- package/lib/src/schemas.js +367 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/package.json +84 -4
- package/src/client.ts +64 -0
- package/src/schemas.ts +465 -0
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const lakeboxStatusSchema: z.ZodEnum<{
|
|
3
|
+
error: "error";
|
|
4
|
+
missing: "missing";
|
|
5
|
+
unknown: "unknown";
|
|
6
|
+
starting: "starting";
|
|
7
|
+
running: "running";
|
|
8
|
+
stopping: "stopping";
|
|
9
|
+
stopped: "stopped";
|
|
10
|
+
}>;
|
|
11
|
+
export type LakeboxStatus = z.infer<typeof lakeboxStatusSchema>;
|
|
12
|
+
export declare const lakeboxUserSchema: z.ZodObject<{
|
|
13
|
+
hash: z.ZodString;
|
|
14
|
+
name: z.ZodString;
|
|
15
|
+
uid: z.ZodNumber;
|
|
16
|
+
home: z.ZodString;
|
|
17
|
+
routePrefix: z.ZodString;
|
|
18
|
+
}, z.core.$strict>;
|
|
19
|
+
export type LakeboxUser = z.infer<typeof lakeboxUserSchema>;
|
|
20
|
+
/** Built-in services every user can start without a definition. */
|
|
21
|
+
export declare const LAKEBOX_BUILT_IN_SERVICES: readonly [{
|
|
22
|
+
readonly name: "terminal";
|
|
23
|
+
readonly label: "Terminal";
|
|
24
|
+
}, {
|
|
25
|
+
readonly name: "desktop";
|
|
26
|
+
readonly label: "Desktop";
|
|
27
|
+
}];
|
|
28
|
+
export declare const lakeboxBuiltInServiceNameSchema: z.ZodEnum<{
|
|
29
|
+
terminal: "terminal";
|
|
30
|
+
desktop: "desktop";
|
|
31
|
+
}>;
|
|
32
|
+
export type LakeboxBuiltInServiceName = z.infer<typeof lakeboxBuiltInServiceNameSchema>;
|
|
33
|
+
/** Environment variables the runtime injects into every service. */
|
|
34
|
+
export declare const LAKEBOX_RESERVED_SERVICE_ENV: readonly ["SERVICE_NAME", "SERVICE_PATH", "SERVICE_PORT", "PORT"];
|
|
35
|
+
export declare const lakeboxServiceNameSchema: z.ZodString;
|
|
36
|
+
export declare const lakeboxServiceStateSchema: z.ZodEnum<{
|
|
37
|
+
error: "error";
|
|
38
|
+
starting: "starting";
|
|
39
|
+
stopped: "stopped";
|
|
40
|
+
ready: "ready";
|
|
41
|
+
}>;
|
|
42
|
+
export type LakeboxServiceState = z.infer<typeof lakeboxServiceStateSchema>;
|
|
43
|
+
export declare const lakeboxServiceKindSchema: z.ZodEnum<{
|
|
44
|
+
terminal: "terminal";
|
|
45
|
+
desktop: "desktop";
|
|
46
|
+
image: "image";
|
|
47
|
+
}>;
|
|
48
|
+
export type LakeboxServiceKind = z.infer<typeof lakeboxServiceKindSchema>;
|
|
49
|
+
export declare const lakeboxServiceSchema: z.ZodObject<{
|
|
50
|
+
name: z.ZodString;
|
|
51
|
+
kind: z.ZodEnum<{
|
|
52
|
+
terminal: "terminal";
|
|
53
|
+
desktop: "desktop";
|
|
54
|
+
image: "image";
|
|
55
|
+
}>;
|
|
56
|
+
image: z.ZodOptional<z.ZodString>;
|
|
57
|
+
openPath: z.ZodOptional<z.ZodString>;
|
|
58
|
+
state: z.ZodEnum<{
|
|
59
|
+
error: "error";
|
|
60
|
+
starting: "starting";
|
|
61
|
+
stopped: "stopped";
|
|
62
|
+
ready: "ready";
|
|
63
|
+
}>;
|
|
64
|
+
port: z.ZodNumber;
|
|
65
|
+
route: z.ZodBoolean;
|
|
66
|
+
path: z.ZodString;
|
|
67
|
+
openUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodURL]>>;
|
|
68
|
+
error: z.ZodOptional<z.ZodString>;
|
|
69
|
+
log: z.ZodOptional<z.ZodString>;
|
|
70
|
+
}, z.core.$strict>;
|
|
71
|
+
export type LakeboxService = z.infer<typeof lakeboxServiceSchema>;
|
|
72
|
+
export declare const lakeboxSummarySchema: z.ZodObject<{
|
|
73
|
+
supported: z.ZodBoolean;
|
|
74
|
+
auto: z.ZodBoolean;
|
|
75
|
+
status: z.ZodEnum<{
|
|
76
|
+
error: "error";
|
|
77
|
+
missing: "missing";
|
|
78
|
+
unknown: "unknown";
|
|
79
|
+
starting: "starting";
|
|
80
|
+
running: "running";
|
|
81
|
+
stopping: "stopping";
|
|
82
|
+
stopped: "stopped";
|
|
83
|
+
}>;
|
|
84
|
+
id: z.ZodOptional<z.ZodString>;
|
|
85
|
+
name: z.ZodString;
|
|
86
|
+
idleTimeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
87
|
+
user: z.ZodObject<{
|
|
88
|
+
hash: z.ZodString;
|
|
89
|
+
name: z.ZodString;
|
|
90
|
+
uid: z.ZodNumber;
|
|
91
|
+
home: z.ZodString;
|
|
92
|
+
routePrefix: z.ZodString;
|
|
93
|
+
}, z.core.$strict>;
|
|
94
|
+
services: z.ZodArray<z.ZodObject<{
|
|
95
|
+
name: z.ZodString;
|
|
96
|
+
kind: z.ZodEnum<{
|
|
97
|
+
terminal: "terminal";
|
|
98
|
+
desktop: "desktop";
|
|
99
|
+
image: "image";
|
|
100
|
+
}>;
|
|
101
|
+
image: z.ZodOptional<z.ZodString>;
|
|
102
|
+
openPath: z.ZodOptional<z.ZodString>;
|
|
103
|
+
state: z.ZodEnum<{
|
|
104
|
+
error: "error";
|
|
105
|
+
starting: "starting";
|
|
106
|
+
stopped: "stopped";
|
|
107
|
+
ready: "ready";
|
|
108
|
+
}>;
|
|
109
|
+
port: z.ZodNumber;
|
|
110
|
+
route: z.ZodBoolean;
|
|
111
|
+
path: z.ZodString;
|
|
112
|
+
openUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodURL]>>;
|
|
113
|
+
error: z.ZodOptional<z.ZodString>;
|
|
114
|
+
log: z.ZodOptional<z.ZodString>;
|
|
115
|
+
}, z.core.$strict>>;
|
|
116
|
+
servicesStale: z.ZodBoolean;
|
|
117
|
+
servicesObservedAt: z.ZodOptional<z.ZodString>;
|
|
118
|
+
canStart: z.ZodBoolean;
|
|
119
|
+
canStop: z.ZodBoolean;
|
|
120
|
+
}, z.core.$strict>;
|
|
121
|
+
export type LakeboxSummary = z.infer<typeof lakeboxSummarySchema>;
|
|
122
|
+
export declare const lakeboxCommandRequestSchema: z.ZodObject<{
|
|
123
|
+
command: z.ZodString;
|
|
124
|
+
args: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
125
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
126
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
127
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
128
|
+
}, z.core.$strict>;
|
|
129
|
+
export type LakeboxCommandRequest = z.input<typeof lakeboxCommandRequestSchema>;
|
|
130
|
+
export declare const lakeboxCommandResultSchema: z.ZodObject<{
|
|
131
|
+
success: z.ZodBoolean;
|
|
132
|
+
exitCode: z.ZodNumber;
|
|
133
|
+
stdout: z.ZodString;
|
|
134
|
+
stderr: z.ZodString;
|
|
135
|
+
executionTimeMs: z.ZodNumber;
|
|
136
|
+
timedOut: z.ZodOptional<z.ZodBoolean>;
|
|
137
|
+
command: z.ZodString;
|
|
138
|
+
args: z.ZodArray<z.ZodString>;
|
|
139
|
+
}, z.core.$strict>;
|
|
140
|
+
export type LakeboxCommandResult = z.infer<typeof lakeboxCommandResultSchema>;
|
|
141
|
+
export declare const lakeboxServiceMountSchema: z.ZodObject<{
|
|
142
|
+
source: z.ZodString;
|
|
143
|
+
target: z.ZodString;
|
|
144
|
+
readOnly: z.ZodDefault<z.ZodBoolean>;
|
|
145
|
+
}, z.core.$strict>;
|
|
146
|
+
export type LakeboxServiceMount = z.input<typeof lakeboxServiceMountSchema>;
|
|
147
|
+
export declare const createLakeboxServiceRequestSchema: z.ZodObject<{
|
|
148
|
+
name: z.ZodString;
|
|
149
|
+
image: z.ZodString;
|
|
150
|
+
command: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
151
|
+
env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
152
|
+
workingDirectory: z.ZodOptional<z.ZodString>;
|
|
153
|
+
mounts: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
154
|
+
source: z.ZodString;
|
|
155
|
+
target: z.ZodString;
|
|
156
|
+
readOnly: z.ZodDefault<z.ZodBoolean>;
|
|
157
|
+
}, z.core.$strict>>>;
|
|
158
|
+
route: z.ZodDefault<z.ZodBoolean>;
|
|
159
|
+
openPath: z.ZodOptional<z.ZodString>;
|
|
160
|
+
stripPrefix: z.ZodDefault<z.ZodBoolean>;
|
|
161
|
+
pull: z.ZodDefault<z.ZodEnum<{
|
|
162
|
+
missing: "missing";
|
|
163
|
+
always: "always";
|
|
164
|
+
}>>;
|
|
165
|
+
}, z.core.$strict>;
|
|
166
|
+
export type CreateLakeboxServiceRequest = z.input<typeof createLakeboxServiceRequestSchema>;
|
|
167
|
+
export type LakeboxServiceDefinition = z.output<typeof createLakeboxServiceRequestSchema>;
|
|
168
|
+
export declare const lakeboxServiceActionSchema: z.ZodObject<{
|
|
169
|
+
name: z.ZodString;
|
|
170
|
+
}, z.core.$strict>;
|
|
171
|
+
export type LakeboxServiceAction = z.infer<typeof lakeboxServiceActionSchema>;
|
|
172
|
+
/** Default number of service log lines returned by bounded log reads. */
|
|
173
|
+
export declare const LAKEBOX_LOG_DEFAULT_MAX_LINES = 200;
|
|
174
|
+
/** Default service log character cap returned by bounded log reads. */
|
|
175
|
+
export declare const LAKEBOX_LOG_DEFAULT_MAX_CHARS = 16000;
|
|
176
|
+
export declare const lakeboxServiceLogsRequestSchema: z.ZodObject<{
|
|
177
|
+
name: z.ZodString;
|
|
178
|
+
maxLines: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
179
|
+
maxChars: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
180
|
+
}, z.core.$strict>;
|
|
181
|
+
export type LakeboxServiceLogsRequest = z.input<typeof lakeboxServiceLogsRequestSchema>;
|
|
182
|
+
export declare const lakeboxServiceLogsResponseSchema: z.ZodObject<{
|
|
183
|
+
log: z.ZodString;
|
|
184
|
+
}, z.core.$strict>;
|
|
185
|
+
export type LakeboxServiceLogsResponse = z.infer<typeof lakeboxServiceLogsResponseSchema>;
|
|
186
|
+
export declare const lakeboxServicesResponseSchema: z.ZodObject<{
|
|
187
|
+
services: z.ZodArray<z.ZodObject<{
|
|
188
|
+
name: z.ZodString;
|
|
189
|
+
kind: z.ZodEnum<{
|
|
190
|
+
terminal: "terminal";
|
|
191
|
+
desktop: "desktop";
|
|
192
|
+
image: "image";
|
|
193
|
+
}>;
|
|
194
|
+
image: z.ZodOptional<z.ZodString>;
|
|
195
|
+
openPath: z.ZodOptional<z.ZodString>;
|
|
196
|
+
state: z.ZodEnum<{
|
|
197
|
+
error: "error";
|
|
198
|
+
starting: "starting";
|
|
199
|
+
stopped: "stopped";
|
|
200
|
+
ready: "ready";
|
|
201
|
+
}>;
|
|
202
|
+
port: z.ZodNumber;
|
|
203
|
+
route: z.ZodBoolean;
|
|
204
|
+
path: z.ZodString;
|
|
205
|
+
openUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodURL]>>;
|
|
206
|
+
error: z.ZodOptional<z.ZodString>;
|
|
207
|
+
log: z.ZodOptional<z.ZodString>;
|
|
208
|
+
}, z.core.$strict>>;
|
|
209
|
+
}, z.core.$strict>;
|
|
210
|
+
export type LakeboxServicesResponse = z.infer<typeof lakeboxServicesResponseSchema>;
|
|
211
|
+
export declare const lakeboxServiceResponseSchema: z.ZodObject<{
|
|
212
|
+
service: z.ZodObject<{
|
|
213
|
+
name: z.ZodString;
|
|
214
|
+
kind: z.ZodEnum<{
|
|
215
|
+
terminal: "terminal";
|
|
216
|
+
desktop: "desktop";
|
|
217
|
+
image: "image";
|
|
218
|
+
}>;
|
|
219
|
+
image: z.ZodOptional<z.ZodString>;
|
|
220
|
+
openPath: z.ZodOptional<z.ZodString>;
|
|
221
|
+
state: z.ZodEnum<{
|
|
222
|
+
error: "error";
|
|
223
|
+
starting: "starting";
|
|
224
|
+
stopped: "stopped";
|
|
225
|
+
ready: "ready";
|
|
226
|
+
}>;
|
|
227
|
+
port: z.ZodNumber;
|
|
228
|
+
route: z.ZodBoolean;
|
|
229
|
+
path: z.ZodString;
|
|
230
|
+
openUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodURL]>>;
|
|
231
|
+
error: z.ZodOptional<z.ZodString>;
|
|
232
|
+
log: z.ZodOptional<z.ZodString>;
|
|
233
|
+
}, z.core.$strict>;
|
|
234
|
+
}, z.core.$strict>;
|
|
235
|
+
export type LakeboxServiceResponse = z.infer<typeof lakeboxServiceResponseSchema>;
|
|
236
|
+
export declare const removeLakeboxServiceResponseSchema: z.ZodObject<{
|
|
237
|
+
removed: z.ZodBoolean;
|
|
238
|
+
}, z.core.$strict>;
|
|
239
|
+
export type RemoveLakeboxServiceResponse = z.infer<typeof removeLakeboxServiceResponseSchema>;
|
|
240
|
+
export declare const lakeboxMetricsSnapshotSchema: z.ZodObject<{
|
|
241
|
+
at: z.ZodString;
|
|
242
|
+
cpu: z.ZodObject<{
|
|
243
|
+
cores: z.ZodNumber;
|
|
244
|
+
usedPercent: z.ZodNumber;
|
|
245
|
+
load1: z.ZodNumber;
|
|
246
|
+
}, z.core.$strict>;
|
|
247
|
+
memory: z.ZodObject<{
|
|
248
|
+
totalBytes: z.ZodNumber;
|
|
249
|
+
usedBytes: z.ZodNumber;
|
|
250
|
+
}, z.core.$strict>;
|
|
251
|
+
storage: z.ZodObject<{
|
|
252
|
+
totalBytes: z.ZodNumber;
|
|
253
|
+
usedBytes: z.ZodNumber;
|
|
254
|
+
}, z.core.$strict>;
|
|
255
|
+
network: z.ZodObject<{
|
|
256
|
+
rxBytesPerSecond: z.ZodNumber;
|
|
257
|
+
txBytesPerSecond: z.ZodNumber;
|
|
258
|
+
}, z.core.$strict>;
|
|
259
|
+
}, z.core.$strict>;
|
|
260
|
+
export type LakeboxMetricsSnapshot = z.infer<typeof lakeboxMetricsSnapshotSchema>;
|
|
261
|
+
export declare const lakeboxMetricsResponseSchema: z.ZodObject<{
|
|
262
|
+
status: z.ZodEnum<{
|
|
263
|
+
error: "error";
|
|
264
|
+
missing: "missing";
|
|
265
|
+
unknown: "unknown";
|
|
266
|
+
starting: "starting";
|
|
267
|
+
running: "running";
|
|
268
|
+
stopping: "stopping";
|
|
269
|
+
stopped: "stopped";
|
|
270
|
+
}>;
|
|
271
|
+
series: z.ZodArray<z.ZodObject<{
|
|
272
|
+
at: z.ZodString;
|
|
273
|
+
cpu: z.ZodObject<{
|
|
274
|
+
cores: z.ZodNumber;
|
|
275
|
+
usedPercent: z.ZodNumber;
|
|
276
|
+
load1: z.ZodNumber;
|
|
277
|
+
}, z.core.$strict>;
|
|
278
|
+
memory: z.ZodObject<{
|
|
279
|
+
totalBytes: z.ZodNumber;
|
|
280
|
+
usedBytes: z.ZodNumber;
|
|
281
|
+
}, z.core.$strict>;
|
|
282
|
+
storage: z.ZodObject<{
|
|
283
|
+
totalBytes: z.ZodNumber;
|
|
284
|
+
usedBytes: z.ZodNumber;
|
|
285
|
+
}, z.core.$strict>;
|
|
286
|
+
network: z.ZodObject<{
|
|
287
|
+
rxBytesPerSecond: z.ZodNumber;
|
|
288
|
+
txBytesPerSecond: z.ZodNumber;
|
|
289
|
+
}, z.core.$strict>;
|
|
290
|
+
}, z.core.$strict>>;
|
|
291
|
+
}, z.core.$strict>;
|
|
292
|
+
export type LakeboxMetricsResponse = z.infer<typeof lakeboxMetricsResponseSchema>;
|
|
293
|
+
export declare const getLakeboxOperationSchema: z.ZodObject<{}, z.core.$strict>;
|
|
294
|
+
export declare const executeLakeboxCommandOperationSchema: z.ZodObject<{
|
|
295
|
+
command: z.ZodString;
|
|
296
|
+
args: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
297
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
298
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
299
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
300
|
+
}, z.core.$strict>;
|
|
301
|
+
export declare const listLakeboxServicesOperationSchema: z.ZodObject<{}, z.core.$strict>;
|
|
302
|
+
export declare const createLakeboxServiceOperationSchema: z.ZodObject<{
|
|
303
|
+
name: z.ZodString;
|
|
304
|
+
image: z.ZodString;
|
|
305
|
+
command: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
306
|
+
env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
307
|
+
workingDirectory: z.ZodOptional<z.ZodString>;
|
|
308
|
+
mounts: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
309
|
+
source: z.ZodString;
|
|
310
|
+
target: z.ZodString;
|
|
311
|
+
readOnly: z.ZodDefault<z.ZodBoolean>;
|
|
312
|
+
}, z.core.$strict>>>;
|
|
313
|
+
route: z.ZodDefault<z.ZodBoolean>;
|
|
314
|
+
openPath: z.ZodOptional<z.ZodString>;
|
|
315
|
+
stripPrefix: z.ZodDefault<z.ZodBoolean>;
|
|
316
|
+
pull: z.ZodDefault<z.ZodEnum<{
|
|
317
|
+
missing: "missing";
|
|
318
|
+
always: "always";
|
|
319
|
+
}>>;
|
|
320
|
+
}, z.core.$strict>;
|
|
321
|
+
export declare const startLakeboxServiceOperationSchema: z.ZodObject<{
|
|
322
|
+
name: z.ZodString;
|
|
323
|
+
}, z.core.$strict>;
|
|
324
|
+
export declare const stopLakeboxServiceOperationSchema: z.ZodObject<{
|
|
325
|
+
name: z.ZodString;
|
|
326
|
+
}, z.core.$strict>;
|
|
327
|
+
export declare const removeLakeboxServiceOperationSchema: z.ZodObject<{
|
|
328
|
+
name: z.ZodString;
|
|
329
|
+
}, z.core.$strict>;
|
|
330
|
+
export declare const getLakeboxServiceLogsOperationSchema: z.ZodObject<{
|
|
331
|
+
name: z.ZodString;
|
|
332
|
+
maxLines: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
333
|
+
maxChars: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
334
|
+
}, z.core.$strict>;
|