lopata 0.15.0 → 0.16.1

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.
Files changed (118) hide show
  1. package/dist/types/api/cors.d.ts +2 -0
  2. package/dist/types/api/dispatch.d.ts +393 -0
  3. package/dist/types/api/generate-sql.d.ts +3 -0
  4. package/dist/types/api/handlers/ai.d.ts +21 -0
  5. package/dist/types/api/handlers/analytics-engine.d.ts +18 -0
  6. package/dist/types/api/handlers/cache.d.ts +11 -0
  7. package/dist/types/api/handlers/config.d.ts +14 -0
  8. package/dist/types/api/handlers/containers.d.ts +26 -0
  9. package/dist/types/api/handlers/d1.d.ts +17 -0
  10. package/dist/types/api/handlers/do.d.ts +44 -0
  11. package/dist/types/api/handlers/email.d.ts +26 -0
  12. package/dist/types/api/handlers/errors.d.ts +38 -0
  13. package/dist/types/api/handlers/generations.d.ts +27 -0
  14. package/dist/types/api/handlers/hosts.d.ts +4 -0
  15. package/dist/types/api/handlers/kv.d.ts +25 -0
  16. package/dist/types/api/handlers/overview.d.ts +4 -0
  17. package/dist/types/api/handlers/queue.d.ts +22 -0
  18. package/dist/types/api/handlers/r2.d.ts +19 -0
  19. package/dist/types/api/handlers/routes.d.ts +4 -0
  20. package/dist/types/api/handlers/scheduled.d.ts +13 -0
  21. package/dist/types/api/handlers/traces.d.ts +63 -0
  22. package/dist/types/api/handlers/warnings.d.ts +4 -0
  23. package/dist/types/api/handlers/workers.d.ts +4 -0
  24. package/dist/types/api/handlers/workflows.d.ts +53 -0
  25. package/dist/types/api/index.d.ts +13 -0
  26. package/dist/types/api/r2.d.ts +2 -0
  27. package/dist/types/api/types.d.ts +369 -0
  28. package/dist/types/bindings/ai.d.ts +20 -0
  29. package/dist/types/bindings/analytics-engine.d.ts +17 -0
  30. package/dist/types/bindings/browser.d.ts +35 -0
  31. package/dist/types/bindings/cache.d.ts +28 -0
  32. package/dist/types/bindings/cf-streams.d.ts +17 -0
  33. package/dist/types/bindings/container-docker.d.ts +54 -0
  34. package/dist/types/bindings/container.d.ts +189 -0
  35. package/dist/types/bindings/crypto-extras.d.ts +22 -0
  36. package/dist/types/bindings/d1.d.ts +51 -0
  37. package/dist/types/bindings/do-executor-inprocess.d.ts +25 -0
  38. package/dist/types/bindings/do-executor-worker.d.ts +129 -0
  39. package/dist/types/bindings/do-executor.d.ts +39 -0
  40. package/dist/types/bindings/do-websocket-bridge.d.ts +60 -0
  41. package/dist/types/bindings/do-worker-entry.d.ts +7 -0
  42. package/dist/types/bindings/do-worker-env.d.ts +23 -0
  43. package/dist/types/bindings/durable-object.d.ts +233 -0
  44. package/dist/types/bindings/email.d.ts +42 -0
  45. package/dist/types/bindings/html-rewriter.d.ts +12 -0
  46. package/dist/types/bindings/hyperdrive.d.ts +28 -0
  47. package/dist/types/bindings/images.d.ts +70 -0
  48. package/dist/types/bindings/kv.d.ts +59 -0
  49. package/dist/types/bindings/media.d.ts +32 -0
  50. package/dist/types/bindings/queue.d.ts +111 -0
  51. package/dist/types/bindings/r2.d.ts +184 -0
  52. package/dist/types/bindings/rpc-stub.d.ts +39 -0
  53. package/dist/types/bindings/scheduled.d.ts +25 -0
  54. package/dist/types/bindings/service-binding.d.ts +42 -0
  55. package/dist/types/bindings/static-assets.d.ts +74 -0
  56. package/dist/types/bindings/websocket-pair.d.ts +66 -0
  57. package/dist/types/bindings/workflow.d.ts +134 -0
  58. package/dist/types/cli/cache.d.ts +2 -0
  59. package/dist/types/cli/context.d.ts +38 -0
  60. package/dist/types/cli/d1.d.ts +11 -0
  61. package/dist/types/cli/dev.d.ts +3 -0
  62. package/dist/types/cli/hosts.d.ts +2 -0
  63. package/dist/types/cli/kv.d.ts +2 -0
  64. package/dist/types/cli/queues.d.ts +2 -0
  65. package/dist/types/cli/r2.d.ts +2 -0
  66. package/dist/types/cli/traces.d.ts +2 -0
  67. package/dist/types/cli.d.ts +2 -0
  68. package/dist/types/config.d.ts +126 -0
  69. package/dist/types/d1-migrate.d.ts +10 -0
  70. package/dist/types/dashboard-serve.d.ts +1 -0
  71. package/dist/types/db.d.ts +13 -0
  72. package/dist/types/env.d.ts +60 -0
  73. package/dist/types/error-page-render.d.ts +2 -0
  74. package/dist/types/execution-context.d.ts +11 -0
  75. package/dist/types/file-watcher.d.ts +12 -0
  76. package/dist/types/generation-manager.d.ts +61 -0
  77. package/dist/types/generation.d.ts +92 -0
  78. package/dist/types/hosts-check.d.ts +21 -0
  79. package/dist/types/lopata-config.d.ts +43 -0
  80. package/dist/types/plugin.d.ts +1 -0
  81. package/dist/types/request-cf.d.ts +1 -0
  82. package/dist/types/route-matcher.d.ts +57 -0
  83. package/dist/types/rpc-validate.d.ts +16 -0
  84. package/dist/types/s3/chunked.d.ts +21 -0
  85. package/dist/types/s3/headers.d.ts +35 -0
  86. package/dist/types/s3/proxy.d.ts +43 -0
  87. package/dist/types/s3/xml.d.ts +96 -0
  88. package/dist/types/setup-globals.d.ts +9 -0
  89. package/dist/types/testing/clock.d.ts +11 -0
  90. package/dist/types/testing/durable-object.d.ts +96 -0
  91. package/dist/types/testing/env-builder.d.ts +38 -0
  92. package/dist/types/testing/fetch-mock.d.ts +39 -0
  93. package/dist/types/testing/index.d.ts +9 -0
  94. package/dist/types/testing/setup.d.ts +19 -0
  95. package/dist/types/testing/types.d.ts +76 -0
  96. package/dist/types/testing/workflow.d.ts +110 -0
  97. package/dist/types/tracing/context.d.ts +21 -0
  98. package/dist/types/tracing/db.d.ts +3 -0
  99. package/dist/types/tracing/frames.d.ts +15 -0
  100. package/dist/types/tracing/instrument.d.ts +22 -0
  101. package/dist/types/tracing/span.d.ts +16 -0
  102. package/dist/types/tracing/store.d.ts +129 -0
  103. package/dist/types/tracing/types.d.ts +50 -0
  104. package/dist/types/tsconfig.tsbuildinfo +1 -0
  105. package/dist/types/virtual-modules.d.ts +9 -0
  106. package/dist/types/vite-plugin/config-plugin.d.ts +7 -0
  107. package/dist/types/vite-plugin/dev-server-plugin.d.ts +31 -0
  108. package/dist/types/vite-plugin/globals-plugin.d.ts +9 -0
  109. package/dist/types/vite-plugin/index.d.ts +30 -0
  110. package/dist/types/vite-plugin/modules-plugin.d.ts +8 -0
  111. package/dist/types/vite-plugin/react-router-plugin.d.ts +16 -0
  112. package/dist/types/warnings.d.ts +7 -0
  113. package/dist/types/worker-registry.d.ts +25 -0
  114. package/package.json +23 -5
  115. package/src/cli/dev.ts +3 -32
  116. package/src/s3/proxy.ts +50 -0
  117. package/src/tsconfig.json +1 -1
  118. package/src/vite-plugin/dev-server-plugin.ts +27 -0
@@ -0,0 +1,2 @@
1
+ export declare function withCors(response: Response): Response;
2
+ export declare function handlePreflight(): Response;
@@ -0,0 +1,393 @@
1
+ import type { HandlerContext } from './types';
2
+ declare const allHandlers: {
3
+ 'hosts.check'(_input: {}, ctx: HandlerContext): import("./types").HostsCheckResponse;
4
+ 'routes.list'(_input: {}, ctx: HandlerContext): import("./types").RouteInfo[];
5
+ 'warnings.optionalDeps'(_input: {}): import("../warnings").OptionalDep[];
6
+ 'analyticsEngine.list'({ dataset, limit }: {
7
+ dataset?: string;
8
+ limit?: number;
9
+ }): import("./types").AnalyticsEngineDataPoint[];
10
+ 'analyticsEngine.get'({ id }: {
11
+ id: string;
12
+ }): import("./types").AnalyticsEngineDataPoint | null;
13
+ 'analyticsEngine.delete'({ id }: {
14
+ id: string;
15
+ }): import("./types").OkResponse;
16
+ 'analyticsEngine.datasets'(_input: {}): string[];
17
+ 'analyticsEngine.stats'(_input: {}): {
18
+ total: number;
19
+ byDataset: Record<string, number>;
20
+ };
21
+ 'ai.list'({ model, status, limit }: {
22
+ model?: string;
23
+ status?: string;
24
+ limit?: number;
25
+ }): import("./types").AiRequest[];
26
+ 'ai.get'({ id }: {
27
+ id: string;
28
+ }): import("./types").AiRequest | null;
29
+ 'ai.delete'({ id }: {
30
+ id: string;
31
+ }): import("./types").OkResponse;
32
+ 'ai.stats'(_input: {}): {
33
+ total: number;
34
+ byModel: Record<string, number>;
35
+ byStatus: Record<string, number>;
36
+ avgDuration: number;
37
+ };
38
+ 'ai.models'(_input: {}): string[];
39
+ 'email.list'({ status, limit }: {
40
+ status?: string;
41
+ limit?: number;
42
+ }): import("./types").EmailRecord[];
43
+ 'email.get'({ id }: {
44
+ id: string;
45
+ }): {
46
+ record: import("./types").EmailRecord;
47
+ raw: string;
48
+ } | null;
49
+ 'email.delete'({ id }: {
50
+ id: string;
51
+ }): import("./types").OkResponse;
52
+ 'email.trigger'({ from, to, subject, body }: {
53
+ from: string;
54
+ to: string;
55
+ subject?: string;
56
+ body?: string;
57
+ }, ctx: HandlerContext): Promise<import("./types").OkResponse>;
58
+ 'email.stats'(_input: {}, _ctx: HandlerContext): {
59
+ total: number;
60
+ byStatus: Record<string, number>;
61
+ };
62
+ 'scheduled.listTriggers'(_input: {}, ctx: HandlerContext): import("./handlers/scheduled").ScheduledTrigger[];
63
+ 'scheduled.trigger'({ cron, workerName }: {
64
+ cron: string;
65
+ workerName?: string | null;
66
+ }, ctx: HandlerContext): Promise<import("./types").OkResponse>;
67
+ 'errors.list'(input: {
68
+ limit?: number;
69
+ cursor?: string;
70
+ }): {
71
+ items: Array<{
72
+ id: string;
73
+ timestamp: number;
74
+ errorName: string;
75
+ errorMessage: string;
76
+ requestMethod: string | null;
77
+ requestUrl: string | null;
78
+ workerName: string | null;
79
+ traceId: string | null;
80
+ spanId: string | null;
81
+ source: string | null;
82
+ }>;
83
+ cursor: string | null;
84
+ };
85
+ 'errors.get'(input: {
86
+ id: string;
87
+ }): {
88
+ id: string;
89
+ timestamp: number;
90
+ traceId: string | null;
91
+ spanId: string | null;
92
+ source: string | null;
93
+ data: unknown;
94
+ };
95
+ 'errors.delete'(input: {
96
+ id: string;
97
+ }): {
98
+ ok: true;
99
+ };
100
+ 'errors.clear'(_input: {}): {
101
+ ok: true;
102
+ };
103
+ 'config.forService'({ type }: {
104
+ type: string;
105
+ }, ctx: HandlerContext): import("./handlers/config").ConfigGroup[];
106
+ 'traces.list'(input: {
107
+ limit?: number;
108
+ cursor?: string;
109
+ }): {
110
+ items: import("./types").TraceSummary[];
111
+ cursor: string | null;
112
+ };
113
+ 'traces.getTrace'(input: {
114
+ traceId: string;
115
+ }): import("./types").TraceDetail;
116
+ 'traces.search'(input: {
117
+ query: string;
118
+ limit?: number;
119
+ }): {
120
+ items: import("./types").TraceSummary[];
121
+ cursor: string | null;
122
+ };
123
+ 'traces.listSpans'(input: {
124
+ limit?: number;
125
+ cursor?: string;
126
+ }): {
127
+ items: Array<{
128
+ spanId: string;
129
+ traceId: string;
130
+ name: string;
131
+ status: string;
132
+ durationMs: number | null;
133
+ startTime: number;
134
+ workerName: string | null;
135
+ }>;
136
+ cursor: string | null;
137
+ };
138
+ 'traces.listLogs'(input: {
139
+ limit?: number;
140
+ cursor?: string;
141
+ }): {
142
+ items: Array<{
143
+ id: number;
144
+ spanId: string;
145
+ traceId: string;
146
+ timestamp: number;
147
+ name: string;
148
+ level: string | null;
149
+ message: string | null;
150
+ }>;
151
+ cursor: string | null;
152
+ };
153
+ 'traces.errors'(input: {
154
+ traceId: string;
155
+ }): {
156
+ id: string;
157
+ timestamp: number;
158
+ errorName: string;
159
+ errorMessage: string;
160
+ source: string | null;
161
+ data: unknown;
162
+ }[];
163
+ 'traces.clear'(_input: {}): {
164
+ ok: true;
165
+ };
166
+ 'containers.list'(_input: {}, ctx: HandlerContext): Promise<import("./types").ContainerSummary[]>;
167
+ 'containers.listInstances'({ className }: {
168
+ className: string;
169
+ }, _ctx: HandlerContext): Promise<import("./types").ContainerInstance[]>;
170
+ 'containers.getDetail'({ className, id }: {
171
+ className: string;
172
+ id: string;
173
+ }, ctx: HandlerContext): Promise<import("./types").ContainerDetail>;
174
+ 'containers.getLogs'({ className, id, tail }: {
175
+ className: string;
176
+ id: string;
177
+ tail?: number;
178
+ }): Promise<{
179
+ logs: string;
180
+ }>;
181
+ 'containers.stop'({ className, id }: {
182
+ className: string;
183
+ id: string;
184
+ }, ctx: HandlerContext): Promise<import("./types").OkResponse>;
185
+ 'containers.destroy'({ className, id }: {
186
+ className: string;
187
+ id: string;
188
+ }, ctx: HandlerContext): Promise<import("./types").OkResponse>;
189
+ 'workers.list'(_input: {}, ctx: HandlerContext): import("./types").WorkerInfo[];
190
+ 'generations.detail'(input: {
191
+ id: number;
192
+ workerName?: string;
193
+ }, ctx: HandlerContext): import("./types").GenerationDetail;
194
+ 'generations.list'(_input: {}, ctx: HandlerContext): import("./types").GenerationsData;
195
+ 'generations.reload'(input: {
196
+ workerName?: string;
197
+ }, ctx: HandlerContext): Promise<{
198
+ ok: true;
199
+ generation: import("./types").GenerationInfo;
200
+ }>;
201
+ 'generations.drain'(input: {
202
+ workerName?: string;
203
+ }, ctx: HandlerContext): {
204
+ ok: true;
205
+ stoppedGeneration: number;
206
+ };
207
+ 'generations.config'({ gracePeriodMs, workerName }: {
208
+ gracePeriodMs: number;
209
+ workerName?: string;
210
+ }, ctx: HandlerContext): {
211
+ ok: true;
212
+ gracePeriodMs: number;
213
+ };
214
+ 'cache.listCaches'(_input: {}): import("./types").CacheName[];
215
+ 'cache.listEntries'({ name }: {
216
+ name: string;
217
+ }): import("./types").CacheEntry[];
218
+ 'cache.deleteEntry'({ name, url }: {
219
+ name: string;
220
+ url: string;
221
+ }): import("./types").OkResponse;
222
+ 'd1.listDatabases'(_input: {}, ctx: HandlerContext): import("./types").D1Database[];
223
+ 'd1.listTables'({ dbName }: {
224
+ dbName: string;
225
+ }): import("./types").D1Table[];
226
+ 'd1.generateSql'({ dbName, prompt }: {
227
+ dbName: string;
228
+ prompt: string;
229
+ }, ctx: HandlerContext): Promise<{
230
+ sql: string;
231
+ }>;
232
+ 'd1.query'({ dbName, sql }: {
233
+ dbName: string;
234
+ sql: string;
235
+ }): import("./types").QueryResult;
236
+ 'workflows.list'(_input: {}, ctx: HandlerContext): import("./types").WorkflowSummary[];
237
+ 'workflows.listInstances'({ name, status }: {
238
+ name: string;
239
+ status?: string;
240
+ }): import("./types").WorkflowInstance[];
241
+ 'workflows.getInstance'({ id }: {
242
+ name: string;
243
+ id: string;
244
+ }): import("./types").WorkflowDetail;
245
+ 'workflows.terminate'({ name, id }: {
246
+ name: string;
247
+ id: string;
248
+ }, ctx: HandlerContext): Promise<import("./types").OkResponse>;
249
+ 'workflows.create'({ name, params }: {
250
+ name: string;
251
+ params: string;
252
+ }, ctx: HandlerContext): Promise<{
253
+ ok: true;
254
+ id: string;
255
+ }>;
256
+ 'workflows.pause'({ name, id }: {
257
+ name: string;
258
+ id: string;
259
+ }, ctx: HandlerContext): Promise<import("./types").OkResponse>;
260
+ 'workflows.resume'({ name, id }: {
261
+ name: string;
262
+ id: string;
263
+ }, ctx: HandlerContext): Promise<import("./types").OkResponse>;
264
+ 'workflows.restart'({ name, id, fromStep }: {
265
+ name: string;
266
+ id: string;
267
+ fromStep?: string;
268
+ }, ctx: HandlerContext): Promise<import("./types").OkResponse>;
269
+ 'workflows.skipSleep'({ name, id }: {
270
+ name: string;
271
+ id: string;
272
+ }, ctx: HandlerContext): Promise<import("./types").OkResponse>;
273
+ 'workflows.sendEvent'({ name, id, type, payload }: {
274
+ name: string;
275
+ id: string;
276
+ type: string;
277
+ payload?: string;
278
+ }, ctx: HandlerContext): Promise<import("./types").OkResponse>;
279
+ 'workflows.duplicate'({ name, id }: {
280
+ name: string;
281
+ id: string;
282
+ }, ctx: HandlerContext): Promise<{
283
+ ok: true;
284
+ id: string;
285
+ }>;
286
+ 'do.listNamespaces'(_input: {}, ctx: HandlerContext): import("./types").DoNamespace[];
287
+ 'do.listInstances'({ ns }: {
288
+ ns: string;
289
+ }): import("./types").DoInstance[];
290
+ 'do.getInstance'({ ns, id }: {
291
+ ns: string;
292
+ id: string;
293
+ }, ctx: HandlerContext): import("./types").DoDetail;
294
+ 'do.deleteEntry'({ ns, id, key }: {
295
+ ns: string;
296
+ id: string;
297
+ key: string;
298
+ }): import("./types").OkResponse;
299
+ 'do.listSqlTables'({ ns, id }: {
300
+ ns: string;
301
+ id: string;
302
+ }): import("./types").D1Table[];
303
+ 'do.triggerAlarm'({ ns, id }: {
304
+ ns: string;
305
+ id: string;
306
+ }, ctx: HandlerContext): Promise<import("./types").OkResponse>;
307
+ 'do.cancelAlarm'({ ns, id }: {
308
+ ns: string;
309
+ id: string;
310
+ }, ctx: HandlerContext): import("./types").OkResponse;
311
+ 'do.deleteInstance'({ ns, id }: {
312
+ ns: string;
313
+ id: string;
314
+ }, ctx: HandlerContext): import("./types").OkResponse;
315
+ 'do.generateSql'({ ns, id, prompt }: {
316
+ ns: string;
317
+ id: string;
318
+ prompt: string;
319
+ }, ctx: HandlerContext): Promise<{
320
+ sql: string;
321
+ }>;
322
+ 'do.sqlQuery'({ ns, id, sql }: {
323
+ ns: string;
324
+ id: string;
325
+ sql: string;
326
+ }): import("./types").QueryResult;
327
+ 'queue.listQueues'(_input: {}, ctx: HandlerContext): import("./types").QueueInfo[];
328
+ 'queue.listMessages'({ queue, limit, status }: {
329
+ queue: string;
330
+ limit?: number;
331
+ status?: string;
332
+ }): import("./types").QueueMessage[];
333
+ 'queue.deleteMessage'({ queue, id }: {
334
+ queue: string;
335
+ id: string;
336
+ }): import("./types").OkResponse;
337
+ 'queue.publishMessage'({ queue, body, contentType }: {
338
+ queue: string;
339
+ body: string;
340
+ contentType?: string;
341
+ }): import("./types").OkResponse;
342
+ 'queue.requeueMessage'({ queue, id }: {
343
+ queue: string;
344
+ id: string;
345
+ }): import("./types").OkResponse;
346
+ 'r2.listBuckets'(_input: {}, ctx: HandlerContext): import("./types").R2Bucket[];
347
+ 'r2.listObjects'({ bucket, limit, cursor, prefix }: {
348
+ bucket: string;
349
+ limit?: number;
350
+ cursor?: string;
351
+ prefix?: string;
352
+ }): import("./types").Paginated<import("./types").R2Object>;
353
+ 'r2.deleteObject'({ bucket, key }: {
354
+ bucket: string;
355
+ key: string;
356
+ }): import("./types").OkResponse;
357
+ 'r2.renameObject'({ bucket, oldKey, newKey }: {
358
+ bucket: string;
359
+ oldKey: string;
360
+ newKey: string;
361
+ }): Promise<import("./types").OkResponse>;
362
+ 'kv.listNamespaces'(_input: {}, ctx: HandlerContext): import("./types").KvNamespace[];
363
+ 'kv.listKeys'({ ns, limit, cursor, prefix }: {
364
+ ns: string;
365
+ limit?: number;
366
+ cursor?: string;
367
+ prefix?: string;
368
+ }): import("./types").Paginated<import("./types").KvKey>;
369
+ 'kv.getKey'({ ns, key }: {
370
+ ns: string;
371
+ key: string;
372
+ }): import("./types").KvValue;
373
+ 'kv.putKey'({ ns, key, value, metadata, expirationTtl }: {
374
+ ns: string;
375
+ key: string;
376
+ value: string;
377
+ metadata?: string;
378
+ expirationTtl?: number;
379
+ }): import("./types").OkResponse;
380
+ 'kv.deleteKey'({ ns, key }: {
381
+ ns: string;
382
+ key: string;
383
+ }): import("./types").OkResponse;
384
+ 'overview.get'(_input: {}, ctx: HandlerContext): import("./types").OverviewData;
385
+ };
386
+ export type Procedures = {
387
+ [K in keyof typeof allHandlers]: {
388
+ input: Parameters<(typeof allHandlers)[K]>[0];
389
+ output: Awaited<ReturnType<(typeof allHandlers)[K]>>;
390
+ };
391
+ };
392
+ export declare function dispatch(request: Request, ctx: HandlerContext): Promise<Response>;
393
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { Database } from 'bun:sqlite';
2
+ import type { LopataConfig } from '../lopata-config';
3
+ export declare function generateSqlFromPrompt(db: Database, prompt: string, lopataConfig: LopataConfig | null): Promise<string>;
@@ -0,0 +1,21 @@
1
+ import type { AiRequest, OkResponse } from '../types';
2
+ export declare const handlers: {
3
+ 'ai.list'({ model, status, limit }: {
4
+ model?: string;
5
+ status?: string;
6
+ limit?: number;
7
+ }): AiRequest[];
8
+ 'ai.get'({ id }: {
9
+ id: string;
10
+ }): AiRequest | null;
11
+ 'ai.delete'({ id }: {
12
+ id: string;
13
+ }): OkResponse;
14
+ 'ai.stats'(_input: {}): {
15
+ total: number;
16
+ byModel: Record<string, number>;
17
+ byStatus: Record<string, number>;
18
+ avgDuration: number;
19
+ };
20
+ 'ai.models'(_input: {}): string[];
21
+ };
@@ -0,0 +1,18 @@
1
+ import type { AnalyticsEngineDataPoint as AEDataPoint, OkResponse } from '../types';
2
+ export declare const handlers: {
3
+ 'analyticsEngine.list'({ dataset, limit }: {
4
+ dataset?: string;
5
+ limit?: number;
6
+ }): AEDataPoint[];
7
+ 'analyticsEngine.get'({ id }: {
8
+ id: string;
9
+ }): AEDataPoint | null;
10
+ 'analyticsEngine.delete'({ id }: {
11
+ id: string;
12
+ }): OkResponse;
13
+ 'analyticsEngine.datasets'(_input: {}): string[];
14
+ 'analyticsEngine.stats'(_input: {}): {
15
+ total: number;
16
+ byDataset: Record<string, number>;
17
+ };
18
+ };
@@ -0,0 +1,11 @@
1
+ import type { CacheEntry, CacheName, OkResponse } from '../types';
2
+ export declare const handlers: {
3
+ 'cache.listCaches'(_input: {}): CacheName[];
4
+ 'cache.listEntries'({ name }: {
5
+ name: string;
6
+ }): CacheEntry[];
7
+ 'cache.deleteEntry'({ name, url }: {
8
+ name: string;
9
+ url: string;
10
+ }): OkResponse;
11
+ };
@@ -0,0 +1,14 @@
1
+ import type { HandlerContext } from '../types';
2
+ export interface ConfigItem {
3
+ name: string;
4
+ value: string;
5
+ }
6
+ export interface ConfigGroup {
7
+ title: string;
8
+ items: ConfigItem[];
9
+ }
10
+ export declare const handlers: {
11
+ 'config.forService'({ type }: {
12
+ type: string;
13
+ }, ctx: HandlerContext): ConfigGroup[];
14
+ };
@@ -0,0 +1,26 @@
1
+ import type { ContainerDetail, ContainerInstance, ContainerSummary, HandlerContext, OkResponse } from '../types';
2
+ export declare const handlers: {
3
+ 'containers.list'(_input: {}, ctx: HandlerContext): Promise<ContainerSummary[]>;
4
+ 'containers.listInstances'({ className }: {
5
+ className: string;
6
+ }, _ctx: HandlerContext): Promise<ContainerInstance[]>;
7
+ 'containers.getDetail'({ className, id }: {
8
+ className: string;
9
+ id: string;
10
+ }, ctx: HandlerContext): Promise<ContainerDetail>;
11
+ 'containers.getLogs'({ className, id, tail }: {
12
+ className: string;
13
+ id: string;
14
+ tail?: number;
15
+ }): Promise<{
16
+ logs: string;
17
+ }>;
18
+ 'containers.stop'({ className, id }: {
19
+ className: string;
20
+ id: string;
21
+ }, ctx: HandlerContext): Promise<OkResponse>;
22
+ 'containers.destroy'({ className, id }: {
23
+ className: string;
24
+ id: string;
25
+ }, ctx: HandlerContext): Promise<OkResponse>;
26
+ };
@@ -0,0 +1,17 @@
1
+ import type { D1Database as D1DatabaseInfo, D1Table, HandlerContext, QueryResult } from '../types';
2
+ export declare const handlers: {
3
+ 'd1.listDatabases'(_input: {}, ctx: HandlerContext): D1DatabaseInfo[];
4
+ 'd1.listTables'({ dbName }: {
5
+ dbName: string;
6
+ }): D1Table[];
7
+ 'd1.generateSql'({ dbName, prompt }: {
8
+ dbName: string;
9
+ prompt: string;
10
+ }, ctx: HandlerContext): Promise<{
11
+ sql: string;
12
+ }>;
13
+ 'd1.query'({ dbName, sql }: {
14
+ dbName: string;
15
+ sql: string;
16
+ }): QueryResult;
17
+ };
@@ -0,0 +1,44 @@
1
+ import type { D1Table, DoDetail, DoInstance, DoNamespace, HandlerContext, OkResponse, QueryResult } from '../types';
2
+ export declare const handlers: {
3
+ 'do.listNamespaces'(_input: {}, ctx: HandlerContext): DoNamespace[];
4
+ 'do.listInstances'({ ns }: {
5
+ ns: string;
6
+ }): DoInstance[];
7
+ 'do.getInstance'({ ns, id }: {
8
+ ns: string;
9
+ id: string;
10
+ }, ctx: HandlerContext): DoDetail;
11
+ 'do.deleteEntry'({ ns, id, key }: {
12
+ ns: string;
13
+ id: string;
14
+ key: string;
15
+ }): OkResponse;
16
+ 'do.listSqlTables'({ ns, id }: {
17
+ ns: string;
18
+ id: string;
19
+ }): D1Table[];
20
+ 'do.triggerAlarm'({ ns, id }: {
21
+ ns: string;
22
+ id: string;
23
+ }, ctx: HandlerContext): Promise<OkResponse>;
24
+ 'do.cancelAlarm'({ ns, id }: {
25
+ ns: string;
26
+ id: string;
27
+ }, ctx: HandlerContext): OkResponse;
28
+ 'do.deleteInstance'({ ns, id }: {
29
+ ns: string;
30
+ id: string;
31
+ }, ctx: HandlerContext): OkResponse;
32
+ 'do.generateSql'({ ns, id, prompt }: {
33
+ ns: string;
34
+ id: string;
35
+ prompt: string;
36
+ }, ctx: HandlerContext): Promise<{
37
+ sql: string;
38
+ }>;
39
+ 'do.sqlQuery'({ ns, id, sql }: {
40
+ ns: string;
41
+ id: string;
42
+ sql: string;
43
+ }): QueryResult;
44
+ };
@@ -0,0 +1,26 @@
1
+ import type { EmailRecord, HandlerContext, OkResponse } from '../types';
2
+ export declare const handlers: {
3
+ 'email.list'({ status, limit }: {
4
+ status?: string;
5
+ limit?: number;
6
+ }): EmailRecord[];
7
+ 'email.get'({ id }: {
8
+ id: string;
9
+ }): {
10
+ record: EmailRecord;
11
+ raw: string;
12
+ } | null;
13
+ 'email.delete'({ id }: {
14
+ id: string;
15
+ }): OkResponse;
16
+ 'email.trigger'({ from, to, subject, body }: {
17
+ from: string;
18
+ to: string;
19
+ subject?: string;
20
+ body?: string;
21
+ }, ctx: HandlerContext): Promise<OkResponse>;
22
+ 'email.stats'(_input: {}, _ctx: HandlerContext): {
23
+ total: number;
24
+ byStatus: Record<string, number>;
25
+ };
26
+ };
@@ -0,0 +1,38 @@
1
+ export declare const handlers: {
2
+ 'errors.list'(input: {
3
+ limit?: number;
4
+ cursor?: string;
5
+ }): {
6
+ items: Array<{
7
+ id: string;
8
+ timestamp: number;
9
+ errorName: string;
10
+ errorMessage: string;
11
+ requestMethod: string | null;
12
+ requestUrl: string | null;
13
+ workerName: string | null;
14
+ traceId: string | null;
15
+ spanId: string | null;
16
+ source: string | null;
17
+ }>;
18
+ cursor: string | null;
19
+ };
20
+ 'errors.get'(input: {
21
+ id: string;
22
+ }): {
23
+ id: string;
24
+ timestamp: number;
25
+ traceId: string | null;
26
+ spanId: string | null;
27
+ source: string | null;
28
+ data: unknown;
29
+ };
30
+ 'errors.delete'(input: {
31
+ id: string;
32
+ }): {
33
+ ok: true;
34
+ };
35
+ 'errors.clear'(_input: {}): {
36
+ ok: true;
37
+ };
38
+ };
@@ -0,0 +1,27 @@
1
+ import type { GenerationDetail, GenerationInfo, GenerationsData, HandlerContext } from '../types';
2
+ export declare const handlers: {
3
+ 'generations.detail'(input: {
4
+ id: number;
5
+ workerName?: string;
6
+ }, ctx: HandlerContext): GenerationDetail;
7
+ 'generations.list'(_input: {}, ctx: HandlerContext): GenerationsData;
8
+ 'generations.reload'(input: {
9
+ workerName?: string;
10
+ }, ctx: HandlerContext): Promise<{
11
+ ok: true;
12
+ generation: GenerationInfo;
13
+ }>;
14
+ 'generations.drain'(input: {
15
+ workerName?: string;
16
+ }, ctx: HandlerContext): {
17
+ ok: true;
18
+ stoppedGeneration: number;
19
+ };
20
+ 'generations.config'({ gracePeriodMs, workerName }: {
21
+ gracePeriodMs: number;
22
+ workerName?: string;
23
+ }, ctx: HandlerContext): {
24
+ ok: true;
25
+ gracePeriodMs: number;
26
+ };
27
+ };
@@ -0,0 +1,4 @@
1
+ import type { HandlerContext, HostsCheckResponse } from '../types';
2
+ export declare const handlers: {
3
+ 'hosts.check'(_input: {}, ctx: HandlerContext): HostsCheckResponse;
4
+ };
@@ -0,0 +1,25 @@
1
+ import type { HandlerContext, KvKey, KvNamespace, KvValue, OkResponse, Paginated } from '../types';
2
+ export declare const handlers: {
3
+ 'kv.listNamespaces'(_input: {}, ctx: HandlerContext): KvNamespace[];
4
+ 'kv.listKeys'({ ns, limit, cursor, prefix }: {
5
+ ns: string;
6
+ limit?: number;
7
+ cursor?: string;
8
+ prefix?: string;
9
+ }): Paginated<KvKey>;
10
+ 'kv.getKey'({ ns, key }: {
11
+ ns: string;
12
+ key: string;
13
+ }): KvValue;
14
+ 'kv.putKey'({ ns, key, value, metadata, expirationTtl }: {
15
+ ns: string;
16
+ key: string;
17
+ value: string;
18
+ metadata?: string;
19
+ expirationTtl?: number;
20
+ }): OkResponse;
21
+ 'kv.deleteKey'({ ns, key }: {
22
+ ns: string;
23
+ key: string;
24
+ }): OkResponse;
25
+ };