@powerhousedao/shared 6.2.3-dev.9 → 6.2.3-dev.90

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 (351) hide show
  1. package/dist/action-id-DON1WCeY.d.ts +19 -0
  2. package/dist/action-id-DON1WCeY.d.ts.map +1 -0
  3. package/dist/analytics/index.d.ts +4 -4
  4. package/dist/analytics/index.d.ts.map +1 -1
  5. package/dist/analytics/index.js +25 -24
  6. package/dist/analytics/index.js.map +1 -1
  7. package/dist/clis/args/access-token.d.mts +15 -2
  8. package/dist/clis/args/access-token.d.mts.map +1 -0
  9. package/dist/clis/args/access-token.mjs +21 -1
  10. package/dist/clis/args/access-token.mjs.map +1 -0
  11. package/dist/clis/args/common-BpLj4peE.d.mts +186 -0
  12. package/dist/clis/args/common-BpLj4peE.d.mts.map +1 -0
  13. package/dist/clis/args/{common-CcYbXrBx.mjs → common-CBLen_yt.mjs} +58 -12
  14. package/dist/clis/args/common-CBLen_yt.mjs.map +1 -0
  15. package/dist/clis/args/common.d.mts +3 -2
  16. package/dist/clis/args/common.mjs +1 -1
  17. package/dist/clis/args/connect.d.mts +449 -2
  18. package/dist/clis/args/connect.d.mts.map +1 -0
  19. package/dist/clis/args/connect.mjs +202 -1
  20. package/dist/clis/args/connect.mjs.map +1 -0
  21. package/dist/clis/args/{generate-CA916Fvj.mjs → generate-a36SaAn4.mjs} +40 -2
  22. package/dist/clis/args/generate-a36SaAn4.mjs.map +1 -0
  23. package/dist/clis/args/generate.d.mts +102 -2
  24. package/dist/clis/args/generate.d.mts.map +1 -0
  25. package/dist/clis/args/generate.mjs +1 -1
  26. package/dist/clis/args/help-Cgh3krcq.d.mts +239 -0
  27. package/dist/clis/args/help-Cgh3krcq.d.mts.map +1 -0
  28. package/dist/clis/args/{help-Bqbgbalu.mjs → help-DnOa5Gr-.mjs} +67 -16
  29. package/dist/clis/args/help-DnOa5Gr-.mjs.map +1 -0
  30. package/dist/clis/args/help.d.mts +3 -2
  31. package/dist/clis/args/help.mjs +15 -1
  32. package/dist/clis/args/host.d.mts +23 -0
  33. package/dist/clis/args/host.d.mts.map +1 -0
  34. package/dist/clis/args/host.mjs +35 -0
  35. package/dist/clis/args/host.mjs.map +1 -0
  36. package/dist/clis/args/index.d.mts +23 -19
  37. package/dist/clis/args/index.mjs +22 -19
  38. package/dist/clis/args/init.d.mts +54 -2
  39. package/dist/clis/args/init.d.mts.map +1 -0
  40. package/dist/clis/args/init.mjs +71 -1
  41. package/dist/clis/args/init.mjs.map +1 -0
  42. package/dist/clis/args/inspect.d.mts +12 -2
  43. package/dist/clis/args/inspect.d.mts.map +1 -0
  44. package/dist/clis/args/inspect.mjs +14 -1
  45. package/dist/clis/args/inspect.mjs.map +1 -0
  46. package/dist/clis/args/install.d.mts +36 -2
  47. package/dist/clis/args/install.d.mts.map +1 -0
  48. package/dist/clis/args/install.mjs +31 -1
  49. package/dist/clis/args/install.mjs.map +1 -0
  50. package/dist/clis/args/keyframes.d.mts +25 -0
  51. package/dist/clis/args/keyframes.d.mts.map +1 -0
  52. package/dist/clis/args/keyframes.mjs +42 -0
  53. package/dist/clis/args/keyframes.mjs.map +1 -0
  54. package/dist/clis/args/list.d.mts +9 -2
  55. package/dist/clis/args/list.d.mts.map +1 -0
  56. package/dist/clis/args/list.mjs +6 -1
  57. package/dist/clis/args/list.mjs.map +1 -0
  58. package/dist/clis/args/login.d.mts +24 -2
  59. package/dist/clis/args/login.d.mts.map +1 -0
  60. package/dist/clis/args/login.mjs +39 -1
  61. package/dist/clis/args/login.mjs.map +1 -0
  62. package/dist/clis/args/mcp.d.mts +15 -0
  63. package/dist/clis/args/mcp.d.mts.map +1 -0
  64. package/dist/clis/args/mcp.mjs +22 -0
  65. package/dist/clis/args/mcp.mjs.map +1 -0
  66. package/dist/clis/args/migrate.d.mts +18 -2
  67. package/dist/clis/args/migrate.d.mts.map +1 -0
  68. package/dist/clis/args/migrate.mjs +27 -1
  69. package/dist/clis/args/migrate.mjs.map +1 -0
  70. package/dist/clis/args/publish.d.mts +15 -2
  71. package/dist/clis/args/publish.d.mts.map +1 -0
  72. package/dist/clis/args/publish.mjs +18 -1
  73. package/dist/clis/args/publish.mjs.map +1 -0
  74. package/dist/clis/args/registry.d.mts +16 -2
  75. package/dist/clis/args/registry.d.mts.map +1 -0
  76. package/dist/clis/args/registry.mjs +22 -1
  77. package/dist/clis/args/registry.mjs.map +1 -0
  78. package/dist/clis/args/run.d.mts +18 -0
  79. package/dist/clis/args/run.d.mts.map +1 -0
  80. package/dist/clis/args/run.mjs +28 -0
  81. package/dist/clis/args/run.mjs.map +1 -0
  82. package/dist/clis/args/service-IZ0Aq58z.d.mts +27 -0
  83. package/dist/clis/args/service-IZ0Aq58z.d.mts.map +1 -0
  84. package/dist/clis/args/service.d.mts +3 -2
  85. package/dist/clis/args/service.mjs +10 -1
  86. package/dist/clis/args/service.mjs.map +1 -0
  87. package/dist/clis/args/switchboard.d.mts +69 -2
  88. package/dist/clis/args/switchboard.d.mts.map +1 -0
  89. package/dist/clis/args/switchboard.mjs +84 -1
  90. package/dist/clis/args/switchboard.mjs.map +1 -0
  91. package/dist/clis/args/uninstall.d.mts +27 -2
  92. package/dist/clis/args/uninstall.d.mts.map +1 -0
  93. package/dist/clis/args/uninstall.mjs +15 -1
  94. package/dist/clis/args/uninstall.mjs.map +1 -0
  95. package/dist/clis/args/unpublish.d.mts +21 -2
  96. package/dist/clis/args/unpublish.d.mts.map +1 -0
  97. package/dist/clis/args/unpublish.mjs +29 -1
  98. package/dist/clis/args/unpublish.mjs.map +1 -0
  99. package/dist/clis/args/{vetra-b4KUu1Ax.mjs → vetra-DlAEC_Mv.mjs} +18 -2
  100. package/dist/clis/args/vetra-DlAEC_Mv.mjs.map +1 -0
  101. package/dist/clis/args/vetra.d.mts +113 -2
  102. package/dist/clis/args/vetra.d.mts.map +1 -0
  103. package/dist/clis/args/vetra.mjs +1 -1
  104. package/dist/clis/build-config-BM1RL4u_.mjs +309 -0
  105. package/dist/clis/build-config-BM1RL4u_.mjs.map +1 -0
  106. package/dist/clis/build-config.d.mts +71 -10616
  107. package/dist/clis/build-config.d.mts.map +1 -1
  108. package/dist/clis/build-config.mjs +2 -93
  109. package/dist/clis/build-pieces.d.mts +160 -0
  110. package/dist/clis/build-pieces.d.mts.map +1 -0
  111. package/dist/clis/build-pieces.mjs +549 -0
  112. package/dist/clis/build-pieces.mjs.map +1 -0
  113. package/dist/clis/command-names.d.mts +6 -2
  114. package/dist/clis/command-names.d.mts.map +1 -1
  115. package/dist/clis/command-names.mjs +9 -1
  116. package/dist/clis/command-names.mjs.map +1 -1
  117. package/dist/clis/constants.d.mts +3 -475
  118. package/dist/clis/constants.mjs +79 -21
  119. package/dist/clis/constants.mjs.map +1 -1
  120. package/dist/clis/feature-flags.d.mts +17 -0
  121. package/dist/clis/feature-flags.d.mts.map +1 -0
  122. package/dist/clis/feature-flags.mjs +21 -0
  123. package/dist/clis/feature-flags.mjs.map +1 -0
  124. package/dist/clis/index-DnZYG-8g.d.mts +11154 -0
  125. package/dist/clis/index-DnZYG-8g.d.mts.map +1 -0
  126. package/dist/clis/index.d.mts +3677 -1967
  127. package/dist/clis/index.d.mts.map +1 -1
  128. package/dist/clis/index.mjs +1317 -871
  129. package/dist/clis/index.mjs.map +1 -1
  130. package/dist/clis/package-style.d.mts +32 -0
  131. package/dist/clis/package-style.d.mts.map +1 -0
  132. package/dist/clis/package-style.mjs +102 -0
  133. package/dist/clis/package-style.mjs.map +1 -0
  134. package/dist/clis/ph-dir.d.mts +26 -0
  135. package/dist/clis/ph-dir.d.mts.map +1 -0
  136. package/dist/clis/ph-dir.mjs +37 -0
  137. package/dist/clis/ph-dir.mjs.map +1 -0
  138. package/dist/clis/project-env.d.mts +10 -4
  139. package/dist/clis/project-env.d.mts.map +1 -1
  140. package/dist/clis/project-env.mjs +16 -1
  141. package/dist/clis/project-env.mjs.map +1 -1
  142. package/dist/clis/project-ports.d.mts +5 -5
  143. package/dist/clis/project-ports.d.mts.map +1 -1
  144. package/dist/clis/project-ports.mjs +1 -1
  145. package/dist/clis/project-ports.mjs.map +1 -1
  146. package/dist/clis/rolldown-runtime-B4iAMlE-.mjs +35 -0
  147. package/dist/clis/services/telemetry.d.mts +7 -7
  148. package/dist/clis/services/telemetry.d.mts.map +1 -1
  149. package/dist/clis/services/telemetry.mjs.map +1 -1
  150. package/dist/clis/types-CqwqhwOG.d.mts +2484 -0
  151. package/dist/clis/types-CqwqhwOG.d.mts.map +1 -0
  152. package/dist/clis/utils.d.mts +4 -4
  153. package/dist/clis/utils.d.mts.map +1 -1
  154. package/dist/clis/utils.mjs.map +1 -1
  155. package/dist/{config-loader-B845Hidf.js → config-loader-B7SqNz8z.js} +50 -12
  156. package/dist/config-loader-B7SqNz8z.js.map +1 -0
  157. package/dist/connect/app-shell.d.ts +48 -0
  158. package/dist/connect/app-shell.d.ts.map +1 -0
  159. package/dist/connect/app-shell.js +90 -0
  160. package/dist/connect/app-shell.js.map +1 -0
  161. package/dist/connect/config-loader.d.ts +21 -8
  162. package/dist/connect/config-loader.d.ts.map +1 -1
  163. package/dist/connect/config-loader.js +2 -2
  164. package/dist/connect/connect-config-schema.d.ts +3 -0
  165. package/dist/connect/connect-config-schema.js +484 -0
  166. package/dist/connect/connect-config-schema.js.map +1 -0
  167. package/dist/connect/image-ref.d.ts +32 -0
  168. package/dist/connect/image-ref.d.ts.map +1 -0
  169. package/dist/connect/image-ref.js +80 -0
  170. package/dist/connect/image-ref.js.map +1 -0
  171. package/dist/connect/index.d.ts +226 -643
  172. package/dist/connect/index.d.ts.map +1 -1
  173. package/dist/connect/index.js +443 -507
  174. package/dist/connect/index.js.map +1 -1
  175. package/dist/connect/json-adapter.d.ts +3 -4
  176. package/dist/connect/json-adapter.d.ts.map +1 -1
  177. package/dist/connect/json-adapter.js.map +1 -1
  178. package/dist/connect/origin-placeholder.d.ts +52 -0
  179. package/dist/connect/origin-placeholder.d.ts.map +1 -0
  180. package/dist/connect/origin-placeholder.js +101 -0
  181. package/dist/connect/origin-placeholder.js.map +1 -0
  182. package/dist/connect-config-schema-LzQbfZHm.d.ts +1858 -0
  183. package/dist/connect-config-schema-LzQbfZHm.d.ts.map +1 -0
  184. package/dist/constants-5UFY_rXh.d.ts +9 -0
  185. package/dist/constants-5UFY_rXh.d.ts.map +1 -0
  186. package/dist/constants.d.ts +3 -2
  187. package/dist/constants.js +22 -6
  188. package/dist/constants.js.map +1 -1
  189. package/dist/document-drive/index.d.ts +103 -101
  190. package/dist/document-drive/index.d.ts.map +1 -1
  191. package/dist/document-drive/index.js +41 -32
  192. package/dist/document-drive/index.js.map +1 -1
  193. package/dist/document-model/action-id.d.ts +3 -0
  194. package/dist/document-model/action-id.js +59 -0
  195. package/dist/document-model/action-id.js.map +1 -0
  196. package/dist/document-model/dispatch.d.ts +25 -0
  197. package/dist/document-model/dispatch.d.ts.map +1 -0
  198. package/dist/document-model/dispatch.js +0 -0
  199. package/dist/document-model/errors.d.ts +3 -0
  200. package/dist/document-model/errors.js +200 -0
  201. package/dist/document-model/errors.js.map +1 -0
  202. package/dist/document-model/index.d.ts +6 -4
  203. package/dist/document-model/index.js +7 -5144
  204. package/dist/document-model/mock.d.ts +2 -3
  205. package/dist/document-model/mock.d.ts.map +1 -1
  206. package/dist/document-model/mock.js +2 -1
  207. package/dist/document-model/mock.js.map +1 -1
  208. package/dist/document-model/utils.d.ts +4 -2
  209. package/dist/document-model/utils.js +3 -2
  210. package/dist/document-model/version.d.ts +3 -0
  211. package/dist/document-model/version.js +8 -0
  212. package/dist/document-model/version.js.map +1 -0
  213. package/dist/document-model-D6OQX6ZP.js +5765 -0
  214. package/dist/document-model-D6OQX6ZP.js.map +1 -0
  215. package/dist/host-tokens/index.d.ts +3 -0
  216. package/dist/host-tokens/index.js +2 -0
  217. package/dist/host-tokens-DOeyxqLi.js +322 -0
  218. package/dist/host-tokens-DOeyxqLi.js.map +1 -0
  219. package/dist/index-B6uMqLt2.d.ts +36 -0
  220. package/dist/index-B6uMqLt2.d.ts.map +1 -0
  221. package/dist/index-D58WVj_E.d.ts +246 -0
  222. package/dist/index-D58WVj_E.d.ts.map +1 -0
  223. package/dist/index.d.ts +7 -6
  224. package/dist/index.js.map +1 -1
  225. package/dist/processors/index.d.ts +3 -2
  226. package/dist/processors/index.js +180 -67
  227. package/dist/processors/index.js.map +1 -1
  228. package/dist/processors/testing.d.ts +22 -0
  229. package/dist/processors/testing.d.ts.map +1 -0
  230. package/dist/processors/testing.js +77 -0
  231. package/dist/processors/testing.js.map +1 -0
  232. package/dist/purge-BOqSpe4O.js +620 -0
  233. package/dist/purge-BOqSpe4O.js.map +1 -0
  234. package/dist/registry/index.d.ts +15 -15
  235. package/dist/registry/index.d.ts.map +1 -1
  236. package/dist/registry/index.js +64 -12
  237. package/dist/registry/index.js.map +1 -1
  238. package/dist/registry/manifest-slim.d.ts +4 -3
  239. package/dist/registry/manifest-slim.d.ts.map +1 -1
  240. package/dist/registry/manifest-slim.js +22 -2
  241. package/dist/registry/manifest-slim.js.map +1 -1
  242. package/dist/registry/updates.d.ts +3 -3
  243. package/dist/registry/updates.d.ts.map +1 -1
  244. package/dist/registry/updates.js.map +1 -1
  245. package/dist/registry/urls.d.ts +2 -2
  246. package/dist/registry/urls.d.ts.map +1 -1
  247. package/dist/registry/urls.js.map +1 -1
  248. package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
  249. package/dist/{types-C1in4fl3.d.ts → types-Bsp8VL2y.d.ts} +2 -2
  250. package/dist/types-Bsp8VL2y.d.ts.map +1 -0
  251. package/dist/types-D2IwhfT4.d.ts +5688 -0
  252. package/dist/types-D2IwhfT4.d.ts.map +1 -0
  253. package/dist/{types-DDpRvBK_.d.ts → types-ZkfQLcTZ.d.ts} +39 -43
  254. package/dist/types-ZkfQLcTZ.d.ts.map +1 -0
  255. package/dist/{utils-aaTmfxFW.js → utils-DiV32YIj.js} +53 -3
  256. package/dist/utils-DiV32YIj.js.map +1 -0
  257. package/dist/utils-MrLmLEVr.js +78 -0
  258. package/dist/utils-MrLmLEVr.js.map +1 -0
  259. package/dist/version-BxLITo9P.d.ts +6 -0
  260. package/dist/version-BxLITo9P.d.ts.map +1 -0
  261. package/package.json +34 -7
  262. package/dist/clis/args/access-token--9H57y8J.d.mts +0 -18
  263. package/dist/clis/args/access-token--9H57y8J.d.mts.map +0 -1
  264. package/dist/clis/args/access-token-To5LaIfL.mjs +0 -22
  265. package/dist/clis/args/access-token-To5LaIfL.mjs.map +0 -1
  266. package/dist/clis/args/common-CcYbXrBx.mjs.map +0 -1
  267. package/dist/clis/args/common-Dsf1vpHV.d.mts +0 -183
  268. package/dist/clis/args/common-Dsf1vpHV.d.mts.map +0 -1
  269. package/dist/clis/args/connect-BVVvCmL9.mjs +0 -198
  270. package/dist/clis/args/connect-BVVvCmL9.mjs.map +0 -1
  271. package/dist/clis/args/connect-DetTnI8g.d.mts +0 -443
  272. package/dist/clis/args/connect-DetTnI8g.d.mts.map +0 -1
  273. package/dist/clis/args/generate-CA916Fvj.mjs.map +0 -1
  274. package/dist/clis/args/generate-DnV-bfXt.d.mts +0 -87
  275. package/dist/clis/args/generate-DnV-bfXt.d.mts.map +0 -1
  276. package/dist/clis/args/help-Bqbgbalu.mjs.map +0 -1
  277. package/dist/clis/args/help-CjAsudUn.d.mts +0 -193
  278. package/dist/clis/args/help-CjAsudUn.d.mts.map +0 -1
  279. package/dist/clis/args/init-CUXyfquF.d.mts +0 -55
  280. package/dist/clis/args/init-CUXyfquF.d.mts.map +0 -1
  281. package/dist/clis/args/init-rz9Ei7nq.mjs +0 -67
  282. package/dist/clis/args/init-rz9Ei7nq.mjs.map +0 -1
  283. package/dist/clis/args/inspect-DtZeoA5c.d.mts +0 -15
  284. package/dist/clis/args/inspect-DtZeoA5c.d.mts.map +0 -1
  285. package/dist/clis/args/inspect-tckH8mSw.mjs +0 -15
  286. package/dist/clis/args/inspect-tckH8mSw.mjs.map +0 -1
  287. package/dist/clis/args/install-CkP8zcHb.d.mts +0 -40
  288. package/dist/clis/args/install-CkP8zcHb.d.mts.map +0 -1
  289. package/dist/clis/args/install-Sz2DlCHh.mjs +0 -32
  290. package/dist/clis/args/install-Sz2DlCHh.mjs.map +0 -1
  291. package/dist/clis/args/list-BGf8s_gj.d.mts +0 -12
  292. package/dist/clis/args/list-BGf8s_gj.d.mts.map +0 -1
  293. package/dist/clis/args/list-DM2d6f1m.mjs +0 -7
  294. package/dist/clis/args/list-DM2d6f1m.mjs.map +0 -1
  295. package/dist/clis/args/login-DNsHwvqk.d.mts +0 -27
  296. package/dist/clis/args/login-DNsHwvqk.d.mts.map +0 -1
  297. package/dist/clis/args/login-DiKT5Jfu.mjs +0 -40
  298. package/dist/clis/args/login-DiKT5Jfu.mjs.map +0 -1
  299. package/dist/clis/args/magic-string.es-h_0HDQBQ.mjs +0 -1013
  300. package/dist/clis/args/magic-string.es-h_0HDQBQ.mjs.map +0 -1
  301. package/dist/clis/args/migrate-CG_gWc4k.mjs +0 -29
  302. package/dist/clis/args/migrate-CG_gWc4k.mjs.map +0 -1
  303. package/dist/clis/args/migrate-sixkWhxm.d.mts +0 -21
  304. package/dist/clis/args/migrate-sixkWhxm.d.mts.map +0 -1
  305. package/dist/clis/args/publish-DDZYsUfV.mjs +0 -19
  306. package/dist/clis/args/publish-DDZYsUfV.mjs.map +0 -1
  307. package/dist/clis/args/publish-Dqe5DUst.d.mts +0 -18
  308. package/dist/clis/args/publish-Dqe5DUst.d.mts.map +0 -1
  309. package/dist/clis/args/registry-C_OVFQmI.mjs +0 -23
  310. package/dist/clis/args/registry-C_OVFQmI.mjs.map +0 -1
  311. package/dist/clis/args/registry-C_RfTsKB.d.mts +0 -19
  312. package/dist/clis/args/registry-C_RfTsKB.d.mts.map +0 -1
  313. package/dist/clis/args/service-CHOOr0Gg.mjs +0 -11
  314. package/dist/clis/args/service-CHOOr0Gg.mjs.map +0 -1
  315. package/dist/clis/args/service-DhIkf8-O.d.mts +0 -22
  316. package/dist/clis/args/service-DhIkf8-O.d.mts.map +0 -1
  317. package/dist/clis/args/switchboard-BlPaq2at.d.mts +0 -72
  318. package/dist/clis/args/switchboard-BlPaq2at.d.mts.map +0 -1
  319. package/dist/clis/args/switchboard-Dsp7nosi.mjs +0 -85
  320. package/dist/clis/args/switchboard-Dsp7nosi.mjs.map +0 -1
  321. package/dist/clis/args/uninstall-BpA3YYbw.d.mts +0 -31
  322. package/dist/clis/args/uninstall-BpA3YYbw.d.mts.map +0 -1
  323. package/dist/clis/args/uninstall-CTwTX0u_.mjs +0 -16
  324. package/dist/clis/args/uninstall-CTwTX0u_.mjs.map +0 -1
  325. package/dist/clis/args/unpublish-BPMkGEg5.mjs +0 -30
  326. package/dist/clis/args/unpublish-BPMkGEg5.mjs.map +0 -1
  327. package/dist/clis/args/unpublish-CvwaIimG.d.mts +0 -24
  328. package/dist/clis/args/unpublish-CvwaIimG.d.mts.map +0 -1
  329. package/dist/clis/args/vetra-DLQ6lhLl.d.mts +0 -113
  330. package/dist/clis/args/vetra-DLQ6lhLl.d.mts.map +0 -1
  331. package/dist/clis/args/vetra-b4KUu1Ax.mjs.map +0 -1
  332. package/dist/clis/args/vetra-ports.test.d.mts +0 -1
  333. package/dist/clis/args/vetra-ports.test.mjs +0 -13249
  334. package/dist/clis/args/vetra-ports.test.mjs.map +0 -1
  335. package/dist/clis/build-config.mjs.map +0 -1
  336. package/dist/clis/constants.d.mts.map +0 -1
  337. package/dist/config-loader-B845Hidf.js.map +0 -1
  338. package/dist/constants-BP_gjn8g.d.ts +0 -8
  339. package/dist/constants-BP_gjn8g.d.ts.map +0 -1
  340. package/dist/document-model/index.js.map +0 -1
  341. package/dist/index-C_iVZe7f.d.ts +0 -7
  342. package/dist/index-C_iVZe7f.d.ts.map +0 -1
  343. package/dist/index-DP3QgHTq.d.ts +0 -836
  344. package/dist/index-DP3QgHTq.d.ts.map +0 -1
  345. package/dist/types-BIoOWpOT.d.ts +0 -3172
  346. package/dist/types-BIoOWpOT.d.ts.map +0 -1
  347. package/dist/types-C1in4fl3.d.ts.map +0 -1
  348. package/dist/types-DDpRvBK_.d.ts.map +0 -1
  349. package/dist/utils-DP122OSS.d.ts +0 -18
  350. package/dist/utils-DP122OSS.d.ts.map +0 -1
  351. package/dist/utils-aaTmfxFW.js.map +0 -1
