@x12i/reportic-api 0.2.4 → 0.2.6

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/openapi.json CHANGED
@@ -1,804 +1,804 @@
1
- {
2
- "openapi": "3.1.0",
3
- "info": {
4
- "title": "Reportic API",
5
- "version": "0.2.4",
6
- "description": "Shared Reportic engine for template discovery, validation, previews, report generation, and private local jobs. Bearer authentication is required when a token is configured; remote binds require a token."
7
- },
8
- "servers": [
9
- {
10
- "url": "http://127.0.0.1:4173"
11
- }
12
- ],
13
- "security": [
14
- {
15
- "bearerAuth": []
16
- }
17
- ],
18
- "paths": {
19
- "/v1/components": {
20
- "get": {
21
- "summary": "List component schemas and target capabilities",
22
- "responses": {
23
- "200": {
24
- "description": "Success",
25
- "content": {
26
- "application/json": {
27
- "schema": {
28
- "type": "object"
29
- }
30
- }
31
- }
32
- },
33
- "401": {
34
- "description": "Bearer authentication is required."
35
- },
36
- "422": {
37
- "description": "Invalid inputs or rendering failure.",
38
- "content": {
39
- "application/json": {
40
- "schema": {
41
- "$ref": "#/components/schemas/Failure"
42
- }
43
- }
44
- }
45
- }
46
- }
47
- }
48
- },
49
- "/v1/components/{type}": {
50
- "get": {
51
- "summary": "Get one component definition",
52
- "parameters": [
53
- {
54
- "name": "type",
55
- "in": "path",
56
- "required": true,
57
- "schema": {
58
- "type": "string"
59
- }
60
- }
61
- ],
62
- "responses": {
63
- "200": {
64
- "description": "Success",
65
- "content": {
66
- "application/json": {
67
- "schema": {
68
- "type": "object"
69
- }
70
- }
71
- }
72
- },
73
- "401": {
74
- "description": "Bearer authentication is required."
75
- },
76
- "422": {
77
- "description": "Invalid inputs or rendering failure.",
78
- "content": {
79
- "application/json": {
80
- "schema": {
81
- "$ref": "#/components/schemas/Failure"
82
- }
83
- }
84
- }
85
- }
86
- }
87
- }
88
- },
89
- "/v1/templates/inspect": {
90
- "post": {
91
- "summary": "Inspect a template",
92
- "requestBody": {
93
- "required": true,
94
- "content": {
95
- "application/json": {
96
- "schema": {
97
- "$ref": "#/components/schemas/ReportRequest"
98
- }
99
- }
100
- }
101
- },
102
- "responses": {
103
- "200": {
104
- "description": "Success",
105
- "content": {
106
- "application/json": {
107
- "schema": {
108
- "type": "object"
109
- }
110
- }
111
- }
112
- },
113
- "401": {
114
- "description": "Bearer authentication is required."
115
- },
116
- "422": {
117
- "description": "Invalid inputs or rendering failure.",
118
- "content": {
119
- "application/json": {
120
- "schema": {
121
- "$ref": "#/components/schemas/Failure"
122
- }
123
- }
124
- }
125
- }
126
- }
127
- }
128
- },
129
- "/v1/templates/validate": {
130
- "post": {
131
- "summary": "Validate template authoring syntax",
132
- "requestBody": {
133
- "required": true,
134
- "content": {
135
- "application/json": {
136
- "schema": {
137
- "$ref": "#/components/schemas/ReportRequest"
138
- }
139
- }
140
- }
141
- },
142
- "responses": {
143
- "200": {
144
- "description": "Success",
145
- "content": {
146
- "application/json": {
147
- "schema": {
148
- "$ref": "#/components/schemas/Validation"
149
- }
150
- }
151
- }
152
- },
153
- "401": {
154
- "description": "Bearer authentication is required."
155
- },
156
- "422": {
157
- "description": "Invalid inputs or rendering failure.",
158
- "content": {
159
- "application/json": {
160
- "schema": {
161
- "$ref": "#/components/schemas/Failure"
162
- }
163
- }
164
- }
165
- }
166
- }
167
- }
168
- },
169
- "/v1/reports/validate": {
170
- "post": {
171
- "summary": "Validate a report without creating an artifact",
172
- "requestBody": {
173
- "required": true,
174
- "content": {
175
- "application/json": {
176
- "schema": {
177
- "$ref": "#/components/schemas/ReportRequest"
178
- }
179
- }
180
- }
181
- },
182
- "responses": {
183
- "200": {
184
- "description": "Success",
185
- "content": {
186
- "application/json": {
187
- "schema": {
188
- "$ref": "#/components/schemas/Validation"
189
- }
190
- }
191
- }
192
- },
193
- "401": {
194
- "description": "Bearer authentication is required."
195
- },
196
- "422": {
197
- "description": "Invalid inputs or rendering failure.",
198
- "content": {
199
- "application/json": {
200
- "schema": {
201
- "$ref": "#/components/schemas/Failure"
202
- }
203
- }
204
- }
205
- }
206
- }
207
- }
208
- },
209
- "/v1/reports/preview": {
210
- "post": {
211
- "summary": "Create a self-contained HTML preview",
212
- "requestBody": {
213
- "required": true,
214
- "content": {
215
- "application/json": {
216
- "schema": {
217
- "$ref": "#/components/schemas/ReportRequest"
218
- }
219
- }
220
- }
221
- },
222
- "responses": {
223
- "200": {
224
- "description": "Success",
225
- "content": {
226
- "application/json": {
227
- "schema": {
228
- "type": "object"
229
- }
230
- }
231
- }
232
- },
233
- "401": {
234
- "description": "Bearer authentication is required."
235
- },
236
- "422": {
237
- "description": "Invalid inputs or rendering failure.",
238
- "content": {
239
- "application/json": {
240
- "schema": {
241
- "$ref": "#/components/schemas/Failure"
242
- }
243
- }
244
- }
245
- }
246
- }
247
- }
248
- },
249
- "/v1/reports/generate": {
250
- "post": {
251
- "summary": "Generate a report; PDF is the default",
252
- "requestBody": {
253
- "required": true,
254
- "content": {
255
- "application/json": {
256
- "schema": {
257
- "$ref": "#/components/schemas/ReportRequest"
258
- }
259
- }
260
- }
261
- },
262
- "responses": {
263
- "200": {
264
- "description": "Verified report bytes or ZIP bundle.",
265
- "content": {
266
- "application/octet-stream": {
267
- "schema": {
268
- "type": "string",
269
- "format": "binary"
270
- }
271
- },
272
- "application/pdf": {
273
- "schema": {
274
- "type": "string",
275
- "format": "binary"
276
- }
277
- }
278
- }
279
- },
280
- "406": {
281
- "description": "Accept mismatch or companion assets require the bundle endpoint."
282
- },
283
- "422": {
284
- "description": "Report failed.",
285
- "content": {
286
- "application/json": {
287
- "schema": {
288
- "$ref": "#/components/schemas/Failure"
289
- }
290
- }
291
- }
292
- }
293
- }
294
- }
295
- },
296
- "/v1/report-jobs": {
297
- "post": {
298
- "summary": "Submit a private background report job",
299
- "requestBody": {
300
- "required": true,
301
- "content": {
302
- "application/json": {
303
- "schema": {
304
- "$ref": "#/components/schemas/ReportRequest"
305
- }
306
- }
307
- }
308
- },
309
- "responses": {
310
- "202": {
311
- "description": "Success",
312
- "content": {
313
- "application/json": {
314
- "schema": {
315
- "$ref": "#/components/schemas/Job"
316
- }
317
- }
318
- }
319
- },
320
- "401": {
321
- "description": "Bearer authentication is required."
322
- },
323
- "409": {
324
- "description": "Idempotency key reused with different inputs."
325
- },
326
- "422": {
327
- "description": "Invalid inputs or rendering failure.",
328
- "content": {
329
- "application/json": {
330
- "schema": {
331
- "$ref": "#/components/schemas/Failure"
332
- }
333
- }
334
- }
335
- }
336
- },
337
- "parameters": [
338
- {
339
- "in": "header",
340
- "name": "Idempotency-Key",
341
- "schema": {
342
- "type": "string"
343
- }
344
- }
345
- ]
346
- }
347
- },
348
- "/v1/report-jobs/{id}": {
349
- "get": {
350
- "summary": "Read job state and artifact metadata",
351
- "parameters": [
352
- {
353
- "name": "id",
354
- "in": "path",
355
- "required": true,
356
- "schema": {
357
- "type": "string",
358
- "format": "uuid"
359
- }
360
- }
361
- ],
362
- "responses": {
363
- "200": {
364
- "description": "Success",
365
- "content": {
366
- "application/json": {
367
- "schema": {
368
- "$ref": "#/components/schemas/Job"
369
- }
370
- }
371
- }
372
- },
373
- "401": {
374
- "description": "Bearer authentication is required."
375
- },
376
- "422": {
377
- "description": "Invalid inputs or rendering failure.",
378
- "content": {
379
- "application/json": {
380
- "schema": {
381
- "$ref": "#/components/schemas/Failure"
382
- }
383
- }
384
- }
385
- }
386
- }
387
- },
388
- "delete": {
389
- "summary": "Cancel a pending or running job",
390
- "parameters": [
391
- {
392
- "name": "id",
393
- "in": "path",
394
- "required": true,
395
- "schema": {
396
- "type": "string",
397
- "format": "uuid"
398
- }
399
- }
400
- ],
401
- "responses": {
402
- "200": {
403
- "description": "Success",
404
- "content": {
405
- "application/json": {
406
- "schema": {
407
- "$ref": "#/components/schemas/Job"
408
- }
409
- }
410
- }
411
- },
412
- "401": {
413
- "description": "Bearer authentication is required."
414
- },
415
- "422": {
416
- "description": "Invalid inputs or rendering failure.",
417
- "content": {
418
- "application/json": {
419
- "schema": {
420
- "$ref": "#/components/schemas/Failure"
421
- }
422
- }
423
- }
424
- }
425
- }
426
- }
427
- },
428
- "/v1/report-jobs/{id}/artifact": {
429
- "get": {
430
- "summary": "Download a verified primary artifact",
431
- "parameters": [
432
- {
433
- "name": "id",
434
- "in": "path",
435
- "required": true,
436
- "schema": {
437
- "type": "string",
438
- "format": "uuid"
439
- }
440
- }
441
- ],
442
- "responses": {
443
- "200": {
444
- "description": "Verified report bytes or ZIP bundle.",
445
- "content": {
446
- "application/octet-stream": {
447
- "schema": {
448
- "type": "string",
449
- "format": "binary"
450
- }
451
- },
452
- "application/pdf": {
453
- "schema": {
454
- "type": "string",
455
- "format": "binary"
456
- }
457
- }
458
- }
459
- },
460
- "406": {
461
- "description": "Accept mismatch or companion assets require the bundle endpoint."
462
- },
463
- "422": {
464
- "description": "Report failed.",
465
- "content": {
466
- "application/json": {
467
- "schema": {
468
- "$ref": "#/components/schemas/Failure"
469
- }
470
- }
471
- }
472
- }
473
- }
474
- }
475
- },
476
- "/v1/report-jobs/{id}/bundle": {
477
- "get": {
478
- "summary": "Download a ZIP including companion assets",
479
- "parameters": [
480
- {
481
- "name": "id",
482
- "in": "path",
483
- "required": true,
484
- "schema": {
485
- "type": "string",
486
- "format": "uuid"
487
- }
488
- }
489
- ],
490
- "responses": {
491
- "200": {
492
- "description": "Verified report bytes or ZIP bundle.",
493
- "content": {
494
- "application/octet-stream": {
495
- "schema": {
496
- "type": "string",
497
- "format": "binary"
498
- }
499
- },
500
- "application/pdf": {
501
- "schema": {
502
- "type": "string",
503
- "format": "binary"
504
- }
505
- }
506
- }
507
- },
508
- "406": {
509
- "description": "Accept mismatch or companion assets require the bundle endpoint."
510
- },
511
- "422": {
512
- "description": "Report failed.",
513
- "content": {
514
- "application/json": {
515
- "schema": {
516
- "$ref": "#/components/schemas/Failure"
517
- }
518
- }
519
- }
520
- }
521
- }
522
- }
523
- }
524
- },
525
- "components": {
526
- "securitySchemes": {
527
- "bearerAuth": {
528
- "type": "http",
529
- "scheme": "bearer"
530
- }
531
- },
532
- "schemas": {
533
- "Diagnostic": {
534
- "type": "object",
535
- "required": [
536
- "code",
537
- "severity",
538
- "phase",
539
- "message"
540
- ],
541
- "properties": {
542
- "code": {
543
- "type": "string"
544
- },
545
- "severity": {
546
- "enum": [
547
- "error",
548
- "warning",
549
- "info"
550
- ]
551
- },
552
- "phase": {
553
- "enum": [
554
- "parse",
555
- "input",
556
- "prepare",
557
- "render"
558
- ]
559
- },
560
- "message": {
561
- "type": "string"
562
- },
563
- "elementId": {
564
- "type": "string"
565
- },
566
- "bindingPath": {
567
- "type": "string"
568
- },
569
- "line": {
570
- "type": "integer"
571
- },
572
- "column": {
573
- "type": "integer"
574
- },
575
- "format": {
576
- "type": "string"
577
- }
578
- }
579
- },
580
- "Validation": {
581
- "type": "object",
582
- "required": [
583
- "valid",
584
- "diagnostics"
585
- ],
586
- "properties": {
587
- "valid": {
588
- "type": "boolean"
589
- },
590
- "diagnostics": {
591
- "type": "array",
592
- "items": {
593
- "$ref": "#/components/schemas/Diagnostic"
594
- }
595
- }
596
- }
597
- },
598
- "Failure": {
599
- "type": "object",
600
- "properties": {
601
- "error": {
602
- "type": "string"
603
- },
604
- "diagnostics": {
605
- "type": "array",
606
- "items": {
607
- "$ref": "#/components/schemas/Diagnostic"
608
- }
609
- }
610
- }
611
- },
612
- "Job": {
613
- "type": "object",
614
- "properties": {
615
- "id": {
616
- "type": "string",
617
- "format": "uuid"
618
- },
619
- "state": {
620
- "enum": [
621
- "queued",
622
- "running",
623
- "succeeded",
624
- "failed",
625
- "cancelled",
626
- "expired"
627
- ]
628
- },
629
- "createdAt": {
630
- "type": "string",
631
- "format": "date-time"
632
- },
633
- "expiresAt": {
634
- "type": "string",
635
- "format": "date-time"
636
- },
637
- "diagnostics": {
638
- "type": "array",
639
- "items": {
640
- "$ref": "#/components/schemas/Diagnostic"
641
- }
642
- },
643
- "artifact": {
644
- "type": "object",
645
- "properties": {
646
- "filename": {
647
- "type": "string"
648
- },
649
- "mediaType": {
650
- "type": "string"
651
- },
652
- "bytes": {
653
- "type": "integer"
654
- },
655
- "url": {
656
- "type": "string"
657
- },
658
- "bundleUrl": {
659
- "type": "string"
660
- }
661
- }
662
- }
663
- }
664
- },
665
- "ReportRequest": {
666
- "type": "object",
667
- "required": [
668
- "template"
669
- ],
670
- "additionalProperties": false,
671
- "properties": {
672
- "template": {
673
- "type": "string",
674
- "maxLength": 1000000
675
- },
676
- "dataSets": {
677
- "type": "array",
678
- "default": [],
679
- "items": {
680
- "type": "object",
681
- "required": [
682
- "name",
683
- "data"
684
- ],
685
- "properties": {
686
- "name": {
687
- "type": "string",
688
- "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
689
- },
690
- "data": {
691
- "type": "object"
692
- }
693
- }
694
- }
695
- },
696
- "variables": {
697
- "type": "object",
698
- "default": {}
699
- },
700
- "format": {
701
- "enum": [
702
- "pdf",
703
- "pptx",
704
- "docx",
705
- "html",
706
- "markdown"
707
- ],
708
- "default": "pdf"
709
- },
710
- "theme": {
711
- "type": "object"
712
- },
713
- "css": {
714
- "type": "string"
715
- },
716
- "assets": {
717
- "type": "object",
718
- "additionalProperties": {
719
- "type": "object",
720
- "required": [
721
- "base64",
722
- "mediaType"
723
- ],
724
- "properties": {
725
- "base64": {
726
- "type": "string",
727
- "contentEncoding": "base64"
728
- },
729
- "mediaType": {
730
- "enum": [
731
- "image/png",
732
- "image/jpeg",
733
- "image/webp",
734
- "image/svg+xml"
735
- ]
736
- }
737
- }
738
- }
739
- },
740
- "html": {
741
- "type": "object",
742
- "properties": {
743
- "assetMode": {
744
- "enum": [
745
- "embedded",
746
- "bundled"
747
- ]
748
- }
749
- }
750
- },
751
- "pdf": {
752
- "type": "object",
753
- "properties": {
754
- "size": {
755
- "enum": [
756
- "A4",
757
- "Letter"
758
- ]
759
- },
760
- "landscape": {
761
- "type": "boolean"
762
- },
763
- "pageNumbers": {
764
- "type": "boolean"
765
- },
766
- "preferCSSPageSize": {
767
- "type": "boolean"
768
- }
769
- }
770
- },
771
- "pptx": {
772
- "type": "object",
773
- "properties": {
774
- "editability": {
775
- "enum": [
776
- "normal",
777
- "strict"
778
- ]
779
- },
780
- "layout": {
781
- "enum": [
782
- "wide",
783
- "standard"
784
- ]
785
- }
786
- }
787
- },
788
- "docx": {
789
- "type": "object"
790
- },
791
- "diagramMode": {
792
- "enum": [
793
- "portable",
794
- "mermaid"
795
- ]
796
- },
797
- "strictStyles": {
798
- "type": "boolean"
799
- }
800
- }
801
- }
802
- }
803
- }
804
- }
1
+ {
2
+ "openapi": "3.1.0",
3
+ "info": {
4
+ "title": "Reportic API",
5
+ "version": "0.2.5",
6
+ "description": "Shared Reportic engine for template discovery, validation, previews, report generation, and private local jobs. Bearer authentication is required when a token is configured; remote binds require a token."
7
+ },
8
+ "servers": [
9
+ {
10
+ "url": "http://127.0.0.1:4173"
11
+ }
12
+ ],
13
+ "security": [
14
+ {
15
+ "bearerAuth": []
16
+ }
17
+ ],
18
+ "paths": {
19
+ "/v1/components": {
20
+ "get": {
21
+ "summary": "List component schemas and target capabilities",
22
+ "responses": {
23
+ "200": {
24
+ "description": "Success",
25
+ "content": {
26
+ "application/json": {
27
+ "schema": {
28
+ "type": "object"
29
+ }
30
+ }
31
+ }
32
+ },
33
+ "401": {
34
+ "description": "Bearer authentication is required."
35
+ },
36
+ "422": {
37
+ "description": "Invalid inputs or rendering failure.",
38
+ "content": {
39
+ "application/json": {
40
+ "schema": {
41
+ "$ref": "#/components/schemas/Failure"
42
+ }
43
+ }
44
+ }
45
+ }
46
+ }
47
+ }
48
+ },
49
+ "/v1/components/{type}": {
50
+ "get": {
51
+ "summary": "Get one component definition",
52
+ "parameters": [
53
+ {
54
+ "name": "type",
55
+ "in": "path",
56
+ "required": true,
57
+ "schema": {
58
+ "type": "string"
59
+ }
60
+ }
61
+ ],
62
+ "responses": {
63
+ "200": {
64
+ "description": "Success",
65
+ "content": {
66
+ "application/json": {
67
+ "schema": {
68
+ "type": "object"
69
+ }
70
+ }
71
+ }
72
+ },
73
+ "401": {
74
+ "description": "Bearer authentication is required."
75
+ },
76
+ "422": {
77
+ "description": "Invalid inputs or rendering failure.",
78
+ "content": {
79
+ "application/json": {
80
+ "schema": {
81
+ "$ref": "#/components/schemas/Failure"
82
+ }
83
+ }
84
+ }
85
+ }
86
+ }
87
+ }
88
+ },
89
+ "/v1/templates/inspect": {
90
+ "post": {
91
+ "summary": "Inspect a template",
92
+ "requestBody": {
93
+ "required": true,
94
+ "content": {
95
+ "application/json": {
96
+ "schema": {
97
+ "$ref": "#/components/schemas/ReportRequest"
98
+ }
99
+ }
100
+ }
101
+ },
102
+ "responses": {
103
+ "200": {
104
+ "description": "Success",
105
+ "content": {
106
+ "application/json": {
107
+ "schema": {
108
+ "type": "object"
109
+ }
110
+ }
111
+ }
112
+ },
113
+ "401": {
114
+ "description": "Bearer authentication is required."
115
+ },
116
+ "422": {
117
+ "description": "Invalid inputs or rendering failure.",
118
+ "content": {
119
+ "application/json": {
120
+ "schema": {
121
+ "$ref": "#/components/schemas/Failure"
122
+ }
123
+ }
124
+ }
125
+ }
126
+ }
127
+ }
128
+ },
129
+ "/v1/templates/validate": {
130
+ "post": {
131
+ "summary": "Validate template authoring syntax",
132
+ "requestBody": {
133
+ "required": true,
134
+ "content": {
135
+ "application/json": {
136
+ "schema": {
137
+ "$ref": "#/components/schemas/ReportRequest"
138
+ }
139
+ }
140
+ }
141
+ },
142
+ "responses": {
143
+ "200": {
144
+ "description": "Success",
145
+ "content": {
146
+ "application/json": {
147
+ "schema": {
148
+ "$ref": "#/components/schemas/Validation"
149
+ }
150
+ }
151
+ }
152
+ },
153
+ "401": {
154
+ "description": "Bearer authentication is required."
155
+ },
156
+ "422": {
157
+ "description": "Invalid inputs or rendering failure.",
158
+ "content": {
159
+ "application/json": {
160
+ "schema": {
161
+ "$ref": "#/components/schemas/Failure"
162
+ }
163
+ }
164
+ }
165
+ }
166
+ }
167
+ }
168
+ },
169
+ "/v1/reports/validate": {
170
+ "post": {
171
+ "summary": "Validate a report without creating an artifact",
172
+ "requestBody": {
173
+ "required": true,
174
+ "content": {
175
+ "application/json": {
176
+ "schema": {
177
+ "$ref": "#/components/schemas/ReportRequest"
178
+ }
179
+ }
180
+ }
181
+ },
182
+ "responses": {
183
+ "200": {
184
+ "description": "Success",
185
+ "content": {
186
+ "application/json": {
187
+ "schema": {
188
+ "$ref": "#/components/schemas/Validation"
189
+ }
190
+ }
191
+ }
192
+ },
193
+ "401": {
194
+ "description": "Bearer authentication is required."
195
+ },
196
+ "422": {
197
+ "description": "Invalid inputs or rendering failure.",
198
+ "content": {
199
+ "application/json": {
200
+ "schema": {
201
+ "$ref": "#/components/schemas/Failure"
202
+ }
203
+ }
204
+ }
205
+ }
206
+ }
207
+ }
208
+ },
209
+ "/v1/reports/preview": {
210
+ "post": {
211
+ "summary": "Create a self-contained HTML preview",
212
+ "requestBody": {
213
+ "required": true,
214
+ "content": {
215
+ "application/json": {
216
+ "schema": {
217
+ "$ref": "#/components/schemas/ReportRequest"
218
+ }
219
+ }
220
+ }
221
+ },
222
+ "responses": {
223
+ "200": {
224
+ "description": "Success",
225
+ "content": {
226
+ "application/json": {
227
+ "schema": {
228
+ "type": "object"
229
+ }
230
+ }
231
+ }
232
+ },
233
+ "401": {
234
+ "description": "Bearer authentication is required."
235
+ },
236
+ "422": {
237
+ "description": "Invalid inputs or rendering failure.",
238
+ "content": {
239
+ "application/json": {
240
+ "schema": {
241
+ "$ref": "#/components/schemas/Failure"
242
+ }
243
+ }
244
+ }
245
+ }
246
+ }
247
+ }
248
+ },
249
+ "/v1/reports/generate": {
250
+ "post": {
251
+ "summary": "Generate a report; PDF is the default",
252
+ "requestBody": {
253
+ "required": true,
254
+ "content": {
255
+ "application/json": {
256
+ "schema": {
257
+ "$ref": "#/components/schemas/ReportRequest"
258
+ }
259
+ }
260
+ }
261
+ },
262
+ "responses": {
263
+ "200": {
264
+ "description": "Verified report bytes or ZIP bundle.",
265
+ "content": {
266
+ "application/octet-stream": {
267
+ "schema": {
268
+ "type": "string",
269
+ "format": "binary"
270
+ }
271
+ },
272
+ "application/pdf": {
273
+ "schema": {
274
+ "type": "string",
275
+ "format": "binary"
276
+ }
277
+ }
278
+ }
279
+ },
280
+ "406": {
281
+ "description": "Accept mismatch or companion assets require the bundle endpoint."
282
+ },
283
+ "422": {
284
+ "description": "Report failed.",
285
+ "content": {
286
+ "application/json": {
287
+ "schema": {
288
+ "$ref": "#/components/schemas/Failure"
289
+ }
290
+ }
291
+ }
292
+ }
293
+ }
294
+ }
295
+ },
296
+ "/v1/report-jobs": {
297
+ "post": {
298
+ "summary": "Submit a private background report job",
299
+ "requestBody": {
300
+ "required": true,
301
+ "content": {
302
+ "application/json": {
303
+ "schema": {
304
+ "$ref": "#/components/schemas/ReportRequest"
305
+ }
306
+ }
307
+ }
308
+ },
309
+ "responses": {
310
+ "202": {
311
+ "description": "Success",
312
+ "content": {
313
+ "application/json": {
314
+ "schema": {
315
+ "$ref": "#/components/schemas/Job"
316
+ }
317
+ }
318
+ }
319
+ },
320
+ "401": {
321
+ "description": "Bearer authentication is required."
322
+ },
323
+ "409": {
324
+ "description": "Idempotency key reused with different inputs."
325
+ },
326
+ "422": {
327
+ "description": "Invalid inputs or rendering failure.",
328
+ "content": {
329
+ "application/json": {
330
+ "schema": {
331
+ "$ref": "#/components/schemas/Failure"
332
+ }
333
+ }
334
+ }
335
+ }
336
+ },
337
+ "parameters": [
338
+ {
339
+ "in": "header",
340
+ "name": "Idempotency-Key",
341
+ "schema": {
342
+ "type": "string"
343
+ }
344
+ }
345
+ ]
346
+ }
347
+ },
348
+ "/v1/report-jobs/{id}": {
349
+ "get": {
350
+ "summary": "Read job state and artifact metadata",
351
+ "parameters": [
352
+ {
353
+ "name": "id",
354
+ "in": "path",
355
+ "required": true,
356
+ "schema": {
357
+ "type": "string",
358
+ "format": "uuid"
359
+ }
360
+ }
361
+ ],
362
+ "responses": {
363
+ "200": {
364
+ "description": "Success",
365
+ "content": {
366
+ "application/json": {
367
+ "schema": {
368
+ "$ref": "#/components/schemas/Job"
369
+ }
370
+ }
371
+ }
372
+ },
373
+ "401": {
374
+ "description": "Bearer authentication is required."
375
+ },
376
+ "422": {
377
+ "description": "Invalid inputs or rendering failure.",
378
+ "content": {
379
+ "application/json": {
380
+ "schema": {
381
+ "$ref": "#/components/schemas/Failure"
382
+ }
383
+ }
384
+ }
385
+ }
386
+ }
387
+ },
388
+ "delete": {
389
+ "summary": "Cancel a pending or running job",
390
+ "parameters": [
391
+ {
392
+ "name": "id",
393
+ "in": "path",
394
+ "required": true,
395
+ "schema": {
396
+ "type": "string",
397
+ "format": "uuid"
398
+ }
399
+ }
400
+ ],
401
+ "responses": {
402
+ "200": {
403
+ "description": "Success",
404
+ "content": {
405
+ "application/json": {
406
+ "schema": {
407
+ "$ref": "#/components/schemas/Job"
408
+ }
409
+ }
410
+ }
411
+ },
412
+ "401": {
413
+ "description": "Bearer authentication is required."
414
+ },
415
+ "422": {
416
+ "description": "Invalid inputs or rendering failure.",
417
+ "content": {
418
+ "application/json": {
419
+ "schema": {
420
+ "$ref": "#/components/schemas/Failure"
421
+ }
422
+ }
423
+ }
424
+ }
425
+ }
426
+ }
427
+ },
428
+ "/v1/report-jobs/{id}/artifact": {
429
+ "get": {
430
+ "summary": "Download a verified primary artifact",
431
+ "parameters": [
432
+ {
433
+ "name": "id",
434
+ "in": "path",
435
+ "required": true,
436
+ "schema": {
437
+ "type": "string",
438
+ "format": "uuid"
439
+ }
440
+ }
441
+ ],
442
+ "responses": {
443
+ "200": {
444
+ "description": "Verified report bytes or ZIP bundle.",
445
+ "content": {
446
+ "application/octet-stream": {
447
+ "schema": {
448
+ "type": "string",
449
+ "format": "binary"
450
+ }
451
+ },
452
+ "application/pdf": {
453
+ "schema": {
454
+ "type": "string",
455
+ "format": "binary"
456
+ }
457
+ }
458
+ }
459
+ },
460
+ "406": {
461
+ "description": "Accept mismatch or companion assets require the bundle endpoint."
462
+ },
463
+ "422": {
464
+ "description": "Report failed.",
465
+ "content": {
466
+ "application/json": {
467
+ "schema": {
468
+ "$ref": "#/components/schemas/Failure"
469
+ }
470
+ }
471
+ }
472
+ }
473
+ }
474
+ }
475
+ },
476
+ "/v1/report-jobs/{id}/bundle": {
477
+ "get": {
478
+ "summary": "Download a ZIP including companion assets",
479
+ "parameters": [
480
+ {
481
+ "name": "id",
482
+ "in": "path",
483
+ "required": true,
484
+ "schema": {
485
+ "type": "string",
486
+ "format": "uuid"
487
+ }
488
+ }
489
+ ],
490
+ "responses": {
491
+ "200": {
492
+ "description": "Verified report bytes or ZIP bundle.",
493
+ "content": {
494
+ "application/octet-stream": {
495
+ "schema": {
496
+ "type": "string",
497
+ "format": "binary"
498
+ }
499
+ },
500
+ "application/pdf": {
501
+ "schema": {
502
+ "type": "string",
503
+ "format": "binary"
504
+ }
505
+ }
506
+ }
507
+ },
508
+ "406": {
509
+ "description": "Accept mismatch or companion assets require the bundle endpoint."
510
+ },
511
+ "422": {
512
+ "description": "Report failed.",
513
+ "content": {
514
+ "application/json": {
515
+ "schema": {
516
+ "$ref": "#/components/schemas/Failure"
517
+ }
518
+ }
519
+ }
520
+ }
521
+ }
522
+ }
523
+ }
524
+ },
525
+ "components": {
526
+ "securitySchemes": {
527
+ "bearerAuth": {
528
+ "type": "http",
529
+ "scheme": "bearer"
530
+ }
531
+ },
532
+ "schemas": {
533
+ "Diagnostic": {
534
+ "type": "object",
535
+ "required": [
536
+ "code",
537
+ "severity",
538
+ "phase",
539
+ "message"
540
+ ],
541
+ "properties": {
542
+ "code": {
543
+ "type": "string"
544
+ },
545
+ "severity": {
546
+ "enum": [
547
+ "error",
548
+ "warning",
549
+ "info"
550
+ ]
551
+ },
552
+ "phase": {
553
+ "enum": [
554
+ "parse",
555
+ "input",
556
+ "prepare",
557
+ "render"
558
+ ]
559
+ },
560
+ "message": {
561
+ "type": "string"
562
+ },
563
+ "elementId": {
564
+ "type": "string"
565
+ },
566
+ "bindingPath": {
567
+ "type": "string"
568
+ },
569
+ "line": {
570
+ "type": "integer"
571
+ },
572
+ "column": {
573
+ "type": "integer"
574
+ },
575
+ "format": {
576
+ "type": "string"
577
+ }
578
+ }
579
+ },
580
+ "Validation": {
581
+ "type": "object",
582
+ "required": [
583
+ "valid",
584
+ "diagnostics"
585
+ ],
586
+ "properties": {
587
+ "valid": {
588
+ "type": "boolean"
589
+ },
590
+ "diagnostics": {
591
+ "type": "array",
592
+ "items": {
593
+ "$ref": "#/components/schemas/Diagnostic"
594
+ }
595
+ }
596
+ }
597
+ },
598
+ "Failure": {
599
+ "type": "object",
600
+ "properties": {
601
+ "error": {
602
+ "type": "string"
603
+ },
604
+ "diagnostics": {
605
+ "type": "array",
606
+ "items": {
607
+ "$ref": "#/components/schemas/Diagnostic"
608
+ }
609
+ }
610
+ }
611
+ },
612
+ "Job": {
613
+ "type": "object",
614
+ "properties": {
615
+ "id": {
616
+ "type": "string",
617
+ "format": "uuid"
618
+ },
619
+ "state": {
620
+ "enum": [
621
+ "queued",
622
+ "running",
623
+ "succeeded",
624
+ "failed",
625
+ "cancelled",
626
+ "expired"
627
+ ]
628
+ },
629
+ "createdAt": {
630
+ "type": "string",
631
+ "format": "date-time"
632
+ },
633
+ "expiresAt": {
634
+ "type": "string",
635
+ "format": "date-time"
636
+ },
637
+ "diagnostics": {
638
+ "type": "array",
639
+ "items": {
640
+ "$ref": "#/components/schemas/Diagnostic"
641
+ }
642
+ },
643
+ "artifact": {
644
+ "type": "object",
645
+ "properties": {
646
+ "filename": {
647
+ "type": "string"
648
+ },
649
+ "mediaType": {
650
+ "type": "string"
651
+ },
652
+ "bytes": {
653
+ "type": "integer"
654
+ },
655
+ "url": {
656
+ "type": "string"
657
+ },
658
+ "bundleUrl": {
659
+ "type": "string"
660
+ }
661
+ }
662
+ }
663
+ }
664
+ },
665
+ "ReportRequest": {
666
+ "type": "object",
667
+ "required": [
668
+ "template"
669
+ ],
670
+ "additionalProperties": false,
671
+ "properties": {
672
+ "template": {
673
+ "type": "string",
674
+ "maxLength": 1000000
675
+ },
676
+ "dataSets": {
677
+ "type": "array",
678
+ "default": [],
679
+ "items": {
680
+ "type": "object",
681
+ "required": [
682
+ "name",
683
+ "data"
684
+ ],
685
+ "properties": {
686
+ "name": {
687
+ "type": "string",
688
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
689
+ },
690
+ "data": {
691
+ "type": "object"
692
+ }
693
+ }
694
+ }
695
+ },
696
+ "variables": {
697
+ "type": "object",
698
+ "default": {}
699
+ },
700
+ "format": {
701
+ "enum": [
702
+ "pdf",
703
+ "pptx",
704
+ "docx",
705
+ "html",
706
+ "markdown"
707
+ ],
708
+ "default": "pdf"
709
+ },
710
+ "theme": {
711
+ "type": "object"
712
+ },
713
+ "css": {
714
+ "type": "string"
715
+ },
716
+ "assets": {
717
+ "type": "object",
718
+ "additionalProperties": {
719
+ "type": "object",
720
+ "required": [
721
+ "base64",
722
+ "mediaType"
723
+ ],
724
+ "properties": {
725
+ "base64": {
726
+ "type": "string",
727
+ "contentEncoding": "base64"
728
+ },
729
+ "mediaType": {
730
+ "enum": [
731
+ "image/png",
732
+ "image/jpeg",
733
+ "image/webp",
734
+ "image/svg+xml"
735
+ ]
736
+ }
737
+ }
738
+ }
739
+ },
740
+ "html": {
741
+ "type": "object",
742
+ "properties": {
743
+ "assetMode": {
744
+ "enum": [
745
+ "embedded",
746
+ "bundled"
747
+ ]
748
+ }
749
+ }
750
+ },
751
+ "pdf": {
752
+ "type": "object",
753
+ "properties": {
754
+ "size": {
755
+ "enum": [
756
+ "A4",
757
+ "Letter"
758
+ ]
759
+ },
760
+ "landscape": {
761
+ "type": "boolean"
762
+ },
763
+ "pageNumbers": {
764
+ "type": "boolean"
765
+ },
766
+ "preferCSSPageSize": {
767
+ "type": "boolean"
768
+ }
769
+ }
770
+ },
771
+ "pptx": {
772
+ "type": "object",
773
+ "properties": {
774
+ "editability": {
775
+ "enum": [
776
+ "normal",
777
+ "strict"
778
+ ]
779
+ },
780
+ "layout": {
781
+ "enum": [
782
+ "wide",
783
+ "standard"
784
+ ]
785
+ }
786
+ }
787
+ },
788
+ "docx": {
789
+ "type": "object"
790
+ },
791
+ "diagramMode": {
792
+ "enum": [
793
+ "portable",
794
+ "mermaid"
795
+ ]
796
+ },
797
+ "strictStyles": {
798
+ "type": "boolean"
799
+ }
800
+ }
801
+ }
802
+ }
803
+ }
804
+ }