@kubohiroya/turbowarp-http-server 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/README.ja.md +32 -14
  2. package/README.md +104 -43
  3. package/assets/block-icon.svg +1 -0
  4. package/dist/cli.js +131 -17
  5. package/dist/cli.js.map +1 -1
  6. package/dist/compiler/adapters/cloudflare.d.ts +2 -0
  7. package/dist/compiler/adapters/cloudflare.js +477 -0
  8. package/dist/compiler/adapters/cloudflare.js.map +1 -0
  9. package/dist/compiler/adapters/firebase.d.ts +2 -0
  10. package/dist/compiler/adapters/firebase.js +489 -0
  11. package/dist/compiler/adapters/firebase.js.map +1 -0
  12. package/dist/compiler/adapters/index.d.ts +2 -0
  13. package/dist/compiler/adapters/index.js +3 -0
  14. package/dist/compiler/adapters/index.js.map +1 -0
  15. package/dist/compiler/binary/codec.d.ts +4 -0
  16. package/dist/compiler/binary/codec.js +45 -0
  17. package/dist/compiler/binary/codec.js.map +1 -0
  18. package/dist/compiler/binary/error.d.ts +3 -0
  19. package/dist/compiler/binary/error.js +21 -0
  20. package/dist/compiler/binary/error.js.map +1 -0
  21. package/dist/compiler/binary/index.d.ts +4 -0
  22. package/dist/compiler/binary/index.js +5 -0
  23. package/dist/compiler/binary/index.js.map +1 -0
  24. package/dist/compiler/binary/runtime.d.ts +18 -0
  25. package/dist/compiler/binary/runtime.js +123 -0
  26. package/dist/compiler/binary/runtime.js.map +1 -0
  27. package/dist/compiler/binary/types.d.ts +17 -0
  28. package/dist/compiler/binary/types.js +2 -0
  29. package/dist/compiler/binary/types.js.map +1 -0
  30. package/dist/compiler/feature-flags.d.ts +4 -0
  31. package/dist/compiler/feature-flags.js +4 -0
  32. package/dist/compiler/feature-flags.js.map +1 -0
  33. package/dist/compiler/index.d.ts +35 -0
  34. package/dist/compiler/index.js +84 -0
  35. package/dist/compiler/index.js.map +1 -0
  36. package/dist/compiler/ir-v2/canonical.d.ts +3 -0
  37. package/dist/compiler/ir-v2/canonical.js +50 -0
  38. package/dist/compiler/ir-v2/canonical.js.map +1 -0
  39. package/dist/compiler/ir-v2/index.d.ts +4 -0
  40. package/dist/compiler/ir-v2/index.js +5 -0
  41. package/dist/compiler/ir-v2/index.js.map +1 -0
  42. package/dist/compiler/ir-v2/parse.d.ts +10 -0
  43. package/dist/compiler/ir-v2/parse.js +753 -0
  44. package/dist/compiler/ir-v2/parse.js.map +1 -0
  45. package/dist/compiler/ir-v2/strict-json.d.ts +4 -0
  46. package/dist/compiler/ir-v2/strict-json.js +133 -0
  47. package/dist/compiler/ir-v2/strict-json.js.map +1 -0
  48. package/dist/compiler/ir-v2/types.d.ts +412 -0
  49. package/dist/compiler/ir-v2/types.js +84 -0
  50. package/dist/compiler/ir-v2/types.js.map +1 -0
  51. package/dist/compiler/kvs/lowering.d.ts +13 -0
  52. package/dist/compiler/kvs/lowering.js +77 -0
  53. package/dist/compiler/kvs/lowering.js.map +1 -0
  54. package/dist/compiler/manifest/error.d.ts +7 -0
  55. package/dist/compiler/manifest/error.js +9 -0
  56. package/dist/compiler/manifest/error.js.map +1 -0
  57. package/dist/compiler/manifest/index.d.ts +6 -0
  58. package/dist/compiler/manifest/index.js +7 -0
  59. package/dist/compiler/manifest/index.js.map +1 -0
  60. package/dist/compiler/manifest/operations.d.ts +12 -0
  61. package/dist/compiler/manifest/operations.js +60 -0
  62. package/dist/compiler/manifest/operations.js.map +1 -0
  63. package/dist/compiler/manifest/parse.d.ts +9 -0
  64. package/dist/compiler/manifest/parse.js +280 -0
  65. package/dist/compiler/manifest/parse.js.map +1 -0
  66. package/dist/compiler/manifest/registry.d.ts +3 -0
  67. package/dist/compiler/manifest/registry.js +48 -0
  68. package/dist/compiler/manifest/registry.js.map +1 -0
  69. package/dist/compiler/manifest/resolve.d.ts +14 -0
  70. package/dist/compiler/manifest/resolve.js +116 -0
  71. package/dist/compiler/manifest/resolve.js.map +1 -0
  72. package/dist/compiler/manifest/types.d.ts +95 -0
  73. package/dist/compiler/manifest/types.js +3 -0
  74. package/dist/compiler/manifest/types.js.map +1 -0
  75. package/dist/compiler/named-body/index.d.ts +1 -0
  76. package/dist/compiler/named-body/index.js +2 -0
  77. package/dist/compiler/named-body/index.js.map +1 -0
  78. package/dist/compiler/named-body/lowering.d.ts +18 -0
  79. package/dist/compiler/named-body/lowering.js +83 -0
  80. package/dist/compiler/named-body/lowering.js.map +1 -0
  81. package/dist/compiler/pipeline/compiler.d.ts +18 -0
  82. package/dist/compiler/pipeline/compiler.js +105 -0
  83. package/dist/compiler/pipeline/compiler.js.map +1 -0
  84. package/dist/compiler/pipeline/core-generator.d.ts +3 -0
  85. package/dist/compiler/pipeline/core-generator.js +483 -0
  86. package/dist/compiler/pipeline/core-generator.js.map +1 -0
  87. package/dist/compiler/pipeline/index.d.ts +5 -0
  88. package/dist/compiler/pipeline/index.js +6 -0
  89. package/dist/compiler/pipeline/index.js.map +1 -0
  90. package/dist/compiler/pipeline/registry.d.ts +7 -0
  91. package/dist/compiler/pipeline/registry.js +17 -0
  92. package/dist/compiler/pipeline/registry.js.map +1 -0
  93. package/dist/compiler/pipeline/requirements.d.ts +9 -0
  94. package/dist/compiler/pipeline/requirements.js +135 -0
  95. package/dist/compiler/pipeline/requirements.js.map +1 -0
  96. package/dist/compiler/pipeline/types.d.ts +65 -0
  97. package/dist/compiler/pipeline/types.js +2 -0
  98. package/dist/compiler/pipeline/types.js.map +1 -0
  99. package/dist/compiler/runtime/error.d.ts +6 -0
  100. package/dist/compiler/runtime/error.js +9 -0
  101. package/dist/compiler/runtime/error.js.map +1 -0
  102. package/dist/compiler/runtime/index.d.ts +1 -0
  103. package/dist/compiler/runtime/index.js +2 -0
  104. package/dist/compiler/runtime/index.js.map +1 -0
  105. package/dist/compiler/structured-data/index.d.ts +3 -0
  106. package/dist/compiler/structured-data/index.js +4 -0
  107. package/dist/compiler/structured-data/index.js.map +1 -0
  108. package/dist/compiler/structured-data/lowering.d.ts +30 -0
  109. package/dist/compiler/structured-data/lowering.js +202 -0
  110. package/dist/compiler/structured-data/lowering.js.map +1 -0
  111. package/dist/compiler/structured-data/path.d.ts +2 -0
  112. package/dist/compiler/structured-data/path.js +60 -0
  113. package/dist/compiler/structured-data/path.js.map +1 -0
  114. package/dist/compiler/structured-data/runtime.d.ts +20 -0
  115. package/dist/compiler/structured-data/runtime.js +210 -0
  116. package/dist/compiler/structured-data/runtime.js.map +1 -0
  117. package/dist/compiler/turbowarp-v2.d.ts +8 -0
  118. package/dist/compiler/turbowarp-v2.js +479 -0
  119. package/dist/compiler/turbowarp-v2.js.map +1 -0
  120. package/dist/compiler/validator/index.d.ts +4 -0
  121. package/dist/compiler/validator/index.js +5 -0
  122. package/dist/compiler/validator/index.js.map +1 -0
  123. package/dist/compiler/validator/ir-validator.d.ts +10 -0
  124. package/dist/compiler/validator/ir-validator.js +463 -0
  125. package/dist/compiler/validator/ir-validator.js.map +1 -0
  126. package/dist/compiler/validator/resource-lifetime.d.ts +18 -0
  127. package/dist/compiler/validator/resource-lifetime.js +106 -0
  128. package/dist/compiler/validator/resource-lifetime.js.map +1 -0
  129. package/dist/compiler/validator/turbowarp-subset.d.ts +3 -0
  130. package/dist/compiler/validator/turbowarp-subset.js +241 -0
  131. package/dist/compiler/validator/turbowarp-subset.js.map +1 -0
  132. package/dist/compiler/validator/types.d.ts +30 -0
  133. package/dist/compiler/validator/types.js +7 -0
  134. package/dist/compiler/validator/types.js.map +1 -0
  135. package/dist/config.d.ts +11 -0
  136. package/dist/config.js +12 -0
  137. package/dist/config.js.map +1 -0
  138. package/dist/digest-cli.js +0 -0
  139. package/dist/extension-manifest.json +102 -0
  140. package/dist/named-body.d.ts +57 -0
  141. package/dist/named-body.js +396 -0
  142. package/dist/named-body.js.map +1 -0
  143. package/dist/named-data-namespace.d.ts +3 -0
  144. package/dist/named-data-namespace.js +6 -0
  145. package/dist/named-data-namespace.js.map +1 -0
  146. package/dist/protocol.d.ts +13 -1
  147. package/dist/protocol.js +34 -0
  148. package/dist/protocol.js.map +1 -1
  149. package/dist/resource-named-body-provider.d.ts +8 -0
  150. package/dist/resource-named-body-provider.js +88 -0
  151. package/dist/resource-named-body-provider.js.map +1 -0
  152. package/dist/server.d.ts +10 -1
  153. package/dist/server.js +37 -7
  154. package/dist/server.js.map +1 -1
  155. package/dist/turbowarp-http-server.js +1614 -1099
  156. package/docs/binary-resource-semantics.ja.md +84 -0
  157. package/docs/cloudflare-worker-compiler.ja.md +90 -0
  158. package/docs/compiler-manifest-registry.ja.md +79 -0
  159. package/docs/compiler-platform-pipeline.ja.md +94 -0
  160. package/docs/deploy-ir-v2.ja.md +123 -0
  161. package/docs/fixed-input-editors.ja.md +23 -0
  162. package/docs/index.html +86 -0
  163. package/docs/ir-v2-conformance.ja.md +65 -0
  164. package/docs/named-response-body.ja.md +120 -0
  165. package/docs/platform-storage-adapters.ja.md +99 -0
  166. package/docs/server-executable-subset.ja.md +88 -0
  167. package/docs/structured-data-lowering.ja.md +63 -0
  168. package/docs/turbowarp-http-server.architecture.html +4 -0
  169. package/examples/compiler/message-app.v2.ir.json +41 -0
  170. package/package.json +45 -20
  171. package/schemas/block-editor-fixed-inputs.schema.json +85 -0
  172. package/schemas/compiler-extension-manifest.schema.json +126 -0
  173. package/schemas/compiler-manifest-lock-v1.schema.json +48 -0
  174. package/schemas/deploy-ir-v2.schema.json +835 -0
  175. package/schemas/ir-v2-conformance-fixture.schema.json +44 -0
  176. package/src/block-definitions.json +76 -0
  177. package/src/cli.ts +136 -23
  178. package/src/compiler/adapters/cloudflare.ts +510 -0
  179. package/src/compiler/adapters/firebase.ts +538 -0
  180. package/src/compiler/adapters/index.ts +2 -0
  181. package/src/compiler/binary/codec.ts +61 -0
  182. package/src/compiler/binary/error.ts +25 -0
  183. package/src/compiler/binary/index.ts +4 -0
  184. package/src/compiler/binary/runtime.ts +133 -0
  185. package/src/compiler/binary/types.ts +26 -0
  186. package/src/compiler/feature-flags.ts +7 -0
  187. package/src/compiler/index.ts +114 -0
  188. package/src/compiler/ir-v2/canonical.ts +46 -0
  189. package/src/compiler/ir-v2/index.ts +9 -0
  190. package/src/compiler/ir-v2/parse.ts +921 -0
  191. package/src/compiler/ir-v2/strict-json.ts +129 -0
  192. package/src/compiler/ir-v2/types.ts +462 -0
  193. package/src/compiler/kvs/lowering.ts +88 -0
  194. package/src/compiler/manifest/error.ts +29 -0
  195. package/src/compiler/manifest/index.ts +17 -0
  196. package/src/compiler/manifest/operations.ts +175 -0
  197. package/src/compiler/manifest/parse.ts +390 -0
  198. package/src/compiler/manifest/registry.ts +74 -0
  199. package/src/compiler/manifest/resolve.ts +159 -0
  200. package/src/compiler/manifest/types.ts +112 -0
  201. package/src/compiler/named-body/index.ts +1 -0
  202. package/src/compiler/named-body/lowering.ts +186 -0
  203. package/src/compiler/pipeline/compiler.ts +138 -0
  204. package/src/compiler/pipeline/core-generator.ts +486 -0
  205. package/src/compiler/pipeline/index.ts +5 -0
  206. package/src/compiler/pipeline/registry.ts +18 -0
  207. package/src/compiler/pipeline/requirements.ts +139 -0
  208. package/src/compiler/pipeline/types.ts +59 -0
  209. package/src/compiler/runtime/error.ts +11 -0
  210. package/src/compiler/runtime/index.ts +1 -0
  211. package/src/compiler/structured-data/index.ts +3 -0
  212. package/src/compiler/structured-data/lowering.ts +314 -0
  213. package/src/compiler/structured-data/path.ts +53 -0
  214. package/src/compiler/structured-data/runtime.ts +221 -0
  215. package/src/compiler/turbowarp-v2.ts +610 -0
  216. package/src/compiler/validator/index.ts +4 -0
  217. package/src/compiler/validator/ir-validator.ts +812 -0
  218. package/src/compiler/validator/resource-lifetime.ts +153 -0
  219. package/src/compiler/validator/turbowarp-subset.ts +387 -0
  220. package/src/compiler/validator/types.ts +68 -0
  221. package/src/config.ts +1 -1
  222. package/src/extension.ts +87 -1
  223. package/src/fixed-input-editors.ts +181 -0
  224. package/src/fixed-input-schema.ts +15 -0
  225. package/src/named-body.ts +495 -0
  226. package/src/named-data-namespace.ts +6 -0
  227. package/src/protocol.ts +50 -1
  228. package/src/resource-named-body-provider.ts +106 -0
  229. package/src/server.ts +88 -8
  230. package/docs/turbowarp-http-server.architecture.visual-check.1440x900.dark.png +0 -0
  231. package/docs/turbowarp-http-server.architecture.visual-check.1440x900.light.png +0 -0
  232. package/docs/turbowarp-http-server.architecture.visual-check.2048x1320.dark.png +0 -0
  233. package/docs/turbowarp-http-server.architecture.visual-check.2048x1320.light.png +0 -0
  234. package/docs/turbowarp-http-server.architecture.visual-check.html +0 -32
  235. package/docs/turbowarp-http-server.architecture.visual-check.json +0 -547
  236. package/schemas/extension-manifest.schema.json +0 -49
  237. package/src/extension-manifest.ts +0 -149