@@ -1,3172 +0,0 @@
1
- import { f as IAnalyticsStore } from "./types-C1in4fl3.js";
2
- import { ZodRawShape, z } from "zod";
3
- import { Draft } from "mutative";
4
- import * as cmd_ts_dist_cjs_argparser_js0 from "cmd-ts/dist/cjs/argparser.js";
5
- import { ArgParser } from "cmd-ts/dist/cjs/argparser.js";
6
- import * as cmd_ts_dist_cjs_helpdoc_js0 from "cmd-ts/dist/cjs/helpdoc.js";
7
- import * as cmd_ts_dist_cjs_runner_js0 from "cmd-ts/dist/cjs/runner.js";
8
- import { Agent } from "package-manager-detector";
9
- import { OperationWithContext } from "@powerhousedao/shared/document-model";
10
- import { Kysely, QueryCreator } from "kysely";
11
- import { IncomingMessage, ServerResponse } from "node:http";
12
- import { FC, ReactNode } from "react";
13
-
14
- //#region clis/args/common.d.ts
15
- declare const getPackageManagerCommand: Partial<cmd_ts_dist_cjs_argparser_js0.Register> & {
16
- parse(context: cmd_ts_dist_cjs_argparser_js0.ParseContext): Promise<cmd_ts_dist_cjs_argparser_js0.ParsingResult<{
17
- packageManager: Agent | undefined;
18
- npm: boolean | undefined;
19
- pnpm: boolean | undefined;
20
- yarn: boolean | undefined;
21
- bun: boolean | undefined;
22
- }>>;
23
- } & cmd_ts_dist_cjs_helpdoc_js0.PrintHelp & cmd_ts_dist_cjs_helpdoc_js0.ProvidesHelp & cmd_ts_dist_cjs_helpdoc_js0.Named & Partial<cmd_ts_dist_cjs_helpdoc_js0.Versioned> & cmd_ts_dist_cjs_argparser_js0.Register & cmd_ts_dist_cjs_runner_js0.Handling<{
24
- packageManager: Agent | undefined;
25
- npm: boolean | undefined;
26
- pnpm: boolean | undefined;
27
- yarn: boolean | undefined;
28
- bun: boolean | undefined;
29
- }, {
30
- packageManager: Agent | undefined;
31
- npm: boolean | undefined;
32
- pnpm: boolean | undefined;
33
- yarn: boolean | undefined;
34
- bun: boolean | undefined;
35
- }> & {
36
- run(context: cmd_ts_dist_cjs_argparser_js0.ParseContext): Promise<cmd_ts_dist_cjs_argparser_js0.ParsingResult<{
37
- packageManager: Agent | undefined;
38
- npm: boolean | undefined;
39
- pnpm: boolean | undefined;
40
- yarn: boolean | undefined;
41
- bun: boolean | undefined;
42
- }>>;
43
- } & Partial<cmd_ts_dist_cjs_helpdoc_js0.Versioned & cmd_ts_dist_cjs_helpdoc_js0.Descriptive & cmd_ts_dist_cjs_helpdoc_js0.Aliased>;
44
- //#endregion
45
- //#region processors/constants.d.ts
46
- declare const PROCESSOR_APPS: readonly ["connect", "switchboard"];
47
- declare const DEFAULT_RELATIONAL_PROCESSOR_DB_NAME = "relational-db";
48
- declare const DEFAULT_ANALYTICS_PROCESSOR_DB_NAME = "analytics-db";
49
- //#endregion
50
- //#region document-model/signatures.d.ts
51
- type Signature = [string, string, string, string, string];
52
- /**
53
- * A user action signer.
54
- */
55
- type UserActionSigner = {
56
- address: string;
57
- networkId: string;
58
- chainId: number;
59
- };
60
- /**
61
- * An app action signer.
62
- */
63
- type AppActionSigner = {
64
- name: string;
65
- key: string;
66
- };
67
- /**
68
- * An action signer.
69
- */
70
- type ActionSigner = {
71
- user: UserActionSigner;
72
- app: AppActionSigner;
73
- signatures: Signature[];
74
- };
75
- /**
76
- * Information to verify the document creator.
77
- */
78
- type PHDocumentSignatureInfo = {
79
- /**
80
- * The public key of the document creator.
81
- **/
82
- publicKey: JsonWebKey; /** The nonce that was appended to the message to create the signature. */
83
- nonce: string;
84
- };
85
- /** Joins a signature's params for transport. Already-joined input passes through. */
86
- declare function serializeSignature(signature: Signature | string): string;
87
- /**
88
- * Splits a transported signature back into its params. A tuple passes through.
89
- *
90
- * Short input is padded rather than refused: verification reads the params by
91
- * position and fails on a wrong one, which says more than a length complaint
92
- * raised here would.
93
- */
94
- declare function deserializeSignature(signature: Signature | string): Signature;
95
- /**
96
- * Configuration for hashing document state in operations.
97
- */
98
- type HashConfig = {
99
- /** The hashing algorithm to use (e.g., "sha1", "sha256") */algorithm: string; /** The encoding format for the hash output (e.g., "base64", "hex") */
100
- encoding: string; /** Optional algorithm-specific parameters */
101
- params?: Record<string, unknown>;
102
- };
103
- //#endregion
104
- //#region document-model/state.d.ts
105
- /**
106
- * Creates a default PHAuthState
107
- */
108
- declare function defaultAuthState(): PHAuthState;
109
- /**
110
- * Creates a default PHDocumentState
111
- */
112
- declare function defaultDocumentState(): PHDocumentState;
113
- /**
114
- * Creates a default PHBaseState with auth and document properties
115
- */
116
- declare function defaultBaseState(): PHBaseState;
117
- /**
118
- * Creates a PHAuthState with the given properties
119
- */
120
- declare function createAuthState(auth?: Partial<PHAuthState>): PHAuthState;
121
- /**
122
- * Creates a PHDocumentState with the given properties
123
- */
124
- declare function createDocumentState(document?: Partial<PHDocumentState>): PHDocumentState;
125
- /**
126
- * Creates a PHBaseState with the given auth and document properties
127
- */
128
- declare function createBaseState(auth?: Partial<PHAuthState>, document?: Partial<PHDocumentState>): PHBaseState;
129
- /**
130
- * Backfills the auth scope to the default for legacy documents serialized with
131
- * an empty `auth`. Replaces only `state.auth`. Idempotent.
132
- */
133
- declare function backfillAuthState<TState extends PHBaseState>(state: TState): TState;
134
- /**
135
- * The document state of the document.
136
- */
137
- type PHDocumentState = {
138
- /**
139
- * The current document model schema version of the document. This is used
140
- * with the UPGRADE_DOCUMENT operation to specify the DocumentModelModule
141
- * version to use for reducer execution.
142
- */
143
- version: number; /** Hash configuration for operation state verification */
144
- hash: HashConfig; /** True if and only if the document has been deleted */
145
- isDeleted?: boolean; /** The timestamp when the document was deleted, in UTC ISO format */
146
- deletedAtUtcIso?: string; /** Optional: who deleted the document */
147
- deletedBy?: string; /** Optional: reason for deletion */
148
- deletionReason?: string;
149
- };
150
- /**
151
- * The document's authorization policy: an ordered, stacked list of grants,
152
- * where the last matching grant wins. `{ version: 0, grants: [] }` is
153
- * uninitialized and leaves the document open.
154
- */
155
- type PHAuthState = {
156
- /**
157
- * Policy language version. 0 is the uninitialized state; INITIALIZE_AUTH
158
- * sets an integer >= 1.
159
- */
160
- version: number;
161
- grants: Grant[];
162
- /**
163
- * The did:key of the auth-policy creator, captured from the INITIALIZE_AUTH
164
- * signer. The creator may always administer the auth scope, so a grant policy
165
- * can never lock administration out of itself. Absent for an unsigned genesis.
166
- */
167
- creator?: string;
168
- };
169
- type Grant = {
170
- /** Stable id. */id: string;
171
- description: string;
172
- effect: "allow" | "deny";
173
- principal: Principal;
174
- capability: Capability;
175
- /**
176
- * The grant applies only when this condition holds. Until conditions are
177
- * evaluated, a grant carrying one never applies.
178
- */
179
- where?: Condition;
180
- };
181
- type Principal = {
182
- anyone: true;
183
- } | {
184
- address: string;
185
- } | {
186
- group: string;
187
- } | {
188
- match: Condition;
189
- };
190
- /**
191
- * The folded global state of a PHGroup (powerhouse/reactor-group) document,
192
- * narrowed to what auth evaluation reads. Membership is matched
193
- * case-insensitively against the subject's address.
194
- */
195
- type PHGroupState = {
196
- members: string[];
197
- };
198
- /**
199
- * Folded group states keyed by group document id, as the groups projection
200
- * provides them. A group id a policy names but the map does not hold fails
201
- * closed: the principal does not match.
202
- */
203
- type AuthGroups = Record<string, PHGroupState>;
204
- type Capability = {
205
- can: "read";
206
- scope?: string;
207
- } | {
208
- can: "execute";
209
- scope?: string;
210
- operation?: string[];
211
- };
212
- /**
213
- * Boolean condition language for grants: deterministic, total, and
214
- * JSON-serializable, versioned by `PHAuthState.version`. Defined now but not
215
- * yet evaluated or enforced.
216
- */
217
- type Condition = {
218
- eq: [Operand, Operand];
219
- } | {
220
- ne: [Operand, Operand];
221
- } | {
222
- in: [Operand, Operand[]];
223
- } | {
224
- notIn: [Operand, Operand[]];
225
- } | {
226
- lt: [Operand, Operand];
227
- } | {
228
- lte: [Operand, Operand];
229
- } | {
230
- gt: [Operand, Operand];
231
- } | {
232
- gte: [Operand, Operand];
233
- } | {
234
- exists: Operand;
235
- } | {
236
- and: Condition[];
237
- } | {
238
- or: Condition[];
239
- } | {
240
- not: Condition;
241
- };
242
- /**
243
- * A condition operand: `attr` is a dotted path into the decision context
244
- * (e.g. "doc.global.status", "subject.address"); `lit` is a constant value.
245
- */
246
- type Operand = {
247
- attr: string;
248
- } | {
249
- lit: string | number | boolean | null;
250
- };
251
- /**
252
- * The base state of the document.
253
- */
254
- type PHBaseState = {
255
- /** Carries authentication information. */auth: PHAuthState; /** Carries information about the document. */
256
- document: PHDocumentState;
257
- };
258
- declare function defaultGlobalState(): DocumentModelGlobalState;
259
- declare function defaultLocalState(): DocumentModelLocalState;
260
- declare function defaultPHState(): DocumentModelPHState;
261
- declare function createGlobalState(state?: Partial<DocumentModelGlobalState>): DocumentModelGlobalState;
262
- declare function createLocalState(state?: Partial<DocumentModelLocalState>): DocumentModelLocalState;
263
- declare function createState(baseState?: Partial<PHBaseState>, globalState?: Partial<DocumentModelGlobalState>, localState?: Partial<DocumentModelLocalState>): DocumentModelPHState;
264
- //#endregion
265
- //#region document-model/operations.d.ts
266
- declare function setNameOperation<TDocument extends PHDocument>(document: TDocument, input: {
267
- name: string;
268
- }): TDocument & {
269
- header: {
270
- name: string;
271
- id: string;
272
- sig: PHDocumentSignatureInfo;
273
- documentType: string;
274
- createdAtUtcIso: string;
275
- slug: string;
276
- branch: string;
277
- revision: {
278
- [scope: string]: number;
279
- };
280
- lastModifiedAtUtcIso: string;
281
- protocolVersions?: {
282
- [key: string]: number;
283
- };
284
- meta?: PHDocumentMeta;
285
- };
286
- };
287
- declare function setPreferredEditorOperation<TDocument extends PHDocument>(document: TDocument, input: {
288
- preferredEditor: string | null;
289
- }): TDocument;
290
- declare function undoOperation<TDocument extends PHDocument>(document: TDocument, action: Action, skip: number): {
291
- document: TDocument;
292
- action: Action;
293
- skip: number;
294
- reuseLastOperationIndex: boolean;
295
- };
296
- /**
297
- * V2 of undoOperation for protocol version 2+.
298
- * Key differences from undoOperation:
299
- * - Never reuses operation index (always increments)
300
- * - Always sets skip=1 (consecutive NOOPs are handled during rebuild/GC)
301
- * - No complex skip calculation - simpler model where each UNDO is independent
302
- */
303
- declare function undoOperationV2<TDocument extends PHDocument>(document: TDocument, action: Action, skip: number): {
304
- document: TDocument;
305
- action: Action;
306
- skip: number;
307
- reuseLastOperationIndex: false;
308
- };
309
- declare function redoOperation<TDocument extends PHDocument>(document: TDocument, action: Action, skip: number): {
310
- document: TDocument;
311
- action: Action;
312
- skip: number;
313
- reuseLastOperationIndex: boolean;
314
- };
315
- declare function loadStateOperation<TState extends PHBaseState>(document: PHDocument<TState>, action: LoadStateActionInput): PHDocument<TState>;
316
- /**
317
- * An operation that was applied to a {@link BaseDocument}.
318
- *
319
- * @remarks
320
- * Wraps an action with an index, to be added to the operations history of a Document.
321
- * The `index` field is used to keep all operations in order and enable replaying the
322
- * document's history from the beginning. Note that indices and skips are relative to
323
- * a specific reactor. Example below:
324
- *
325
- * For (index, skip, ts, action)
326
- * A - [(0, 0, 1, "A0"), (1, 0, 2, "A1")]
327
- * B - [(0, 0, 0, "B0"), (1, 0, 3, "B1")]
328
- * ...
329
- * B gets A's Operations Scenario:
330
- * B' - [(0, 0, 0, "B0"), (1, 0, 3, "B1"), (2, 1, 1, "A0"), (3, 0, 2, "A1"), (4, 0, 3, "B1")]
331
- * Then A needs to end up with:
332
- * A' - [(0, 0, 1, "A0"), (1, 0, 2, "A1"), (2, 2, 0, "B0"), (3, 0, 1, "A0"), (4, 0, 2, "A1"), (5, 0, 3, "B1")]
333
- * So that both A and B end up with the stream of actions (action):
334
- * [("B0"), ("A0"), ("A1"), ("B1")]
335
- *
336
- * @typeParam A - The type of the action.
337
- */
338
- type Operation = {
339
- /**
340
- * This is a stable id, derived from various document and action properties
341
- * in deriveOperationId().
342
- *
343
- * It _cannot_ be an arbitrary string.
344
- *
345
- * It it also not unique per operation, as reshuffled operations will keep'
346
- * the same id they had before they were reshuffled. This means that the
347
- * IOperationStore may have multiple operations with the same operation id.
348
- **/
349
- id: string; /** Position of the operation in the history. This is relative to a specific reactor -- they may not all agree on this value. */
350
- index: number; /** The number of operations skipped with this Operation. This is relative to a specific reactor -- they may not all agree on this value. */
351
- skip: number; /** Timestamp of when the operation was added */
352
- timestampUtcMs: string; /** Hash of the resulting document data after the operation */
353
- hash: string; /** Error message for a failed action */
354
- error?: string;
355
- /**
356
- * If authorization rejected the action, this records the reason why.
357
- */
358
- deniedReason?: string; /** The resulting state after the operation */
359
- resultingState?: string;
360
- /**
361
- * The action that was applied to the document to produce this operation.
362
- */
363
- action: Action;
364
- };
365
- /**
366
- * The operations history of the document by scope.
367
- *
368
- * This will be removed in a future release.
369
- *
370
- * TODO: Type should be Partial<Record<string, Operation[]>>,
371
- * but that is a breaking change for codegen + external doc models.
372
- */
373
- type DocumentOperations = Record<string, Operation[]>;
374
- /**
375
- * What happened to an operation. An operation that is not `applied` still
376
- * occupies its index but contributes nothing to the document's state.
377
- */
378
- type OperationOutcome = {
379
- kind: "applied";
380
- } | {
381
- kind: "reducer-error";
382
- message: string;
383
- } | {
384
- kind: "denied";
385
- reason: string;
386
- };
387
- /**
388
- * Reads an operation's outcome. A denial takes precedence over a reducer
389
- * error, since a denied operation never reaches its reducer.
390
- */
391
- declare function operationOutcome(operation: Operation): OperationOutcome;
392
- type OperationContext = {
393
- documentId: string;
394
- documentType: string;
395
- scope: string;
396
- branch: string;
397
- resultingState?: string;
398
- ordinal: number;
399
- };
400
- type OperationWithContext$1 = {
401
- operation: Operation;
402
- context: OperationContext;
403
- };
404
- //#endregion
405
- //#region document-model/documents.d.ts
406
- /** Meta information about the document. */
407
- type PHDocumentMeta = {
408
- /** The preferred editor for the document. */preferredEditor?: string;
409
- };
410
- /**
411
- * The header of a document.
412
- */
413
- type PHDocumentHeader = {
414
- /**
415
- * The id of the document.
416
- *
417
- * This is a Ed25519 signature and is immutable.
418
- **/
419
- id: string;
420
- /**
421
- * Information to verify the document creator.
422
- *
423
- * This is immutable.
424
- **/
425
- sig: PHDocumentSignatureInfo;
426
- /**
427
- * The type of the document.
428
- *
429
- * This is used as part of the signature payload and thus, cannot be changed
430
- * after the document header has been created.
431
- **/
432
- documentType: string;
433
- /**
434
- * The timestamp of the creation date of the document, in UTC ISO format.
435
- *
436
- * This is used as part of the signature payload and thus, cannot be changed
437
- * after the document header has been created.
438
- **/
439
- createdAtUtcIso: string; /** The slug of the document. */
440
- slug: string; /** The name of the document. */
441
- name: string; /** The branch of this document. */
442
- branch: string;
443
- /**
444
- * The revision of each scope of the document. This object is updated every
445
- * time any _other_ scope is updated.
446
- */
447
- revision: {
448
- [scope: string]: number;
449
- };
450
- /**
451
- * The timestamp of the last change in the document, in UTC ISO format.
452
- **/
453
- lastModifiedAtUtcIso: string;
454
- /**
455
- * This is a map from protocol name to version. A protocol can be any set of
456
- * rules that are applied to the document.
457
- *
458
- * Examples of protocols include:
459
- *
460
- * - "base-reducer"
461
- */
462
- protocolVersions?: {
463
- [key: string]: number;
464
- }; /** Meta information about the document. */
465
- meta?: PHDocumentMeta;
466
- };
467
- /**
468
- * The base type of a document model.
469
- *
470
- * @remarks
471
- * This type is extended by all Document models.
472
- *
473
- * @typeParam TState - The type of the document state.
474
- */
475
- type PHDocument<TState extends PHBaseState = PHBaseState> = {
476
- /** The header of the document. */header: PHDocumentHeader; /** The document model specific state. */
477
- state: TState;
478
- /**
479
- * The initial state of the document, enabling replaying operations.
480
- *
481
- * This will be removed in a future release.
482
- */
483
- initialState: TState;
484
- /**
485
- * The operations history of the document.
486
- *
487
- * This will be removed in a future release.
488
- */
489
- operations: DocumentOperations;
490
- /**
491
- * A list of undone operations
492
- *
493
- * This will be removed in a future release.
494
- */
495
- clipboard: Operation[];
496
- };
497
- declare function isNoopOperation<TOp extends {
498
- type: string;
499
- skip: number;
500
- hash: string;
501
- }>(op: Partial<TOp>): boolean;
502
- declare function isUndoRedo(action: Action): action is UndoRedoAction;
503
- declare function isUndo(action: Action): action is UndoAction;
504
- declare function isDocumentAction(action: Action): action is DocumentAction;
505
- /**
506
- * Creates a new document. When `documentType` is given the header is stamped
507
- * with it and the document-scope operations are seeded.
508
- */
509
- declare function baseCreateDocument<TState extends PHBaseState = PHBaseState>(createState: CreateState<TState>, initialState?: Partial<TState>, documentType?: string): PHDocument<TState>;
510
- declare function hashDocumentStateForScope(document: {
511
- state: {
512
- [key: string]: unknown;
513
- };
514
- }, scope?: string): string;
515
- declare function readOnly<T>(value: T): Readonly<T>;
516
- /**
517
- * Maps skipped operations in an array of operations.
518
- * Skipped operations are operations that are ignored during processing.
519
- * @param operations - The array of operations to map.
520
- * @param skippedHeadOperations - The number of operations to skip at the head of the array of operations.
521
- * @returns An array of mapped operations with ignore flag indicating if the operation is skipped.
522
- * @throws Error if the operation index is invalid and there are missing operations.
523
- */
524
- declare function mapSkippedOperations(operations: Operation[], skippedHeadOperations?: number): MappedOperation[];
525
- /**
526
- * V2 version of mapSkippedOperations for protocol version 2+.
527
- * In V2, all NOOPs have skip=1 and consecutive NOOPs form chains.
528
- * N consecutive NOOPs at any point skip N preceding content operations.
529
- *
530
- * Algorithm: Process from end to start
531
- * - When hitting a NOOP: increment chain length, mark as ignored
532
- * - When hitting a non-NOOP:
533
- * - If chain > 0: decrement chain, mark as ignored (this op was undone)
534
- * - If chain == 0: mark as not ignored (apply this op)
535
- */
536
- declare function mapSkippedOperationsV2(operations: Operation[]): MappedOperation[];
537
- /**
538
- * V2 garbage collect that returns only operations that should be applied for state.
539
- * Uses the V2 model where consecutive NOOPs form chains.
540
- * Unlike V1 garbageCollect, this preserves ALL operations but marks which to apply.
541
- */
542
- /**
543
- * The base-reducer protocol version a document is written against. Every
544
- * document carries one, set from the CREATE_DOCUMENT input. A header without
545
- * one was built outside that path, and choosing a version on its behalf would
546
- * replay the document through a reducer it was not written for, so it is an
547
- * error rather than a default.
548
- */
549
- declare function baseReducerVersion(header: PHDocumentHeader): number;
550
- declare function garbageCollectV2<TOpIndex extends OperationIndex>(sortedOperations: TOpIndex[]): TOpIndex[];
551
- declare function sortMappedOperations(operations: DocumentOperationsIgnoreMap): MappedOperation[];
552
- /**
553
- * Records an operation in the history without applying it, which is what a
554
- * denied operation needs: it occupies its index and contributes no state.
555
- *
556
- * The scope defaults to the action's own, and is passed explicitly by a rebuild
557
- * that is walking one stream and does not want to trust the action's copy.
558
- */
559
- declare function appendWithoutApplying<TState extends PHBaseState>(document: PHDocument<TState>, operation: Operation, scope?: string): PHDocument<TState>;
560
- declare function replayDocument<TState extends PHBaseState = PHBaseState>(initialState: TState, operations: DocumentOperations, reducer: Reducer<TState>, header: PHDocumentHeader, dispatch?: SignalDispatch, skipHeaderOperations?: SkipHeaderOperations, options?: ReplayDocumentOptions): PHDocument<TState>;
561
- declare function parseResultingState<TState>(state: string | null | undefined): TState;
562
- declare enum IntegrityIssueType {
563
- UNEXPECTED_INDEX = "UNEXPECTED_INDEX"
564
- }
565
- declare enum IntegrityIssueSubType {
566
- DUPLICATED_INDEX = "DUPLICATED_INDEX",
567
- MISSING_INDEX = "MISSING_INDEX"
568
- }
569
- type IntegrityIssue = {
570
- operation: OperationIndex;
571
- issue: IntegrityIssueType;
572
- category: IntegrityIssueSubType;
573
- message: string;
574
- };
575
- type Reshuffle = (startIndex: OperationIndex, opsA: Operation[], opsB: Operation[]) => Operation[];
576
- declare function checkCleanedOperationsIntegrity(sortedOperations: OperationIndex[]): IntegrityIssue[];
577
- declare function garbageCollect<TOpIndex extends OperationIndex>(sortedOperations: TOpIndex[]): TOpIndex[];
578
- declare function addUndo(sortedOperations: Operation[]): Operation[];
579
- declare function sortOperations<TOpIndex extends OperationIndex>(operations: TOpIndex[]): TOpIndex[];
580
- declare function reshuffleByTimestamp<TOp extends OperationIndex>(startIndex: OperationIndex, opsA: TOp[], opsB: TOp[]): TOp[];
581
- declare function reshuffleByTimestampAndIndex<TOp extends OperationIndex>(startIndex: OperationIndex, opsA: TOp[], opsB: TOp[]): TOp[];
582
- declare function operationsAreEqual<TOp extends {
583
- index: number;
584
- skip: number;
585
- type?: string;
586
- scope?: string;
587
- input?: unknown;
588
- }>(op1: TOp, op2: TOp): boolean;
589
- declare function attachBranch(trunk: Operation[], newBranch: Operation[]): [Operation[], Operation[]];
590
- declare function precedes(op1: OperationIndex, op2: OperationIndex): boolean;
591
- declare function split(sortedTargetOperations: Operation[], sortedMergeOperations: Operation[]): [Operation[], Operation[], Operation[]];
592
- declare function merge(sortedTargetOperations: Operation[], sortedMergeOperations: Operation[], reshuffle: Reshuffle): Operation[];
593
- declare function nextSkipNumber(sortedOperations: OperationIndex[]): number;
594
- declare function checkOperationsIntegrity(operations: Operation[]): IntegrityIssue[];
595
- declare function groupOperationsByScope(operations: Operation[]): Partial<Record<string, Operation[]>>;
596
- type PrepareOperationsResult = {
597
- validOperations: Operation[];
598
- invalidOperations: Operation[];
599
- duplicatedOperations: Operation[];
600
- integrityIssues: IntegrityIssue[];
601
- };
602
- declare function prepareOperations(operationsHistory: Operation[], newOperations: Operation[]): PrepareOperationsResult;
603
- declare function removeExistingOperations(newOperations: Operation[], operationsHistory: Operation[]): Operation[];
604
- /**
605
- * Skips header operations and returns the remaining operations.
606
- *
607
- * @param operations - The array of operations.
608
- * @param skipHeaderOperation - The skip header operation index.
609
- * @returns The remaining operations after skipping header operations.
610
- */
611
- declare function skipHeaderOperations(operations: Operation[], skipHeaderOperation: SkipHeaderOperationIndex): Operation[];
612
- declare function garbageCollectDocumentOperations(documentOperations: DocumentOperations): DocumentOperations;
613
- /**
614
- * Filters out duplicated operations from the target operations array based on their IDs.
615
- * If an operation has an ID, it is considered duplicated if there is another operation in the source operations array with the same ID.
616
- * If an operation does not have an ID, it is considered unique and will not be filtered out.
617
- * @param targetOperations - The array of target operations to filter.
618
- * @param sourceOperations - The array of source operations to compare against.
619
- * @returns An array of operations with duplicates filtered out.
620
- */
621
- declare function filterDuplicatedOperations<T extends {
622
- id?: string | number;
623
- }>(targetOperations: T[], sourceOperations: T[]): T[];
624
- declare function filterDocumentOperationsResultingState(documentOperations?: DocumentOperations): {
625
- [x: string]: Operation[] | {
626
- id: string;
627
- index: number;
628
- skip: number;
629
- timestampUtcMs: string;
630
- hash: string;
631
- error?: string;
632
- deniedReason?: string;
633
- action: Action;
634
- }[];
635
- };
636
- /**
637
- * Calculates the difference between two arrays of operations.
638
- * Returns an array of operations that are present in `clearedOperationsA` but not in `clearedOperationsB`.
639
- *
640
- * @template TOp - The type of the operations.
641
- * @param {TOp[]} clearedOperationsA - The first array of operations.
642
- * @param {TOp[]} clearedOperationsB - The second array of operations.
643
- * @returns {TOp[]} - The difference between the two arrays of operations.
644
- */
645
- declare function diffOperations<TOp extends OperationIndex>(clearedOperationsA: TOp[], clearedOperationsB: TOp[]): TOp[];
646
- declare function getDocumentLastModified(document: PHDocument): string;
647
- /**
648
- * Updates the document header with the latest revision number and
649
- * date of last modification.
650
- *
651
- * @param document The current state of the document.
652
- * @param scope The scope of the operation.
653
- * @param lastModifiedTimestamp Optional timestamp to use directly, avoiding a scan of all operations.
654
- * @returns The updated document state.
655
- */
656
- declare function updateHeaderRevision(document: PHDocument, scope: string, lastModifiedTimestamp?: string): PHDocument;
657
- //#endregion
658
- //#region document-model/actions.d.ts
659
- /**
660
- * Cancels the last `count` operations.
661
- *
662
- * @param count - Number of operations to cancel
663
- * @category Actions
664
- */
665
- declare const undo: (count?: number, scope?: string) => UndoAction;
666
- /**
667
- * Cancels the last `count` {@link undo | UNDO} operations.
668
- *
669
- * @param count - Number of UNDO operations to cancel
670
- * @category Actions
671
- */
672
- declare const redo: (count?: number, scope?: string) => RedoAction;
673
- /**
674
- * Joins multiple operations into a single {@link loadState | LOAD_STATE} operation.
675
- *
676
- * @remarks
677
- * Useful to keep operations history smaller. Operations to prune are selected by index,
678
- * similar to the {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice | slice} method in Arrays.
679
- *
680
- * @param start - Index of the first operation to prune
681
- * @param end - Index of the last operation to prune
682
- * @category Actions
683
- */
684
- declare const prune: (start?: number, end?: number, scope?: string) => SchemaPruneAction;
685
- /**
686
- * Replaces the state of the document.
687
- *
688
- * @remarks
689
- * This action shouldn't be used directly. It is dispatched by the {@link prune} action.
690
- *
691
- * @param state - State to be set in the document.
692
- * @param operations - Number of operations that were removed from the previous state.
693
- * @category Actions
694
- */
695
- declare const loadState: <TState extends PHBaseState = PHBaseState>(state: TState & {
696
- name: string;
697
- }, operations: number) => LoadStateAction;
698
- declare const noop: (scope?: string) => NOOPAction;
699
- /**
700
- * Helper function to be used by action creators.
701
- *
702
- * @remarks
703
- * Creates an action with the given type and input properties. The input
704
- * properties default to an empty object.
705
- *
706
- * @typeParam A - Type of the action to be returned.
707
- *
708
- * @param type - The type of the action.
709
- * @param input - The input properties of the action.
710
- * @param _attachments - Deprecated and ignored. Retained so action creators
711
- * generated before the attachment-system removal keep their 5-argument shape.
712
- * @param validator - The validator to use for the input properties.
713
- * @param scope - The scope of the action, can either be 'global' or 'local'.
714
- *
715
- * @throws Error if the type is empty or not a string.
716
- *
717
- * @returns The new action.
718
- */
719
- declare function createAction<TAction extends Action>(type: TAction["type"], input?: TAction["input"], _attachments?: unknown, validator?: () => {
720
- parse(v: unknown): TAction["input"];
721
- }, scope?: Action["scope"]): TAction;
722
- /**
723
- * This function should be used instead of { ...action } to ensure
724
- * that extra properties are not included in the action.
725
- */
726
- declare const actionFromAction: (action: Action) => Action;
727
- declare const operationFromAction: (action: Action, index: number, skip: number, context: OperationContext) => Operation;
728
- declare const operationFromOperation: (operation: Operation, index: number, skip: number, context: OperationContext) => Operation;
729
- declare const operationWithContext: (operation: Operation, context: ActionContext) => Operation;
730
- declare const actionContext: () => ActionContext;
731
- declare const actionSigner: (user: UserActionSigner, app: AppActionSigner, signatures?: Signature[]) => ActionSigner;
732
- declare function buildOperationSignature(context: ActionSignatureContext, signMethod: ActionSigningHandler): Promise<Signature>;
733
- declare function buildSignedAction<TState extends PHBaseState = PHBaseState>(action: Action, reducer: Reducer<TState>, document: PHDocument<TState>, signer: ActionSigner, signHandler: ActionSigningHandler): Promise<Operation>;
734
- declare function verifyOperationSignature(signature: Signature, signer: Omit<ActionSigner, "signatures">, verifyHandler: ActionVerificationHandler): Promise<boolean>;
735
- /**
736
- * Changes the name of the document.
737
- *
738
- * @param name - The name to be set in the document.
739
- * @category Actions
740
- */
741
- declare const setName: (name: string | {
742
- name: string;
743
- }) => SetNameAction;
744
- /**
745
- * Changes the preferred editor recorded in the document header meta.
746
- *
747
- * Passing `null` clears the preferred editor.
748
- *
749
- * @category Actions
750
- */
751
- declare const setPreferredEditor: (input: string | null | {
752
- preferredEditor: string | null;
753
- }) => SetPreferredEditorAction;
754
- declare const setModelName: (input: SetModelNameInput) => SetModelNameAction;
755
- declare const setModelId: (input: SetModelIdInput) => SetModelIdAction;
756
- declare const setModelExtension: (input: SetModelExtensionInput) => SetModelExtensionAction;
757
- declare const setModelDescription: (input: SetModelDescriptionInput) => SetModelDescriptionAction;
758
- declare const setAuthorName: (input: SetAuthorNameInput) => SetAuthorNameAction;
759
- declare const setAuthorWebsite: (input: SetAuthorWebsiteInput) => SetAuthorWebsiteAction;
760
- declare const addModule: (input: AddModuleInput) => AddModuleAction;
761
- declare const setModuleName: (input: SetModuleNameInput) => SetModuleNameAction;
762
- declare const setModuleDescription: (input: SetModuleDescriptionInput) => SetModuleDescriptionAction;
763
- declare const deleteModule: (input: DeleteModuleInput) => DeleteModuleAction;
764
- declare const reorderModules: (input: ReorderModulesInput) => ReorderModulesAction;
765
- declare const addOperation: (input: AddOperationInput) => AddOperationAction;
766
- declare const setOperationName: (input: SetOperationNameInput) => SetOperationNameAction;
767
- declare const setOperationScope: (input: SetOperationScopeInput) => SetOperationScopeAction;
768
- declare const setOperationSchema: (input: SetOperationSchemaInput) => SetOperationSchemaAction;
769
- declare const setOperationDescription: (input: SetOperationDescriptionInput) => SetOperationDescriptionAction;
770
- declare const setOperationTemplate: (input: SetOperationTemplateInput) => SetOperationTemplateAction;
771
- declare const setOperationReducer: (input: SetOperationReducerInput) => SetOperationReducerAction;
772
- declare const moveOperation: (input: MoveOperationInput) => MoveOperationAction;
773
- declare const deleteOperation: (input: DeleteOperationInput) => DeleteOperationAction;
774
- declare const reorderModuleOperations: (input: ReorderModuleOperationsInput) => ReorderModuleOperationsAction;
775
- declare const addOperationError: (input: AddOperationErrorInput) => AddOperationErrorAction;
776
- declare const setOperationErrorCode: (input: SetOperationErrorCodeInput) => SetOperationErrorCodeAction;
777
- declare const setOperationErrorName: (input: SetOperationErrorNameInput) => SetOperationErrorNameAction;
778
- declare const setOperationErrorDescription: (input: SetOperationErrorDescriptionInput) => SetOperationErrorDescriptionAction;
779
- declare const setOperationErrorTemplate: (input: SetOperationErrorTemplateInput) => SetOperationErrorTemplateAction;
780
- declare const deleteOperationError: (input: DeleteOperationErrorInput) => DeleteOperationErrorAction;
781
- declare const reorderOperationErrors: (input: ReorderOperationErrorsInput) => ReorderOperationErrorsAction;
782
- declare const addOperationExample: (input: AddOperationExampleInput) => AddOperationExampleAction;
783
- declare const updateOperationExample: (input: UpdateOperationExampleInput) => UpdateOperationExampleAction;
784
- declare const deleteOperationExample: (input: DeleteOperationExampleInput) => DeleteOperationExampleAction;
785
- declare const reorderOperationExamples: (input: ReorderOperationExamplesInput) => ReorderOperationExamplesAction;
786
- declare const operationExampleCreators: {
787
- addOperationExample: (input: AddOperationExampleInput) => AddOperationExampleAction;
788
- updateOperationExample: (input: UpdateOperationExampleInput) => UpdateOperationExampleAction;
789
- deleteOperationExample: (input: DeleteOperationExampleInput) => DeleteOperationExampleAction;
790
- reorderOperationExamples: (input: ReorderOperationExamplesInput) => ReorderOperationExamplesAction;
791
- };
792
- declare const setStateSchema: (input: SetStateSchemaInput) => SetStateSchemaAction;
793
- declare const setInitialState: (input: SetInitialStateInput) => SetInitialStateAction;
794
- declare const addStateExample: (input: AddStateExampleInput) => AddStateExampleAction;
795
- declare const updateStateExample: (input: UpdateStateExampleInput) => UpdateStateExampleAction;
796
- declare const deleteStateExample: (input: DeleteStateExampleInput) => DeleteStateExampleAction;
797
- declare const reorderStateExamples: (input: ReorderStateExamplesInput) => ReorderStateExamplesAction;
798
- declare const addChangeLogItem: (input: AddChangeLogItemInput) => AddChangeLogItemAction;
799
- declare const updateChangeLogItem: (input: UpdateChangeLogItemInput) => UpdateChangeLogItemAction;
800
- declare const deleteChangeLogItem: (input: DeleteChangeLogItemInput) => DeleteChangeLogItemAction;
801
- declare const reorderChangeLogItems: (input: ReorderChangeLogItemsInput) => ReorderChangeLogItemsAction;
802
- declare const releaseNewVersion: () => ReleaseNewVersionAction;
803
- declare const baseActions: {
804
- setName: (name: string | {
805
- name: string;
806
- }) => SetNameAction;
807
- setPreferredEditor: (input: string | null | {
808
- preferredEditor: string | null;
809
- }) => SetPreferredEditorAction;
810
- undo: (count?: number, scope?: string) => UndoAction;
811
- redo: (count?: number, scope?: string) => RedoAction;
812
- prune: (start?: number, end?: number, scope?: string) => SchemaPruneAction;
813
- loadState: <TState extends PHBaseState = PHBaseState>(state: TState & {
814
- name: string;
815
- }, operations: number) => LoadStateAction;
816
- noop: (scope?: string) => NOOPAction;
817
- };
818
- declare const documentModelActions: {
819
- setModelName: (input: SetModelNameInput) => SetModelNameAction;
820
- setModelId: (input: SetModelIdInput) => SetModelIdAction;
821
- setModelExtension: (input: SetModelExtensionInput) => SetModelExtensionAction;
822
- setModelDescription: (input: SetModelDescriptionInput) => SetModelDescriptionAction;
823
- setAuthorName: (input: SetAuthorNameInput) => SetAuthorNameAction;
824
- setAuthorWebsite: (input: SetAuthorWebsiteInput) => SetAuthorWebsiteAction;
825
- addModule: (input: AddModuleInput) => AddModuleAction;
826
- setModuleName: (input: SetModuleNameInput) => SetModuleNameAction;
827
- setModuleDescription: (input: SetModuleDescriptionInput) => SetModuleDescriptionAction;
828
- deleteModule: (input: DeleteModuleInput) => DeleteModuleAction;
829
- reorderModules: (input: ReorderModulesInput) => ReorderModulesAction;
830
- addOperation: (input: AddOperationInput) => AddOperationAction;
831
- setOperationName: (input: SetOperationNameInput) => SetOperationNameAction;
832
- setOperationScope: (input: SetOperationScopeInput) => SetOperationScopeAction;
833
- setOperationSchema: (input: SetOperationSchemaInput) => SetOperationSchemaAction;
834
- setOperationDescription: (input: SetOperationDescriptionInput) => SetOperationDescriptionAction;
835
- setOperationTemplate: (input: SetOperationTemplateInput) => SetOperationTemplateAction;
836
- setOperationReducer: (input: SetOperationReducerInput) => SetOperationReducerAction;
837
- moveOperation: (input: MoveOperationInput) => MoveOperationAction;
838
- deleteOperation: (input: DeleteOperationInput) => DeleteOperationAction;
839
- reorderModuleOperations: (input: ReorderModuleOperationsInput) => ReorderModuleOperationsAction;
840
- addOperationError: (input: AddOperationErrorInput) => AddOperationErrorAction;
841
- setOperationErrorCode: (input: SetOperationErrorCodeInput) => SetOperationErrorCodeAction;
842
- setOperationErrorName: (input: SetOperationErrorNameInput) => SetOperationErrorNameAction;
843
- setOperationErrorDescription: (input: SetOperationErrorDescriptionInput) => SetOperationErrorDescriptionAction;
844
- setOperationErrorTemplate: (input: SetOperationErrorTemplateInput) => SetOperationErrorTemplateAction;
845
- deleteOperationError: (input: DeleteOperationErrorInput) => DeleteOperationErrorAction;
846
- reorderOperationErrors: (input: ReorderOperationErrorsInput) => ReorderOperationErrorsAction;
847
- addOperationExample: (input: AddOperationExampleInput) => AddOperationExampleAction;
848
- updateOperationExample: (input: UpdateOperationExampleInput) => UpdateOperationExampleAction;
849
- deleteOperationExample: (input: DeleteOperationExampleInput) => DeleteOperationExampleAction;
850
- reorderOperationExamples: (input: ReorderOperationExamplesInput) => ReorderOperationExamplesAction;
851
- setStateSchema: (input: SetStateSchemaInput) => SetStateSchemaAction;
852
- setInitialState: (input: SetInitialStateInput) => SetInitialStateAction;
853
- addStateExample: (input: AddStateExampleInput) => AddStateExampleAction;
854
- updateStateExample: (input: UpdateStateExampleInput) => UpdateStateExampleAction;
855
- deleteStateExample: (input: DeleteStateExampleInput) => DeleteStateExampleAction;
856
- reorderStateExamples: (input: ReorderStateExamplesInput) => ReorderStateExamplesAction;
857
- addChangeLogItem: (input: AddChangeLogItemInput) => AddChangeLogItemAction;
858
- updateChangeLogItem: (input: UpdateChangeLogItemInput) => UpdateChangeLogItemAction;
859
- deleteChangeLogItem: (input: DeleteChangeLogItemInput) => DeleteChangeLogItemAction;
860
- reorderChangeLogItems: (input: ReorderChangeLogItemsInput) => ReorderChangeLogItemsAction;
861
- releaseNewVersion: () => ReleaseNewVersionAction;
862
- };
863
- declare const actions: {
864
- setModelName: (input: SetModelNameInput) => SetModelNameAction;
865
- setModelId: (input: SetModelIdInput) => SetModelIdAction;
866
- setModelExtension: (input: SetModelExtensionInput) => SetModelExtensionAction;
867
- setModelDescription: (input: SetModelDescriptionInput) => SetModelDescriptionAction;
868
- setAuthorName: (input: SetAuthorNameInput) => SetAuthorNameAction;
869
- setAuthorWebsite: (input: SetAuthorWebsiteInput) => SetAuthorWebsiteAction;
870
- addModule: (input: AddModuleInput) => AddModuleAction;
871
- setModuleName: (input: SetModuleNameInput) => SetModuleNameAction;
872
- setModuleDescription: (input: SetModuleDescriptionInput) => SetModuleDescriptionAction;
873
- deleteModule: (input: DeleteModuleInput) => DeleteModuleAction;
874
- reorderModules: (input: ReorderModulesInput) => ReorderModulesAction;
875
- addOperation: (input: AddOperationInput) => AddOperationAction;
876
- setOperationName: (input: SetOperationNameInput) => SetOperationNameAction;
877
- setOperationScope: (input: SetOperationScopeInput) => SetOperationScopeAction;
878
- setOperationSchema: (input: SetOperationSchemaInput) => SetOperationSchemaAction;
879
- setOperationDescription: (input: SetOperationDescriptionInput) => SetOperationDescriptionAction;
880
- setOperationTemplate: (input: SetOperationTemplateInput) => SetOperationTemplateAction;
881
- setOperationReducer: (input: SetOperationReducerInput) => SetOperationReducerAction;
882
- moveOperation: (input: MoveOperationInput) => MoveOperationAction;
883
- deleteOperation: (input: DeleteOperationInput) => DeleteOperationAction;
884
- reorderModuleOperations: (input: ReorderModuleOperationsInput) => ReorderModuleOperationsAction;
885
- addOperationError: (input: AddOperationErrorInput) => AddOperationErrorAction;
886
- setOperationErrorCode: (input: SetOperationErrorCodeInput) => SetOperationErrorCodeAction;
887
- setOperationErrorName: (input: SetOperationErrorNameInput) => SetOperationErrorNameAction;
888
- setOperationErrorDescription: (input: SetOperationErrorDescriptionInput) => SetOperationErrorDescriptionAction;
889
- setOperationErrorTemplate: (input: SetOperationErrorTemplateInput) => SetOperationErrorTemplateAction;
890
- deleteOperationError: (input: DeleteOperationErrorInput) => DeleteOperationErrorAction;
891
- reorderOperationErrors: (input: ReorderOperationErrorsInput) => ReorderOperationErrorsAction;
892
- addOperationExample: (input: AddOperationExampleInput) => AddOperationExampleAction;
893
- updateOperationExample: (input: UpdateOperationExampleInput) => UpdateOperationExampleAction;
894
- deleteOperationExample: (input: DeleteOperationExampleInput) => DeleteOperationExampleAction;
895
- reorderOperationExamples: (input: ReorderOperationExamplesInput) => ReorderOperationExamplesAction;
896
- setStateSchema: (input: SetStateSchemaInput) => SetStateSchemaAction;
897
- setInitialState: (input: SetInitialStateInput) => SetInitialStateAction;
898
- addStateExample: (input: AddStateExampleInput) => AddStateExampleAction;
899
- updateStateExample: (input: UpdateStateExampleInput) => UpdateStateExampleAction;
900
- deleteStateExample: (input: DeleteStateExampleInput) => DeleteStateExampleAction;
901
- reorderStateExamples: (input: ReorderStateExamplesInput) => ReorderStateExamplesAction;
902
- addChangeLogItem: (input: AddChangeLogItemInput) => AddChangeLogItemAction;
903
- updateChangeLogItem: (input: UpdateChangeLogItemInput) => UpdateChangeLogItemAction;
904
- deleteChangeLogItem: (input: DeleteChangeLogItemInput) => DeleteChangeLogItemAction;
905
- reorderChangeLogItems: (input: ReorderChangeLogItemsInput) => ReorderChangeLogItemsAction;
906
- releaseNewVersion: () => ReleaseNewVersionAction;
907
- setName: (name: string | {
908
- name: string;
909
- }) => SetNameAction;
910
- setPreferredEditor: (input: string | null | {
911
- preferredEditor: string | null;
912
- }) => SetPreferredEditorAction;
913
- undo: (count?: number, scope?: string) => UndoAction;
914
- redo: (count?: number, scope?: string) => RedoAction;
915
- prune: (start?: number, end?: number, scope?: string) => SchemaPruneAction;
916
- loadState: <TState extends PHBaseState = PHBaseState>(state: TState & {
917
- name: string;
918
- }, operations: number) => LoadStateAction;
919
- noop: (scope?: string) => NOOPAction;
920
- };
921
- /**
922
- * The context of an action.
923
- */
924
- type ActionContext = {
925
- /** The index of the previous operation, showing intended ordering. */prevOpIndex?: number; /** The hash of the previous operation, showing intended state. */
926
- prevOpHash?: string; /** A nonce, to cover specific signing attacks and to prevent replay attacks from no-ops. */
927
- nonce?: string; /** The signer of the action. */
928
- signer?: ActionSigner;
929
- };
930
- /**
931
- * Defines the basic structure of an action.
932
- */
933
- type Action = {
934
- /** The id of the action. This is distinct from the operation id. */id: string; /** The name of the action. */
935
- type: string; /** The timestamp of the action. */
936
- timestampUtcMs: string; /** The payload of the action. */
937
- input: unknown; /** The scope of the action */
938
- scope: string; /** The context of the action. */
939
- context?: ActionContext;
940
- };
941
- //#endregion
942
- //#region processors/http.d.ts
943
- /** Methods a package route may bind. OPTIONS belongs to the CORS layer. */
944
- type RouteMethod = "DELETE" | "GET" | "HEAD" | "PATCH" | "POST" | "PUT";
945
- interface RouteUser {
946
- address: string;
947
- chainId: number;
948
- networkId: string;
949
- appKey: string;
950
- }
951
- type RouteActor = {
952
- user: RouteUser | undefined;
953
- authEnabled: boolean;
954
- };
955
- type AuthorizerResult = {
956
- authorized: true;
957
- } /** Refused; the scope answers with its own JSON error envelope. */ | {
958
- authorized: false;
959
- status: number;
960
- message: string;
961
- } | {
962
- authorized: false;
963
- response: Response;
964
- };
965
- /** A route-specific gate, for policies the standard modes cannot express. */
966
- type RouteAuthorizer = (req: IncomingMessage) => Promise<AuthorizerResult> | AuthorizerResult;
967
- /** How a route authenticates. */
968
- type RouteAuth = /** Default. A verifiable bearer is required; a caller without one gets 401. */"renown" | "renown-optional" | "public" | RouteAuthorizer;
969
- /** How the request body reaches the handler. */
970
- type RouteBody = /** Default. Buffered, and readable through the Fetch Request. */"parsed" /** Buffered and also handed over as `ctx.rawBody`, byte for byte. */ | "raw" /** Not buffered; the Fetch Request body is the live request stream. */ | "stream" /** The body is not read at all. */ | "none";
971
- interface RouteOptions {
972
- auth?: RouteAuth;
973
- body?: RouteBody;
974
- /** Refuse a body larger than this with 413. Ignored when body is `stream`. */
975
- maxBodyBytes?: number;
976
- /** Serve sub-paths too, not just an exact match. */
977
- prefix?: boolean;
978
- }
979
- /** Where the request reached the host, resolved through any reverse proxy. */
980
- interface RouteTransport {
981
- proto: string;
982
- host: string;
983
- prefix: string;
984
- baseUrl: string;
985
- }
986
- interface RouteContext {
987
- /** Decoded path params. */
988
- params: Record<string, string>;
989
- user: RouteUser | undefined;
990
- authEnabled: boolean;
991
- /** The exact octets received. Present only when body is `raw`. */
992
- rawBody: Buffer | undefined;
993
- /** Aborts when the client disconnects. */
994
- signal: AbortSignal;
995
- transport: RouteTransport;
996
- }
997
- type RouteHandler = (request: Request, ctx: RouteContext) => Response | Promise<Response>;
998
- interface RouteSpec extends RouteOptions {
999
- method: RouteMethod | RouteMethod[];
1000
- /** Relative to the scope: "runs/:id", never "/api/@scope/pkg/runs/:id". */
1001
- path: string;
1002
- handler: RouteHandler;
1003
- }
1004
- interface NodeRouteSpec extends Omit<RouteOptions, "body" | "maxBodyBytes"> {
1005
- method: RouteMethod | RouteMethod[];
1006
- path: string;
1007
- handler: (req: IncomingMessage, res: ServerResponse, ctx: Omit<RouteContext, "rawBody" | "signal">) => void | Promise<void>;
1008
- }
1009
- interface ScopedRouteHandle {
1010
- /** The absolute public URL this route answers on. */
1011
- readonly url: string;
1012
- dispose(): void;
1013
- }
1014
- type WebhookScheme = "none" /** A shared secret presented verbatim. No digest, so no digest options. */ | "token" /** The digest of the body, alone. */ | "hmac" /** That digest behind a label, `sha256=<digest>`. */ | "hmac-prefixed" | "hmac-timestamped";
1015
- /** Hashes a sender may compute the digest with. */
1016
- type WebhookHashAlgorithm = "sha1" | "sha256" | "sha512";
1017
- /** How the digest is written into the header. */
1018
- type WebhookSignatureEncoding = "hex" | "base64";
1019
- interface WebhookVerification {
1020
- scheme: WebhookScheme;
1021
- /** Resolved value, never a reference — the caller resolves refs. */
1022
- secret?: string;
1023
- /** Overrides the scheme's conventional header. */
1024
- header?: string;
1025
- /** Replay window for timestamped schemes. */
1026
- toleranceSeconds?: number;
1027
- algorithm?: WebhookHashAlgorithm;
1028
- /** Defaults to `hex`. Base64 comparison is case-sensitive; hex is not. */
1029
- encoding?: WebhookSignatureEncoding;
1030
- prefix?: string;
1031
- }
1032
- type WebhookField = string | {
1033
- header: string;
1034
- } /** Dot-separated path into the parsed body, e.g. `data.object.id`. */ | {
1035
- body: string;
1036
- };
1037
- interface WebhookRequest {
1038
- /** The caller's own key for this endpoint, e.g. a document id. */
1039
- key: string;
1040
- method: string;
1041
- path: string;
1042
- queryParams: Record<string, string>;
1043
- /** Lowercased, with credentials redacted. */
1044
- headers: Record<string, string>;
1045
- /** The exact bytes received. */
1046
- raw: Buffer;
1047
- /** JSON and form bodies decoded; anything else as text. */
1048
- body: unknown;
1049
- }
1050
- interface WebhookReply {
1051
- status: number;
1052
- body?: string;
1053
- contentType?: string;
1054
- }
1055
- interface WebhookPolicy {
1056
- verify?: WebhookVerification;
1057
- /** Uppercase. Undefined accepts every method. */
1058
- methods?: string[];
1059
- dedupe?: {
1060
- field: WebhookField;
1061
- ttlSeconds?: number;
1062
- };
1063
- challengeField?: WebhookField;
1064
- maxBodyBytes?: number;
1065
- }
1066
- interface WebhookSpec {
1067
- /** Distinguishes several endpoint families within one package. */
1068
- name: string;
1069
- defaults?: WebhookPolicy;
1070
- onRequest: (request: WebhookRequest) => Promise<WebhookReply> | WebhookReply;
1071
- policyFor?: (key: string) => Promise<WebhookPolicy | undefined> | WebhookPolicy | undefined;
1072
- }
1073
- interface WebhookEndpointInfo {
1074
- key: string;
1075
- token: string;
1076
- url: string;
1077
- createdAt: string;
1078
- }
1079
- interface IWebhookEndpoints {
1080
- endpointFor(key: string): Promise<Omit<WebhookEndpointInfo, "key">>;
1081
- revoke(key: string): Promise<void>;
1082
- list(): Promise<WebhookEndpointInfo[]>;
1083
- }
1084
- interface IWebhookScope {
1085
- register(spec: WebhookSpec): Promise<IWebhookEndpoints>;
1086
- readonly hasPublicOrigin: boolean;
1087
- }
1088
- interface IHttpScope {
1089
- readonly owner: string;
1090
- readonly baseUrl: string;
1091
- get(path: string, handler: RouteHandler): ScopedRouteHandle;
1092
- get(path: string, options: RouteOptions, handler: RouteHandler): ScopedRouteHandle;
1093
- post(path: string, handler: RouteHandler): ScopedRouteHandle;
1094
- post(path: string, options: RouteOptions, handler: RouteHandler): ScopedRouteHandle;
1095
- put(path: string, handler: RouteHandler): ScopedRouteHandle;
1096
- put(path: string, options: RouteOptions, handler: RouteHandler): ScopedRouteHandle;
1097
- patch(path: string, handler: RouteHandler): ScopedRouteHandle;
1098
- patch(path: string, options: RouteOptions, handler: RouteHandler): ScopedRouteHandle;
1099
- delete(path: string, handler: RouteHandler): ScopedRouteHandle;
1100
- delete(path: string, options: RouteOptions, handler: RouteHandler): ScopedRouteHandle;
1101
- /** Registered independently of GET: a HEAD response is not a bodyless GET. */
1102
- head(path: string, handler: RouteHandler): ScopedRouteHandle;
1103
- head(path: string, options: RouteOptions, handler: RouteHandler): ScopedRouteHandle;
1104
- route(spec: RouteSpec): ScopedRouteHandle;
1105
- nodeRoute(spec: NodeRouteSpec): ScopedRouteHandle;
1106
- readonly webhooks: IWebhookScope;
1107
- /** Release every route this scope registered. Called on package teardown. */
1108
- dispose(): void;
1109
- }
1110
- //#endregion
1111
- //#region processors/types.d.ts
1112
- type ProcessorDispatchResult = {
1113
- id: string;
1114
- status: string;
1115
- };
1116
- interface IProcessorDispatch {
1117
- execute(docId: string, branch: string, actions: Action[], signal?: AbortSignal, meta?: Record<string, unknown>): Promise<ProcessorDispatchResult>;
1118
- }
1119
- interface IProcessorHostModuleBase {
1120
- analyticsStore: IAnalyticsStore;
1121
- relationalDb: IRelationalDb;
1122
- processorApp: ProcessorApp;
1123
- dispatch: IProcessorDispatch;
1124
- getReadModel<T>(name: string): T;
1125
- config?: Map<string, unknown>;
1126
- /**
1127
- * The package's slice of the HTTP surface, bound to its own namespace.
1128
- *
1129
- * Declared on the host-agnostic base rather than on each host's module so
1130
- * the two cannot drift: codegen types generated processors against
1131
- * reactor-browser's `IProcessorHostModule`, and the same source has to
1132
- * compile against reactor-api's.
1133
- *
1134
- * Absent whenever the host has no HTTP server — processors also run in the
1135
- * browser — and on the reactor when the package's name cannot be resolved to
1136
- * a routable namespace, so a caller must always check before using it.
1137
- */
1138
- http?: IHttpScope;
1139
- }
1140
- /**
1141
- * Filter for matching operations to processors.
1142
- * All fields are optional arrays - when provided, operations must match at least one value in each specified field.
1143
- * When a field is undefined or empty, it matches all values for that field.
1144
- */
1145
- type ProcessorFilter = {
1146
- documentType?: string[];
1147
- scope?: string[];
1148
- branch?: string[];
1149
- documentId?: string[];
1150
- };
1151
- /**
1152
- * Describes an object that can process operations.
1153
- */
1154
- interface IProcessor {
1155
- /**
1156
- * Processes a list of operations with context.
1157
- * Called when operations match this processor's filter.
1158
- */
1159
- onOperations(operations: OperationWithContext[]): Promise<void>;
1160
- /**
1161
- * Called when the processor is disconnected.
1162
- * Used to clean up any resources allocated during processor creation.
1163
- */
1164
- onDisconnect(): Promise<void>;
1165
- }
1166
- /**
1167
- * Relates a processor to its filter configuration.
1168
- */
1169
- type ProcessorRecord = {
1170
- processor: IProcessor;
1171
- filter: ProcessorFilter;
1172
- startFrom?: "beginning" | "current";
1173
- id?: string;
1174
- };
1175
- /**
1176
- * A factory function that creates processor records for a given drive.
1177
- * Called once per drive when the drive is first detected or when the factory is registered.
1178
- */
1179
- type ProcessorFactory = (driveHeader: PHDocumentHeader, processorApp?: ProcessorApp) => Promise<ProcessorRecord[]> | ProcessorRecord[];
1180
- /** Takes a processor host module and builds processor factories using its context. */
1181
- type ProcessorFactoryBuilder<TModule extends IProcessorHostModuleBase = IProcessorHostModuleBase> = {
1182
- bivarianceHack(module: TModule): Promise<ProcessorFactory> | ProcessorFactory;
1183
- }["bivarianceHack"];
1184
- type ProcessorStatus = "active" | "errored";
1185
- type TrackedProcessor = {
1186
- processorId: string;
1187
- factoryId: string;
1188
- driveId: string;
1189
- processorIndex: number;
1190
- record: ProcessorRecord;
1191
- lastOrdinal: number;
1192
- status: ProcessorStatus;
1193
- lastError: string | undefined;
1194
- lastErrorTimestamp: Date | undefined;
1195
- retry: () => Promise<void>;
1196
- };
1197
- /**
1198
- * Manages processor creation and destruction based on drive operations.
1199
- */
1200
- interface IProcessorManager {
1201
- /**
1202
- * Registers a processor factory.
1203
- * Immediately creates processors for all existing drives.
1204
- */
1205
- registerFactory(identifier: string, factory: ProcessorFactory): Promise<void>;
1206
- /**
1207
- * Unregisters a processor factory and disconnects all processors it created.
1208
- */
1209
- unregisterFactory(identifier: string): Promise<void>;
1210
- /**
1211
- * Gets a tracked processor by its ID.
1212
- */
1213
- get(processorId: string): TrackedProcessor | undefined;
1214
- /**
1215
- * Gets all tracked processors.
1216
- */
1217
- getAll(): TrackedProcessor[];
1218
- }
1219
- type ProcessorApp = (typeof PROCESSOR_APPS)[number];
1220
- type ProcessorApps = readonly ProcessorApp[];
1221
- //#endregion
1222
- //#region processors/relational/types.d.ts
1223
- type IRelationalQueryMethods = "selectFrom" | "selectNoFrom" | "with" | "withRecursive";
1224
- type IRelationalQueryBuilder<Schema = unknown> = Pick<QueryCreator<Schema>, IRelationalQueryMethods> & {
1225
- withSchema: (schema: string) => IRelationalQueryBuilder<Schema>;
1226
- };
1227
- type HashAlgorithms = "fnv1a";
1228
- type IBaseRelationalDb<Schema = unknown> = Kysely<Schema>;
1229
- /**
1230
- * The standardized relational database interface for relational db processors.
1231
- * This abstraction provides type-safe database operations while hiding the underlying
1232
- * database framework implementation details.
1233
- **/
1234
- type IRelationalDb<Schema = unknown> = IBaseRelationalDb<Schema> & {
1235
- createNamespace<NamespaceSchema>(namespace: string): Promise<IRelationalDb<ExtractProcessorSchemaOrSelf<NamespaceSchema>>>;
1236
- queryNamespace<NamespaceSchema>(namespace: string): IRelationalQueryBuilder<NamespaceSchema>;
1237
- };
1238
- type ExtractProcessorSchemaOrSelf<TProcessor> = TProcessor extends RelationalDbProcessor<infer TSchema> ? TSchema : TProcessor;
1239
- type RelationalDbProcessorClass<TSchema> = typeof RelationalDbProcessor<TSchema>;
1240
- interface IRelationalDbProcessor<TDatabaseSchema = unknown> extends IProcessor {
1241
- namespace: string;
1242
- query: IRelationalQueryBuilder<TDatabaseSchema>;
1243
- filter: ProcessorFilter;
1244
- initAndUpgrade(): Promise<void>;
1245
- }
1246
- declare const IS_RELATIONAL_DB_PROCESSOR: unique symbol;
1247
- /**
1248
- * Base class for relational db processors that require a relational database storage.
1249
- * This class abstracts database initialization, migration management, and resource cleanup,
1250
- * allowing derived classes to focus on business logic.
1251
- */
1252
- declare abstract class RelationalDbProcessor<TDatabaseSchema = unknown> implements IRelationalDbProcessor<TDatabaseSchema> {
1253
- protected _namespace: string;
1254
- protected _filter: ProcessorFilter;
1255
- protected relationalDb: IRelationalDb<TDatabaseSchema>;
1256
- constructor(_namespace: string, _filter: ProcessorFilter, relationalDb: IRelationalDb<TDatabaseSchema>);
1257
- static [IS_RELATIONAL_DB_PROCESSOR]: boolean;
1258
- /**
1259
- * Returns the namespace for a given drive id.
1260
- * This method can be overridden by derived classes to provide a custom namespace.
1261
- */
1262
- static getNamespace(driveId: string): string;
1263
- static query<Schema>(this: RelationalDbProcessorClass<Schema>, driveId: string, db: IRelationalDb<any>): IRelationalQueryBuilder<Schema>;
1264
- /**
1265
- * Processes a list of operations with context.
1266
- * Called when operations match this processor's filter.
1267
- */
1268
- abstract onOperations(operations: OperationWithContext[]): Promise<void>;
1269
- /**
1270
- * Returns the filter for the processor.
1271
- * This method can be overridden by derived classes to provide a custom filter.
1272
- */
1273
- get filter(): ProcessorFilter;
1274
- /**
1275
- * Returns the namespace used by the processor.
1276
- */
1277
- get namespace(): string;
1278
- get query(): IRelationalQueryBuilder<TDatabaseSchema>;
1279
- /**
1280
- * Abstract method that derived classes must implement.
1281
- * This method is meant to be called on subclasses to initialize and upgrade the database.
1282
- */
1283
- abstract initAndUpgrade(): Promise<void>;
1284
- /**
1285
- * Called when the processor is disconnected.
1286
- * This method is meant to be overridden by subclasses to clean up resources.
1287
- */
1288
- abstract onDisconnect(): Promise<void>;
1289
- }
1290
- //#endregion
1291
- //#region processors/relational/utils.d.ts
1292
- /**
1293
- * Hashes a string to a lowercase base-26 string.
1294
- * @param str The string to hash.
1295
- * @param length The length of the hash. Defaults to 10.
1296
- * @param algorithm The hashing algorithm to use. Defaults to "fnv1a".
1297
- * @returns The hashed string.
1298
- */
1299
- declare function hashNamespace(str: string, length?: number): string;
1300
- /**
1301
- * Creates a RelationalDb instance with namespace support.
1302
- * @param baseDb The base RelationalDb instance to enhance.
1303
- * @param baseOptions The default options for namespace creation. Hashes namespace by default.
1304
- * @returns The enhanced RelationalDb instance.
1305
- */
1306
- declare function createRelationalDb<Schema>(baseDb: IBaseRelationalDb<Schema>, baseOptions?: NamespaceOptions): IRelationalDb<Schema>;
1307
- type NamespaceOptions = {
1308
- hashNamespace?: boolean;
1309
- };
1310
- declare function createNamespacedDb<Schema>(db: IBaseRelationalDb<any>, namespace: string, options?: NamespaceOptions): Promise<IRelationalDb<Schema>>;
1311
- declare function createNamespacedQueryBuilder<Schema>(db: IBaseRelationalDb<any>, namespace: string, options?: NamespaceOptions): IRelationalQueryBuilder<Schema>;
1312
- /**
1313
- * Returns a query builder for a RelationalDb instance.
1314
- * @param query The RelationalDb instance to convert.
1315
- * @returns The IRelationalQueryBuilder instance.
1316
- */
1317
- declare function relationalDbToQueryBuilder<TSchema>(query: IBaseRelationalDb<TSchema>): IRelationalQueryBuilder<TSchema>;
1318
- //#endregion
1319
- //#region document-model/schemas.d.ts
1320
- type definedNonNullAny = {};
1321
- declare const isDefinedNonNullAny: (v: any) => v is definedNonNullAny;
1322
- declare const definedNonNullAnySchema: z.ZodAny & z.ZodType<definedNonNullAny, any, z.core.$ZodTypeInternals<definedNonNullAny, any>>;
1323
- declare const Load_StateSchema: z.ZodEnum<{
1324
- LOAD_STATE: "LOAD_STATE";
1325
- }>;
1326
- declare const PruneSchema: z.ZodEnum<{
1327
- PRUNE: "PRUNE";
1328
- }>;
1329
- declare const RedoSchema: z.ZodEnum<{
1330
- REDO: "REDO";
1331
- }>;
1332
- declare const Set_NameSchema: z.ZodEnum<{
1333
- SET_NAME: "SET_NAME";
1334
- }>;
1335
- declare const Set_PreferredEditorSchema: z.ZodEnum<{
1336
- SET_PREFERRED_EDITOR: "SET_PREFERRED_EDITOR";
1337
- }>;
1338
- declare const UndoSchema: z.ZodEnum<{
1339
- UNDO: "UNDO";
1340
- }>;
1341
- declare function OperationScopeSchema(): z.ZodString;
1342
- declare function DocumentActionSchema(): z.ZodUnion<readonly [z.ZodObject<Required<{
1343
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1344
- timestampUtcMs: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1345
- input: z.ZodType<LoadStateActionInput, LoadStateActionInput, z.core.$ZodTypeInternals<LoadStateActionInput, LoadStateActionInput>>;
1346
- type: z.ZodType<"LOAD_STATE", "LOAD_STATE", z.core.$ZodTypeInternals<"LOAD_STATE", "LOAD_STATE">>;
1347
- scope: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1348
- }>, z.core.$strip>, z.ZodObject<Required<{
1349
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1350
- timestampUtcMs: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1351
- input: z.ZodType<PruneActionInput, PruneActionInput, z.core.$ZodTypeInternals<PruneActionInput, PruneActionInput>>;
1352
- type: z.ZodType<"PRUNE", "PRUNE", z.core.$ZodTypeInternals<"PRUNE", "PRUNE">>;
1353
- scope: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1354
- }>, z.core.$strip>, z.ZodObject<Required<{
1355
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1356
- timestampUtcMs: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1357
- input: z.ZodType<RedoActionInput, RedoActionInput, z.core.$ZodTypeInternals<RedoActionInput, RedoActionInput>>;
1358
- type: z.ZodType<"REDO", "REDO", z.core.$ZodTypeInternals<"REDO", "REDO">>;
1359
- scope: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1360
- }>, z.core.$strip>, z.ZodObject<Required<{
1361
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1362
- timestampUtcMs: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1363
- input: z.ZodType<SetNameActionInput, SetNameActionInput, z.core.$ZodTypeInternals<SetNameActionInput, SetNameActionInput>>;
1364
- type: z.ZodType<"SET_NAME", "SET_NAME", z.core.$ZodTypeInternals<"SET_NAME", "SET_NAME">>;
1365
- scope: z.ZodType<"global", "global", z.core.$ZodTypeInternals<"global", "global">>;
1366
- }>, z.core.$strip>, z.ZodObject<Required<{
1367
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1368
- timestampUtcMs: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1369
- input: z.ZodType<SetPreferredEditorActionInput, SetPreferredEditorActionInput, z.core.$ZodTypeInternals<SetPreferredEditorActionInput, SetPreferredEditorActionInput>>;
1370
- type: z.ZodType<"SET_PREFERRED_EDITOR", "SET_PREFERRED_EDITOR", z.core.$ZodTypeInternals<"SET_PREFERRED_EDITOR", "SET_PREFERRED_EDITOR">>;
1371
- scope: z.ZodType<"header", "header", z.core.$ZodTypeInternals<"header", "header">>;
1372
- }>, z.core.$strip>, z.ZodObject<Required<{
1373
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1374
- timestampUtcMs: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1375
- input: z.ZodType<UndoActionInput, UndoActionInput, z.core.$ZodTypeInternals<UndoActionInput, UndoActionInput>>;
1376
- type: z.ZodType<"UNDO", "UNDO", z.core.$ZodTypeInternals<"UNDO", "UNDO">>;
1377
- scope: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1378
- }>, z.core.$strip>]>;
1379
- declare function LoadStateActionSchema(): z.ZodObject<Properties<SchemaLoadStateAction>>;
1380
- declare function LoadStateActionInputSchema(): z.ZodObject<Properties<LoadStateActionInput>>;
1381
- declare function LoadStateActionStateInputSchema(): z.ZodObject<Properties<LoadStateActionStateInput>>;
1382
- declare function PruneActionSchema(): z.ZodObject<Properties<SchemaPruneAction>>;
1383
- declare function PruneActionInputSchema(): z.ZodObject<Properties<PruneActionInput>>;
1384
- declare function RedoActionInputSchema(): z.ZodObject<{
1385
- count: z.ZodNumber;
1386
- }, z.core.$strip>;
1387
- declare function RedoActionSchema(): z.ZodObject<Properties<SchemaRedoAction>>;
1388
- declare function SetNameActionInputSchema(): z.ZodObject<{
1389
- name: z.ZodString;
1390
- }, z.core.$strip>;
1391
- declare function SetNameActionSchema(): z.ZodObject<Properties<SchemaSetNameAction>>;
1392
- declare function SetPreferredEditorActionInputSchema(): z.ZodObject<{
1393
- preferredEditor: z.ZodNullable<z.ZodString>;
1394
- }, z.core.$strip>;
1395
- declare function SetPreferredEditorActionSchema(): z.ZodObject<Properties<SchemaSetPreferredEditorAction>>;
1396
- declare function UndoActionInputSchema(): z.ZodObject<{
1397
- count: z.ZodNumber;
1398
- }, z.core.$strip>;
1399
- declare function UndoActionSchema(): z.ZodObject<Properties<SchemaUndoAction>>;
1400
- type Properties<T> = Required<{ [K in keyof T]: z.ZodType<T[K], T[K]> }>;
1401
- declare function AddChangeLogItemInputSchema(): z.ZodObject<Properties<AddChangeLogItemInput>>;
1402
- declare function AddModuleInputSchema(): z.ZodObject<Properties<AddModuleInput>>;
1403
- declare function AddOperationErrorInputSchema(): z.ZodObject<Properties<AddOperationErrorInput>>;
1404
- declare function AddOperationExampleInputSchema(): z.ZodObject<Properties<AddOperationExampleInput>>;
1405
- declare function AddOperationInputSchema(): z.ZodObject<Properties<AddOperationInput>>;
1406
- declare function AddStateExampleInputSchema(): z.ZodObject<Properties<AddStateExampleInput>>;
1407
- declare function AuthorSchema(): z.ZodObject<Properties<Author>>;
1408
- declare function CodeExampleSchema(): z.ZodObject<Properties<CodeExample>>;
1409
- declare function DeleteChangeLogItemInputSchema(): z.ZodObject<Properties<DeleteChangeLogItemInput>>;
1410
- declare function DeleteModuleInputSchema(): z.ZodObject<Properties<DeleteModuleInput>>;
1411
- declare function DeleteOperationErrorInputSchema(): z.ZodObject<Properties<DeleteOperationErrorInput>>;
1412
- declare function DeleteOperationExampleInputSchema(): z.ZodObject<Properties<DeleteOperationExampleInput>>;
1413
- declare function DeleteOperationInputSchema(): z.ZodObject<Properties<DeleteOperationInput>>;
1414
- declare function DeleteStateExampleInputSchema(): z.ZodObject<Properties<DeleteStateExampleInput>>;
1415
- declare function DocumentModelInputSchema(): z.ZodUnion<readonly [z.ZodObject<Required<{
1416
- __typename?: z.ZodType<"AddChangeLogItemInput" | undefined, "AddChangeLogItemInput" | undefined, z.core.$ZodTypeInternals<"AddChangeLogItemInput" | undefined, "AddChangeLogItemInput" | undefined>> | undefined;
1417
- content: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1418
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1419
- insertBefore: z.ZodType<Maybe<string>, Maybe<string>, z.core.$ZodTypeInternals<Maybe<string>, Maybe<string>>>;
1420
- }>, z.core.$strip>, z.ZodObject<Required<{
1421
- description?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1422
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1423
- name: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1424
- }>, z.core.$strip>, z.ZodObject<Required<{
1425
- errorCode?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1426
- errorDescription?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1427
- errorName?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1428
- errorTemplate?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1429
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1430
- operationId: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1431
- }>, z.core.$strip>, z.ZodObject<Required<{
1432
- example: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1433
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1434
- operationId: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1435
- }>, z.core.$strip>, z.ZodObject<Required<{
1436
- description?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1437
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1438
- moduleId: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1439
- name: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1440
- reducer?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1441
- schema?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1442
- template?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1443
- scope?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1444
- }>, z.core.$strip>, z.ZodObject<Required<{
1445
- scope: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1446
- example: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1447
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1448
- insertBefore?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1449
- }>, z.core.$strip>, z.ZodObject<Required<{
1450
- __typename?: z.ZodType<"DeleteChangeLogItemInput" | undefined, "DeleteChangeLogItemInput" | undefined, z.core.$ZodTypeInternals<"DeleteChangeLogItemInput" | undefined, "DeleteChangeLogItemInput" | undefined>> | undefined;
1451
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1452
- }>, z.core.$strip>, z.ZodObject<Required<{
1453
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1454
- }>, z.core.$strip>, z.ZodObject<Required<{
1455
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1456
- }>, z.core.$strip>, z.ZodObject<Required<{
1457
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1458
- }>, z.core.$strip>, z.ZodObject<Required<{
1459
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1460
- }>, z.core.$strip>, z.ZodObject<Required<{
1461
- scope: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1462
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1463
- }>, z.core.$strip>, z.ZodObject<Required<{
1464
- newModuleId: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1465
- operationId: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1466
- }>, z.core.$strip>, z.ZodObject<Required<{
1467
- __typename?: z.ZodType<"ReorderChangeLogItemsInput" | undefined, "ReorderChangeLogItemsInput" | undefined, z.core.$ZodTypeInternals<"ReorderChangeLogItemsInput" | undefined, "ReorderChangeLogItemsInput" | undefined>> | undefined;
1468
- order: z.ZodType<string[], string[], z.core.$ZodTypeInternals<string[], string[]>>;
1469
- }>, z.core.$strip>, z.ZodObject<Required<{
1470
- moduleId: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1471
- order: z.ZodType<string[], string[], z.core.$ZodTypeInternals<string[], string[]>>;
1472
- }>, z.core.$strip>, z.ZodObject<Required<{
1473
- order: z.ZodType<string[], string[], z.core.$ZodTypeInternals<string[], string[]>>;
1474
- }>, z.core.$strip>, z.ZodObject<Required<{
1475
- operationId: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1476
- order: z.ZodType<string[], string[], z.core.$ZodTypeInternals<string[], string[]>>;
1477
- }>, z.core.$strip>, z.ZodObject<Required<{
1478
- operationId: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1479
- order: z.ZodType<string[], string[], z.core.$ZodTypeInternals<string[], string[]>>;
1480
- }>, z.core.$strip>, z.ZodObject<Required<{
1481
- scope: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1482
- order: z.ZodType<string[], string[], z.core.$ZodTypeInternals<string[], string[]>>;
1483
- }>, z.core.$strip>, z.ZodObject<Required<{
1484
- authorName: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1485
- }>, z.core.$strip>, z.ZodObject<Required<{
1486
- authorWebsite: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1487
- }>, z.core.$strip>, z.ZodObject<Required<{
1488
- scope: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1489
- initialValue: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1490
- }>, z.core.$strip>, z.ZodObject<Required<{
1491
- description: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1492
- }>, z.core.$strip>, z.ZodObject<Required<{
1493
- extension: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1494
- }>, z.core.$strip>, z.ZodObject<Required<{
1495
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1496
- }>, z.core.$strip>, z.ZodObject<Required<{
1497
- name: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1498
- }>, z.core.$strip>, z.ZodObject<Required<{
1499
- description?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1500
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1501
- }>, z.core.$strip>, z.ZodObject<Required<{
1502
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1503
- name?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1504
- }>, z.core.$strip>, z.ZodObject<Required<{
1505
- description?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1506
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1507
- }>, z.core.$strip>, z.ZodObject<Required<{
1508
- errorCode?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1509
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1510
- }>, z.core.$strip>, z.ZodObject<Required<{
1511
- errorDescription?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1512
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1513
- }>, z.core.$strip>, z.ZodObject<Required<{
1514
- errorName?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1515
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1516
- }>, z.core.$strip>, z.ZodObject<Required<{
1517
- errorTemplate?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1518
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1519
- }>, z.core.$strip>, z.ZodObject<Required<{
1520
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1521
- name?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1522
- }>, z.core.$strip>, z.ZodObject<Required<{
1523
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1524
- reducer?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1525
- }>, z.core.$strip>, z.ZodObject<Required<{
1526
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1527
- schema?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1528
- }>, z.core.$strip>, z.ZodObject<Required<{
1529
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1530
- template?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1531
- }>, z.core.$strip>, z.ZodObject<Required<{
1532
- scope: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1533
- schema: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1534
- }>, z.core.$strip>, z.ZodObject<Required<{
1535
- __typename?: z.ZodType<"UpdateChangeLogItemInput" | undefined, "UpdateChangeLogItemInput" | undefined, z.core.$ZodTypeInternals<"UpdateChangeLogItemInput" | undefined, "UpdateChangeLogItemInput" | undefined>> | undefined;
1536
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1537
- newContent: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1538
- }>, z.core.$strip>, z.ZodObject<Required<{
1539
- example: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1540
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1541
- }>, z.core.$strip>, z.ZodObject<Required<{
1542
- scope: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1543
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1544
- newExample: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1545
- }>, z.core.$strip>]>;
1546
- declare function DocumentModelGlobalStateSchema(): z.ZodObject<Properties<DocumentModelGlobalState>>;
1547
- declare function DocumentSpecificationSchema(): z.ZodObject<Properties<DocumentSpecification>>;
1548
- declare function ModuleSchema(): z.ZodObject<Properties<ModuleSpecification>>;
1549
- declare function MoveOperationInputSchema(): z.ZodObject<Properties<MoveOperationInput>>;
1550
- declare function OperationSpecificationSchema(): z.ZodObject<Properties<OperationSpecification>>;
1551
- declare function OperationErrorSchema(): z.ZodObject<Properties<OperationErrorSpecification>>;
1552
- declare function ReorderChangeLogItemsInputSchema(): z.ZodObject<Properties<ReorderChangeLogItemsInput>>;
1553
- declare function ReorderModuleOperationsInputSchema(): z.ZodObject<Properties<ReorderModuleOperationsInput>>;
1554
- declare function ReorderModulesInputSchema(): z.ZodObject<Properties<ReorderModulesInput>>;
1555
- declare function ReorderOperationErrorsInputSchema(): z.ZodObject<Properties<ReorderOperationErrorsInput>>;
1556
- declare function ReorderOperationExamplesInputSchema(): z.ZodObject<Properties<ReorderOperationExamplesInput>>;
1557
- declare function ReorderStateExamplesInputSchema(): z.ZodObject<Properties<ReorderStateExamplesInput>>;
1558
- declare function SetAuthorNameInputSchema(): z.ZodObject<Properties<SetAuthorNameInput>>;
1559
- declare function SetAuthorWebsiteInputSchema(): z.ZodObject<Properties<SetAuthorWebsiteInput>>;
1560
- declare function SetInitialStateInputSchema(): z.ZodObject<Properties<SetInitialStateInput>>;
1561
- declare function SetModelDescriptionInputSchema(): z.ZodObject<Properties<SetModelDescriptionInput>>;
1562
- declare function SetModelExtensionInputSchema(): z.ZodObject<Properties<SetModelExtensionInput>>;
1563
- declare function SetModelIdInputSchema(): z.ZodObject<Properties<SetModelIdInput>>;
1564
- declare function SetModelNameInputSchema(): z.ZodObject<Properties<SetModelNameInput>>;
1565
- declare function SetModuleDescriptionInputSchema(): z.ZodObject<Properties<SetModuleDescriptionInput>>;
1566
- declare function SetModuleNameInputSchema(): z.ZodObject<Properties<SetModuleNameInput>>;
1567
- declare function SetOperationDescriptionInputSchema(): z.ZodObject<Properties<SetOperationDescriptionInput>>;
1568
- declare function SetOperationErrorCodeInputSchema(): z.ZodObject<Properties<SetOperationErrorCodeInput>>;
1569
- declare function SetOperationErrorDescriptionInputSchema(): z.ZodObject<Properties<SetOperationErrorDescriptionInput>>;
1570
- declare function SetOperationErrorNameInputSchema(): z.ZodObject<Properties<SetOperationErrorNameInput>>;
1571
- declare function SetOperationErrorTemplateInputSchema(): z.ZodObject<Properties<SetOperationErrorTemplateInput>>;
1572
- declare function SetOperationNameInputSchema(): z.ZodObject<Properties<SetOperationNameInput>>;
1573
- declare function SetOperationScopeInputSchema(): z.ZodObject<Properties<SetOperationScopeInput>>;
1574
- declare function SetOperationReducerInputSchema(): z.ZodObject<Properties<SetOperationReducerInput>>;
1575
- declare function SetOperationSchemaInputSchema(): z.ZodObject<Properties<SetOperationSchemaInput>>;
1576
- declare function SetOperationTemplateInputSchema(): z.ZodObject<Properties<SetOperationTemplateInput>>;
1577
- declare function SetStateSchemaInputSchema(): z.ZodObject<Properties<SetStateSchemaInput>>;
1578
- declare function StateSchema(): z.ZodObject<Properties<State>>;
1579
- declare function ScopeStateSchema(): z.ZodObject<Properties<ScopeState>>;
1580
- declare function UpdateChangeLogItemInputSchema(): z.ZodObject<Properties<UpdateChangeLogItemInput>>;
1581
- declare function UpdateOperationExampleInputSchema(): z.ZodObject<Properties<UpdateOperationExampleInput>>;
1582
- declare function UpdateStateExampleInputSchema(): z.ZodObject<Properties<UpdateStateExampleInput>>;
1583
- declare const PowerhouseModuleSchema: z.ZodObject<{
1584
- id: z.ZodString;
1585
- name: z.ZodString;
1586
- documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1587
- }, z.core.$strip>;
1588
- declare const PowerhouseModulesSchema: z.ZodOptional<z.ZodArray<z.ZodObject<{
1589
- id: z.ZodString;
1590
- name: z.ZodString;
1591
- documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1592
- }, z.core.$strip>>>;
1593
- declare const PublisherSchema: z.ZodObject<{
1594
- name: z.ZodOptional<z.ZodString>;
1595
- url: z.ZodOptional<z.ZodString>;
1596
- }, z.core.$strip>;
1597
- declare const ConfigEntryTypeSchema: z.ZodUnion<readonly [z.ZodLiteral<"var">, z.ZodLiteral<"secret">]>;
1598
- declare const ConfigEntrySchema: z.ZodObject<{
1599
- name: z.ZodString;
1600
- type: z.ZodUnion<readonly [z.ZodLiteral<"var">, z.ZodLiteral<"secret">]>;
1601
- description: z.ZodOptional<z.ZodString>;
1602
- required: z.ZodOptional<z.ZodBoolean>;
1603
- default: z.ZodOptional<z.ZodBoolean>;
1604
- }, z.core.$strip>;
1605
- declare const PwaConfigSchema: z.ZodType<PHConnectPwa>;
1606
- declare const ManifestSchema: z.ZodObject<{
1607
- name: z.ZodString;
1608
- description: z.ZodOptional<z.ZodString>;
1609
- category: z.ZodOptional<z.ZodString>;
1610
- image: z.ZodOptional<z.ZodString>;
1611
- publisher: z.ZodOptional<z.ZodObject<{
1612
- name: z.ZodOptional<z.ZodString>;
1613
- url: z.ZodOptional<z.ZodString>;
1614
- }, z.core.$strip>>;
1615
- documentModels: z.ZodOptional<z.ZodArray<z.ZodObject<{
1616
- id: z.ZodString;
1617
- name: z.ZodString;
1618
- documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1619
- }, z.core.$strip>>>;
1620
- apps: z.ZodOptional<z.ZodArray<z.ZodObject<{
1621
- id: z.ZodString;
1622
- name: z.ZodString;
1623
- documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1624
- }, z.core.$strip>>>;
1625
- editors: z.ZodOptional<z.ZodArray<z.ZodObject<{
1626
- id: z.ZodString;
1627
- name: z.ZodString;
1628
- documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1629
- }, z.core.$strip>>>;
1630
- processors: z.ZodOptional<z.ZodArray<z.ZodObject<{
1631
- id: z.ZodString;
1632
- name: z.ZodString;
1633
- documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1634
- }, z.core.$strip>>>;
1635
- subgraphs: z.ZodOptional<z.ZodArray<z.ZodObject<{
1636
- id: z.ZodString;
1637
- name: z.ZodString;
1638
- documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1639
- }, z.core.$strip>>>;
1640
- pieces: z.ZodOptional<z.ZodArray<z.ZodObject<{
1641
- id: z.ZodString;
1642
- name: z.ZodString;
1643
- documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1644
- }, z.core.$strip>>>;
1645
- config: z.ZodOptional<z.ZodArray<z.ZodObject<{
1646
- name: z.ZodString;
1647
- type: z.ZodUnion<readonly [z.ZodLiteral<"var">, z.ZodLiteral<"secret">]>;
1648
- description: z.ZodOptional<z.ZodString>;
1649
- required: z.ZodOptional<z.ZodBoolean>;
1650
- default: z.ZodOptional<z.ZodBoolean>;
1651
- }, z.core.$strip>>>;
1652
- pwa: z.ZodOptional<z.ZodType<PHConnectPwa, unknown, z.core.$ZodTypeInternals<PHConnectPwa, unknown>>>;
1653
- }, z.core.$strip>;
1654
- //#endregion
1655
- //#region document-model/upgrades.d.ts
1656
- /** Upgrade reducer transforms a document from one version to another */
1657
- type UpgradeReducer<TFrom extends PHBaseState, TTo extends PHBaseState> = (document: PHDocument<TFrom>, action: Action) => PHDocument<TTo>;
1658
- type ModelVersion = number;
1659
- /** Metadata about a version transition */
1660
- type UpgradeTransition = {
1661
- toVersion: ModelVersion;
1662
- upgradeReducer: UpgradeReducer<any, any>;
1663
- description?: string;
1664
- };
1665
- type TupleMember<T extends readonly unknown[]> = T[number];
1666
- /** Manifest declaring all supported versions and upgrade paths */
1667
- type UpgradeManifest<TVersions extends readonly number[]> = {
1668
- documentType: string;
1669
- latestVersion: TupleMember<TVersions>;
1670
- supportedVersions: TVersions;
1671
- upgrades: { [V in Exclude<TupleMember<TVersions>, 1> as `v${V}`]: UpgradeTransition };
1672
- };
1673
- /**
1674
- * Canonical document-model version normalization: documents stamped with 0
1675
- * or nothing at all predate versioning and are treated as version 1, the
1676
- * same version the registry assigns unversioned modules. Every consumer
1677
- * that resolves a module or compares versions must use this rule; resolving
1678
- * 0 to "latest" instead re-pins a legacy document's history to whichever
1679
- * module happens to be newest.
1680
- */
1681
- declare function normalizeDocumentModelVersion(version: number | undefined | null): number;
1682
- /**
1683
- * Applies an UPGRADE_DOCUMENT action to a document.
1684
- * Handles all upgrade scenarios including initial upgrades, no-ops, and multi-step upgrades.
1685
- *
1686
- * Behavior based on fromVersion/toVersion:
1687
- * - fromVersion === toVersion (and fromVersion > 0): No-op - return unchanged document
1688
- * - fromVersion > toVersion: Throw DowngradeNotSupportedError
1689
- * - All other cases: Apply upgradePath transitions (if provided), then apply initialState, set version
1690
- */
1691
- declare function applyUpgradeDocumentAction(document: PHDocument, action: UpgradeDocumentAction, upgradePath?: UpgradeTransition[]): PHDocument;
1692
- /**
1693
- * Applies a DELETE_DOCUMENT action to a document.
1694
- * Marks the document as deleted in the document scope state.
1695
- */
1696
- declare function applyDeleteDocumentAction(document: PHDocument, action: DeleteDocumentAction): PHDocument;
1697
- /**
1698
- * Computes the ordered list of upgrade transitions needed to move from
1699
- * fromVersion to toVersion using the provided manifest.
1700
- * Walks keys v(fromVersion+1)..v(toVersion) and throws a descriptive Error
1701
- * if the manifest is absent or any step is missing.
1702
- */
1703
- declare function computeUpgradeTransitions(manifest: UpgradeManifest<readonly number[]> | undefined, fromVersion: number, toVersion: number): UpgradeTransition[];
1704
- //#endregion
1705
- //#region document-model/types.d.ts
1706
- type State = {
1707
- examples: CodeExample[];
1708
- initialValue: string;
1709
- schema: string;
1710
- };
1711
- type ScopeState = {
1712
- global: State;
1713
- local: State;
1714
- };
1715
- type Author = {
1716
- name: string;
1717
- website: string | null;
1718
- };
1719
- type OperationErrorSpecification = {
1720
- code: string | null;
1721
- description: string | null;
1722
- id: ID;
1723
- name: string | null;
1724
- template: string | null;
1725
- };
1726
- type CodeExample = {
1727
- id: ID;
1728
- value: string;
1729
- };
1730
- type OperationSpecification = {
1731
- description: string | null;
1732
- errors: OperationErrorSpecification[];
1733
- examples: CodeExample[];
1734
- id: ID;
1735
- name: string | null;
1736
- reducer: string | null;
1737
- schema: string | null;
1738
- template: string | null;
1739
- scope: string;
1740
- };
1741
- type ModuleSpecification = {
1742
- description: string | null;
1743
- id: ID;
1744
- name: string;
1745
- operations: OperationSpecification[];
1746
- };
1747
- type DocumentSpecification = {
1748
- changeLog: string[];
1749
- modules: ModuleSpecification[];
1750
- state: ScopeState;
1751
- version: number;
1752
- };
1753
- type DocumentModelGlobalState = {
1754
- author: Author;
1755
- description: string;
1756
- extension: string;
1757
- id: string;
1758
- name: string;
1759
- specifications: DocumentSpecification[];
1760
- };
1761
- type DocumentModelLocalState = {};
1762
- type DocumentModelPHState = PHBaseState & {
1763
- global: DocumentModelGlobalState;
1764
- local: DocumentModelLocalState;
1765
- };
1766
- type DocumentModelDocument = PHDocument<DocumentModelPHState>;
1767
- type DocumentModelAction = DocumentModelHeaderAction | DocumentModelVersioningAction | DocumentModelModuleAction | DocumentModelOperationErrorAction | DocumentModelOperationExampleAction | DocumentModelOperationAction | DocumentModelStateAction;
1768
- type AddChangeLogItemInput = {
1769
- __typename?: "AddChangeLogItemInput";
1770
- content: Scalars["String"]["output"];
1771
- id: Scalars["ID"]["output"];
1772
- insertBefore: Maybe<Scalars["ID"]["output"]>;
1773
- };
1774
- type AddModuleInput = {
1775
- description?: InputMaybe<Scalars["String"]["input"]>;
1776
- id: Scalars["ID"]["input"];
1777
- name: Scalars["String"]["input"];
1778
- };
1779
- type AddOperationErrorInput = {
1780
- errorCode?: InputMaybe<Scalars["String"]["input"]>;
1781
- errorDescription?: InputMaybe<Scalars["String"]["input"]>;
1782
- errorName?: InputMaybe<Scalars["String"]["input"]>;
1783
- errorTemplate?: InputMaybe<Scalars["String"]["input"]>;
1784
- id: Scalars["ID"]["input"];
1785
- operationId: Scalars["ID"]["input"];
1786
- };
1787
- type AddOperationExampleInput = {
1788
- example: Scalars["String"]["input"];
1789
- id: Scalars["ID"]["input"];
1790
- operationId: Scalars["ID"]["input"];
1791
- };
1792
- type AddOperationInput = {
1793
- description?: InputMaybe<Scalars["String"]["input"]>;
1794
- id: Scalars["ID"]["input"];
1795
- moduleId: Scalars["ID"]["input"];
1796
- name: Scalars["String"]["input"];
1797
- reducer?: InputMaybe<Scalars["String"]["input"]>;
1798
- schema?: InputMaybe<Scalars["String"]["input"]>;
1799
- template?: InputMaybe<Scalars["String"]["input"]>;
1800
- scope?: InputMaybe<string>;
1801
- };
1802
- type AddStateExampleInput = {
1803
- scope: Scalars["String"]["input"];
1804
- example: Scalars["String"]["input"];
1805
- id: Scalars["ID"]["input"];
1806
- insertBefore?: InputMaybe<Scalars["ID"]["input"]>;
1807
- };
1808
- type DeleteChangeLogItemInput = {
1809
- __typename?: "DeleteChangeLogItemInput";
1810
- id: Scalars["ID"]["output"];
1811
- };
1812
- type DeleteModuleInput = {
1813
- id: Scalars["ID"]["input"];
1814
- };
1815
- type DeleteOperationErrorInput = {
1816
- id: Scalars["ID"]["input"];
1817
- };
1818
- type DeleteOperationExampleInput = {
1819
- id: Scalars["ID"]["input"];
1820
- };
1821
- type DeleteOperationInput = {
1822
- id: Scalars["ID"]["input"];
1823
- };
1824
- type DeleteStateExampleInput = {
1825
- scope: Scalars["String"]["input"];
1826
- id: Scalars["ID"]["input"];
1827
- };
1828
- type DocumentModelInput = AddChangeLogItemInput | AddModuleInput | AddOperationErrorInput | AddOperationExampleInput | AddOperationInput | AddStateExampleInput | DeleteChangeLogItemInput | DeleteModuleInput | DeleteOperationErrorInput | DeleteOperationExampleInput | DeleteOperationInput | DeleteStateExampleInput | MoveOperationInput | ReorderChangeLogItemsInput | ReorderModuleOperationsInput | ReorderModulesInput | ReorderOperationErrorsInput | ReorderOperationExamplesInput | ReorderStateExamplesInput | SetAuthorNameInput | SetAuthorWebsiteInput | SetInitialStateInput | SetModelDescriptionInput | SetModelExtensionInput | SetModelIdInput | SetModelNameInput | SetModuleDescriptionInput | SetModuleNameInput | SetOperationDescriptionInput | SetOperationErrorCodeInput | SetOperationErrorDescriptionInput | SetOperationErrorNameInput | SetOperationErrorTemplateInput | SetOperationNameInput | SetOperationReducerInput | SetOperationSchemaInput | SetOperationTemplateInput | SetStateSchemaInput | UpdateChangeLogItemInput | UpdateOperationExampleInput | UpdateStateExampleInput;
1829
- type MoveOperationInput = {
1830
- newModuleId: Scalars["ID"]["input"];
1831
- operationId: Scalars["ID"]["input"];
1832
- };
1833
- type Mutation = {
1834
- __typename?: "Mutation";
1835
- addChangeLogItemInput: DocumentModelGlobalState;
1836
- addModule: DocumentModelGlobalState;
1837
- addOperation: DocumentModelGlobalState;
1838
- addOperationError: DocumentModelGlobalState;
1839
- addOperationExample: DocumentModelGlobalState;
1840
- addStateExample: DocumentModelGlobalState;
1841
- deleteChangeLogItemInput: DocumentModelGlobalState;
1842
- deleteModule: DocumentModelGlobalState;
1843
- deleteOperation: DocumentModelGlobalState;
1844
- deleteOperationError: DocumentModelGlobalState;
1845
- deleteOperationExample: DocumentModelGlobalState;
1846
- deleteStateExample: DocumentModelGlobalState;
1847
- moveOperation: DocumentModelGlobalState;
1848
- releaseNewVersion: DocumentModelGlobalState;
1849
- reorderChangeLogItemsInput: DocumentModelGlobalState;
1850
- reorderModuleOperations: DocumentModelGlobalState;
1851
- reorderModules: DocumentModelGlobalState;
1852
- reorderOperationErrors: DocumentModelGlobalState;
1853
- reorderOperationExamples: DocumentModelGlobalState;
1854
- reorderStateExamples: DocumentModelGlobalState;
1855
- setAuthorName: DocumentModelGlobalState;
1856
- setAuthorWebsite: DocumentModelGlobalState;
1857
- setInitialState: DocumentModelGlobalState;
1858
- setModelDescription: DocumentModelGlobalState;
1859
- setModelExtension: DocumentModelGlobalState;
1860
- setModelId: DocumentModelGlobalState;
1861
- setModelName: DocumentModelGlobalState;
1862
- setModuleDescription: DocumentModelGlobalState;
1863
- setModuleName: DocumentModelGlobalState;
1864
- setOperationDescription: DocumentModelGlobalState;
1865
- setOperationErrorCode: DocumentModelGlobalState;
1866
- setOperationErrorDescription: DocumentModelGlobalState;
1867
- setOperationErrorName: DocumentModelGlobalState;
1868
- setOperationErrorTemplate: DocumentModelGlobalState;
1869
- setOperationName: DocumentModelGlobalState;
1870
- setOperationReducer: DocumentModelGlobalState;
1871
- setOperationSchema: DocumentModelGlobalState;
1872
- setOperationTemplate: DocumentModelGlobalState;
1873
- setStateSchema: DocumentModelGlobalState;
1874
- updateChangeLogItemInput: DocumentModelGlobalState;
1875
- updateOperationExample: DocumentModelGlobalState;
1876
- updateStateExample: DocumentModelGlobalState;
1877
- };
1878
- type MutationAddChangeLogItemInputArgs = {
1879
- input?: InputMaybe<AddChangeLogItemInput>;
1880
- };
1881
- type MutationAddModuleArgs = {
1882
- input: AddModuleInput;
1883
- };
1884
- type MutationAddOperationArgs = {
1885
- input: AddOperationInput;
1886
- };
1887
- type MutationAddOperationErrorArgs = {
1888
- input: AddOperationErrorInput;
1889
- };
1890
- type MutationAddOperationExampleArgs = {
1891
- input: AddOperationExampleInput;
1892
- };
1893
- type MutationAddStateExampleArgs = {
1894
- input: AddStateExampleInput;
1895
- };
1896
- type MutationDeleteChangeLogItemInputArgs = {
1897
- input?: InputMaybe<DeleteChangeLogItemInput>;
1898
- };
1899
- type MutationDeleteModuleArgs = {
1900
- input: DeleteModuleInput;
1901
- };
1902
- type MutationDeleteOperationArgs = {
1903
- input: DeleteOperationInput;
1904
- };
1905
- type MutationDeleteOperationErrorArgs = {
1906
- input: DeleteOperationErrorInput;
1907
- };
1908
- type MutationDeleteOperationExampleArgs = {
1909
- input: DeleteOperationExampleInput;
1910
- };
1911
- type MutationDeleteStateExampleArgs = {
1912
- input: DeleteStateExampleInput;
1913
- };
1914
- type MutationMoveOperationArgs = {
1915
- input: MoveOperationInput;
1916
- };
1917
- type MutationReorderChangeLogItemsInputArgs = {
1918
- input?: InputMaybe<ReorderChangeLogItemsInput>;
1919
- };
1920
- type MutationReorderModuleOperationsArgs = {
1921
- input: ReorderModuleOperationsInput;
1922
- };
1923
- type MutationReorderModulesArgs = {
1924
- input: ReorderModulesInput;
1925
- };
1926
- type MutationReorderOperationErrorsArgs = {
1927
- input: ReorderOperationErrorsInput;
1928
- };
1929
- type MutationReorderOperationExamplesArgs = {
1930
- input: ReorderOperationExamplesInput;
1931
- };
1932
- type MutationReorderStateExamplesArgs = {
1933
- input: ReorderStateExamplesInput;
1934
- };
1935
- type MutationSetAuthorNameArgs = {
1936
- input: SetAuthorNameInput;
1937
- };
1938
- type MutationSetAuthorWebsiteArgs = {
1939
- input: SetAuthorWebsiteInput;
1940
- };
1941
- type MutationSetInitialStateArgs = {
1942
- input: SetInitialStateInput;
1943
- };
1944
- type MutationSetModelDescriptionArgs = {
1945
- input: SetModelDescriptionInput;
1946
- };
1947
- type MutationSetModelExtensionArgs = {
1948
- input: SetModelExtensionInput;
1949
- };
1950
- type MutationSetModelIdArgs = {
1951
- input: SetModelIdInput;
1952
- };
1953
- type MutationSetModelNameArgs = {
1954
- input: SetModelNameInput;
1955
- };
1956
- type MutationSetModuleDescriptionArgs = {
1957
- input: SetModuleDescriptionInput;
1958
- };
1959
- type MutationSetModuleNameArgs = {
1960
- input: SetModuleNameInput;
1961
- };
1962
- type MutationSetOperationDescriptionArgs = {
1963
- input: SetOperationDescriptionInput;
1964
- };
1965
- type MutationSetOperationErrorCodeArgs = {
1966
- input: SetOperationErrorCodeInput;
1967
- };
1968
- type MutationSetOperationErrorDescriptionArgs = {
1969
- input: SetOperationErrorDescriptionInput;
1970
- };
1971
- type MutationSetOperationErrorNameArgs = {
1972
- input: SetOperationErrorNameInput;
1973
- };
1974
- type MutationSetOperationErrorTemplateArgs = {
1975
- input: SetOperationErrorTemplateInput;
1976
- };
1977
- type MutationSetOperationNameArgs = {
1978
- input: SetOperationNameInput;
1979
- };
1980
- type MutationSetOperationReducerArgs = {
1981
- input: SetOperationReducerInput;
1982
- };
1983
- type MutationSetOperationSchemaArgs = {
1984
- input: SetOperationSchemaInput;
1985
- };
1986
- type MutationSetOperationTemplateArgs = {
1987
- input: SetOperationTemplateInput;
1988
- };
1989
- type MutationSetStateSchemaArgs = {
1990
- input: SetStateSchemaInput;
1991
- };
1992
- type MutationUpdateChangeLogItemInputArgs = {
1993
- input?: InputMaybe<UpdateChangeLogItemInput>;
1994
- };
1995
- type MutationUpdateOperationExampleArgs = {
1996
- input: UpdateOperationExampleInput;
1997
- };
1998
- type MutationUpdateStateExampleArgs = {
1999
- input: UpdateStateExampleInput;
2000
- };
2001
- type ReorderChangeLogItemsInput = {
2002
- __typename?: "ReorderChangeLogItemsInput";
2003
- order: Array<Scalars["ID"]["output"]>;
2004
- };
2005
- type ReorderModuleOperationsInput = {
2006
- moduleId: Scalars["ID"]["input"];
2007
- order: Array<Scalars["ID"]["input"]>;
2008
- };
2009
- type ReorderModulesInput = {
2010
- order: Array<Scalars["ID"]["input"]>;
2011
- };
2012
- type ReorderOperationErrorsInput = {
2013
- operationId: Scalars["ID"]["input"];
2014
- order: Array<Scalars["ID"]["input"]>;
2015
- };
2016
- type ReorderOperationExamplesInput = {
2017
- operationId: Scalars["ID"]["input"];
2018
- order: Array<Scalars["ID"]["input"]>;
2019
- };
2020
- type ReorderStateExamplesInput = {
2021
- scope: Scalars["String"]["input"];
2022
- order: Array<Scalars["ID"]["input"]>;
2023
- };
2024
- type SetAuthorNameInput = {
2025
- authorName: Scalars["String"]["input"];
2026
- };
2027
- type SetAuthorWebsiteInput = {
2028
- authorWebsite: Scalars["String"]["input"];
2029
- };
2030
- type SetInitialStateInput = {
2031
- scope: Scalars["String"]["input"];
2032
- initialValue: Scalars["String"]["input"];
2033
- };
2034
- type SetModelDescriptionInput = {
2035
- description: Scalars["String"]["input"];
2036
- };
2037
- type SetModelExtensionInput = {
2038
- extension: Scalars["String"]["input"];
2039
- };
2040
- type SetModelIdInput = {
2041
- id: Scalars["String"]["input"];
2042
- };
2043
- type SetModelNameInput = {
2044
- name: Scalars["String"]["input"];
2045
- };
2046
- type SetModuleDescriptionInput = {
2047
- description?: InputMaybe<Scalars["String"]["input"]>;
2048
- id: Scalars["ID"]["input"];
2049
- };
2050
- type SetModuleNameInput = {
2051
- id: Scalars["ID"]["input"];
2052
- name?: InputMaybe<Scalars["String"]["input"]>;
2053
- };
2054
- type SetOperationDescriptionInput = {
2055
- description?: InputMaybe<Scalars["String"]["input"]>;
2056
- id: Scalars["ID"]["input"];
2057
- };
2058
- type SetOperationErrorCodeInput = {
2059
- errorCode?: InputMaybe<Scalars["String"]["input"]>;
2060
- id: Scalars["ID"]["input"];
2061
- };
2062
- type SetOperationErrorDescriptionInput = {
2063
- errorDescription?: InputMaybe<Scalars["String"]["input"]>;
2064
- id: Scalars["ID"]["input"];
2065
- };
2066
- type SetOperationErrorNameInput = {
2067
- errorName?: InputMaybe<Scalars["String"]["input"]>;
2068
- id: Scalars["ID"]["input"];
2069
- };
2070
- type SetOperationErrorTemplateInput = {
2071
- errorTemplate?: InputMaybe<Scalars["String"]["input"]>;
2072
- id: Scalars["ID"]["input"];
2073
- };
2074
- type SetOperationNameInput = {
2075
- id: Scalars["ID"]["input"];
2076
- name?: InputMaybe<Scalars["String"]["input"]>;
2077
- };
2078
- type SetOperationScopeInput = {
2079
- id: Scalars["ID"]["input"];
2080
- scope?: InputMaybe<string>;
2081
- };
2082
- type SetOperationReducerInput = {
2083
- id: Scalars["ID"]["input"];
2084
- reducer?: InputMaybe<Scalars["String"]["input"]>;
2085
- };
2086
- type SetOperationSchemaInput = {
2087
- id: Scalars["ID"]["input"];
2088
- schema?: InputMaybe<Scalars["String"]["input"]>;
2089
- };
2090
- type SetOperationTemplateInput = {
2091
- id: Scalars["ID"]["input"];
2092
- template?: InputMaybe<Scalars["String"]["input"]>;
2093
- };
2094
- type SetStateSchemaInput = {
2095
- scope: Scalars["String"]["input"];
2096
- schema: Scalars["String"]["input"];
2097
- };
2098
- type UpdateChangeLogItemInput = {
2099
- __typename?: "UpdateChangeLogItemInput";
2100
- id: Scalars["ID"]["output"];
2101
- newContent: Scalars["String"]["output"];
2102
- };
2103
- type UpdateOperationExampleInput = {
2104
- example: Scalars["String"]["input"];
2105
- id: Scalars["ID"]["input"];
2106
- };
2107
- type UpdateStateExampleInput = {
2108
- scope: Scalars["String"]["input"];
2109
- id: Scalars["ID"]["input"];
2110
- newExample: Scalars["String"]["input"];
2111
- };
2112
- type SetModelNameAction = Action & {
2113
- type: "SET_MODEL_NAME";
2114
- input: SetModelNameInput;
2115
- };
2116
- type SetModelIdAction = Action & {
2117
- type: "SET_MODEL_ID";
2118
- input: SetModelIdInput;
2119
- };
2120
- type SetModelExtensionAction = Action & {
2121
- type: "SET_MODEL_EXTENSION";
2122
- input: SetModelExtensionInput;
2123
- };
2124
- type SetModelDescriptionAction = Action & {
2125
- type: "SET_MODEL_DESCRIPTION";
2126
- input: SetModelDescriptionInput;
2127
- };
2128
- type SetAuthorNameAction = Action & {
2129
- type: "SET_AUTHOR_NAME";
2130
- input: SetAuthorNameInput;
2131
- };
2132
- type SetAuthorWebsiteAction = Action & {
2133
- type: "SET_AUTHOR_WEBSITE";
2134
- input: SetAuthorWebsiteInput;
2135
- };
2136
- type DocumentModelHeaderAction = SetModelNameAction | SetModelIdAction | SetModelExtensionAction | SetModelDescriptionAction | SetAuthorNameAction | SetAuthorWebsiteAction;
2137
- type AddModuleAction = Action & {
2138
- type: "ADD_MODULE";
2139
- input: AddModuleInput;
2140
- };
2141
- type SetModuleNameAction = Action & {
2142
- type: "SET_MODULE_NAME";
2143
- input: SetModuleNameInput;
2144
- };
2145
- type SetModuleDescriptionAction = Action & {
2146
- type: "SET_MODULE_DESCRIPTION";
2147
- input: SetModuleDescriptionInput;
2148
- };
2149
- type DeleteModuleAction = Action & {
2150
- type: "DELETE_MODULE";
2151
- input: DeleteModuleInput;
2152
- };
2153
- type ReorderModulesAction = Action & {
2154
- type: "REORDER_MODULES";
2155
- input: ReorderModulesInput;
2156
- };
2157
- type DocumentModelModuleAction = AddModuleAction | SetModuleNameAction | SetModuleDescriptionAction | DeleteModuleAction | ReorderModulesAction;
2158
- type AddOperationAction = Action & {
2159
- type: "ADD_OPERATION";
2160
- input: AddOperationInput;
2161
- };
2162
- type SetOperationNameAction = Action & {
2163
- type: "SET_OPERATION_NAME";
2164
- input: SetOperationNameInput;
2165
- };
2166
- type SetOperationScopeAction = Action & {
2167
- type: "SET_OPERATION_SCOPE";
2168
- input: SetOperationScopeInput;
2169
- };
2170
- type SetOperationSchemaAction = Action & {
2171
- type: "SET_OPERATION_SCHEMA";
2172
- input: SetOperationSchemaInput;
2173
- };
2174
- type SetOperationDescriptionAction = Action & {
2175
- type: "SET_OPERATION_DESCRIPTION";
2176
- input: SetOperationDescriptionInput;
2177
- };
2178
- type SetOperationTemplateAction = Action & {
2179
- type: "SET_OPERATION_TEMPLATE";
2180
- input: SetOperationTemplateInput;
2181
- };
2182
- type SetOperationReducerAction = Action & {
2183
- type: "SET_OPERATION_REDUCER";
2184
- input: SetOperationReducerInput;
2185
- };
2186
- type MoveOperationAction = Action & {
2187
- type: "MOVE_OPERATION";
2188
- input: MoveOperationInput;
2189
- };
2190
- type DeleteOperationAction = Action & {
2191
- type: "DELETE_OPERATION";
2192
- input: DeleteOperationInput;
2193
- };
2194
- type ReorderModuleOperationsAction = Action & {
2195
- type: "REORDER_MODULE_OPERATIONS";
2196
- input: ReorderModuleOperationsInput;
2197
- };
2198
- type DocumentModelOperationAction = AddOperationAction | SetOperationNameAction | SetOperationScopeAction | SetOperationSchemaAction | SetOperationDescriptionAction | SetOperationTemplateAction | SetOperationReducerAction | MoveOperationAction | DeleteOperationAction | ReorderModuleOperationsAction;
2199
- type AddOperationErrorAction = Action & {
2200
- type: "ADD_OPERATION_ERROR";
2201
- input: AddOperationErrorInput;
2202
- };
2203
- type SetOperationErrorCodeAction = Action & {
2204
- type: "SET_OPERATION_ERROR_CODE";
2205
- input: SetOperationErrorCodeInput;
2206
- };
2207
- type SetOperationErrorNameAction = Action & {
2208
- type: "SET_OPERATION_ERROR_NAME";
2209
- input: SetOperationErrorNameInput;
2210
- };
2211
- type SetOperationErrorDescriptionAction = Action & {
2212
- type: "SET_OPERATION_ERROR_DESCRIPTION";
2213
- input: SetOperationErrorDescriptionInput;
2214
- };
2215
- type SetOperationErrorTemplateAction = Action & {
2216
- type: "SET_OPERATION_ERROR_TEMPLATE";
2217
- input: SetOperationErrorTemplateInput;
2218
- };
2219
- type DeleteOperationErrorAction = Action & {
2220
- type: "DELETE_OPERATION_ERROR";
2221
- input: DeleteOperationErrorInput;
2222
- };
2223
- type ReorderOperationErrorsAction = Action & {
2224
- type: "REORDER_OPERATION_ERRORS";
2225
- input: ReorderOperationErrorsInput;
2226
- };
2227
- type DocumentModelOperationErrorAction = AddOperationErrorAction | SetOperationErrorCodeAction | SetOperationErrorNameAction | SetOperationErrorDescriptionAction | SetOperationErrorTemplateAction | DeleteOperationErrorAction | ReorderOperationErrorsAction;
2228
- type AddOperationExampleAction = Action & {
2229
- type: "ADD_OPERATION_EXAMPLE";
2230
- input: AddOperationExampleInput;
2231
- };
2232
- type UpdateOperationExampleAction = Action & {
2233
- type: "UPDATE_OPERATION_EXAMPLE";
2234
- input: UpdateOperationExampleInput;
2235
- };
2236
- type DeleteOperationExampleAction = Action & {
2237
- type: "DELETE_OPERATION_EXAMPLE";
2238
- input: DeleteOperationExampleInput;
2239
- };
2240
- type ReorderOperationExamplesAction = Action & {
2241
- type: "REORDER_OPERATION_EXAMPLES";
2242
- input: ReorderOperationExamplesInput;
2243
- };
2244
- type DocumentModelOperationExampleAction = AddOperationExampleAction | UpdateOperationExampleAction | DeleteOperationExampleAction | ReorderOperationExamplesAction;
2245
- type SetStateSchemaAction = Action & {
2246
- type: "SET_STATE_SCHEMA";
2247
- input: SetStateSchemaInput;
2248
- };
2249
- type SetInitialStateAction = Action & {
2250
- type: "SET_INITIAL_STATE";
2251
- input: SetInitialStateInput;
2252
- };
2253
- type AddStateExampleAction = Action & {
2254
- type: "ADD_STATE_EXAMPLE";
2255
- input: AddStateExampleInput;
2256
- };
2257
- type UpdateStateExampleAction = Action & {
2258
- type: "UPDATE_STATE_EXAMPLE";
2259
- input: UpdateStateExampleInput;
2260
- };
2261
- type DeleteStateExampleAction = Action & {
2262
- type: "DELETE_STATE_EXAMPLE";
2263
- input: DeleteStateExampleInput;
2264
- };
2265
- type ReorderStateExamplesAction = Action & {
2266
- type: "REORDER_STATE_EXAMPLES";
2267
- input: ReorderStateExamplesInput;
2268
- };
2269
- type DocumentModelStateAction = SetStateSchemaAction | SetInitialStateAction | AddStateExampleAction | UpdateStateExampleAction | DeleteStateExampleAction | ReorderStateExamplesAction;
2270
- type AddChangeLogItemAction = Action & {
2271
- type: "ADD_CHANGE_LOG_ITEM";
2272
- input: AddChangeLogItemInput;
2273
- };
2274
- type UpdateChangeLogItemAction = Action & {
2275
- type: "UPDATE_CHANGE_LOG_ITEM";
2276
- input: UpdateChangeLogItemInput;
2277
- };
2278
- type DeleteChangeLogItemAction = Action & {
2279
- type: "DELETE_CHANGE_LOG_ITEM";
2280
- input: DeleteChangeLogItemInput;
2281
- };
2282
- type ReorderChangeLogItemsAction = Action & {
2283
- type: "REORDER_CHANGE_LOG_ITEMS";
2284
- input: ReorderChangeLogItemsInput;
2285
- };
2286
- type ReleaseNewVersionAction = Action & {
2287
- type: "RELEASE_NEW_VERSION";
2288
- input: {};
2289
- };
2290
- type DocumentModelVersioningAction = AddChangeLogItemAction | UpdateChangeLogItemAction | DeleteChangeLogItemAction | ReorderChangeLogItemsAction | ReleaseNewVersionAction;
2291
- interface DocumentModelHeaderOperations {
2292
- setModelNameOperation: (state: DocumentModelGlobalState, action: SetModelNameAction) => void;
2293
- setModelIdOperation: (state: DocumentModelGlobalState, action: SetModelIdAction) => void;
2294
- setModelExtensionOperation: (state: DocumentModelGlobalState, action: SetModelExtensionAction) => void;
2295
- setModelDescriptionOperation: (state: DocumentModelGlobalState, action: SetModelDescriptionAction) => void;
2296
- setAuthorNameOperation: (state: DocumentModelGlobalState, action: SetAuthorNameAction) => void;
2297
- setAuthorWebsiteOperation: (state: DocumentModelGlobalState, action: SetAuthorWebsiteAction) => void;
2298
- }
2299
- interface DocumentModelModuleOperations {
2300
- addModuleOperation: (state: DocumentModelGlobalState, action: AddModuleAction) => void;
2301
- setModuleNameOperation: (state: DocumentModelGlobalState, action: SetModuleNameAction) => void;
2302
- setModuleDescriptionOperation: (state: DocumentModelGlobalState, action: SetModuleDescriptionAction) => void;
2303
- deleteModuleOperation: (state: DocumentModelGlobalState, action: DeleteModuleAction) => void;
2304
- reorderModulesOperation: (state: DocumentModelGlobalState, action: ReorderModulesAction) => void;
2305
- }
2306
- type DocumentModelOperationOperations = {
2307
- addOperationOperation: (state: DocumentModelGlobalState, action: AddOperationAction) => void;
2308
- setOperationNameOperation: (state: DocumentModelGlobalState, action: SetOperationNameAction) => void;
2309
- setOperationScopeOperation: (state: DocumentModelGlobalState, action: SetOperationScopeAction) => void;
2310
- setOperationSchemaOperation: (state: DocumentModelGlobalState, action: SetOperationSchemaAction) => void;
2311
- setOperationDescriptionOperation: (state: DocumentModelGlobalState, action: SetOperationDescriptionAction) => void;
2312
- setOperationTemplateOperation: (state: DocumentModelGlobalState, action: SetOperationTemplateAction) => void;
2313
- setOperationReducerOperation: (state: DocumentModelGlobalState, action: SetOperationReducerAction) => void;
2314
- moveOperationOperation: (state: DocumentModelGlobalState, action: MoveOperationAction) => void;
2315
- deleteOperationOperation: (state: DocumentModelGlobalState, action: DeleteOperationAction) => void;
2316
- reorderModuleOperationsOperation: (state: DocumentModelGlobalState, action: ReorderModuleOperationsAction) => void;
2317
- };
2318
- interface DocumentModelOperationErrorOperations {
2319
- addOperationErrorOperation: (state: DocumentModelGlobalState, action: AddOperationErrorAction) => void;
2320
- setOperationErrorCodeOperation: (state: DocumentModelGlobalState, action: SetOperationErrorCodeAction) => void;
2321
- setOperationErrorNameOperation: (state: DocumentModelGlobalState, action: SetOperationErrorNameAction) => void;
2322
- setOperationErrorDescriptionOperation: (state: DocumentModelGlobalState, action: SetOperationErrorDescriptionAction) => void;
2323
- setOperationErrorTemplateOperation: (state: DocumentModelGlobalState, action: SetOperationErrorTemplateAction) => void;
2324
- deleteOperationErrorOperation: (state: DocumentModelGlobalState, action: DeleteOperationErrorAction) => void;
2325
- reorderOperationErrorsOperation: (state: DocumentModelGlobalState, action: ReorderOperationErrorsAction) => void;
2326
- }
2327
- interface DocumentModelOperationExampleOperations {
2328
- addOperationExampleOperation: (state: DocumentModelGlobalState, action: AddOperationExampleAction) => void;
2329
- updateOperationExampleOperation: (state: DocumentModelGlobalState, action: UpdateOperationExampleAction) => void;
2330
- deleteOperationExampleOperation: (state: DocumentModelGlobalState, action: DeleteOperationExampleAction) => void;
2331
- reorderOperationExamplesOperation: (state: DocumentModelGlobalState, action: ReorderOperationExamplesAction) => void;
2332
- }
2333
- interface DocumentModelStateOperations {
2334
- setStateSchemaOperation: (state: DocumentModelGlobalState, action: SetStateSchemaAction) => void;
2335
- setInitialStateOperation: (state: DocumentModelGlobalState, action: SetInitialStateAction) => void;
2336
- addStateExampleOperation: (state: DocumentModelGlobalState, action: AddStateExampleAction) => void;
2337
- updateStateExampleOperation: (state: DocumentModelGlobalState, action: UpdateStateExampleAction) => void;
2338
- deleteStateExampleOperation: (state: DocumentModelGlobalState, action: DeleteStateExampleAction) => void;
2339
- reorderStateExamplesOperation: (state: DocumentModelGlobalState, action: ReorderStateExamplesAction) => void;
2340
- }
2341
- interface DocumentModelVersioningOperations {
2342
- addChangeLogItemOperation: (state: DocumentModelGlobalState, action: AddChangeLogItemAction) => void;
2343
- updateChangeLogItemOperation: (state: DocumentModelGlobalState, action: UpdateChangeLogItemAction) => void;
2344
- deleteChangeLogItemOperation: (state: DocumentModelGlobalState, action: DeleteChangeLogItemAction) => void;
2345
- reorderChangeLogItemsOperation: (state: DocumentModelGlobalState, action: ReorderChangeLogItemsAction) => void;
2346
- releaseNewVersionOperation: (state: DocumentModelGlobalState, action: ReleaseNewVersionAction) => void;
2347
- }
2348
- type Maybe<T> = T | null;
2349
- type InputMaybe<T> = T | null | undefined;
2350
- type Exact<T extends Record<string, unknown>> = { [K in keyof T]: T[K] };
2351
- type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
2352
- type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
2353
- type MakeEmpty<T extends Record<string, unknown>, K extends keyof T> = { [_ in K]?: never };
2354
- type Incremental<T> = T | { [P in keyof T]?: P extends " $fragmentName" | "__typename" ? T[P] : never };
2355
- /** All built-in and custom scalars, mapped to their actual values */
2356
- type Scalars = {
2357
- ID: {
2358
- input: string;
2359
- output: string;
2360
- };
2361
- String: {
2362
- input: string;
2363
- output: string;
2364
- };
2365
- Boolean: {
2366
- input: boolean;
2367
- output: boolean;
2368
- };
2369
- Int: {
2370
- input: number;
2371
- output: number;
2372
- };
2373
- Float: {
2374
- input: number;
2375
- output: number;
2376
- };
2377
- Address: {
2378
- input: `${string}:0x${string}`;
2379
- output: `${string}:0x${string}`;
2380
- };
2381
- AttachmentRef: {
2382
- input: `attachment://v${number}:${string}`;
2383
- output: `attachment://v${number}:${string}`;
2384
- };
2385
- DateTime: {
2386
- input: string;
2387
- output: string;
2388
- };
2389
- Unknown: {
2390
- input: unknown;
2391
- output: unknown;
2392
- };
2393
- };
2394
- type ID = string;
2395
- type OperationsByScope = Partial<Record<string, Operation[]>>;
2396
- type SkipHeaderOperationIndex = Partial<Pick<OperationIndex, "index">> & Pick<OperationIndex, "skip">;
2397
- type UndoRedoAction = SchemaRedoAction | SchemaUndoAction;
2398
- type IAction = {
2399
- type: Scalars["String"]["output"];
2400
- };
2401
- type IDocument = {
2402
- created: Scalars["DateTime"]["output"];
2403
- documentType: Scalars["String"]["output"];
2404
- lastModified: Scalars["DateTime"]["output"];
2405
- name: Scalars["String"]["output"];
2406
- operations: Array<IOperation>;
2407
- revision: Scalars["Int"]["output"];
2408
- };
2409
- type IOperation = {
2410
- hash: Scalars["String"]["output"];
2411
- index: Scalars["Int"]["output"];
2412
- timestampUtcMs: Scalars["DateTime"]["output"];
2413
- type: Scalars["String"]["output"];
2414
- };
2415
- type Load_State = "LOAD_STATE";
2416
- type SchemaLoadStateAction = {
2417
- id: Scalars["String"]["output"];
2418
- timestampUtcMs: Scalars["DateTime"]["output"];
2419
- input: LoadStateActionInput;
2420
- type: Load_State;
2421
- scope: string;
2422
- };
2423
- type LoadStateActionInput = {
2424
- operations: Scalars["Int"]["input"];
2425
- state: LoadStateActionStateInput;
2426
- };
2427
- type LoadStateActionStateInput = {
2428
- data?: InputMaybe<Scalars["Unknown"]["input"]>;
2429
- name: Scalars["String"]["input"];
2430
- };
2431
- type MutationLoadStateArgs = {
2432
- input: SchemaLoadStateAction;
2433
- };
2434
- type MutationPruneArgs = {
2435
- input: SchemaPruneAction;
2436
- };
2437
- type MutationRedoArgs = {
2438
- input: SchemaRedoAction;
2439
- };
2440
- type MutationSetNameArgs = {
2441
- input: SchemaSetNameAction;
2442
- };
2443
- type MutationUndoArgs = {
2444
- input: SchemaUndoAction;
2445
- };
2446
- type Prune = "PRUNE";
2447
- type SchemaPruneAction = {
2448
- id: Scalars["String"]["output"];
2449
- timestampUtcMs: Scalars["DateTime"]["output"];
2450
- input: PruneActionInput;
2451
- type: Prune;
2452
- scope: string;
2453
- };
2454
- type PruneActionInput = {
2455
- end?: InputMaybe<Scalars["Int"]["input"]>;
2456
- start?: InputMaybe<Scalars["Int"]["input"]>;
2457
- };
2458
- type Query = {
2459
- __typename?: "Query";
2460
- document: Maybe<IDocument>;
2461
- };
2462
- type Redo = "REDO";
2463
- type RedoActionInput = {
2464
- count: Scalars["Int"]["input"];
2465
- };
2466
- type SchemaRedoAction = {
2467
- id: Scalars["String"]["output"];
2468
- timestampUtcMs: Scalars["DateTime"]["output"];
2469
- input: RedoActionInput;
2470
- type: Redo;
2471
- scope: string;
2472
- };
2473
- type Set_Name = "SET_NAME";
2474
- type SetNameActionInput = {
2475
- name: Scalars["String"]["input"];
2476
- };
2477
- type SchemaSetNameAction = {
2478
- id: Scalars["String"]["output"];
2479
- timestampUtcMs: Scalars["DateTime"]["output"];
2480
- input: SetNameActionInput;
2481
- type: Set_Name;
2482
- scope: "global";
2483
- };
2484
- type SetNameOperation = IOperation & {
2485
- __typename?: "SetNameOperation";
2486
- hash: Scalars["String"]["output"];
2487
- index: Scalars["Int"]["output"];
2488
- input: Scalars["String"]["output"];
2489
- timestamp: Scalars["DateTime"]["output"];
2490
- type: Scalars["String"]["output"];
2491
- };
2492
- type Set_PreferredEditor = "SET_PREFERRED_EDITOR";
2493
- type SetPreferredEditorActionInput = {
2494
- preferredEditor: Scalars["String"]["input"] | null;
2495
- };
2496
- type SchemaSetPreferredEditorAction = {
2497
- id: Scalars["String"]["output"];
2498
- timestampUtcMs: Scalars["DateTime"]["output"];
2499
- input: SetPreferredEditorActionInput;
2500
- type: Set_PreferredEditor;
2501
- scope: "header";
2502
- };
2503
- type SetPreferredEditorOperation = IOperation & {
2504
- __typename?: "SetPreferredEditorOperation";
2505
- hash: Scalars["String"]["output"];
2506
- index: Scalars["Int"]["output"];
2507
- input: SetPreferredEditorActionInput;
2508
- timestamp: Scalars["DateTime"]["output"];
2509
- type: Scalars["String"]["output"];
2510
- };
2511
- type Undo = "UNDO";
2512
- type UndoActionInput = {
2513
- count: Scalars["Int"]["input"];
2514
- };
2515
- type SchemaUndoAction = {
2516
- id: Scalars["String"]["output"];
2517
- timestampUtcMs: Scalars["DateTime"]["output"];
2518
- input: UndoActionInput;
2519
- type: Undo;
2520
- scope: string;
2521
- };
2522
- type SchemaNOOPAction = {
2523
- id: Scalars["String"]["output"];
2524
- input: Scalars["Unknown"]["input"];
2525
- scope: string;
2526
- timestampUtcMs: Scalars["DateTime"]["output"];
2527
- type: "NOOP";
2528
- };
2529
- type LoadStateAction = Action & {
2530
- type: "LOAD_STATE";
2531
- input: LoadStateActionInput;
2532
- };
2533
- type PruneAction = Action & {
2534
- type: "PRUNE";
2535
- input: PruneActionInput;
2536
- };
2537
- type RedoAction = Action & {
2538
- type: "REDO";
2539
- input: SchemaRedoAction["input"];
2540
- };
2541
- type SetNameAction = Action & {
2542
- type: "SET_NAME";
2543
- input: SchemaSetNameAction["input"];
2544
- };
2545
- type SetPreferredEditorAction = Action & {
2546
- type: "SET_PREFERRED_EDITOR";
2547
- input: SchemaSetPreferredEditorAction["input"];
2548
- };
2549
- type UndoAction = Action & {
2550
- type: "UNDO";
2551
- input: SchemaUndoAction["input"];
2552
- };
2553
- type NOOPAction = Action & {
2554
- type: "NOOP";
2555
- input: SchemaNOOPAction["input"];
2556
- };
2557
- type CreateDocumentActionInput = {
2558
- model: string;
2559
- version: 0;
2560
- documentId: string;
2561
- signing?: {
2562
- signature: string;
2563
- publicKey: JsonWebKey;
2564
- nonce: string;
2565
- createdAtUtcIso: string;
2566
- documentType: string;
2567
- };
2568
- slug?: string;
2569
- name?: string;
2570
- branch?: string;
2571
- meta?: Record<string, unknown>;
2572
- protocolVersions?: {
2573
- [key: string]: number;
2574
- };
2575
- };
2576
- type UpgradeDocumentActionInput = {
2577
- model: string;
2578
- fromVersion: number;
2579
- toVersion: number;
2580
- documentId: string;
2581
- initialState?: object;
2582
- /**
2583
- * Per-scope next-operation-index snapshot at the moment the upgrade executes.
2584
- * Absent on legacy operations; loaders fall back to timestamp ordering when missing.
2585
- * Stamped CLIENT-SIDE at action creation (before signing), NEVER at execution.
2586
- */
2587
- revision?: Record<string, number>;
2588
- };
2589
- type DeleteDocumentActionInput = {
2590
- documentId: string;
2591
- propagate?: "none" | "cascade";
2592
- };
2593
- type AddRelationshipActionInput = {
2594
- sourceId: string;
2595
- targetId: string;
2596
- relationshipType: string;
2597
- metadata?: Record<string, unknown>;
2598
- };
2599
- type RemoveRelationshipActionInput = {
2600
- sourceId: string;
2601
- targetId: string;
2602
- relationshipType: string;
2603
- };
2604
- type UpdateRelationshipActionInput = {
2605
- sourceId: string;
2606
- targetId: string;
2607
- relationshipType: string;
2608
- metadata: Record<string, unknown> | null;
2609
- };
2610
- type CreateDocumentAction = Action & {
2611
- type: "CREATE_DOCUMENT";
2612
- input: CreateDocumentActionInput;
2613
- };
2614
- type UpgradeDocumentAction = Action & {
2615
- type: "UPGRADE_DOCUMENT";
2616
- input: UpgradeDocumentActionInput;
2617
- };
2618
- type DeleteDocumentAction = Action & {
2619
- type: "DELETE_DOCUMENT";
2620
- input: DeleteDocumentActionInput;
2621
- };
2622
- type AddRelationshipAction = Action & {
2623
- type: "ADD_RELATIONSHIP";
2624
- input: AddRelationshipActionInput;
2625
- };
2626
- type RemoveRelationshipAction = Action & {
2627
- type: "REMOVE_RELATIONSHIP";
2628
- input: RemoveRelationshipActionInput;
2629
- };
2630
- type UpdateRelationshipAction = Action & {
2631
- type: "UPDATE_RELATIONSHIP";
2632
- input: UpdateRelationshipActionInput;
2633
- };
2634
- type DocumentAction = LoadStateAction | PruneAction | RedoAction | SetNameAction | SetPreferredEditorAction | UndoAction | NOOPAction;
2635
- interface ISignal<TType extends string, TInput> {
2636
- type: TType;
2637
- input: TInput;
2638
- }
2639
- type ISignalResult<TTYpe, TInput, TResult> = {
2640
- signal: {
2641
- type: TTYpe;
2642
- input: TInput;
2643
- };
2644
- result: TResult;
2645
- };
2646
- type CreateChildDocumentInput = {
2647
- id: string;
2648
- documentType: string;
2649
- };
2650
- type CreateChildDocumentSignal = ISignal<"CREATE_CHILD_DOCUMENT", CreateChildDocumentInput>;
2651
- type DeleteChildDocumentInput = {
2652
- id: string;
2653
- };
2654
- type DeleteChildDocumentSignal = ISignal<"DELETE_CHILD_DOCUMENT", DeleteChildDocumentInput>;
2655
- type CopyChildDocumentInput = {
2656
- id: string;
2657
- newId: string;
2658
- };
2659
- type CopyChildDocumentSignal = ISignal<"COPY_CHILD_DOCUMENT", CopyChildDocumentInput>;
2660
- type Signal = CreateChildDocumentSignal | CopyChildDocumentSignal | DeleteChildDocumentSignal;
2661
- type SignalDispatch = (signal: Signal) => void;
2662
- type SignalResult = ISignalResult<CreateChildDocumentSignal["type"], CreateChildDocumentSignal["input"], PHDocument> | ISignalResult<CopyChildDocumentSignal["type"], CopyChildDocumentSignal["input"], boolean> | ISignalResult<DeleteChildDocumentSignal["type"], DeleteChildDocumentSignal["input"], PHDocument>;
2663
- type SignalResults = {
2664
- CREATE_CHILD_DOCUMENT: PHDocument;
2665
- COPY_CHILD_DOCUMENT: PHDocument;
2666
- DELETE_CHILD_DOCUMENT: boolean;
2667
- };
2668
- type SignalType<T extends Signal> = T["type"];
2669
- type FileInput = string | number[] | Uint8Array | ArrayBuffer | Blob;
2670
- type ReducerOptions = {
2671
- /** The number of operations to skip before this new action is applied. This overrides the skip count in the operation. */skip?: number; /** When true the skip count is ignored and the action is applied regardless of the skip count */
2672
- ignoreSkipOperations?: boolean; /** if true reuses the provided action resulting state instead of replaying it */
2673
- reuseOperationResultingState?: boolean; /** if true checks the hashes of the operations */
2674
- checkHashes?: boolean; /** Options for performing a replay. */
2675
- replayOptions?: {
2676
- /** The previously created operation to verify against. */operation: Operation;
2677
- }; /** Optional parser for the operation resulting state, uses JSON.parse by default */
2678
- operationResultingStateParser?: <TState>(state: string | null | undefined) => TState;
2679
- /**
2680
- * When true (default), the reducer will prune operations (garbage collect) when processing a skip.
2681
- * When false, it will recompute state for the skip but preserve the existing operations history.
2682
- */
2683
- pruneOnSkip?: boolean; /** The branch being operated on. Defaults to "main". */
2684
- branch?: string;
2685
- /**
2686
- * Protocol version controlling undo/redo behavior.
2687
- * - Version 1 (default): Legacy behavior with index reuse
2688
- * - Version 2: Reactor behavior with monotonic indices
2689
- */
2690
- protocolVersion?: number;
2691
- /**
2692
- * When true, skip index contiguity validation during replay.
2693
- * Used for V2 state rebuild where gapped indices are expected.
2694
- */
2695
- skipIndexValidation?: boolean;
2696
- };
2697
- /**
2698
- * A pure function that takes an action and the previous state
2699
- * of the document and returns the new state.
2700
- */
2701
- type Reducer<TState extends PHBaseState = PHBaseState> = (document: PHDocument<TState>, action: Action, dispatch?: SignalDispatch, options?: ReducerOptions) => PHDocument<TState>;
2702
- type StateReducer<TState extends PHBaseState = PHBaseState> = (state: Draft<TState>, action: Action, dispatch?: SignalDispatch) => TState | undefined;
2703
- type MappedOperation = {
2704
- ignore: boolean;
2705
- operation: Operation;
2706
- };
2707
- type DocumentOperationsIgnoreMap = Record<string, MappedOperation[]>;
2708
- type ActionSignatureContext = {
2709
- documentId: string;
2710
- signer: ActionSigner;
2711
- action: Action;
2712
- previousStateHash: string;
2713
- };
2714
- type ActionSigningHandler = (message: Uint8Array) => Promise<Uint8Array>;
2715
- type ActionVerificationHandler = (publicKey: string, signature: Uint8Array, data: Uint8Array) => Promise<boolean>;
2716
- /**
2717
- * Handler for verifying operation signatures.
2718
- *
2719
- * @param operation - The operation to verify
2720
- * @param publicKey - The public key to verify against (from signer.app.key)
2721
- * @returns Promise that resolves to true if signature is valid, false otherwise
2722
- */
2723
- type SignatureVerificationHandler = (operation: Operation, publicKey: string) => Promise<boolean>;
2724
- type ENSInfo = {
2725
- name?: string;
2726
- avatarUrl?: string;
2727
- };
2728
- type User = {
2729
- address: `0x${string}`;
2730
- networkId: string;
2731
- chainId: number;
2732
- ens?: ENSInfo;
2733
- };
2734
- type PartialRecord<K extends keyof any, T> = { [P in K]?: T };
2735
- type RevisionsFilter = PartialRecord<string, number>;
2736
- type GetDocumentOptions = ReducerOptions & {
2737
- revisions?: RevisionsFilter;
2738
- checkHashes?: boolean;
2739
- };
2740
- type ActionErrorCallback = (error: unknown) => void;
2741
- type EditorDispatch = (action: Action, onErrorCallback?: ActionErrorCallback) => void;
2742
- type EditorProps = {
2743
- children?: ReactNode;
2744
- className?: string;
2745
- document?: PHDocument;
2746
- };
2747
- type SubgraphModule = {
2748
- id: string;
2749
- name: string;
2750
- gql: string;
2751
- endpoint: string;
2752
- };
2753
- type EditorModule<TProps = any> = {
2754
- Component: FC<EditorProps & TProps>;
2755
- documentTypes: string[];
2756
- config: {
2757
- id: string;
2758
- name: string;
2759
- };
2760
- };
2761
- type ValidationError = {
2762
- message: string;
2763
- details: object;
2764
- };
2765
- type SkipHeaderOperations = Partial<Record<string, number>>;
2766
- type ReplayDocumentOptions = {
2767
- checkHashes?: boolean;
2768
- reuseOperationResultingState?: boolean;
2769
- operationResultingStateParser?: <TState>(state: string) => TState;
2770
- skipIndexValidation?: boolean;
2771
- };
2772
- type OperationIndex = {
2773
- index: number;
2774
- skip: number;
2775
- id?: string;
2776
- timestampUtcMs?: string;
2777
- };
2778
- /**
2779
- * Parameters used in a document signature.
2780
- */
2781
- type SigningParameters = {
2782
- documentType: string;
2783
- createdAtUtcIso: string;
2784
- /**
2785
- * The nonce can act as both a salt and a typical nonce.
2786
- */
2787
- nonce: string;
2788
- };
2789
- /**
2790
- * Describes a signer that can sign both document headers and actions.
2791
- */
2792
- interface ISigner {
2793
- /** The user associated with the signer */
2794
- user?: UserActionSigner;
2795
- /** The app associated with the signer */
2796
- app?: AppActionSigner;
2797
- /** The corresponding public key */
2798
- publicKey: CryptoKey;
2799
- /**
2800
- * Signs raw data (used for document header signing).
2801
- *
2802
- * @param data - The data to sign.
2803
- * @returns The signature of the data.
2804
- */
2805
- sign: (data: Uint8Array) => Promise<Uint8Array>;
2806
- /**
2807
- * Verifies a signature.
2808
- *
2809
- * @param data - The data to verify.
2810
- * @param signature - The signature to verify.
2811
- */
2812
- verify: (data: Uint8Array, signature: Uint8Array) => Promise<void>;
2813
- /**
2814
- * Signs an action (used for operation signing).
2815
- *
2816
- * @param action - The action to sign.
2817
- * @param abortSignal - Optional abort signal to cancel the signing.
2818
- * @returns The signature tuple.
2819
- */
2820
- signAction: (action: Action, abortSignal?: AbortSignal) => Promise<Signature>;
2821
- }
2822
- type IsStateOfType<TState> = (state: unknown) => state is TState;
2823
- type AssertIsStateOfType<TState> = (state: unknown) => asserts state is TState;
2824
- type IsDocumentOfType<TState extends PHBaseState> = (document: unknown) => document is PHDocument<TState>;
2825
- type AssertIsDocumentOfType<TState extends PHBaseState> = (document: unknown) => asserts document is PHDocument<TState>;
2826
- type PartialState<TState> = TState | Partial<TState>;
2827
- type CreateState<TState extends PHBaseState = PHBaseState> = (state?: PartialState<TState>) => TState;
2828
- type SaveToFileHandle = (document: PHDocument, input: FileSystemFileHandle) => void | Promise<void>;
2829
- type SaveToFile = (document: PHDocument, path: string, name?: string) => string | Promise<string>;
2830
- type LoadFromInput<TState extends PHBaseState = PHBaseState> = (input: FileInput) => PHDocument<TState> | Promise<PHDocument<TState>>;
2831
- type LoadFromFile<TState extends PHBaseState = PHBaseState> = (path: string) => PHDocument<TState> | Promise<PHDocument<TState>>;
2832
- type CreateDocument<TState extends PHBaseState = PHBaseState> = (initialState?: Partial<TState>, createState?: CreateState<TState>) => PHDocument<TState>;
2833
- type MinimalBackupData = {
2834
- documentId: string;
2835
- documentType: string;
2836
- branch: string;
2837
- state: PHBaseState;
2838
- name: string;
2839
- };
2840
- type DocumentModelUtils<TState extends PHBaseState = PHBaseState> = {
2841
- fileExtension: string;
2842
- createState: CreateState<TState>;
2843
- createDocument: CreateDocument<TState>;
2844
- loadFromInput: LoadFromInput<TState>;
2845
- saveToFileHandle: SaveToFileHandle;
2846
- isStateOfType: IsStateOfType<TState>;
2847
- assertIsStateOfType: AssertIsStateOfType<TState>;
2848
- isDocumentOfType: IsDocumentOfType<TState>;
2849
- assertIsDocumentOfType: AssertIsDocumentOfType<TState>;
2850
- };
2851
- type Actions = Record<string, (...args: any[]) => Action>;
2852
- /** MCP-compatible annotation hints; structural, no MCP SDK dependency. */
2853
- type PhAiToolAnnotations = {
2854
- title?: string;
2855
- readOnlyHint?: boolean;
2856
- destructiveHint?: boolean;
2857
- idempotentHint?: boolean;
2858
- openWorldHint?: boolean;
2859
- };
2860
- /**
2861
- * Provider-agnostic tool descriptor a package can offer to the in-browser
2862
- * AI assistant (see `DocumentModelLib.aiTools`).
2863
- *
2864
- * Structurally compatible with the MCP tool records produced by
2865
- * `createReactorMcpProvider`: the callback parameter is `never` so any
2866
- * per-tool-args function type is assignable, and the result is `unknown`
2867
- * because the envelope shape (MCP `CallToolResult`) is unwrapped at the
2868
- * adapter boundary.
2869
- */
2870
- type PhAiToolDescriptor = {
2871
- name: string;
2872
- description?: string;
2873
- inputSchema: ZodRawShape;
2874
- annotations?: PhAiToolAnnotations;
2875
- callback: (args: never) => Promise<unknown>;
2876
- };
2877
- type DocumentModelModule<TState extends PHBaseState = PHBaseState> = {
2878
- /** optional version field, should be made required */version?: number;
2879
- reducer: Reducer<TState>;
2880
- actions: Actions;
2881
- utils: DocumentModelUtils<TState>;
2882
- documentModel: DocumentModelPHState;
2883
- };
2884
- type DocumentModelLib<TState extends PHBaseState = PHBaseState> = {
2885
- manifest: Manifest;
2886
- documentModels: readonly DocumentModelModule<TState>[];
2887
- editors: readonly EditorModule[];
2888
- subgraphs?: readonly SubgraphModule[];
2889
- upgradeManifests?: readonly UpgradeManifest<readonly number[]>[] | undefined;
2890
- processorFactory?: ProcessorFactoryBuilder;
2891
- /**
2892
- * Optional: tool descriptors this package offers to the in-browser AI
2893
- * assistant (merged into the chat agent's tool set by the host app).
2894
- */
2895
- aiTools?: readonly PhAiToolDescriptor[];
2896
- };
2897
- type DocumentModelDocumentModelModule = DocumentModelModule<DocumentModelPHState>;
2898
- type ConfigEntryType = z.infer<typeof ConfigEntryTypeSchema>;
2899
- type ConfigEntry = z.infer<typeof ConfigEntrySchema>;
2900
- type PowerhouseModule = z.infer<typeof PowerhouseModuleSchema>;
2901
- type Publisher = z.infer<typeof PublisherSchema>;
2902
- type Manifest = z.infer<typeof ManifestSchema>;
2903
- //#endregion
2904
- //#region clis/constants.d.ts
2905
- declare const SERVICE_ACTIONS: readonly ["start", "stop", "status", "setup", "restart"];
2906
- declare const DRIVES_PRESERVE_STRATEGIES: readonly ["preserve-all", "preserve-by-url-and-detach"];
2907
- declare const LOG_LEVELS: readonly ["debug", "info", "warn", "error", "verbose"];
2908
- declare const DEFAULT_REGISTRY_URL: "https://registry.vetra.io";
2909
- //#endregion
2910
- //#region clis/types.d.ts
2911
- type ServiceActions = typeof SERVICE_ACTIONS;
2912
- type ServiceAction = ServiceActions[number];
2913
- type DrivePreserveStrategies = typeof DRIVES_PRESERVE_STRATEGIES;
2914
- type DrivePreserveStrategy = DrivePreserveStrategies[number];
2915
- type LogLevels = typeof LOG_LEVELS;
2916
- type LogLevel = LogLevels[number];
2917
- type ParsedCmdResult<P> = P extends ArgParser<infer Out> ? Out : never;
2918
- type PackageManagerArgs = ParsedCmdResult<typeof getPackageManagerCommand>;
2919
- type PHPackageProvider = "npm" | "github" | "local" | "registry";
2920
- type PathValidation = (dir: string) => boolean;
2921
- type PowerhousePackage = {
2922
- packageName: string;
2923
- version?: string;
2924
- provider?: PHPackageProvider;
2925
- url?: string;
2926
- };
2927
- type PHConnectBranding = {
2928
- appName?: string;
2929
- homeBackground?: string | null;
2930
- };
2931
- type PHConnectDefaultDriveRemote = {
2932
- url: string;
2933
- name?: string | null;
2934
- icon?: string | null;
2935
- };
2936
- type PHConnectDefaultDriveLocal = {
2937
- /** Discriminator: this entry is a local drive created on first boot. */local: true; /** Stable drive id; the drive is not re-created on later boots. */
2938
- id: string;
2939
- name?: string | null;
2940
- icon?: string | null; /** Drive app (preferred editor) to open on the drive. */
2941
- app?: string;
2942
- };
2943
- type PHConnectDefaultDrive = PHConnectDefaultDriveRemote | PHConnectDefaultDriveLocal;
2944
- type PHConnectDriveSection = {
2945
- enabled?: boolean;
2946
- allowAdd?: boolean;
2947
- allowDelete?: boolean;
2948
- };
2949
- type PHConnectDriveSections = {
2950
- remote?: PHConnectDriveSection;
2951
- local?: PHConnectDriveSection;
2952
- };
2953
- type PHConnectDrives = {
2954
- allowAddDrive?: boolean;
2955
- defaultDrives?: PHConnectDefaultDrive[];
2956
- preserveStrategy?: DrivePreserveStrategy;
2957
- sections?: PHConnectDriveSections;
2958
- };
2959
- type PHConnectApp = {
2960
- logLevel?: "debug" | "info" | "warn" | "error";
2961
- basePath?: string;
2962
- offline?: boolean;
2963
- studioMode?: boolean;
2964
- };
2965
- type PHConnectAi = {
2966
- /** Enables the in-browser AI assistant (chat FAB + window). Off by default. */assistantEnabled?: boolean;
2967
- };
2968
- type PHConnectPackages = {
2969
- externalEnabled?: boolean; /** Subscribe to the static-mode `/__packages` SSE channel for live reload. */
2970
- liveReload?: boolean;
2971
- };
2972
- type PHRenownRainbowAdapterConfig = {
2973
- /** WalletConnect project id; required for the rainbow adapter to function. */walletConnectProjectId?: string; /** Optional Infura project id used to build RPC transports. */
2974
- infuraProjectId?: string;
2975
- };
2976
- type PHRenownPrivyAdapterConfig = {
2977
- /** Privy application id; required for the privy adapter to function. */appId?: string; /** Optional Privy client id. */
2978
- clientId?: string; /** Login methods this adapter offers; defaults per adapter when omitted. */
2979
- methods?: string[];
2980
- };
2981
- type PHConnectRenownAdapters = {
2982
- rainbow?: PHRenownRainbowAdapterConfig;
2983
- privy?: PHRenownPrivyAdapterConfig;
2984
- };
2985
- type PHConnectRenown = {
2986
- url?: string;
2987
- networkId?: string;
2988
- chainId?: number; /** Renown localStorage namespace; share it across Connects to share login. */
2989
- namespace?: string; /** Switchboard GraphQL URL; when set, enables in-page (no-redirect) auth. */
2990
- switchboardUrl?: string; /** Per-adapter wallet config; presence of a key enables that adapter. */
2991
- adapters?: PHConnectRenownAdapters;
2992
- };
2993
- type PHConnectSentry = {
2994
- /** Sentry DSN URL. `null` disables Sentry entirely. */dsn?: string | null; /** Sentry environment label. */
2995
- env?: string; /** Enable Sentry performance tracing. */
2996
- tracing?: boolean;
2997
- };
2998
- type PHConnectInstance = {
2999
- namespace: string | null;
3000
- reactorWorker: boolean;
3001
- };
3002
- /** Each flag implies its predecessors, and must match the fleet Connect syncs
3003
- * with or the two compute different replay outcomes. */
3004
- type PHConnectReactorFeatureFlags = {
3005
- /** Decide writes from the document stream instead of the meta cache. */documentDecisions?: boolean; /** Enforce the auth scope's policy at admission, replay, and read. */
3006
- authEnforcement?: boolean; /** Let `{ group }` principals match, via the group documents' rosters. */
3007
- authGroups?: boolean; /** Evaluate `where` / `match` conditions on grants. */
3008
- authConditions?: boolean;
3009
- };
3010
- type PHConnectReactor = {
3011
- featureFlags?: PHConnectReactorFeatureFlags;
3012
- };
3013
- /**
3014
- * A URL-matching pattern for a service-worker runtime-caching rule, in
3015
- * JSON-serialisable form. A plain string is handed to Workbox verbatim (exact
3016
- * URL or same-origin path match). `{ source, flags }` is reconstructed into a
3017
- * `RegExp` at build time — use it for prefix/suffix/origin matches (e.g.
3018
- * `{ source: "^https://api\\.acme\\.io/" }`). Function-valued patterns aren't
3019
- * expressible here; regex covers the realistic package cases.
3020
- */
3021
- type PHConnectPwaUrlPattern = string | {
3022
- source: string;
3023
- flags?: string;
3024
- };
3025
- type PHConnectPwaCacheStrategy = "CacheFirst" | "CacheOnly" | "NetworkFirst" | "NetworkOnly" | "StaleWhileRevalidate";
3026
- /** Serialisable subset of a Workbox `RuntimeCaching` rule. */
3027
- type PHConnectPwaRuntimeCaching = {
3028
- urlPattern: PHConnectPwaUrlPattern;
3029
- handler: PHConnectPwaCacheStrategy;
3030
- method?: "GET" | "POST" | "PUT" | "DELETE" | "HEAD" | "PATCH";
3031
- options?: {
3032
- cacheName?: string;
3033
- /** Seconds a NetworkFirst rule waits for the network before falling back
3034
- * to the cache. */
3035
- networkTimeoutSeconds?: number;
3036
- expiration?: {
3037
- maxEntries?: number;
3038
- maxAgeSeconds?: number;
3039
- };
3040
- cacheableResponse?: {
3041
- statuses?: number[];
3042
- headers?: Record<string, string>;
3043
- };
3044
- };
3045
- };
3046
- type PHConnectPwaIcon = {
3047
- src: string;
3048
- sizes?: string;
3049
- type?: string;
3050
- purpose?: string;
3051
- };
3052
- /**
3053
- * A File Handling API entry a package or project contributes: the OS-level
3054
- * file types the installed Connect PWA offers to open. There is deliberately
3055
- * no `action` field — consuming launched files requires runtime code that
3056
- * lives in Connect itself, so every handler (built-in or contributed) opens
3057
- * at Connect's app root, injected at build time.
3058
- */
3059
- type PHConnectPwaFileHandler = {
3060
- /** MIME type → file extensions (each must start with "."). */accept: Record<string, string[]>; /** OS-level file-type icons. */
3061
- icons?: PHConnectPwaIcon[];
3062
- launch_type?: "single-client" | "multiple-clients";
3063
- };
3064
- /** Web-app-manifest fields a package or project may override. */
3065
- type PHConnectPwaManifest = {
3066
- name?: string;
3067
- short_name?: string;
3068
- description?: string;
3069
- theme_color?: string;
3070
- background_color?: string;
3071
- display?: "fullscreen" | "standalone" | "minimal-ui" | "browser";
3072
- start_url?: string;
3073
- scope?: string;
3074
- icons?: PHConnectPwaIcon[]; /** Extra file associations, appended after Connect's built-in `.phd`/`.phdm` handler. */
3075
- file_handlers?: PHConnectPwaFileHandler[]; /** How the OS launches the app for handled files/links. */
3076
- launch_handler?: {
3077
- client_mode: "auto" | "focus-existing" | "navigate-existing" | "navigate-new";
3078
- };
3079
- /** App-store-style categories. NOT authored under `connect.pwa` — derived at
3080
- * build/runtime from the `category` field of every contributing
3081
- * `powerhouse.manifest.json` (project + packages), unioned across them. */
3082
- categories?: string[];
3083
- };
3084
- /**
3085
- * PWA / service-worker overrides contributed by a package or the project.
3086
- * Layered on top of Connect's hardcoded PWA defaults at build time. Scalar
3087
- * fields deep-merge (later layer wins); every array member — the manifest
3088
- * arrays (`icons`, `file_handlers`, and the derived `categories`) plus the
3089
- * top-level `globPatterns`, `globIgnores`, `runtimeCaching` and
3090
- * `navigateFallbackDenylist` — is additive (concatenated/unioned);
3091
- * `maximumFileSizeToCacheInBytes` takes the max across contributors.
3092
- * Precedence: defaults < package fragments < project config.
3093
- */
3094
- type PHConnectPwa = {
3095
- manifest?: PHConnectPwaManifest; /** Extra Workbox precache globs, unioned with the built-in patterns. */
3096
- globPatterns?: string[]; /** Extra Workbox precache ignore globs, unioned with the built-in list. */
3097
- globIgnores?: string[]; /** Raise the precache file-size ceiling; the max across contributors wins. */
3098
- maximumFileSizeToCacheInBytes?: number; /** Additional runtime-caching rules, appended after the built-in rules. */
3099
- runtimeCaching?: PHConnectPwaRuntimeCaching[]; /** Extra SPA-fallback denylist patterns, unioned with the built-in list. */
3100
- navigateFallbackDenylist?: PHConnectPwaUrlPattern[];
3101
- };
3102
- type PHConnectRuntimeConfig = {
3103
- branding?: PHConnectBranding;
3104
- app?: PHConnectApp;
3105
- ai?: PHConnectAi;
3106
- packages?: PHConnectPackages;
3107
- drives?: PHConnectDrives;
3108
- renown?: PHConnectRenown;
3109
- sentry?: PHConnectSentry;
3110
- instance?: PHConnectInstance;
3111
- reactor?: PHConnectReactor;
3112
- pwa?: PHConnectPwa;
3113
- };
3114
- /** Which Renown instance a reactor authenticates against, server-side. */
3115
- type PHReactorRenown = {
3116
- /** "self" reads this reactor's own renown read model; "remote" (default)
3117
- * queries a Renown or Switchboard instance. */
3118
- source?: "remote" | "self"; /** Renown base URL; also the instance this reactor's own identity uses. */
3119
- url?: string; /** Switchboard GraphQL endpoint to read credentials from directly. */
3120
- switchboardUrl?: string;
3121
- };
3122
- type PowerhouseConfig = {
3123
- logLevel: LogLevel;
3124
- documentModelsDir: string;
3125
- editorsDir: string;
3126
- processorsDir: string;
3127
- subgraphsDir: string;
3128
- importScriptsDir: string;
3129
- skipFormat: boolean;
3130
- interactive?: boolean;
3131
- watch?: boolean;
3132
- reactor?: {
3133
- port?: number;
3134
- https?: undefined | boolean | {
3135
- keyPath: string;
3136
- certPath: string;
3137
- };
3138
- storage?: {
3139
- type: "filesystem" | "memory" | "postgres" | "browser";
3140
- filesystemPath?: string;
3141
- postgresUrl?: string;
3142
- };
3143
- };
3144
- auth?: {
3145
- enabled?: boolean;
3146
- admins: string[];
3147
- renown?: PHReactorRenown;
3148
- };
3149
- switchboard?: {
3150
- database?: {
3151
- url?: string;
3152
- };
3153
- port?: number;
3154
- };
3155
- studio?: {
3156
- port?: number;
3157
- host?: string;
3158
- https: boolean;
3159
- openBrowser?: boolean;
3160
- };
3161
- packages?: PowerhousePackage[];
3162
- vetra?: {
3163
- driveId?: string;
3164
- driveUrl?: string;
3165
- connectPort?: number;
3166
- };
3167
- packageRegistryUrl?: string;
3168
- connect?: PHConnectRuntimeConfig;
3169
- };
3170
- //#endregion
3171
- export { AddOperationExampleAction as $, UpgradeReducer as $a, deleteOperationExample as $c, SetOperationErrorCodeAction as $i, baseCreateDocument as $l, MutationDeleteOperationErrorArgs as $n, SetAuthorWebsiteInputSchema as $o, RedoActionInput as $r, ProcessorDispatchResult as $s, DocumentModelOperationExampleOperations as $t, PHDocumentState as $u, PHReactorRenown as A, SigningParameters as Aa, WebhookSignatureEncoding as Ac, SetAuthorNameAction as Ai, setOperationErrorDescription as Al, LoadStateActionInput as An, ModuleSchema as Ao, MutationSetOperationTemplateArgs as Ar, UpdateStateExampleInputSchema as As, DeleteOperationErrorInput as At, sortMappedOperations as Au, DEFAULT_REGISTRY_URL as B, UpdateChangeLogItemAction as Ba, addModule as Bc, SetModelIdAction as Bi, undo as Bl, ModuleSpecification as Bn, PublisherSchema as Bo, OperationsByScope as Br, IBaseRelationalDb as Bs, DocumentModelGlobalState as Bt, operationOutcome as Bu, PHConnectReactor as C, Set_PreferredEditor as Ca, WebhookEndpointInfo as Cc, DEFAULT_ANALYTICS_PROCESSOR_DB_NAME as Cd, SchemaNOOPAction as Ci, setModelId as Cl, Incremental as Cn, DocumentModelInputSchema as Co, MutationSetOperationErrorCodeArgs as Cr, Set_PreferredEditorSchema as Cs, DeleteChildDocumentSignal as Ct, prepareOperations as Cu, PHConnectRuntimeConfig as D, SignalResults as Da, WebhookReply as Dc, SchemaSetPreferredEditorAction as Di, setName as Dl, LoadFromFile as Dn, LoadStateActionStateInputSchema as Do, MutationSetOperationNameArgs as Dr, UndoSchema as Ds, DeleteModuleInput as Dt, reshuffleByTimestamp as Du, PHConnectRenownAdapters as E, SignalResult as Ea, WebhookPolicy as Ec, SchemaSetNameAction as Ei, setModuleName as El, IsStateOfType as En, LoadStateActionSchema as Eo, MutationSetOperationErrorTemplateArgs as Er, UndoActionSchema as Es, DeleteModuleAction as Et, replayDocument as Eu, PathValidation as F, SubgraphModule as Fa, actionContext as Fc, SetInitialStateInput as Fi, setOperationSchema as Fl, MakeOptional as Fn, PowerhouseModuleSchema as Fo, MutationUpdateStateExampleArgs as Fr, createRelationalDb as Fs, DeleteStateExampleInput as Ft, Operation as Fu, Actions as G, UpdateRelationshipActionInput as Ga, baseActions as Gc, SetModuleDescriptionInput as Gi, IntegrityIssueSubType as Gl, MutationAddModuleArgs as Gn, ReorderChangeLogItemsInputSchema as Go, PowerhouseModule as Gr, RelationalDbProcessor as Gs, DocumentModelLocalState as Gt, undoOperationV2 as Gu, ActionSignatureContext as H, UpdateOperationExampleAction as Ha, addOperationError as Hc, SetModelNameAction as Hi, updateOperationExample as Hl, MoveOperationInput as Hn, RedoActionInputSchema as Ho, PartialState as Hr, IRelationalDbProcessor as Hs, DocumentModelHeaderOperations as Ht, setNameOperation as Hu, PowerhouseConfig as I, Undo as Ia, actionFromAction as Ic, SetModelDescriptionAction as Ii, setOperationScope as Il, Manifest as In, PowerhouseModulesSchema as Io, NOOPAction as Ir, hashNamespace as Is, DocumentAction as It, OperationContext as Iu, AddModuleAction as J, UpgradeDocumentAction as Ja, createAction as Jc, SetNameAction as Ji, PHDocumentHeader as Jl, MutationAddOperationExampleArgs as Jn, ReorderOperationErrorsInputSchema as Jo, PruneActionInput as Jr, IProcessorDispatch as Js, DocumentModelModuleOperations as Jt, Condition as Ju, AddChangeLogItemAction as K, UpdateStateExampleAction as Ka, buildOperationSignature as Kc, SetModuleNameAction as Ki, IntegrityIssueType as Kl, MutationAddOperationArgs as Kn, ReorderModuleOperationsInputSchema as Ko, Prune as Kr, RelationalDbProcessorClass as Ks, DocumentModelModule as Kt, AuthGroups as Ku, PowerhousePackage as L, UndoAction as La, actionSigner as Lc, SetModelDescriptionInput as Li, setOperationTemplate as Ll, MappedOperation as Ln, PruneActionInputSchema as Lo, OperationErrorSpecification as Lr, relationalDbToQueryBuilder as Ls, DocumentModelAction as Lt, OperationOutcome as Lu, PHRenownRainbowAdapterConfig as M, SkipHeaderOperations as Ma, WebhookVerification as Mc, SetAuthorWebsiteAction as Mi, setOperationErrorTemplate as Ml, Load_State as Mn, OperationErrorSchema as Mo, MutationUndoArgs as Mr, isDefinedNonNullAny as Ms, DeleteOperationExampleInput as Mt, split as Mu, PackageManagerArgs as N, State as Na, Action as Nc, SetAuthorWebsiteInput as Ni, setOperationName as Nl, MakeEmpty as Nn, OperationScopeSchema as No, MutationUpdateChangeLogItemInputArgs as Nr, createNamespacedDb as Ns, DeleteOperationInput as Nt, updateHeaderRevision as Nu, PHConnectSentry as O, SignalType as Oa, WebhookRequest as Oc, SchemaUndoAction as Oi, setOperationDescription as Ol, LoadFromInput as On, Load_StateSchema as Oo, MutationSetOperationReducerArgs as Or, UpdateChangeLogItemInputSchema as Os, DeleteOperationAction as Ot, reshuffleByTimestampAndIndex as Ou, ParsedCmdResult as P, StateReducer as Pa, ActionContext as Pc, SetInitialStateAction as Pi, setOperationReducer as Pl, MakeMaybe as Pn, OperationSpecificationSchema as Po, MutationUpdateOperationExampleArgs as Pr, createNamespacedQueryBuilder as Ps, DeleteStateExampleAction as Pt, DocumentOperations as Pu, AddOperationErrorInput as Q, UpgradeManifest as Qa, deleteOperationError as Qc, SetOperationDescriptionInput as Qi, attachBranch as Ql, MutationDeleteOperationArgs as Qn, SetAuthorNameInputSchema as Qo, RedoAction as Qr, ProcessorApps as Qs, DocumentModelOperationExampleAction as Qt, PHBaseState as Qu, ServiceAction as R, UndoActionInput as Ra, actions as Rc, SetModelExtensionAction as Ri, setPreferredEditor as Rl, Maybe as Rn, PruneActionSchema as Ro, OperationIndex as Rr, ExtractProcessorSchemaOrSelf as Rs, DocumentModelDocument as Rt, OperationWithContext$1 as Ru, PHConnectPwaUrlPattern as S, Set_Name as Sa, ScopedRouteHandle as Sc, serializeSignature as Sd, SchemaLoadStateAction as Si, setModelExtension as Sl, ISigner as Sn, DocumentModelGlobalStateSchema as So, MutationSetOperationDescriptionArgs as Sr, Set_NameSchema as Ss, DeleteChildDocumentInput as St, precedes as Su, PHConnectRenown as T, SignalDispatch as Ta, WebhookHashAlgorithm as Tc, PROCESSOR_APPS as Td, SchemaRedoAction as Ti, setModuleDescription as Tl, IsDocumentOfType as Tn, LoadStateActionInputSchema as To, MutationSetOperationErrorNameArgs as Tr, UndoActionInputSchema as Ts, DeleteDocumentActionInput as Tt, removeExistingOperations as Tu, ActionSigningHandler as U, UpdateOperationExampleInput as Ua, addOperationExample as Uc, SetModelNameInput as Ui, updateStateExample as Ul, Mutation as Un, RedoActionSchema as Uo, PhAiToolAnnotations as Ur, IRelationalQueryBuilder as Us, DocumentModelInput as Ut, setPreferredEditorOperation as Uu, ActionErrorCallback as V, UpdateChangeLogItemInput as Va, addOperation as Vc, SetModelIdInput as Vi, updateChangeLogItem as Vl, MoveOperationAction as Vn, PwaConfigSchema as Vo, PartialRecord as Vr, IRelationalDb as Vs, DocumentModelHeaderAction as Vt, redoOperation as Vu, ActionVerificationHandler as W, UpdateRelationshipAction as Wa, addStateExample as Wc, SetModuleDescriptionAction as Wi, verifyOperationSignature as Wl, MutationAddChangeLogItemInputArgs as Wn, RedoSchema as Wo, PhAiToolDescriptor as Wr, IRelationalQueryMethods as Ws, DocumentModelLib as Wt, undoOperation as Wu, AddOperationAction as X, User as Xa, deleteModule as Xc, SetNameOperation as Xi, addUndo as Xl, MutationDeleteChangeLogItemInputArgs as Xn, ReorderStateExamplesInputSchema as Xo, Query as Xr, IProcessorManager as Xs, DocumentModelOperationErrorAction as Xt, Operand as Xu, AddModuleInput as Y, UpgradeDocumentActionInput as Ya, deleteChangeLogItem as Yc, SetNameActionInput as Yi, PHDocumentMeta as Yl, MutationAddStateExampleArgs as Yn, ReorderOperationExamplesInputSchema as Yo, Publisher as Yr, IProcessorHostModuleBase as Ys, DocumentModelOperationAction as Yt, Grant as Yu, AddOperationErrorAction as Z, ValidationError as Za, deleteOperation as Zc, SetOperationDescriptionAction as Zi, appendWithoutApplying as Zl, MutationDeleteModuleArgs as Zn, ScopeStateSchema as Zo, Redo as Zr, ProcessorApp as Zs, DocumentModelOperationErrorOperations as Zt, PHAuthState as Zu, PHConnectPwaCacheStrategy as _, SetPreferredEditorAction as _a, RouteMethod as _c, HashConfig as _d, ReplayDocumentOptions as _i, reorderStateExamples as _l, ID as _n, DeleteOperationErrorInputSchema as _o, MutationSetModelIdArgs as _r, SetOperationScopeInputSchema as _s, CreateDocumentAction as _t, mapSkippedOperationsV2 as _u, PHConnectAi as a, SetOperationErrorTemplateAction as aa, TrackedProcessor as ac, createDocumentState as ad, ReorderChangeLogItemsAction as ai, operationExampleCreators as al, DocumentModelVersioningAction as an, AddChangeLogItemInputSchema as ao, MutationRedoArgs as ar, SetModuleDescriptionInputSchema as as, AddStateExampleInput as at, filterDuplicatedOperations as au, PHConnectPwaManifest as b, SetStateSchemaAction as ba, RouteTransport as bc, UserActionSigner as bd, SaveToFileHandle as bi, setInitialState as bl, ISignal as bn, DeleteStateExampleInputSchema as bo, MutationSetModuleNameArgs as br, SetPreferredEditorActionSchema as bs, DeleteChangeLogItemAction as bt, operationsAreEqual as bu, PHConnectDefaultDrive as c, SetOperationNameInput as ca, IWebhookEndpoints as cc, createState as cd, ReorderModuleOperationsInput as ci, operationWithContext as cl, DocumentSpecification as cn, AddOperationExampleInputSchema as co, MutationReorderModulesArgs as cr, SetNameActionSchema as cs, Author as ct, garbageCollectV2 as cu, PHConnectDriveSection as d, SetOperationSchemaAction as da, RouteActor as dc, defaultDocumentState as dd, ReorderOperationErrorsAction as di, releaseNewVersion as dl, EditorModule as dn, AuthorSchema as do, MutationReorderStateExamplesArgs as dr, SetOperationErrorDescriptionInputSchema as ds, ConfigEntryType as dt, hashDocumentStateForScope as du, SetOperationErrorCodeInput as ea, ProcessorFactory as ec, PHGroupState as ed, Reducer as ei, deleteStateExample as el, DocumentModelOperationOperations as en, UpgradeTransition as eo, MutationDeleteOperationExampleArgs as er, SetInitialStateInputSchema as es, AddOperationExampleInput as et, baseReducerVersion as eu, PHConnectDriveSections as f, SetOperationSchemaInput as fa, RouteAuth as fc, defaultGlobalState as fd, ReorderOperationErrorsInput as fi, reorderChangeLogItems as fl, EditorProps as fn, CodeExampleSchema as fo, MutationSetAuthorNameArgs as fr, SetOperationErrorNameInputSchema as fs, CopyChildDocumentInput as ft, isDocumentAction as fu, PHConnectPwa as g, SetOperationTemplateInput as ga, RouteHandler as gc, AppActionSigner as gd, ReorderStateExamplesInput as gi, reorderOperationExamples as gl, IAction as gn, DeleteModuleInputSchema as go, MutationSetModelExtensionArgs as gr, SetOperationSchemaInputSchema as gs, CreateDocument as gt, mapSkippedOperations as gu, PHConnectPackages as h, SetOperationTemplateAction as ha, RouteContext as hc, ActionSigner as hd, ReorderStateExamplesAction as hi, reorderOperationErrors as hl, GetDocumentOptions as hn, DeleteChangeLogItemInputSchema as ho, MutationSetModelDescriptionArgs as hr, SetOperationReducerInputSchema as hs, CreateChildDocumentSignal as ht, isUndoRedo as hu, LogLevels as i, SetOperationErrorNameInput as ia, ProcessorStatus as ic, createBaseState as id, RemoveRelationshipActionInput as ii, noop as il, DocumentModelUtils as in, normalizeDocumentModelVersion as io, MutationPruneArgs as ir, SetModelNameInputSchema as is, AddStateExampleAction as it, filterDocumentOperationsResultingState as iu, PHRenownPrivyAdapterConfig as j, SkipHeaderOperationIndex as ja, WebhookSpec as jc, SetAuthorNameInput as ji, setOperationErrorName as jl, LoadStateActionStateInput as jn, MoveOperationInputSchema as jo, MutationSetStateSchemaArgs as jr, definedNonNullAnySchema as js, DeleteOperationExampleAction as jt, sortOperations as ju, PHPackageProvider as k, SignatureVerificationHandler as ka, WebhookScheme as kc, ScopeState as ki, setOperationErrorCode as kl, LoadStateAction as kn, ManifestSchema as ko, MutationSetOperationSchemaArgs as kr, UpdateOperationExampleInputSchema as ks, DeleteOperationErrorAction as kt, skipHeaderOperations as ku, PHConnectDefaultDriveLocal as l, SetOperationReducerAction as la, IWebhookScope as lc, defaultAuthState as ld, ReorderModulesAction as li, prune as ll, ENSInfo as ln, AddOperationInputSchema as lo, MutationReorderOperationErrorsArgs as lr, SetOperationDescriptionInputSchema as ls, CodeExample as lt, getDocumentLastModified as lu, PHConnectInstance as m, SetOperationScopeInput as ma, RouteBody as mc, defaultPHState as md, ReorderOperationExamplesInput as mi, reorderModules as ml, FileInput as mn, ConfigEntryTypeSchema as mo, MutationSetInitialStateArgs as mr, SetOperationNameInputSchema as ms, CreateChildDocumentInput as mt, isUndo as mu, DrivePreserveStrategy as n, SetOperationErrorDescriptionInput as na, ProcessorFilter as nc, backfillAuthState as nd, ReleaseNewVersionAction as ni, loadState as nl, DocumentModelStateAction as nn, applyUpgradeDocumentAction as no, MutationLoadStateArgs as nr, SetModelExtensionInputSchema as ns, AddRelationshipAction as nt, checkOperationsIntegrity as nu, PHConnectApp as o, SetOperationErrorTemplateInput as oa, AuthorizerResult as oc, createGlobalState as od, ReorderChangeLogItemsInput as oi, operationFromAction as ol, DocumentModelVersioningOperations as on, AddModuleInputSchema as oo, MutationReorderChangeLogItemsInputArgs as or, SetModuleNameInputSchema as os, AssertIsDocumentOfType as ot, garbageCollect as ou, PHConnectDrives as p, SetOperationScopeAction as pa, RouteAuthorizer as pc, defaultLocalState as pd, ReorderOperationExamplesAction as pi, reorderModuleOperations as pl, Exact as pn, ConfigEntrySchema as po, MutationSetAuthorWebsiteArgs as pr, SetOperationErrorTemplateInputSchema as ps, CopyChildDocumentSignal as pt, isNoopOperation as pu, AddChangeLogItemInput as q, UpdateStateExampleInput as qa, buildSignedAction as qc, SetModuleNameInput as qi, PHDocument as ql, MutationAddOperationErrorArgs as qn, ReorderModulesInputSchema as qo, PruneAction as qr, IProcessor as qs, DocumentModelModuleAction as qt, Capability as qu, LogLevel as r, SetOperationErrorNameAction as ra, ProcessorRecord as rc, createAuthState as rd, RemoveRelationshipAction as ri, moveOperation as rl, DocumentModelStateOperations as rn, computeUpgradeTransitions as ro, MutationMoveOperationArgs as rr, SetModelIdInputSchema as rs, AddRelationshipActionInput as rt, diffOperations as ru, PHConnectBranding as s, SetOperationNameAction as sa, IHttpScope as sc, createLocalState as sd, ReorderModuleOperationsAction as si, operationFromOperation as sl, DocumentOperationsIgnoreMap as sn, AddOperationErrorInputSchema as so, MutationReorderModuleOperationsArgs as sr, SetNameActionInputSchema as ss, AssertIsStateOfType as st, garbageCollectDocumentOperations as su, DrivePreserveStrategies as t, SetOperationErrorDescriptionAction as ta, ProcessorFactoryBuilder as tc, Principal as td, ReducerOptions as ti, documentModelActions as tl, DocumentModelPHState as tn, applyDeleteDocumentAction as to, MutationDeleteStateExampleArgs as tr, SetModelDescriptionInputSchema as ts, AddOperationInput as tt, checkCleanedOperationsIntegrity as tu, PHConnectDefaultDriveRemote as u, SetOperationReducerInput as ua, NodeRouteSpec as uc, defaultBaseState as ud, ReorderModulesInput as ui, redo as ul, EditorDispatch as un, AddStateExampleInputSchema as uo, MutationReorderOperationExamplesArgs as ur, SetOperationErrorCodeInputSchema as us, ConfigEntry as ut, groupOperationsByScope as uu, PHConnectPwaFileHandler as v, SetPreferredEditorActionInput as va, RouteOptions as vc, PHDocumentSignatureInfo as vd, RevisionsFilter as vi, setAuthorName as vl, IDocument as vn, DeleteOperationExampleInputSchema as vo, MutationSetModelNameArgs as vr, SetOperationTemplateInputSchema as vs, CreateDocumentActionInput as vt, merge as vu, PHConnectReactorFeatureFlags as w, Signal as wa, WebhookField as wc, DEFAULT_RELATIONAL_PROCESSOR_DB_NAME as wd, SchemaPruneAction as wi, setModelName as wl, InputMaybe as wn, DocumentSpecificationSchema as wo, MutationSetOperationErrorDescriptionArgs as wr, StateSchema as ws, DeleteDocumentAction as wt, readOnly as wu, PHConnectPwaRuntimeCaching as x, SetStateSchemaInput as xa, RouteUser as xc, deserializeSignature as xd, Scalars as xi, setModelDescription as xl, ISignalResult as xn, DocumentActionSchema as xo, MutationSetNameArgs as xr, SetStateSchemaInputSchema as xs, DeleteChangeLogItemInput as xt, parseResultingState as xu, PHConnectPwaIcon as y, SetPreferredEditorOperation as ya, RouteSpec as yc, Signature as yd, SaveToFile as yi, setAuthorWebsite as yl, IOperation as yn, DeleteOperationInputSchema as yo, MutationSetModuleDescriptionArgs as yr, SetPreferredEditorActionInputSchema as ys, CreateState as yt, nextSkipNumber as yu, ServiceActions as z, UndoRedoAction as za, addChangeLogItem as zc, SetModelExtensionInput as zi, setStateSchema as zl, MinimalBackupData as zn, PruneSchema as zo, OperationSpecification as zr, HashAlgorithms as zs, DocumentModelDocumentModelModule as zt, loadStateOperation as zu };
3172
- //# sourceMappingURL=types-BIoOWpOT.d.ts.map