@dyrected/knowledge 0.2.0

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.
@@ -0,0 +1,1643 @@
1
+ {
2
+ "openapi": "3.0.0",
3
+ "info": {
4
+ "title": "Dyrected API",
5
+ "version": "1.0.0",
6
+ "description": "Automatically generated OpenAPI specification for the Dyrected project."
7
+ },
8
+ "components": {
9
+ "schemas": {
10
+ "WorkflowMetadata": {
11
+ "type": "object",
12
+ "required": [
13
+ "state",
14
+ "revision"
15
+ ],
16
+ "properties": {
17
+ "state": {
18
+ "type": "string"
19
+ },
20
+ "revision": {
21
+ "type": "integer",
22
+ "minimum": 1
23
+ },
24
+ "publishedRevision": {
25
+ "type": "integer",
26
+ "minimum": 1
27
+ },
28
+ "publishedAt": {
29
+ "type": "string",
30
+ "format": "date-time"
31
+ },
32
+ "publishedBy": {
33
+ "type": "string"
34
+ },
35
+ "availableTransitions": {
36
+ "type": "array",
37
+ "items": {
38
+ "type": "string"
39
+ }
40
+ }
41
+ }
42
+ },
43
+ "WorkflowTransitionRequest": {
44
+ "type": "object",
45
+ "properties": {
46
+ "expectedRevision": {
47
+ "type": "integer",
48
+ "minimum": 1
49
+ },
50
+ "comment": {
51
+ "type": "string"
52
+ }
53
+ }
54
+ },
55
+ "WorkflowHistoryEntry": {
56
+ "type": "object",
57
+ "required": [
58
+ "collection",
59
+ "documentId",
60
+ "transition",
61
+ "from",
62
+ "to",
63
+ "revision",
64
+ "createdAt"
65
+ ],
66
+ "properties": {
67
+ "id": {
68
+ "type": "string"
69
+ },
70
+ "collection": {
71
+ "type": "string"
72
+ },
73
+ "documentId": {
74
+ "type": "string"
75
+ },
76
+ "transition": {
77
+ "type": "string"
78
+ },
79
+ "from": {
80
+ "type": "string"
81
+ },
82
+ "to": {
83
+ "type": "string"
84
+ },
85
+ "revision": {
86
+ "type": "integer"
87
+ },
88
+ "comment": {
89
+ "type": "string",
90
+ "nullable": true
91
+ },
92
+ "actorId": {
93
+ "type": "string",
94
+ "nullable": true
95
+ },
96
+ "createdAt": {
97
+ "type": "string",
98
+ "format": "date-time"
99
+ }
100
+ }
101
+ },
102
+ "Error": {
103
+ "type": "object",
104
+ "properties": {
105
+ "message": {
106
+ "type": "string"
107
+ },
108
+ "errors": {
109
+ "type": "array",
110
+ "items": {
111
+ "type": "object",
112
+ "additionalProperties": true
113
+ }
114
+ }
115
+ }
116
+ },
117
+ "AuthCredentials": {
118
+ "type": "object",
119
+ "required": [
120
+ "email",
121
+ "password"
122
+ ],
123
+ "properties": {
124
+ "email": {
125
+ "type": "string",
126
+ "format": "email"
127
+ },
128
+ "password": {
129
+ "type": "string"
130
+ }
131
+ }
132
+ },
133
+ "TokenResponse": {
134
+ "type": "object",
135
+ "properties": {
136
+ "token": {
137
+ "type": "string"
138
+ },
139
+ "user": {
140
+ "type": "object",
141
+ "additionalProperties": true
142
+ }
143
+ }
144
+ },
145
+ "users": {
146
+ "type": "object",
147
+ "properties": {
148
+ "id": {
149
+ "type": "string"
150
+ },
151
+ "createdAt": {
152
+ "type": "string",
153
+ "format": "date-time"
154
+ },
155
+ "updatedAt": {
156
+ "type": "string",
157
+ "format": "date-time"
158
+ },
159
+ "name": {
160
+ "type": "string",
161
+ "description": "Name"
162
+ }
163
+ },
164
+ "required": [
165
+ "id",
166
+ "name"
167
+ ]
168
+ },
169
+ "media": {
170
+ "type": "object",
171
+ "properties": {
172
+ "id": {
173
+ "type": "string"
174
+ },
175
+ "createdAt": {
176
+ "type": "string",
177
+ "format": "date-time"
178
+ },
179
+ "updatedAt": {
180
+ "type": "string",
181
+ "format": "date-time"
182
+ },
183
+ "alt": {
184
+ "type": "string",
185
+ "description": "Alternative text"
186
+ }
187
+ },
188
+ "required": [
189
+ "id"
190
+ ]
191
+ },
192
+ "posts": {
193
+ "type": "object",
194
+ "properties": {
195
+ "id": {
196
+ "type": "string"
197
+ },
198
+ "createdAt": {
199
+ "type": "string",
200
+ "format": "date-time"
201
+ },
202
+ "updatedAt": {
203
+ "type": "string",
204
+ "format": "date-time"
205
+ },
206
+ "_workflow": {
207
+ "$ref": "#/components/schemas/WorkflowMetadata"
208
+ },
209
+ "title": {
210
+ "type": "string",
211
+ "description": "Title"
212
+ },
213
+ "publishedAt": {
214
+ "type": "string",
215
+ "format": "date-time",
216
+ "description": "Published at"
217
+ },
218
+ "author": {
219
+ "type": "string",
220
+ "description": "Author"
221
+ },
222
+ "hero": {
223
+ "type": "string",
224
+ "description": "Hero image"
225
+ }
226
+ },
227
+ "required": [
228
+ "id",
229
+ "title"
230
+ ]
231
+ },
232
+ "settings": {
233
+ "type": "object",
234
+ "properties": {
235
+ "siteName": {
236
+ "type": "string",
237
+ "description": "Site name"
238
+ }
239
+ },
240
+ "required": [
241
+ "siteName"
242
+ ]
243
+ }
244
+ },
245
+ "securitySchemes": {
246
+ "ApiKeyAuth": {
247
+ "type": "apiKey",
248
+ "in": "header",
249
+ "name": "x-api-key"
250
+ }
251
+ }
252
+ },
253
+ "paths": {
254
+ "/api/schemas": {
255
+ "get": {
256
+ "tags": [
257
+ "System"
258
+ ],
259
+ "summary": "Get the serialized Dyrected schema",
260
+ "security": [],
261
+ "responses": {
262
+ "200": {
263
+ "description": "Collection and global schema definitions"
264
+ }
265
+ }
266
+ }
267
+ },
268
+ "/api/openapi.json": {
269
+ "get": {
270
+ "tags": [
271
+ "System"
272
+ ],
273
+ "summary": "Get the OpenAPI specification",
274
+ "security": [],
275
+ "responses": {
276
+ "200": {
277
+ "description": "OpenAPI 3.0 document"
278
+ }
279
+ }
280
+ }
281
+ },
282
+ "/api/docs": {
283
+ "get": {
284
+ "tags": [
285
+ "System"
286
+ ],
287
+ "summary": "Open interactive API documentation",
288
+ "security": [],
289
+ "responses": {
290
+ "200": {
291
+ "description": "Swagger UI HTML"
292
+ }
293
+ }
294
+ }
295
+ },
296
+ "/api/dyrected/options/{collection}/{field}": {
297
+ "get": {
298
+ "tags": [
299
+ "System"
300
+ ],
301
+ "summary": "Resolve dynamic field options",
302
+ "parameters": [
303
+ {
304
+ "name": "collection",
305
+ "in": "path",
306
+ "required": true,
307
+ "schema": {
308
+ "type": "string"
309
+ }
310
+ },
311
+ {
312
+ "name": "field",
313
+ "in": "path",
314
+ "required": true,
315
+ "schema": {
316
+ "type": "string"
317
+ }
318
+ }
319
+ ],
320
+ "responses": {
321
+ "200": {
322
+ "description": "Resolved option items"
323
+ }
324
+ }
325
+ }
326
+ },
327
+ "/api/preferences/{key}": {
328
+ "get": {
329
+ "tags": [
330
+ "Preferences"
331
+ ],
332
+ "summary": "Get an authenticated user preference",
333
+ "parameters": [
334
+ {
335
+ "name": "key",
336
+ "in": "path",
337
+ "required": true,
338
+ "schema": {
339
+ "type": "string"
340
+ }
341
+ }
342
+ ],
343
+ "responses": {
344
+ "200": {
345
+ "description": "Preference value"
346
+ }
347
+ }
348
+ },
349
+ "put": {
350
+ "tags": [
351
+ "Preferences"
352
+ ],
353
+ "summary": "Set an authenticated user preference",
354
+ "parameters": [
355
+ {
356
+ "name": "key",
357
+ "in": "path",
358
+ "required": true,
359
+ "schema": {
360
+ "type": "string"
361
+ }
362
+ }
363
+ ],
364
+ "requestBody": {
365
+ "required": true,
366
+ "content": {
367
+ "application/json": {
368
+ "schema": {
369
+ "type": "object"
370
+ }
371
+ }
372
+ }
373
+ },
374
+ "responses": {
375
+ "200": {
376
+ "description": "Updated preference"
377
+ }
378
+ }
379
+ }
380
+ },
381
+ "/api/preview-token": {
382
+ "post": {
383
+ "tags": [
384
+ "Preview"
385
+ ],
386
+ "summary": "Create a preview token",
387
+ "responses": {
388
+ "200": {
389
+ "description": "Short-lived preview token"
390
+ }
391
+ }
392
+ }
393
+ },
394
+ "/api/preview-data": {
395
+ "get": {
396
+ "tags": [
397
+ "Preview"
398
+ ],
399
+ "summary": "Resolve preview data from a token",
400
+ "security": [],
401
+ "parameters": [
402
+ {
403
+ "name": "token",
404
+ "in": "query",
405
+ "required": true,
406
+ "schema": {
407
+ "type": "string"
408
+ }
409
+ }
410
+ ],
411
+ "responses": {
412
+ "200": {
413
+ "description": "Preview document data"
414
+ }
415
+ }
416
+ }
417
+ },
418
+ "/api/collections/users": {
419
+ "get": {
420
+ "tags": [
421
+ "Collections"
422
+ ],
423
+ "summary": "Find Users",
424
+ "parameters": [
425
+ {
426
+ "name": "limit",
427
+ "in": "query",
428
+ "schema": {
429
+ "type": "integer",
430
+ "default": 10
431
+ }
432
+ },
433
+ {
434
+ "name": "page",
435
+ "in": "query",
436
+ "schema": {
437
+ "type": "integer",
438
+ "default": 1
439
+ }
440
+ },
441
+ {
442
+ "name": "where",
443
+ "in": "query",
444
+ "schema": {
445
+ "type": "string"
446
+ },
447
+ "description": "JSON filter"
448
+ },
449
+ {
450
+ "name": "sort",
451
+ "in": "query",
452
+ "schema": {
453
+ "type": "string"
454
+ },
455
+ "description": "Sort field (e.g. -createdAt)"
456
+ }
457
+ ],
458
+ "responses": {
459
+ "200": {
460
+ "description": "Success",
461
+ "content": {
462
+ "application/json": {
463
+ "schema": {
464
+ "type": "object",
465
+ "properties": {
466
+ "docs": {
467
+ "type": "array",
468
+ "items": {
469
+ "$ref": "#/components/schemas/users"
470
+ }
471
+ },
472
+ "total": {
473
+ "type": "integer"
474
+ },
475
+ "limit": {
476
+ "type": "integer"
477
+ },
478
+ "page": {
479
+ "type": "integer"
480
+ }
481
+ }
482
+ }
483
+ }
484
+ }
485
+ }
486
+ }
487
+ },
488
+ "post": {
489
+ "tags": [
490
+ "Collections"
491
+ ],
492
+ "summary": "Create User",
493
+ "requestBody": {
494
+ "required": true,
495
+ "content": {
496
+ "application/json": {
497
+ "schema": {
498
+ "$ref": "#/components/schemas/users"
499
+ }
500
+ }
501
+ }
502
+ },
503
+ "responses": {
504
+ "201": {
505
+ "description": "Created",
506
+ "content": {
507
+ "application/json": {
508
+ "schema": {
509
+ "$ref": "#/components/schemas/users"
510
+ }
511
+ }
512
+ }
513
+ }
514
+ }
515
+ }
516
+ },
517
+ "/api/collections/users/{id}": {
518
+ "get": {
519
+ "tags": [
520
+ "Collections"
521
+ ],
522
+ "summary": "Get a single User",
523
+ "parameters": [
524
+ {
525
+ "name": "id",
526
+ "in": "path",
527
+ "required": true,
528
+ "schema": {
529
+ "type": "string"
530
+ }
531
+ }
532
+ ],
533
+ "responses": {
534
+ "200": {
535
+ "description": "Success",
536
+ "content": {
537
+ "application/json": {
538
+ "schema": {
539
+ "$ref": "#/components/schemas/users"
540
+ }
541
+ }
542
+ }
543
+ }
544
+ }
545
+ },
546
+ "patch": {
547
+ "tags": [
548
+ "Collections"
549
+ ],
550
+ "summary": "Update User",
551
+ "parameters": [
552
+ {
553
+ "name": "id",
554
+ "in": "path",
555
+ "required": true,
556
+ "schema": {
557
+ "type": "string"
558
+ }
559
+ }
560
+ ],
561
+ "requestBody": {
562
+ "required": true,
563
+ "content": {
564
+ "application/json": {
565
+ "schema": {
566
+ "$ref": "#/components/schemas/users"
567
+ }
568
+ }
569
+ }
570
+ },
571
+ "responses": {
572
+ "200": {
573
+ "description": "Updated",
574
+ "content": {
575
+ "application/json": {
576
+ "schema": {
577
+ "$ref": "#/components/schemas/users"
578
+ }
579
+ }
580
+ }
581
+ }
582
+ }
583
+ },
584
+ "delete": {
585
+ "tags": [
586
+ "Collections"
587
+ ],
588
+ "summary": "Delete User",
589
+ "parameters": [
590
+ {
591
+ "name": "id",
592
+ "in": "path",
593
+ "required": true,
594
+ "schema": {
595
+ "type": "string"
596
+ }
597
+ }
598
+ ],
599
+ "responses": {
600
+ "204": {
601
+ "description": "Deleted"
602
+ }
603
+ }
604
+ }
605
+ },
606
+ "/api/collections/users/delete-many": {
607
+ "delete": {
608
+ "tags": [
609
+ "Collections"
610
+ ],
611
+ "summary": "Delete multiple Users",
612
+ "requestBody": {
613
+ "required": true,
614
+ "content": {
615
+ "application/json": {
616
+ "schema": {
617
+ "type": "object",
618
+ "required": [
619
+ "ids"
620
+ ],
621
+ "properties": {
622
+ "ids": {
623
+ "type": "array",
624
+ "items": {
625
+ "type": "string"
626
+ }
627
+ }
628
+ }
629
+ }
630
+ }
631
+ }
632
+ },
633
+ "responses": {
634
+ "200": {
635
+ "description": "Deleted and failed document IDs"
636
+ }
637
+ }
638
+ }
639
+ },
640
+ "/api/collections/users/seed": {
641
+ "post": {
642
+ "tags": [
643
+ "Collections"
644
+ ],
645
+ "summary": "Seed initial Users",
646
+ "responses": {
647
+ "200": {
648
+ "description": "Seeded documents"
649
+ }
650
+ }
651
+ }
652
+ },
653
+ "/api/collections/users/login": {
654
+ "post": {
655
+ "tags": [
656
+ "Authentication"
657
+ ],
658
+ "summary": "Log in to Users",
659
+ "security": [],
660
+ "requestBody": {
661
+ "required": true,
662
+ "content": {
663
+ "application/json": {
664
+ "schema": {
665
+ "$ref": "#/components/schemas/AuthCredentials"
666
+ }
667
+ }
668
+ }
669
+ },
670
+ "responses": {
671
+ "200": {
672
+ "description": "Authenticated",
673
+ "content": {
674
+ "application/json": {
675
+ "schema": {
676
+ "$ref": "#/components/schemas/TokenResponse"
677
+ }
678
+ }
679
+ }
680
+ },
681
+ "401": {
682
+ "description": "Invalid credentials"
683
+ }
684
+ }
685
+ }
686
+ },
687
+ "/api/collections/users/logout": {
688
+ "post": {
689
+ "tags": [
690
+ "Authentication"
691
+ ],
692
+ "summary": "Log out of Users",
693
+ "responses": {
694
+ "200": {
695
+ "description": "Logged out"
696
+ }
697
+ }
698
+ }
699
+ },
700
+ "/api/collections/users/init": {
701
+ "get": {
702
+ "tags": [
703
+ "Authentication"
704
+ ],
705
+ "summary": "Get Users initialization state",
706
+ "security": [],
707
+ "responses": {
708
+ "200": {
709
+ "description": "Initialization state"
710
+ }
711
+ }
712
+ }
713
+ },
714
+ "/api/collections/users/first-user": {
715
+ "post": {
716
+ "tags": [
717
+ "Authentication"
718
+ ],
719
+ "summary": "Register the first User",
720
+ "security": [],
721
+ "requestBody": {
722
+ "required": true,
723
+ "content": {
724
+ "application/json": {
725
+ "schema": {
726
+ "type": "object",
727
+ "additionalProperties": true
728
+ }
729
+ }
730
+ }
731
+ },
732
+ "responses": {
733
+ "200": {
734
+ "description": "Success"
735
+ },
736
+ "400": {
737
+ "description": "Invalid request"
738
+ }
739
+ }
740
+ }
741
+ },
742
+ "/api/collections/users/me": {
743
+ "get": {
744
+ "tags": [
745
+ "Authentication"
746
+ ],
747
+ "summary": "Get the current User",
748
+ "responses": {
749
+ "200": {
750
+ "description": "Authenticated user"
751
+ }
752
+ }
753
+ }
754
+ },
755
+ "/api/collections/users/refresh-token": {
756
+ "post": {
757
+ "tags": [
758
+ "Authentication"
759
+ ],
760
+ "summary": "Refresh an authentication token",
761
+ "responses": {
762
+ "200": {
763
+ "description": "Refreshed token"
764
+ }
765
+ }
766
+ }
767
+ },
768
+ "/api/collections/users/forgot-password": {
769
+ "post": {
770
+ "tags": [
771
+ "Authentication"
772
+ ],
773
+ "summary": "Request a password reset",
774
+ "security": [],
775
+ "requestBody": {
776
+ "required": true,
777
+ "content": {
778
+ "application/json": {
779
+ "schema": {
780
+ "type": "object",
781
+ "additionalProperties": true
782
+ }
783
+ }
784
+ }
785
+ },
786
+ "responses": {
787
+ "200": {
788
+ "description": "Success"
789
+ },
790
+ "400": {
791
+ "description": "Invalid request"
792
+ }
793
+ }
794
+ }
795
+ },
796
+ "/api/collections/users/reset-password": {
797
+ "post": {
798
+ "tags": [
799
+ "Authentication"
800
+ ],
801
+ "summary": "Reset a password",
802
+ "security": [],
803
+ "requestBody": {
804
+ "required": true,
805
+ "content": {
806
+ "application/json": {
807
+ "schema": {
808
+ "type": "object",
809
+ "additionalProperties": true
810
+ }
811
+ }
812
+ }
813
+ },
814
+ "responses": {
815
+ "200": {
816
+ "description": "Success"
817
+ },
818
+ "400": {
819
+ "description": "Invalid request"
820
+ }
821
+ }
822
+ }
823
+ },
824
+ "/api/collections/users/invite": {
825
+ "post": {
826
+ "tags": [
827
+ "Authentication"
828
+ ],
829
+ "summary": "Invite a User",
830
+ "responses": {
831
+ "200": {
832
+ "description": "Invitation sent"
833
+ }
834
+ }
835
+ }
836
+ },
837
+ "/api/collections/users/accept-invite": {
838
+ "post": {
839
+ "tags": [
840
+ "Authentication"
841
+ ],
842
+ "summary": "Accept an invitation",
843
+ "security": [],
844
+ "requestBody": {
845
+ "required": true,
846
+ "content": {
847
+ "application/json": {
848
+ "schema": {
849
+ "type": "object",
850
+ "additionalProperties": true
851
+ }
852
+ }
853
+ }
854
+ },
855
+ "responses": {
856
+ "200": {
857
+ "description": "Success"
858
+ },
859
+ "400": {
860
+ "description": "Invalid request"
861
+ }
862
+ }
863
+ }
864
+ },
865
+ "/api/collections/users/{id}/change-password": {
866
+ "post": {
867
+ "tags": [
868
+ "Authentication"
869
+ ],
870
+ "summary": "Change a User password",
871
+ "parameters": [
872
+ {
873
+ "name": "id",
874
+ "in": "path",
875
+ "required": true,
876
+ "schema": {
877
+ "type": "string"
878
+ }
879
+ }
880
+ ],
881
+ "responses": {
882
+ "200": {
883
+ "description": "Password changed"
884
+ }
885
+ }
886
+ }
887
+ },
888
+ "/api/collections/media": {
889
+ "get": {
890
+ "tags": [
891
+ "Collections"
892
+ ],
893
+ "summary": "Find Media",
894
+ "parameters": [
895
+ {
896
+ "name": "limit",
897
+ "in": "query",
898
+ "schema": {
899
+ "type": "integer",
900
+ "default": 10
901
+ }
902
+ },
903
+ {
904
+ "name": "page",
905
+ "in": "query",
906
+ "schema": {
907
+ "type": "integer",
908
+ "default": 1
909
+ }
910
+ },
911
+ {
912
+ "name": "where",
913
+ "in": "query",
914
+ "schema": {
915
+ "type": "string"
916
+ },
917
+ "description": "JSON filter"
918
+ },
919
+ {
920
+ "name": "sort",
921
+ "in": "query",
922
+ "schema": {
923
+ "type": "string"
924
+ },
925
+ "description": "Sort field (e.g. -createdAt)"
926
+ }
927
+ ],
928
+ "responses": {
929
+ "200": {
930
+ "description": "Success",
931
+ "content": {
932
+ "application/json": {
933
+ "schema": {
934
+ "type": "object",
935
+ "properties": {
936
+ "docs": {
937
+ "type": "array",
938
+ "items": {
939
+ "$ref": "#/components/schemas/media"
940
+ }
941
+ },
942
+ "total": {
943
+ "type": "integer"
944
+ },
945
+ "limit": {
946
+ "type": "integer"
947
+ },
948
+ "page": {
949
+ "type": "integer"
950
+ }
951
+ }
952
+ }
953
+ }
954
+ }
955
+ }
956
+ }
957
+ },
958
+ "post": {
959
+ "tags": [
960
+ "Collections"
961
+ ],
962
+ "summary": "Create Media item",
963
+ "requestBody": {
964
+ "required": true,
965
+ "content": {
966
+ "application/json": {
967
+ "schema": {
968
+ "$ref": "#/components/schemas/media"
969
+ }
970
+ }
971
+ }
972
+ },
973
+ "responses": {
974
+ "201": {
975
+ "description": "Created",
976
+ "content": {
977
+ "application/json": {
978
+ "schema": {
979
+ "$ref": "#/components/schemas/media"
980
+ }
981
+ }
982
+ }
983
+ }
984
+ }
985
+ }
986
+ },
987
+ "/api/collections/media/{id}": {
988
+ "get": {
989
+ "tags": [
990
+ "Collections"
991
+ ],
992
+ "summary": "Get a single Media item",
993
+ "parameters": [
994
+ {
995
+ "name": "id",
996
+ "in": "path",
997
+ "required": true,
998
+ "schema": {
999
+ "type": "string"
1000
+ }
1001
+ }
1002
+ ],
1003
+ "responses": {
1004
+ "200": {
1005
+ "description": "Success",
1006
+ "content": {
1007
+ "application/json": {
1008
+ "schema": {
1009
+ "$ref": "#/components/schemas/media"
1010
+ }
1011
+ }
1012
+ }
1013
+ }
1014
+ }
1015
+ },
1016
+ "patch": {
1017
+ "tags": [
1018
+ "Collections"
1019
+ ],
1020
+ "summary": "Update Media item",
1021
+ "parameters": [
1022
+ {
1023
+ "name": "id",
1024
+ "in": "path",
1025
+ "required": true,
1026
+ "schema": {
1027
+ "type": "string"
1028
+ }
1029
+ }
1030
+ ],
1031
+ "requestBody": {
1032
+ "required": true,
1033
+ "content": {
1034
+ "application/json": {
1035
+ "schema": {
1036
+ "$ref": "#/components/schemas/media"
1037
+ }
1038
+ }
1039
+ }
1040
+ },
1041
+ "responses": {
1042
+ "200": {
1043
+ "description": "Updated",
1044
+ "content": {
1045
+ "application/json": {
1046
+ "schema": {
1047
+ "$ref": "#/components/schemas/media"
1048
+ }
1049
+ }
1050
+ }
1051
+ }
1052
+ }
1053
+ },
1054
+ "delete": {
1055
+ "tags": [
1056
+ "Collections"
1057
+ ],
1058
+ "summary": "Delete Media item",
1059
+ "parameters": [
1060
+ {
1061
+ "name": "id",
1062
+ "in": "path",
1063
+ "required": true,
1064
+ "schema": {
1065
+ "type": "string"
1066
+ }
1067
+ }
1068
+ ],
1069
+ "responses": {
1070
+ "204": {
1071
+ "description": "Deleted"
1072
+ }
1073
+ }
1074
+ }
1075
+ },
1076
+ "/api/collections/media/delete-many": {
1077
+ "delete": {
1078
+ "tags": [
1079
+ "Collections"
1080
+ ],
1081
+ "summary": "Delete multiple Media",
1082
+ "requestBody": {
1083
+ "required": true,
1084
+ "content": {
1085
+ "application/json": {
1086
+ "schema": {
1087
+ "type": "object",
1088
+ "required": [
1089
+ "ids"
1090
+ ],
1091
+ "properties": {
1092
+ "ids": {
1093
+ "type": "array",
1094
+ "items": {
1095
+ "type": "string"
1096
+ }
1097
+ }
1098
+ }
1099
+ }
1100
+ }
1101
+ }
1102
+ },
1103
+ "responses": {
1104
+ "200": {
1105
+ "description": "Deleted and failed document IDs"
1106
+ }
1107
+ }
1108
+ }
1109
+ },
1110
+ "/api/collections/media/seed": {
1111
+ "post": {
1112
+ "tags": [
1113
+ "Collections"
1114
+ ],
1115
+ "summary": "Seed initial Media",
1116
+ "responses": {
1117
+ "200": {
1118
+ "description": "Seeded documents"
1119
+ }
1120
+ }
1121
+ }
1122
+ },
1123
+ "/api/collections/media/media": {
1124
+ "get": {
1125
+ "tags": [
1126
+ "Media"
1127
+ ],
1128
+ "summary": "List Media",
1129
+ "responses": {
1130
+ "200": {
1131
+ "description": "Paginated media documents"
1132
+ }
1133
+ }
1134
+ },
1135
+ "post": {
1136
+ "tags": [
1137
+ "Media"
1138
+ ],
1139
+ "summary": "Upload Media item",
1140
+ "requestBody": {
1141
+ "required": true,
1142
+ "content": {
1143
+ "multipart/form-data": {
1144
+ "schema": {
1145
+ "type": "object",
1146
+ "required": [
1147
+ "file"
1148
+ ],
1149
+ "properties": {
1150
+ "file": {
1151
+ "type": "string",
1152
+ "format": "binary"
1153
+ }
1154
+ }
1155
+ }
1156
+ }
1157
+ }
1158
+ },
1159
+ "responses": {
1160
+ "201": {
1161
+ "description": "Uploaded media document"
1162
+ }
1163
+ }
1164
+ }
1165
+ },
1166
+ "/api/collections/media/media/{filename}": {
1167
+ "get": {
1168
+ "tags": [
1169
+ "Media"
1170
+ ],
1171
+ "summary": "Serve Media item bytes",
1172
+ "parameters": [
1173
+ {
1174
+ "name": "filename",
1175
+ "in": "path",
1176
+ "required": true,
1177
+ "schema": {
1178
+ "type": "string"
1179
+ }
1180
+ }
1181
+ ],
1182
+ "security": [],
1183
+ "responses": {
1184
+ "200": {
1185
+ "description": "Stored file"
1186
+ },
1187
+ "404": {
1188
+ "description": "File not found"
1189
+ }
1190
+ }
1191
+ }
1192
+ },
1193
+ "/api/collections/posts": {
1194
+ "get": {
1195
+ "tags": [
1196
+ "Collections"
1197
+ ],
1198
+ "summary": "Find Posts",
1199
+ "parameters": [
1200
+ {
1201
+ "name": "limit",
1202
+ "in": "query",
1203
+ "schema": {
1204
+ "type": "integer",
1205
+ "default": 10
1206
+ }
1207
+ },
1208
+ {
1209
+ "name": "page",
1210
+ "in": "query",
1211
+ "schema": {
1212
+ "type": "integer",
1213
+ "default": 1
1214
+ }
1215
+ },
1216
+ {
1217
+ "name": "where",
1218
+ "in": "query",
1219
+ "schema": {
1220
+ "type": "string"
1221
+ },
1222
+ "description": "JSON filter"
1223
+ },
1224
+ {
1225
+ "name": "sort",
1226
+ "in": "query",
1227
+ "schema": {
1228
+ "type": "string"
1229
+ },
1230
+ "description": "Sort field (e.g. -createdAt)"
1231
+ }
1232
+ ],
1233
+ "responses": {
1234
+ "200": {
1235
+ "description": "Success",
1236
+ "content": {
1237
+ "application/json": {
1238
+ "schema": {
1239
+ "type": "object",
1240
+ "properties": {
1241
+ "docs": {
1242
+ "type": "array",
1243
+ "items": {
1244
+ "$ref": "#/components/schemas/posts"
1245
+ }
1246
+ },
1247
+ "total": {
1248
+ "type": "integer"
1249
+ },
1250
+ "limit": {
1251
+ "type": "integer"
1252
+ },
1253
+ "page": {
1254
+ "type": "integer"
1255
+ }
1256
+ }
1257
+ }
1258
+ }
1259
+ }
1260
+ }
1261
+ }
1262
+ },
1263
+ "post": {
1264
+ "tags": [
1265
+ "Collections"
1266
+ ],
1267
+ "summary": "Create Post",
1268
+ "requestBody": {
1269
+ "required": true,
1270
+ "content": {
1271
+ "application/json": {
1272
+ "schema": {
1273
+ "$ref": "#/components/schemas/posts"
1274
+ }
1275
+ }
1276
+ }
1277
+ },
1278
+ "responses": {
1279
+ "201": {
1280
+ "description": "Created",
1281
+ "content": {
1282
+ "application/json": {
1283
+ "schema": {
1284
+ "$ref": "#/components/schemas/posts"
1285
+ }
1286
+ }
1287
+ }
1288
+ }
1289
+ }
1290
+ }
1291
+ },
1292
+ "/api/collections/posts/{id}": {
1293
+ "get": {
1294
+ "tags": [
1295
+ "Collections"
1296
+ ],
1297
+ "summary": "Get a single Post",
1298
+ "parameters": [
1299
+ {
1300
+ "name": "id",
1301
+ "in": "path",
1302
+ "required": true,
1303
+ "schema": {
1304
+ "type": "string"
1305
+ }
1306
+ }
1307
+ ],
1308
+ "responses": {
1309
+ "200": {
1310
+ "description": "Success",
1311
+ "content": {
1312
+ "application/json": {
1313
+ "schema": {
1314
+ "$ref": "#/components/schemas/posts"
1315
+ }
1316
+ }
1317
+ }
1318
+ }
1319
+ }
1320
+ },
1321
+ "patch": {
1322
+ "tags": [
1323
+ "Collections"
1324
+ ],
1325
+ "summary": "Update Post",
1326
+ "parameters": [
1327
+ {
1328
+ "name": "id",
1329
+ "in": "path",
1330
+ "required": true,
1331
+ "schema": {
1332
+ "type": "string"
1333
+ }
1334
+ }
1335
+ ],
1336
+ "requestBody": {
1337
+ "required": true,
1338
+ "content": {
1339
+ "application/json": {
1340
+ "schema": {
1341
+ "$ref": "#/components/schemas/posts"
1342
+ }
1343
+ }
1344
+ }
1345
+ },
1346
+ "responses": {
1347
+ "200": {
1348
+ "description": "Updated",
1349
+ "content": {
1350
+ "application/json": {
1351
+ "schema": {
1352
+ "$ref": "#/components/schemas/posts"
1353
+ }
1354
+ }
1355
+ }
1356
+ }
1357
+ }
1358
+ },
1359
+ "delete": {
1360
+ "tags": [
1361
+ "Collections"
1362
+ ],
1363
+ "summary": "Delete Post",
1364
+ "parameters": [
1365
+ {
1366
+ "name": "id",
1367
+ "in": "path",
1368
+ "required": true,
1369
+ "schema": {
1370
+ "type": "string"
1371
+ }
1372
+ }
1373
+ ],
1374
+ "responses": {
1375
+ "204": {
1376
+ "description": "Deleted"
1377
+ }
1378
+ }
1379
+ }
1380
+ },
1381
+ "/api/collections/posts/delete-many": {
1382
+ "delete": {
1383
+ "tags": [
1384
+ "Collections"
1385
+ ],
1386
+ "summary": "Delete multiple Posts",
1387
+ "requestBody": {
1388
+ "required": true,
1389
+ "content": {
1390
+ "application/json": {
1391
+ "schema": {
1392
+ "type": "object",
1393
+ "required": [
1394
+ "ids"
1395
+ ],
1396
+ "properties": {
1397
+ "ids": {
1398
+ "type": "array",
1399
+ "items": {
1400
+ "type": "string"
1401
+ }
1402
+ }
1403
+ }
1404
+ }
1405
+ }
1406
+ }
1407
+ },
1408
+ "responses": {
1409
+ "200": {
1410
+ "description": "Deleted and failed document IDs"
1411
+ }
1412
+ }
1413
+ }
1414
+ },
1415
+ "/api/collections/posts/seed": {
1416
+ "post": {
1417
+ "tags": [
1418
+ "Collections"
1419
+ ],
1420
+ "summary": "Seed initial Posts",
1421
+ "responses": {
1422
+ "200": {
1423
+ "description": "Seeded documents"
1424
+ }
1425
+ }
1426
+ }
1427
+ },
1428
+ "/api/collections/posts/{id}/transitions/{transition}": {
1429
+ "post": {
1430
+ "tags": [
1431
+ "Workflows"
1432
+ ],
1433
+ "summary": "Transition Post workflow",
1434
+ "parameters": [
1435
+ {
1436
+ "name": "id",
1437
+ "in": "path",
1438
+ "required": true,
1439
+ "schema": {
1440
+ "type": "string"
1441
+ }
1442
+ },
1443
+ {
1444
+ "name": "transition",
1445
+ "in": "path",
1446
+ "required": true,
1447
+ "schema": {
1448
+ "type": "string",
1449
+ "enum": [
1450
+ "submit",
1451
+ "publish",
1452
+ "reject",
1453
+ "unpublish"
1454
+ ]
1455
+ }
1456
+ }
1457
+ ],
1458
+ "requestBody": {
1459
+ "content": {
1460
+ "application/json": {
1461
+ "schema": {
1462
+ "$ref": "#/components/schemas/WorkflowTransitionRequest"
1463
+ }
1464
+ }
1465
+ }
1466
+ },
1467
+ "responses": {
1468
+ "200": {
1469
+ "description": "Transition applied",
1470
+ "content": {
1471
+ "application/json": {
1472
+ "schema": {
1473
+ "$ref": "#/components/schemas/posts"
1474
+ }
1475
+ }
1476
+ }
1477
+ },
1478
+ "400": {
1479
+ "description": "Required transition input is missing"
1480
+ },
1481
+ "403": {
1482
+ "description": "Transition capability denied"
1483
+ },
1484
+ "409": {
1485
+ "description": "Invalid state or stale revision"
1486
+ }
1487
+ }
1488
+ }
1489
+ },
1490
+ "/api/collections/posts/{id}/workflow-history": {
1491
+ "get": {
1492
+ "tags": [
1493
+ "Workflows"
1494
+ ],
1495
+ "summary": "Get Post workflow history",
1496
+ "parameters": [
1497
+ {
1498
+ "name": "id",
1499
+ "in": "path",
1500
+ "required": true,
1501
+ "schema": {
1502
+ "type": "string"
1503
+ }
1504
+ },
1505
+ {
1506
+ "name": "limit",
1507
+ "in": "query",
1508
+ "schema": {
1509
+ "type": "integer",
1510
+ "default": 50,
1511
+ "maximum": 100
1512
+ }
1513
+ }
1514
+ ],
1515
+ "responses": {
1516
+ "200": {
1517
+ "description": "Workflow transition history",
1518
+ "content": {
1519
+ "application/json": {
1520
+ "schema": {
1521
+ "type": "object",
1522
+ "properties": {
1523
+ "docs": {
1524
+ "type": "array",
1525
+ "items": {
1526
+ "$ref": "#/components/schemas/WorkflowHistoryEntry"
1527
+ }
1528
+ },
1529
+ "total": {
1530
+ "type": "integer"
1531
+ },
1532
+ "limit": {
1533
+ "type": "integer"
1534
+ },
1535
+ "page": {
1536
+ "type": "integer"
1537
+ }
1538
+ }
1539
+ }
1540
+ }
1541
+ }
1542
+ },
1543
+ "403": {
1544
+ "description": "Collection read access denied"
1545
+ }
1546
+ }
1547
+ }
1548
+ },
1549
+ "/api/globals/settings": {
1550
+ "get": {
1551
+ "tags": [
1552
+ "Globals"
1553
+ ],
1554
+ "summary": "Get Site settings",
1555
+ "responses": {
1556
+ "200": {
1557
+ "description": "Success",
1558
+ "content": {
1559
+ "application/json": {
1560
+ "schema": {
1561
+ "$ref": "#/components/schemas/settings"
1562
+ }
1563
+ }
1564
+ }
1565
+ }
1566
+ }
1567
+ },
1568
+ "patch": {
1569
+ "tags": [
1570
+ "Globals"
1571
+ ],
1572
+ "summary": "Update Site settings",
1573
+ "requestBody": {
1574
+ "required": true,
1575
+ "content": {
1576
+ "application/json": {
1577
+ "schema": {
1578
+ "$ref": "#/components/schemas/settings"
1579
+ }
1580
+ }
1581
+ }
1582
+ },
1583
+ "responses": {
1584
+ "200": {
1585
+ "description": "Updated",
1586
+ "content": {
1587
+ "application/json": {
1588
+ "schema": {
1589
+ "$ref": "#/components/schemas/settings"
1590
+ }
1591
+ }
1592
+ }
1593
+ }
1594
+ }
1595
+ }
1596
+ },
1597
+ "/api/globals/settings/seed": {
1598
+ "post": {
1599
+ "tags": [
1600
+ "Globals"
1601
+ ],
1602
+ "summary": "Seed Site settings",
1603
+ "responses": {
1604
+ "200": {
1605
+ "description": "Seeded global"
1606
+ }
1607
+ }
1608
+ }
1609
+ },
1610
+ "/api/media/{filename}": {
1611
+ "get": {
1612
+ "tags": [
1613
+ "Media"
1614
+ ],
1615
+ "summary": "Serve a stored file",
1616
+ "security": [],
1617
+ "parameters": [
1618
+ {
1619
+ "name": "filename",
1620
+ "in": "path",
1621
+ "required": true,
1622
+ "schema": {
1623
+ "type": "string"
1624
+ }
1625
+ }
1626
+ ],
1627
+ "responses": {
1628
+ "200": {
1629
+ "description": "Stored file bytes"
1630
+ },
1631
+ "404": {
1632
+ "description": "File not found"
1633
+ }
1634
+ }
1635
+ }
1636
+ }
1637
+ },
1638
+ "security": [
1639
+ {
1640
+ "ApiKeyAuth": []
1641
+ }
1642
+ ]
1643
+ }