-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
4694 lines (4487 loc) · 174 KB
/
openapi.yaml
File metadata and controls
4694 lines (4487 loc) · 174 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.3
info:
title: Adblock Compiler API
description: |
**Compiler-as-a-Service** for adblock filter lists. Transform, optimize, and combine filter lists from multiple sources with real-time progress tracking.
## Features
- 🎯 Multi-Source Compilation
- ⚡ Performance (Gzip compression, caching, request deduplication)
- 🔄 Circuit Breaker with retry logic
- 📊 Visual Diff between compilations
- 📡 Real-time progress via SSE and WebSocket
- 🎪 Batch Processing
- 🌍 Universal (Deno, Node.js, Cloudflare Workers, browsers)
## Links
- [GitHub Repository](https://github.com/jaypatrick/adblock-compiler)
- [Documentation](https://github.com/jaypatrick/adblock-compiler/tree/master/docs)
- [Web UI](https://adblock-compiler.jayson-knight.workers.dev/)
version: 2.0.0
license:
name: GPL-3.0
url: https://github.com/jaypatrick/adblock-compiler/blob/master/LICENSE
contact:
name: Jayson Knight
url: https://github.com/jaypatrick/adblock-compiler
servers:
- url: https://adblock-compiler.jayson-knight.workers.dev
description: Production server
- url: http://localhost:8787
description: Local development server
tags:
- name: Compilation
description: Filter list compilation endpoints
- name: Streaming
description: Real-time event streaming endpoints
- name: Queue
description: Async job queue management
- name: Metrics
description: Performance metrics and statistics
- name: WebSocket
description: Bidirectional real-time communication
- name: Admin
description: Administration endpoints for storage, auth, migration, and backends (require X-Admin-Key header)
- name: Workflow
description: Durable execution workflow endpoints
- name: Health
description: Health monitoring endpoints
- name: Browser Rendering
description: Endpoints backed by the Cloudflare Browser Rendering binding (`BROWSER`). Used for resolving redirect chains and monitoring filter-list source URLs for changes.
- name: Authentication
description: User-level authentication endpoints — API key management and webhook receivers. Requires Clerk JWT or API key auth.
- name: LocalAuth
description: Local JWT auth bridge — self-contained sign-up/login until Clerk is production-ready. When `CLERK_JWKS_URL` is set the provider auto-switches to Clerk and these endpoints are no longer used.
- name: Info
description: API metadata and self-describing schema endpoints (anonymous access, cached).
- name: Configuration
description: Compilation configuration defaults, validation, and resolution endpoints.
paths:
/api:
get:
tags: [Metrics]
summary: Get API information
description: Returns API version, available endpoints, and usage examples
operationId: getApiInfo
responses:
'200':
description: API information
content:
application/json:
schema:
$ref: '#/components/schemas/ApiInfo'
/api/schemas:
get:
tags: [Info]
operationId: getApiSchemas
summary: Get JSON Schemas for all public request/response types
description: |
Returns JSON Schema representations of all public Zod schemas
(ConfigurationSchema, CompileRequestSchema, SourceSchema, BenchmarkMetricsSchema)
for use by API testers and external tooling.
Anonymous access. Cached for 1 hour.
responses:
'200':
description: JSON Schema definitions.
headers:
Cache-Control:
schema: { type: string, example: 'public, max-age=3600' }
content:
application/json:
schema:
type: object
properties:
success: { type: boolean, example: true }
schemas:
type: object
additionalProperties:
type: object
description: A JSON Schema definition object.
'429':
$ref: '#/components/responses/RateLimited'
/compile:
post:
tags: [Compilation]
summary: Compile filter list (JSON)
description: |
Compile filter lists and return results as JSON. Results are cached for 1 hour.
Supports request deduplication for concurrent identical requests.
operationId: compileJson
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CompileRequest'
examples:
simple:
summary: Simple compilation
value:
configuration:
name: My Filter List
sources:
- source: https://example.com/filters.txt
transformations:
- RemoveComments
- Validate
transformations:
- Deduplicate
withPreFetched:
summary: With pre-fetched content
value:
configuration:
name: Custom Rules
sources:
- source: my-custom-rules
preFetchedContent:
my-custom-rules: "||ads.example.com^\n||tracking.example.com^"
responses:
'200':
description: Compilation successful
headers:
X-Cache:
schema:
type: string
enum: [HIT, MISS]
description: Cache hit/miss status
X-Request-Deduplication:
schema:
type: string
enum: [HIT]
description: Present if request was deduplicated
content:
application/json:
schema:
$ref: '#/components/schemas/CompileResponse'
'400':
$ref: '#/components/responses/BadRequestError'
'429':
$ref: '#/components/responses/RateLimitError'
'500':
$ref: '#/components/responses/CompilationError'
/compile/stream:
post:
tags: [Streaming]
summary: Compile with real-time progress (SSE)
description: |
Compile filter lists with real-time progress updates via Server-Sent Events.
Streams events including source downloads, transformations, diagnostics, cache operations, network events, and metrics.
operationId: compileStream
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CompileRequest'
responses:
'200':
description: Event stream
content:
text/event-stream:
schema:
type: string
description: |
Server-Sent Events stream with the following event types:
**Compilation Events:**
- `log` - Log messages (info, warn, error, debug)
- `source:start` - Source download started
- `source:complete` - Source download completed
- `source:error` - Source download failed
- `transformation:start` - Transformation started
- `transformation:complete` - Transformation completed
- `progress` - Compilation progress update
- `result` - Final compilation result
- `done` - Compilation finished
- `error` - Compilation error
**Enhanced Events:**
- `diagnostic` - Diagnostic event from tracing system
- `cache` - Cache operation (hit/miss/write)
- `network` - Network operation (HTTP requests)
- `metric` - Performance metric
examples:
logEvent:
value: |
event: log
data: {"level":"info","message":"Fetching source..."}
sourceStart:
value: |
event: source:start
data: {"source":{"name":"Source 1","source":"https://..."},"sourceIndex":0,"totalSources":2}
diagnostic:
value: |
event: diagnostic
data: {"eventId":"evt-123","timestamp":"2026-01-14T05:00:00Z","category":"compilation","severity":"info","message":"Started compilation"}
cache:
value: |
event: cache
data: {"operation":"hit","key":"cache:abc123","size":1024}
network:
value: |
event: network
data: {"method":"GET","url":"https://example.com/filters.txt","statusCode":200,"durationMs":234,"responseSize":51200}
metric:
value: |
event: metric
data: {"metric":"download_speed","value":218.5,"unit":"KB/s"}
'400':
$ref: '#/components/responses/BadRequestError'
'429':
$ref: '#/components/responses/RateLimitError'
/compile/batch:
post:
tags: [Compilation]
summary: Batch compile multiple lists
description: Compile multiple filter lists in parallel (max 10 per batch)
operationId: compileBatch
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/BatchCompileRequest'
responses:
'200':
description: Batch compilation results
content:
application/json:
schema:
$ref: '#/components/schemas/BatchCompileResponse'
'400':
$ref: '#/components/responses/BadRequestError'
'429':
$ref: '#/components/responses/RateLimitError'
/compile/async:
post:
tags: [Queue]
summary: Queue async compilation job
description: |
Queue a compilation job for asynchronous processing. Returns immediately with a request ID.
Use GET /queue/results/{requestId} to retrieve results when complete.
operationId: compileAsync
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CompileRequest'
responses:
'202':
description: Job queued successfully
content:
application/json:
schema:
$ref: '#/components/schemas/QueueResponse'
'400':
$ref: '#/components/responses/BadRequestError'
'500':
$ref: '#/components/responses/ServiceUnavailable'
/compile/batch/async:
post:
tags: [Queue]
summary: Queue batch async compilation
description: Queue multiple compilations for async processing
operationId: compileBatchAsync
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/BatchCompileRequest'
responses:
'202':
description: Batch queued successfully
content:
application/json:
schema:
$ref: '#/components/schemas/QueueResponse'
'400':
$ref: '#/components/responses/BadRequestError'
'500':
$ref: '#/components/responses/ServiceUnavailable'
/ws/compile:
get:
tags: [WebSocket]
summary: WebSocket endpoint for real-time compilation
description: |
Bidirectional WebSocket connection for real-time compilation with event streaming.
**Client → Server Messages:**
- `compile` - Start compilation
- `cancel` - Cancel running compilation
- `ping` - Heartbeat ping
**Server → Client Messages:**
- `welcome` - Connection established
- `pong` - Heartbeat response
- `compile:started` - Compilation started
- `event` - Compilation event (source, transformation, progress, diagnostic, cache, network, metric)
- `compile:complete` - Compilation finished successfully
- `compile:error` - Compilation failed
- `compile:cancelled` - Compilation cancelled
- `error` - Error message
**Features:**
- Up to 3 concurrent compilations per connection
- Automatic heartbeat (30s interval)
- Connection timeout (5 minutes idle)
- Session-based compilation tracking
- Cancellation support
operationId: websocketCompile
responses:
'101':
description: WebSocket connection established
'426':
description: Upgrade required (not a WebSocket request)
x-websocket-messages:
client-to-server:
- $ref: '#/components/schemas/WsCompileRequest'
- $ref: '#/components/schemas/WsCancelRequest'
- $ref: '#/components/schemas/WsPingMessage'
server-to-client:
- $ref: '#/components/schemas/WsWelcomeMessage'
- $ref: '#/components/schemas/WsPongMessage'
- $ref: '#/components/schemas/WsCompileStartedMessage'
- $ref: '#/components/schemas/WsEventMessage'
- $ref: '#/components/schemas/WsCompileCompleteMessage'
- $ref: '#/components/schemas/WsCompileErrorMessage'
/metrics:
get:
tags: [Metrics]
summary: Get performance metrics
description: Returns aggregated metrics for the last 30 minutes
operationId: getMetrics
responses:
'200':
description: Performance metrics
content:
application/json:
schema:
$ref: '#/components/schemas/MetricsResponse'
/queue/stats:
get:
tags: [Queue]
summary: Get queue statistics
description: Returns queue health metrics and job statistics
operationId: getQueueStats
responses:
'200':
description: Queue statistics
content:
application/json:
schema:
$ref: '#/components/schemas/QueueStats'
/queue/results/{requestId}:
get:
tags: [Queue]
summary: Get async job results
description: Retrieve results for a completed async compilation job
operationId: getQueueResults
parameters:
- name: requestId
in: path
required: true
schema:
type: string
description: Request ID returned from async endpoints
responses:
'200':
description: Job results
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/CompileResponse'
- $ref: '#/components/schemas/QueueJobStatus'
'404':
description: Job not found
/api/version:
get:
tags: [Metrics]
summary: Get latest deployment version
description: Returns the current version from deployment history
operationId: getApiVersion
responses:
'200':
description: Version information
content:
application/json:
schema:
$ref: '#/components/schemas/VersionResponse'
'503':
$ref: '#/components/responses/ServiceUnavailable'
/api/deployments:
get:
tags: [Metrics]
summary: Get deployment history
description: Returns deployment history records
operationId: getDeployments
parameters:
- name: limit
in: query
schema:
type: integer
format: int32
default: 50
minimum: 1
maximum: 1000
description: Maximum number of records to return
- name: version
in: query
schema:
type: string
description: Filter by version
- name: status
in: query
schema:
type: string
description: Filter by deployment status
- name: branch
in: query
schema:
type: string
description: Filter by branch name
responses:
'200':
description: Deployment history
content:
application/json:
schema:
$ref: '#/components/schemas/DeploymentHistoryResponse'
'503':
$ref: '#/components/responses/ServiceUnavailable'
/api/deployments/stats:
get:
tags: [Metrics]
summary: Get deployment statistics
description: Returns aggregated deployment statistics
operationId: getDeploymentStats
responses:
'200':
description: Deployment statistics
content:
application/json:
schema:
$ref: '#/components/schemas/DeploymentStatsResponse'
'503':
$ref: '#/components/responses/ServiceUnavailable'
/api/turnstile-config:
get:
tags: [Metrics]
summary: Get Turnstile configuration
description: Returns the Cloudflare Turnstile site key and whether it is enabled
operationId: getTurnstileConfig
responses:
'200':
description: Turnstile configuration
content:
application/json:
schema:
$ref: '#/components/schemas/TurnstileConfigResponse'
/queue/history:
get:
tags: [Queue]
summary: Get queue job history
description: Returns job history and queue depth over time
operationId: getQueueHistory
responses:
'200':
description: Queue history
content:
application/json:
schema:
$ref: '#/components/schemas/QueueHistoryResponse'
/queue/cancel/{requestId}:
delete:
tags: [Queue]
summary: Cancel a pending queue job
description: |
Cancels a pending queue job by its requestId.
Returns 409 if the job is already completed, failed, or cancelled.
Requires authentication (free tier or above).
operationId: cancelQueueJob
security:
- BearerAuth: []
- ApiKeyAuth: []
parameters:
- name: requestId
in: path
required: true
schema:
type: string
pattern: '^[a-zA-Z0-9_-]+$'
description: The requestId of the queue job to cancel.
responses:
'200':
description: Job cancelled successfully.
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
example: true
cancelled:
type: boolean
example: true
description: Whether the cancellation signal was recorded. This is a best-effort operation.
requestId:
type: string
description: The requestId of the job.
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
description: Cloudflare Access JWT invalid or missing.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
$ref: '#/components/responses/RateLimited'
/ast/parse:
post:
tags: [Compilation]
summary: Parse filter rules into AST
description: Parses adblock filter rules into an Abstract Syntax Tree representation
operationId: parseAST
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ASTParseRequest'
responses:
'200':
description: Parsed AST
content:
application/json:
schema:
$ref: '#/components/schemas/ASTParseResponse'
'400':
description: Invalid request (must provide rules or text)
'500':
description: Parse error
/configuration/defaults:
get:
tags: [Configuration]
operationId: getConfigurationDefaults
summary: Get system compilation defaults and limits
description: |
Returns the system defaults and hard limits that apply to every compilation.
No authentication required (anonymous tier).
responses:
'200':
description: Defaults and limits.
headers:
Cache-Control:
schema: { type: string, example: 'public, max-age=3600' }
content:
application/json:
schema:
type: object
properties:
success: { type: boolean, example: true }
defaults:
type: object
properties:
compilation: { type: object }
validation: { type: object }
limits:
type: object
properties:
maxSources: { type: integer, example: 20 }
maxExclusions: { type: integer, example: 1000 }
supportedSourceTypes:
type: array
items: { type: string }
example: ['adblock', 'hosts']
'429':
$ref: '#/components/responses/RateLimited'
/configuration/validate:
post:
tags: [Configuration]
operationId: validateConfiguration
summary: Validate a configuration object against the schema
description: |
Validates a configuration object against the Zod `ConfigurationSchema`.
Requires a Cloudflare Turnstile token when `TURNSTILE_SECRET_KEY` is configured.
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [config]
properties:
config:
type: object
description: The configuration object to validate.
turnstileToken:
type: string
description: Cloudflare Turnstile token (required when Turnstile is enabled).
responses:
'200':
description: Validation result.
content:
application/json:
schema:
type: object
properties:
success: { type: boolean, example: true }
valid: { type: boolean }
errors:
type: array
items:
type: object
properties:
path: { type: string }
message: { type: string }
code: { type: string }
'400':
$ref: '#/components/responses/BadRequest'
'403':
description: Turnstile verification failed.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
$ref: '#/components/responses/RateLimited'
/configuration/resolve:
post:
tags: [Configuration]
operationId: resolveConfiguration
summary: Merge configuration layers and return effective IConfiguration
description: |
Merges one or more configuration layers (base config + optional override) and
returns the effective `IConfiguration`. Useful for previewing the result of a
config + environment overlay before submitting a compile job.
Requires a Cloudflare Turnstile token when `TURNSTILE_SECRET_KEY` is configured.
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [config]
properties:
config:
type: object
description: Base configuration object.
override:
type: object
description: Optional highest-priority JSON overlay merged on top of config.
applyEnvOverrides:
type: boolean
default: true
description: Whether to apply environment variable overrides.
turnstileToken:
type: string
description: Cloudflare Turnstile token (required when Turnstile is enabled).
responses:
'200':
description: Resolved configuration.
content:
application/json:
schema:
type: object
properties:
success: { type: boolean, example: true }
config:
$ref: '#/components/schemas/Configuration'
'400':
$ref: '#/components/responses/BadRequest'
'403':
description: Turnstile verification failed.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
$ref: '#/components/responses/RateLimited'
/admin/storage/stats:
get:
tags: [Admin]
summary: Get storage statistics
description: Returns database table counts and expired entry counts
operationId: getAdminStorageStats
security:
- AdminKey: []
responses:
'200':
description: Storage statistics
content:
application/json:
schema:
$ref: '#/components/schemas/AdminStorageStatsResponse'
'401':
$ref: '#/components/responses/UnauthorizedError'
'503':
$ref: '#/components/responses/ServiceUnavailable'
/admin/storage/clear-expired:
post:
tags: [Admin]
summary: Clear expired entries
description: Deletes all expired entries from storage tables
operationId: clearExpiredEntries
security:
- AdminKey: []
responses:
'200':
description: Entries cleared
content:
application/json:
schema:
$ref: '#/components/schemas/AdminOperationResponse'
'401':
$ref: '#/components/responses/UnauthorizedError'
'503':
$ref: '#/components/responses/ServiceUnavailable'
/admin/storage/clear-cache:
post:
tags: [Admin]
summary: Clear cache entries
description: Deletes all cache entries from storage tables
operationId: clearCacheEntries
security:
- AdminKey: []
responses:
'200':
description: Cache cleared
content:
application/json:
schema:
$ref: '#/components/schemas/AdminOperationResponse'
'401':
$ref: '#/components/responses/UnauthorizedError'
'503':
$ref: '#/components/responses/ServiceUnavailable'
/admin/storage/export:
get:
tags: [Admin]
summary: Export storage data
description: Exports storage entries as JSON (includes storage entries, filter cache, and compilation metadata; returned amounts subject to implementation limits)
operationId: exportStorage
security:
- AdminKey: []
responses:
'200':
description: Storage export
content:
application/json:
schema:
$ref: '#/components/schemas/AdminExportResponse'
'401':
$ref: '#/components/responses/UnauthorizedError'
'503':
$ref: '#/components/responses/ServiceUnavailable'
/admin/storage/vacuum:
post:
tags: [Admin]
summary: Vacuum database
description: Runs VACUUM on the D1 database to reclaim space
operationId: vacuumDatabase
security:
- AdminKey: []
responses:
'200':
description: Vacuum completed
content:
application/json:
schema:
$ref: '#/components/schemas/AdminOperationResponse'
'401':
$ref: '#/components/responses/UnauthorizedError'
'503':
$ref: '#/components/responses/ServiceUnavailable'
/admin/storage/tables:
get:
tags: [Admin]
summary: List database tables
description: Returns all tables and indexes in the D1 database
operationId: listStorageTables
security:
- AdminKey: []
responses:
'200':
description: Table listing
content:
application/json:
schema:
$ref: '#/components/schemas/AdminTablesResponse'
'401':
$ref: '#/components/responses/UnauthorizedError'
'503':
$ref: '#/components/responses/ServiceUnavailable'
/admin/storage/query:
post:
tags: [Admin]
summary: Execute read-only SQL query
description: Executes a SELECT-only SQL query against the D1 database for debugging
operationId: queryStorage
security:
- AdminKey: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AdminQueryRequest'
responses:
'200':
description: Query results
content:
application/json:
schema:
$ref: '#/components/schemas/AdminQueryResponse'
'400':
description: Invalid or disallowed SQL
'401':
$ref: '#/components/responses/UnauthorizedError'
'503':
$ref: '#/components/responses/ServiceUnavailable'
/workflow/compile:
post:
tags: [Workflow]
summary: Start async compilation workflow
description: Creates a durable Cloudflare Workflow instance for compilation
operationId: startWorkflowCompile
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CompileRequest'
responses:
'202':
description: Workflow started
content:
application/json:
schema:
$ref: '#/components/schemas/WorkflowStartResponse'
'400':
$ref: '#/components/responses/BadRequestError'
'503':
$ref: '#/components/responses/ServiceUnavailable'
/workflow/batch:
post:
tags: [Workflow]
summary: Start async batch compilation workflow
description: Creates a durable Cloudflare Workflow instance for batch compilation
operationId: startWorkflowBatch
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/BatchCompileRequest'
responses:
'202':
description: Workflow started
content:
application/json:
schema:
$ref: '#/components/schemas/WorkflowStartResponse'
'400':
$ref: '#/components/responses/BadRequestError'
'503':
$ref: '#/components/responses/ServiceUnavailable'
/workflow/cache-warm:
post:
tags: [Workflow]
summary: Start cache warming workflow
description: Triggers manual cache warming for specified configurations
operationId: startWorkflowCacheWarm
requestBody:
required: false
content:
application/json:
schema:
$ref: '#/components/schemas/CacheWarmRequest'
responses:
'202':
description: Workflow started
content:
application/json:
schema:
$ref: '#/components/schemas/WorkflowStartResponse'
'400':
$ref: '#/components/responses/BadRequestError'
'503':
$ref: '#/components/responses/ServiceUnavailable'
/workflow/health-check:
post:
tags: [Workflow]
summary: Start health monitoring workflow
description: Triggers manual health check for specified filter list sources
operationId: startWorkflowHealthCheck
requestBody:
required: false
content:
application/json:
schema:
$ref: '#/components/schemas/HealthCheckRequest'
responses:
'202':
description: Workflow started
content:
application/json:
schema:
$ref: '#/components/schemas/WorkflowStartResponse'
'400':
$ref: '#/components/responses/BadRequestError'
'503':
$ref: '#/components/responses/ServiceUnavailable'
/workflow/status/{workflowType}/{instanceId}:
get:
tags: [Workflow]
summary: Get workflow instance status
description: Returns the current status and output of a workflow instance
operationId: getWorkflowStatus
parameters:
- name: workflowType
in: path
required: true
schema:
type: string
enum: [compilation, batch-compilation, cache-warming, health-monitoring]
description: Type of workflow
- name: instanceId
in: path
required: true
schema:
type: string
description: Workflow instance ID
responses:
'200':
description: Workflow status
content:
application/json:
schema: