@decocms/blocks 8.1.0-next.0 → 8.1.0-next.2

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 (490) hide show
  1. package/bin/deco.js +5 -12
  2. package/dist/index.d.ts +2 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +4 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/protocol/assets.d.ts +46 -0
  7. package/dist/protocol/assets.d.ts.map +1 -0
  8. package/dist/protocol/assets.js +105 -0
  9. package/dist/protocol/assets.js.map +1 -0
  10. package/dist/protocol/canonical.d.ts +8 -0
  11. package/dist/protocol/canonical.d.ts.map +1 -0
  12. package/dist/protocol/canonical.js +8 -0
  13. package/dist/protocol/canonical.js.map +1 -0
  14. package/dist/protocol/ciphertext.d.ts +7 -0
  15. package/dist/protocol/ciphertext.d.ts.map +1 -0
  16. package/dist/protocol/ciphertext.js +7 -0
  17. package/dist/protocol/ciphertext.js.map +1 -0
  18. package/dist/protocol/client.d.ts +54 -0
  19. package/dist/protocol/client.d.ts.map +1 -0
  20. package/dist/protocol/client.js +104 -0
  21. package/dist/protocol/client.js.map +1 -0
  22. package/dist/protocol/conformance/cases/assets.d.ts +3 -0
  23. package/dist/protocol/conformance/cases/assets.d.ts.map +1 -0
  24. package/dist/protocol/conformance/cases/assets.js +71 -0
  25. package/dist/protocol/conformance/cases/assets.js.map +1 -0
  26. package/dist/protocol/conformance/cases/guards.d.ts +3 -0
  27. package/dist/protocol/conformance/cases/guards.d.ts.map +1 -0
  28. package/dist/protocol/conformance/cases/guards.js +265 -0
  29. package/dist/protocol/conformance/cases/guards.js.map +1 -0
  30. package/dist/protocol/conformance/cases/reads.d.ts +3 -0
  31. package/dist/protocol/conformance/cases/reads.d.ts.map +1 -0
  32. package/dist/protocol/conformance/cases/reads.js +140 -0
  33. package/dist/protocol/conformance/cases/reads.js.map +1 -0
  34. package/dist/protocol/conformance/cases/types.d.ts +9 -0
  35. package/dist/protocol/conformance/cases/types.d.ts.map +1 -0
  36. package/dist/protocol/conformance/cases/types.js +2 -0
  37. package/dist/protocol/conformance/cases/types.js.map +1 -0
  38. package/dist/protocol/conformance/cases/wire.d.ts +3 -0
  39. package/dist/protocol/conformance/cases/wire.d.ts.map +1 -0
  40. package/dist/protocol/conformance/cases/wire.js +130 -0
  41. package/dist/protocol/conformance/cases/wire.js.map +1 -0
  42. package/dist/protocol/conformance/cases/writes.d.ts +3 -0
  43. package/dist/protocol/conformance/cases/writes.d.ts.map +1 -0
  44. package/dist/protocol/conformance/cases/writes.js +278 -0
  45. package/dist/protocol/conformance/cases/writes.js.map +1 -0
  46. package/dist/protocol/conformance/contentHashFixtures.d.ts +22 -0
  47. package/dist/protocol/conformance/contentHashFixtures.d.ts.map +1 -0
  48. package/dist/protocol/conformance/contentHashFixtures.js +64 -0
  49. package/dist/protocol/conformance/contentHashFixtures.js.map +1 -0
  50. package/dist/protocol/conformance/context.d.ts +100 -0
  51. package/dist/protocol/conformance/context.d.ts.map +1 -0
  52. package/dist/protocol/conformance/context.js +155 -0
  53. package/dist/protocol/conformance/context.js.map +1 -0
  54. package/dist/protocol/conformance/index.d.ts +32 -0
  55. package/dist/protocol/conformance/index.d.ts.map +1 -0
  56. package/dist/protocol/conformance/index.js +90 -0
  57. package/dist/protocol/conformance/index.js.map +1 -0
  58. package/dist/protocol/errors.d.ts +85 -0
  59. package/dist/protocol/errors.d.ts.map +1 -0
  60. package/dist/protocol/errors.js +62 -0
  61. package/dist/protocol/errors.js.map +1 -0
  62. package/dist/protocol/index.d.ts +25 -0
  63. package/dist/protocol/index.d.ts.map +1 -0
  64. package/dist/protocol/index.js +25 -0
  65. package/dist/protocol/index.js.map +1 -0
  66. package/dist/protocol/keys.d.ts +101 -0
  67. package/dist/protocol/keys.d.ts.map +1 -0
  68. package/dist/protocol/keys.js +223 -0
  69. package/dist/protocol/keys.js.map +1 -0
  70. package/dist/protocol/params.d.ts +10 -0
  71. package/dist/protocol/params.d.ts.map +1 -0
  72. package/dist/protocol/params.js +54 -0
  73. package/dist/protocol/params.js.map +1 -0
  74. package/dist/protocol/secrets.d.ts +22 -0
  75. package/dist/protocol/secrets.d.ts.map +1 -0
  76. package/dist/protocol/secrets.js +200 -0
  77. package/dist/protocol/secrets.js.map +1 -0
  78. package/dist/protocol/server/assets.d.ts +20 -0
  79. package/dist/protocol/server/assets.d.ts.map +1 -0
  80. package/dist/protocol/server/assets.js +77 -0
  81. package/dist/protocol/server/assets.js.map +1 -0
  82. package/dist/protocol/server/auth.d.ts +31 -0
  83. package/dist/protocol/server/auth.d.ts.map +1 -0
  84. package/dist/protocol/server/auth.js +32 -0
  85. package/dist/protocol/server/auth.js.map +1 -0
  86. package/dist/protocol/server/bodyCache.d.ts +28 -0
  87. package/dist/protocol/server/bodyCache.d.ts.map +1 -0
  88. package/dist/protocol/server/bodyCache.js +75 -0
  89. package/dist/protocol/server/bodyCache.js.map +1 -0
  90. package/dist/protocol/server/content.d.ts +44 -0
  91. package/dist/protocol/server/content.d.ts.map +1 -0
  92. package/dist/protocol/server/content.js +132 -0
  93. package/dist/protocol/server/content.js.map +1 -0
  94. package/dist/protocol/server/core.d.ts +63 -0
  95. package/dist/protocol/server/core.d.ts.map +1 -0
  96. package/dist/protocol/server/core.js +77 -0
  97. package/dist/protocol/server/core.js.map +1 -0
  98. package/dist/protocol/server/handler.d.ts +5 -0
  99. package/dist/protocol/server/handler.d.ts.map +1 -0
  100. package/dist/protocol/server/handler.js +70 -0
  101. package/dist/protocol/server/handler.js.map +1 -0
  102. package/dist/protocol/server/http.d.ts +24 -0
  103. package/dist/protocol/server/http.d.ts.map +1 -0
  104. package/dist/protocol/server/http.js +133 -0
  105. package/dist/protocol/server/http.js.map +1 -0
  106. package/dist/protocol/server/index.d.ts +11 -0
  107. package/dist/protocol/server/index.d.ts.map +1 -0
  108. package/dist/protocol/server/index.js +9 -0
  109. package/dist/protocol/server/index.js.map +1 -0
  110. package/dist/protocol/server/methods/apply.d.ts +4 -0
  111. package/dist/protocol/server/methods/apply.d.ts.map +1 -0
  112. package/dist/protocol/server/methods/apply.js +275 -0
  113. package/dist/protocol/server/methods/apply.js.map +1 -0
  114. package/dist/protocol/server/methods/read.d.ts +14 -0
  115. package/dist/protocol/server/methods/read.d.ts.map +1 -0
  116. package/dist/protocol/server/methods/read.js +132 -0
  117. package/dist/protocol/server/methods/read.js.map +1 -0
  118. package/dist/protocol/server/rpc.d.ts +7 -0
  119. package/dist/protocol/server/rpc.d.ts.map +1 -0
  120. package/dist/protocol/server/rpc.js +115 -0
  121. package/dist/protocol/server/rpc.js.map +1 -0
  122. package/dist/protocol/storage/fs/hash.d.ts +8 -0
  123. package/dist/protocol/storage/fs/hash.d.ts.map +1 -0
  124. package/dist/protocol/storage/fs/hash.js +20 -0
  125. package/dist/protocol/storage/fs/hash.js.map +1 -0
  126. package/dist/protocol/storage/fs/index.d.ts +30 -0
  127. package/dist/protocol/storage/fs/index.d.ts.map +1 -0
  128. package/dist/protocol/storage/fs/index.js +301 -0
  129. package/dist/protocol/storage/fs/index.js.map +1 -0
  130. package/dist/protocol/storage/fs/lock.d.ts +8 -0
  131. package/dist/protocol/storage/fs/lock.d.ts.map +1 -0
  132. package/dist/protocol/storage/fs/lock.js +61 -0
  133. package/dist/protocol/storage/fs/lock.js.map +1 -0
  134. package/dist/protocol/storage/fs/transaction.d.ts +19 -0
  135. package/dist/protocol/storage/fs/transaction.d.ts.map +1 -0
  136. package/dist/protocol/storage/fs/transaction.js +174 -0
  137. package/dist/protocol/storage/fs/transaction.js.map +1 -0
  138. package/dist/protocol/storage/fs/unsupported.d.ts +10 -0
  139. package/dist/protocol/storage/fs/unsupported.d.ts.map +1 -0
  140. package/dist/protocol/storage/fs/unsupported.js +4 -0
  141. package/dist/protocol/storage/fs/unsupported.js.map +1 -0
  142. package/dist/protocol/storage/memory.d.ts +40 -0
  143. package/dist/protocol/storage/memory.d.ts.map +1 -0
  144. package/dist/protocol/storage/memory.js +179 -0
  145. package/dist/protocol/storage/memory.js.map +1 -0
  146. package/dist/protocol/storage.d.ts +178 -0
  147. package/dist/protocol/storage.d.ts.map +1 -0
  148. package/dist/protocol/storage.js +29 -0
  149. package/dist/protocol/storage.js.map +1 -0
  150. package/dist/protocol/types.d.ts +194 -0
  151. package/dist/protocol/types.d.ts.map +1 -0
  152. package/dist/protocol/types.js +31 -0
  153. package/dist/protocol/types.js.map +1 -0
  154. package/dist/v8/analytics.d.ts +31 -0
  155. package/dist/v8/analytics.d.ts.map +1 -0
  156. package/dist/v8/analytics.js +46 -0
  157. package/dist/v8/analytics.js.map +1 -0
  158. package/dist/v8/background.d.ts +26 -0
  159. package/dist/v8/background.d.ts.map +1 -0
  160. package/dist/v8/background.js +95 -0
  161. package/dist/v8/background.js.map +1 -0
  162. package/dist/v8/builtins/data.d.ts +15 -0
  163. package/dist/v8/builtins/data.d.ts.map +1 -0
  164. package/dist/v8/builtins/data.js +18 -0
  165. package/dist/v8/builtins/data.js.map +1 -0
  166. package/dist/v8/builtins/index.d.ts +9 -0
  167. package/dist/v8/builtins/index.d.ts.map +1 -0
  168. package/dist/v8/builtins/index.js +24 -0
  169. package/dist/v8/builtins/index.js.map +1 -0
  170. package/dist/v8/builtins/lazy.d.ts +17 -0
  171. package/dist/v8/builtins/lazy.d.ts.map +1 -0
  172. package/dist/v8/builtins/lazy.js +13 -0
  173. package/dist/v8/builtins/lazy.js.map +1 -0
  174. package/dist/v8/builtins/legacy.d.ts +41 -0
  175. package/dist/v8/builtins/legacy.d.ts.map +1 -0
  176. package/dist/v8/builtins/legacy.js +62 -0
  177. package/dist/v8/builtins/legacy.js.map +1 -0
  178. package/dist/v8/builtins/matchers.d.ts +19 -0
  179. package/dist/v8/builtins/matchers.d.ts.map +1 -0
  180. package/dist/v8/builtins/matchers.js +24 -0
  181. package/dist/v8/builtins/matchers.js.map +1 -0
  182. package/dist/v8/builtins/multivariate.d.ts +15 -0
  183. package/dist/v8/builtins/multivariate.d.ts.map +1 -0
  184. package/dist/v8/builtins/multivariate.js +18 -0
  185. package/dist/v8/builtins/multivariate.js.map +1 -0
  186. package/dist/v8/builtins/secret.d.ts +7 -0
  187. package/dist/v8/builtins/secret.d.ts.map +1 -0
  188. package/dist/v8/builtins/secret.js +68 -0
  189. package/dist/v8/builtins/secret.js.map +1 -0
  190. package/dist/v8/canonical.d.ts +42 -0
  191. package/dist/v8/canonical.d.ts.map +1 -0
  192. package/dist/v8/canonical.js +111 -0
  193. package/dist/v8/canonical.js.map +1 -0
  194. package/dist/v8/ciphertext.d.ts +58 -0
  195. package/dist/v8/ciphertext.d.ts.map +1 -0
  196. package/dist/v8/ciphertext.js +134 -0
  197. package/dist/v8/ciphertext.js.map +1 -0
  198. package/dist/v8/cli/builtins.d.ts +11 -0
  199. package/dist/v8/cli/builtins.d.ts.map +1 -0
  200. package/dist/v8/cli/builtins.js +18 -0
  201. package/dist/v8/cli/builtins.js.map +1 -0
  202. package/dist/v8/cli/check/index.d.ts +41 -0
  203. package/dist/v8/cli/check/index.d.ts.map +1 -0
  204. package/dist/v8/cli/check/index.js +713 -0
  205. package/dist/v8/cli/check/index.js.map +1 -0
  206. package/dist/v8/cli/check/messages.d.ts +24 -0
  207. package/dist/v8/cli/check/messages.d.ts.map +1 -0
  208. package/dist/v8/cli/check/messages.js +150 -0
  209. package/dist/v8/cli/check/messages.js.map +1 -0
  210. package/dist/v8/cli/content.d.ts +60 -0
  211. package/dist/v8/cli/content.d.ts.map +1 -0
  212. package/dist/v8/cli/content.js +231 -0
  213. package/dist/v8/cli/content.js.map +1 -0
  214. package/dist/v8/cli/index.d.ts +18 -0
  215. package/dist/v8/cli/index.d.ts.map +1 -0
  216. package/dist/v8/cli/index.js +18 -0
  217. package/dist/v8/cli/index.js.map +1 -0
  218. package/dist/v8/cli/log.d.ts +9 -0
  219. package/dist/v8/cli/log.d.ts.map +1 -0
  220. package/dist/v8/cli/log.js +11 -0
  221. package/dist/v8/cli/log.js.map +1 -0
  222. package/dist/v8/cli/main.d.ts +2 -0
  223. package/dist/v8/cli/main.d.ts.map +1 -0
  224. package/dist/v8/cli/main.js +9 -0
  225. package/dist/v8/cli/main.js.map +1 -0
  226. package/dist/v8/cli/root.d.ts +28 -0
  227. package/dist/v8/cli/root.d.ts.map +1 -0
  228. package/dist/v8/cli/root.js +64 -0
  229. package/dist/v8/cli/root.js.map +1 -0
  230. package/dist/v8/cli/run.d.ts +13 -0
  231. package/dist/v8/cli/run.d.ts.map +1 -0
  232. package/dist/v8/cli/run.js +210 -0
  233. package/dist/v8/cli/run.js.map +1 -0
  234. package/dist/v8/cli/schema/builtinSchemas.d.ts +22 -0
  235. package/dist/v8/cli/schema/builtinSchemas.d.ts.map +1 -0
  236. package/dist/v8/cli/schema/builtinSchemas.js +213 -0
  237. package/dist/v8/cli/schema/builtinSchemas.js.map +1 -0
  238. package/dist/v8/cli/schema/generate.d.ts +50 -0
  239. package/dist/v8/cli/schema/generate.d.ts.map +1 -0
  240. package/dist/v8/cli/schema/generate.js +415 -0
  241. package/dist/v8/cli/schema/generate.js.map +1 -0
  242. package/dist/v8/cli/schema/index.d.ts +21 -0
  243. package/dist/v8/cli/schema/index.d.ts.map +1 -0
  244. package/dist/v8/cli/schema/index.js +51 -0
  245. package/dist/v8/cli/schema/index.js.map +1 -0
  246. package/dist/v8/cli/schema/tsProgram.d.ts +120 -0
  247. package/dist/v8/cli/schema/tsProgram.d.ts.map +1 -0
  248. package/dist/v8/cli/schema/tsProgram.js +418 -0
  249. package/dist/v8/cli/schema/tsProgram.js.map +1 -0
  250. package/dist/v8/cli/schema/typeToSchema.d.ts +81 -0
  251. package/dist/v8/cli/schema/typeToSchema.d.ts.map +1 -0
  252. package/dist/v8/cli/schema/typeToSchema.js +683 -0
  253. package/dist/v8/cli/schema/typeToSchema.js.map +1 -0
  254. package/dist/v8/cli/serve/server.d.ts +31 -0
  255. package/dist/v8/cli/serve/server.d.ts.map +1 -0
  256. package/dist/v8/cli/serve/server.js +247 -0
  257. package/dist/v8/cli/serve/server.js.map +1 -0
  258. package/dist/v8/cli/watch.d.ts +20 -0
  259. package/dist/v8/cli/watch.d.ts.map +1 -0
  260. package/dist/v8/cli/watch.js +79 -0
  261. package/dist/v8/cli/watch.js.map +1 -0
  262. package/dist/v8/client.d.ts +20 -0
  263. package/dist/v8/client.d.ts.map +1 -0
  264. package/dist/v8/client.js +115 -0
  265. package/dist/v8/client.js.map +1 -0
  266. package/dist/v8/cms.d.ts +9 -0
  267. package/dist/v8/cms.d.ts.map +1 -0
  268. package/dist/v8/cms.js +206 -0
  269. package/dist/v8/cms.js.map +1 -0
  270. package/dist/v8/content.d.ts +35 -0
  271. package/dist/v8/content.d.ts.map +1 -0
  272. package/dist/v8/content.js +183 -0
  273. package/dist/v8/content.js.map +1 -0
  274. package/dist/v8/draft.d.ts +44 -0
  275. package/dist/v8/draft.d.ts.map +1 -0
  276. package/dist/v8/draft.js +133 -0
  277. package/dist/v8/draft.js.map +1 -0
  278. package/dist/v8/errors.d.ts +21 -0
  279. package/dist/v8/errors.d.ts.map +1 -0
  280. package/dist/v8/errors.js +39 -0
  281. package/dist/v8/errors.js.map +1 -0
  282. package/dist/v8/fetch.d.ts +26 -0
  283. package/dist/v8/fetch.d.ts.map +1 -0
  284. package/dist/v8/fetch.js +98 -0
  285. package/dist/v8/fetch.js.map +1 -0
  286. package/dist/v8/identity.d.ts +19 -0
  287. package/dist/v8/identity.d.ts.map +1 -0
  288. package/dist/v8/identity.js +54 -0
  289. package/dist/v8/identity.js.map +1 -0
  290. package/dist/v8/index.d.ts +11 -0
  291. package/dist/v8/index.d.ts.map +1 -0
  292. package/dist/v8/index.js +10 -0
  293. package/dist/v8/index.js.map +1 -0
  294. package/dist/v8/json.d.ts +19 -0
  295. package/dist/v8/json.d.ts.map +1 -0
  296. package/dist/v8/json.js +65 -0
  297. package/dist/v8/json.js.map +1 -0
  298. package/dist/v8/matchRoute.d.ts +30 -0
  299. package/dist/v8/matchRoute.d.ts.map +1 -0
  300. package/dist/v8/matchRoute.js +175 -0
  301. package/dist/v8/matchRoute.js.map +1 -0
  302. package/dist/v8/remoteLoader.d.ts +16 -0
  303. package/dist/v8/remoteLoader.d.ts.map +1 -0
  304. package/dist/v8/remoteLoader.js +243 -0
  305. package/dist/v8/remoteLoader.js.map +1 -0
  306. package/dist/v8/resolver.d.ts +34 -0
  307. package/dist/v8/resolver.d.ts.map +1 -0
  308. package/dist/v8/resolver.js +219 -0
  309. package/dist/v8/resolver.js.map +1 -0
  310. package/dist/v8/secrets.d.ts +9 -0
  311. package/dist/v8/secrets.d.ts.map +1 -0
  312. package/dist/v8/secrets.js +14 -0
  313. package/dist/v8/secrets.js.map +1 -0
  314. package/dist/v8/telemetry.d.ts +61 -0
  315. package/dist/v8/telemetry.d.ts.map +1 -0
  316. package/dist/v8/telemetry.js +460 -0
  317. package/dist/v8/telemetry.js.map +1 -0
  318. package/dist/v8/types.d.ts +214 -0
  319. package/dist/v8/types.d.ts.map +1 -0
  320. package/dist/v8/types.js +2 -0
  321. package/dist/v8/types.js.map +1 -0
  322. package/package.json +65 -105
  323. package/src/index.ts +3 -13
  324. package/src/protocol/canonical.ts +1 -1
  325. package/src/protocol/ciphertext.ts +1 -1
  326. package/src/protocol/client.ts +2 -2
  327. package/src/protocol/conformance/cases/assets.ts +3 -3
  328. package/src/protocol/conformance/cases/guards.ts +4 -4
  329. package/src/protocol/conformance/cases/reads.ts +4 -4
  330. package/src/protocol/conformance/cases/types.ts +1 -1
  331. package/src/protocol/conformance/cases/wire.ts +4 -4
  332. package/src/protocol/conformance/cases/writes.ts +4 -4
  333. package/src/protocol/conformance/context.ts +4 -4
  334. package/src/protocol/conformance/index.ts +10 -10
  335. package/src/protocol/index.ts +6 -6
  336. package/src/protocol/params.ts +2 -2
  337. package/src/protocol/secrets.ts +3 -3
  338. package/src/protocol/server/assets.ts +6 -6
  339. package/src/protocol/server/auth.ts +1 -1
  340. package/src/protocol/server/content.ts +5 -5
  341. package/src/protocol/server/core.ts +12 -6
  342. package/src/protocol/server/handler.ts +6 -6
  343. package/src/protocol/server/http.ts +1 -1
  344. package/src/protocol/server/index.ts +3 -3
  345. package/src/protocol/server/methods/apply.ts +9 -9
  346. package/src/protocol/server/methods/read.ts +5 -5
  347. package/src/protocol/server/rpc.ts +6 -6
  348. package/src/protocol/storage/fs/index.ts +7 -7
  349. package/src/protocol/storage/fs/lock.ts +1 -1
  350. package/src/protocol/storage/fs/unsupported.ts +2 -2
  351. package/src/protocol/storage/memory.ts +5 -5
  352. package/src/protocol/storage.ts +1 -1
  353. package/src/v8/analytics.ts +2 -2
  354. package/src/v8/background.ts +3 -3
  355. package/src/v8/builtins/data.ts +1 -1
  356. package/src/v8/builtins/index.ts +6 -6
  357. package/src/v8/builtins/lazy.ts +1 -1
  358. package/src/v8/builtins/legacy.ts +2 -2
  359. package/src/v8/builtins/multivariate.ts +1 -1
  360. package/src/v8/builtins/secret.ts +2 -2
  361. package/src/v8/cli/builtins.ts +2 -2
  362. package/src/v8/cli/check/index.ts +11 -11
  363. package/src/v8/cli/content.ts +6 -6
  364. package/src/v8/cli/index.ts +8 -8
  365. package/src/v8/cli/main.ts +1 -1
  366. package/src/v8/cli/run.ts +7 -7
  367. package/src/v8/cli/schema/builtinSchemas.ts +1 -1
  368. package/src/v8/cli/schema/generate.ts +6 -6
  369. package/src/v8/cli/schema/index.ts +4 -4
  370. package/src/v8/cli/schema/tsProgram.ts +1 -1
  371. package/src/v8/cli/schema/typeToSchema.ts +24 -2
  372. package/src/v8/cli/serve/server.ts +9 -9
  373. package/src/v8/client.ts +5 -5
  374. package/src/v8/cms.ts +9 -9
  375. package/src/v8/content.ts +4 -4
  376. package/src/v8/draft.ts +1 -1
  377. package/src/v8/errors.ts +1 -1
  378. package/src/v8/fetch.ts +9 -28
  379. package/src/v8/identity.ts +1 -1
  380. package/src/v8/index.ts +5 -5
  381. package/src/v8/matchRoute.ts +1 -1
  382. package/src/v8/remoteLoader.ts +7 -7
  383. package/src/v8/resolver.ts +6 -6
  384. package/src/v8/secrets.ts +1 -1
  385. package/src/v8/telemetry.ts +6 -6
  386. package/src/cms/applySectionConventions.ts +0 -148
  387. package/src/cms/blockSource.ts +0 -228
  388. package/src/cms/client.ts +0 -85
  389. package/src/cms/deferredTrigger.ts +0 -58
  390. package/src/cms/draftSource.ts +0 -476
  391. package/src/cms/index.ts +0 -180
  392. package/src/cms/loadDecofileDirectory.ts +0 -89
  393. package/src/cms/loader.ts +0 -563
  394. package/src/cms/registry.ts +0 -264
  395. package/src/cms/renderJson.ts +0 -179
  396. package/src/cms/resolve.ts +0 -2583
  397. package/src/cms/schema.ts +0 -1219
  398. package/src/cms/sectionLoaderContext.ts +0 -113
  399. package/src/cms/sectionLoaders.ts +0 -686
  400. package/src/cms/sectionMixins.ts +0 -153
  401. package/src/flags/audience.ts +0 -56
  402. package/src/flags/everyone.ts +0 -29
  403. package/src/flags/flag.ts +0 -15
  404. package/src/flags/multivariate/image.ts +0 -11
  405. package/src/flags/multivariate/message.ts +0 -11
  406. package/src/flags/multivariate/page.ts +0 -16
  407. package/src/flags/multivariate/section.ts +0 -16
  408. package/src/flags/multivariate.ts +0 -1
  409. package/src/flags/types.ts +0 -59
  410. package/src/flags/utils/multivariate.ts +0 -20
  411. package/src/hooks/Image.tsx +0 -314
  412. package/src/hooks/JsonLd.tsx +0 -353
  413. package/src/hooks/LazySection.tsx +0 -121
  414. package/src/hooks/LiveControls.tsx +0 -144
  415. package/src/hooks/Picture.tsx +0 -127
  416. package/src/hooks/RenderSection.tsx +0 -91
  417. package/src/hooks/SectionErrorFallback.tsx +0 -97
  418. package/src/hooks/Stats.tsx +0 -134
  419. package/src/hooks/index.ts +0 -35
  420. package/src/hooks/useLoadMore.ts +0 -100
  421. package/src/matchers/builtins.ts +0 -459
  422. package/src/matchers/countryNames.ts +0 -104
  423. package/src/matchers/override.ts +0 -136
  424. package/src/matchers/posthog.ts +0 -154
  425. package/src/middleware/decoState.ts +0 -55
  426. package/src/middleware/healthMetrics.ts +0 -133
  427. package/src/middleware/hydrationContext.ts +0 -79
  428. package/src/middleware/index.ts +0 -88
  429. package/src/middleware/liveness.ts +0 -21
  430. package/src/middleware/observability.ts +0 -800
  431. package/src/middleware/validateSection.ts +0 -100
  432. package/src/preview/DraftPreviewBadge.tsx +0 -306
  433. package/src/preview/decoMark.ts +0 -11
  434. package/src/preview/index.ts +0 -8
  435. package/src/sdk/abTesting.ts +0 -556
  436. package/src/sdk/analytics.ts +0 -147
  437. package/src/sdk/cacheHeaders.ts +0 -633
  438. package/src/sdk/cacheStorage.ts +0 -287
  439. package/src/sdk/cachedLoader.ts +0 -556
  440. package/src/sdk/clx.ts +0 -5
  441. package/src/sdk/cn.ts +0 -28
  442. package/src/sdk/composite.ts +0 -114
  443. package/src/sdk/cookie.ts +0 -129
  444. package/src/sdk/crypto.ts +0 -199
  445. package/src/sdk/csp.ts +0 -59
  446. package/src/sdk/deepOmit.ts +0 -52
  447. package/src/sdk/detectDevice.ts +0 -45
  448. package/src/sdk/djb2.ts +0 -20
  449. package/src/sdk/encoding.ts +0 -44
  450. package/src/sdk/env.ts +0 -54
  451. package/src/sdk/experiments.ts +0 -314
  452. package/src/sdk/fetchCache.ts +0 -269
  453. package/src/sdk/fetchTimeout.ts +0 -58
  454. package/src/sdk/flags.ts +0 -138
  455. package/src/sdk/http.ts +0 -124
  456. package/src/sdk/index.ts +0 -97
  457. package/src/sdk/inflightTimeout.ts +0 -53
  458. package/src/sdk/instrumentedFetch.ts +0 -362
  459. package/src/sdk/invoke.ts +0 -298
  460. package/src/sdk/logger.ts +0 -304
  461. package/src/sdk/mergeCacheControl.ts +0 -150
  462. package/src/sdk/nonce.ts +0 -46
  463. package/src/sdk/normalizeUrls.ts +0 -91
  464. package/src/sdk/observability.ts +0 -116
  465. package/src/sdk/otel.ts +0 -1118
  466. package/src/sdk/otelAdapters/clickhouseCollector.ts +0 -65
  467. package/src/sdk/otelAdapters.ts +0 -144
  468. package/src/sdk/otelHttpLog.ts +0 -419
  469. package/src/sdk/otelHttpMeter.ts +0 -532
  470. package/src/sdk/otelHttpTracer.ts +0 -543
  471. package/src/sdk/redirects.ts +0 -336
  472. package/src/sdk/requestContext.ts +0 -281
  473. package/src/sdk/requestContextStorage.browser.ts +0 -43
  474. package/src/sdk/requestContextStorage.ts +0 -35
  475. package/src/sdk/responseCache.ts +0 -82
  476. package/src/sdk/retry.ts +0 -45
  477. package/src/sdk/serverTimings.ts +0 -68
  478. package/src/sdk/signal.ts +0 -42
  479. package/src/sdk/sitemap.ts +0 -160
  480. package/src/sdk/urlRedaction.ts +0 -82
  481. package/src/sdk/urlUtils.ts +0 -183
  482. package/src/sdk/useDevice.ts +0 -89
  483. package/src/sdk/useDeviceContext.tsx +0 -108
  484. package/src/sdk/useId.ts +0 -7
  485. package/src/sdk/useScript.ts +0 -210
  486. package/src/sdk/useSuggestions.ts +0 -188
  487. package/src/sdk/wrapCaughtErrors.ts +0 -107
  488. package/src/setup.ts +0 -120
  489. package/src/types/index.ts +0 -53
  490. package/src/types/widgets.ts +0 -14