@@ -0,0 +1,835 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://raw.githubusercontent.com/kubohiroya/turbowarp-http-server/main/schemas/deploy-ir-v2.schema.json",
4
+ "title": "TurboWarp HTTP Server Deploy IR v2",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["version", "name", "auth", "capabilities", "routes"],
8
+ "properties": {
9
+ "version": {"const": 2},
10
+ "name": {"type": "string", "minLength": 1},
11
+ "auth": {"$ref": "#/$defs/auth"},
12
+ "capabilities": {
13
+ "type": "array",
14
+ "uniqueItems": true,
15
+ "items": {"$ref": "#/$defs/capability"}
16
+ },
17
+ "routes": {
18
+ "type": "array",
19
+ "minItems": 1,
20
+ "items": {"$ref": "#/$defs/route"}
21
+ }
22
+ },
23
+ "$defs": {
24
+ "atomicValueType": {
25
+ "enum": ["null", "boolean", "number", "string", "json-text", "json-array", "json-object", "binary-ref"]
26
+ },
27
+ "valueType": {
28
+ "oneOf": [
29
+ {"$ref": "#/$defs/atomicValueType"},
30
+ {
31
+ "type": "object",
32
+ "additionalProperties": false,
33
+ "required": ["kind", "members"],
34
+ "properties": {
35
+ "kind": {"const": "union"},
36
+ "members": {
37
+ "type": "array",
38
+ "minItems": 2,
39
+ "uniqueItems": true,
40
+ "items": {"$ref": "#/$defs/atomicValueType"}
41
+ }
42
+ }
43
+ }
44
+ ]
45
+ },
46
+ "bindingType": {
47
+ "oneOf": [
48
+ {
49
+ "type": "object",
50
+ "additionalProperties": false,
51
+ "required": ["kind", "valueType"],
52
+ "properties": {
53
+ "kind": {"const": "value"},
54
+ "valueType": {"$ref": "#/$defs/valueType"}
55
+ }
56
+ },
57
+ {
58
+ "type": "object",
59
+ "additionalProperties": false,
60
+ "required": ["kind", "resourceType"],
61
+ "properties": {
62
+ "kind": {"const": "resource"},
63
+ "resourceType": {"const": "binary-body"}
64
+ }
65
+ }
66
+ ]
67
+ },
68
+ "binaryRefDescriptor": {
69
+ "type": "object",
70
+ "additionalProperties": false,
71
+ "required": ["namespace", "key"],
72
+ "properties": {
73
+ "namespace": {"type": "string", "pattern": "^[a-z][a-z0-9.-]{0,63}$"},
74
+ "key": {"type": "string", "minLength": 1, "maxLength": 512, "pattern": "^(?!/)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*//)(?!.*\\\\).+$"},
75
+ "contentType": {"type": "string", "minLength": 1, "maxLength": 255},
76
+ "size": {"type": "integer", "minimum": 0},
77
+ "integrity": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"},
78
+ "revision": {"type": "string", "minLength": 1, "maxLength": 256}
79
+ }
80
+ },
81
+ "binaryLocator": {
82
+ "type": "object",
83
+ "additionalProperties": false,
84
+ "required": ["namespace", "key"],
85
+ "properties": {
86
+ "namespace": {"type": "string", "pattern": "^[a-z][a-z0-9.-]{0,63}$"},
87
+ "key": {"type": "string", "minLength": 1, "maxLength": 512, "pattern": "^(?!/)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*//)(?!.*\\\\).+$"}
88
+ }
89
+ },
90
+ "binaryMetadata": {
91
+ "type": "object",
92
+ "additionalProperties": false,
93
+ "properties": {
94
+ "contentType": {"type": "string", "minLength": 1, "maxLength": 255},
95
+ "size": {"type": "integer", "minimum": 0},
96
+ "integrity": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"},
97
+ "revision": {"type": "string", "minLength": 1, "maxLength": 256}
98
+ }
99
+ },
100
+ "binaryLimit": {"type": "integer", "minimum": 1, "maximum": 16777216},
101
+ "pathSegment": {
102
+ "oneOf": [
103
+ {
104
+ "type": "object",
105
+ "additionalProperties": false,
106
+ "required": ["kind", "value"],
107
+ "properties": {"kind": {"const": "key"}, "value": {"type": "string"}}
108
+ },
109
+ {
110
+ "type": "object",
111
+ "additionalProperties": false,
112
+ "required": ["kind", "value"],
113
+ "properties": {"kind": {"const": "index"}, "value": {"type": "integer", "minimum": 0}}
114
+ }
115
+ ]
116
+ },
117
+ "jsonValueType": {
118
+ "type": "object",
119
+ "additionalProperties": false,
120
+ "required": ["kind", "members"],
121
+ "properties": {
122
+ "kind": {"const": "union"},
123
+ "members": {"const": ["null", "boolean", "number", "string", "json-array", "json-object"]}
124
+ }
125
+ },
126
+ "path": {"type": "array", "items": {"$ref": "#/$defs/pathSegment"}},
127
+ "binding": {
128
+ "type": "object",
129
+ "additionalProperties": false,
130
+ "required": ["id", "type"],
131
+ "properties": {
132
+ "id": {"type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"},
133
+ "type": {"$ref": "#/$defs/bindingType"}
134
+ }
135
+ },
136
+ "sourceRef": {
137
+ "type": "object",
138
+ "additionalProperties": false,
139
+ "required": ["targetIndex", "targetName", "blockId", "opcode"],
140
+ "properties": {
141
+ "targetIndex": {"type": "integer", "minimum": 0},
142
+ "targetName": {"type": "string", "minLength": 1},
143
+ "blockId": {"type": "string", "minLength": 1},
144
+ "opcode": {"type": "string", "minLength": 1},
145
+ "input": {"type": "string", "minLength": 1}
146
+ }
147
+ },
148
+ "auth": {
149
+ "oneOf": [
150
+ {
151
+ "type": "object",
152
+ "additionalProperties": false,
153
+ "required": ["kind"],
154
+ "properties": {"kind": {"const": "none"}}
155
+ },
156
+ {
157
+ "type": "object",
158
+ "additionalProperties": false,
159
+ "required": ["kind", "scheme"],
160
+ "properties": {
161
+ "kind": {"const": "jwt"},
162
+ "scheme": {"enum": ["external-jwt", "trusted-access-jwt"]}
163
+ }
164
+ }
165
+ ]
166
+ },
167
+ "capability": {
168
+ "oneOf": [
169
+ {
170
+ "type": "object",
171
+ "additionalProperties": false,
172
+ "required": ["kind"],
173
+ "properties": {"kind": {"enum": ["record-store", "key-value-store"]}}
174
+ },
175
+ {
176
+ "type": "object",
177
+ "additionalProperties": false,
178
+ "required": ["kind"],
179
+ "properties": {"kind": {"enum": ["object-storage", "streaming-body", "named-body-provider"]}}
180
+ },
181
+ {
182
+ "type": "object",
183
+ "additionalProperties": false,
184
+ "required": ["kind", "field"],
185
+ "properties": {
186
+ "kind": {"const": "request-metadata"},
187
+ "field": {"const": "client-address"}
188
+ }
189
+ },
190
+ {
191
+ "type": "object",
192
+ "additionalProperties": false,
193
+ "required": ["kind", "scheme"],
194
+ "properties": {
195
+ "kind": {"const": "auth"},
196
+ "scheme": {"enum": ["external-jwt", "trusted-access-jwt"]}
197
+ }
198
+ }
199
+ ]
200
+ },
201
+ "expression": {
202
+ "oneOf": [
203
+ {"$ref": "#/$defs/kvsGetTextExpression"},
204
+ {"$ref": "#/$defs/kvsHasExpression"},
205
+ {"$ref": "#/$defs/kvsListKeysExpression"},
206
+ {
207
+ "type": "object",
208
+ "additionalProperties": false,
209
+ "required": ["kind", "valueType", "value"],
210
+ "properties": {
211
+ "kind": {"const": "literal"},
212
+ "valueType": {"$ref": "#/$defs/atomicValueType"},
213
+ "value": {},
214
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
215
+ },
216
+ "allOf": [
217
+ {
218
+ "if": {"properties": {"valueType": {"const": "binary-ref"}}, "required": ["valueType"]},
219
+ "then": {"properties": {"value": {"$ref": "#/$defs/binaryRefDescriptor"}}}
220
+ }
221
+ ]
222
+ },
223
+ {
224
+ "type": "object",
225
+ "additionalProperties": false,
226
+ "required": ["kind", "valueType", "source"],
227
+ "properties": {
228
+ "kind": {"const": "request"},
229
+ "valueType": {"const": "string"},
230
+ "source": {"enum": ["method", "path", "url", "body-text", "content-type", "client-address"]},
231
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
232
+ }
233
+ },
234
+ {
235
+ "type": "object",
236
+ "additionalProperties": false,
237
+ "required": ["kind", "valueType", "source", "name"],
238
+ "properties": {
239
+ "kind": {"const": "request-value"},
240
+ "valueType": {"const": "string"},
241
+ "source": {"enum": ["query", "path-param", "header"]},
242
+ "name": {"type": "string", "minLength": 1},
243
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
244
+ }
245
+ },
246
+ {
247
+ "type": "object",
248
+ "additionalProperties": false,
249
+ "required": ["kind", "valueType", "left", "right"],
250
+ "properties": {
251
+ "kind": {"const": "concat"},
252
+ "valueType": {"const": "string"},
253
+ "left": {"$ref": "#/$defs/expression"},
254
+ "right": {"$ref": "#/$defs/expression"},
255
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
256
+ }
257
+ },
258
+ {
259
+ "type": "object",
260
+ "additionalProperties": false,
261
+ "required": ["kind", "valueType", "name"],
262
+ "properties": {
263
+ "kind": {"const": "handler-variable"},
264
+ "valueType": {
265
+ "type": "object",
266
+ "additionalProperties": false,
267
+ "required": ["kind", "members"],
268
+ "properties": {
269
+ "kind": {"const": "union"},
270
+ "members": {"const": ["number", "string"]}
271
+ }
272
+ },
273
+ "name": {"$ref": "#/$defs/expression"},
274
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
275
+ }
276
+ },
277
+ {
278
+ "type": "object",
279
+ "additionalProperties": false,
280
+ "required": ["kind", "valueType", "name"],
281
+ "properties": {
282
+ "kind": {"const": "handler-variable-exists"},
283
+ "valueType": {"const": "boolean"},
284
+ "name": {"$ref": "#/$defs/expression"},
285
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
286
+ }
287
+ },
288
+ {
289
+ "type": "object",
290
+ "additionalProperties": false,
291
+ "required": ["kind", "valueType"],
292
+ "properties": {
293
+ "kind": {"const": "handler-variable-names"},
294
+ "valueType": {"const": "string"},
295
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
296
+ }
297
+ },
298
+ {
299
+ "type": "object",
300
+ "additionalProperties": false,
301
+ "required": ["kind", "valueType", "binding"],
302
+ "properties": {
303
+ "kind": {"const": "binding"},
304
+ "valueType": {"$ref": "#/$defs/valueType"},
305
+ "binding": {"type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"},
306
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
307
+ }
308
+ },
309
+ {
310
+ "type": "object",
311
+ "additionalProperties": false,
312
+ "required": ["kind", "valueType", "input"],
313
+ "properties": {
314
+ "kind": {"const": "json-text-coerce"},
315
+ "valueType": {"const": "json-text"},
316
+ "input": {"$ref": "#/$defs/expression"},
317
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
318
+ }
319
+ },
320
+ {
321
+ "type": "object",
322
+ "additionalProperties": false,
323
+ "required": ["kind", "valueType", "text"],
324
+ "properties": {
325
+ "kind": {"const": "json-parse"},
326
+ "valueType": {"$ref": "#/$defs/jsonValueType"},
327
+ "text": {"$ref": "#/$defs/expression"},
328
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
329
+ }
330
+ },
331
+ {
332
+ "type": "object",
333
+ "additionalProperties": false,
334
+ "required": ["kind", "valueType", "value"],
335
+ "properties": {
336
+ "kind": {"const": "json-stringify"},
337
+ "valueType": {"const": "json-text"},
338
+ "value": {"$ref": "#/$defs/expression"},
339
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
340
+ }
341
+ },
342
+ {
343
+ "type": "object",
344
+ "additionalProperties": false,
345
+ "required": ["kind", "valueType", "text"],
346
+ "properties": {
347
+ "kind": {"const": "json-is-valid"},
348
+ "valueType": {"const": "boolean"},
349
+ "text": {"$ref": "#/$defs/expression"},
350
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
351
+ }
352
+ },
353
+ {
354
+ "type": "object",
355
+ "additionalProperties": false,
356
+ "required": ["kind", "valueType", "root", "path"],
357
+ "properties": {
358
+ "kind": {"const": "json-get"},
359
+ "valueType": {"$ref": "#/$defs/jsonValueType"},
360
+ "root": {"$ref": "#/$defs/expression"},
361
+ "path": {"$ref": "#/$defs/path"},
362
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
363
+ }
364
+ },
365
+ {
366
+ "type": "object",
367
+ "additionalProperties": false,
368
+ "required": ["kind", "valueType", "root", "path"],
369
+ "properties": {
370
+ "kind": {"const": "json-has"},
371
+ "valueType": {"const": "boolean"},
372
+ "root": {"$ref": "#/$defs/expression"},
373
+ "path": {"$ref": "#/$defs/path"},
374
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
375
+ }
376
+ },
377
+ {
378
+ "type": "object",
379
+ "additionalProperties": false,
380
+ "required": ["kind", "valueType", "root", "path", "value"],
381
+ "properties": {
382
+ "kind": {"const": "json-set"},
383
+ "valueType": {"$ref": "#/$defs/jsonValueType"},
384
+ "root": {"$ref": "#/$defs/expression"},
385
+ "path": {"$ref": "#/$defs/path"},
386
+ "value": {"$ref": "#/$defs/expression"},
387
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
388
+ }
389
+ },
390
+ {
391
+ "type": "object",
392
+ "additionalProperties": false,
393
+ "required": ["kind", "valueType", "root", "path"],
394
+ "properties": {
395
+ "kind": {"const": "json-delete"},
396
+ "valueType": {"$ref": "#/$defs/jsonValueType"},
397
+ "root": {"$ref": "#/$defs/expression"},
398
+ "path": {"$ref": "#/$defs/path"},
399
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
400
+ }
401
+ },
402
+ {
403
+ "type": "object",
404
+ "additionalProperties": false,
405
+ "required": ["kind", "valueType", "root", "path"],
406
+ "properties": {
407
+ "kind": {"const": "json-keys"},
408
+ "valueType": {"const": "json-array"},
409
+ "root": {"$ref": "#/$defs/expression"},
410
+ "path": {"$ref": "#/$defs/path"},
411
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
412
+ }
413
+ },
414
+ {
415
+ "type": "object",
416
+ "additionalProperties": false,
417
+ "required": ["kind", "valueType", "root", "path"],
418
+ "properties": {
419
+ "kind": {"const": "json-length"},
420
+ "valueType": {"const": "number"},
421
+ "root": {"$ref": "#/$defs/expression"},
422
+ "path": {"$ref": "#/$defs/path"},
423
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
424
+ }
425
+ },
426
+ {
427
+ "type": "object",
428
+ "additionalProperties": false,
429
+ "required": ["kind", "valueType", "loopId"],
430
+ "properties": {
431
+ "kind": {"const": "iteration-key"},
432
+ "valueType": {"const": "string"},
433
+ "loopId": {"type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"},
434
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
435
+ }
436
+ },
437
+ {
438
+ "type": "object",
439
+ "additionalProperties": false,
440
+ "required": ["kind", "valueType", "loopId"],
441
+ "properties": {
442
+ "kind": {"const": "iteration-index"},
443
+ "valueType": {"const": "number"},
444
+ "loopId": {"type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"},
445
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
446
+ }
447
+ },
448
+ {
449
+ "type": "object",
450
+ "additionalProperties": false,
451
+ "required": ["kind", "valueType", "loopId"],
452
+ "properties": {
453
+ "kind": {"const": "iteration-value"},
454
+ "valueType": {"$ref": "#/$defs/jsonValueType"},
455
+ "loopId": {"type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"},
456
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
457
+ }
458
+ }
459
+ ]
460
+ },
461
+ "kvsGetTextExpression": {
462
+ "type": "object",
463
+ "additionalProperties": false,
464
+ "required": ["kind", "valueType", "namespace", "key"],
465
+ "properties": {
466
+ "kind": {"const": "kvs-get-text"},
467
+ "valueType": {"const": "string"},
468
+ "namespace": {"$ref": "#/$defs/expression"},
469
+ "key": {"$ref": "#/$defs/expression"},
470
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
471
+ }
472
+ },
473
+ "kvsHasExpression": {
474
+ "type": "object",
475
+ "additionalProperties": false,
476
+ "required": ["kind", "valueType", "namespace", "key"],
477
+ "properties": {
478
+ "kind": {"const": "kvs-has"},
479
+ "valueType": {"const": "boolean"},
480
+ "namespace": {"$ref": "#/$defs/expression"},
481
+ "key": {"$ref": "#/$defs/expression"},
482
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
483
+ }
484
+ },
485
+ "kvsListKeysExpression": {
486
+ "type": "object",
487
+ "additionalProperties": false,
488
+ "required": ["kind", "valueType", "namespace"],
489
+ "properties": {
490
+ "kind": {"const": "kvs-list-keys"},
491
+ "valueType": {"const": "json-text"},
492
+ "namespace": {"$ref": "#/$defs/expression"},
493
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
494
+ }
495
+ },
496
+ "statement": {
497
+ "oneOf": [
498
+ {"$ref": "#/$defs/setStatus"},
499
+ {"$ref": "#/$defs/setHeader"},
500
+ {"$ref": "#/$defs/removeHeader"},
501
+ {"$ref": "#/$defs/handlerVariableMutation"},
502
+ {"$ref": "#/$defs/deleteHandlerVariable"},
503
+ {"$ref": "#/$defs/clearHandlerVariables"},
504
+ {"$ref": "#/$defs/kvsSetText"},
505
+ {"$ref": "#/$defs/kvsDelete"},
506
+ {"$ref": "#/$defs/recordCreate"},
507
+ {"$ref": "#/$defs/recordList"},
508
+ {"$ref": "#/$defs/recordById"},
509
+ {"$ref": "#/$defs/assetResolve"},
510
+ {"$ref": "#/$defs/requestBodyBinary"},
511
+ {"$ref": "#/$defs/assetObjectGet"},
512
+ {"$ref": "#/$defs/assetObjectPut"},
513
+ {"$ref": "#/$defs/assetObjectDelete"},
514
+ {"$ref": "#/$defs/ifStatement"},
515
+ {"$ref": "#/$defs/boundedLoop"},
516
+ {"$ref": "#/$defs/jsonForEach"},
517
+ {"$ref": "#/$defs/respondBinary"},
518
+ {"$ref": "#/$defs/respondNamedBody"},
519
+ {"$ref": "#/$defs/respond"}
520
+ ]
521
+ },
522
+ "setStatus": {
523
+ "type": "object",
524
+ "additionalProperties": false,
525
+ "required": ["kind", "status"],
526
+ "properties": {
527
+ "kind": {"const": "set-status"},
528
+ "status": {"type": "integer", "minimum": 100, "maximum": 599},
529
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
530
+ }
531
+ },
532
+ "setHeader": {
533
+ "type": "object",
534
+ "additionalProperties": false,
535
+ "required": ["kind", "name", "value"],
536
+ "properties": {
537
+ "kind": {"const": "set-header"},
538
+ "name": {"type": "string", "minLength": 1},
539
+ "value": {"$ref": "#/$defs/expression"},
540
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
541
+ }
542
+ },
543
+ "removeHeader": {
544
+ "type": "object",
545
+ "additionalProperties": false,
546
+ "required": ["kind", "name"],
547
+ "properties": {
548
+ "kind": {"const": "remove-header"},
549
+ "name": {"type": "string", "minLength": 1},
550
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
551
+ }
552
+ },
553
+ "handlerVariableMutation": {
554
+ "type": "object",
555
+ "additionalProperties": false,
556
+ "required": ["kind", "name", "value"],
557
+ "properties": {
558
+ "kind": {"enum": ["set-handler-variable", "change-handler-variable"]},
559
+ "name": {"$ref": "#/$defs/expression"},
560
+ "value": {"$ref": "#/$defs/expression"},
561
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
562
+ }
563
+ },
564
+ "deleteHandlerVariable": {
565
+ "type": "object",
566
+ "additionalProperties": false,
567
+ "required": ["kind", "name"],
568
+ "properties": {
569
+ "kind": {"const": "delete-handler-variable"},
570
+ "name": {"$ref": "#/$defs/expression"},
571
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
572
+ }
573
+ },
574
+ "clearHandlerVariables": {
575
+ "type": "object",
576
+ "additionalProperties": false,
577
+ "required": ["kind"],
578
+ "properties": {
579
+ "kind": {"const": "clear-handler-variables"},
580
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
581
+ }
582
+ },
583
+ "kvsSetText": {
584
+ "type": "object",
585
+ "additionalProperties": false,
586
+ "required": ["kind", "namespace", "key", "value"],
587
+ "properties": {
588
+ "kind": {"const": "kvs-set-text"},
589
+ "namespace": {"$ref": "#/$defs/expression"},
590
+ "key": {"$ref": "#/$defs/expression"},
591
+ "value": {"$ref": "#/$defs/expression"},
592
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
593
+ }
594
+ },
595
+ "kvsDelete": {
596
+ "type": "object",
597
+ "additionalProperties": false,
598
+ "required": ["kind", "namespace", "key"],
599
+ "properties": {
600
+ "kind": {"const": "kvs-delete"},
601
+ "namespace": {"$ref": "#/$defs/expression"},
602
+ "key": {"$ref": "#/$defs/expression"},
603
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
604
+ }
605
+ },
606
+ "recordCreate": {
607
+ "type": "object",
608
+ "additionalProperties": false,
609
+ "required": ["kind", "collection", "data", "result"],
610
+ "properties": {
611
+ "kind": {"const": "record-create"},
612
+ "collection": {"type": "string", "minLength": 1},
613
+ "data": {"$ref": "#/$defs/expression"},
614
+ "result": {"$ref": "#/$defs/binding"},
615
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
616
+ }
617
+ },
618
+ "recordList": {
619
+ "type": "object",
620
+ "additionalProperties": false,
621
+ "required": ["kind", "collection", "result"],
622
+ "properties": {
623
+ "kind": {"const": "record-list"},
624
+ "collection": {"type": "string", "minLength": 1},
625
+ "result": {"$ref": "#/$defs/binding"},
626
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
627
+ }
628
+ },
629
+ "recordById": {
630
+ "type": "object",
631
+ "additionalProperties": false,
632
+ "required": ["kind", "id", "result"],
633
+ "properties": {
634
+ "kind": {"enum": ["record-get", "record-delete"]},
635
+ "id": {"$ref": "#/$defs/expression"},
636
+ "result": {"$ref": "#/$defs/binding"},
637
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
638
+ }
639
+ },
640
+ "assetResolve": {
641
+ "type": "object",
642
+ "additionalProperties": false,
643
+ "required": ["kind", "locator", "result"],
644
+ "properties": {
645
+ "kind": {"const": "asset-resolve"},
646
+ "locator": {"$ref": "#/$defs/binaryLocator"},
647
+ "result": {"$ref": "#/$defs/binding"},
648
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
649
+ }
650
+ },
651
+ "requestBodyBinary": {
652
+ "type": "object",
653
+ "additionalProperties": false,
654
+ "required": ["kind", "maxBytes", "result"],
655
+ "properties": {
656
+ "kind": {"const": "request-body-binary"},
657
+ "maxBytes": {"$ref": "#/$defs/binaryLimit"},
658
+ "result": {"$ref": "#/$defs/binding"},
659
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
660
+ }
661
+ },
662
+ "assetObjectGet": {
663
+ "type": "object",
664
+ "additionalProperties": false,
665
+ "required": ["kind", "ref", "maxBytes", "result"],
666
+ "properties": {
667
+ "kind": {"const": "asset-object-get"},
668
+ "ref": {"$ref": "#/$defs/expression"},
669
+ "maxBytes": {"$ref": "#/$defs/binaryLimit"},
670
+ "result": {"$ref": "#/$defs/binding"},
671
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
672
+ }
673
+ },
674
+ "assetObjectPut": {
675
+ "type": "object",
676
+ "additionalProperties": false,
677
+ "required": ["kind", "locator", "body", "metadata", "maxBytes", "result"],
678
+ "properties": {
679
+ "kind": {"const": "asset-object-put"},
680
+ "locator": {"$ref": "#/$defs/binaryLocator"},
681
+ "body": {"type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"},
682
+ "metadata": {"$ref": "#/$defs/binaryMetadata"},
683
+ "maxBytes": {"$ref": "#/$defs/binaryLimit"},
684
+ "result": {"$ref": "#/$defs/binding"},
685
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
686
+ }
687
+ },
688
+ "assetObjectDelete": {
689
+ "type": "object",
690
+ "additionalProperties": false,
691
+ "required": ["kind", "target", "result"],
692
+ "properties": {
693
+ "kind": {"const": "asset-object-delete"},
694
+ "target": {
695
+ "oneOf": [
696
+ {
697
+ "type": "object",
698
+ "additionalProperties": false,
699
+ "required": ["kind", "ref"],
700
+ "properties": {"kind": {"const": "ref"}, "ref": {"$ref": "#/$defs/expression"}}
701
+ },
702
+ {
703
+ "type": "object",
704
+ "additionalProperties": false,
705
+ "required": ["kind", "locator"],
706
+ "properties": {"kind": {"const": "locator"}, "locator": {"$ref": "#/$defs/binaryLocator"}}
707
+ }
708
+ ]
709
+ },
710
+ "result": {"$ref": "#/$defs/binding"},
711
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
712
+ }
713
+ },
714
+ "ifStatement": {
715
+ "type": "object",
716
+ "additionalProperties": false,
717
+ "required": ["kind", "condition", "then"],
718
+ "properties": {
719
+ "kind": {"const": "if"},
720
+ "condition": {"$ref": "#/$defs/expression"},
721
+ "then": {"type": "array", "items": {"$ref": "#/$defs/statement"}},
722
+ "else": {"type": "array", "items": {"$ref": "#/$defs/statement"}},
723
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
724
+ }
725
+ },
726
+ "boundedLoop": {
727
+ "type": "object",
728
+ "additionalProperties": false,
729
+ "required": ["kind", "maxIterations", "body"],
730
+ "properties": {
731
+ "kind": {"const": "bounded-loop"},
732
+ "maxIterations": {"type": "integer", "minimum": 0, "maximum": 1000},
733
+ "body": {"type": "array", "items": {"$ref": "#/$defs/statement"}},
734
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
735
+ }
736
+ },
737
+ "jsonForEach": {
738
+ "type": "object",
739
+ "additionalProperties": false,
740
+ "required": ["kind", "loopId", "root", "path", "maxIterations", "body"],
741
+ "properties": {
742
+ "kind": {"const": "json-for-each"},
743
+ "loopId": {"type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"},
744
+ "root": {"$ref": "#/$defs/expression"},
745
+ "path": {"$ref": "#/$defs/path"},
746
+ "maxIterations": {"type": "integer", "minimum": 1, "maximum": 1000},
747
+ "body": {"type": "array", "items": {"$ref": "#/$defs/statement"}},
748
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
749
+ }
750
+ },
751
+ "respondBinary": {
752
+ "type": "object",
753
+ "additionalProperties": false,
754
+ "required": ["kind", "body"],
755
+ "properties": {
756
+ "kind": {"const": "respond-binary"},
757
+ "body": {"type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"},
758
+ "disposition": {
759
+ "oneOf": [
760
+ {
761
+ "type": "object",
762
+ "additionalProperties": false,
763
+ "required": ["kind"],
764
+ "properties": {"kind": {"const": "inline"}}
765
+ },
766
+ {
767
+ "type": "object",
768
+ "additionalProperties": false,
769
+ "required": ["kind", "filename"],
770
+ "properties": {
771
+ "kind": {"const": "attachment"},
772
+ "filename": {"type": "string", "minLength": 1, "maxLength": 255}
773
+ }
774
+ }
775
+ ]
776
+ },
777
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
778
+ }
779
+ },
780
+ "respondNamedBody": {
781
+ "type": "object",
782
+ "additionalProperties": false,
783
+ "required": ["kind", "reference", "representation", "maxBytes"],
784
+ "properties": {
785
+ "kind": {"const": "respond-named-body"},
786
+ "reference": {
787
+ "type": "object",
788
+ "additionalProperties": false,
789
+ "required": ["namespace", "name", "kind", "scope"],
790
+ "properties": {
791
+ "namespace": {"type": "string", "pattern": "^[a-z][a-z0-9.-]{0,63}$"},
792
+ "name": {"type": "string", "minLength": 1, "maxLength": 256},
793
+ "kind": {"enum": ["structured", "document", "binary", "asset"]},
794
+ "scope": {"enum": ["target", "project"]}
795
+ }
796
+ },
797
+ "representation": {"enum": ["json", "yaml", "html", "markdown", "raw"]},
798
+ "targetId": {"type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},
799
+ "maxBytes": {"$ref": "#/$defs/binaryLimit"},
800
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
801
+ },
802
+ "allOf": [
803
+ {
804
+ "if": {"properties": {"reference": {"properties": {"scope": {"const": "target"}}}}},
805
+ "then": {"required": ["targetId"]},
806
+ "else": {"not": {"required": ["targetId"]}}
807
+ }
808
+ ]
809
+ },
810
+ "respond": {
811
+ "type": "object",
812
+ "additionalProperties": false,
813
+ "required": ["kind", "format", "body"],
814
+ "properties": {
815
+ "kind": {"const": "respond"},
816
+ "format": {"enum": ["text", "html", "json"]},
817
+ "body": {"$ref": "#/$defs/expression"},
818
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
819
+ }
820
+ },
821
+ "route": {
822
+ "type": "object",
823
+ "additionalProperties": false,
824
+ "required": ["id", "method", "path", "auth", "body"],
825
+ "properties": {
826
+ "id": {"type": "string", "minLength": 1},
827
+ "method": {"enum": ["ALL", "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"]},
828
+ "path": {"type": "string", "minLength": 1},
829
+ "auth": {"enum": ["public", "required"]},
830
+ "body": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/statement"}},
831
+ "sourceRef": {"$ref": "#/$defs/sourceRef"}
832
+ }
833
+ }
834
+ }
835
+ }