ordinary-config 0.7.0

Config for Ordinary
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "OrdinaryConfig",
  "description": "Config definition for an Ordinary Application",
  "type": "object",
  "properties": {
    "lifecycle": {
      "anyOf": [
        {
          "$ref": "#/$defs/TopLevelLifecycle"
        },
        {
          "type": "null"
        }
      ]
    },
    "domain": {
      "description": "Domain name for the application to be run from the\ndeployment environment.",
      "type": "string"
    },
    "cnames": {
      "description": "additional domains with a CNAME or ALIAS records\npointing at the primary `OrdinaryConfig::domain`.\n\nadd a TXT record in the following format:\n`ordinary=your.config.domain`",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      }
    },
    "canonical": {
      "description": "specify which of the `domain` or `cnames` is\nthe \"canonical\" location.\n\nthis is useful for [indexing](https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls)\nand situations where you want to display the primary\nURL as text on the page itself (i.e. pick one of `example.some.host`, `example.com`, and `www.example.com`).\n\ndefaults to `domain` if `cnames` is empty. defaults to first `cname` in list if `cnames`\nare not empty.",
      "type": [
        "string",
        "null"
      ]
    },
    "redirects": {
      "description": "configuration of internal redirects",
      "anyOf": [
        {
          "$ref": "#/$defs/Redirects"
        },
        {
          "type": "null"
        }
      ]
    },
    "proxies": {
      "description": "configuration of proxied services",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/ProxyConfig"
      }
    },
    "contacts": {
      "description": "list of email addresses that can be used to contact\nthe application owner or administrators.",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      }
    },
    "hide_contacts": {
      "description": "whether contacts should be hidden (defaults to `true`)",
      "type": [
        "boolean",
        "null"
      ]
    },
    "version": {
      "description": "Version of the site build.",
      "type": "string"
    },
    "storage_size": {
      "description": "Storage size in bytes (rounded up to nearest OS page size).",
      "type": [
        "integer",
        "null"
      ],
      "format": "uint64",
      "minimum": 0,
      "default": 5000000
    },
    "default_timeout": {
      "description": "Default request timeout.\n\nUnit (seconds).",
      "type": [
        "integer",
        "null"
      ],
      "format": "uint16",
      "minimum": 0,
      "maximum": 65535
    },
    "csp": {
      "description": "HTTP Content Security Policy configuration.\n\n<https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP>\n\n\"Base\" defaults to `default-src 'self';` and tacks on SHA-256 integrity\nhashes for all inlined scripts and styles (generated at build time) to\n`script-src 'self' sha256-b64` and `style-src 'self' sha256-b64`, respectively.\n\n`https:` is used when not running in `--insecure` mode.",
      "anyOf": [
        {
          "$ref": "#/$defs/HttpCsp"
        },
        {
          "type": "null"
        }
      ]
    },
    "cors": {
      "anyOf": [
        {
          "$ref": "#/$defs/HttpCors"
        },
        {
          "type": "null"
        }
      ]
    },
    "runtime": {
      "description": "Specifies runtime mode for application on the host.\n\nIf none is specified, defaults to Shared (or host default).",
      "anyOf": [
        {
          "$ref": "#/$defs/RuntimeMode"
        },
        {
          "type": "null"
        }
      ]
    },
    "hide_schema": {
      "description": "When set to true, `{{ domain }}/.ordinary/schema`\nis not addressable.\n\nNote: this can break applications which depend on\nflags, and `action`/`template` query descriptors.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "client_rendering": {
      "description": "Include template rendering code in the client WASM.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "obfuscation": {
      "description": "Include E2EE handler code in the client WASM.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "client_events": {
      "description": "Include E2EE handler code in the client WASM.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "port": {
      "description": "Port to be used for standalone \"run\" instances.",
      "type": [
        "integer",
        "null"
      ],
      "format": "uint16",
      "minimum": 0,
      "maximum": 65535
    },
    "redirect_port": {
      "description": "port used for redirecting from http when\nstandalone is running in secure mode.",
      "type": [
        "integer",
        "null"
      ],
      "format": "uint16",
      "minimum": 0,
      "maximum": 65535
    },
    "logging": {
      "anyOf": [
        {
          "$ref": "#/$defs/LoggingConfig"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "description": "Configures error handling.\n\nNote: If not included just the error message will be\nsent back as text.",
      "anyOf": [
        {
          "$ref": "#/$defs/ErrorConfig"
        },
        {
          "type": "null"
        }
      ]
    },
    "auth": {
      "description": "Auth config for the Ordinary application.",
      "anyOf": [
        {
          "$ref": "#/$defs/AuthConfig"
        },
        {
          "type": "null"
        }
      ]
    },
    "globals": {
      "description": "Global constants that can be accessed from templates",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/Global"
      }
    },
    "secrets": {
      "description": "Secrets that can be used by actions or integrations.",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/Secret"
      }
    },
    "flags": {
      "description": "Feature flags which can be referenced from templates\nto inform application behavior, and run experiments.",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/Flag"
      }
    },
    "content": {
      "description": "Definitions for static content \"types\"/object structure\nthat can be used to inform template/page development (i.e.\none might define a \"post\" content definition, and then create\na template for their blog).",
      "anyOf": [
        {
          "$ref": "#/$defs/Content"
        },
        {
          "type": "null"
        }
      ]
    },
    "models": {
      "description": "Definitions for the models that will be stored in the Ordinary database.",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/ModelConfig"
      }
    },
    "integrations": {
      "description": "Definitions for the external APIs that will be integrated\ninto the Ordinary application.",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/IntegrationConfig"
      }
    },
    "actions": {
      "description": "IO, access and language configuration for actions that\nare compiled to and executed as WebAssembly modules.",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/ActionConfig"
      }
    },
    "assets": {
      "description": "Specifies the asset directory and per-path configuration\ndetails for assets that require preprocessing (TypeScript, SCSS,\nJavaScript minification, etc.)",
      "anyOf": [
        {
          "$ref": "#/$defs/AssetsConfig"
        },
        {
          "type": "null"
        }
      ]
    },
    "fragments": {
      "description": "Configuration for the template fragments",
      "anyOf": [
        {
          "$ref": "#/$defs/FragmentsConfig"
        },
        {
          "type": "null"
        }
      ]
    },
    "templates": {
      "description": "Configuration for the templates/pages that the application\nwill render. Each template is compiled to a WebAssembly module\nwhich accepts runtime arguments for models/content/integrations, and can be\nexecuted on either the server or the client.\n\nWith the option to render on the client, only the result of the server\nquery needs to be sent, in a compact, optimized, format.\n\nCurrently, all rendering is happening server-side, and only HTML is being sent.\n\nIn an ideal/future state multiple modes will be supported, even up to a full\n'noscript' config.",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/TemplateConfig"
      }
    }
  },
  "required": [
    "domain",
    "version"
  ],
  "$defs": {
    "TopLevelLifecycle": {
      "type": "object",
      "properties": {
        "before_all": {
          "description": "run before every lifecycle operation",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "build": {
          "description": "configure build lifecycle hooks",
          "anyOf": [
            {
              "$ref": "#/$defs/LifecycleBeforeAfterScripts"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "LifecycleBeforeAfterScripts": {
      "type": "object",
      "properties": {
        "before": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "after": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    },
    "Redirects": {
      "type": "object",
      "properties": {
        "host": {
          "description": "host redirects",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/HostRedirect"
          }
        },
        "route": {
          "description": "route redirects",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/RouteRedirect"
          }
        }
      }
    },
    "HostRedirect": {
      "type": "object",
      "properties": {
        "from": {
          "description": "from host name",
          "type": "string"
        },
        "to": {
          "description": "to host name",
          "type": "string"
        },
        "method": {
          "description": "redirect method",
          "$ref": "#/$defs/RedirectMethod"
        }
      },
      "required": [
        "from",
        "to",
        "method"
      ]
    },
    "RedirectMethod": {
      "oneOf": [
        {
          "description": "307 <https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/307>",
          "type": "string",
          "const": "Temporary"
        },
        {
          "description": "308 <https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/308>",
          "type": "string",
          "const": "Permanent"
        }
      ]
    },
    "RouteRedirect": {
      "type": "object",
      "properties": {
        "condition": {
          "description": "[axum route](https://docs.rs/axum/latest/axum/struct.Router.html#method.route) pattern",
          "type": "string"
        },
        "rule": {
          "description": "translation regexes map to [`Regex::replace_all`](https://docs.rs/regex/latest/regex/#example-replacement-with-named-capture-groups)\nwhere `rule.0` is body of `Regex::new()` and `rule.1` is second param of `re.replace_all()`.",
          "type": "array",
          "prefixItems": [
            {
              "type": "string"
            },
            {
              "type": "string"
            }
          ],
          "minItems": 2,
          "maxItems": 2
        },
        "method": {
          "description": "redirect method",
          "$ref": "#/$defs/RedirectMethod"
        }
      },
      "required": [
        "condition",
        "rule",
        "method"
      ]
    },
    "ProxyConfig": {
      "description": "proxy configuration.\n\n**Note:** `path` should not be set at the same time as either `domain`\nor `port`. `path` takes precedence and the other sources will be ignored.\n\nif the `path`, `domain` and `port` are all unset, validation will fail.",
      "type": "object",
      "properties": {
        "path": {
          "description": "an `axum` [route](https://docs.rs/axum/latest/axum/routing/struct.Router.html#method.route)\nwith a `*path` wildcard that will be appended to the target.\n\ni.e. `\"/some/path/{*path}\"`\n\n**Note:** MUST end in a trailing `/{*path}`",
          "type": [
            "string",
            "null"
          ]
        },
        "domain": {
          "description": "custom domain with an ALIAS/CNAME pointing at the primary `OrdinaryConfig::domain`\nand a TXT record indicating ownership (i.e. `ordinary-proxy=your.config.domain`).\n\ni.e `example.com`\n\n**Note:** if a `path` is specified, the `domain` will be ignored",
          "type": [
            "string",
            "null"
          ]
        },
        "port": {
          "description": "preferred port that the proxy will listen on in a `--dedicated-ports`\nconfigured multi-tenant server OR a standalone app instance.\n\ni.e `8081`\n\n**Note:** if a `path` is specified, the `port` will be ignored,\nand `port` will not be tried without `domain` being present.",
          "type": [
            "integer",
            "null"
          ],
          "format": "uint16",
          "minimum": 0,
          "maximum": 65535
        },
        "target": {
          "description": "url for resource to proxy.\n\ni.e. `https://example.com`",
          "type": "string"
        }
      },
      "required": [
        "target"
      ]
    },
    "HttpCsp": {
      "type": "object",
      "properties": {
        "default_src": {
          "description": "defaults to `'self'` (`default-src ` does not need to be included)",
          "type": [
            "string",
            "null"
          ]
        },
        "script_src": {
          "description": "defaults to unset unless inline hashes are included,\nin which case the directive will start with `'self'` (`script-src ` does not need to be included).",
          "type": [
            "string",
            "null"
          ]
        },
        "style_src": {
          "description": "defaults to unset unless inline hashes are included,\nin which case the directive will start with `'self'` (`style-src ` does not need to be included).",
          "type": [
            "string",
            "null"
          ]
        },
        "font_src": {
          "description": "defaults to unset.\n\n(`font-src ` does not need to be included).",
          "type": [
            "string",
            "null"
          ]
        },
        "img_src": {
          "description": "defaults to unset.\n\n(`img-src ` does not need to be included).",
          "type": [
            "string",
            "null"
          ]
        },
        "frame_src": {
          "description": "defaults to unset.\n\n(`frame-src ` does not need to be included).",
          "type": [
            "string",
            "null"
          ]
        },
        "include_inline_hashes": {
          "description": "defaults to `true`.",
          "type": [
            "boolean",
            "null"
          ]
        }
      }
    },
    "HttpCors": {
      "type": "object",
      "properties": {
        "allow_credentials": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "allow_headers": {
          "anyOf": [
            {
              "$ref": "#/$defs/HttpCorsAllowHeaders"
            },
            {
              "type": "null"
            }
          ]
        },
        "max_age": {
          "description": "unit: Seconds",
          "type": [
            "integer",
            "null"
          ],
          "format": "uint32",
          "minimum": 0
        },
        "allow_methods": {
          "anyOf": [
            {
              "$ref": "#/$defs/HttpCorsAllowMethods"
            },
            {
              "type": "null"
            }
          ]
        },
        "allow_origin": {
          "anyOf": [
            {
              "$ref": "#/$defs/HttpCorsAllowOrigin"
            },
            {
              "type": "null"
            }
          ]
        },
        "expose_headers": {
          "anyOf": [
            {
              "$ref": "#/$defs/HttpCorsExposeHeaders"
            },
            {
              "type": "null"
            }
          ]
        },
        "allow_private_network": {
          "type": [
            "boolean",
            "null"
          ]
        }
      }
    },
    "HttpCorsAllowHeaders": {
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "Any"
          ]
        },
        {
          "description": "<https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers>",
          "type": "object",
          "properties": {
            "Headers": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "required": [
            "Headers"
          ],
          "additionalProperties": false
        }
      ]
    },
    "HttpCorsAllowMethods": {
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "Any"
          ]
        },
        {
          "description": "<https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Methods>",
          "type": "object",
          "properties": {
            "Methods": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "required": [
            "Methods"
          ],
          "additionalProperties": false
        }
      ]
    },
    "HttpCorsAllowOrigin": {
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "Any"
          ]
        },
        {
          "description": "<https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin>",
          "type": "object",
          "properties": {
            "Origins": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "required": [
            "Origins"
          ],
          "additionalProperties": false
        }
      ]
    },
    "HttpCorsExposeHeaders": {
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "Any"
          ]
        },
        {
          "description": "<https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Expose-Headers>",
          "type": "object",
          "properties": {
            "Headers": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "required": [
            "Headers"
          ],
          "additionalProperties": false
        }
      ]
    },
    "RuntimeMode": {
      "oneOf": [
        {
          "description": "Application will run on the shared multithreaded\ntokio runtime.",
          "type": "string",
          "const": "Shared"
        },
        {
          "description": "Application will run on a separate thread with its\nown single-threaded tokio runtime.",
          "type": "string",
          "const": "SingleThreaded"
        },
        {
          "description": "Application will run on a separate thread with its\nown multithreaded tokio runtime.",
          "type": "string",
          "const": "MultiThreaded"
        }
      ]
    },
    "LoggingConfig": {
      "type": "object",
      "properties": {
        "client": {
          "anyOf": [
            {
              "$ref": "#/$defs/ClientLoggingConfig"
            },
            {
              "type": "null"
            }
          ]
        },
        "server": {
          "anyOf": [
            {
              "$ref": "#/$defs/ServerLoggingConfig"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "ClientLoggingConfig": {
      "type": "object",
      "properties": {
        "min_delay": {
          "description": "bottom end of the delayed delivery range (seconds)",
          "type": [
            "integer",
            "null"
          ],
          "format": "uint32",
          "minimum": 0
        },
        "max_delay": {
          "description": "top end of delayed delivery range (seconds)",
          "type": [
            "integer",
            "null"
          ],
          "format": "uint32",
          "minimum": 0
        },
        "max_buffer": {
          "description": "max number of events to be buffered on the client\nprior to flush.",
          "type": [
            "integer",
            "null"
          ],
          "format": "uint16",
          "minimum": 0,
          "maximum": 65535
        },
        "max_batch": {
          "description": "sets the max number of events in a given request.",
          "type": [
            "integer",
            "null"
          ],
          "format": "uint16",
          "minimum": 0,
          "maximum": 65535
        }
      }
    },
    "ServerLoggingConfig": {
      "type": "object",
      "properties": {
        "ips": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "headers": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "credentials": {
          "anyOf": [
            {
              "$ref": "#/$defs/RedactedHashAlg"
            },
            {
              "type": "null"
            }
          ]
        },
        "timing": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "sizes": {
          "type": [
            "boolean",
            "null"
          ]
        }
      }
    },
    "RedactedHashAlg": {
      "type": "string",
      "enum": [
        "Blake2",
        "Blake3"
      ]
    },
    "ErrorConfig": {
      "type": "object",
      "properties": {
        "template": {
          "description": "Refers to the error template by name.\n\nNote: if set, will override the `asset` field",
          "type": [
            "string",
            "null"
          ]
        },
        "asset": {
          "description": "Refers to the asset by path.\n\nNote: if `template` is set it will override this field",
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "AuthConfig": {
      "description": "Auth configuration.",
      "type": "object",
      "properties": {
        "password": {
          "description": "Configuration for passwords.",
          "$ref": "#/$defs/PasswordConfig"
        },
        "mfa": {
          "description": "MFA configuration for auth.",
          "$ref": "#/$defs/MfaConfig"
        },
        "refresh_token": {
          "description": "Configuration for refresh tokens.",
          "$ref": "#/$defs/RefreshTokenConfig"
        },
        "access_token": {
          "description": "Configuration for access tokens.",
          "$ref": "#/$defs/AccessTokenConfig"
        },
        "cookies_enabled": {
          "description": "Determines whether cookies should be used\nfor browser based template navigation, and form submissions\n\nNote: when set to `false`, `protected` templates, and actions triggered\nby form submission will fail. Form based registration and login will\nnecessarily be disabled, also.\n\n!! Important: when set to `true`, tokens retrieved for `js` and `noscript` flavors\n!! do not support client signatures, because http-only cookies cannot be signed by\n!! the client.",
          "type": "boolean"
        },
        "client_hash": {
          "description": "what algorithm is used to hash passwords and MFA codes",
          "$ref": "#/$defs/ClientPasswordHash"
        },
        "invite": {
          "description": "invite config",
          "anyOf": [
            {
              "$ref": "#/$defs/InviteConfig"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "password",
        "mfa",
        "refresh_token",
        "access_token",
        "cookies_enabled",
        "client_hash"
      ]
    },
    "PasswordConfig": {
      "description": "Configuration for passwords.",
      "type": "object",
      "properties": {
        "protocol": {
          "$ref": "#/$defs/PasswordProtocol"
        }
      },
      "required": [
        "protocol"
      ]
    },
    "PasswordProtocol": {
      "description": "Configuration for password protocol.",
      "oneOf": [
        {
          "description": "When WASM is enabled, this will run the client portions\nbrowser-side. When JavaScript-only, passwords will be hashed\nand then sent to the server where the client portion will\nbe done on behalf of the user. In noscript mode, the password\nis sent only protected by TLS, hashed and then the client operations\nare done server side.\n\nIf a user later decides to enable JavaScript or WASM, they'll be\nable to opt in to the no-plain-password-sent modes without interruption.",
          "type": "string",
          "const": "Opaque"
        }
      ]
    },
    "MfaConfig": {
      "type": "object",
      "properties": {
        "totp": {
          "$ref": "#/$defs/TotpConfig"
        }
      },
      "required": [
        "totp"
      ]
    },
    "TotpConfig": {
      "type": "object",
      "properties": {
        "template": {
          "description": "Used for response after registration form is submitted.\nWill just return a QR code SVG if not set.",
          "type": [
            "string",
            "null"
          ]
        },
        "algorithm": {
          "$ref": "#/$defs/TotpAlgorithm"
        }
      },
      "required": [
        "algorithm"
      ]
    },
    "TotpAlgorithm": {
      "oneOf": [
        {
          "description": "only allowing SHA1 for now\nbecause many of the major MFA authenticator\napps don't support SHA256 or SHA512, and fail silently.",
          "type": "string",
          "const": "Sha1"
        }
      ]
    },
    "RefreshTokenConfig": {
      "description": "Configuration for refresh tokens.",
      "type": "object",
      "properties": {
        "algorithm": {
          "description": "Algorithm used for verifying the token.",
          "$ref": "#/$defs/TokenAlgorithm"
        },
        "lifetime": {
          "description": "How long a token should be valid for (seconds).",
          "type": "integer",
          "format": "uint32",
          "minimum": 0
        },
        "rotation": {
          "description": "how frequently the key should be rotated",
          "type": "integer",
          "format": "uint32",
          "minimum": 0
        }
      },
      "required": [
        "algorithm",
        "lifetime",
        "rotation"
      ]
    },
    "TokenAlgorithm": {
      "type": "string",
      "enum": [
        "HmacBlake2b256"
      ]
    },
    "AccessTokenConfig": {
      "description": "Configuration for access tokens.",
      "type": "object",
      "properties": {
        "algorithm": {
          "description": "Algorithm used for verifying the token.",
          "$ref": "#/$defs/TokenAlgorithm"
        },
        "lifetime": {
          "description": "How long a token should be valid for (seconds).",
          "type": "integer",
          "format": "uint32",
          "minimum": 0
        },
        "rotation": {
          "description": "how frequently the key should be rotated",
          "type": "integer",
          "format": "uint32",
          "minimum": 0
        },
        "claims": {
          "description": "Token claims structuring.\n\nNote: `idx` starts at 1 to create space for system claims (id, domain, and account).",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Field"
          }
        }
      },
      "required": [
        "algorithm",
        "lifetime",
        "rotation",
        "claims"
      ]
    },
    "Field": {
      "description": "Fields are used to describe properties on a model,\nIO for actions/integrations and content definitions.",
      "type": "object",
      "properties": {
        "idx": {
          "description": "The index used for compact, vector based serialization.\nThe index is preserved even if the property name changes.\nEach field must be assigned an index value from 0-255, with\nno gaps (i.e. cannot go from 2 to 4 without also having a field\nwith an index of 3).",
          "type": "integer",
          "format": "uint8",
          "minimum": 0,
          "maximum": 255
        },
        "name": {
          "description": "this is the name that is used when accessing a property in a template\nand will be the name that is used in the JSON serialized format.",
          "type": "string"
        },
        "kind": {
          "description": "the \"kind\" represents the type of the value that will\nbe stored or sent.",
          "$ref": "#/$defs/Kind"
        },
        "indexed": {
          "description": "Used for models and content definitions. Determines whether\nyou can access an object/item by this property. All items\nhave are automatically stored ID that can be used for look\nup if no properties are indexed.\n\nNote: `indexed` fields also have a uniqueness constraint.\n\n!! Important: only `String`, `Uuid` and `Url` kinds can be indexed",
          "type": [
            "boolean",
            "null"
          ]
        },
        "queryable": {
          "description": "Specifies whether field can be queried via Gte/Gt, Lte/Lt, Eq and `BeginsWith`.\n\n!! Important: only `Bool`, `String`, `Url`, `Uuid`, `Timestamp`, `U8/16/32/64`, `I8/16/32/64`,\n!! and `F32/64` kinds can be made queryable.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "searchable": {
          "description": "Specifies whether the field can be searched by any value of the same kind.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "mapping": {
          "description": "Used for integrations, so that a property on the external\nresource's response can be renamed.",
          "type": [
            "string",
            "null"
          ]
        },
        "doc": {
          "description": "Optional message to hint to the user\nin an editor.",
          "type": [
            "string",
            "null"
          ]
        },
        "compressed": {
          "description": "Compresses the value of the field using the Zstd compression algorithm (level 4).\n\nNote: at some point in the future, compression levels and compression algorithm\nselection will be configurable.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "encrypted": {
          "description": "Encrypts the field using `XChaCha20Poly1305`.\n\nNote: The storage encryption key is stored on the same\nserver as the data it's encrypting; anyone with full access\nto the server. This is mostly useful for protecting\nsensitive data in backups (assuming the key isn't stored with the\nbackup), and can potentially limit exposure in partial-access context\nstemming from a misconfiguration or a mistake in a multi-tenant scenario\n(i.e. for whatever reason tenant A's database contents is moved to tenant B's\ndirectory, without the keys also being shifted over).\n\n!! Important: this is not currently intended for storing *any* meaningfully\n!! sensitive data (e.g. SSNs, credit card numbers, passwords, encryption keys, etc.)\n!! use (or don't) at your own risk.",
          "type": [
            "boolean",
            "null"
          ]
        }
      },
      "required": [
        "idx",
        "name",
        "kind"
      ]
    },
    "Kind": {
      "description": "Defines the types recognized by this framework.",
      "oneOf": [
        {
          "description": "In the case of one-to-many the deletion of the\nparent reference causes a cascading delete (i.e if you have a user, chat, message\nrelationship structure, deletion of the user or the chat automatically\ndeletes messages owned by either).\n\nReferences must always be bidirectionally defined.",
          "type": "object",
          "properties": {
            "Ref": {
              "type": "object",
              "properties": {
                "model": {
                  "description": "name of model you're referencing.",
                  "type": "string"
                },
                "field": {
                  "description": "name of the field on the model.",
                  "type": "string"
                },
                "many": {
                  "description": "whether you have many of the referenced model.",
                  "type": [
                    "boolean",
                    "null"
                  ]
                }
              },
              "required": [
                "model",
                "field"
              ]
            }
          },
          "required": [
            "Ref"
          ],
          "additionalProperties": false
        },
        {
          "description": "null/void/undefined/None",
          "type": "string",
          "const": "Void"
        },
        {
          "description": "boolean/true/false",
          "type": "string",
          "const": "Bool"
        },
        {
          "description": "integers between",
          "type": "string",
          "const": "I8"
        },
        {
          "description": "integers between",
          "type": "string",
          "const": "U8"
        },
        {
          "description": "integers between",
          "type": "string",
          "const": "I16"
        },
        {
          "description": "integers between",
          "type": "string",
          "const": "U16"
        },
        {
          "description": "integers between",
          "type": "string",
          "const": "I32"
        },
        {
          "description": "integers between",
          "type": "string",
          "const": "U32"
        },
        {
          "description": "integers between",
          "type": "string",
          "const": "I64"
        },
        {
          "description": "integers between",
          "type": "string",
          "const": "U64"
        },
        {
          "description": "floats between",
          "type": "string",
          "const": "F32"
        },
        {
          "description": "floats between",
          "type": "string",
          "const": "F64"
        },
        {
          "description": "universal unique identifiers. 16 bytes\nor 36 characters.",
          "type": "string",
          "const": "Uuid"
        },
        {
          "description": "must be a valid URL",
          "type": "string",
          "const": "Url"
        },
        {
          "description": "unix timestamp",
          "type": "object",
          "properties": {
            "Timestamp": {
              "type": "object",
              "properties": {
                "unit": {
                  "$ref": "#/$defs/TimeUnit"
                }
              },
              "required": [
                "unit"
              ]
            }
          },
          "required": [
            "Timestamp"
          ],
          "additionalProperties": false
        },
        {
          "description": "array of bytes.",
          "type": "string",
          "const": "Blob"
        },
        {
          "description": "text/string/characters.",
          "type": "string",
          "const": "String"
        },
        {
          "description": "JSON formatted string.",
          "type": "string",
          "const": "Json"
        },
        {
          "description": "Markdown formatted string",
          "type": "string",
          "const": "Markdown"
        },
        {
          "description": "array of values.",
          "type": "object",
          "properties": {
            "List": {
              "type": "object",
              "properties": {
                "kind": {
                  "description": "the type for the values stored in the list.",
                  "$ref": "#/$defs/Kind"
                }
              },
              "required": [
                "kind"
              ]
            }
          },
          "required": [
            "List"
          ],
          "additionalProperties": false
        },
        {
          "description": "Select from a list of options. Stored as its u8 index value.",
          "type": "object",
          "properties": {
            "Enum": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "opts": {
                  "type": "array",
                  "items": {
                    "$ref": "#/$defs/EnumOpt"
                  }
                }
              },
              "required": [
                "name",
                "opts"
              ]
            }
          },
          "required": [
            "Enum"
          ],
          "additionalProperties": false
        },
        {
          "description": "complex kind with its own name and subfields.",
          "type": "object",
          "properties": {
            "Object": {
              "type": "object",
              "properties": {
                "name": {
                  "description": "the object definition's name.",
                  "type": "string"
                },
                "fields": {
                  "description": "nested subfields.",
                  "type": "array",
                  "items": {
                    "$ref": "#/$defs/Field"
                  }
                }
              },
              "required": [
                "name",
                "fields"
              ]
            }
          },
          "required": [
            "Object"
          ],
          "additionalProperties": false
        }
      ]
    },
    "TimeUnit": {
      "type": "string",
      "enum": [
        "Seconds"
      ]
    },
    "EnumOpt": {
      "type": "object",
      "properties": {
        "idx": {
          "type": "integer",
          "format": "uint8",
          "minimum": 0,
          "maximum": 255
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "idx",
        "name"
      ]
    },
    "ClientPasswordHash": {
      "description": "Configuration for client password hashing.\n\nWhen JavaScript or WASM modes are enabled, passwords are\nhashed with the application name, and account, before transit\n(or in the case of WASM prior to the Opaque client operations\nif Opaque is selected for the `PasswordProtocol`).",
      "oneOf": [
        {
          "description": "Limited by what browsers can support, SHA-256 is\na good option for a client-side hash to enable\nslightly better password protection when in\njavascript-only mode, without the WASM for Opaque.",
          "type": "string",
          "const": "Sha256"
        }
      ]
    },
    "InviteConfig": {
      "type": "object",
      "properties": {
        "mode": {
          "$ref": "#/$defs/InviteMode"
        },
        "lifetime": {
          "description": "How long a token is valid for.\n\nDefaults to 7 days.",
          "type": "integer",
          "format": "uint32",
          "minimum": 0
        },
        "clean_interval": {
          "description": "On what interval to clean up expired token ids.\n\nDefaults to 30 - 90 seconds.",
          "type": "array",
          "prefixItems": [
            {
              "type": "integer",
              "format": "uint32",
              "minimum": 0
            },
            {
              "type": "integer",
              "format": "uint32",
              "minimum": 0
            }
          ],
          "minItems": 2,
          "maxItems": 2
        },
        "claims": {
          "description": "Values that can be used internally in the API server to\nset default permissions for new accounts.\n\nTODO: in the future, these can also be set in order to pre-validate\nTODO: or constrain `app` account registrations. This will require the\nTODO: use of an `InviteCreate` action trigger (for validating and setting\nTODO: the invite token claims), and a pre-registration `InviteValidate`,\nTODO: as well as passing the invite token claims to the `Registration` trigger\nTODO: (allowing for the validated invite claims to be used in the account\nTODO: claims setting operation).\n\nNote: `idx` starts at 1 to create space for system claims (id, domain, and account).",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/Field"
          }
        }
      },
      "required": [
        "mode",
        "lifetime",
        "clean_interval"
      ]
    },
    "InviteMode": {
      "oneOf": [
        {
          "description": "only the root user can invite",
          "type": "string",
          "const": "Root"
        },
        {
          "description": "only a site admin can invite",
          "type": "string",
          "const": "Admin"
        },
        {
          "description": "anyone who has been invited can invite anyone else",
          "type": "string",
          "const": "Viral"
        }
      ]
    },
    "Global": {
      "description": "Global constant definitions, for use in [`ordinary_template::Template`]s.",
      "type": "object",
      "properties": {
        "name": {
          "description": "Name of the global constant.",
          "type": "string"
        },
        "kind": {
          "description": "Type definition for the global variable.",
          "$ref": "#/$defs/Kind"
        },
        "value": {
          "description": "JSON value of the global constant."
        }
      },
      "required": [
        "name",
        "kind",
        "value"
      ]
    },
    "Secret": {
      "description": "Mechanism for exposing secrets to `Integration`s.",
      "type": "object",
      "properties": {
        "name": {
          "description": "Name of the secret.",
          "type": "string"
        },
        "source": {
          "description": "Where to retrieve the secret from.",
          "$ref": "#/$defs/SecretSource"
        },
        "visibility": {
          "description": "Where the secret is to be used.",
          "$ref": "#/$defs/SecretVisibility"
        }
      },
      "required": [
        "name",
        "source",
        "visibility"
      ]
    },
    "SecretSource": {
      "description": "Where Ordinary will look for the secret.",
      "oneOf": [
        {
          "description": "Name of the host provided environment variable/secret.\n\n`Env` secrets are available to every tenant for a given\nAPI server (when running in \"multi\" mode).\n\nThis is useful in scenarios where a provider running the API\nserver would like to expose convenient integrations with 3rd parties, for\nwhich it only wants to maintain a single set of credentials.\n\n`Env` secrets are also useful when you're running a standalone\napplication and do not need a more complicated secrets management\nparadigm.",
          "type": "string",
          "const": "Env"
        },
        {
          "description": "Name of a stored secret.\n\n`Stored` secrets are application scoped, and can be set\nthrough an API server on which the application runs.\n\n`Stored` secrets live in their own database and are only\naccessible to components with permissions.",
          "type": "string",
          "const": "Stored"
        }
      ]
    },
    "SecretVisibility": {
      "description": "Where the secret is accessible from.",
      "oneOf": [
        {
          "description": "`Integrations` level visibility runs the risk of unintentionally\nsending a secret to the incorrect endpoint, but does not expose\nsecrets to any user defined modules.",
          "type": "string",
          "const": "Integrations"
        }
      ]
    },
    "Flag": {
      "description": "Feature flag definition.\n\nNote: Flags use cookies for non-logged in users,\nand use fields set on their token after they're logged in\nso that users have the ability to configure their preference\nif they have one.",
      "type": "object",
      "properties": {
        "idx": {
          "description": "Unique index for the feature flag.",
          "type": "integer",
          "format": "uint8",
          "minimum": 0,
          "maximum": 255
        },
        "name": {
          "description": "Name of the feature flag.",
          "type": "string"
        },
        "options": {
          "description": "Options for this flag. Percentage must\ntotal 100.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/FlagOption"
          }
        }
      },
      "required": [
        "idx",
        "name",
        "options"
      ]
    },
    "FlagOption": {
      "description": "Option for the feature flag.",
      "type": "object",
      "properties": {
        "idx": {
          "description": "Unique index for this flag option.",
          "type": "integer",
          "format": "uint8",
          "minimum": 0,
          "maximum": 255
        },
        "name": {
          "description": "Name of this feature flag option.",
          "type": "string"
        },
        "percentage": {
          "description": "Percentage of users that will have this\nflag turned on.",
          "type": "integer",
          "format": "uint8",
          "minimum": 0,
          "maximum": 255
        }
      },
      "required": [
        "idx",
        "name",
        "percentage"
      ]
    },
    "Content": {
      "description": "Content is used for static values that should be updated\nindependent of document structure, stylings or behavior.\n\nContent is stored in a denormalized format for indexed fields\nto optimize for maximum read efficiency.",
      "type": "object",
      "properties": {
        "file_path": {
          "description": "Specifies the path to the JSON file which contains\nthe content objects.",
          "type": "string"
        },
        "definitions": {
          "description": "Definitions/structure of the content objects in the\n`content.json`.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ContentDefinition"
          }
        },
        "update": {
          "anyOf": [
            {
              "$ref": "#/$defs/ContentUpdateConfig"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "file_path",
        "definitions"
      ]
    },
    "ContentDefinition": {
      "type": "object",
      "properties": {
        "idx": {
          "description": "Unique index for the content definition.",
          "type": "integer",
          "format": "uint8",
          "minimum": 0,
          "maximum": 255
        },
        "name": {
          "description": "Name of the content definition.",
          "type": "string"
        },
        "fields": {
          "description": "Fields for the content definition.\n\nNote: only fields with the `String` and `Uuid` kinds can\nbe indexed (for now).",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Field"
          }
        },
        "lifecycle": {
          "description": "configure scripts for responding to object lifecycle events.",
          "anyOf": [
            {
              "$ref": "#/$defs/ContentObjectLifecycle"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "idx",
        "name",
        "fields"
      ]
    },
    "ContentObjectLifecycle": {
      "type": "object",
      "properties": {
        "before_all": {
          "description": "run script before all commands in the set",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "on_add": {
          "description": "hook for running scripts before/after an object\nis added via CLI or studio.\n\n`after` receives the stringified JSON object as the\nfirst stdarg.",
          "anyOf": [
            {
              "$ref": "#/$defs/LifecycleBeforeAfterScripts"
            },
            {
              "type": "null"
            }
          ]
        },
        "on_edit": {
          "description": "hook for running scripts before/after an object\nis edited via CLI or studio.\n\n`after` receives the stringified JSON object as the\nfirst stdarg.",
          "anyOf": [
            {
              "$ref": "#/$defs/LifecycleBeforeAfterScripts"
            },
            {
              "type": "null"
            }
          ]
        },
        "on_delete": {
          "description": "hook for running scripts before/after an object\nis deleted via CLI or studio.\n\n`after` receives the stringified JSON object as the\nfirst stdarg.",
          "anyOf": [
            {
              "$ref": "#/$defs/LifecycleBeforeAfterScripts"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "ContentUpdateConfig": {
      "type": "object",
      "properties": {
        "lifecycle": {
          "anyOf": [
            {
              "$ref": "#/$defs/LifecycleBeforeAfterScripts"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "ModelConfig": {
      "description": "Defines a model in the Ordinary Database.",
      "type": "object",
      "properties": {
        "idx": {
          "description": "Index of the model. Used for its kind\nfor storage keys. There can be no gaps in\nindex values.\n\nNote: the first (0) index is always skipped as it\nis reserved for the item UUID.",
          "type": "integer",
          "format": "uint8",
          "minimum": 0,
          "maximum": 255
        },
        "name": {
          "description": "Name of the model.",
          "type": "string"
        },
        "fields": {
          "description": "Fields on the model.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Field"
          }
        },
        "uuid": {
          "description": "Every model is generated with a UUID key. If this value\nis blank, it will default to V4. If you'd like records to\nbe ordered by time, V7 is recommended.",
          "anyOf": [
            {
              "$ref": "#/$defs/UuidVersion"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "idx",
        "name",
        "fields"
      ]
    },
    "UuidVersion": {
      "type": "string",
      "enum": [
        "V4",
        "V7"
      ]
    },
    "IntegrationConfig": {
      "description": "The mechanism for reverse proxying and calling\nout to external APIs.",
      "type": "object",
      "properties": {
        "idx": {
          "description": "Unique index for integration",
          "type": "integer",
          "format": "uint8",
          "minimum": 0,
          "maximum": 255
        },
        "name": {
          "description": "Name of the integration.",
          "type": "string"
        },
        "protocol": {
          "description": "Protocol used for communicating with the external service.",
          "$ref": "#/$defs/IntegrationProtocol"
        },
        "endpoint": {
          "description": "Endpoint that the external service lives at.",
          "type": "string"
        },
        "send": {
          "description": "Definition for the parameters of the receiving service.\n\n(Automatically translated to the service's protocol/encoding format).",
          "$ref": "#/$defs/Kind"
        },
        "recv": {
          "description": "Definition for the returned value of the external service.\n\n(Automatically translated from the service's protocol/encoding format).",
          "$ref": "#/$defs/Kind"
        },
        "secrets": {
          "description": "Names of secrets to include",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "timeout": {
          "description": "Max duration for the template.\n\nUnit: seconds",
          "type": [
            "integer",
            "null"
          ],
          "format": "uint16",
          "minimum": 0,
          "maximum": 65535
        }
      },
      "required": [
        "idx",
        "name",
        "protocol",
        "endpoint",
        "send",
        "recv"
      ]
    },
    "IntegrationProtocol": {
      "description": "The protocol for the integration.",
      "oneOf": [
        {
          "description": "For integrating an external HTTP API.",
          "type": "object",
          "properties": {
            "Http": {
              "type": "object",
              "properties": {
                "method": {
                  "description": "HTTP method.",
                  "type": "string"
                },
                "headers": {
                  "description": "static http headers",
                  "type": "array",
                  "items": {
                    "type": "array",
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "minItems": 2,
                    "maxItems": 2
                  }
                },
                "send_encoding": {
                  "description": "how to encode the value passed from the action",
                  "$ref": "#/$defs/IntegrationProtocolHttpEncoding"
                },
                "recv_encoding": {
                  "description": "how to decode the value passed back to the action",
                  "$ref": "#/$defs/IntegrationProtocolHttpEncoding"
                }
              },
              "required": [
                "method",
                "headers",
                "send_encoding",
                "recv_encoding"
              ]
            }
          },
          "required": [
            "Http"
          ],
          "additionalProperties": false
        }
      ]
    },
    "IntegrationProtocolHttpEncoding": {
      "type": "string",
      "enum": [
        "Json",
        "Text",
        "None"
      ]
    },
    "ActionConfig": {
      "description": "Configuration parameters for Ordinary Actions.",
      "type": "object",
      "properties": {
        "ffi": {
          "description": "Foreign function interface config",
          "$ref": "#/$defs/ActionFfi"
        },
        "idx": {
          "description": "Unique index value for action.",
          "type": "integer",
          "format": "uint8",
          "minimum": 0,
          "maximum": 255
        },
        "name": {
          "description": "Action name. Must be unique.",
          "type": "string"
        },
        "lang": {
          "description": "The source language the action is written in.",
          "$ref": "#/$defs/ActionLang"
        },
        "dir_path": {
          "description": "Relative path to the source directory for the action.",
          "type": [
            "string",
            "null"
          ]
        },
        "protected": {
          "description": "What to check the token fields against. If blank\naction is public.",
          "anyOf": [
            {
              "$ref": "#/$defs/Check"
            },
            {
              "type": "null"
            }
          ]
        },
        "transactional": {
          "description": "whether the storage interactions\nare executed under a single transaction.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "access": {
          "description": "Which Ordinary Application resources the action has access to.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ActionAccessPermission"
          }
        },
        "accepts": {
          "description": "Input definition for the action.",
          "$ref": "#/$defs/Kind"
        },
        "returns": {
          "description": "Output definition for the action.",
          "$ref": "#/$defs/Kind"
        },
        "triggered_by": {
          "description": "How this action is called (i.e. side effect from DB/Auth,\nhttp API call, browser form submission, etc.)",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ActionTrigger"
          }
        },
        "timeout": {
          "description": "Max duration for the action.\n\nUnit: seconds",
          "type": [
            "integer",
            "null"
          ],
          "format": "uint16",
          "minimum": 0,
          "maximum": 65535
        },
        "cors": {
          "anyOf": [
            {
              "$ref": "#/$defs/HttpCors"
            },
            {
              "type": "null"
            }
          ]
        },
        "wasm_opt": {
          "anyOf": [
            {
              "$ref": "#/$defs/WasmOpt"
            },
            {
              "type": "null"
            }
          ]
        },
        "privileged": {
          "description": "Whether the action should have bindings for API server interaction.\n\nCan only be set on applications which have been explicitly\nallow-listed by the API server administrator via their domain.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "variables": {
          "description": "List of build time environment variables.\n\nformat in template: `{{ YOUR_VAR }}`",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "ffi",
        "idx",
        "name",
        "lang",
        "access",
        "accepts",
        "returns",
        "triggered_by"
      ]
    },
    "ActionFfi": {
      "type": "object",
      "properties": {
        "version": {
          "$ref": "#/$defs/ActionFfiVersion"
        },
        "serialization": {
          "$ref": "#/$defs/ActionFfiSerialization"
        }
      },
      "required": [
        "version",
        "serialization"
      ]
    },
    "ActionFfiVersion": {
      "type": "string",
      "enum": [
        "V1"
      ]
    },
    "ActionFfiSerialization": {
      "description": "Input/output serialization for module and host functions.",
      "type": "string",
      "enum": [
        "FlexBufferVector"
      ]
    },
    "ActionLang": {
      "description": "The language in which the action is written.\n\nMany more languages will be supported in the future.",
      "oneOf": [
        {
          "description": "Action is written in the Rust programming language.\n\nUses zero-copy `FlexBuffer` vectors for serialization format.",
          "type": "string",
          "const": "Rust"
        },
        {
          "description": "Action is written in JavaScript.\n\n`QuickJS` runtime embedded in a Rust WASM which itself uses\n`FlexBuffer` vectors for FFI serialization, but then translates\nto JSON when communicating across the `QuickJS` runtime barrier.",
          "type": "string",
          "const": "JavaScript"
        }
      ]
    },
    "Check": {
      "type": "object"
    },
    "ActionAccessPermission": {
      "description": "Defines access permissions that an Ordinary\nAction can configure.",
      "oneOf": [
        {
          "description": "Provides the action access to a given model.",
          "type": "object",
          "properties": {
            "Model": {
              "type": "object",
              "properties": {
                "name": {
                  "description": "Name of the model.",
                  "type": "string"
                },
                "ops": {
                  "description": "List of allowed operations that the action\ncan take on the model.",
                  "type": "array",
                  "items": {
                    "$ref": "#/$defs/ActionAccessModelOps"
                  }
                }
              },
              "required": [
                "name",
                "ops"
              ]
            }
          },
          "required": [
            "Model"
          ],
          "additionalProperties": false
        },
        {
          "description": "Provides the action access to a given content def.",
          "type": "object",
          "properties": {
            "Content": {
              "type": "object",
              "properties": {
                "name": {
                  "description": "Content definition name.",
                  "type": "string"
                }
              },
              "required": [
                "name"
              ]
            }
          },
          "required": [
            "Content"
          ],
          "additionalProperties": false
        },
        {
          "description": "Provides the action access to a given integration.",
          "type": "object",
          "properties": {
            "Integration": {
              "type": "object",
              "properties": {
                "name": {
                  "description": "Name of the integration the action can access.",
                  "type": "string"
                }
              },
              "required": [
                "name"
              ]
            }
          },
          "required": [
            "Integration"
          ],
          "additionalProperties": false
        },
        {
          "description": "Provides the action access to another action.",
          "type": "object",
          "properties": {
            "Action": {
              "type": "object",
              "properties": {
                "name": {
                  "description": "Name of the other action.",
                  "type": "string"
                }
              },
              "required": [
                "name"
              ]
            }
          },
          "required": [
            "Action"
          ],
          "additionalProperties": false
        },
        {
          "description": "Provides the action access to Ordinary Auth.",
          "type": "object",
          "properties": {
            "Auth": {
              "type": "object",
              "properties": {
                "ops": {
                  "description": "Which operations the action is allowed to take.",
                  "type": "array",
                  "items": {
                    "$ref": "#/$defs/ActionAccessAuthOps"
                  }
                }
              },
              "required": [
                "ops"
              ]
            }
          },
          "required": [
            "Auth"
          ],
          "additionalProperties": false
        }
      ]
    },
    "ActionAccessModelOps": {
      "description": "Model operations that an action is allowed to make.",
      "oneOf": [
        {
          "description": "Can create an item for this model.",
          "type": "string",
          "const": "Insert"
        },
        {
          "description": "Can get an item for this model by UUID or Index.",
          "type": "string",
          "const": "Get"
        },
        {
          "description": "Can query an item for this model by queryable field.",
          "type": "string",
          "const": "Query"
        },
        {
          "description": "Can search an item for this model by searchable field.",
          "type": "string",
          "const": "Search"
        },
        {
          "description": "Can update an item for this model.",
          "type": "string",
          "const": "Update"
        },
        {
          "description": "Can delete an item for this model.",
          "type": "string",
          "const": "Delete"
        }
      ]
    },
    "ActionAccessAuthOps": {
      "description": "Auth operations that an action can make.",
      "oneOf": [
        {
          "description": "Allows the action the ability to set\na user's access token fields/claims.",
          "type": "string",
          "const": "SetTokenFields"
        }
      ]
    },
    "ActionTrigger": {
      "description": "Action trigger options.",
      "oneOf": [
        {
          "description": "HTTP request with the Ordinary data format",
          "type": "string",
          "const": "Ordinary"
        },
        {
          "description": "JSON formatted API call",
          "type": "object",
          "properties": {
            "Json": {
              "type": "object",
              "properties": {
                "route": {
                  "description": "API rout",
                  "type": "string"
                },
                "method": {
                  "description": "HTTP method",
                  "$ref": "#/$defs/HttpMethod"
                }
              },
              "required": [
                "route",
                "method"
              ]
            }
          },
          "required": [
            "Json"
          ],
          "additionalProperties": false
        },
        {
          "description": "Web Form Submission",
          "type": "object",
          "properties": {
            "Form": {
              "type": "object",
              "properties": {
                "route": {
                  "description": "endpoint the form should point at",
                  "type": "string"
                },
                "method": {
                  "description": "method for the form to use",
                  "$ref": "#/$defs/HttpMethod"
                },
                "redirect": {
                  "description": "redirect for after submission.\n\nnote: it is allowed to use return values in the route\nvia {return} or {`return.some_field_name`}",
                  "type": "string"
                }
              },
              "required": [
                "route",
                "method",
                "redirect"
              ]
            }
          },
          "required": [
            "Form"
          ],
          "additionalProperties": false
        },
        {
          "description": "Login event from Auth",
          "type": "string",
          "const": "Login"
        },
        {
          "description": "Registration event from Auth",
          "type": "string",
          "const": "Registration"
        },
        {
          "description": "For when content updates",
          "type": "object",
          "properties": {
            "Content": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "name"
              ]
            }
          },
          "required": [
            "Content"
          ],
          "additionalProperties": false
        }
      ]
    },
    "HttpMethod": {
      "type": "string",
      "enum": [
        "PUT",
        "POST",
        "GET",
        "DELETE"
      ]
    },
    "WasmOpt": {
      "description": "Corresponds to <https://docs.rs/wasm-opt/latest/wasm_opt/struct.OptimizationOptions.html#impl-OptimizationOptions>.\n\nCertain levels may not work with `wasmtime`/`cranelift`.",
      "type": "string",
      "enum": [
        "Size",
        "SizeAggressive",
        "Level0",
        "Level1",
        "Level2",
        "Level3",
        "Level4"
      ]
    },
    "AssetsConfig": {
      "type": "object",
      "properties": {
        "dir_path": {
          "description": "Relative path to assets directory.",
          "type": [
            "string",
            "null"
          ]
        },
        "base_route": {
          "description": "Note: must start with a `/` and cannot end with a `/` unless\n`/` is the entire route.",
          "type": "string",
          "default": "/assets"
        },
        "append_index_html": {
          "description": "whether to add `index.html` to the base route\nand the end of routes having a trailing slash\nor missing an extension.\n\ni.e. `https://example.com/static`, `https://example.com/static/`,\n`https://example.com/static/{*path}/` and `https://example.com/static/{*path}`\n(with no extension) would return the contents of\n`/static/index.html` or `/static/{*path}/index.html`.\n\nprimarily useful when serving a generated static site.\n\nNote: cannot be used with `append_index_ext`",
          "type": [
            "boolean",
            "null"
          ]
        },
        "skip_base_route_index_html": {
          "description": "whether the `{base_route}` and `{base_route}/` routes should\nskip returning the `index.html` at the root of the static dir.\n\nuseful when the static dir `base_route` is set to `/` but you'd\nlike to have a template use the `/` route.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "append_html_ext": {
          "description": "whether to append `.html` to routes that do not\ninclude an extension.\n\ni.e. `https://example.com/static/about` would return the contents of\n`/static/about.html`.\n\nprimarily useful when serving a generated static site.\n\nNote: cannot be used with `append_index_html`",
          "type": [
            "boolean",
            "null"
          ]
        },
        "preserve_exif": {
          "description": "will not strip the exif data from images.\n\nImportant: only use if you want all metadata (including\nlocation data) on your photos.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "html_csp": {
          "description": "content security policy for HTML assets",
          "anyOf": [
            {
              "$ref": "#/$defs/HttpCsp"
            },
            {
              "type": "null"
            }
          ]
        },
        "http": {
          "description": "HTTP cache configuration.\n\nTODO: provide a way to pattern match files for which to apply\nTODO: specific cache controls.",
          "anyOf": [
            {
              "$ref": "#/$defs/HttpCache"
            },
            {
              "type": "null"
            }
          ]
        },
        "precompression": {
          "description": "Which encodings to use when precompressing assets.\n\nServing priority is dictated by specified order.",
          "anyOf": [
            {
              "$ref": "#/$defs/CompressionAlgorithms"
            },
            {
              "type": "null"
            }
          ]
        },
        "internal_precompression": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/CompressionAlgorithm"
          },
          "maxItems": 4,
          "writeOnly": true
        },
        "minify_css": {
          "description": "Determines whether CSS files should be minified,\nprior to write.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "minify_js": {
          "description": "Determines whether JS files should be minified,\nprior to write.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "minify_html": {
          "description": "Determines whether HTML files should be minified,\nprior to write.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "internal_cache_control_header_value": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "HttpCache": {
      "type": "object",
      "properties": {
        "cache_control": {
          "anyOf": [
            {
              "$ref": "#/$defs/HttpCacheControl"
            },
            {
              "type": "null"
            }
          ]
        },
        "expires": {
          "description": "Corresponds to the HTTP Expires header.\n<https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Expires>\n\nUnit: seconds.",
          "type": [
            "integer",
            "null"
          ],
          "format": "uint64",
          "minimum": 0
        },
        "etag": {
          "anyOf": [
            {
              "$ref": "#/$defs/HttpEtag"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "HttpCacheControl": {
      "description": "HTTP Cache-Control.\nSee: <https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cache-Control>",
      "type": "object",
      "properties": {
        "max_age": {
          "type": [
            "integer",
            "null"
          ],
          "format": "uint",
          "minimum": 0
        },
        "s_maxage": {
          "type": [
            "integer",
            "null"
          ],
          "format": "uint",
          "minimum": 0
        },
        "no_cache": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "no_store": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "no_transform": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "must_revalidate": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "proxy_revalidate": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "private": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "public": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "immutable": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "stale_while_revalidate": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "stale_if_error": {
          "type": [
            "boolean",
            "null"
          ]
        }
      }
    },
    "HttpEtag": {
      "description": "HTTP Cache-Control.\nSee: <https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cache-Control>",
      "type": "object",
      "properties": {
        "alg": {
          "anyOf": [
            {
              "$ref": "#/$defs/HttpEtagAlgorithm"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "HttpEtagAlgorithm": {
      "description": "Hashing algorithm options for generating etags.\n\n`AHash` is the default if none is selected.",
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "AHash",
            "Rustc",
            "Blake3"
          ]
        },
        {
          "type": "object",
          "properties": {
            "XXH3": {
              "$ref": "#/$defs/XXH3Variation"
            }
          },
          "required": [
            "XXH3"
          ],
          "additionalProperties": false
        }
      ]
    },
    "XXH3Variation": {
      "type": "string",
      "enum": [
        "Bit64",
        "Bit128"
      ]
    },
    "CompressionAlgorithms": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CompressionAlgorithm"
      }
    },
    "CompressionAlgorithm": {
      "description": "Compression algorithms",
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "All",
            "Gzip",
            "Brotli",
            "Deflate"
          ]
        },
        {
          "type": "object",
          "properties": {
            "Zstd": {
              "type": "object",
              "properties": {
                "level": {
                  "type": "integer",
                  "format": "uint8",
                  "minimum": 0,
                  "maximum": 255
                }
              },
              "required": [
                "level"
              ]
            }
          },
          "required": [
            "Zstd"
          ],
          "additionalProperties": false
        }
      ]
    },
    "FragmentsConfig": {
      "type": "object",
      "properties": {
        "dir_path": {
          "description": "Relative path to fragments directory.",
          "type": "string"
        }
      },
      "required": [
        "dir_path"
      ]
    },
    "TemplateConfig": {
      "description": "Template configuration for Ordinary Applications.",
      "type": "object",
      "properties": {
        "ffi": {
          "description": "Foreign function interface config",
          "$ref": "#/$defs/TemplateFfi"
        },
        "idx": {
          "description": "Unique index for template.",
          "type": "integer",
          "format": "uint8",
          "minimum": 0,
          "maximum": 255
        },
        "name": {
          "description": "Template's name.",
          "type": "string"
        },
        "mime": {
          "description": "Used as the `content-type` header for HTTP responses.\nValidated against file extension (if `path` is present).",
          "type": "string"
        },
        "minify": {
          "description": "Specifies whether the content in the file should\nbe \"minified\"/have whitespace removed.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "path": {
          "description": "Relative path to the template file",
          "type": [
            "string",
            "null"
          ]
        },
        "route": {
          "description": "The route used in the HTTP server to serve this template.\nCan use segments to bind to properties on models or content",
          "type": "string"
        },
        "protected": {
          "description": "What to check the token fields against. If left blank, route is considered public.",
          "anyOf": [
            {
              "$ref": "#/$defs/Check"
            },
            {
              "type": "null"
            }
          ]
        },
        "cache": {
          "description": "Used to specify the cache policy for this template.",
          "anyOf": [
            {
              "$ref": "#/$defs/TemplateCache"
            },
            {
              "type": "null"
            }
          ]
        },
        "csp": {
          "description": "HTTP Content Security Policy configuration.\n\n<https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP>\n\n\"Base\" defaults to `default-src 'self';` and tacks on SHA-256 integrity\nhashes for all inlined scripts and styles (generated at build time) to\n`script-src 'self' sha256-b64` and `style-src 'self' sha256-b64`, respectively.\n\n`https:` is used when not running in `--insecure` mode.",
          "anyOf": [
            {
              "$ref": "#/$defs/HttpCsp"
            },
            {
              "type": "null"
            }
          ]
        },
        "cors": {
          "anyOf": [
            {
              "$ref": "#/$defs/HttpCors"
            },
            {
              "type": "null"
            }
          ]
        },
        "timeout": {
          "description": "Max duration for the template.\n\nUnit: seconds",
          "type": [
            "integer",
            "null"
          ],
          "format": "uint16",
          "minimum": 0,
          "maximum": 65535
        },
        "fields": {
          "description": "Used for template-specific variables that don't need to be shared\nbeyond the scope of the given template, and don't warrant a content\nobject.",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/TemplateField"
          }
        },
        "globals": {
          "description": "List of global variables to be included with the compiled template\nbinary. Globals are excluded by default and have to be explicitly\nlisted in the globals to be accessed from the template.",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "flags": {
          "description": "List of flags to be referenced by the template.",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/TemplateFlagRef"
          }
        },
        "params": {
          "description": "List of params to be referenced by the template.",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/TemplateParamRef"
          }
        },
        "models": {
          "description": "List of models and what fields the template needs from the models.\nThis is effectively a query definition.",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/TemplateRef"
          }
        },
        "content": {
          "description": "List of content definitions and the content definition fields\nthat this template will use.",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/TemplateRef"
          }
        },
        "actions": {
          "description": "Specifies which actions this template triggers, and adds\nthis template's route pattern to the action's list of valid\norigins.",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "wasm_opt": {
          "anyOf": [
            {
              "$ref": "#/$defs/WasmOpt"
            },
            {
              "type": "null"
            }
          ]
        },
        "variables": {
          "description": "List of build time environment variables.\n\nformat in template: `{{ YOUR_VAR }}`",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "ffi",
        "idx",
        "name",
        "mime",
        "route"
      ]
    },
    "TemplateFfi": {
      "type": "object",
      "properties": {
        "version": {
          "$ref": "#/$defs/TemplateFfiVersion"
        },
        "serialization": {
          "$ref": "#/$defs/TemplateFfiSerialization"
        }
      },
      "required": [
        "version",
        "serialization"
      ]
    },
    "TemplateFfiVersion": {
      "type": "string",
      "enum": [
        "V1"
      ]
    },
    "TemplateFfiSerialization": {
      "description": "Input serialization format. Output is always an array of bytes.",
      "type": "string",
      "enum": [
        "FlexBufferVector"
      ]
    },
    "TemplateCache": {
      "type": "object",
      "properties": {
        "stored": {
          "anyOf": [
            {
              "$ref": "#/$defs/StoredCache"
            },
            {
              "type": "null"
            }
          ]
        },
        "http": {
          "anyOf": [
            {
              "$ref": "#/$defs/HttpCache"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "StoredCache": {
      "description": "Render caching policy.\n\nIMPORTANT: Very experimental, may not work as described. `policy: Permanent` is currently\nthe most likely to behave correctly.",
      "type": "object",
      "properties": {
        "policy": {
          "$ref": "#/$defs/StoredCachePolicy"
        },
        "compression": {
          "description": "Which compression formats should be stored",
          "anyOf": [
            {
              "$ref": "#/$defs/CompressionAlgorithms"
            },
            {
              "type": "null"
            }
          ]
        },
        "internal_compression": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/CompressionAlgorithm"
          },
          "maxItems": 4,
          "writeOnly": true
        },
        "max_ttl": {
          "description": "Upper limit on total time a cached item can be stored\n\nUnit: seconds",
          "type": [
            "integer",
            "null"
          ],
          "format": "uint64",
          "minimum": 0
        },
        "hit_ttl": {
          "description": "Compared with time since last hit.\n\nUnit: seconds",
          "type": [
            "integer",
            "null"
          ],
          "format": "uint64",
          "minimum": 0
        },
        "max_size": {
          "description": "Upper limit on the cumulative size of all cached responses\nfor a given template.\n\nUnit: bytes",
          "type": [
            "integer",
            "null"
          ],
          "format": "uint64",
          "minimum": 0
        },
        "max_count": {
          "description": "Upper limit on the number of cached responses stored at\na given time, for a given template.",
          "type": [
            "integer",
            "null"
          ],
          "format": "uint",
          "minimum": 0
        },
        "frequency_window": {
          "description": "How long an LFU \"hit\" tick is valid for\n\nUnit: seconds",
          "type": [
            "integer",
            "null"
          ],
          "format": "uint64",
          "minimum": 0
        },
        "clean_interval": {
          "description": "Rate at which the cache is cleaned based on other rules.\n\nOption<(min, max)>",
          "type": [
            "array",
            "null"
          ],
          "prefixItems": [
            {
              "type": "integer",
              "format": "uint64",
              "minimum": 0
            },
            {
              "type": "integer",
              "format": "uint64",
              "minimum": 0
            }
          ],
          "minItems": 2,
          "maxItems": 2
        },
        "evict_on_dependency_change": {
          "description": "Whether a cached item should also track the of models and content\nwhich it depends on, and evict when they are modified.",
          "type": [
            "boolean",
            "null"
          ]
        }
      },
      "required": [
        "policy"
      ]
    },
    "StoredCachePolicy": {
      "oneOf": [
        {
          "description": "No eviction on clean or write. Constrained only by overall storage limit or `max_size`\n(if set). Will only be evicted if dependencies change and `evict_on_dependency_change`\nis set.",
          "type": "string",
          "const": "Permanent"
        },
        {
          "description": "Prioritize the most Frequently accessed, Recently accessed and smallest Sized items\n\n(`frequency_equality_threshold` (hit count), `recency_equality_threshold` (seconds))",
          "type": "object",
          "properties": {
            "FRs": {
              "type": "array",
              "prefixItems": [
                {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0
                },
                {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0
                }
              ],
              "minItems": 2,
              "maxItems": 2
            }
          },
          "required": [
            "FRs"
          ],
          "additionalProperties": false
        }
      ]
    },
    "TemplateField": {
      "description": "Field used within the scope of a single template.",
      "type": "object",
      "properties": {
        "name": {
          "description": "Field name",
          "type": "string"
        },
        "kind": {
          "description": "Specifies the type of the value.",
          "$ref": "#/$defs/Kind"
        },
        "value": {
          "description": "JSON value for template field."
        }
      },
      "required": [
        "name",
        "kind",
        "value"
      ]
    },
    "TemplateFlagRef": {
      "description": "Server flags can only be used in templates whose cache is\nset to \"Never\".",
      "type": "object",
      "properties": {
        "idx": {
          "description": "Specifies the index position for the referenced\ndata. Index must be unique across flags, data models and\ncontent definitions.",
          "type": "integer",
          "format": "uint8",
          "minimum": 0,
          "maximum": 255
        },
        "name": {
          "description": "Name of the flag.",
          "type": "string"
        }
      },
      "required": [
        "idx",
        "name"
      ]
    },
    "TemplateParamRef": {
      "type": "object",
      "properties": {
        "idx": {
          "description": "Specifies the index position for the referenced\ndata. Index must be unique across flags, data models, params, and\ncontent definitions.",
          "type": "integer",
          "format": "uint8",
          "minimum": 0,
          "maximum": 255
        },
        "name": {
          "description": "Name of the param.",
          "type": "string"
        }
      },
      "required": [
        "idx",
        "name"
      ]
    },
    "TemplateRef": {
      "description": "How templates reference Content Definitions\nand Data Models, and the specific fields it\nwants to include.",
      "type": "object",
      "properties": {
        "idx": {
          "description": "Specifies the index position for the referenced\ndata. Index must be unique across flags, params, data models and\ncontent definitions.",
          "type": "integer",
          "format": "uint8",
          "minimum": 0,
          "maximum": 255
        },
        "name": {
          "description": "Name of the model or content definition.",
          "type": "string"
        },
        "fields": {
          "description": "Which fields to include.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/TemplateRefField"
          }
        },
        "all": {
          "description": "for requesting multiple top-level items\n\nnote: only supported for content. models use relationships.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "idx",
        "name",
        "fields"
      ]
    },
    "TemplateRefField": {
      "description": "Declaration for which fields from a content definition\nor data model to include.",
      "type": "object",
      "properties": {
        "idx": {
          "description": "Specifies index for reference field. Index\nmust be unique across fields for a given reference.",
          "type": "integer",
          "format": "uint8",
          "minimum": 0,
          "maximum": 255
        },
        "name": {
          "description": "Name of field to be included.",
          "type": "string"
        },
        "bind": {
          "description": "Option to bind this field's value to a route\nsegment, querystring parameter or token field.",
          "anyOf": [
            {
              "$ref": "#/$defs/TemplateRefFieldBind"
            },
            {
              "type": "null"
            }
          ]
        },
        "fields": {
          "description": "List of any nested subfields to include for this field.",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/TemplateRefField"
          }
        }
      },
      "required": [
        "idx",
        "name"
      ]
    },
    "TemplateRefFieldBind": {
      "description": "Binding options for template field refs.",
      "oneOf": [
        {
          "description": "Bind this property to a token field.",
          "type": "object",
          "properties": {
            "Token": {
              "type": "object",
              "properties": {
                "field": {
                  "description": "Name of the field that this property should bind to.\n(i.e \"account\" if you'd like to have an \"/account\" route\nthat interprets the request based on the logged-in user's\ntoken claims/fields).",
                  "type": "string"
                },
                "expression": {
                  "description": "Include if the parent field is queryable.",
                  "anyOf": [
                    {
                      "$ref": "#/$defs/QueryExpression"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "field"
              ]
            }
          },
          "required": [
            "Token"
          ],
          "additionalProperties": false
        },
        {
          "description": "Bind this property to a route segment (i.e /{something})",
          "type": "object",
          "properties": {
            "Segment": {
              "type": "object",
              "properties": {
                "name": {
                  "description": "Specifies the name of the route segment that this property is binding to.",
                  "type": "string"
                },
                "expression": {
                  "description": "Include if the parent field is queryable.",
                  "anyOf": [
                    {
                      "$ref": "#/$defs/QueryExpression"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "name"
              ]
            }
          },
          "required": [
            "Segment"
          ],
          "additionalProperties": false
        }
      ]
    },
    "QueryExpression": {
      "description": "Query expression to be used in template bindings.",
      "type": "string",
      "enum": [
        "Gte",
        "Gt",
        "Lte",
        "Lt",
        "Eq",
        "BeginsWith"
      ]
    }
  }
}