@@ -1,154 +0,0 @@
1
- /**
2
- * PostHog feature flag matcher bridge.
3
- *
4
- * Bridges deco's CMS matcher interface (`evaluateMatcher`) to PostHog's
5
- * feature flag system for experiment-grade A/B testing with sticky sessions.
6
- *
7
- * This module is designed to be used with `registerMatcher()` from the CMS.
8
- * PostHog itself is NOT a dependency of `@decocms/start` — the storefront
9
- * provides the PostHog client via `configurePostHogMatcher()`.
10
- *
11
- * @example
12
- * ```ts
13
- * // In your storefront setup.ts
14
- * import { registerMatcher } from "@decocms/start/cms";
15
- * import { createPostHogMatcher, configurePostHogMatcher } from "@decocms/start/matchers/posthog";
16
- * import posthog from "posthog-js";
17
- *
18
- * configurePostHogMatcher({
19
- * isFeatureEnabled: (key) => posthog.isFeatureEnabled(key) ?? false,
20
- * getFeatureFlagVariant: (key) => posthog.getFeatureFlag(key),
21
- * });
22
- *
23
- * registerMatcher("posthog/matchers/featureFlag.ts", createPostHogMatcher());
24
- * ```
25
- */
26
-
27
- import type { MatcherContext } from "../cms/resolve";
28
-
29
- export interface PostHogAdapter {
30
- /**
31
- * Evaluate a boolean feature flag.
32
- * Should return `true` if the flag is enabled for the current user.
33
- */
34
- isFeatureEnabled: (flagKey: string) => boolean;
35
- /**
36
- * Get the variant key for a multivariate feature flag.
37
- * Returns the variant string or `undefined`/`false` if not matched.
38
- */
39
- getFeatureFlagVariant?: (flagKey: string) => string | boolean | undefined;
40
- }
41
-
42
- let adapter: PostHogAdapter | null = null;
43
-
44
- /**
45
- * Provide the PostHog client adapter. Must be called before
46
- * any PostHog matchers are evaluated.
47
- */
48
- export function configurePostHogMatcher(ph: PostHogAdapter) {
49
- adapter = ph;
50
- }
51
-
52
- /**
53
- * Creates a matcher function compatible with `registerMatcher()`.
54
- *
55
- * CMS rule shape (in the decofile JSON):
56
- * ```json
57
- * {
58
- * "__resolveType": "posthog/matchers/featureFlag.ts",
59
- * "flagKey": "my-experiment",
60
- * "variant": "treatment"
61
- * }
62
- * ```
63
- *
64
- * - If only `flagKey` is provided, matches when the flag is enabled (boolean).
65
- * - If `variant` is also provided, matches when the flag's variant equals it.
66
- */
67
- export function createPostHogMatcher() {
68
- return (rule: Record<string, unknown>, _ctx: MatcherContext): boolean => {
69
- if (!adapter) {
70
- console.warn(
71
- "[PostHog Matcher] No adapter configured. Call configurePostHogMatcher() first.",
72
- );
73
- return false;
74
- }
75
-
76
- const flagKey = rule.flagKey as string | undefined;
77
- if (!flagKey) {
78
- console.warn("[PostHog Matcher] Missing `flagKey` in matcher rule.");
79
- return false;
80
- }
81
-
82
- const expectedVariant = rule.variant as string | undefined;
83
-
84
- if (expectedVariant && adapter.getFeatureFlagVariant) {
85
- const actual = adapter.getFeatureFlagVariant(flagKey);
86
- return actual === expectedVariant;
87
- }
88
-
89
- return adapter.isFeatureEnabled(flagKey);
90
- };
91
- }
92
-
93
- /**
94
- * Server-side PostHog evaluation for SSR.
95
- *
96
- * Uses the PostHog Node SDK to evaluate flags server-side,
97
- * ensuring the first render has the correct variant without a flash.
98
- *
99
- * @example
100
- * ```ts
101
- * import { PostHog } from "posthog-node";
102
- * import { configurePostHogMatcher, createServerPostHogAdapter } from "@decocms/start/matchers/posthog";
103
- *
104
- * const phServer = new PostHog(process.env.POSTHOG_API_KEY);
105
- *
106
- * // In your middleware, per-request:
107
- * const adapter = createServerPostHogAdapter(phServer, distinctId);
108
- * configurePostHogMatcher(adapter);
109
- * ```
110
- */
111
- export function createServerPostHogAdapter(
112
- client: {
113
- isFeatureEnabled: (key: string, distinctId: string) => Promise<boolean> | boolean;
114
- getFeatureFlag: (
115
- key: string,
116
- distinctId: string,
117
- ) => Promise<string | boolean | undefined> | string | boolean | undefined;
118
- },
119
- distinctId: string,
120
- ): PostHogAdapter {
121
- const flagCache = new Map<string, boolean>();
122
- const variantCache = new Map<string, string | boolean | undefined>();
123
-
124
- return {
125
- isFeatureEnabled(key: string): boolean {
126
- if (flagCache.has(key)) return flagCache.get(key)!;
127
-
128
- // Synchronous path — pre-warm the cache in middleware before resolution
129
- const result = client.isFeatureEnabled(key, distinctId);
130
- if (result instanceof Promise) {
131
- console.warn(
132
- "[PostHog] Async flag evaluation used synchronously. Pre-warm flags in middleware.",
133
- );
134
- return false;
135
- }
136
- flagCache.set(key, result);
137
- return result;
138
- },
139
-
140
- getFeatureFlagVariant(key: string): string | boolean | undefined {
141
- if (variantCache.has(key)) return variantCache.get(key);
142
-
143
- const result = client.getFeatureFlag(key, distinctId);
144
- if (result instanceof Promise) {
145
- console.warn(
146
- "[PostHog] Async variant evaluation used synchronously. Pre-warm flags in middleware.",
147
- );
148
- return undefined;
149
- }
150
- variantCache.set(key, result);
151
- return result;
152
- },
153
- };
154
- }
@@ -1,55 +0,0 @@
1
- /**
2
- * Per-request Deco state that the middleware pipeline builds up
3
- * and passes through the request lifecycle.
4
- */
5
- import { createServerTimings, type ServerTimings } from "../sdk/serverTimings";
6
- import type { Flag } from "../types/index";
7
-
8
- export interface DecoState {
9
- /** Site name / identifier. */
10
- site: string;
11
- /** Per-request Server-Timing tracker. */
12
- timings: ServerTimings;
13
- /** Active feature flags for this request. */
14
- flags: Flag[];
15
- /** Whether the request is from a deco admin origin. */
16
- isAdmin: boolean;
17
- /** Whether debug mode is enabled (via `?__d=true` or admin). */
18
- debug: boolean;
19
- /** Start time of the request (ms). */
20
- startedAt: number;
21
- }
22
-
23
- export function buildDecoState(request: Request, site?: string): DecoState {
24
- const url = new URL(request.url);
25
- const origin = request.headers.get("origin") || request.headers.get("referer") || "";
26
-
27
- const ADMIN_ORIGINS = [
28
- "https://admin.deco.cx",
29
- "https://v0-admin.deco.cx",
30
- "https://play.deco.cx",
31
- "https://admin-cx.deco.page",
32
- "https://deco.chat",
33
- "https://admin.decocms.com",
34
- "https://decocms.com",
35
- ];
36
-
37
- const isAdmin =
38
- origin.includes("localhost") ||
39
- origin.includes("127.0.0.1") ||
40
- ADMIN_ORIGINS.some((d) => origin.startsWith(d));
41
-
42
- const debug = url.searchParams.has("__d") || isAdmin;
43
-
44
- return {
45
- site:
46
- site ||
47
- (typeof globalThis.process !== "undefined" ? globalThis.process.env?.DECO_SITE : undefined) ||
48
- "storefront",
49
- timings: createServerTimings(),
50
- flags: [],
51
- isAdmin,
52
- debug,
53
- startedAt: performance.now(),
54
- };
55
- }
@@ -1,133 +0,0 @@
1
- /**
2
- * Health metrics collection for request tracking and diagnostics.
3
- *
4
- * Provides atomic counters for requests (total, inflight, errors)
5
- * and a health endpoint with cache stats and uptime.
6
- *
7
- * @example
8
- * ```ts
9
- * import { trackRequest, getHealthMetrics, handleHealthCheck } from "@decocms/start/middleware/healthMetrics";
10
- *
11
- * // In middleware:
12
- * trackRequest.start();
13
- * const response = await next();
14
- * trackRequest.end(response.status);
15
- * ```
16
- */
17
-
18
- import { getLoaderCacheStats } from "../sdk/cachedLoader";
19
-
20
- // ---------------------------------------------------------------------------
21
- // Counters
22
- // ---------------------------------------------------------------------------
23
-
24
- let totalRequests = 0;
25
- let inflightRequests = 0;
26
- let totalErrors = 0;
27
- const startedAt = Date.now();
28
-
29
- const statusCounts: Record<string, number> = {};
30
-
31
- export const trackRequest = {
32
- start() {
33
- totalRequests++;
34
- inflightRequests++;
35
- },
36
-
37
- end(status: number) {
38
- inflightRequests--;
39
- const bucket = `${Math.floor(status / 100)}xx`;
40
- statusCounts[bucket] = (statusCounts[bucket] || 0) + 1;
41
- if (status >= 500) totalErrors++;
42
- },
43
- };
44
-
45
- // ---------------------------------------------------------------------------
46
- // Metrics access
47
- // ---------------------------------------------------------------------------
48
-
49
- export interface HealthMetrics {
50
- uptime: number;
51
- uptimeHuman: string;
52
- requests: {
53
- total: number;
54
- inflight: number;
55
- errors: number;
56
- statusCodes: Record<string, number>;
57
- };
58
- cache: {
59
- entries: number;
60
- inflight: number;
61
- estimatedBytes: number;
62
- maxBytes: number;
63
- };
64
- memory?: {
65
- rss: number;
66
- heapUsed: number;
67
- heapTotal: number;
68
- };
69
- }
70
-
71
- function formatUptime(ms: number): string {
72
- const seconds = Math.floor(ms / 1000);
73
- const h = Math.floor(seconds / 3600);
74
- const m = Math.floor((seconds % 3600) / 60);
75
- const s = seconds % 60;
76
- return `${h}h ${m}m ${s}s`;
77
- }
78
-
79
- export function getHealthMetrics(): HealthMetrics {
80
- const uptime = Date.now() - startedAt;
81
- const cacheStats = getLoaderCacheStats();
82
-
83
- const metrics: HealthMetrics = {
84
- uptime,
85
- uptimeHuman: formatUptime(uptime),
86
- requests: {
87
- total: totalRequests,
88
- inflight: inflightRequests,
89
- errors: totalErrors,
90
- statusCodes: { ...statusCounts },
91
- },
92
- cache: cacheStats,
93
- };
94
-
95
- // Memory info is only available in Node.js / Deno environments
96
- if (typeof globalThis.process !== "undefined" && globalThis.process.memoryUsage) {
97
- try {
98
- const mem = globalThis.process.memoryUsage();
99
- metrics.memory = {
100
- rss: mem.rss,
101
- heapUsed: mem.heapUsed,
102
- heapTotal: mem.heapTotal,
103
- };
104
- } catch {
105
- // not available in this runtime
106
- }
107
- }
108
-
109
- return metrics;
110
- }
111
-
112
- // ---------------------------------------------------------------------------
113
- // Health check handler
114
- // ---------------------------------------------------------------------------
115
-
116
- /**
117
- * Handle `/deco/_health` requests with detailed metrics.
118
- * Returns null for non-matching requests.
119
- */
120
- export function handleHealthCheck(request: Request): Response | null {
121
- const url = new URL(request.url);
122
- if (url.pathname !== "/deco/_health") return null;
123
-
124
- const metrics = getHealthMetrics();
125
-
126
- return new Response(JSON.stringify(metrics, null, 2), {
127
- status: 200,
128
- headers: {
129
- "Content-Type": "application/json",
130
- "Cache-Control": "no-store",
131
- },
132
- });
133
- }
@@ -1,79 +0,0 @@
1
- /**
2
- * Hydration context utilities for consistent SSR/client rendering.
3
- *
4
- * Provides patterns for extracting locale, timezone, and other
5
- * request-specific data that must be consistent between server
6
- * and client to avoid hydration mismatches.
7
- *
8
- * @example
9
- * ```tsx
10
- * // In your storefront's middleware.ts:
11
- * import { createMiddleware } from "@tanstack/react-start";
12
- * import { buildHydrationContext } from "@decocms/start/middleware/hydrationContext";
13
- *
14
- * export const hydrationMiddleware = createMiddleware().server(async ({ request, next }) => {
15
- * const hydrationCtx = buildHydrationContext(request);
16
- * return next({ context: { hydration: hydrationCtx } });
17
- * });
18
- * ```
19
- *
20
- * Then in components:
21
- * ```tsx
22
- * // Use the cookie-based values for deterministic SSR rendering
23
- * const locale = hydrationCtx.locale; // same on server and client
24
- * ```
25
- */
26
-
27
- export interface HydrationContext {
28
- /** Locale from cookie or Accept-Language header. */
29
- locale: string;
30
- /** Timezone from cookie. Falls back to "UTC" for deterministic SSR. */
31
- timeZone: string;
32
- /** Country code from Cloudflare headers or cookie. */
33
- country?: string;
34
- }
35
-
36
- /**
37
- * Build hydration context from a request.
38
- *
39
- * Values are extracted from cookies first (set by the client on first visit),
40
- * then from headers. Cookie-based values are deterministic because the same
41
- * cookie is sent on both SSR and client-side navigations.
42
- *
43
- * Recommended: set these cookies on first client render:
44
- * ```tsx
45
- * useEffect(() => {
46
- * const tz = Intl.DateTimeFormat().resolvedOptions().timeZone;
47
- * document.cookie = `tz=${tz}; path=/; max-age=31536000; SameSite=Lax`;
48
- * document.cookie = `locale=${navigator.language}; path=/; max-age=31536000; SameSite=Lax`;
49
- * }, []);
50
- * ```
51
- */
52
- export function buildHydrationContext(request: Request): HydrationContext {
53
- const cookies = parseCookies(request.headers.get("cookie") ?? "");
54
-
55
- // Locale: cookie → Accept-Language → fallback
56
- const locale =
57
- cookies.locale ||
58
- request.headers.get("accept-language")?.split(",")[0]?.split(";")[0]?.trim() ||
59
- "en-US";
60
-
61
- // Timezone: cookie → UTC fallback (never guess — causes hydration mismatch)
62
- const timeZone = cookies.tz || "UTC";
63
-
64
- // Country: Cloudflare header → cookie
65
- const country =
66
- request.headers.get("cf-ipcountry") || cookies.country || undefined;
67
-
68
- return { locale, timeZone, country };
69
- }
70
-
71
- function parseCookies(cookieHeader: string): Record<string, string> {
72
- const cookies: Record<string, string> = {};
73
- for (const part of cookieHeader.split(";")) {
74
- const [key, ...rest] = part.split("=");
75
- const k = key?.trim();
76
- if (k) cookies[k] = rest.join("=").trim();
77
- }
78
- return cookies;
79
- }
@@ -1,88 +0,0 @@
1
- /**
2
- * Deco middleware utilities for TanStack Start.
3
- *
4
- * These are NOT TanStack `createMiddleware()` instances because
5
- * `@decocms/start` doesn't depend on `@tanstack/react-start`.
6
- * Instead, they export composable handler functions that storefronts
7
- * wire into their own `createMiddleware()` chain.
8
- *
9
- * @example
10
- * ```ts
11
- * // In your storefront's middleware.ts
12
- * import { createMiddleware } from "@tanstack/react-start";
13
- * import { buildDecoState, handleLiveness, applyServerTiming, applyCorsHeaders } from "@decocms/start/middleware";
14
- *
15
- * export const decoMiddleware = createMiddleware().server(async ({ request, next }) => {
16
- * const liveness = handleLiveness(request);
17
- * if (liveness) return { result: undefined, response: liveness };
18
- *
19
- * const state = buildDecoState(request, "my-site");
20
- * const endTotal = state.timings.start("total");
21
- *
22
- * const result = await next();
23
- *
24
- * endTotal();
25
- * applyServerTiming(result.response, state);
26
- * if (state.isAdmin) applyCorsHeaders(result.response, request);
27
- *
28
- * return result;
29
- * });
30
- * ```
31
- */
32
-
33
- export {
34
- type CacheDecision,
35
- configureMeter,
36
- configureTracer,
37
- getActiveSpan,
38
- getMeter,
39
- getTracer,
40
- injectTraceContext,
41
- logRequest,
42
- type MeterAdapter,
43
- MetricNames,
44
- recordCacheMetric,
45
- recordRequestMetric,
46
- type Span,
47
- setSpanAttribute,
48
- type TracerAdapter,
49
- withTracing,
50
- } from "../sdk/observability";
51
- export { buildDecoState, type DecoState } from "./decoState";
52
- export {
53
- getHealthMetrics,
54
- type HealthMetrics,
55
- handleHealthCheck,
56
- trackRequest,
57
- } from "./healthMetrics";
58
- export { buildHydrationContext, type HydrationContext } from "./hydrationContext";
59
- export { handleLiveness } from "./liveness";
60
- export {
61
- createSectionValidator,
62
- type DeferredSectionInput,
63
- validateDeferredSectionInput,
64
- } from "./validateSection";
65
-
66
- /**
67
- * Appends Server-Timing header to a response from the accumulated timings.
68
- */
69
- export function applyServerTiming(response: Response, state: { timings: { toHeader(): string } }) {
70
- const header = state.timings.toHeader();
71
- if (header) {
72
- response.headers.append("Server-Timing", header);
73
- }
74
- }
75
-
76
- /**
77
- * Applies CORS headers for deco admin origins to a response.
78
- */
79
- export function applyCorsHeaders(response: Response, request: Request) {
80
- const origin = request.headers.get("origin") || "*";
81
- response.headers.set("Access-Control-Allow-Origin", origin);
82
- response.headers.set("Access-Control-Allow-Methods", "GET, POST, OPTIONS");
83
- response.headers.set(
84
- "Access-Control-Allow-Headers",
85
- "Content-Type, Authorization, If-None-Match",
86
- );
87
- response.headers.set("Access-Control-Allow-Credentials", "true");
88
- }
@@ -1,21 +0,0 @@
1
- /**
2
- * Liveness and readiness probe handlers.
3
- *
4
- * - `/_liveness` — simple 200 OK for load balancers (K8s, Cloudflare)
5
- * - `/deco/_health` — detailed JSON health metrics (delegated to healthMetrics)
6
- */
7
-
8
- import { handleHealthCheck } from "./healthMetrics";
9
-
10
- export function handleLiveness(request: Request): Response | null {
11
- const url = new URL(request.url);
12
-
13
- if (url.pathname === "/_liveness" || url.pathname === "/deco/_liveness") {
14
- return new Response("OK", {
15
- status: 200,
16
- headers: { "Content-Type": "text/plain", "Cache-Control": "no-store" },
17
- });
18
- }
19
-
20
- return handleHealthCheck(request);
21
- }