@powerhousedao/shared 6.2.3-dev.8 → 6.2.3-dev.81
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.
- package/dist/action-id-DON1WCeY.d.ts +19 -0
- package/dist/action-id-DON1WCeY.d.ts.map +1 -0
- package/dist/analytics/index.d.ts +4 -4
- package/dist/analytics/index.d.ts.map +1 -1
- package/dist/analytics/index.js +25 -24
- package/dist/analytics/index.js.map +1 -1
- package/dist/clis/args/access-token.d.mts +15 -2
- package/dist/clis/args/access-token.d.mts.map +1 -0
- package/dist/clis/args/access-token.mjs +21 -1
- package/dist/clis/args/access-token.mjs.map +1 -0
- package/dist/clis/args/common-BpLj4peE.d.mts +186 -0
- package/dist/clis/args/common-BpLj4peE.d.mts.map +1 -0
- package/dist/clis/args/{common-CcYbXrBx.mjs → common-CBLen_yt.mjs} +58 -12
- package/dist/clis/args/common-CBLen_yt.mjs.map +1 -0
- package/dist/clis/args/common.d.mts +3 -2
- package/dist/clis/args/common.mjs +1 -1
- package/dist/clis/args/connect.d.mts +449 -2
- package/dist/clis/args/connect.d.mts.map +1 -0
- package/dist/clis/args/connect.mjs +202 -1
- package/dist/clis/args/connect.mjs.map +1 -0
- package/dist/clis/args/{generate-CA916Fvj.mjs → generate-a36SaAn4.mjs} +40 -2
- package/dist/clis/args/generate-a36SaAn4.mjs.map +1 -0
- package/dist/clis/args/generate.d.mts +102 -2
- package/dist/clis/args/generate.d.mts.map +1 -0
- package/dist/clis/args/generate.mjs +1 -1
- package/dist/clis/args/{help-Bqbgbalu.mjs → help-Cb66IK-J.mjs} +59 -16
- package/dist/clis/args/help-Cb66IK-J.mjs.map +1 -0
- package/dist/clis/args/help-CmnOv3z3.d.mts +227 -0
- package/dist/clis/args/help-CmnOv3z3.d.mts.map +1 -0
- package/dist/clis/args/help.d.mts +3 -2
- package/dist/clis/args/help.mjs +14 -1
- package/dist/clis/args/host.d.mts +23 -0
- package/dist/clis/args/host.d.mts.map +1 -0
- package/dist/clis/args/host.mjs +35 -0
- package/dist/clis/args/host.mjs.map +1 -0
- package/dist/clis/args/index.d.mts +22 -19
- package/dist/clis/args/index.mjs +21 -19
- package/dist/clis/args/init.d.mts +54 -2
- package/dist/clis/args/init.d.mts.map +1 -0
- package/dist/clis/args/init.mjs +71 -1
- package/dist/clis/args/init.mjs.map +1 -0
- package/dist/clis/args/inspect.d.mts +12 -2
- package/dist/clis/args/inspect.d.mts.map +1 -0
- package/dist/clis/args/inspect.mjs +14 -1
- package/dist/clis/args/inspect.mjs.map +1 -0
- package/dist/clis/args/install.d.mts +36 -2
- package/dist/clis/args/install.d.mts.map +1 -0
- package/dist/clis/args/install.mjs +31 -1
- package/dist/clis/args/install.mjs.map +1 -0
- package/dist/clis/args/list.d.mts +9 -2
- package/dist/clis/args/list.d.mts.map +1 -0
- package/dist/clis/args/list.mjs +6 -1
- package/dist/clis/args/list.mjs.map +1 -0
- package/dist/clis/args/login.d.mts +24 -2
- package/dist/clis/args/login.d.mts.map +1 -0
- package/dist/clis/args/login.mjs +39 -1
- package/dist/clis/args/login.mjs.map +1 -0
- package/dist/clis/args/mcp.d.mts +15 -0
- package/dist/clis/args/mcp.d.mts.map +1 -0
- package/dist/clis/args/mcp.mjs +22 -0
- package/dist/clis/args/mcp.mjs.map +1 -0
- package/dist/clis/args/migrate.d.mts +18 -2
- package/dist/clis/args/migrate.d.mts.map +1 -0
- package/dist/clis/args/migrate.mjs +27 -1
- package/dist/clis/args/migrate.mjs.map +1 -0
- package/dist/clis/args/publish.d.mts +15 -2
- package/dist/clis/args/publish.d.mts.map +1 -0
- package/dist/clis/args/publish.mjs +18 -1
- package/dist/clis/args/publish.mjs.map +1 -0
- package/dist/clis/args/registry.d.mts +16 -2
- package/dist/clis/args/registry.d.mts.map +1 -0
- package/dist/clis/args/registry.mjs +22 -1
- package/dist/clis/args/registry.mjs.map +1 -0
- package/dist/clis/args/run.d.mts +18 -0
- package/dist/clis/args/run.d.mts.map +1 -0
- package/dist/clis/args/run.mjs +28 -0
- package/dist/clis/args/run.mjs.map +1 -0
- package/dist/clis/args/service-IZ0Aq58z.d.mts +27 -0
- package/dist/clis/args/service-IZ0Aq58z.d.mts.map +1 -0
- package/dist/clis/args/service.d.mts +3 -2
- package/dist/clis/args/service.mjs +10 -1
- package/dist/clis/args/service.mjs.map +1 -0
- package/dist/clis/args/switchboard.d.mts +69 -2
- package/dist/clis/args/switchboard.d.mts.map +1 -0
- package/dist/clis/args/switchboard.mjs +84 -1
- package/dist/clis/args/switchboard.mjs.map +1 -0
- package/dist/clis/args/uninstall.d.mts +27 -2
- package/dist/clis/args/uninstall.d.mts.map +1 -0
- package/dist/clis/args/uninstall.mjs +15 -1
- package/dist/clis/args/uninstall.mjs.map +1 -0
- package/dist/clis/args/unpublish.d.mts +21 -2
- package/dist/clis/args/unpublish.d.mts.map +1 -0
- package/dist/clis/args/unpublish.mjs +29 -1
- package/dist/clis/args/unpublish.mjs.map +1 -0
- package/dist/clis/args/{vetra-b4KUu1Ax.mjs → vetra-DlAEC_Mv.mjs} +18 -2
- package/dist/clis/args/vetra-DlAEC_Mv.mjs.map +1 -0
- package/dist/clis/args/vetra.d.mts +113 -2
- package/dist/clis/args/vetra.d.mts.map +1 -0
- package/dist/clis/args/vetra.mjs +1 -1
- package/dist/clis/build-config-xZgi0nyb.mjs +278 -0
- package/dist/clis/build-config-xZgi0nyb.mjs.map +1 -0
- package/dist/clis/build-config.d.mts +56 -10616
- package/dist/clis/build-config.d.mts.map +1 -1
- package/dist/clis/build-config.mjs +2 -88
- package/dist/clis/build-pieces.d.mts +160 -0
- package/dist/clis/build-pieces.d.mts.map +1 -0
- package/dist/clis/build-pieces.mjs +549 -0
- package/dist/clis/build-pieces.mjs.map +1 -0
- package/dist/clis/command-names.d.mts +6 -2
- package/dist/clis/command-names.d.mts.map +1 -1
- package/dist/clis/command-names.mjs +8 -1
- package/dist/clis/command-names.mjs.map +1 -1
- package/dist/clis/constants.d.mts +3 -462
- package/dist/clis/constants.mjs +87 -21
- package/dist/clis/constants.mjs.map +1 -1
- package/dist/clis/feature-flags.d.mts +17 -0
- package/dist/clis/feature-flags.d.mts.map +1 -0
- package/dist/clis/feature-flags.mjs +21 -0
- package/dist/clis/feature-flags.mjs.map +1 -0
- package/dist/clis/index-DnZYG-8g.d.mts +11154 -0
- package/dist/clis/index-DnZYG-8g.d.mts.map +1 -0
- package/dist/clis/index.d.mts +3474 -1967
- package/dist/clis/index.d.mts.map +1 -1
- package/dist/clis/index.mjs +1208 -875
- package/dist/clis/index.mjs.map +1 -1
- package/dist/clis/package-style.d.mts +32 -0
- package/dist/clis/package-style.d.mts.map +1 -0
- package/dist/clis/package-style.mjs +102 -0
- package/dist/clis/package-style.mjs.map +1 -0
- package/dist/clis/ph-dir.d.mts +26 -0
- package/dist/clis/ph-dir.d.mts.map +1 -0
- package/dist/clis/ph-dir.mjs +37 -0
- package/dist/clis/ph-dir.mjs.map +1 -0
- package/dist/clis/project-env.d.mts +10 -4
- package/dist/clis/project-env.d.mts.map +1 -1
- package/dist/clis/project-env.mjs +16 -1
- package/dist/clis/project-env.mjs.map +1 -1
- package/dist/clis/project-ports.d.mts +5 -5
- package/dist/clis/project-ports.d.mts.map +1 -1
- package/dist/clis/project-ports.mjs +1 -1
- package/dist/clis/project-ports.mjs.map +1 -1
- package/dist/clis/rolldown-runtime-B4iAMlE-.mjs +35 -0
- package/dist/clis/services/telemetry.d.mts +7 -7
- package/dist/clis/services/telemetry.d.mts.map +1 -1
- package/dist/clis/services/telemetry.mjs.map +1 -1
- package/dist/clis/types-DKuZRMVO.d.mts +2353 -0
- package/dist/clis/types-DKuZRMVO.d.mts.map +1 -0
- package/dist/clis/utils.d.mts +4 -4
- package/dist/clis/utils.d.mts.map +1 -1
- package/dist/clis/utils.mjs.map +1 -1
- package/dist/{config-loader-B845Hidf.js → config-loader-B7SqNz8z.js} +50 -12
- package/dist/config-loader-B7SqNz8z.js.map +1 -0
- package/dist/connect/config-loader.d.ts +21 -8
- package/dist/connect/config-loader.d.ts.map +1 -1
- package/dist/connect/config-loader.js +2 -2
- package/dist/connect/connect-config-schema.d.ts +3 -0
- package/dist/connect/connect-config-schema.js +449 -0
- package/dist/connect/connect-config-schema.js.map +1 -0
- package/dist/connect/image-ref.d.ts +32 -0
- package/dist/connect/image-ref.d.ts.map +1 -0
- package/dist/connect/image-ref.js +80 -0
- package/dist/connect/image-ref.js.map +1 -0
- package/dist/connect/index.d.ts +226 -643
- package/dist/connect/index.d.ts.map +1 -1
- package/dist/connect/index.js +443 -507
- package/dist/connect/index.js.map +1 -1
- package/dist/connect/json-adapter.d.ts +3 -4
- package/dist/connect/json-adapter.d.ts.map +1 -1
- package/dist/connect/json-adapter.js.map +1 -1
- package/dist/connect/origin-placeholder.d.ts +52 -0
- package/dist/connect/origin-placeholder.d.ts.map +1 -0
- package/dist/connect/origin-placeholder.js +101 -0
- package/dist/connect/origin-placeholder.js.map +1 -0
- package/dist/connect-config-schema-CsotSch2.d.ts +1736 -0
- package/dist/connect-config-schema-CsotSch2.d.ts.map +1 -0
- package/dist/constants-5UFY_rXh.d.ts +9 -0
- package/dist/constants-5UFY_rXh.d.ts.map +1 -0
- package/dist/constants.d.ts +3 -2
- package/dist/constants.js +17 -5
- package/dist/constants.js.map +1 -1
- package/dist/document-drive/index.d.ts +103 -101
- package/dist/document-drive/index.d.ts.map +1 -1
- package/dist/document-drive/index.js +41 -32
- package/dist/document-drive/index.js.map +1 -1
- package/dist/document-model/action-id.d.ts +3 -0
- package/dist/document-model/action-id.js +59 -0
- package/dist/document-model/action-id.js.map +1 -0
- package/dist/document-model/dispatch.d.ts +25 -0
- package/dist/document-model/dispatch.d.ts.map +1 -0
- package/dist/document-model/dispatch.js +0 -0
- package/dist/document-model/errors.d.ts +3 -0
- package/dist/document-model/errors.js +152 -0
- package/dist/document-model/errors.js.map +1 -0
- package/dist/document-model/index.d.ts +7 -4
- package/dist/document-model/index.js +7 -5143
- package/dist/document-model/mock.d.ts +2 -3
- package/dist/document-model/mock.d.ts.map +1 -1
- package/dist/document-model/mock.js +2 -1
- package/dist/document-model/mock.js.map +1 -1
- package/dist/document-model/utils.d.ts +4 -2
- package/dist/document-model/utils.js +3 -2
- package/dist/document-model/version.d.ts +3 -0
- package/dist/document-model/version.js +8 -0
- package/dist/document-model/version.js.map +1 -0
- package/dist/document-model-D8Z3NUYl.js +5202 -0
- package/dist/document-model-D8Z3NUYl.js.map +1 -0
- package/dist/host-tokens/index.d.ts +3 -0
- package/dist/host-tokens/index.js +2 -0
- package/dist/host-tokens-DOeyxqLi.js +322 -0
- package/dist/host-tokens-DOeyxqLi.js.map +1 -0
- package/dist/index-D58WVj_E.d.ts +246 -0
- package/dist/index-D58WVj_E.d.ts.map +1 -0
- package/dist/index-iCvF3gYi.d.ts +36 -0
- package/dist/index-iCvF3gYi.d.ts.map +1 -0
- package/dist/index.d.ts +7 -6
- package/dist/index.js.map +1 -1
- package/dist/processors/index.d.ts +3 -2
- package/dist/processors/index.js +180 -67
- package/dist/processors/index.js.map +1 -1
- package/dist/processors/testing.d.ts +22 -0
- package/dist/processors/testing.d.ts.map +1 -0
- package/dist/processors/testing.js +77 -0
- package/dist/processors/testing.js.map +1 -0
- package/dist/purge-YMJM0Vl7.js +402 -0
- package/dist/purge-YMJM0Vl7.js.map +1 -0
- package/dist/registry/index.d.ts +15 -15
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +64 -12
- package/dist/registry/index.js.map +1 -1
- package/dist/registry/manifest-slim.d.ts +4 -3
- package/dist/registry/manifest-slim.d.ts.map +1 -1
- package/dist/registry/manifest-slim.js +21 -0
- package/dist/registry/manifest-slim.js.map +1 -1
- package/dist/registry/updates.d.ts +3 -3
- package/dist/registry/updates.d.ts.map +1 -1
- package/dist/registry/updates.js.map +1 -1
- package/dist/registry/urls.d.ts +2 -2
- package/dist/registry/urls.d.ts.map +1 -1
- package/dist/registry/urls.js.map +1 -1
- package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
- package/dist/{types-C1in4fl3.d.ts → types-Bsp8VL2y.d.ts} +2 -2
- package/dist/types-Bsp8VL2y.d.ts.map +1 -0
- package/dist/types-CJNZYvPc.d.ts +4547 -0
- package/dist/types-CJNZYvPc.d.ts.map +1 -0
- package/dist/{types-YqLqb0Zb.d.ts → types-avXn3ESK.d.ts} +39 -43
- package/dist/types-avXn3ESK.d.ts.map +1 -0
- package/dist/{utils-DP122OSS.d.ts → utils-BrKxCmKx.d.ts} +2 -2
- package/dist/utils-BrKxCmKx.d.ts.map +1 -0
- package/dist/{utils-aaTmfxFW.js → utils-CSF716ux.js} +10 -3
- package/dist/utils-CSF716ux.js.map +1 -0
- package/dist/utils-MrLmLEVr.js +78 -0
- package/dist/utils-MrLmLEVr.js.map +1 -0
- package/dist/version-BxLITo9P.d.ts +6 -0
- package/dist/version-BxLITo9P.d.ts.map +1 -0
- package/package.json +34 -7
- package/dist/clis/args/access-token--9H57y8J.d.mts +0 -18
- package/dist/clis/args/access-token--9H57y8J.d.mts.map +0 -1
- package/dist/clis/args/access-token-To5LaIfL.mjs +0 -22
- package/dist/clis/args/access-token-To5LaIfL.mjs.map +0 -1
- package/dist/clis/args/common-CcYbXrBx.mjs.map +0 -1
- package/dist/clis/args/common-Dsf1vpHV.d.mts +0 -183
- package/dist/clis/args/common-Dsf1vpHV.d.mts.map +0 -1
- package/dist/clis/args/connect-BVVvCmL9.mjs +0 -198
- package/dist/clis/args/connect-BVVvCmL9.mjs.map +0 -1
- package/dist/clis/args/connect-DetTnI8g.d.mts +0 -443
- package/dist/clis/args/connect-DetTnI8g.d.mts.map +0 -1
- package/dist/clis/args/generate-CA916Fvj.mjs.map +0 -1
- package/dist/clis/args/generate-DnV-bfXt.d.mts +0 -87
- package/dist/clis/args/generate-DnV-bfXt.d.mts.map +0 -1
- package/dist/clis/args/help-Bqbgbalu.mjs.map +0 -1
- package/dist/clis/args/help-CjAsudUn.d.mts +0 -193
- package/dist/clis/args/help-CjAsudUn.d.mts.map +0 -1
- package/dist/clis/args/init-CUXyfquF.d.mts +0 -55
- package/dist/clis/args/init-CUXyfquF.d.mts.map +0 -1
- package/dist/clis/args/init-rz9Ei7nq.mjs +0 -67
- package/dist/clis/args/init-rz9Ei7nq.mjs.map +0 -1
- package/dist/clis/args/inspect-DtZeoA5c.d.mts +0 -15
- package/dist/clis/args/inspect-DtZeoA5c.d.mts.map +0 -1
- package/dist/clis/args/inspect-tckH8mSw.mjs +0 -15
- package/dist/clis/args/inspect-tckH8mSw.mjs.map +0 -1
- package/dist/clis/args/install-CkP8zcHb.d.mts +0 -40
- package/dist/clis/args/install-CkP8zcHb.d.mts.map +0 -1
- package/dist/clis/args/install-Sz2DlCHh.mjs +0 -32
- package/dist/clis/args/install-Sz2DlCHh.mjs.map +0 -1
- package/dist/clis/args/list-BGf8s_gj.d.mts +0 -12
- package/dist/clis/args/list-BGf8s_gj.d.mts.map +0 -1
- package/dist/clis/args/list-DM2d6f1m.mjs +0 -7
- package/dist/clis/args/list-DM2d6f1m.mjs.map +0 -1
- package/dist/clis/args/login-DNsHwvqk.d.mts +0 -27
- package/dist/clis/args/login-DNsHwvqk.d.mts.map +0 -1
- package/dist/clis/args/login-DiKT5Jfu.mjs +0 -40
- package/dist/clis/args/login-DiKT5Jfu.mjs.map +0 -1
- package/dist/clis/args/magic-string.es-h_0HDQBQ.mjs +0 -1013
- package/dist/clis/args/magic-string.es-h_0HDQBQ.mjs.map +0 -1
- package/dist/clis/args/migrate-CG_gWc4k.mjs +0 -29
- package/dist/clis/args/migrate-CG_gWc4k.mjs.map +0 -1
- package/dist/clis/args/migrate-sixkWhxm.d.mts +0 -21
- package/dist/clis/args/migrate-sixkWhxm.d.mts.map +0 -1
- package/dist/clis/args/publish-DDZYsUfV.mjs +0 -19
- package/dist/clis/args/publish-DDZYsUfV.mjs.map +0 -1
- package/dist/clis/args/publish-Dqe5DUst.d.mts +0 -18
- package/dist/clis/args/publish-Dqe5DUst.d.mts.map +0 -1
- package/dist/clis/args/registry-C_OVFQmI.mjs +0 -23
- package/dist/clis/args/registry-C_OVFQmI.mjs.map +0 -1
- package/dist/clis/args/registry-C_RfTsKB.d.mts +0 -19
- package/dist/clis/args/registry-C_RfTsKB.d.mts.map +0 -1
- package/dist/clis/args/service-CHOOr0Gg.mjs +0 -11
- package/dist/clis/args/service-CHOOr0Gg.mjs.map +0 -1
- package/dist/clis/args/service-DhIkf8-O.d.mts +0 -22
- package/dist/clis/args/service-DhIkf8-O.d.mts.map +0 -1
- package/dist/clis/args/switchboard-BlPaq2at.d.mts +0 -72
- package/dist/clis/args/switchboard-BlPaq2at.d.mts.map +0 -1
- package/dist/clis/args/switchboard-Dsp7nosi.mjs +0 -85
- package/dist/clis/args/switchboard-Dsp7nosi.mjs.map +0 -1
- package/dist/clis/args/uninstall-BpA3YYbw.d.mts +0 -31
- package/dist/clis/args/uninstall-BpA3YYbw.d.mts.map +0 -1
- package/dist/clis/args/uninstall-CTwTX0u_.mjs +0 -16
- package/dist/clis/args/uninstall-CTwTX0u_.mjs.map +0 -1
- package/dist/clis/args/unpublish-BPMkGEg5.mjs +0 -30
- package/dist/clis/args/unpublish-BPMkGEg5.mjs.map +0 -1
- package/dist/clis/args/unpublish-CvwaIimG.d.mts +0 -24
- package/dist/clis/args/unpublish-CvwaIimG.d.mts.map +0 -1
- package/dist/clis/args/vetra-DLQ6lhLl.d.mts +0 -113
- package/dist/clis/args/vetra-DLQ6lhLl.d.mts.map +0 -1
- package/dist/clis/args/vetra-b4KUu1Ax.mjs.map +0 -1
- package/dist/clis/args/vetra-ports.test.d.mts +0 -1
- package/dist/clis/args/vetra-ports.test.mjs +0 -13249
- package/dist/clis/args/vetra-ports.test.mjs.map +0 -1
- package/dist/clis/build-config.mjs.map +0 -1
- package/dist/clis/constants.d.mts.map +0 -1
- package/dist/config-loader-B845Hidf.js.map +0 -1
- package/dist/constants-BP_gjn8g.d.ts +0 -8
- package/dist/constants-BP_gjn8g.d.ts.map +0 -1
- package/dist/document-model/index.js.map +0 -1
- package/dist/index-C_iVZe7f.d.ts +0 -7
- package/dist/index-C_iVZe7f.d.ts.map +0 -1
- package/dist/index-DyYIJtVy.d.ts +0 -836
- package/dist/index-DyYIJtVy.d.ts.map +0 -1
- package/dist/types-C1in4fl3.d.ts.map +0 -1
- package/dist/types-CpnWmiFY.d.ts +0 -3167
- package/dist/types-CpnWmiFY.d.ts.map +0 -1
- package/dist/types-YqLqb0Zb.d.ts.map +0 -1
- package/dist/utils-DP122OSS.d.ts.map +0 -1
- package/dist/utils-aaTmfxFW.js.map +0 -1
|
@@ -0,0 +1,4547 @@
|
|
|
1
|
+
import { f as IAnalyticsStore } from "./types-Bsp8VL2y.js";
|
|
2
|
+
import { A as connectPwaCacheStrategySchema, B as connectRenownAdaptersSchema, C as connectHomeSchema, D as connectLoaderSchema, E as connectLengthSchema, G as connectRuntimeInstanceSchema, H as connectRenownRainbowAdapterSchema, I as connectPwaUrlPatternSchema, J as connectSchemedColorSchema, K as connectRuntimePwaManifestSchema, L as connectReactorClientModeSchema, M as connectPwaIconSchema, O as connectOpenPanelSchema, P as connectPwaRuntimeCachingSchema, R as connectReactorFeatureFlagsSchema, S as connectExplorerIconsSchema, U as connectRenownSchema, V as connectRenownPrivyAdapterSchema, W as connectRuntimeConfigSchema, X as connectSentrySchema, Y as connectSchemedImageSchema, Z as connect_config_schema_d_exports, a as connectAiSchema, b as connectDrivesSchema, c as connectBackgroundLayersSchema, d as connectCompositionEntrySchema, g as connectDefaultDriveSchema, h as connectDefaultDriveRemoteSchema, j as connectPwaFileHandlerSchema, k as connectPackagesSchema, l as connectBackgroundSchema, m as connectDefaultDriveLocalSchema, o as connectAppSchema, q as connectRuntimePwaSchema, s as connectBackgroundLayerSchema, u as connectBrandingSchema, v as connectDriveSectionSchema, w as connectImageRefSchema, x as connectEdgesSchema, y as connectDriveSectionsSchema, z as connectReactorSchema } from "./connect-config-schema-CsotSch2.js";
|
|
3
|
+
import "./utils-BrKxCmKx.js";
|
|
4
|
+
import { ZodIssue, ZodRawShape, z } from "zod";
|
|
5
|
+
import { Draft } from "mutative";
|
|
6
|
+
import { Kysely, QueryCreator } from "kysely";
|
|
7
|
+
import { ArgParser } from "cmd-ts/dist/cjs/argparser.js";
|
|
8
|
+
import { Agent } from "package-manager-detector";
|
|
9
|
+
import { DispatchOutcome, DocumentDispatch, DocumentDispatch as DocumentDispatch$1, RejectedAction } from "@powerhousedao/shared/document-model/dispatch";
|
|
10
|
+
import { OperationWithContext } from "@powerhousedao/shared/document-model";
|
|
11
|
+
import { IncomingMessage, ServerResponse } from "node:http";
|
|
12
|
+
import { FC, ReactNode } from "react";
|
|
13
|
+
//#region clis/args/common.d.ts
|
|
14
|
+
declare const getPackageManagerCommand: Partial<import("cmd-ts/dist/cjs/argparser.js").Register> & {
|
|
15
|
+
parse(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<{
|
|
16
|
+
packageManager: Agent | undefined;
|
|
17
|
+
npm: boolean | undefined;
|
|
18
|
+
pnpm: boolean | undefined;
|
|
19
|
+
yarn: boolean | undefined;
|
|
20
|
+
bun: boolean | undefined;
|
|
21
|
+
}>>;
|
|
22
|
+
} & import("cmd-ts/dist/cjs/helpdoc.js").PrintHelp & import("cmd-ts/dist/cjs/helpdoc.js").ProvidesHelp & import("cmd-ts/dist/cjs/helpdoc.js").Named & Partial<import("cmd-ts/dist/cjs/helpdoc.js").Versioned> & import("cmd-ts/dist/cjs/argparser.js").Register & import("cmd-ts/dist/cjs/runner.js").Handling<{
|
|
23
|
+
packageManager: Agent | undefined;
|
|
24
|
+
npm: boolean | undefined;
|
|
25
|
+
pnpm: boolean | undefined;
|
|
26
|
+
yarn: boolean | undefined;
|
|
27
|
+
bun: boolean | undefined;
|
|
28
|
+
}, {
|
|
29
|
+
packageManager: Agent | undefined;
|
|
30
|
+
npm: boolean | undefined;
|
|
31
|
+
pnpm: boolean | undefined;
|
|
32
|
+
yarn: boolean | undefined;
|
|
33
|
+
bun: boolean | undefined;
|
|
34
|
+
}> & {
|
|
35
|
+
run(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<{
|
|
36
|
+
packageManager: Agent | undefined;
|
|
37
|
+
npm: boolean | undefined;
|
|
38
|
+
pnpm: boolean | undefined;
|
|
39
|
+
yarn: boolean | undefined;
|
|
40
|
+
bun: boolean | undefined;
|
|
41
|
+
}>>;
|
|
42
|
+
} & Partial<import("cmd-ts/dist/cjs/helpdoc.js").Versioned & import("cmd-ts/dist/cjs/helpdoc.js").Descriptive & import("cmd-ts/dist/cjs/helpdoc.js").Aliased>;
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region processors/constants.d.ts
|
|
45
|
+
declare const PROCESSOR_APPS: readonly ["connect", "switchboard"];
|
|
46
|
+
declare const DEFAULT_RELATIONAL_PROCESSOR_DB_NAME = "relational-db";
|
|
47
|
+
declare const DEFAULT_ANALYTICS_PROCESSOR_DB_NAME = "analytics-db";
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region document-model/signatures.d.ts
|
|
50
|
+
type Signature = [string, string, string, string, string];
|
|
51
|
+
/**
|
|
52
|
+
* A user action signer.
|
|
53
|
+
*/
|
|
54
|
+
type UserActionSigner = {
|
|
55
|
+
address: string;
|
|
56
|
+
networkId: string;
|
|
57
|
+
chainId: number;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* An app action signer.
|
|
61
|
+
*/
|
|
62
|
+
type AppActionSigner = {
|
|
63
|
+
name: string;
|
|
64
|
+
key: string;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* An action signer.
|
|
68
|
+
*/
|
|
69
|
+
type ActionSigner = {
|
|
70
|
+
user: UserActionSigner;
|
|
71
|
+
app: AppActionSigner;
|
|
72
|
+
signatures: Signature[];
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Information to verify the document creator.
|
|
76
|
+
*/
|
|
77
|
+
type PHDocumentSignatureInfo = {
|
|
78
|
+
/**
|
|
79
|
+
* The public key of the document creator.
|
|
80
|
+
**/
|
|
81
|
+
publicKey: JsonWebKey;
|
|
82
|
+
/** 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") */
|
|
100
|
+
algorithm: string;
|
|
101
|
+
/** The encoding format for the hash output (e.g., "base64", "hex") */
|
|
102
|
+
encoding: string;
|
|
103
|
+
/** Optional algorithm-specific parameters */
|
|
104
|
+
params?: Record<string, unknown>;
|
|
105
|
+
};
|
|
106
|
+
//#endregion
|
|
107
|
+
//#region document-model/operations.d.ts
|
|
108
|
+
declare function setNameOperation<TDocument extends PHDocument$1>(document: TDocument, input: {
|
|
109
|
+
name: string;
|
|
110
|
+
}): TDocument & {
|
|
111
|
+
header: {
|
|
112
|
+
name: string;
|
|
113
|
+
id: string;
|
|
114
|
+
sig: PHDocumentSignatureInfo;
|
|
115
|
+
documentType: string;
|
|
116
|
+
createdAtUtcIso: string;
|
|
117
|
+
slug: string;
|
|
118
|
+
branch: string;
|
|
119
|
+
revision: {
|
|
120
|
+
[scope: string]: number;
|
|
121
|
+
};
|
|
122
|
+
lastModifiedAtUtcIso: string;
|
|
123
|
+
protocolVersions?: {
|
|
124
|
+
[key: string]: number;
|
|
125
|
+
};
|
|
126
|
+
meta?: PHDocumentMeta;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
declare function setPreferredEditorOperation<TDocument extends PHDocument$1>(document: TDocument, input: {
|
|
130
|
+
preferredEditor: string | null;
|
|
131
|
+
}): TDocument;
|
|
132
|
+
declare function undoOperation<TDocument extends PHDocument$1>(document: TDocument, action: Action, skip: number): {
|
|
133
|
+
document: TDocument;
|
|
134
|
+
action: Action;
|
|
135
|
+
skip: number;
|
|
136
|
+
reuseLastOperationIndex: boolean;
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* V2 of undoOperation for protocol version 2+.
|
|
140
|
+
* Key differences from undoOperation:
|
|
141
|
+
* - Never reuses operation index (always increments)
|
|
142
|
+
* - Always sets skip=1 (consecutive NOOPs are handled during rebuild/GC)
|
|
143
|
+
* - No complex skip calculation - simpler model where each UNDO is independent
|
|
144
|
+
*/
|
|
145
|
+
declare function undoOperationV2<TDocument extends PHDocument$1>(document: TDocument, action: Action, skip: number): {
|
|
146
|
+
document: TDocument;
|
|
147
|
+
action: Action;
|
|
148
|
+
skip: number;
|
|
149
|
+
reuseLastOperationIndex: false;
|
|
150
|
+
};
|
|
151
|
+
declare function redoOperation<TDocument extends PHDocument$1>(document: TDocument, action: Action, skip: number): {
|
|
152
|
+
document: TDocument;
|
|
153
|
+
action: Action;
|
|
154
|
+
skip: number;
|
|
155
|
+
reuseLastOperationIndex: boolean;
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* An operation that was applied to a {@link BaseDocument}.
|
|
159
|
+
*
|
|
160
|
+
* @remarks
|
|
161
|
+
* Wraps an action with an index, to be added to the operations history of a Document.
|
|
162
|
+
* The `index` field is used to keep all operations in order and enable replaying the
|
|
163
|
+
* document's history from the beginning. Note that indices and skips are relative to
|
|
164
|
+
* a specific reactor. Example below:
|
|
165
|
+
*
|
|
166
|
+
* For (index, skip, ts, action)
|
|
167
|
+
* A - [(0, 0, 1, "A0"), (1, 0, 2, "A1")]
|
|
168
|
+
* B - [(0, 0, 0, "B0"), (1, 0, 3, "B1")]
|
|
169
|
+
* ...
|
|
170
|
+
* B gets A's Operations Scenario:
|
|
171
|
+
* B' - [(0, 0, 0, "B0"), (1, 0, 3, "B1"), (2, 1, 1, "A0"), (3, 0, 2, "A1"), (4, 0, 3, "B1")]
|
|
172
|
+
* Then A needs to end up with:
|
|
173
|
+
* 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")]
|
|
174
|
+
* So that both A and B end up with the stream of actions (action):
|
|
175
|
+
* [("B0"), ("A0"), ("A1"), ("B1")]
|
|
176
|
+
*
|
|
177
|
+
* @typeParam A - The type of the action.
|
|
178
|
+
*/
|
|
179
|
+
type Operation = {
|
|
180
|
+
/**
|
|
181
|
+
* This is a stable id, derived from various document and action properties
|
|
182
|
+
* in deriveOperationId().
|
|
183
|
+
*
|
|
184
|
+
* It _cannot_ be an arbitrary string.
|
|
185
|
+
*
|
|
186
|
+
* It it also not unique per operation, as reshuffled operations will keep'
|
|
187
|
+
* the same id they had before they were reshuffled. This means that the
|
|
188
|
+
* IOperationStore may have multiple operations with the same operation id.
|
|
189
|
+
**/
|
|
190
|
+
id: string;
|
|
191
|
+
/** Position of the operation in the history. This is relative to a specific reactor -- they may not all agree on this value. */
|
|
192
|
+
index: number;
|
|
193
|
+
/** The number of operations skipped with this Operation. This is relative to a specific reactor -- they may not all agree on this value. */
|
|
194
|
+
skip: number;
|
|
195
|
+
/** Timestamp of when the operation was added */
|
|
196
|
+
timestampUtcMs: string;
|
|
197
|
+
/** Hash of the resulting document data after the operation */
|
|
198
|
+
hash: string;
|
|
199
|
+
/** Error message for a failed action */
|
|
200
|
+
error?: string;
|
|
201
|
+
/** The name of the error a reducer threw, e.g. "BookNotStartedError"; not stored. */
|
|
202
|
+
errorName?: string;
|
|
203
|
+
/** The `errorCode` of the error a reducer threw, e.g. "BOOK_NOT_STARTED"; not stored. */
|
|
204
|
+
errorCode?: string;
|
|
205
|
+
/**
|
|
206
|
+
* If authorization rejected the action, this records the reason why.
|
|
207
|
+
*/
|
|
208
|
+
deniedReason?: string;
|
|
209
|
+
/** The resulting state after the operation */
|
|
210
|
+
resultingState?: string;
|
|
211
|
+
/**
|
|
212
|
+
* The action that was applied to the document to produce this operation.
|
|
213
|
+
*/
|
|
214
|
+
action: Action;
|
|
215
|
+
};
|
|
216
|
+
/**
|
|
217
|
+
* The operations history of the document by scope.
|
|
218
|
+
*
|
|
219
|
+
* This will be removed in a future release.
|
|
220
|
+
*
|
|
221
|
+
* TODO: Type should be Partial<Record<string, Operation[]>>,
|
|
222
|
+
* but that is a breaking change for codegen + external doc models.
|
|
223
|
+
*/
|
|
224
|
+
type DocumentOperations = Record<string, Operation[]>;
|
|
225
|
+
/**
|
|
226
|
+
* What happened to an operation. An operation that is not `applied` still
|
|
227
|
+
* occupies its index but contributes nothing to the document's state.
|
|
228
|
+
*/
|
|
229
|
+
type OperationOutcome = {
|
|
230
|
+
kind: "applied";
|
|
231
|
+
} | {
|
|
232
|
+
kind: "reducer-error";
|
|
233
|
+
message: string;
|
|
234
|
+
name?: string;
|
|
235
|
+
code?: string;
|
|
236
|
+
} | {
|
|
237
|
+
kind: "denied";
|
|
238
|
+
reason: string;
|
|
239
|
+
};
|
|
240
|
+
/**
|
|
241
|
+
* Reads an operation's outcome. A denial takes precedence over a reducer
|
|
242
|
+
* error, since a denied operation never reaches its reducer.
|
|
243
|
+
*/
|
|
244
|
+
declare function operationOutcome(operation: Operation): OperationOutcome;
|
|
245
|
+
type OperationContext = {
|
|
246
|
+
documentId: string;
|
|
247
|
+
documentType: string;
|
|
248
|
+
scope: string;
|
|
249
|
+
branch: string;
|
|
250
|
+
resultingState?: string;
|
|
251
|
+
ordinal: number;
|
|
252
|
+
};
|
|
253
|
+
type OperationWithContext$1 = {
|
|
254
|
+
operation: Operation;
|
|
255
|
+
context: OperationContext;
|
|
256
|
+
};
|
|
257
|
+
//#endregion
|
|
258
|
+
//#region document-model/signature-policy.d.ts
|
|
259
|
+
/** The `protocolVersions` key that fixes a document's signature requirement. */
|
|
260
|
+
declare const SIGNATURE_PROTOCOL = "signature";
|
|
261
|
+
/** `protocolVersions.signature` of a document that requires v2 tuples. */
|
|
262
|
+
declare const SIGNATURE_PROTOCOL_V2 = 2;
|
|
263
|
+
/** `v2-required`: v2 tuples only and a content-addressed id. */
|
|
264
|
+
type SignaturePolicy$1 = "legacy" | "v2-required";
|
|
265
|
+
/** What a new document is created as unless the caller or host says otherwise. */
|
|
266
|
+
declare const DEFAULT_SIGNATURE_POLICY: SignaturePolicy$1;
|
|
267
|
+
declare function isSignaturePolicy(value: unknown): value is SignaturePolicy$1;
|
|
268
|
+
type ProtocolVersions = {
|
|
269
|
+
[protocol: string]: number;
|
|
270
|
+
};
|
|
271
|
+
/** Read from a header, a CREATE_DOCUMENT input or a bare map. */
|
|
272
|
+
declare function signaturePolicyOf(source: {
|
|
273
|
+
protocolVersions?: ProtocolVersions | null;
|
|
274
|
+
} | ProtocolVersions | null | undefined): SignaturePolicy$1;
|
|
275
|
+
/** `protocolVersions` for a new v2-required document. */
|
|
276
|
+
declare function v2RequiredProtocolVersions(base?: ProtocolVersions): ProtocolVersions;
|
|
277
|
+
/**
|
|
278
|
+
* The policy a create call asks for: `signaturePolicy`, else the `signature`
|
|
279
|
+
* key of its `protocolVersions`, else `fallback`, the host's default.
|
|
280
|
+
*/
|
|
281
|
+
declare function requestedSignaturePolicy(request: {
|
|
282
|
+
signaturePolicy?: SignaturePolicy$1;
|
|
283
|
+
protocolVersions?: ProtocolVersions;
|
|
284
|
+
} | undefined, fallback: SignaturePolicy$1): SignaturePolicy$1;
|
|
285
|
+
/** `protocolVersions` for a new document under `policy`, over `base`. */
|
|
286
|
+
declare function protocolVersionsFor(policy: SignaturePolicy$1, base?: ProtocolVersions): ProtocolVersions;
|
|
287
|
+
/** What the id of a v2-required document is a hash of. */
|
|
288
|
+
type DocumentIdParams = {
|
|
289
|
+
documentType: string;
|
|
290
|
+
createdAtUtcIso: string;
|
|
291
|
+
nonce: string;
|
|
292
|
+
protocolVersions: ProtocolVersions;
|
|
293
|
+
};
|
|
294
|
+
/** `base64url(sha256(canonicalJson(params)))`, unpadded. */
|
|
295
|
+
declare function deriveDocumentId(params: DocumentIdParams): string;
|
|
296
|
+
/** Whether `id` has the shape `deriveDocumentId` produces. */
|
|
297
|
+
declare function isDerivedDocumentId(id: string): boolean;
|
|
298
|
+
//#endregion
|
|
299
|
+
//#region document-model/state.d.ts
|
|
300
|
+
/**
|
|
301
|
+
* Creates a default PHAuthState
|
|
302
|
+
*/
|
|
303
|
+
declare function defaultAuthState(): PHAuthState;
|
|
304
|
+
/**
|
|
305
|
+
* Creates a default PHDocumentState
|
|
306
|
+
*/
|
|
307
|
+
declare function defaultDocumentState(): PHDocumentState;
|
|
308
|
+
/**
|
|
309
|
+
* Creates a default PHBaseState with auth and document properties
|
|
310
|
+
*/
|
|
311
|
+
declare function defaultBaseState(): PHBaseState;
|
|
312
|
+
/**
|
|
313
|
+
* Creates a PHAuthState with the given properties
|
|
314
|
+
*/
|
|
315
|
+
declare function createAuthState(auth?: Partial<PHAuthState>): PHAuthState;
|
|
316
|
+
/**
|
|
317
|
+
* Creates a PHDocumentState with the given properties
|
|
318
|
+
*/
|
|
319
|
+
declare function createDocumentState(document?: Partial<PHDocumentState>): PHDocumentState;
|
|
320
|
+
/**
|
|
321
|
+
* Creates a PHBaseState with the given auth and document properties
|
|
322
|
+
*/
|
|
323
|
+
declare function createBaseState(auth?: Partial<PHAuthState>, document?: Partial<PHDocumentState>): PHBaseState;
|
|
324
|
+
/**
|
|
325
|
+
* Backfills the auth scope to the default for legacy documents serialized with
|
|
326
|
+
* an empty `auth`. Replaces only `state.auth`. Idempotent.
|
|
327
|
+
*/
|
|
328
|
+
declare function backfillAuthState<TState extends PHBaseState>(state: TState): TState;
|
|
329
|
+
/**
|
|
330
|
+
* The document state of the document.
|
|
331
|
+
*/
|
|
332
|
+
type PHDocumentState = {
|
|
333
|
+
/**
|
|
334
|
+
* The current document model schema version of the document. This is used
|
|
335
|
+
* with the UPGRADE_DOCUMENT operation to specify the DocumentModelModule
|
|
336
|
+
* version to use for reducer execution.
|
|
337
|
+
*/
|
|
338
|
+
version: number;
|
|
339
|
+
/** Hash configuration for operation state verification */
|
|
340
|
+
hash: HashConfig;
|
|
341
|
+
/** True if and only if the document has been deleted */
|
|
342
|
+
isDeleted?: boolean;
|
|
343
|
+
/** The timestamp when the document was deleted, in UTC ISO format */
|
|
344
|
+
deletedAtUtcIso?: string;
|
|
345
|
+
/** Optional: who deleted the document */
|
|
346
|
+
deletedBy?: string;
|
|
347
|
+
/** Optional: reason for deletion */
|
|
348
|
+
deletionReason?: string;
|
|
349
|
+
};
|
|
350
|
+
/**
|
|
351
|
+
* The document's authorization policy: an ordered, stacked list of grants,
|
|
352
|
+
* where the last matching grant wins. `{ version: 0, grants: [] }` is
|
|
353
|
+
* uninitialized and leaves the document open.
|
|
354
|
+
*/
|
|
355
|
+
type PHAuthState = {
|
|
356
|
+
/**
|
|
357
|
+
* Policy language version. 0 is the uninitialized state; INITIALIZE_AUTH
|
|
358
|
+
* sets an integer >= 1.
|
|
359
|
+
*/
|
|
360
|
+
version: number;
|
|
361
|
+
grants: Grant[];
|
|
362
|
+
/**
|
|
363
|
+
* The did:key of the auth-policy creator, captured from the INITIALIZE_AUTH
|
|
364
|
+
* signer. The creator may always administer the auth scope, so a grant policy
|
|
365
|
+
* can never lock administration out of itself. Absent for an unsigned genesis.
|
|
366
|
+
*/
|
|
367
|
+
creator?: string;
|
|
368
|
+
};
|
|
369
|
+
type Grant = {
|
|
370
|
+
/** Stable id. */
|
|
371
|
+
id: string;
|
|
372
|
+
description: string;
|
|
373
|
+
effect: "allow" | "deny";
|
|
374
|
+
principal: Principal;
|
|
375
|
+
capability: Capability;
|
|
376
|
+
/**
|
|
377
|
+
* The grant applies only when this condition holds. Until conditions are
|
|
378
|
+
* evaluated, a grant carrying one never applies.
|
|
379
|
+
*/
|
|
380
|
+
where?: Condition;
|
|
381
|
+
};
|
|
382
|
+
type Principal = {
|
|
383
|
+
anyone: true;
|
|
384
|
+
} | {
|
|
385
|
+
address: string;
|
|
386
|
+
} | {
|
|
387
|
+
group: string;
|
|
388
|
+
} | {
|
|
389
|
+
match: Condition;
|
|
390
|
+
};
|
|
391
|
+
/**
|
|
392
|
+
* The folded global state of a PHGroup (powerhouse/reactor-group) document,
|
|
393
|
+
* narrowed to what auth evaluation reads. Membership is matched
|
|
394
|
+
* case-insensitively against the subject's address.
|
|
395
|
+
*/
|
|
396
|
+
type PHGroupState = {
|
|
397
|
+
members: string[];
|
|
398
|
+
};
|
|
399
|
+
/**
|
|
400
|
+
* Folded group states keyed by group document id, as the groups projection
|
|
401
|
+
* provides them. A group id a policy names but the map does not hold fails
|
|
402
|
+
* closed: the principal does not match.
|
|
403
|
+
*/
|
|
404
|
+
type AuthGroups = Record<string, PHGroupState>;
|
|
405
|
+
type Capability = {
|
|
406
|
+
can: "read";
|
|
407
|
+
scope?: string;
|
|
408
|
+
} | {
|
|
409
|
+
can: "execute";
|
|
410
|
+
scope?: string;
|
|
411
|
+
operation?: string[];
|
|
412
|
+
};
|
|
413
|
+
/**
|
|
414
|
+
* Boolean condition language for grants: deterministic, total, and
|
|
415
|
+
* JSON-serializable, versioned by `PHAuthState.version`. Defined now but not
|
|
416
|
+
* yet evaluated or enforced.
|
|
417
|
+
*/
|
|
418
|
+
type Condition = {
|
|
419
|
+
eq: [Operand, Operand];
|
|
420
|
+
} | {
|
|
421
|
+
ne: [Operand, Operand];
|
|
422
|
+
} | {
|
|
423
|
+
in: [Operand, Operand[]];
|
|
424
|
+
} | {
|
|
425
|
+
notIn: [Operand, Operand[]];
|
|
426
|
+
} | {
|
|
427
|
+
lt: [Operand, Operand];
|
|
428
|
+
} | {
|
|
429
|
+
lte: [Operand, Operand];
|
|
430
|
+
} | {
|
|
431
|
+
gt: [Operand, Operand];
|
|
432
|
+
} | {
|
|
433
|
+
gte: [Operand, Operand];
|
|
434
|
+
} | {
|
|
435
|
+
exists: Operand;
|
|
436
|
+
} | {
|
|
437
|
+
and: Condition[];
|
|
438
|
+
} | {
|
|
439
|
+
or: Condition[];
|
|
440
|
+
} | {
|
|
441
|
+
not: Condition;
|
|
442
|
+
};
|
|
443
|
+
/**
|
|
444
|
+
* A condition operand: `attr` is a dotted path into the decision context
|
|
445
|
+
* (e.g. "doc.global.status", "subject.address"); `lit` is a constant value.
|
|
446
|
+
*/
|
|
447
|
+
type Operand = {
|
|
448
|
+
attr: string;
|
|
449
|
+
} | {
|
|
450
|
+
lit: string | number | boolean | null;
|
|
451
|
+
};
|
|
452
|
+
/**
|
|
453
|
+
* The base state of the document.
|
|
454
|
+
*/
|
|
455
|
+
type PHBaseState = {
|
|
456
|
+
/** Carries authentication information. */
|
|
457
|
+
auth: PHAuthState;
|
|
458
|
+
/** Carries information about the document. */
|
|
459
|
+
document: PHDocumentState;
|
|
460
|
+
};
|
|
461
|
+
declare function defaultGlobalState(): DocumentModelGlobalState;
|
|
462
|
+
declare function defaultLocalState(): DocumentModelLocalState;
|
|
463
|
+
declare function defaultPHState(): DocumentModelPHState;
|
|
464
|
+
declare function createGlobalState(state?: Partial<DocumentModelGlobalState>): DocumentModelGlobalState;
|
|
465
|
+
declare function createLocalState(state?: Partial<DocumentModelLocalState>): DocumentModelLocalState;
|
|
466
|
+
declare function createState(baseState?: Partial<PHBaseState>, globalState?: Partial<DocumentModelGlobalState>, localState?: Partial<DocumentModelLocalState>): DocumentModelPHState;
|
|
467
|
+
//#endregion
|
|
468
|
+
//#region document-model/documents.d.ts
|
|
469
|
+
/** Meta information about the document. */
|
|
470
|
+
type PHDocumentMeta = {
|
|
471
|
+
/** The preferred editor for the document. */
|
|
472
|
+
preferredEditor?: string;
|
|
473
|
+
};
|
|
474
|
+
/**
|
|
475
|
+
* The header of a document.
|
|
476
|
+
*/
|
|
477
|
+
type PHDocumentHeader = {
|
|
478
|
+
/**
|
|
479
|
+
* The id of the document.
|
|
480
|
+
*
|
|
481
|
+
* This is a Ed25519 signature and is immutable.
|
|
482
|
+
**/
|
|
483
|
+
id: string;
|
|
484
|
+
/**
|
|
485
|
+
* Information to verify the document creator.
|
|
486
|
+
*
|
|
487
|
+
* This is immutable.
|
|
488
|
+
**/
|
|
489
|
+
sig: PHDocumentSignatureInfo;
|
|
490
|
+
/**
|
|
491
|
+
* The type of the document.
|
|
492
|
+
*
|
|
493
|
+
* This is used as part of the signature payload and thus, cannot be changed
|
|
494
|
+
* after the document header has been created.
|
|
495
|
+
**/
|
|
496
|
+
documentType: string;
|
|
497
|
+
/**
|
|
498
|
+
* The timestamp of the creation date of the document, in UTC ISO format.
|
|
499
|
+
*
|
|
500
|
+
* This is used as part of the signature payload and thus, cannot be changed
|
|
501
|
+
* after the document header has been created.
|
|
502
|
+
**/
|
|
503
|
+
createdAtUtcIso: string;
|
|
504
|
+
/** The slug of the document. */
|
|
505
|
+
slug: string;
|
|
506
|
+
/** The name of the document. */
|
|
507
|
+
name: string;
|
|
508
|
+
/** The branch of this document. */
|
|
509
|
+
branch: string;
|
|
510
|
+
/**
|
|
511
|
+
* The revision of each scope of the document. This object is updated every
|
|
512
|
+
* time any _other_ scope is updated.
|
|
513
|
+
*/
|
|
514
|
+
revision: {
|
|
515
|
+
[scope: string]: number;
|
|
516
|
+
};
|
|
517
|
+
/**
|
|
518
|
+
* The timestamp of the last change in the document, in UTC ISO format.
|
|
519
|
+
**/
|
|
520
|
+
lastModifiedAtUtcIso: string;
|
|
521
|
+
/**
|
|
522
|
+
* This is a map from protocol name to version. A protocol can be any set of
|
|
523
|
+
* rules that are applied to the document.
|
|
524
|
+
*
|
|
525
|
+
* Examples of protocols include:
|
|
526
|
+
*
|
|
527
|
+
* - "base-reducer"
|
|
528
|
+
*/
|
|
529
|
+
protocolVersions?: {
|
|
530
|
+
[key: string]: number;
|
|
531
|
+
};
|
|
532
|
+
/** Meta information about the document. */
|
|
533
|
+
meta?: PHDocumentMeta;
|
|
534
|
+
};
|
|
535
|
+
/**
|
|
536
|
+
* The base type of a document model.
|
|
537
|
+
*
|
|
538
|
+
* @remarks
|
|
539
|
+
* This type is extended by all Document models.
|
|
540
|
+
*
|
|
541
|
+
* @typeParam TState - The type of the document state.
|
|
542
|
+
*/
|
|
543
|
+
type PHDocument$1<TState extends PHBaseState = PHBaseState> = {
|
|
544
|
+
/** The header of the document. */
|
|
545
|
+
header: PHDocumentHeader;
|
|
546
|
+
/** The document model specific state. */
|
|
547
|
+
state: TState;
|
|
548
|
+
/**
|
|
549
|
+
* The initial state of the document, enabling replaying operations.
|
|
550
|
+
*
|
|
551
|
+
* This will be removed in a future release.
|
|
552
|
+
*/
|
|
553
|
+
initialState: TState;
|
|
554
|
+
/**
|
|
555
|
+
* The operations history of the document.
|
|
556
|
+
*
|
|
557
|
+
* Only documents built by reducers carry it. Documents read from a reactor,
|
|
558
|
+
* such as an editor's `document` in Connect, have an empty array per scope;
|
|
559
|
+
* read their history with `useDocumentOperations(document.header.id, scope)`
|
|
560
|
+
* and their operation count with `header.revision[scope]`.
|
|
561
|
+
*
|
|
562
|
+
* This will be removed in a future release.
|
|
563
|
+
*/
|
|
564
|
+
operations: DocumentOperations;
|
|
565
|
+
/**
|
|
566
|
+
* A list of undone operations
|
|
567
|
+
*
|
|
568
|
+
* This will be removed in a future release.
|
|
569
|
+
*/
|
|
570
|
+
clipboard: Operation[];
|
|
571
|
+
};
|
|
572
|
+
declare function isNoopOperation<TOp extends {
|
|
573
|
+
type: string;
|
|
574
|
+
skip: number;
|
|
575
|
+
hash: string;
|
|
576
|
+
}>(op: Partial<TOp>): boolean;
|
|
577
|
+
declare function isUndoRedo(action: Action): action is UndoRedoAction;
|
|
578
|
+
declare function isUndo(action: Action): action is UndoAction;
|
|
579
|
+
declare function isDocumentAction(action: Action): action is DocumentAction;
|
|
580
|
+
/**
|
|
581
|
+
* Creates a new document. When `documentType` is given the header is stamped
|
|
582
|
+
* with it and the document-scope operations are seeded. Without
|
|
583
|
+
* `protocolVersions` the document is v2-required and takes a derived id; with
|
|
584
|
+
* them it is v2-required only if they say so (see {@link protocolVersionsFor}).
|
|
585
|
+
*/
|
|
586
|
+
declare function baseCreateDocument<TState extends PHBaseState = PHBaseState>(createState: CreateState<TState>, initialState?: Partial<TState>, documentType?: string, protocolVersions?: ProtocolVersions): PHDocument$1<TState>;
|
|
587
|
+
/**
|
|
588
|
+
* `document`, not yet created, under a fresh header for `policy`. A legacy
|
|
589
|
+
* header takes `id` when given; a v2-required one ignores `id` and derives its
|
|
590
|
+
* own, so a caller that needs a fixed id must ask for legacy.
|
|
591
|
+
* `protocolVersions` are merged over the document's. Name, slug, branch and
|
|
592
|
+
* meta carry over. A document already under `policy` is returned as is unless
|
|
593
|
+
* a legacy `id` or `protocolVersions` are given.
|
|
594
|
+
*/
|
|
595
|
+
declare function withSignaturePolicy<TDocument extends PHDocument$1>(document: TDocument, policy: SignaturePolicy$1, options?: {
|
|
596
|
+
id?: string;
|
|
597
|
+
protocolVersions?: ProtocolVersions;
|
|
598
|
+
}): TDocument;
|
|
599
|
+
declare function hashDocumentStateForScope(document: {
|
|
600
|
+
state: {
|
|
601
|
+
[key: string]: unknown;
|
|
602
|
+
};
|
|
603
|
+
}, scope?: string): string;
|
|
604
|
+
declare function readOnly<T>(value: T): Readonly<T>;
|
|
605
|
+
/**
|
|
606
|
+
* Maps skipped operations in an array of operations.
|
|
607
|
+
* Skipped operations are operations that are ignored during processing.
|
|
608
|
+
* @param operations - The array of operations to map.
|
|
609
|
+
* @param skippedHeadOperations - The number of operations to skip at the head of the array of operations.
|
|
610
|
+
* @returns An array of mapped operations with ignore flag indicating if the operation is skipped.
|
|
611
|
+
* @throws Error if the operation index is invalid and there are missing operations.
|
|
612
|
+
*/
|
|
613
|
+
declare function mapSkippedOperations(operations: Operation[], skippedHeadOperations?: number): MappedOperation[];
|
|
614
|
+
/**
|
|
615
|
+
* V2 version of mapSkippedOperations for protocol version 2+.
|
|
616
|
+
* In V2, all NOOPs have skip=1 and consecutive NOOPs form chains.
|
|
617
|
+
* N consecutive NOOPs at any point skip N preceding content operations.
|
|
618
|
+
*
|
|
619
|
+
* Algorithm: Process from end to start
|
|
620
|
+
* - When hitting a NOOP: increment chain length, mark as ignored
|
|
621
|
+
* - When hitting a non-NOOP:
|
|
622
|
+
* - If chain > 0: decrement chain, mark as ignored (this op was undone)
|
|
623
|
+
* - If chain == 0: mark as not ignored (apply this op)
|
|
624
|
+
*/
|
|
625
|
+
declare function mapSkippedOperationsV2(operations: Operation[]): MappedOperation[];
|
|
626
|
+
/**
|
|
627
|
+
* V2 garbage collect that returns only operations that should be applied for state.
|
|
628
|
+
* Uses the V2 model where consecutive NOOPs form chains.
|
|
629
|
+
* Unlike V1 garbageCollect, this preserves ALL operations but marks which to apply.
|
|
630
|
+
*/
|
|
631
|
+
/**
|
|
632
|
+
* The base-reducer protocol version a document is written against. Every
|
|
633
|
+
* document carries one, set from the CREATE_DOCUMENT input. A header without
|
|
634
|
+
* one was built outside that path, and choosing a version on its behalf would
|
|
635
|
+
* replay the document through a reducer it was not written for, so it is an
|
|
636
|
+
* error rather than a default.
|
|
637
|
+
*/
|
|
638
|
+
declare function baseReducerVersion(header: PHDocumentHeader): number;
|
|
639
|
+
declare function garbageCollectV2<TOpIndex extends OperationIndex>(sortedOperations: TOpIndex[]): TOpIndex[];
|
|
640
|
+
declare function sortMappedOperations(operations: DocumentOperationsIgnoreMap): MappedOperation[];
|
|
641
|
+
/**
|
|
642
|
+
* Records an operation in the history without applying it, which is what a
|
|
643
|
+
* denied operation needs: it occupies its index and contributes no state.
|
|
644
|
+
*
|
|
645
|
+
* The scope defaults to the action's own, and is passed explicitly by a rebuild
|
|
646
|
+
* that is walking one stream and does not want to trust the action's copy.
|
|
647
|
+
*/
|
|
648
|
+
declare function appendWithoutApplying<TState extends PHBaseState>(document: PHDocument$1<TState>, operation: Operation, scope?: string): PHDocument$1<TState>;
|
|
649
|
+
declare function replayDocument<TState extends PHBaseState = PHBaseState>(initialState: TState, operations: DocumentOperations, reducer: Reducer<TState>, header: PHDocumentHeader, dispatch?: SignalDispatch, skipHeaderOperations?: SkipHeaderOperations, options?: ReplayDocumentOptions): PHDocument$1<TState>;
|
|
650
|
+
declare function parseResultingState<TState>(state: string | null | undefined): TState;
|
|
651
|
+
declare enum IntegrityIssueType {
|
|
652
|
+
UNEXPECTED_INDEX = "UNEXPECTED_INDEX"
|
|
653
|
+
}
|
|
654
|
+
declare enum IntegrityIssueSubType {
|
|
655
|
+
DUPLICATED_INDEX = "DUPLICATED_INDEX",
|
|
656
|
+
MISSING_INDEX = "MISSING_INDEX"
|
|
657
|
+
}
|
|
658
|
+
type IntegrityIssue = {
|
|
659
|
+
operation: OperationIndex;
|
|
660
|
+
issue: IntegrityIssueType;
|
|
661
|
+
category: IntegrityIssueSubType;
|
|
662
|
+
message: string;
|
|
663
|
+
};
|
|
664
|
+
type Reshuffle = (startIndex: OperationIndex, opsA: Operation[], opsB: Operation[]) => Operation[];
|
|
665
|
+
declare function checkCleanedOperationsIntegrity(sortedOperations: OperationIndex[]): IntegrityIssue[];
|
|
666
|
+
declare function garbageCollect<TOpIndex extends OperationIndex>(sortedOperations: TOpIndex[]): TOpIndex[];
|
|
667
|
+
declare function addUndo(sortedOperations: Operation[]): Operation[];
|
|
668
|
+
declare function sortOperations<TOpIndex extends OperationIndex>(operations: TOpIndex[]): TOpIndex[];
|
|
669
|
+
declare function reshuffleByTimestamp<TOp extends OperationIndex>(startIndex: OperationIndex, opsA: TOp[], opsB: TOp[]): TOp[];
|
|
670
|
+
declare function reshuffleByTimestampAndIndex<TOp extends OperationIndex>(startIndex: OperationIndex, opsA: TOp[], opsB: TOp[]): TOp[];
|
|
671
|
+
declare function operationsAreEqual<TOp extends {
|
|
672
|
+
index: number;
|
|
673
|
+
skip: number;
|
|
674
|
+
type?: string;
|
|
675
|
+
scope?: string;
|
|
676
|
+
input?: unknown;
|
|
677
|
+
}>(op1: TOp, op2: TOp): boolean;
|
|
678
|
+
declare function attachBranch(trunk: Operation[], newBranch: Operation[]): [Operation[], Operation[]];
|
|
679
|
+
declare function precedes(op1: OperationIndex, op2: OperationIndex): boolean;
|
|
680
|
+
declare function split(sortedTargetOperations: Operation[], sortedMergeOperations: Operation[]): [Operation[], Operation[], Operation[]];
|
|
681
|
+
declare function merge(sortedTargetOperations: Operation[], sortedMergeOperations: Operation[], reshuffle: Reshuffle): Operation[];
|
|
682
|
+
declare function nextSkipNumber(sortedOperations: OperationIndex[]): number;
|
|
683
|
+
declare function checkOperationsIntegrity(operations: Operation[]): IntegrityIssue[];
|
|
684
|
+
declare function groupOperationsByScope(operations: Operation[]): Partial<Record<string, Operation[]>>;
|
|
685
|
+
type PrepareOperationsResult = {
|
|
686
|
+
validOperations: Operation[];
|
|
687
|
+
invalidOperations: Operation[];
|
|
688
|
+
duplicatedOperations: Operation[];
|
|
689
|
+
integrityIssues: IntegrityIssue[];
|
|
690
|
+
};
|
|
691
|
+
declare function prepareOperations(operationsHistory: Operation[], newOperations: Operation[]): PrepareOperationsResult;
|
|
692
|
+
declare function removeExistingOperations(newOperations: Operation[], operationsHistory: Operation[]): Operation[];
|
|
693
|
+
/**
|
|
694
|
+
* Skips header operations and returns the remaining operations.
|
|
695
|
+
*
|
|
696
|
+
* @param operations - The array of operations.
|
|
697
|
+
* @param skipHeaderOperation - The skip header operation index.
|
|
698
|
+
* @returns The remaining operations after skipping header operations.
|
|
699
|
+
*/
|
|
700
|
+
declare function skipHeaderOperations(operations: Operation[], skipHeaderOperation: SkipHeaderOperationIndex): Operation[];
|
|
701
|
+
declare function garbageCollectDocumentOperations(documentOperations: DocumentOperations): DocumentOperations;
|
|
702
|
+
/**
|
|
703
|
+
* Filters out duplicated operations from the target operations array based on their IDs.
|
|
704
|
+
* If an operation has an ID, it is considered duplicated if there is another operation in the source operations array with the same ID.
|
|
705
|
+
* If an operation does not have an ID, it is considered unique and will not be filtered out.
|
|
706
|
+
* @param targetOperations - The array of target operations to filter.
|
|
707
|
+
* @param sourceOperations - The array of source operations to compare against.
|
|
708
|
+
* @returns An array of operations with duplicates filtered out.
|
|
709
|
+
*/
|
|
710
|
+
declare function filterDuplicatedOperations<T extends {
|
|
711
|
+
id?: string | number;
|
|
712
|
+
}>(targetOperations: T[], sourceOperations: T[]): T[];
|
|
713
|
+
declare function filterDocumentOperationsResultingState(documentOperations?: DocumentOperations): {
|
|
714
|
+
[x: string]: Operation[] | {
|
|
715
|
+
id: string;
|
|
716
|
+
index: number;
|
|
717
|
+
skip: number;
|
|
718
|
+
timestampUtcMs: string;
|
|
719
|
+
hash: string;
|
|
720
|
+
error?: string;
|
|
721
|
+
errorName?: string;
|
|
722
|
+
errorCode?: string;
|
|
723
|
+
deniedReason?: string;
|
|
724
|
+
action: Action;
|
|
725
|
+
}[];
|
|
726
|
+
};
|
|
727
|
+
/**
|
|
728
|
+
* Calculates the difference between two arrays of operations.
|
|
729
|
+
* Returns an array of operations that are present in `clearedOperationsA` but not in `clearedOperationsB`.
|
|
730
|
+
*
|
|
731
|
+
* @template TOp - The type of the operations.
|
|
732
|
+
* @param {TOp[]} clearedOperationsA - The first array of operations.
|
|
733
|
+
* @param {TOp[]} clearedOperationsB - The second array of operations.
|
|
734
|
+
* @returns {TOp[]} - The difference between the two arrays of operations.
|
|
735
|
+
*/
|
|
736
|
+
declare function diffOperations<TOp extends OperationIndex>(clearedOperationsA: TOp[], clearedOperationsB: TOp[]): TOp[];
|
|
737
|
+
declare function getDocumentLastModified(document: PHDocument$1): string;
|
|
738
|
+
/** `revision` with a 0 for each scope of `state` it lacks; auth is not a model scope, so it is left out. */
|
|
739
|
+
declare function withScopeRevisions(revision: PHDocumentHeader["revision"], state: object): PHDocumentHeader["revision"];
|
|
740
|
+
/**
|
|
741
|
+
* Updates the document header with the latest revision number and
|
|
742
|
+
* date of last modification.
|
|
743
|
+
*
|
|
744
|
+
* @param document The current state of the document.
|
|
745
|
+
* @param scope The scope of the operation.
|
|
746
|
+
* @param lastModifiedTimestamp Optional timestamp to use directly, avoiding a scan of all operations.
|
|
747
|
+
* @returns The updated document state.
|
|
748
|
+
*/
|
|
749
|
+
declare function updateHeaderRevision(document: PHDocument$1, scope: string, lastModifiedTimestamp?: string): PHDocument$1;
|
|
750
|
+
//#endregion
|
|
751
|
+
//#region document-model/actions.d.ts
|
|
752
|
+
/**
|
|
753
|
+
* Cancels the last `count` operations.
|
|
754
|
+
*
|
|
755
|
+
* @param count - Number of operations to cancel
|
|
756
|
+
* @category Actions
|
|
757
|
+
*/
|
|
758
|
+
declare const undo: (count?: number, scope?: string) => UndoAction;
|
|
759
|
+
/**
|
|
760
|
+
* Cancels the last `count` {@link undo | UNDO} operations.
|
|
761
|
+
*
|
|
762
|
+
* @param count - Number of UNDO operations to cancel
|
|
763
|
+
* @category Actions
|
|
764
|
+
*/
|
|
765
|
+
declare const redo: (count?: number, scope?: string) => RedoAction;
|
|
766
|
+
declare const noop: (scope?: string) => NOOPAction;
|
|
767
|
+
/**
|
|
768
|
+
* Helper function to be used by action creators.
|
|
769
|
+
*
|
|
770
|
+
* @remarks
|
|
771
|
+
* Creates an action with the given type and input properties. The input
|
|
772
|
+
* properties default to an empty object.
|
|
773
|
+
*
|
|
774
|
+
* @typeParam A - Type of the action to be returned.
|
|
775
|
+
*
|
|
776
|
+
* @param type - The type of the action.
|
|
777
|
+
* @param input - The input properties of the action.
|
|
778
|
+
* @param _attachments - Deprecated and ignored. Retained so action creators
|
|
779
|
+
* generated before the attachment-system removal keep their 5-argument shape.
|
|
780
|
+
* @param validator - The validator to use for the input properties.
|
|
781
|
+
* @param scope - The scope of the action, can either be 'global' or 'local'.
|
|
782
|
+
*
|
|
783
|
+
* @throws Error if the type is empty or not a string.
|
|
784
|
+
*
|
|
785
|
+
* @returns The new action.
|
|
786
|
+
*/
|
|
787
|
+
declare function createAction<TAction extends Action>(type: TAction["type"], input?: TAction["input"], _attachments?: unknown, validator?: () => {
|
|
788
|
+
parse(v: unknown): TAction["input"];
|
|
789
|
+
}, scope?: Action["scope"]): TAction;
|
|
790
|
+
/**
|
|
791
|
+
* This function should be used instead of { ...action } to ensure
|
|
792
|
+
* that extra properties are not included in the action.
|
|
793
|
+
*/
|
|
794
|
+
declare const actionFromAction: (action: Action) => Action;
|
|
795
|
+
declare const operationFromAction: (action: Action, index: number, skip: number, context: OperationContext) => Operation;
|
|
796
|
+
declare const operationFromOperation: (operation: Operation, index: number, skip: number, context: OperationContext) => Operation;
|
|
797
|
+
declare const operationWithContext: (operation: Operation, context: ActionContext) => Operation;
|
|
798
|
+
declare const actionContext: () => ActionContext;
|
|
799
|
+
declare const actionSigner: (user: UserActionSigner, app: AppActionSigner, signatures?: Signature[]) => ActionSigner;
|
|
800
|
+
declare function buildOperationSignature(context: ActionSignatureContext, signMethod: ActionSigningHandler): Promise<Signature>;
|
|
801
|
+
/** @deprecated Emits a legacy SHA-1 tuple; sign through `ISigner.signAction`. */
|
|
802
|
+
declare function buildSignedAction<TState extends PHBaseState = PHBaseState>(action: Action, reducer: Reducer<TState>, document: PHDocument$1<TState>, signer: ActionSigner, signHandler: ActionSigningHandler): Promise<Operation>;
|
|
803
|
+
/** @deprecated Use `verifyActionSignature` from `@powerhousedao/reactor`. */
|
|
804
|
+
declare function verifyOperationSignature(signature: Signature, signer: Omit<ActionSigner, "signatures">, verifyHandler: ActionVerificationHandler): Promise<boolean>;
|
|
805
|
+
/**
|
|
806
|
+
* Changes the name of the document.
|
|
807
|
+
*
|
|
808
|
+
* @param name - The name to be set in the document.
|
|
809
|
+
* @category Actions
|
|
810
|
+
*/
|
|
811
|
+
declare const setName: (name: string | {
|
|
812
|
+
name: string;
|
|
813
|
+
}) => SetNameAction;
|
|
814
|
+
/**
|
|
815
|
+
* Changes the preferred editor recorded in the document header meta.
|
|
816
|
+
*
|
|
817
|
+
* Passing `null` clears the preferred editor.
|
|
818
|
+
*
|
|
819
|
+
* @category Actions
|
|
820
|
+
*/
|
|
821
|
+
declare const setPreferredEditor: (input: string | null | {
|
|
822
|
+
preferredEditor: string | null;
|
|
823
|
+
}) => SetPreferredEditorAction;
|
|
824
|
+
declare const setModelName: (input: SetModelNameInput) => SetModelNameAction;
|
|
825
|
+
declare const setModelId: (input: SetModelIdInput) => SetModelIdAction;
|
|
826
|
+
declare const setModelExtension: (input: SetModelExtensionInput) => SetModelExtensionAction;
|
|
827
|
+
declare const setModelDescription: (input: SetModelDescriptionInput) => SetModelDescriptionAction;
|
|
828
|
+
declare const setAuthorName: (input: SetAuthorNameInput) => SetAuthorNameAction;
|
|
829
|
+
declare const setAuthorWebsite: (input: SetAuthorWebsiteInput) => SetAuthorWebsiteAction;
|
|
830
|
+
declare const addModule: (input: AddModuleInput) => AddModuleAction;
|
|
831
|
+
declare const setModuleName: (input: SetModuleNameInput) => SetModuleNameAction;
|
|
832
|
+
declare const setModuleDescription: (input: SetModuleDescriptionInput) => SetModuleDescriptionAction;
|
|
833
|
+
declare const deleteModule: (input: DeleteModuleInput) => DeleteModuleAction;
|
|
834
|
+
declare const reorderModules: (input: ReorderModulesInput) => ReorderModulesAction;
|
|
835
|
+
declare const addOperation: (input: AddOperationInput) => AddOperationAction;
|
|
836
|
+
declare const setOperationName: (input: SetOperationNameInput) => SetOperationNameAction;
|
|
837
|
+
declare const setOperationScope: (input: SetOperationScopeInput) => SetOperationScopeAction;
|
|
838
|
+
declare const setOperationSchema: (input: SetOperationSchemaInput) => SetOperationSchemaAction;
|
|
839
|
+
declare const setOperationDescription: (input: SetOperationDescriptionInput) => SetOperationDescriptionAction;
|
|
840
|
+
declare const setOperationTemplate: (input: SetOperationTemplateInput) => SetOperationTemplateAction;
|
|
841
|
+
declare const setOperationReducer: (input: SetOperationReducerInput) => SetOperationReducerAction;
|
|
842
|
+
declare const moveOperation: (input: MoveOperationInput) => MoveOperationAction;
|
|
843
|
+
declare const deleteOperation: (input: DeleteOperationInput) => DeleteOperationAction;
|
|
844
|
+
declare const reorderModuleOperations: (input: ReorderModuleOperationsInput) => ReorderModuleOperationsAction;
|
|
845
|
+
declare const addOperationError: (input: AddOperationErrorInput) => AddOperationErrorAction;
|
|
846
|
+
declare const setOperationErrorCode: (input: SetOperationErrorCodeInput) => SetOperationErrorCodeAction;
|
|
847
|
+
declare const setOperationErrorName: (input: SetOperationErrorNameInput) => SetOperationErrorNameAction;
|
|
848
|
+
declare const setOperationErrorDescription: (input: SetOperationErrorDescriptionInput) => SetOperationErrorDescriptionAction;
|
|
849
|
+
declare const setOperationErrorTemplate: (input: SetOperationErrorTemplateInput) => SetOperationErrorTemplateAction;
|
|
850
|
+
declare const deleteOperationError: (input: DeleteOperationErrorInput) => DeleteOperationErrorAction;
|
|
851
|
+
declare const reorderOperationErrors: (input: ReorderOperationErrorsInput) => ReorderOperationErrorsAction;
|
|
852
|
+
declare const addOperationExample: (input: AddOperationExampleInput) => AddOperationExampleAction;
|
|
853
|
+
declare const updateOperationExample: (input: UpdateOperationExampleInput) => UpdateOperationExampleAction;
|
|
854
|
+
declare const deleteOperationExample: (input: DeleteOperationExampleInput) => DeleteOperationExampleAction;
|
|
855
|
+
declare const reorderOperationExamples: (input: ReorderOperationExamplesInput) => ReorderOperationExamplesAction;
|
|
856
|
+
declare const operationExampleCreators: {
|
|
857
|
+
addOperationExample: typeof addOperationExample;
|
|
858
|
+
updateOperationExample: typeof updateOperationExample;
|
|
859
|
+
deleteOperationExample: typeof deleteOperationExample;
|
|
860
|
+
reorderOperationExamples: typeof reorderOperationExamples;
|
|
861
|
+
};
|
|
862
|
+
declare const setStateSchema: (input: SetStateSchemaInput) => SetStateSchemaAction;
|
|
863
|
+
declare const setInitialState: (input: SetInitialStateInput) => SetInitialStateAction;
|
|
864
|
+
declare const addStateExample: (input: AddStateExampleInput) => AddStateExampleAction;
|
|
865
|
+
declare const updateStateExample: (input: UpdateStateExampleInput) => UpdateStateExampleAction;
|
|
866
|
+
declare const deleteStateExample: (input: DeleteStateExampleInput) => DeleteStateExampleAction;
|
|
867
|
+
declare const reorderStateExamples: (input: ReorderStateExamplesInput) => ReorderStateExamplesAction;
|
|
868
|
+
declare const addChangeLogItem: (input: AddChangeLogItemInput) => AddChangeLogItemAction;
|
|
869
|
+
declare const updateChangeLogItem: (input: UpdateChangeLogItemInput) => UpdateChangeLogItemAction;
|
|
870
|
+
declare const deleteChangeLogItem: (input: DeleteChangeLogItemInput) => DeleteChangeLogItemAction;
|
|
871
|
+
declare const reorderChangeLogItems: (input: ReorderChangeLogItemsInput) => ReorderChangeLogItemsAction;
|
|
872
|
+
declare const releaseNewVersion: () => ReleaseNewVersionAction;
|
|
873
|
+
declare const baseActions: {
|
|
874
|
+
setName: typeof setName;
|
|
875
|
+
setPreferredEditor: typeof setPreferredEditor;
|
|
876
|
+
undo: typeof undo;
|
|
877
|
+
redo: typeof redo;
|
|
878
|
+
noop: typeof noop;
|
|
879
|
+
};
|
|
880
|
+
declare const documentModelActions: {
|
|
881
|
+
setModelName: typeof setModelName;
|
|
882
|
+
setModelId: typeof setModelId;
|
|
883
|
+
setModelExtension: typeof setModelExtension;
|
|
884
|
+
setModelDescription: typeof setModelDescription;
|
|
885
|
+
setAuthorName: typeof setAuthorName;
|
|
886
|
+
setAuthorWebsite: typeof setAuthorWebsite;
|
|
887
|
+
addModule: typeof addModule;
|
|
888
|
+
setModuleName: typeof setModuleName;
|
|
889
|
+
setModuleDescription: typeof setModuleDescription;
|
|
890
|
+
deleteModule: typeof deleteModule;
|
|
891
|
+
reorderModules: typeof reorderModules;
|
|
892
|
+
addOperation: typeof addOperation;
|
|
893
|
+
setOperationName: typeof setOperationName;
|
|
894
|
+
setOperationScope: typeof setOperationScope;
|
|
895
|
+
setOperationSchema: typeof setOperationSchema;
|
|
896
|
+
setOperationDescription: typeof setOperationDescription;
|
|
897
|
+
setOperationTemplate: typeof setOperationTemplate;
|
|
898
|
+
setOperationReducer: typeof setOperationReducer;
|
|
899
|
+
moveOperation: typeof moveOperation;
|
|
900
|
+
deleteOperation: typeof deleteOperation;
|
|
901
|
+
reorderModuleOperations: typeof reorderModuleOperations;
|
|
902
|
+
addOperationError: typeof addOperationError;
|
|
903
|
+
setOperationErrorCode: typeof setOperationErrorCode;
|
|
904
|
+
setOperationErrorName: typeof setOperationErrorName;
|
|
905
|
+
setOperationErrorDescription: typeof setOperationErrorDescription;
|
|
906
|
+
setOperationErrorTemplate: typeof setOperationErrorTemplate;
|
|
907
|
+
deleteOperationError: typeof deleteOperationError;
|
|
908
|
+
reorderOperationErrors: typeof reorderOperationErrors;
|
|
909
|
+
addOperationExample: typeof addOperationExample;
|
|
910
|
+
updateOperationExample: typeof updateOperationExample;
|
|
911
|
+
deleteOperationExample: typeof deleteOperationExample;
|
|
912
|
+
reorderOperationExamples: typeof reorderOperationExamples;
|
|
913
|
+
setStateSchema: typeof setStateSchema;
|
|
914
|
+
setInitialState: typeof setInitialState;
|
|
915
|
+
addStateExample: typeof addStateExample;
|
|
916
|
+
updateStateExample: typeof updateStateExample;
|
|
917
|
+
deleteStateExample: typeof deleteStateExample;
|
|
918
|
+
reorderStateExamples: typeof reorderStateExamples;
|
|
919
|
+
addChangeLogItem: typeof addChangeLogItem;
|
|
920
|
+
updateChangeLogItem: typeof updateChangeLogItem;
|
|
921
|
+
deleteChangeLogItem: typeof deleteChangeLogItem;
|
|
922
|
+
reorderChangeLogItems: typeof reorderChangeLogItems;
|
|
923
|
+
releaseNewVersion: typeof releaseNewVersion;
|
|
924
|
+
};
|
|
925
|
+
declare const actions: {
|
|
926
|
+
setName: typeof setName;
|
|
927
|
+
setPreferredEditor: typeof setPreferredEditor;
|
|
928
|
+
undo: typeof undo;
|
|
929
|
+
redo: typeof redo;
|
|
930
|
+
noop: typeof noop;
|
|
931
|
+
setModelName: typeof setModelName;
|
|
932
|
+
setModelId: typeof setModelId;
|
|
933
|
+
setModelExtension: typeof setModelExtension;
|
|
934
|
+
setModelDescription: typeof setModelDescription;
|
|
935
|
+
setAuthorName: typeof setAuthorName;
|
|
936
|
+
setAuthorWebsite: typeof setAuthorWebsite;
|
|
937
|
+
addModule: typeof addModule;
|
|
938
|
+
setModuleName: typeof setModuleName;
|
|
939
|
+
setModuleDescription: typeof setModuleDescription;
|
|
940
|
+
deleteModule: typeof deleteModule;
|
|
941
|
+
reorderModules: typeof reorderModules;
|
|
942
|
+
addOperation: typeof addOperation;
|
|
943
|
+
setOperationName: typeof setOperationName;
|
|
944
|
+
setOperationScope: typeof setOperationScope;
|
|
945
|
+
setOperationSchema: typeof setOperationSchema;
|
|
946
|
+
setOperationDescription: typeof setOperationDescription;
|
|
947
|
+
setOperationTemplate: typeof setOperationTemplate;
|
|
948
|
+
setOperationReducer: typeof setOperationReducer;
|
|
949
|
+
moveOperation: typeof moveOperation;
|
|
950
|
+
deleteOperation: typeof deleteOperation;
|
|
951
|
+
reorderModuleOperations: typeof reorderModuleOperations;
|
|
952
|
+
addOperationError: typeof addOperationError;
|
|
953
|
+
setOperationErrorCode: typeof setOperationErrorCode;
|
|
954
|
+
setOperationErrorName: typeof setOperationErrorName;
|
|
955
|
+
setOperationErrorDescription: typeof setOperationErrorDescription;
|
|
956
|
+
setOperationErrorTemplate: typeof setOperationErrorTemplate;
|
|
957
|
+
deleteOperationError: typeof deleteOperationError;
|
|
958
|
+
reorderOperationErrors: typeof reorderOperationErrors;
|
|
959
|
+
addOperationExample: typeof addOperationExample;
|
|
960
|
+
updateOperationExample: typeof updateOperationExample;
|
|
961
|
+
deleteOperationExample: typeof deleteOperationExample;
|
|
962
|
+
reorderOperationExamples: typeof reorderOperationExamples;
|
|
963
|
+
setStateSchema: typeof setStateSchema;
|
|
964
|
+
setInitialState: typeof setInitialState;
|
|
965
|
+
addStateExample: typeof addStateExample;
|
|
966
|
+
updateStateExample: typeof updateStateExample;
|
|
967
|
+
deleteStateExample: typeof deleteStateExample;
|
|
968
|
+
reorderStateExamples: typeof reorderStateExamples;
|
|
969
|
+
addChangeLogItem: typeof addChangeLogItem;
|
|
970
|
+
updateChangeLogItem: typeof updateChangeLogItem;
|
|
971
|
+
deleteChangeLogItem: typeof deleteChangeLogItem;
|
|
972
|
+
reorderChangeLogItems: typeof reorderChangeLogItems;
|
|
973
|
+
releaseNewVersion: typeof releaseNewVersion;
|
|
974
|
+
};
|
|
975
|
+
/**
|
|
976
|
+
* The context of an action.
|
|
977
|
+
*/
|
|
978
|
+
type ActionContext = {
|
|
979
|
+
/** The index of the previous operation, showing intended ordering. */
|
|
980
|
+
prevOpIndex?: number;
|
|
981
|
+
/** The hash of the previous operation, showing intended state. */
|
|
982
|
+
prevOpHash?: string;
|
|
983
|
+
/** A nonce, to cover specific signing attacks and to prevent replay attacks from no-ops. */
|
|
984
|
+
nonce?: string;
|
|
985
|
+
/** The signer of the action. */
|
|
986
|
+
signer?: ActionSigner;
|
|
987
|
+
};
|
|
988
|
+
/**
|
|
989
|
+
* Defines the basic structure of an action.
|
|
990
|
+
*/
|
|
991
|
+
type Action = {
|
|
992
|
+
/** The id of the action. This is distinct from the operation id. */
|
|
993
|
+
id: string;
|
|
994
|
+
/** The name of the action. */
|
|
995
|
+
type: string;
|
|
996
|
+
/** The timestamp of the action. */
|
|
997
|
+
timestampUtcMs: string;
|
|
998
|
+
/** The payload of the action. */
|
|
999
|
+
input: unknown;
|
|
1000
|
+
/** The scope of the action */
|
|
1001
|
+
scope: string;
|
|
1002
|
+
/** The context of the action. */
|
|
1003
|
+
context?: ActionContext;
|
|
1004
|
+
};
|
|
1005
|
+
//#endregion
|
|
1006
|
+
//#region document-model/action-signature.d.ts
|
|
1007
|
+
declare const ACTION_SIGNATURE_V2_PREFIX = "v2:";
|
|
1008
|
+
/** The log an operation is stored in, which a v2 tuple is bound to. */
|
|
1009
|
+
type ActionSigningTarget = {
|
|
1010
|
+
documentId: string;
|
|
1011
|
+
branch: string;
|
|
1012
|
+
};
|
|
1013
|
+
/** Who a v2 tuple attributes the action to; both halves are in the preimage. */
|
|
1014
|
+
type ActionSignerIdentity = {
|
|
1015
|
+
user: UserActionSigner;
|
|
1016
|
+
app: AppActionSigner;
|
|
1017
|
+
};
|
|
1018
|
+
/** A value that would not survive a JSON store round trip unchanged. */
|
|
1019
|
+
declare class CanonicalJsonError extends Error {
|
|
1020
|
+
constructor(path: string, detail: string);
|
|
1021
|
+
}
|
|
1022
|
+
/** Sorted-key JSON, as the state hash encodes; drops `undefined` properties. */
|
|
1023
|
+
declare function canonicalJson(value: unknown, label?: string): string;
|
|
1024
|
+
/** Actions the reactor reduces itself, onto the document scope. */
|
|
1025
|
+
declare const DOCUMENT_SCOPE_ACTION_TYPES: ReadonlySet<string>;
|
|
1026
|
+
/** Where a document-scope action writes: `sourceId` or `documentId`. */
|
|
1027
|
+
declare function targetDocumentId(action: {
|
|
1028
|
+
type: string;
|
|
1029
|
+
input: unknown;
|
|
1030
|
+
}, fallback: string): string;
|
|
1031
|
+
/** The log an action submitted to a job on `documentId` is stored in. */
|
|
1032
|
+
declare function actionSigningTarget(action: {
|
|
1033
|
+
type: string;
|
|
1034
|
+
input: unknown;
|
|
1035
|
+
}, documentId: string, branch: string): ActionSigningTarget;
|
|
1036
|
+
/** The identity a signer writes into `context.signer`, and signs over. */
|
|
1037
|
+
declare function actionSignerIdentity(signer: {
|
|
1038
|
+
user?: UserActionSigner;
|
|
1039
|
+
app?: AppActionSigner;
|
|
1040
|
+
}): ActionSignerIdentity;
|
|
1041
|
+
/** The v2 preimage; throws `CanonicalJsonError` on an unsignable action. */
|
|
1042
|
+
declare function actionPreimageV2(action: Action, target: ActionSigningTarget, signer: ActionSignerIdentity): string;
|
|
1043
|
+
/** `"v2:" + base64url(sha256(preimage))`, unpadded. */
|
|
1044
|
+
declare function hashActionV2(action: Action, target: ActionSigningTarget, signer: ActionSignerIdentity): Promise<string>;
|
|
1045
|
+
/** Signs `action` as a v2 tuple; the message layout is the legacy one. */
|
|
1046
|
+
declare function signActionV2(params: {
|
|
1047
|
+
action: Action;
|
|
1048
|
+
target: ActionSigningTarget;
|
|
1049
|
+
signer: ActionSignerIdentity;
|
|
1050
|
+
sign: ActionSigningHandler;
|
|
1051
|
+
previousStateHash?: string;
|
|
1052
|
+
}): Promise<Signature>;
|
|
1053
|
+
/** Element [2] carries the v2 prefix, whether or not it is well formed. */
|
|
1054
|
+
declare function isV2ActionHash(hash: string): boolean;
|
|
1055
|
+
/** The strict shape of a v2 tuple, apart from what its hash covers. */
|
|
1056
|
+
declare function v2TupleProblem(tuple: Signature): string | undefined;
|
|
1057
|
+
//#endregion
|
|
1058
|
+
//#region document-model/action-transport.d.ts
|
|
1059
|
+
/**
|
|
1060
|
+
* An action's signer, as the wire declares it: signatures joined into strings,
|
|
1061
|
+
* because GraphQL declares them as a list of strings rather than of lists.
|
|
1062
|
+
*/
|
|
1063
|
+
type TransportSigner = {
|
|
1064
|
+
user?: {
|
|
1065
|
+
address: string;
|
|
1066
|
+
networkId: string;
|
|
1067
|
+
chainId: number;
|
|
1068
|
+
};
|
|
1069
|
+
app?: {
|
|
1070
|
+
name: string;
|
|
1071
|
+
key: string;
|
|
1072
|
+
};
|
|
1073
|
+
signatures: string[];
|
|
1074
|
+
};
|
|
1075
|
+
/** An action's context, as the wire declares it. */
|
|
1076
|
+
type TransportActionContext = {
|
|
1077
|
+
prevOpIndex?: number;
|
|
1078
|
+
prevOpHash?: string;
|
|
1079
|
+
nonce?: string;
|
|
1080
|
+
signer?: TransportSigner;
|
|
1081
|
+
};
|
|
1082
|
+
/** An action projected onto exactly the fields the wire declares. */
|
|
1083
|
+
type TransportAction = {
|
|
1084
|
+
id: string;
|
|
1085
|
+
type: string;
|
|
1086
|
+
timestampUtcMs: string;
|
|
1087
|
+
/**
|
|
1088
|
+
* Non-nullable, because the wire declares it so. An action's own type says
|
|
1089
|
+
* `unknown`, which admits the absent input an action creator called without
|
|
1090
|
+
* one produces - {@link toTransportAction} refuses that rather than passing
|
|
1091
|
+
* it on.
|
|
1092
|
+
*/
|
|
1093
|
+
input: NonNullable<unknown>;
|
|
1094
|
+
scope: string;
|
|
1095
|
+
context?: TransportActionContext;
|
|
1096
|
+
};
|
|
1097
|
+
/**
|
|
1098
|
+
* Projects an action onto the fields the GraphQL `ActionInput` declares.
|
|
1099
|
+
*
|
|
1100
|
+
* A projection rather than a spread, because an input object rejects a field it
|
|
1101
|
+
* does not declare, and that refusal takes the whole request with it. An action
|
|
1102
|
+
* read back out of storage can carry fields the type no longer has - a legacy
|
|
1103
|
+
* `attachments` array, or the operation fields left behind by a signing helper
|
|
1104
|
+
* that returns an operation - and any one of them would sink an otherwise valid
|
|
1105
|
+
* submission.
|
|
1106
|
+
*
|
|
1107
|
+
* Only fields the action actually carries are emitted, so an unsigned action
|
|
1108
|
+
* sends no context at all rather than a context full of nulls.
|
|
1109
|
+
*/
|
|
1110
|
+
declare function toTransportAction(action: Action): TransportAction;
|
|
1111
|
+
//#endregion
|
|
1112
|
+
//#region document-model/auth.d.ts
|
|
1113
|
+
type InitializeAuthActionInput = {
|
|
1114
|
+
version: number;
|
|
1115
|
+
grants: Grant[];
|
|
1116
|
+
};
|
|
1117
|
+
type SetGrantActionInput = {
|
|
1118
|
+
grant: Grant;
|
|
1119
|
+
};
|
|
1120
|
+
type RemoveGrantActionInput = {
|
|
1121
|
+
id: string;
|
|
1122
|
+
};
|
|
1123
|
+
type MoveGrantActionInput = {
|
|
1124
|
+
id: string;
|
|
1125
|
+
/** Target index in the grant list; clamped to the valid range. */
|
|
1126
|
+
index: number;
|
|
1127
|
+
};
|
|
1128
|
+
type InitializeAuthAction = Action & {
|
|
1129
|
+
type: "INITIALIZE_AUTH";
|
|
1130
|
+
input: InitializeAuthActionInput;
|
|
1131
|
+
};
|
|
1132
|
+
type SetGrantAction = Action & {
|
|
1133
|
+
type: "SET_GRANT";
|
|
1134
|
+
input: SetGrantActionInput;
|
|
1135
|
+
};
|
|
1136
|
+
type RemoveGrantAction = Action & {
|
|
1137
|
+
type: "REMOVE_GRANT";
|
|
1138
|
+
input: RemoveGrantActionInput;
|
|
1139
|
+
};
|
|
1140
|
+
type MoveGrantAction = Action & {
|
|
1141
|
+
type: "MOVE_GRANT";
|
|
1142
|
+
input: MoveGrantActionInput;
|
|
1143
|
+
};
|
|
1144
|
+
type AuthAction = InitializeAuthAction | SetGrantAction | RemoveGrantAction | MoveGrantAction;
|
|
1145
|
+
declare const AUTH_ACTION_TYPES: readonly ["INITIALIZE_AUTH", "SET_GRANT", "REMOVE_GRANT", "MOVE_GRANT"];
|
|
1146
|
+
declare function isAuthAction(action: Action): action is AuthAction;
|
|
1147
|
+
/** Highest known policy version; decide() fails closed above it. */
|
|
1148
|
+
declare const MAX_SUPPORTED_AUTH_VERSION = 1;
|
|
1149
|
+
declare const InitializeAuthActionInputSchema: () => z.ZodObject<{
|
|
1150
|
+
version: z.ZodNumber;
|
|
1151
|
+
grants: z.ZodArray<z.ZodCustom<Grant, Grant>>;
|
|
1152
|
+
}, z.core.$strip>;
|
|
1153
|
+
declare const SetGrantActionInputSchema: () => z.ZodObject<{
|
|
1154
|
+
grant: z.ZodCustom<Grant, Grant>;
|
|
1155
|
+
}, z.core.$strip>;
|
|
1156
|
+
declare const RemoveGrantActionInputSchema: () => z.ZodObject<{
|
|
1157
|
+
id: z.ZodString;
|
|
1158
|
+
}, z.core.$strip>;
|
|
1159
|
+
declare const MoveGrantActionInputSchema: () => z.ZodObject<{
|
|
1160
|
+
id: z.ZodString;
|
|
1161
|
+
index: z.ZodNumber;
|
|
1162
|
+
}, z.core.$strip>;
|
|
1163
|
+
declare const initializeAuth: (input: InitializeAuthActionInput) => InitializeAuthAction;
|
|
1164
|
+
declare const setGrant: (input: SetGrantActionInput) => SetGrantAction;
|
|
1165
|
+
declare const removeGrant: (input: RemoveGrantActionInput) => RemoveGrantAction;
|
|
1166
|
+
declare const moveGrant: (input: MoveGrantActionInput) => MoveGrantAction;
|
|
1167
|
+
/**
|
|
1168
|
+
* True when `signerKey` (an ActionSigner app key, a did:key) identifies the same
|
|
1169
|
+
* key recorded as the document creator. Returns false
|
|
1170
|
+
* when there is no creator (empty JWK) or no signer key.
|
|
1171
|
+
*/
|
|
1172
|
+
declare function isDocumentCreator(creatorKey: JsonWebKey | undefined, signerKey: string | undefined): boolean;
|
|
1173
|
+
/**
|
|
1174
|
+
* Sets the initial policy. Valid only while the auth scope is uninitialized
|
|
1175
|
+
* (version 0). The input version is the policy language version and must be an
|
|
1176
|
+
* integer >= 1; 0 is reserved for the uninitialized state. On a signed-header
|
|
1177
|
+
* document it must be signed by the document creator (`header.sig.publicKey`).
|
|
1178
|
+
* A creator-less policy must include a grant permitting execute on the auth
|
|
1179
|
+
* scope, or it would be born locked out.
|
|
1180
|
+
*/
|
|
1181
|
+
declare function applyInitializeAuthAction<TState extends PHBaseState>(document: PHDocument$1<TState>, action: InitializeAuthAction): PHDocument$1<TState>;
|
|
1182
|
+
/** Upserts a grant by id: replaces in place if present, otherwise appends. */
|
|
1183
|
+
declare function applySetGrantAction<TState extends PHBaseState>(document: PHDocument$1<TState>, action: SetGrantAction): PHDocument$1<TState>;
|
|
1184
|
+
/**
|
|
1185
|
+
* Removes a grant by id; throws if the id is not present or if the removal
|
|
1186
|
+
* would leave a creator-less policy with no auth-administration grant.
|
|
1187
|
+
*/
|
|
1188
|
+
declare function applyRemoveGrantAction<TState extends PHBaseState>(document: PHDocument$1<TState>, action: RemoveGrantAction): PHDocument$1<TState>;
|
|
1189
|
+
/**
|
|
1190
|
+
* Moves a grant by id to a new index. Order is load-bearing (the last
|
|
1191
|
+
* applicable grant wins), so the relative order of the other grants is kept.
|
|
1192
|
+
* The target index is clamped to the valid range; an unknown id throws.
|
|
1193
|
+
*
|
|
1194
|
+
* Order alone decides which grant wins, so a move can take administration away
|
|
1195
|
+
* without changing the list's contents. It carries the same retention rule as
|
|
1196
|
+
* the two mutation paths.
|
|
1197
|
+
*/
|
|
1198
|
+
declare function applyMoveGrantAction<TState extends PHBaseState>(document: PHDocument$1<TState>, action: MoveGrantAction): PHDocument$1<TState>;
|
|
1199
|
+
/**
|
|
1200
|
+
* Dispatches an auth-scope action to its handler. This is the auth scope's
|
|
1201
|
+
* dedicated reducer: it is applied by the base reducer instead of the model
|
|
1202
|
+
* reducer, mirroring the document-scope platform handlers. Unknown types are a
|
|
1203
|
+
* no-op, matching the model-reducer default.
|
|
1204
|
+
*/
|
|
1205
|
+
declare function applyAuthAction<TState extends PHBaseState>(document: PHDocument$1<TState>, action: Action): PHDocument$1<TState>;
|
|
1206
|
+
/**
|
|
1207
|
+
* Because only creators can initialize auth scopes, we must verify that either
|
|
1208
|
+
* the document has no auth or the version and creator match.
|
|
1209
|
+
*/
|
|
1210
|
+
declare function assertAuthPreservedOnDuplicate(documentId: string, source: PHAuthState | undefined, duplicated: PHAuthState | undefined): void;
|
|
1211
|
+
/**
|
|
1212
|
+
* The auth scope a state snapshot may install, given the policy already there.
|
|
1213
|
+
*
|
|
1214
|
+
* `applyAuthAction` is the validated door onto `state.auth`, but a whole-state
|
|
1215
|
+
* snapshot (UPGRADE_DOCUMENT's `initialState`) replaces the scope wholesale and
|
|
1216
|
+
* is authorized as a `document`-scope write. Without this, a subject holding
|
|
1217
|
+
* `execute` on `document` and no auth grant at all can install a policy of its
|
|
1218
|
+
* choosing, name itself `creator` (which exempts the policy from the retention
|
|
1219
|
+
* rule for good), or wipe an existing policy by carrying the default
|
|
1220
|
+
* uninitialized one.
|
|
1221
|
+
*
|
|
1222
|
+
* Three cases:
|
|
1223
|
+
*
|
|
1224
|
+
* - the snapshot carries no policy, or an uninitialized one: the document
|
|
1225
|
+
* keeps the policy it has, so a default-state upgrade cannot reset it;
|
|
1226
|
+
* - the document is uninitialized and the snapshot carries a policy: the
|
|
1227
|
+
* policy is installed after the same validation genesis applies, so it
|
|
1228
|
+
* cannot be born locked out;
|
|
1229
|
+
* - both carry a policy: they must agree. A duplicate preserves its source's
|
|
1230
|
+
* policy (see {@link assertAuthPreservedOnDuplicate}), and anything else is
|
|
1231
|
+
* an attempt to replace one policy with another.
|
|
1232
|
+
*/
|
|
1233
|
+
declare function resolveSnapshotAuth(documentId: string, documentType: string, current: PHAuthState | undefined, incoming: PHAuthState | undefined): PHAuthState;
|
|
1234
|
+
/** UNDO and REDO are rejected on the auth scope. */
|
|
1235
|
+
declare function assertAuthScopeActionAllowed(action: Action): void;
|
|
1236
|
+
type AuthVerb = "read" | "execute";
|
|
1237
|
+
type AuthRequest = {
|
|
1238
|
+
verb: AuthVerb;
|
|
1239
|
+
scope: string;
|
|
1240
|
+
/** For execute: the operation (action type) being attempted. Omitted for reads. */
|
|
1241
|
+
operation?: string;
|
|
1242
|
+
};
|
|
1243
|
+
type AuthSubject = {
|
|
1244
|
+
/** Verified signer address; undefined for an anonymous subject. */
|
|
1245
|
+
address?: string;
|
|
1246
|
+
/** The signer's app key (a did:key), used to match the document creator. */
|
|
1247
|
+
key?: string;
|
|
1248
|
+
};
|
|
1249
|
+
/**
|
|
1250
|
+
* What condition attr paths resolve against, beyond the subject. Supplied
|
|
1251
|
+
* only while authConditions enforcement is on: with no context a grant
|
|
1252
|
+
* carrying `where` or a { match } principal never applies.
|
|
1253
|
+
*/
|
|
1254
|
+
type ConditionContext = {
|
|
1255
|
+
/** The executing scope's own state, for `doc.<scope>.*` paths. */
|
|
1256
|
+
scopeState: unknown;
|
|
1257
|
+
/** The action's input, for `action.input.*` paths. Absent for reads. */
|
|
1258
|
+
actionInput?: unknown;
|
|
1259
|
+
};
|
|
1260
|
+
type AuthDecision = "allow" | "deny";
|
|
1261
|
+
/** Why the policy refused a request. */
|
|
1262
|
+
type AuthRefusal = "version-unsupported" | "no-applicable-grant" | "denied-by-grant";
|
|
1263
|
+
/**
|
|
1264
|
+
* A decision together with why it refused. A refusal names which of the
|
|
1265
|
+
* policy's rules produced it, so an operation records the reason it was refused
|
|
1266
|
+
* rather than one reason standing for every refusal.
|
|
1267
|
+
*/
|
|
1268
|
+
type AuthEvaluation = {
|
|
1269
|
+
decision: "allow";
|
|
1270
|
+
} | {
|
|
1271
|
+
decision: "deny";
|
|
1272
|
+
refusal: AuthRefusal;
|
|
1273
|
+
grantId?: string;
|
|
1274
|
+
};
|
|
1275
|
+
/**
|
|
1276
|
+
* Evaluates the auth policy for a single request and reports why it refused.
|
|
1277
|
+
* Pure and deterministic.
|
|
1278
|
+
*
|
|
1279
|
+
* An uninitialized policy (version 0, absent auth state, or a legacy `{}`
|
|
1280
|
+
* auth scope serialized before PHAuthState had a version) leaves the document
|
|
1281
|
+
* open. Once a policy exists the default is deny, and grants stack in order.
|
|
1282
|
+
*
|
|
1283
|
+
* Group principals match only against a supplied groups map (the groups
|
|
1284
|
+
* projection, present when authGroups is on); with no map they never apply.
|
|
1285
|
+
* `where` clauses and { match } principals likewise evaluate only against a
|
|
1286
|
+
* supplied condition context (present when authConditions is on).
|
|
1287
|
+
*/
|
|
1288
|
+
declare function evaluate(auth: PHAuthState | undefined, subject: AuthSubject, request: AuthRequest, groups?: AuthGroups, conditions?: ConditionContext): AuthEvaluation;
|
|
1289
|
+
/**
|
|
1290
|
+
* Evaluates the auth policy for a single request. Pure and deterministic. This
|
|
1291
|
+
* is {@link evaluate} with the reason dropped.
|
|
1292
|
+
*/
|
|
1293
|
+
declare function decide(auth: PHAuthState | undefined, subject: AuthSubject, request: AuthRequest, groups?: AuthGroups, conditions?: ConditionContext): AuthDecision;
|
|
1294
|
+
/**
|
|
1295
|
+
* The group document ids a single auth action's input names with `{ group }`
|
|
1296
|
+
* principals. INITIALIZE_AUTH contributes the groups named across its grants,
|
|
1297
|
+
* SET_GRANT the groups named by its one grant; REMOVE_GRANT and MOVE_GRANT
|
|
1298
|
+
* contribute nothing. Total over any input shape, because references are read
|
|
1299
|
+
* from the input as it arrived, including inputs later stored as errors.
|
|
1300
|
+
*/
|
|
1301
|
+
declare function mentionedGroupIds(action: Action): string[];
|
|
1302
|
+
//#endregion
|
|
1303
|
+
//#region document-model/auth-v1.d.ts
|
|
1304
|
+
/** Maximum number of grants in a policy. */
|
|
1305
|
+
declare const MAX_AUTH_GRANTS = 100;
|
|
1306
|
+
/** Maximum nesting depth of a condition tree. */
|
|
1307
|
+
declare const MAX_CONDITION_DEPTH = 10;
|
|
1308
|
+
/** Maximum node count (conditions plus operands) of a condition tree. */
|
|
1309
|
+
declare const MAX_CONDITION_NODES = 100;
|
|
1310
|
+
/** Maximum entries in an execute capability's operation list. */
|
|
1311
|
+
declare const MAX_CAPABILITY_OPERATIONS = 100;
|
|
1312
|
+
/**
|
|
1313
|
+
* Thrown when a grant violates the v1 validation rules. The message is stored
|
|
1314
|
+
* on error operations, so it must be a pure function of the input.
|
|
1315
|
+
*/
|
|
1316
|
+
declare class InvalidGrantError extends Error {
|
|
1317
|
+
readonly grantId: string;
|
|
1318
|
+
constructor(grantId: string, problem: string);
|
|
1319
|
+
}
|
|
1320
|
+
/** Thrown for a `{ group }` principal on a group document: references never chain. */
|
|
1321
|
+
declare class GroupPrincipalNotAllowedError extends Error {
|
|
1322
|
+
readonly grantId: string;
|
|
1323
|
+
constructor(grantId: string);
|
|
1324
|
+
}
|
|
1325
|
+
/**
|
|
1326
|
+
* Thrown when a change would leave a creator-less policy with no grant
|
|
1327
|
+
* permitting execute on the auth scope. Without the creator carve-out no
|
|
1328
|
+
* subject could ever administer such a policy again.
|
|
1329
|
+
*/
|
|
1330
|
+
declare class AuthAdministrationLockoutError extends Error {
|
|
1331
|
+
readonly grantId: string;
|
|
1332
|
+
constructor(grantId: string);
|
|
1333
|
+
}
|
|
1334
|
+
/**
|
|
1335
|
+
* Thrown when INITIALIZE_AUTH would create a creator-less policy with no grant
|
|
1336
|
+
* permitting execute on the auth scope. Such a policy would be born with no
|
|
1337
|
+
* subject able to administer it.
|
|
1338
|
+
*/
|
|
1339
|
+
declare class AuthAdministrationMissingError extends Error {
|
|
1340
|
+
constructor();
|
|
1341
|
+
}
|
|
1342
|
+
declare function isPlainValue(value: unknown): value is Record<string, unknown>;
|
|
1343
|
+
/** Returns the first v1-rule violation, or null. Pure, total, deterministic. */
|
|
1344
|
+
declare function grantProblem(value: unknown): string | null;
|
|
1345
|
+
declare const GrantSchema: () => z.ZodCustom<Grant, Grant>;
|
|
1346
|
+
/** V1 shape rules plus the group-document group-principal ban. */
|
|
1347
|
+
declare function assertValidGrant(grant: unknown, documentType: string): void;
|
|
1348
|
+
/**
|
|
1349
|
+
* Validates an initial grant list: the count cap, every grant, and — on a
|
|
1350
|
+
* creator-less policy — that some grant keeps the auth scope administrable.
|
|
1351
|
+
*/
|
|
1352
|
+
declare function assertValidInitialGrants(grants: Grant[], documentType: string, creator: string | undefined): void;
|
|
1353
|
+
/**
|
|
1354
|
+
* Validates a grant upsert: the grant itself, the count cap on append, and
|
|
1355
|
+
* administration retention. Retention is checked on an append as well as an
|
|
1356
|
+
* in-place replace, because a grant appended after the administration grant can
|
|
1357
|
+
* shadow it (evaluation is last-applicable-grant-wins) and so take
|
|
1358
|
+
* administration away without removing anything.
|
|
1359
|
+
*/
|
|
1360
|
+
declare function assertValidGrantUpsert(grant: Grant, existing: Grant[], documentType: string, creator: string | undefined): void;
|
|
1361
|
+
/**
|
|
1362
|
+
* A creator-less policy must always retain a grant permitting execute on the
|
|
1363
|
+
* auth scope; on a signed document the creator carve-out keeps administration
|
|
1364
|
+
* reachable instead. Rejects a change that takes the last such grant away. A
|
|
1365
|
+
* policy already without one is left alone: the change is not what locks it.
|
|
1366
|
+
*/
|
|
1367
|
+
declare function assertAuthAdministrationRetained(creator: string | undefined, previous: Grant[], next: Grant[], grantId: string): void;
|
|
1368
|
+
/**
|
|
1369
|
+
* Evaluates a version-1 condition. Deterministic, total, and pure: any input
|
|
1370
|
+
* shape yields a boolean and never throws, and a malformed condition is
|
|
1371
|
+
* false. These are consensus semantics, versioned by `PHAuthState.version`;
|
|
1372
|
+
* changing them requires a new version.
|
|
1373
|
+
*/
|
|
1374
|
+
declare function evaluateCondition(condition: Condition, subject: AuthSubject, request: AuthRequest, conditions: ConditionContext): boolean;
|
|
1375
|
+
/**
|
|
1376
|
+
* The group document ids named by `{ group }` principals in a grant list, in
|
|
1377
|
+
* order of first appearance. These are the streams the groups projection reads.
|
|
1378
|
+
*/
|
|
1379
|
+
declare function referencedGroupIds(grants: Grant[]): string[];
|
|
1380
|
+
/**
|
|
1381
|
+
* Evaluates a v1 grant stack: default deny, last applicable grant wins, and
|
|
1382
|
+
* reports which grant decided it. Group principals match only against a
|
|
1383
|
+
* supplied groups map, and `where` clauses and { match } principals evaluate
|
|
1384
|
+
* only against a supplied condition context; a grant that uses an unsupplied
|
|
1385
|
+
* feature never applies.
|
|
1386
|
+
*/
|
|
1387
|
+
declare function evaluateGrantStack(grants: Grant[], subject: AuthSubject, request: AuthRequest, groups?: AuthGroups, conditions?: ConditionContext): AuthEvaluation;
|
|
1388
|
+
/**
|
|
1389
|
+
* Evaluates a v1 grant stack: default deny, last applicable grant wins. This is
|
|
1390
|
+
* {@link evaluateGrantStack} with the reason dropped.
|
|
1391
|
+
*/
|
|
1392
|
+
declare function evaluateGrants(grants: Grant[], subject: AuthSubject, request: AuthRequest, groups?: AuthGroups, conditions?: ConditionContext): AuthDecision;
|
|
1393
|
+
//#endregion
|
|
1394
|
+
//#region document-model/constants.d.ts
|
|
1395
|
+
declare const documentModelFileExtension: "phdm";
|
|
1396
|
+
declare const documentModelInitialLocalState: DocumentModelLocalState;
|
|
1397
|
+
declare const documentModelInitialGlobalState: DocumentModelGlobalState;
|
|
1398
|
+
declare const documentModelGlobalState: DocumentModelGlobalState;
|
|
1399
|
+
declare const HASH_ALGORITHM_SHA1 = "sha1";
|
|
1400
|
+
declare const HASH_ALGORITHM_SHA256 = "sha256";
|
|
1401
|
+
declare const HASH_ALGORITHM_SHA512 = "sha512";
|
|
1402
|
+
declare const HASH_ENCODING_BASE64 = "base64";
|
|
1403
|
+
declare const HASH_ENCODING_HEX = "hex";
|
|
1404
|
+
//#endregion
|
|
1405
|
+
//#region document-model/crypto.d.ts
|
|
1406
|
+
declare const hashBrowser: (data: string | Uint8Array | ArrayBufferView | DataView, algorithm?: string, encoding?: string, _params?: Record<string, unknown>) => string;
|
|
1407
|
+
declare function getUnixTimestamp(date: Date | string): string;
|
|
1408
|
+
declare function buildOperationSignatureParams({ documentId, signer, action, previousStateHash }: ActionSignatureContext): [string, string, string, string];
|
|
1409
|
+
declare function buildOperationSignatureMessage(params: [string, string, string, string]): Uint8Array;
|
|
1410
|
+
declare function ab2hex(ab: ArrayBuffer | ArrayBufferView): string;
|
|
1411
|
+
declare function hex2ab(hex: string): Uint8Array<ArrayBuffer>;
|
|
1412
|
+
/**
|
|
1413
|
+
* Decodes a base58btc (Bitcoin/IPFS alphabet) string to bytes. Returns null on
|
|
1414
|
+
* any character outside the alphabet.
|
|
1415
|
+
*/
|
|
1416
|
+
declare function base58Decode(input: string): Uint8Array | null;
|
|
1417
|
+
/** Encodes bytes as unpadded base64url. */
|
|
1418
|
+
declare function bytesToBase64Url(bytes: Uint8Array): string;
|
|
1419
|
+
/** Decodes a base64url string to bytes (portable across node, browsers, workers). */
|
|
1420
|
+
declare function base64UrlToBytes(input: string): Uint8Array;
|
|
1421
|
+
//#endregion
|
|
1422
|
+
//#region document-model/create-document.d.ts
|
|
1423
|
+
declare function createDocumentAction(input: CreateDocumentActionInput): Action;
|
|
1424
|
+
/** Sets the model version and, on the first upgrade, the initial state. */
|
|
1425
|
+
declare function upgradeDocumentAction(input: UpgradeDocumentActionInput): Action;
|
|
1426
|
+
/** The unsigned CREATE_DOCUMENT and UPGRADE_DOCUMENT that create `document`. */
|
|
1427
|
+
declare function creationActions(document: PHDocument$1, protocolVersions: ProtocolVersions): Action[];
|
|
1428
|
+
/** The state `creationActions` recorded: the snapshot the document scope's first UPGRADE_DOCUMENT carries. */
|
|
1429
|
+
declare function creationState(documentScope: readonly Operation[]): PHBaseState | undefined;
|
|
1430
|
+
/** The document a CREATE_DOCUMENT heads, before UPGRADE_DOCUMENT sets its state. */
|
|
1431
|
+
declare function documentFromCreation(action: CreateDocumentAction): PHDocument$1;
|
|
1432
|
+
//#endregion
|
|
1433
|
+
//#region document-model/denied.d.ts
|
|
1434
|
+
/**
|
|
1435
|
+
* True iff authorization rejected the action.
|
|
1436
|
+
*/
|
|
1437
|
+
declare function isDenied(operation: Operation): boolean;
|
|
1438
|
+
/**
|
|
1439
|
+
* The closed set of strings persisted as `deniedReason`. Re-evaluation compares
|
|
1440
|
+
* them, so they are consensus data: exact strings that embed no grant id,
|
|
1441
|
+
* subject or timestamp. Changing one is history-visible.
|
|
1442
|
+
*/
|
|
1443
|
+
declare const DOCUMENT_DELETED_REASON = "document deleted";
|
|
1444
|
+
declare const AUTH_VERSION_UNSUPPORTED_REASON = "auth policy version unsupported";
|
|
1445
|
+
declare const AUTH_NO_GRANT_REASON = "no grant permits this operation";
|
|
1446
|
+
declare const AUTH_DENIED_BY_GRANT_REASON = "denied by grant";
|
|
1447
|
+
//#endregion
|
|
1448
|
+
//#region document-model/document-schema.d.ts
|
|
1449
|
+
declare const BaseDocumentHeaderSchema: z.ZodObject<{
|
|
1450
|
+
id: z.ZodString;
|
|
1451
|
+
name: z.ZodString;
|
|
1452
|
+
createdAtUtcIso: z.ZodString;
|
|
1453
|
+
lastModifiedAtUtcIso: z.ZodString;
|
|
1454
|
+
documentType: z.ZodString;
|
|
1455
|
+
}, z.core.$strip>;
|
|
1456
|
+
declare const BaseDocumentStateSchema: z.ZodObject<{
|
|
1457
|
+
global: z.ZodUnknown;
|
|
1458
|
+
}, z.core.$strip>;
|
|
1459
|
+
/** Schema for validating the header object of a DocumentModel document */
|
|
1460
|
+
declare const DocumentModelHeaderSchema: z.ZodObject<{
|
|
1461
|
+
id: z.ZodString;
|
|
1462
|
+
name: z.ZodString;
|
|
1463
|
+
createdAtUtcIso: z.ZodString;
|
|
1464
|
+
lastModifiedAtUtcIso: z.ZodString;
|
|
1465
|
+
documentType: z.ZodLiteral<"powerhouse/document-model">;
|
|
1466
|
+
}, z.core.$strip>;
|
|
1467
|
+
/** Schema for validating the state object of a DocumentModel document */
|
|
1468
|
+
declare const DocumentModelPHStateSchema: z.ZodObject<{
|
|
1469
|
+
global: z.ZodObject<Required<{
|
|
1470
|
+
author: z.ZodType<Author, Author, z.core.$ZodTypeInternals<Author, Author>>;
|
|
1471
|
+
description: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
1472
|
+
extension: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
1473
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
1474
|
+
name: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
1475
|
+
specifications: z.ZodType<DocumentSpecification[], DocumentSpecification[], z.core.$ZodTypeInternals<DocumentSpecification[], DocumentSpecification[]>>;
|
|
1476
|
+
}>, z.core.$strip>;
|
|
1477
|
+
}, z.core.$strip>;
|
|
1478
|
+
declare const DocumentModelSchema: z.ZodObject<{
|
|
1479
|
+
header: z.ZodObject<{
|
|
1480
|
+
id: z.ZodString;
|
|
1481
|
+
name: z.ZodString;
|
|
1482
|
+
createdAtUtcIso: z.ZodString;
|
|
1483
|
+
lastModifiedAtUtcIso: z.ZodString;
|
|
1484
|
+
documentType: z.ZodLiteral<"powerhouse/document-model">;
|
|
1485
|
+
}, z.core.$strip>;
|
|
1486
|
+
state: z.ZodObject<{
|
|
1487
|
+
global: z.ZodObject<Required<{
|
|
1488
|
+
author: z.ZodType<Author, Author, z.core.$ZodTypeInternals<Author, Author>>;
|
|
1489
|
+
description: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
1490
|
+
extension: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
1491
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
1492
|
+
name: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
1493
|
+
specifications: z.ZodType<DocumentSpecification[], DocumentSpecification[], z.core.$ZodTypeInternals<DocumentSpecification[], DocumentSpecification[]>>;
|
|
1494
|
+
}>, z.core.$strip>;
|
|
1495
|
+
}, z.core.$strip>;
|
|
1496
|
+
initialState: z.ZodObject<{
|
|
1497
|
+
global: z.ZodObject<Required<{
|
|
1498
|
+
author: z.ZodType<Author, Author, z.core.$ZodTypeInternals<Author, Author>>;
|
|
1499
|
+
description: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
1500
|
+
extension: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
1501
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
1502
|
+
name: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
1503
|
+
specifications: z.ZodType<DocumentSpecification[], DocumentSpecification[], z.core.$ZodTypeInternals<DocumentSpecification[], DocumentSpecification[]>>;
|
|
1504
|
+
}>, z.core.$strip>;
|
|
1505
|
+
}, z.core.$strip>;
|
|
1506
|
+
}, z.core.$strip>;
|
|
1507
|
+
/** Simple helper function to check if a state object is a DocumentModel document state object */
|
|
1508
|
+
declare function isDocumentModelState(state: unknown): state is DocumentModelPHState;
|
|
1509
|
+
/** Simple helper function to assert that a document state object is a DocumentModel document state object */
|
|
1510
|
+
declare function assertIsDocumentModelState(state: unknown): asserts state is DocumentModelPHState;
|
|
1511
|
+
/** Simple helper function to check if a document is a DocumentModel document */
|
|
1512
|
+
declare function isDocumentModelDocument(document: unknown): document is DocumentModelDocument;
|
|
1513
|
+
/** Simple helper function to assert that a document is a DocumentModel document */
|
|
1514
|
+
declare function assertIsDocumentModelDocument(document: unknown): asserts document is DocumentModelDocument;
|
|
1515
|
+
//#endregion
|
|
1516
|
+
//#region document-model/document-type.d.ts
|
|
1517
|
+
declare const documentModelDocumentType = "powerhouse/document-model";
|
|
1518
|
+
declare const groupDocumentType = "powerhouse/reactor-group";
|
|
1519
|
+
/**
|
|
1520
|
+
* The group-model action types that change membership. The groups projection
|
|
1521
|
+
* filters its reads to these, so any other group operation is invisible to a
|
|
1522
|
+
* decision. Kept here so the reactor never depends on the group package; a
|
|
1523
|
+
* reactor-group test guards against drift.
|
|
1524
|
+
*/
|
|
1525
|
+
declare const groupMembershipActionTypes: readonly ["ADD_MEMBER", "REMOVE_MEMBER"];
|
|
1526
|
+
//#endregion
|
|
1527
|
+
//#region document-model/errors.d.ts
|
|
1528
|
+
declare const FileSystemError: Error;
|
|
1529
|
+
declare class InvalidActionInputError extends Error {
|
|
1530
|
+
data: unknown;
|
|
1531
|
+
constructor(data: unknown);
|
|
1532
|
+
}
|
|
1533
|
+
declare class InvalidActionInputZodError extends InvalidActionInputError {
|
|
1534
|
+
issues: ZodIssue[];
|
|
1535
|
+
constructor(issues: ZodIssue[]);
|
|
1536
|
+
}
|
|
1537
|
+
/**
|
|
1538
|
+
* Error thrown when attempting to downgrade a document version.
|
|
1539
|
+
*/
|
|
1540
|
+
declare class DowngradeNotSupportedError extends Error {
|
|
1541
|
+
readonly documentType: string;
|
|
1542
|
+
readonly fromVersion: number;
|
|
1543
|
+
readonly toVersion: number;
|
|
1544
|
+
constructor(documentType: string, fromVersion: number, toVersion: number);
|
|
1545
|
+
}
|
|
1546
|
+
/**
|
|
1547
|
+
* Thrown when INITIALIZE_AUTH is applied to an already-initialized auth scope.
|
|
1548
|
+
* The genesis action is valid only at auth revision zero.
|
|
1549
|
+
*/
|
|
1550
|
+
declare class AuthAlreadyInitializedError extends Error {
|
|
1551
|
+
readonly documentId: string;
|
|
1552
|
+
constructor(documentId: string);
|
|
1553
|
+
}
|
|
1554
|
+
/**
|
|
1555
|
+
* Thrown when INITIALIZE_AUTH is not signed by the document creator (its signer
|
|
1556
|
+
* does not match `header.sig.publicKey`), so it cannot set the auth policy.
|
|
1557
|
+
*/
|
|
1558
|
+
declare class AuthInitializerNotCreatorError extends Error {
|
|
1559
|
+
readonly documentId: string;
|
|
1560
|
+
constructor(documentId: string);
|
|
1561
|
+
}
|
|
1562
|
+
/**
|
|
1563
|
+
* Thrown when INITIALIZE_AUTH carries a version below 1. Version 0 is reserved
|
|
1564
|
+
* for the uninitialized auth scope.
|
|
1565
|
+
*/
|
|
1566
|
+
declare class InvalidAuthVersionError extends Error {
|
|
1567
|
+
readonly documentId: string;
|
|
1568
|
+
readonly version: number;
|
|
1569
|
+
constructor(documentId: string, version: number);
|
|
1570
|
+
}
|
|
1571
|
+
/** Thrown when a duplicate would lose the source policy's version or creator binding. */
|
|
1572
|
+
declare class AuthPolicyNotPreservedError extends Error {
|
|
1573
|
+
readonly documentId: string;
|
|
1574
|
+
constructor(documentId: string);
|
|
1575
|
+
}
|
|
1576
|
+
/**
|
|
1577
|
+
* Thrown when a grant referenced by REMOVE_GRANT or MOVE_GRANT does not exist.
|
|
1578
|
+
*/
|
|
1579
|
+
declare class GrantNotFoundError extends Error {
|
|
1580
|
+
readonly grantId: string;
|
|
1581
|
+
constructor(grantId: string);
|
|
1582
|
+
}
|
|
1583
|
+
/**
|
|
1584
|
+
* Thrown when a disallowed action (UNDO, REDO) targets the auth scope.
|
|
1585
|
+
*/
|
|
1586
|
+
declare class AuthActionNotAllowedError extends Error {
|
|
1587
|
+
readonly actionType: string;
|
|
1588
|
+
constructor(actionType: string);
|
|
1589
|
+
}
|
|
1590
|
+
declare class HashMismatchError extends Error {
|
|
1591
|
+
protected _scope: string;
|
|
1592
|
+
protected _document: PHDocument$1;
|
|
1593
|
+
protected _operation: Operation;
|
|
1594
|
+
constructor(scope: string, document: PHDocument$1, operation: Operation);
|
|
1595
|
+
get document(): PHDocument$1;
|
|
1596
|
+
get scope(): string;
|
|
1597
|
+
get operation(): Operation;
|
|
1598
|
+
}
|
|
1599
|
+
/**
|
|
1600
|
+
* Thrown when replay or import requires a document model version that is not
|
|
1601
|
+
* registered. Carries the data the UI needs to explain the mismatch.
|
|
1602
|
+
*/
|
|
1603
|
+
declare class UnsupportedDocumentModelVersionError extends Error {
|
|
1604
|
+
readonly documentType: string;
|
|
1605
|
+
readonly requiredVersion: number;
|
|
1606
|
+
readonly availableVersions: number[];
|
|
1607
|
+
constructor(documentType: string, requiredVersion: number, availableVersions: number[]);
|
|
1608
|
+
static isError(error: unknown): error is UnsupportedDocumentModelVersionError;
|
|
1609
|
+
}
|
|
1610
|
+
//#endregion
|
|
1611
|
+
//#region document-model/upgrades.d.ts
|
|
1612
|
+
/** Upgrade reducer transforms a document from one version to another */
|
|
1613
|
+
type UpgradeReducer<TFrom extends PHBaseState, TTo extends PHBaseState> = (document: PHDocument$1<TFrom>, action: Action) => PHDocument$1<TTo>;
|
|
1614
|
+
type ModelVersion = number;
|
|
1615
|
+
/** Metadata about a version transition */
|
|
1616
|
+
type UpgradeTransition = {
|
|
1617
|
+
toVersion: ModelVersion;
|
|
1618
|
+
upgradeReducer: UpgradeReducer<any, any>;
|
|
1619
|
+
description?: string;
|
|
1620
|
+
};
|
|
1621
|
+
type TupleMember<T extends readonly unknown[]> = T[number];
|
|
1622
|
+
/** Manifest declaring all supported versions and upgrade paths */
|
|
1623
|
+
type UpgradeManifest<TVersions extends readonly number[]> = {
|
|
1624
|
+
documentType: string;
|
|
1625
|
+
latestVersion: TupleMember<TVersions>;
|
|
1626
|
+
supportedVersions: TVersions;
|
|
1627
|
+
upgrades: { [V in Exclude<TupleMember<TVersions>, 1> as `v${V}`]: UpgradeTransition; };
|
|
1628
|
+
};
|
|
1629
|
+
/**
|
|
1630
|
+
* Applies an UPGRADE_DOCUMENT action to a document.
|
|
1631
|
+
* Handles all upgrade scenarios including initial upgrades, no-ops, and multi-step upgrades.
|
|
1632
|
+
*
|
|
1633
|
+
* Behavior based on fromVersion/toVersion:
|
|
1634
|
+
* - fromVersion === toVersion (and fromVersion > 0): No-op - return unchanged document
|
|
1635
|
+
* - fromVersion > toVersion: Throw DowngradeNotSupportedError
|
|
1636
|
+
* - All other cases: Apply upgradePath transitions (if provided), then apply initialState, set version
|
|
1637
|
+
*/
|
|
1638
|
+
declare function applyUpgradeDocumentAction(document: PHDocument$1, action: UpgradeDocumentAction, upgradePath?: UpgradeTransition[]): PHDocument$1;
|
|
1639
|
+
/** CREATE_DOCUMENT fixes `protocolVersions`; this puts them back after a reducer. */
|
|
1640
|
+
declare function withProtocolVersions<TDocument extends PHDocument$1>(document: TDocument, protocolVersions: PHDocument$1["header"]["protocolVersions"]): TDocument;
|
|
1641
|
+
/**
|
|
1642
|
+
* Applies a DELETE_DOCUMENT action, or a PURGE_DOCUMENT marker, to a document.
|
|
1643
|
+
* Marks the document as deleted in the document scope state.
|
|
1644
|
+
*/
|
|
1645
|
+
declare function applyDeleteDocumentAction(document: PHDocument$1, action: DeleteDocumentAction | PurgeDocumentAction): PHDocument$1;
|
|
1646
|
+
/**
|
|
1647
|
+
* Computes the ordered list of upgrade transitions needed to move from
|
|
1648
|
+
* fromVersion to toVersion using the provided manifest.
|
|
1649
|
+
* Walks keys v(fromVersion+1)..v(toVersion) and throws a descriptive Error
|
|
1650
|
+
* if the manifest is absent or any step is missing.
|
|
1651
|
+
*/
|
|
1652
|
+
declare function computeUpgradeTransitions(manifest: UpgradeManifest<readonly number[]> | undefined, fromVersion: number, toVersion: number): UpgradeTransition[];
|
|
1653
|
+
//#endregion
|
|
1654
|
+
//#region document-model/versioned-replay.d.ts
|
|
1655
|
+
type VersionedReducers = Record<number, Reducer<PHBaseState>>;
|
|
1656
|
+
type VersionedReplayConfig = {
|
|
1657
|
+
reducers: VersionedReducers;
|
|
1658
|
+
upgradeManifest?: UpgradeManifest<readonly number[]>;
|
|
1659
|
+
};
|
|
1660
|
+
/**
|
|
1661
|
+
* Version-aware document replay. Replays a versioned document through per-version
|
|
1662
|
+
* reducers, applying upgrade transitions at segment boundaries.
|
|
1663
|
+
*
|
|
1664
|
+
* Algorithm (D5):
|
|
1665
|
+
* a. Build spine from operations["document"]. Empty spine or no upgrades → legacy fallback.
|
|
1666
|
+
* b. Collect UPGRADE_DOCUMENT ops from the spine.
|
|
1667
|
+
* c. Seed state from the creation upgrade (fromVersion===0). Missing seed with validated
|
|
1668
|
+
* upgrades throws; otherwise falls back to legacy.
|
|
1669
|
+
* d. Identify validated upgrades (fromVersion > 0, version increases). Compute per-scope
|
|
1670
|
+
* boundaries using revision snapshot (preferred) or timestamp fallback.
|
|
1671
|
+
* e. Loop over version segments, replaying each scope's ops through the matching reducer,
|
|
1672
|
+
* then applying the upgrade transition before the next segment.
|
|
1673
|
+
* f. Set header.revision["document"], verify per-scope hashes against state at op-time
|
|
1674
|
+
* (not post-upgrade state) when checkHashes is false, and map timestamps from input.
|
|
1675
|
+
*
|
|
1676
|
+
* operations must include ALL scopes (document scope is NOT stripped).
|
|
1677
|
+
* reuseOperationResultingState is ignored by this function — zip operations never carry
|
|
1678
|
+
* resultingState.
|
|
1679
|
+
*/
|
|
1680
|
+
declare function replayDocumentVersioned<TState extends PHBaseState>(initialState: TState, operations: DocumentOperations, config: VersionedReplayConfig, header: PHDocumentHeader, dispatch?: SignalDispatch, options?: ReplayDocumentOptions): PHDocument$1<TState>;
|
|
1681
|
+
//#endregion
|
|
1682
|
+
//#region document-model/files.d.ts
|
|
1683
|
+
declare function createZip(document: PHDocument$1): Promise<Uint8Array>;
|
|
1684
|
+
/**
|
|
1685
|
+
* Creates a minimal ZIP backup from strand data.
|
|
1686
|
+
* Used when the full document is not available (e.g., in onOperations handler).
|
|
1687
|
+
* Creates a ZIP with minimal header and empty operations.
|
|
1688
|
+
*/
|
|
1689
|
+
declare function createMinimalZip(data: MinimalBackupData): Promise<Uint8Array>;
|
|
1690
|
+
declare function baseSaveToFileHandle(document: PHDocument$1, input: FileSystemFileHandle): Promise<void>;
|
|
1691
|
+
declare function baseLoadFromInput<TState extends PHBaseState>(input: FileInput, reducer: Reducer<TState>, options?: ReplayDocumentOptions): Promise<PHDocument$1<TState>>;
|
|
1692
|
+
declare function baseLoadFromInputVersioned<TState extends PHBaseState>(input: FileInput, config: VersionedReplayConfig, options?: ReplayDocumentOptions): Promise<PHDocument$1<TState>>;
|
|
1693
|
+
type BulkArchiveEntry = {
|
|
1694
|
+
/** "/"-separated zip path of a file entry (no trailing slash). */
|
|
1695
|
+
path: string;
|
|
1696
|
+
data: Uint8Array;
|
|
1697
|
+
};
|
|
1698
|
+
/**
|
|
1699
|
+
* Whether this zip is a single Powerhouse document: the document's four JSON
|
|
1700
|
+
* entries (header/state/current-state/operations) at the archive root. A
|
|
1701
|
+
* bulk archive has a folder tree instead. Returns false for any input that
|
|
1702
|
+
* is not a readable zip.
|
|
1703
|
+
*/
|
|
1704
|
+
declare function isDocumentZip(data: Uint8Array): Promise<boolean>;
|
|
1705
|
+
/**
|
|
1706
|
+
* The file entries of a zip (directory entries excluded). Used for bulk
|
|
1707
|
+
* archives; throws when the archive holds no files. Note this does NOT
|
|
1708
|
+
* validate that the entries are document zips — pair with isDocumentZip.
|
|
1709
|
+
*/
|
|
1710
|
+
declare function parseBulkArchive(data: Uint8Array): Promise<BulkArchiveEntry[]>;
|
|
1711
|
+
/**
|
|
1712
|
+
* Assemble a zip from raw entries. A key ending in "/" with empty data is a
|
|
1713
|
+
* directory entry, so an archive's folder structure survives a round-trip.
|
|
1714
|
+
*/
|
|
1715
|
+
declare function zipEntries(entries: Record<string, Uint8Array>): Promise<Uint8Array>;
|
|
1716
|
+
declare const documentModelLoadFromInput: LoadFromInput<DocumentModelPHState>;
|
|
1717
|
+
declare const documentModelSaveToFileHandle: SaveToFileHandle;
|
|
1718
|
+
declare function writeFileBrowser(path: string, name: string, stream: Uint8Array): Promise<string>;
|
|
1719
|
+
declare function readFileBrowser(path: string): void;
|
|
1720
|
+
declare function fetchFileBrowser(url: string): Promise<{
|
|
1721
|
+
data: Buffer;
|
|
1722
|
+
mimeType?: string;
|
|
1723
|
+
}>;
|
|
1724
|
+
declare const getFileBrowser: (file: string) => Promise<void>;
|
|
1725
|
+
//#endregion
|
|
1726
|
+
//#region document-model/header.d.ts
|
|
1727
|
+
/**
|
|
1728
|
+
* Creates a verification-only signer from a public key.
|
|
1729
|
+
* This signer can only verify signatures, not sign data.
|
|
1730
|
+
*
|
|
1731
|
+
* @param pubKey - The public key to use for verification.
|
|
1732
|
+
* @returns An ISigner that can only verify signatures.
|
|
1733
|
+
*/
|
|
1734
|
+
declare function createVerificationSigner(pubKey: JsonWebKey): Promise<ISigner>;
|
|
1735
|
+
/**
|
|
1736
|
+
* Signs a header. Generally, this is not called directly, but rather through
|
|
1737
|
+
* {@link createSignedHeader}.
|
|
1738
|
+
*
|
|
1739
|
+
* @param parameters - The parameters used to sign the header.
|
|
1740
|
+
* @param signer - The signer of the document.
|
|
1741
|
+
*
|
|
1742
|
+
* @returns The signature of the header.
|
|
1743
|
+
*/
|
|
1744
|
+
declare const sign: (parameters: SigningParameters, signer: ISigner) => Promise<string>;
|
|
1745
|
+
/**
|
|
1746
|
+
* Verifies a header signature. Generally, this is not called directly, but
|
|
1747
|
+
* rather through {@link validateHeader}.
|
|
1748
|
+
*
|
|
1749
|
+
* @param parameters - The parameters used to sign the header.
|
|
1750
|
+
* @param signature - The signature to verify.
|
|
1751
|
+
* @param signer - The signer of the document.
|
|
1752
|
+
*/
|
|
1753
|
+
declare const verify: (parameters: SigningParameters, signature: string, signer: ISigner) => Promise<void>;
|
|
1754
|
+
/**
|
|
1755
|
+
* Validates a header signature.
|
|
1756
|
+
*/
|
|
1757
|
+
declare const validateHeader: (header: PHDocumentHeader) => Promise<void>;
|
|
1758
|
+
/**
|
|
1759
|
+
* Creates a header that has yet to be signed. This header is not valid, but
|
|
1760
|
+
* can be input into {@link createSignedHeader} to create a signed header.
|
|
1761
|
+
*
|
|
1762
|
+
* With `protocolVersions` requiring v2 signatures the header takes a random
|
|
1763
|
+
* nonce and the id {@link deriveDocumentId} gives, so `id` must be omitted.
|
|
1764
|
+
*
|
|
1765
|
+
* @returns An unsigned header for a document.
|
|
1766
|
+
*/
|
|
1767
|
+
declare const createPresignedHeader: (id?: string, documentType?: string, protocolVersions?: ProtocolVersions) => PHDocumentHeader;
|
|
1768
|
+
/**
|
|
1769
|
+
* A header for a copy of a document headed `source`. A copy is v2-required
|
|
1770
|
+
* when its source is or when `policy` asks for it, and then takes a derived id;
|
|
1771
|
+
* otherwise it takes `id`. It keeps the source's other protocol versions.
|
|
1772
|
+
*/
|
|
1773
|
+
declare function createCopyHeader(source: Pick<PHDocumentHeader, "documentType" | "protocolVersions">, id?: string, policy?: SignaturePolicy$1): PHDocumentHeader;
|
|
1774
|
+
/** Whether a v2-required `header` carries the id its params derive. */
|
|
1775
|
+
declare function hasDerivedDocumentId(header: PHDocumentHeader): boolean;
|
|
1776
|
+
/**
|
|
1777
|
+
* Creates a new, signed header for a document. This will replace the id of the
|
|
1778
|
+
* document.
|
|
1779
|
+
*
|
|
1780
|
+
* @param unsignedHeader - The unsigned header to created the signed header from.
|
|
1781
|
+
* @param signer - The signer of the document.
|
|
1782
|
+
*
|
|
1783
|
+
* @returns A new signed header for a document. Some fields are mutable and
|
|
1784
|
+
* some are not. See the PHDocumentHeader type for more information.
|
|
1785
|
+
*/
|
|
1786
|
+
declare const createSignedHeader: (unsignedHeader: PHDocumentHeader, documentType: string, signer: ISigner) => Promise<PHDocumentHeader>;
|
|
1787
|
+
/**
|
|
1788
|
+
* Creates a signed header for a document. The document header requires a signer
|
|
1789
|
+
* as the document id is a cryptographic signature.
|
|
1790
|
+
*
|
|
1791
|
+
* @param documentType - The type of the document.
|
|
1792
|
+
* @param signer - The signer of the document.
|
|
1793
|
+
*
|
|
1794
|
+
* @returns The signed header for a document. Some fields are mutable and
|
|
1795
|
+
* some are not. See the PHDocumentHeader type for more information.
|
|
1796
|
+
*/
|
|
1797
|
+
declare const createSignedHeaderForSigner: (documentType: string, signer: ISigner) => Promise<PHDocumentHeader>;
|
|
1798
|
+
//#endregion
|
|
1799
|
+
//#region document-model/new-document.d.ts
|
|
1800
|
+
/** What a new document takes besides the client's selected versions. */
|
|
1801
|
+
type NewDocumentHeaderOptions = {
|
|
1802
|
+
/** Merged over the selected versions; `signature: 2` makes it v2-required. */
|
|
1803
|
+
protocolVersions?: ProtocolVersions;
|
|
1804
|
+
/** Overrides the client's creation default. */
|
|
1805
|
+
signaturePolicy?: SignaturePolicy$1;
|
|
1806
|
+
/** Passed to the model's createDocument, which fills what it leaves out. */
|
|
1807
|
+
initialState?: Partial<PHBaseState>;
|
|
1808
|
+
name?: string;
|
|
1809
|
+
/** Kept only under the legacy policy; any other policy derives the id. */
|
|
1810
|
+
id?: string;
|
|
1811
|
+
};
|
|
1812
|
+
type CreateProtocolVersionsOptions = {
|
|
1813
|
+
/**
|
|
1814
|
+
* The new document's type, which fits base-reducer to its reducer.
|
|
1815
|
+
* `undefined` only where the type is not known, e.g. a legacy request.
|
|
1816
|
+
*/
|
|
1817
|
+
documentType: string | undefined;
|
|
1818
|
+
parentIdentifier?: string;
|
|
1819
|
+
};
|
|
1820
|
+
/** A header's versions are its creator's choice; only a versionless legacy header is selected for. */
|
|
1821
|
+
declare function createVersionsOf(document: PHDocument$1, select: (options: CreateProtocolVersionsOptions) => Promise<ProtocolVersions>, parentIdentifier?: string): Promise<ProtocolVersions>;
|
|
1822
|
+
/** A new, uncreated document of `module`, headed with `baseVersions` under `options`. */
|
|
1823
|
+
declare function headNewDocument(module: DocumentModelModule, options: NewDocumentHeaderOptions | undefined, defaultPolicy: SignaturePolicy$1, baseVersions: ProtocolVersions): PHDocument$1;
|
|
1824
|
+
/** The registered module for a type: the requested version, else the latest. */
|
|
1825
|
+
declare function selectDocumentModelModule(modules: readonly DocumentModelModule[], documentModelType: string, documentModelVersion?: number): DocumentModelModule;
|
|
1826
|
+
//#endregion
|
|
1827
|
+
//#region document-model/peer-agreement.d.ts
|
|
1828
|
+
/** The reactor feature flags a capability's support is a function of. */
|
|
1829
|
+
type PeerCapabilityFlags = {
|
|
1830
|
+
readonly [flag: string]: boolean | undefined;
|
|
1831
|
+
};
|
|
1832
|
+
/** A document protocol, named by its `protocolVersions` key. */
|
|
1833
|
+
type ProtocolCapability = {
|
|
1834
|
+
kind: "protocol";
|
|
1835
|
+
name: string;
|
|
1836
|
+
/** What a peer that announces nothing is assumed to support. */
|
|
1837
|
+
baseline: readonly number[];
|
|
1838
|
+
supported(flags: PeerCapabilityFlags): readonly number[];
|
|
1839
|
+
/** The version new documents take when peers agree. Absent: not negotiated. */
|
|
1840
|
+
preferred?(flags: PeerCapabilityFlags): number;
|
|
1841
|
+
/** A header may omit the key. */
|
|
1842
|
+
optional: boolean;
|
|
1843
|
+
};
|
|
1844
|
+
/** A feature that changes what a peer sends or expects on the wire. */
|
|
1845
|
+
type FeatureCapability = {
|
|
1846
|
+
kind: "feature";
|
|
1847
|
+
name: string;
|
|
1848
|
+
baseline: readonly number[];
|
|
1849
|
+
supported(flags: PeerCapabilityFlags): readonly number[];
|
|
1850
|
+
};
|
|
1851
|
+
type PeerCapability = ProtocolCapability | FeatureCapability;
|
|
1852
|
+
/** A purged document's protocol; never preferred, so creation never selects it. */
|
|
1853
|
+
declare const DOCUMENT_PURGE_PROTOCOL = "document-purge";
|
|
1854
|
+
/** A peer that takes refusals of polled purge markers on the poll. */
|
|
1855
|
+
declare const MARKER_REFUSAL_FEATURE = "marker-refusal";
|
|
1856
|
+
declare const PEER_CAPABILITIES: readonly PeerCapability[];
|
|
1857
|
+
/** `base` plus `extra`; an extra replaces a base entry of the same name. */
|
|
1858
|
+
declare function mergePeerCapabilities(base: readonly PeerCapability[], extra: readonly PeerCapability[]): PeerCapability[];
|
|
1859
|
+
declare const PEER_MANIFEST_FORMAT = 1;
|
|
1860
|
+
type Supports = {
|
|
1861
|
+
protocols: {
|
|
1862
|
+
[protocol: string]: readonly number[];
|
|
1863
|
+
};
|
|
1864
|
+
features: {
|
|
1865
|
+
[feature: string]: readonly number[];
|
|
1866
|
+
};
|
|
1867
|
+
};
|
|
1868
|
+
type PeerManifest = Supports & {
|
|
1869
|
+
format: 1;
|
|
1870
|
+
/** The signer's did:key, when configured; informational. */
|
|
1871
|
+
appKey?: string;
|
|
1872
|
+
/** Grows with every start of the reactor; a peer ignores an older one. */
|
|
1873
|
+
sequence: number;
|
|
1874
|
+
/** base64url(sha256(canonicalJson(Supports & { sequence }))) */
|
|
1875
|
+
revision: string;
|
|
1876
|
+
};
|
|
1877
|
+
/** What this reactor supports, for every capability it registers. */
|
|
1878
|
+
declare function localSupports(capabilities: readonly PeerCapability[], flags: PeerCapabilityFlags): Supports;
|
|
1879
|
+
/** What a peer that announces nothing supports. */
|
|
1880
|
+
declare function legacySupports(capabilities: readonly PeerCapability[]): Supports;
|
|
1881
|
+
declare function manifestRevision(supports: Supports, sequence?: number): string;
|
|
1882
|
+
declare function localPeerManifest(capabilities: readonly PeerCapability[], flags: PeerCapabilityFlags, appKey?: string, sequence?: number): PeerManifest;
|
|
1883
|
+
/** A manifest sent before the one already held; silence carries no sequence. */
|
|
1884
|
+
declare function isOlderManifest(next: PeerManifest | null, held: PeerManifest | null | undefined): boolean;
|
|
1885
|
+
/** A peer's manifest, or the baselines for a peer that announced none. */
|
|
1886
|
+
declare function peerSupports(manifest: PeerManifest | null, capabilities: readonly PeerCapability[]): Supports;
|
|
1887
|
+
/**
|
|
1888
|
+
* A manifest as received from a peer, or null when it is not one. Formats only
|
|
1889
|
+
* add fields, so one of an unknown format is read as its two maps.
|
|
1890
|
+
*/
|
|
1891
|
+
declare function readPeerManifest(value: unknown): PeerManifest | null;
|
|
1892
|
+
/** Why a document may not go to a peer. */
|
|
1893
|
+
type HoldReason = {
|
|
1894
|
+
protocol: string;
|
|
1895
|
+
version: number;
|
|
1896
|
+
peerSupports: readonly number[];
|
|
1897
|
+
};
|
|
1898
|
+
/** Only keys this reactor registers are judged; an absent key agrees. */
|
|
1899
|
+
declare function holdReason(peer: Supports, versions: {
|
|
1900
|
+
readonly [protocol: string]: number;
|
|
1901
|
+
}, capabilities: readonly PeerCapability[]): HoldReason | undefined;
|
|
1902
|
+
/** Whether a peer runs every version this reactor does, so nothing is held. */
|
|
1903
|
+
declare function coversLocal(peer: Supports, local: Supports, capabilities: readonly PeerCapability[]): boolean;
|
|
1904
|
+
/**
|
|
1905
|
+
* protocolVersions for a new document: per negotiated protocol, the highest
|
|
1906
|
+
* version up to the local preference that every member supports, else the
|
|
1907
|
+
* lowest local one. `requested` wins over what is selected.
|
|
1908
|
+
*/
|
|
1909
|
+
declare function selectProtocolVersions(input: {
|
|
1910
|
+
capabilities: readonly PeerCapability[];
|
|
1911
|
+
flags: PeerCapabilityFlags;
|
|
1912
|
+
members: Iterable<Supports>;
|
|
1913
|
+
requested?: {
|
|
1914
|
+
readonly [protocol: string]: number;
|
|
1915
|
+
};
|
|
1916
|
+
}): {
|
|
1917
|
+
[protocol: string]: number;
|
|
1918
|
+
};
|
|
1919
|
+
/**
|
|
1920
|
+
* Another reactor's selection for a new document, within `supports`: a
|
|
1921
|
+
* negotiated protocol drops to the highest supported version at or below it,
|
|
1922
|
+
* or takes its baseline when absent; another known protocol must be
|
|
1923
|
+
* supported; an unknown one passes, as refusalFor admits it.
|
|
1924
|
+
*/
|
|
1925
|
+
declare function capSelection(selected: {
|
|
1926
|
+
readonly [protocol: string]: number;
|
|
1927
|
+
} | undefined, capabilities: readonly PeerCapability[], supports: Supports): {
|
|
1928
|
+
[protocol: string]: number;
|
|
1929
|
+
};
|
|
1930
|
+
//#endregion
|
|
1931
|
+
//#region document-model/purge.d.ts
|
|
1932
|
+
declare const PURGE_DOCUMENT = "PURGE_DOCUMENT";
|
|
1933
|
+
type PurgeMarkerOperation = Operation & {
|
|
1934
|
+
action: PurgeDocumentAction;
|
|
1935
|
+
};
|
|
1936
|
+
type ActionLike = Pick<Action, "type">;
|
|
1937
|
+
declare function isPurgeMarker(value: Action): value is PurgeDocumentAction;
|
|
1938
|
+
declare function isPurgeMarker(value: Operation): value is PurgeMarkerOperation;
|
|
1939
|
+
declare function isPurgeMarker(value: OperationWithContext$1): value is OperationWithContext$1 & {
|
|
1940
|
+
operation: PurgeMarkerOperation;
|
|
1941
|
+
};
|
|
1942
|
+
declare function isPurgeMarker(value: ActionLike | {
|
|
1943
|
+
action?: ActionLike;
|
|
1944
|
+
} | {
|
|
1945
|
+
operation: Operation;
|
|
1946
|
+
}): boolean;
|
|
1947
|
+
/** An unsigned marker; `purgedAtUtcIso` is the action's own timestamp. */
|
|
1948
|
+
declare function purgeDocumentAction(input: Omit<PurgeDocumentActionInput, "purgedAtUtcIso">, options?: {
|
|
1949
|
+
id?: string;
|
|
1950
|
+
timestampUtcMs?: string;
|
|
1951
|
+
}): PurgeDocumentAction;
|
|
1952
|
+
/** The sole row of a purged stream: document/main, index 0, skip 0, hash "". */
|
|
1953
|
+
declare function purgeMarkerOperation(action: PurgeDocumentAction): PurgeMarkerOperation;
|
|
1954
|
+
/** Protocol versions of a purged id; derived, never stored. */
|
|
1955
|
+
declare function purgedProtocolVersions(): {
|
|
1956
|
+
[protocol: string]: number;
|
|
1957
|
+
};
|
|
1958
|
+
//#endregion
|
|
1959
|
+
//#region document-model/reducer.d.ts
|
|
1960
|
+
declare function replayOperations<TState extends PHBaseState = PHBaseState>(initialState: TState, clearedOperations: DocumentOperations, stateReducer: StateReducer<TState>, header: PHDocumentHeader, dispatch?: SignalDispatch, documentReducer?: typeof baseReducer, skipHeaderOperations?: SkipHeaderOperations, options?: ReplayDocumentOptions): PHDocument$1<TState>;
|
|
1961
|
+
/**
|
|
1962
|
+
* Updates the document state based on the provided action.
|
|
1963
|
+
*
|
|
1964
|
+
* @param state The current state of the document.
|
|
1965
|
+
* @param action The action being applied to the document.
|
|
1966
|
+
* @param skip The number of operations to skip before applying the action.
|
|
1967
|
+
* @param reuseLastOperationIndex Whether to reuse the last operation index (used when a an UNDO operation is performed after an existing one).
|
|
1968
|
+
* @param context The operation context for deterministic ID generation.
|
|
1969
|
+
* @returns The updated document state.
|
|
1970
|
+
*/
|
|
1971
|
+
declare function updateDocument<TDocument extends PHDocument$1>(document: TDocument, action: Action, reuseLastOperationIndex: boolean, skip: number, context: OperationContext, operation?: Operation, skipIndexValidation?: boolean): TDocument;
|
|
1972
|
+
/**
|
|
1973
|
+
* Processes an UNDO or REDO action.
|
|
1974
|
+
*
|
|
1975
|
+
* @param document The current state of the document.
|
|
1976
|
+
* @param action The action being applied to the document.
|
|
1977
|
+
* @param skip The number of operations to skip before applying the action.
|
|
1978
|
+
* @returns The updated document, calculated skip value and transformed action (if applied).
|
|
1979
|
+
*/
|
|
1980
|
+
declare function processUndoRedo<TState extends PHBaseState = PHBaseState>(document: PHDocument$1<TState>, action: Action, skip: number, protocolVersion?: number): {
|
|
1981
|
+
document: PHDocument$1<TState>;
|
|
1982
|
+
action: Action;
|
|
1983
|
+
skip: number;
|
|
1984
|
+
reuseLastOperationIndex: boolean;
|
|
1985
|
+
};
|
|
1986
|
+
/**
|
|
1987
|
+
* Base document reducer that wraps a custom document reducer and handles
|
|
1988
|
+
* document-level actions such as undo, redo, and set name.
|
|
1989
|
+
*
|
|
1990
|
+
* @template TGlobalState - The type of the state of the custom reducer.
|
|
1991
|
+
* @template TAction - The type of the actions of the custom reducer.
|
|
1992
|
+
* @param state - The current state of the document.
|
|
1993
|
+
* @param action - The action object to apply to the state.
|
|
1994
|
+
* @param customReducer - The custom reducer that implements the application logic
|
|
1995
|
+
* specific to the document's state.
|
|
1996
|
+
* @returns The new state of the document.
|
|
1997
|
+
*/
|
|
1998
|
+
declare function baseReducer<TState extends PHBaseState = PHBaseState>(document: PHDocument$1<TState>, action: Action, customReducer: StateReducer<TState>, dispatch?: SignalDispatch, options?: ReducerOptions): PHDocument$1<TState>;
|
|
1999
|
+
/**
|
|
2000
|
+
* Helper function to create a document model reducer.
|
|
2001
|
+
*
|
|
2002
|
+
* @remarks
|
|
2003
|
+
* This function creates a new reducer that wraps the provided `reducer` with
|
|
2004
|
+
* `documentReducer`, adding support for document actions:
|
|
2005
|
+
* - `SET_NAME`
|
|
2006
|
+
* - `UNDO`
|
|
2007
|
+
* - `REDO`
|
|
2008
|
+
*
|
|
2009
|
+
* It also updates the document-related attributes on every operation.
|
|
2010
|
+
*
|
|
2011
|
+
* @param reducer - The custom reducer to wrap.
|
|
2012
|
+
* @param documentReducer - The document reducer to use.
|
|
2013
|
+
*
|
|
2014
|
+
* @returns The new reducer.
|
|
2015
|
+
*/
|
|
2016
|
+
declare function createReducer<TState extends PHBaseState = PHBaseState>(stateReducer: StateReducer<TState>, documentReducer?: typeof baseReducer): Reducer<TState>;
|
|
2017
|
+
//#endregion
|
|
2018
|
+
//#region document-model/reducers.d.ts
|
|
2019
|
+
declare const documentModelHeaderReducer: DocumentModelHeaderOperations;
|
|
2020
|
+
declare const documentModelModuleReducer: DocumentModelModuleOperations;
|
|
2021
|
+
declare const documentModelOperationErrorReducer: DocumentModelOperationErrorOperations;
|
|
2022
|
+
declare const documentModelOperationExampleReducer: DocumentModelOperationExampleOperations;
|
|
2023
|
+
declare const documentModelOperationReducer: DocumentModelOperationOperations;
|
|
2024
|
+
declare const documentModelStateSchemaReducer: DocumentModelStateOperations;
|
|
2025
|
+
declare const documentModelVersioningReducer: DocumentModelVersioningOperations;
|
|
2026
|
+
declare const documentModelStateReducer: StateReducer<DocumentModelPHState>;
|
|
2027
|
+
declare const documentModelReducer: Reducer<DocumentModelPHState>;
|
|
2028
|
+
//#endregion
|
|
2029
|
+
//#region document-model/schemas.d.ts
|
|
2030
|
+
type definedNonNullAny = {};
|
|
2031
|
+
declare const isDefinedNonNullAny: (v: any) => v is definedNonNullAny;
|
|
2032
|
+
declare const definedNonNullAnySchema: z.ZodAny & z.ZodType<definedNonNullAny, any, z.core.$ZodTypeInternals<definedNonNullAny, any>>;
|
|
2033
|
+
declare const RedoSchema: z.ZodEnum<{
|
|
2034
|
+
REDO: "REDO";
|
|
2035
|
+
}>;
|
|
2036
|
+
declare const Set_NameSchema: z.ZodEnum<{
|
|
2037
|
+
SET_NAME: "SET_NAME";
|
|
2038
|
+
}>;
|
|
2039
|
+
declare const Set_PreferredEditorSchema: z.ZodEnum<{
|
|
2040
|
+
SET_PREFERRED_EDITOR: "SET_PREFERRED_EDITOR";
|
|
2041
|
+
}>;
|
|
2042
|
+
declare const UndoSchema: z.ZodEnum<{
|
|
2043
|
+
UNDO: "UNDO";
|
|
2044
|
+
}>;
|
|
2045
|
+
declare function OperationScopeSchema(): z.ZodString;
|
|
2046
|
+
declare function DocumentActionSchema(): z.ZodUnion<readonly [z.ZodObject<Required<{
|
|
2047
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2048
|
+
timestampUtcMs: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2049
|
+
input: z.ZodType<RedoActionInput, RedoActionInput, z.core.$ZodTypeInternals<RedoActionInput, RedoActionInput>>;
|
|
2050
|
+
type: z.ZodType<"REDO", "REDO", z.core.$ZodTypeInternals<"REDO", "REDO">>;
|
|
2051
|
+
scope: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2052
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2053
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2054
|
+
timestampUtcMs: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2055
|
+
input: z.ZodType<SetNameActionInput, SetNameActionInput, z.core.$ZodTypeInternals<SetNameActionInput, SetNameActionInput>>;
|
|
2056
|
+
type: z.ZodType<"SET_NAME", "SET_NAME", z.core.$ZodTypeInternals<"SET_NAME", "SET_NAME">>;
|
|
2057
|
+
scope: z.ZodType<"global", "global", z.core.$ZodTypeInternals<"global", "global">>;
|
|
2058
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2059
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2060
|
+
timestampUtcMs: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2061
|
+
input: z.ZodType<SetPreferredEditorActionInput, SetPreferredEditorActionInput, z.core.$ZodTypeInternals<SetPreferredEditorActionInput, SetPreferredEditorActionInput>>;
|
|
2062
|
+
type: z.ZodType<"SET_PREFERRED_EDITOR", "SET_PREFERRED_EDITOR", z.core.$ZodTypeInternals<"SET_PREFERRED_EDITOR", "SET_PREFERRED_EDITOR">>;
|
|
2063
|
+
scope: z.ZodType<"header", "header", z.core.$ZodTypeInternals<"header", "header">>;
|
|
2064
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2065
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2066
|
+
timestampUtcMs: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2067
|
+
input: z.ZodType<UndoActionInput, UndoActionInput, z.core.$ZodTypeInternals<UndoActionInput, UndoActionInput>>;
|
|
2068
|
+
type: z.ZodType<"UNDO", "UNDO", z.core.$ZodTypeInternals<"UNDO", "UNDO">>;
|
|
2069
|
+
scope: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2070
|
+
}>, z.core.$strip>]>;
|
|
2071
|
+
declare function RedoActionInputSchema(): z.ZodObject<{
|
|
2072
|
+
count: z.ZodNumber;
|
|
2073
|
+
}, z.core.$strip>;
|
|
2074
|
+
declare function RedoActionSchema(): z.ZodObject<Properties<SchemaRedoAction>>;
|
|
2075
|
+
declare function SetNameActionInputSchema(): z.ZodObject<{
|
|
2076
|
+
name: z.ZodString;
|
|
2077
|
+
}, z.core.$strip>;
|
|
2078
|
+
declare function SetNameActionSchema(): z.ZodObject<Properties<SchemaSetNameAction>>;
|
|
2079
|
+
declare function SetPreferredEditorActionInputSchema(): z.ZodObject<{
|
|
2080
|
+
preferredEditor: z.ZodNullable<z.ZodString>;
|
|
2081
|
+
}, z.core.$strip>;
|
|
2082
|
+
declare function SetPreferredEditorActionSchema(): z.ZodObject<Properties<SchemaSetPreferredEditorAction>>;
|
|
2083
|
+
declare function UndoActionInputSchema(): z.ZodObject<{
|
|
2084
|
+
count: z.ZodNumber;
|
|
2085
|
+
}, z.core.$strip>;
|
|
2086
|
+
declare function UndoActionSchema(): z.ZodObject<Properties<SchemaUndoAction>>;
|
|
2087
|
+
type Properties<T> = Required<{ [K in keyof T]: z.ZodType<T[K], T[K]>; }>;
|
|
2088
|
+
declare function AddChangeLogItemInputSchema(): z.ZodObject<Properties<AddChangeLogItemInput>>;
|
|
2089
|
+
declare function AddModuleInputSchema(): z.ZodObject<Properties<AddModuleInput>>;
|
|
2090
|
+
declare function AddOperationErrorInputSchema(): z.ZodObject<Properties<AddOperationErrorInput>>;
|
|
2091
|
+
declare function AddOperationExampleInputSchema(): z.ZodObject<Properties<AddOperationExampleInput>>;
|
|
2092
|
+
declare function AddOperationInputSchema(): z.ZodObject<Properties<AddOperationInput>>;
|
|
2093
|
+
declare function AddStateExampleInputSchema(): z.ZodObject<Properties<AddStateExampleInput>>;
|
|
2094
|
+
declare function AuthorSchema(): z.ZodObject<Properties<Author>>;
|
|
2095
|
+
declare function CodeExampleSchema(): z.ZodObject<Properties<CodeExample>>;
|
|
2096
|
+
declare function DeleteChangeLogItemInputSchema(): z.ZodObject<Properties<DeleteChangeLogItemInput>>;
|
|
2097
|
+
declare function DeleteModuleInputSchema(): z.ZodObject<Properties<DeleteModuleInput>>;
|
|
2098
|
+
declare function DeleteOperationErrorInputSchema(): z.ZodObject<Properties<DeleteOperationErrorInput>>;
|
|
2099
|
+
declare function DeleteOperationExampleInputSchema(): z.ZodObject<Properties<DeleteOperationExampleInput>>;
|
|
2100
|
+
declare function DeleteOperationInputSchema(): z.ZodObject<Properties<DeleteOperationInput>>;
|
|
2101
|
+
declare function DeleteStateExampleInputSchema(): z.ZodObject<Properties<DeleteStateExampleInput>>;
|
|
2102
|
+
declare function DocumentModelInputSchema(): z.ZodUnion<readonly [z.ZodObject<Required<{
|
|
2103
|
+
__typename?: z.ZodType<"AddChangeLogItemInput" | undefined, "AddChangeLogItemInput" | undefined, z.core.$ZodTypeInternals<"AddChangeLogItemInput" | undefined, "AddChangeLogItemInput" | undefined>> | undefined;
|
|
2104
|
+
content: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2105
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2106
|
+
insertBefore: z.ZodType<Maybe<string>, Maybe<string>, z.core.$ZodTypeInternals<Maybe<string>, Maybe<string>>>;
|
|
2107
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2108
|
+
description?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
|
|
2109
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2110
|
+
name: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2111
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2112
|
+
errorCode?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
|
|
2113
|
+
errorDescription?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
|
|
2114
|
+
errorName?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
|
|
2115
|
+
errorTemplate?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
|
|
2116
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2117
|
+
operationId: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2118
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2119
|
+
example: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2120
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2121
|
+
operationId: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2122
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2123
|
+
description?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
|
|
2124
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2125
|
+
moduleId: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2126
|
+
name: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2127
|
+
reducer?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
|
|
2128
|
+
schema?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
|
|
2129
|
+
template?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
|
|
2130
|
+
scope?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
|
|
2131
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2132
|
+
scope: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2133
|
+
example: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2134
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2135
|
+
insertBefore?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
|
|
2136
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2137
|
+
__typename?: z.ZodType<"DeleteChangeLogItemInput" | undefined, "DeleteChangeLogItemInput" | undefined, z.core.$ZodTypeInternals<"DeleteChangeLogItemInput" | undefined, "DeleteChangeLogItemInput" | undefined>> | undefined;
|
|
2138
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2139
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2140
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2141
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2142
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2143
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2144
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2145
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2146
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2147
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2148
|
+
scope: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2149
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2150
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2151
|
+
newModuleId: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2152
|
+
operationId: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2153
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2154
|
+
__typename?: z.ZodType<"ReorderChangeLogItemsInput" | undefined, "ReorderChangeLogItemsInput" | undefined, z.core.$ZodTypeInternals<"ReorderChangeLogItemsInput" | undefined, "ReorderChangeLogItemsInput" | undefined>> | undefined;
|
|
2155
|
+
order: z.ZodType<string[], string[], z.core.$ZodTypeInternals<string[], string[]>>;
|
|
2156
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2157
|
+
moduleId: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2158
|
+
order: z.ZodType<string[], string[], z.core.$ZodTypeInternals<string[], string[]>>;
|
|
2159
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2160
|
+
order: z.ZodType<string[], string[], z.core.$ZodTypeInternals<string[], string[]>>;
|
|
2161
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2162
|
+
operationId: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2163
|
+
order: z.ZodType<string[], string[], z.core.$ZodTypeInternals<string[], string[]>>;
|
|
2164
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2165
|
+
operationId: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2166
|
+
order: z.ZodType<string[], string[], z.core.$ZodTypeInternals<string[], string[]>>;
|
|
2167
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2168
|
+
scope: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2169
|
+
order: z.ZodType<string[], string[], z.core.$ZodTypeInternals<string[], string[]>>;
|
|
2170
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2171
|
+
authorName: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2172
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2173
|
+
authorWebsite: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2174
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2175
|
+
scope: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2176
|
+
initialValue: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2177
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2178
|
+
description: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2179
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2180
|
+
extension: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2181
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2182
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2183
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2184
|
+
name: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2185
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2186
|
+
description?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
|
|
2187
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2188
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2189
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2190
|
+
name?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
|
|
2191
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2192
|
+
description?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
|
|
2193
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2194
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2195
|
+
errorCode?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
|
|
2196
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2197
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2198
|
+
errorDescription?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
|
|
2199
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2200
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2201
|
+
errorName?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
|
|
2202
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2203
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2204
|
+
errorTemplate?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
|
|
2205
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2206
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2207
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2208
|
+
name?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
|
|
2209
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2210
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2211
|
+
reducer?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
|
|
2212
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2213
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2214
|
+
schema?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
|
|
2215
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2216
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2217
|
+
template?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
|
|
2218
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2219
|
+
scope: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2220
|
+
schema: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2221
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2222
|
+
__typename?: z.ZodType<"UpdateChangeLogItemInput" | undefined, "UpdateChangeLogItemInput" | undefined, z.core.$ZodTypeInternals<"UpdateChangeLogItemInput" | undefined, "UpdateChangeLogItemInput" | undefined>> | undefined;
|
|
2223
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2224
|
+
newContent: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2225
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2226
|
+
example: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2227
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2228
|
+
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
2229
|
+
scope: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2230
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2231
|
+
newExample: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
2232
|
+
}>, z.core.$strip>]>;
|
|
2233
|
+
declare function DocumentModelGlobalStateSchema(): z.ZodObject<Properties<DocumentModelGlobalState>>;
|
|
2234
|
+
declare function DocumentSpecificationSchema(): z.ZodObject<Properties<DocumentSpecification>>;
|
|
2235
|
+
declare function ModuleSchema(): z.ZodObject<Properties<ModuleSpecification>>;
|
|
2236
|
+
declare function MoveOperationInputSchema(): z.ZodObject<Properties<MoveOperationInput>>;
|
|
2237
|
+
declare function OperationSpecificationSchema(): z.ZodObject<Properties<OperationSpecification>>;
|
|
2238
|
+
declare function OperationErrorSchema(): z.ZodObject<Properties<OperationErrorSpecification>>;
|
|
2239
|
+
declare function ReorderChangeLogItemsInputSchema(): z.ZodObject<Properties<ReorderChangeLogItemsInput>>;
|
|
2240
|
+
declare function ReorderModuleOperationsInputSchema(): z.ZodObject<Properties<ReorderModuleOperationsInput>>;
|
|
2241
|
+
declare function ReorderModulesInputSchema(): z.ZodObject<Properties<ReorderModulesInput>>;
|
|
2242
|
+
declare function ReorderOperationErrorsInputSchema(): z.ZodObject<Properties<ReorderOperationErrorsInput>>;
|
|
2243
|
+
declare function ReorderOperationExamplesInputSchema(): z.ZodObject<Properties<ReorderOperationExamplesInput>>;
|
|
2244
|
+
declare function ReorderStateExamplesInputSchema(): z.ZodObject<Properties<ReorderStateExamplesInput>>;
|
|
2245
|
+
declare function SetAuthorNameInputSchema(): z.ZodObject<Properties<SetAuthorNameInput>>;
|
|
2246
|
+
declare function SetAuthorWebsiteInputSchema(): z.ZodObject<Properties<SetAuthorWebsiteInput>>;
|
|
2247
|
+
declare function SetInitialStateInputSchema(): z.ZodObject<Properties<SetInitialStateInput>>;
|
|
2248
|
+
declare function SetModelDescriptionInputSchema(): z.ZodObject<Properties<SetModelDescriptionInput>>;
|
|
2249
|
+
declare function SetModelExtensionInputSchema(): z.ZodObject<Properties<SetModelExtensionInput>>;
|
|
2250
|
+
declare function SetModelIdInputSchema(): z.ZodObject<Properties<SetModelIdInput>>;
|
|
2251
|
+
declare function SetModelNameInputSchema(): z.ZodObject<Properties<SetModelNameInput>>;
|
|
2252
|
+
declare function SetModuleDescriptionInputSchema(): z.ZodObject<Properties<SetModuleDescriptionInput>>;
|
|
2253
|
+
declare function SetModuleNameInputSchema(): z.ZodObject<Properties<SetModuleNameInput>>;
|
|
2254
|
+
declare function SetOperationDescriptionInputSchema(): z.ZodObject<Properties<SetOperationDescriptionInput>>;
|
|
2255
|
+
declare function SetOperationErrorCodeInputSchema(): z.ZodObject<Properties<SetOperationErrorCodeInput>>;
|
|
2256
|
+
declare function SetOperationErrorDescriptionInputSchema(): z.ZodObject<Properties<SetOperationErrorDescriptionInput>>;
|
|
2257
|
+
declare function SetOperationErrorNameInputSchema(): z.ZodObject<Properties<SetOperationErrorNameInput>>;
|
|
2258
|
+
declare function SetOperationErrorTemplateInputSchema(): z.ZodObject<Properties<SetOperationErrorTemplateInput>>;
|
|
2259
|
+
declare function SetOperationNameInputSchema(): z.ZodObject<Properties<SetOperationNameInput>>;
|
|
2260
|
+
declare function SetOperationScopeInputSchema(): z.ZodObject<Properties<SetOperationScopeInput>>;
|
|
2261
|
+
declare function SetOperationReducerInputSchema(): z.ZodObject<Properties<SetOperationReducerInput>>;
|
|
2262
|
+
declare function SetOperationSchemaInputSchema(): z.ZodObject<Properties<SetOperationSchemaInput>>;
|
|
2263
|
+
declare function SetOperationTemplateInputSchema(): z.ZodObject<Properties<SetOperationTemplateInput>>;
|
|
2264
|
+
declare function SetStateSchemaInputSchema(): z.ZodObject<Properties<SetStateSchemaInput>>;
|
|
2265
|
+
declare function StateSchema(): z.ZodObject<Properties<State>>;
|
|
2266
|
+
declare function ScopeStateSchema(): z.ZodObject<Properties<ScopeState>>;
|
|
2267
|
+
declare function UpdateChangeLogItemInputSchema(): z.ZodObject<Properties<UpdateChangeLogItemInput>>;
|
|
2268
|
+
declare function UpdateOperationExampleInputSchema(): z.ZodObject<Properties<UpdateOperationExampleInput>>;
|
|
2269
|
+
declare function UpdateStateExampleInputSchema(): z.ZodObject<Properties<UpdateStateExampleInput>>;
|
|
2270
|
+
declare const PowerhouseModuleSchema: z.ZodObject<{
|
|
2271
|
+
id: z.ZodString;
|
|
2272
|
+
name: z.ZodString;
|
|
2273
|
+
documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2274
|
+
}, z.core.$strip>;
|
|
2275
|
+
declare const PowerhouseModulesSchema: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2276
|
+
id: z.ZodString;
|
|
2277
|
+
name: z.ZodString;
|
|
2278
|
+
documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2279
|
+
}, z.core.$strip>>>;
|
|
2280
|
+
declare const PieceModuleSchema: z.ZodObject<{
|
|
2281
|
+
id: z.ZodString;
|
|
2282
|
+
name: z.ZodString;
|
|
2283
|
+
documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2284
|
+
version: z.ZodOptional<z.ZodString>;
|
|
2285
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2286
|
+
bundle: z.ZodOptional<z.ZodString>;
|
|
2287
|
+
descriptor: z.ZodOptional<z.ZodString>;
|
|
2288
|
+
}, z.core.$strip>;
|
|
2289
|
+
declare const PieceModulesSchema: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2290
|
+
id: z.ZodString;
|
|
2291
|
+
name: z.ZodString;
|
|
2292
|
+
documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2293
|
+
version: z.ZodOptional<z.ZodString>;
|
|
2294
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2295
|
+
bundle: z.ZodOptional<z.ZodString>;
|
|
2296
|
+
descriptor: z.ZodOptional<z.ZodString>;
|
|
2297
|
+
}, z.core.$strip>>>;
|
|
2298
|
+
declare const PublisherSchema: z.ZodObject<{
|
|
2299
|
+
name: z.ZodOptional<z.ZodString>;
|
|
2300
|
+
url: z.ZodOptional<z.ZodString>;
|
|
2301
|
+
}, z.core.$strip>;
|
|
2302
|
+
declare const ConfigEntryTypeSchema: z.ZodUnion<readonly [z.ZodLiteral<"var">, z.ZodLiteral<"secret">]>;
|
|
2303
|
+
declare const ConfigEntrySchema: z.ZodObject<{
|
|
2304
|
+
name: z.ZodString;
|
|
2305
|
+
type: z.ZodUnion<readonly [z.ZodLiteral<"var">, z.ZodLiteral<"secret">]>;
|
|
2306
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2307
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
2308
|
+
default: z.ZodOptional<z.ZodString>;
|
|
2309
|
+
}, z.core.$strip>;
|
|
2310
|
+
declare const PwaConfigSchema: z.ZodType<PHConnectPwa>;
|
|
2311
|
+
declare const ManifestSchema: z.ZodObject<{
|
|
2312
|
+
name: z.ZodString;
|
|
2313
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2314
|
+
category: z.ZodOptional<z.ZodString>;
|
|
2315
|
+
image: z.ZodOptional<z.ZodString>;
|
|
2316
|
+
publisher: z.ZodOptional<z.ZodObject<{
|
|
2317
|
+
name: z.ZodOptional<z.ZodString>;
|
|
2318
|
+
url: z.ZodOptional<z.ZodString>;
|
|
2319
|
+
}, z.core.$strip>>;
|
|
2320
|
+
documentModels: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2321
|
+
id: z.ZodString;
|
|
2322
|
+
name: z.ZodString;
|
|
2323
|
+
documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2324
|
+
}, z.core.$strip>>>;
|
|
2325
|
+
apps: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2326
|
+
id: z.ZodString;
|
|
2327
|
+
name: z.ZodString;
|
|
2328
|
+
documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2329
|
+
}, z.core.$strip>>>;
|
|
2330
|
+
editors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2331
|
+
id: z.ZodString;
|
|
2332
|
+
name: z.ZodString;
|
|
2333
|
+
documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2334
|
+
}, z.core.$strip>>>;
|
|
2335
|
+
processors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2336
|
+
id: z.ZodString;
|
|
2337
|
+
name: z.ZodString;
|
|
2338
|
+
documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2339
|
+
}, z.core.$strip>>>;
|
|
2340
|
+
subgraphs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2341
|
+
id: z.ZodString;
|
|
2342
|
+
name: z.ZodString;
|
|
2343
|
+
documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2344
|
+
}, z.core.$strip>>>;
|
|
2345
|
+
pieces: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2346
|
+
id: z.ZodString;
|
|
2347
|
+
name: z.ZodString;
|
|
2348
|
+
documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2349
|
+
version: z.ZodOptional<z.ZodString>;
|
|
2350
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2351
|
+
bundle: z.ZodOptional<z.ZodString>;
|
|
2352
|
+
descriptor: z.ZodOptional<z.ZodString>;
|
|
2353
|
+
}, z.core.$strip>>>;
|
|
2354
|
+
externalDependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
2355
|
+
config: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2356
|
+
name: z.ZodString;
|
|
2357
|
+
type: z.ZodUnion<readonly [z.ZodLiteral<"var">, z.ZodLiteral<"secret">]>;
|
|
2358
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2359
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
2360
|
+
default: z.ZodOptional<z.ZodString>;
|
|
2361
|
+
}, z.core.$strip>>>;
|
|
2362
|
+
pwa: z.ZodOptional<z.ZodType<{
|
|
2363
|
+
globPatterns?: string[] | undefined;
|
|
2364
|
+
globIgnores?: string[] | undefined;
|
|
2365
|
+
maximumFileSizeToCacheInBytes?: number | undefined;
|
|
2366
|
+
runtimeCaching?: {
|
|
2367
|
+
urlPattern: string | {
|
|
2368
|
+
source: string;
|
|
2369
|
+
flags?: string | undefined;
|
|
2370
|
+
};
|
|
2371
|
+
handler: "CacheFirst" | "CacheOnly" | "NetworkFirst" | "NetworkOnly" | "StaleWhileRevalidate";
|
|
2372
|
+
method?: "DELETE" | "GET" | "HEAD" | "PATCH" | "POST" | "PUT" | undefined;
|
|
2373
|
+
options?: {
|
|
2374
|
+
cacheName?: string | undefined;
|
|
2375
|
+
networkTimeoutSeconds?: number | undefined;
|
|
2376
|
+
expiration?: {
|
|
2377
|
+
maxEntries?: number | undefined;
|
|
2378
|
+
maxAgeSeconds?: number | undefined;
|
|
2379
|
+
} | undefined;
|
|
2380
|
+
cacheableResponse?: {
|
|
2381
|
+
statuses?: number[] | undefined;
|
|
2382
|
+
headers?: Record<string, string> | undefined;
|
|
2383
|
+
} | undefined;
|
|
2384
|
+
} | undefined;
|
|
2385
|
+
}[] | undefined;
|
|
2386
|
+
navigateFallbackDenylist?: (string | {
|
|
2387
|
+
source: string;
|
|
2388
|
+
flags?: string | undefined;
|
|
2389
|
+
})[] | undefined;
|
|
2390
|
+
manifest?: {
|
|
2391
|
+
name?: string | undefined;
|
|
2392
|
+
short_name?: string | undefined;
|
|
2393
|
+
description?: string | undefined;
|
|
2394
|
+
theme_color?: string | undefined;
|
|
2395
|
+
background_color?: string | undefined;
|
|
2396
|
+
display?: "browser" | "fullscreen" | "minimal-ui" | "standalone" | undefined;
|
|
2397
|
+
start_url?: string | undefined;
|
|
2398
|
+
scope?: string | undefined;
|
|
2399
|
+
icons?: {
|
|
2400
|
+
src: string;
|
|
2401
|
+
sizes?: string | undefined;
|
|
2402
|
+
type?: string | undefined;
|
|
2403
|
+
purpose?: string | undefined;
|
|
2404
|
+
}[] | undefined;
|
|
2405
|
+
file_handlers?: {
|
|
2406
|
+
accept: Record<string, string[]>;
|
|
2407
|
+
icons?: {
|
|
2408
|
+
src: string;
|
|
2409
|
+
sizes?: string | undefined;
|
|
2410
|
+
type?: string | undefined;
|
|
2411
|
+
purpose?: string | undefined;
|
|
2412
|
+
}[] | undefined;
|
|
2413
|
+
launch_type?: "multiple-clients" | "single-client" | undefined;
|
|
2414
|
+
}[] | undefined;
|
|
2415
|
+
launch_handler?: {
|
|
2416
|
+
client_mode: "auto" | "focus-existing" | "navigate-existing" | "navigate-new";
|
|
2417
|
+
} | undefined;
|
|
2418
|
+
categories?: string[] | undefined;
|
|
2419
|
+
} | undefined;
|
|
2420
|
+
}, unknown, z.core.$ZodTypeInternals<{
|
|
2421
|
+
globPatterns?: string[] | undefined;
|
|
2422
|
+
globIgnores?: string[] | undefined;
|
|
2423
|
+
maximumFileSizeToCacheInBytes?: number | undefined;
|
|
2424
|
+
runtimeCaching?: {
|
|
2425
|
+
urlPattern: string | {
|
|
2426
|
+
source: string;
|
|
2427
|
+
flags?: string | undefined;
|
|
2428
|
+
};
|
|
2429
|
+
handler: "CacheFirst" | "CacheOnly" | "NetworkFirst" | "NetworkOnly" | "StaleWhileRevalidate";
|
|
2430
|
+
method?: "DELETE" | "GET" | "HEAD" | "PATCH" | "POST" | "PUT" | undefined;
|
|
2431
|
+
options?: {
|
|
2432
|
+
cacheName?: string | undefined;
|
|
2433
|
+
networkTimeoutSeconds?: number | undefined;
|
|
2434
|
+
expiration?: {
|
|
2435
|
+
maxEntries?: number | undefined;
|
|
2436
|
+
maxAgeSeconds?: number | undefined;
|
|
2437
|
+
} | undefined;
|
|
2438
|
+
cacheableResponse?: {
|
|
2439
|
+
statuses?: number[] | undefined;
|
|
2440
|
+
headers?: Record<string, string> | undefined;
|
|
2441
|
+
} | undefined;
|
|
2442
|
+
} | undefined;
|
|
2443
|
+
}[] | undefined;
|
|
2444
|
+
navigateFallbackDenylist?: (string | {
|
|
2445
|
+
source: string;
|
|
2446
|
+
flags?: string | undefined;
|
|
2447
|
+
})[] | undefined;
|
|
2448
|
+
manifest?: {
|
|
2449
|
+
name?: string | undefined;
|
|
2450
|
+
short_name?: string | undefined;
|
|
2451
|
+
description?: string | undefined;
|
|
2452
|
+
theme_color?: string | undefined;
|
|
2453
|
+
background_color?: string | undefined;
|
|
2454
|
+
display?: "browser" | "fullscreen" | "minimal-ui" | "standalone" | undefined;
|
|
2455
|
+
start_url?: string | undefined;
|
|
2456
|
+
scope?: string | undefined;
|
|
2457
|
+
icons?: {
|
|
2458
|
+
src: string;
|
|
2459
|
+
sizes?: string | undefined;
|
|
2460
|
+
type?: string | undefined;
|
|
2461
|
+
purpose?: string | undefined;
|
|
2462
|
+
}[] | undefined;
|
|
2463
|
+
file_handlers?: {
|
|
2464
|
+
accept: Record<string, string[]>;
|
|
2465
|
+
icons?: {
|
|
2466
|
+
src: string;
|
|
2467
|
+
sizes?: string | undefined;
|
|
2468
|
+
type?: string | undefined;
|
|
2469
|
+
purpose?: string | undefined;
|
|
2470
|
+
}[] | undefined;
|
|
2471
|
+
launch_type?: "multiple-clients" | "single-client" | undefined;
|
|
2472
|
+
}[] | undefined;
|
|
2473
|
+
launch_handler?: {
|
|
2474
|
+
client_mode: "auto" | "focus-existing" | "navigate-existing" | "navigate-new";
|
|
2475
|
+
} | undefined;
|
|
2476
|
+
categories?: string[] | undefined;
|
|
2477
|
+
} | undefined;
|
|
2478
|
+
}, unknown>>>;
|
|
2479
|
+
connectRoutes: z.ZodOptional<z.ZodBoolean>;
|
|
2480
|
+
}, z.core.$strip>;
|
|
2481
|
+
//#endregion
|
|
2482
|
+
//#region document-model/validation.d.ts
|
|
2483
|
+
/**
|
|
2484
|
+
* Reserved operation names from base reducer (core/actions.ts).
|
|
2485
|
+
* These names cannot be used for custom operations.
|
|
2486
|
+
*/
|
|
2487
|
+
declare const RESERVED_OPERATION_NAMES: readonly ["UNDO", "REDO", "SET_NAME", "SET_PREFERRED_EDITOR", "NOOP", "PURGE_DOCUMENT"];
|
|
2488
|
+
type ReservedOperationName = (typeof RESERVED_OPERATION_NAMES)[number];
|
|
2489
|
+
/**
|
|
2490
|
+
* Operation names become the literal action `type` string at runtime and the
|
|
2491
|
+
* key for codegen's action union. They must be SCREAMING_SNAKE_CASE so the
|
|
2492
|
+
* generated TypeScript is valid.
|
|
2493
|
+
*/
|
|
2494
|
+
declare const OPERATION_NAME_PATTERN: RegExp;
|
|
2495
|
+
declare function isValidOperationNameFormat(name: string): boolean;
|
|
2496
|
+
/**
|
|
2497
|
+
* Check if name conflicts with base reducer actions (case-insensitive).
|
|
2498
|
+
*/
|
|
2499
|
+
declare function isReservedOperationName(name: string): boolean;
|
|
2500
|
+
/**
|
|
2501
|
+
* Get all operation names from all modules in the latest specification.
|
|
2502
|
+
* Returns names in uppercase for case-insensitive comparison.
|
|
2503
|
+
*/
|
|
2504
|
+
declare function getAllOperationNames(state: DocumentModelGlobalState, excludeOperationId?: string): string[];
|
|
2505
|
+
/**
|
|
2506
|
+
* Validate operation name is not reserved or duplicate. Throws on failure.
|
|
2507
|
+
*
|
|
2508
|
+
* @param name - The operation name to validate
|
|
2509
|
+
* @param state - The document model global state
|
|
2510
|
+
* @param excludeOperationId - Optional operation ID to exclude (for rename validation)
|
|
2511
|
+
* @throws Error if the name is reserved or a duplicate
|
|
2512
|
+
*/
|
|
2513
|
+
declare function validateOperationName(name: string, state: DocumentModelGlobalState, excludeOperationId?: string): void;
|
|
2514
|
+
declare function validateInitialState(initialState: string, allowEmptyState?: boolean): ValidationError[];
|
|
2515
|
+
declare function validateStateSchemaName(schema: string, documentName: string, scope?: string, allowEmptySchema?: boolean): ValidationError[];
|
|
2516
|
+
declare function validateModules(modules: ModuleSpecification[]): ValidationError[];
|
|
2517
|
+
declare function validateModule(mod: ModuleSpecification): ValidationError[];
|
|
2518
|
+
declare function validateModuleOperation(operation: OperationSpecification): ValidationError[];
|
|
2519
|
+
/**
|
|
2520
|
+
* Find a module in the latest specification by id, or throw. Reducers that
|
|
2521
|
+
* mutate-by-id should call this up front so an unknown id fails loudly
|
|
2522
|
+
* instead of silently no-opping.
|
|
2523
|
+
*/
|
|
2524
|
+
declare function findModuleOrThrow(state: DocumentModelGlobalState, moduleId: string): ModuleSpecification;
|
|
2525
|
+
/**
|
|
2526
|
+
* Find an operation in the latest specification by id, or throw. Same
|
|
2527
|
+
* rationale as findModuleOrThrow — reducers that target an operation must
|
|
2528
|
+
* fail loudly when the operation doesn't exist.
|
|
2529
|
+
*/
|
|
2530
|
+
declare function findOperationOrThrow(state: DocumentModelGlobalState, operationId: string): OperationSpecification;
|
|
2531
|
+
/**
|
|
2532
|
+
* Find an operation error by id across all operations in the latest
|
|
2533
|
+
* specification, or throw. Throws on a duplicate id too: setters act on a
|
|
2534
|
+
* single error, so an ambiguous id must fail loudly rather than mutate an
|
|
2535
|
+
* arbitrary match.
|
|
2536
|
+
*/
|
|
2537
|
+
declare function findOperationErrorOrThrow(state: DocumentModelGlobalState, errorId: string): OperationErrorSpecification;
|
|
2538
|
+
/**
|
|
2539
|
+
* Find an operation example (code example) by id across all operations in the
|
|
2540
|
+
* latest specification, or throw. Throws on a duplicate id for the same reason
|
|
2541
|
+
* as findOperationErrorOrThrow.
|
|
2542
|
+
*/
|
|
2543
|
+
declare function findOperationExampleOrThrow(state: DocumentModelGlobalState, exampleId: string): CodeExample;
|
|
2544
|
+
/**
|
|
2545
|
+
* Assert no module in the latest specification already uses `id`. Modules are
|
|
2546
|
+
* targeted by id by the setter/delete/reorder reducers, so a duplicate id makes
|
|
2547
|
+
* those operations ambiguous.
|
|
2548
|
+
*/
|
|
2549
|
+
declare function assertModuleIdUnique(state: DocumentModelGlobalState, id: string): void;
|
|
2550
|
+
/**
|
|
2551
|
+
* Assert no operation in the latest specification already uses `id`. Operations
|
|
2552
|
+
* are targeted by id across all modules, so the id must be unique document-wide.
|
|
2553
|
+
*/
|
|
2554
|
+
declare function assertOperationIdUnique(state: DocumentModelGlobalState, id: string): void;
|
|
2555
|
+
/**
|
|
2556
|
+
* Assert no operation error in the latest specification already uses `id`.
|
|
2557
|
+
* Error ids are targeted document-wide by the setter/delete reducers, so the id
|
|
2558
|
+
* must be unique to keep those operations unambiguous.
|
|
2559
|
+
*/
|
|
2560
|
+
declare function assertOperationErrorIdUnique(state: DocumentModelGlobalState, id: string): void;
|
|
2561
|
+
/**
|
|
2562
|
+
* Assert no operation example in the latest specification already uses `id`.
|
|
2563
|
+
* Example ids are targeted document-wide by the update/delete reducers, so the
|
|
2564
|
+
* id must be unique to keep those operations unambiguous.
|
|
2565
|
+
*/
|
|
2566
|
+
declare function assertOperationExampleIdUnique(state: DocumentModelGlobalState, id: string): void;
|
|
2567
|
+
declare function validateOperations(operations: DocumentOperations): ValidationError[];
|
|
2568
|
+
//#endregion
|
|
2569
|
+
//#region processors/deletion.d.ts
|
|
2570
|
+
/** The id a DELETE_DOCUMENT or PURGE_DOCUMENT removes; undefined otherwise. */
|
|
2571
|
+
declare function deletedDocumentId(op: OperationWithContext$1): string | undefined;
|
|
2572
|
+
//#endregion
|
|
2573
|
+
//#region processors/http.d.ts
|
|
2574
|
+
/** Methods a package route may bind. OPTIONS belongs to the CORS layer. */
|
|
2575
|
+
type RouteMethod = "DELETE" | "GET" | "HEAD" | "PATCH" | "POST" | "PUT";
|
|
2576
|
+
interface RouteUser {
|
|
2577
|
+
address: string;
|
|
2578
|
+
chainId: number;
|
|
2579
|
+
networkId: string;
|
|
2580
|
+
appKey: string;
|
|
2581
|
+
}
|
|
2582
|
+
type RouteActor = {
|
|
2583
|
+
user: RouteUser | undefined;
|
|
2584
|
+
authEnabled: boolean;
|
|
2585
|
+
};
|
|
2586
|
+
type AuthorizerResult = {
|
|
2587
|
+
authorized: true;
|
|
2588
|
+
} |
|
|
2589
|
+
/** Refused; the scope answers with its own JSON error envelope. */
|
|
2590
|
+
{
|
|
2591
|
+
authorized: false;
|
|
2592
|
+
status: number;
|
|
2593
|
+
message: string;
|
|
2594
|
+
} | {
|
|
2595
|
+
authorized: false;
|
|
2596
|
+
response: Response;
|
|
2597
|
+
};
|
|
2598
|
+
/** A route-specific gate, for policies the standard modes cannot express. */
|
|
2599
|
+
type RouteAuthorizer = (req: IncomingMessage) => Promise<AuthorizerResult> | AuthorizerResult;
|
|
2600
|
+
/** How a route authenticates. */
|
|
2601
|
+
type RouteAuth =
|
|
2602
|
+
/** Default. A verifiable bearer is required; a caller without one gets 401. */
|
|
2603
|
+
"renown" | "renown-optional" | "public" | RouteAuthorizer;
|
|
2604
|
+
/** How the request body reaches the handler. */
|
|
2605
|
+
type RouteBody =
|
|
2606
|
+
/** Default. Buffered, and readable through the Fetch Request. */
|
|
2607
|
+
"parsed" |
|
|
2608
|
+
/** Buffered and also handed over as `ctx.rawBody`, byte for byte. */
|
|
2609
|
+
"raw" |
|
|
2610
|
+
/** Not buffered; the Fetch Request body is the live request stream. */
|
|
2611
|
+
"stream" |
|
|
2612
|
+
/** The body is not read at all. */
|
|
2613
|
+
"none";
|
|
2614
|
+
interface RouteOptions {
|
|
2615
|
+
auth?: RouteAuth;
|
|
2616
|
+
body?: RouteBody;
|
|
2617
|
+
/** Refuse a body larger than this with 413. Ignored when body is `stream`. */
|
|
2618
|
+
maxBodyBytes?: number;
|
|
2619
|
+
/** Serve sub-paths too, not just an exact match. */
|
|
2620
|
+
prefix?: boolean;
|
|
2621
|
+
}
|
|
2622
|
+
/** Where the request reached the host, resolved through any reverse proxy. */
|
|
2623
|
+
interface RouteTransport {
|
|
2624
|
+
proto: string;
|
|
2625
|
+
host: string;
|
|
2626
|
+
prefix: string;
|
|
2627
|
+
baseUrl: string;
|
|
2628
|
+
}
|
|
2629
|
+
interface RouteContext {
|
|
2630
|
+
/** Decoded path params. */
|
|
2631
|
+
params: Record<string, string>;
|
|
2632
|
+
user: RouteUser | undefined;
|
|
2633
|
+
authEnabled: boolean;
|
|
2634
|
+
/** The exact octets received. Present only when body is `raw`. */
|
|
2635
|
+
rawBody: Buffer | undefined;
|
|
2636
|
+
/** Aborts when the client disconnects. */
|
|
2637
|
+
signal: AbortSignal;
|
|
2638
|
+
transport: RouteTransport;
|
|
2639
|
+
}
|
|
2640
|
+
type RouteHandler = (request: Request, ctx: RouteContext) => Response | Promise<Response>;
|
|
2641
|
+
interface RouteSpec extends RouteOptions {
|
|
2642
|
+
method: RouteMethod | RouteMethod[];
|
|
2643
|
+
/** Relative to the scope: "runs/:id", never "/api/@scope/pkg/runs/:id". */
|
|
2644
|
+
path: string;
|
|
2645
|
+
handler: RouteHandler;
|
|
2646
|
+
}
|
|
2647
|
+
interface NodeRouteSpec extends Omit<RouteOptions, "body" | "maxBodyBytes"> {
|
|
2648
|
+
method: RouteMethod | RouteMethod[];
|
|
2649
|
+
path: string;
|
|
2650
|
+
handler: (req: IncomingMessage, res: ServerResponse, ctx: Omit<RouteContext, "rawBody" | "signal">) => void | Promise<void>;
|
|
2651
|
+
}
|
|
2652
|
+
interface ScopedRouteHandle {
|
|
2653
|
+
/** The absolute public URL this route answers on. */
|
|
2654
|
+
readonly url: string;
|
|
2655
|
+
dispose(): void;
|
|
2656
|
+
}
|
|
2657
|
+
type WebhookScheme = "none" |
|
|
2658
|
+
/** A shared secret presented verbatim. No digest, so no digest options. */
|
|
2659
|
+
"token" |
|
|
2660
|
+
/** The digest of the body, alone. */
|
|
2661
|
+
"hmac" |
|
|
2662
|
+
/** That digest behind a label, `sha256=<digest>`. */
|
|
2663
|
+
"hmac-prefixed" | "hmac-timestamped";
|
|
2664
|
+
/** Hashes a sender may compute the digest with. */
|
|
2665
|
+
type WebhookHashAlgorithm = "sha1" | "sha256" | "sha512";
|
|
2666
|
+
/** How the digest is written into the header. */
|
|
2667
|
+
type WebhookSignatureEncoding = "hex" | "base64";
|
|
2668
|
+
interface WebhookVerification {
|
|
2669
|
+
scheme: WebhookScheme;
|
|
2670
|
+
/** Resolved value, never a reference — the caller resolves refs. */
|
|
2671
|
+
secret?: string;
|
|
2672
|
+
/** Overrides the scheme's conventional header. */
|
|
2673
|
+
header?: string;
|
|
2674
|
+
/** Replay window for timestamped schemes. */
|
|
2675
|
+
toleranceSeconds?: number;
|
|
2676
|
+
algorithm?: WebhookHashAlgorithm;
|
|
2677
|
+
/** Defaults to `hex`. Base64 comparison is case-sensitive; hex is not. */
|
|
2678
|
+
encoding?: WebhookSignatureEncoding;
|
|
2679
|
+
prefix?: string;
|
|
2680
|
+
}
|
|
2681
|
+
type WebhookField = string | {
|
|
2682
|
+
header: string;
|
|
2683
|
+
} |
|
|
2684
|
+
/** Dot-separated path into the parsed body, e.g. `data.object.id`. */
|
|
2685
|
+
{
|
|
2686
|
+
body: string;
|
|
2687
|
+
};
|
|
2688
|
+
interface WebhookRequest {
|
|
2689
|
+
/** The caller's own key for this endpoint, e.g. a document id. */
|
|
2690
|
+
key: string;
|
|
2691
|
+
method: string;
|
|
2692
|
+
path: string;
|
|
2693
|
+
queryParams: Record<string, string>;
|
|
2694
|
+
/** Lowercased, with credentials redacted. */
|
|
2695
|
+
headers: Record<string, string>;
|
|
2696
|
+
/** The exact bytes received. */
|
|
2697
|
+
raw: Buffer;
|
|
2698
|
+
/** JSON and form bodies decoded; anything else as text. */
|
|
2699
|
+
body: unknown;
|
|
2700
|
+
}
|
|
2701
|
+
interface WebhookReply {
|
|
2702
|
+
status: number;
|
|
2703
|
+
body?: string;
|
|
2704
|
+
contentType?: string;
|
|
2705
|
+
/** Extra response headers, lowercased; the host sets content-type and framing. */
|
|
2706
|
+
headers?: Record<string, string>;
|
|
2707
|
+
/** The handler did not process this delivery (its owner is shutting down),
|
|
2708
|
+
* so its dedupe key is dropped and the sender's retry is delivered again.
|
|
2709
|
+
* Unset, a delivery counts as seen whatever the status. */
|
|
2710
|
+
unprocessed?: boolean;
|
|
2711
|
+
}
|
|
2712
|
+
interface WebhookPolicy {
|
|
2713
|
+
verify?: WebhookVerification;
|
|
2714
|
+
/** Uppercase. Undefined accepts every method. */
|
|
2715
|
+
methods?: string[];
|
|
2716
|
+
dedupe?: {
|
|
2717
|
+
field: WebhookField;
|
|
2718
|
+
ttlSeconds?: number;
|
|
2719
|
+
};
|
|
2720
|
+
challengeField?: WebhookField;
|
|
2721
|
+
maxBodyBytes?: number;
|
|
2722
|
+
}
|
|
2723
|
+
interface WebhookSpec {
|
|
2724
|
+
/** Distinguishes several endpoint families within one package. */
|
|
2725
|
+
name: string;
|
|
2726
|
+
defaults?: WebhookPolicy;
|
|
2727
|
+
onRequest: (request: WebhookRequest) => Promise<WebhookReply> | WebhookReply;
|
|
2728
|
+
policyFor?: (key: string) => Promise<WebhookPolicy | undefined> | WebhookPolicy | undefined;
|
|
2729
|
+
}
|
|
2730
|
+
interface WebhookEndpointInfo {
|
|
2731
|
+
key: string;
|
|
2732
|
+
token: string;
|
|
2733
|
+
url: string;
|
|
2734
|
+
createdAt: string;
|
|
2735
|
+
}
|
|
2736
|
+
interface IWebhookEndpoints {
|
|
2737
|
+
endpointFor(key: string): Promise<Omit<WebhookEndpointInfo, "key">>;
|
|
2738
|
+
revoke(key: string): Promise<void>;
|
|
2739
|
+
list(): Promise<WebhookEndpointInfo[]>;
|
|
2740
|
+
}
|
|
2741
|
+
interface IWebhookScope {
|
|
2742
|
+
register(spec: WebhookSpec): Promise<IWebhookEndpoints>;
|
|
2743
|
+
readonly hasPublicOrigin: boolean;
|
|
2744
|
+
}
|
|
2745
|
+
interface IHttpScope {
|
|
2746
|
+
readonly owner: string;
|
|
2747
|
+
readonly baseUrl: string;
|
|
2748
|
+
get(path: string, handler: RouteHandler): ScopedRouteHandle;
|
|
2749
|
+
get(path: string, options: RouteOptions, handler: RouteHandler): ScopedRouteHandle;
|
|
2750
|
+
post(path: string, handler: RouteHandler): ScopedRouteHandle;
|
|
2751
|
+
post(path: string, options: RouteOptions, handler: RouteHandler): ScopedRouteHandle;
|
|
2752
|
+
put(path: string, handler: RouteHandler): ScopedRouteHandle;
|
|
2753
|
+
put(path: string, options: RouteOptions, handler: RouteHandler): ScopedRouteHandle;
|
|
2754
|
+
patch(path: string, handler: RouteHandler): ScopedRouteHandle;
|
|
2755
|
+
patch(path: string, options: RouteOptions, handler: RouteHandler): ScopedRouteHandle;
|
|
2756
|
+
delete(path: string, handler: RouteHandler): ScopedRouteHandle;
|
|
2757
|
+
delete(path: string, options: RouteOptions, handler: RouteHandler): ScopedRouteHandle;
|
|
2758
|
+
/** Registered independently of GET: a HEAD response is not a bodyless GET. */
|
|
2759
|
+
head(path: string, handler: RouteHandler): ScopedRouteHandle;
|
|
2760
|
+
head(path: string, options: RouteOptions, handler: RouteHandler): ScopedRouteHandle;
|
|
2761
|
+
route(spec: RouteSpec): ScopedRouteHandle;
|
|
2762
|
+
nodeRoute(spec: NodeRouteSpec): ScopedRouteHandle;
|
|
2763
|
+
readonly webhooks: IWebhookScope;
|
|
2764
|
+
/** Release every route this scope registered. Called on package teardown. */
|
|
2765
|
+
dispose(): void;
|
|
2766
|
+
}
|
|
2767
|
+
//#endregion
|
|
2768
|
+
//#region processors/types.d.ts
|
|
2769
|
+
type ProcessorDispatchResult = {
|
|
2770
|
+
id: string;
|
|
2771
|
+
status: string;
|
|
2772
|
+
};
|
|
2773
|
+
/** A dispatched create: the job, and the id the new document carries. */
|
|
2774
|
+
type ProcessorDispatchCreateResult = ProcessorDispatchResult & {
|
|
2775
|
+
documentId: string;
|
|
2776
|
+
};
|
|
2777
|
+
/** How a dispatched delete treats children: "cascade" deletes orphans too. */
|
|
2778
|
+
type ProcessorDeletePropagation = "none" | "cascade";
|
|
2779
|
+
/**
|
|
2780
|
+
* How a processor writes. Each member resolves once the write is accepted and
|
|
2781
|
+
* answers with the job's id and status; it does not wait for the commit.
|
|
2782
|
+
*/
|
|
2783
|
+
interface IProcessorDispatch {
|
|
2784
|
+
execute(docId: string, branch: string, actions: Action[], signal?: AbortSignal, meta?: Record<string, unknown>): Promise<ProcessorDispatchResult>;
|
|
2785
|
+
/**
|
|
2786
|
+
* Adds a document to a drive, under `parentFolder` when given. The
|
|
2787
|
+
* document's own creation has completed when this resolves; the drive's
|
|
2788
|
+
* file node has been accepted.
|
|
2789
|
+
*/
|
|
2790
|
+
createInDrive(driveId: string, document: PHDocument$1, parentFolder?: string, signal?: AbortSignal): Promise<ProcessorDispatchCreateResult>;
|
|
2791
|
+
/** Deletes a document, and with "cascade" its orphaned children. */
|
|
2792
|
+
deleteDocument(docId: string, propagate?: ProcessorDeletePropagation, signal?: AbortSignal): Promise<ProcessorDispatchResult>;
|
|
2793
|
+
}
|
|
2794
|
+
interface IProcessorHostModuleBase {
|
|
2795
|
+
analyticsStore: IAnalyticsStore;
|
|
2796
|
+
relationalDb: IRelationalDb;
|
|
2797
|
+
processorApp: ProcessorApp;
|
|
2798
|
+
dispatch: IProcessorDispatch;
|
|
2799
|
+
getReadModel<T>(name: string): T;
|
|
2800
|
+
config?: Map<string, unknown>;
|
|
2801
|
+
/**
|
|
2802
|
+
* The package's slice of the HTTP surface, bound to its own namespace.
|
|
2803
|
+
*
|
|
2804
|
+
* Declared on the host-agnostic base rather than on each host's module so
|
|
2805
|
+
* the two cannot drift: codegen types generated processors against
|
|
2806
|
+
* reactor-browser's `IProcessorHostModule`, and the same source has to
|
|
2807
|
+
* compile against reactor-api's.
|
|
2808
|
+
*
|
|
2809
|
+
* Absent whenever the host has no HTTP server — processors also run in the
|
|
2810
|
+
* browser — and on the reactor when the package's name cannot be resolved to
|
|
2811
|
+
* a routable namespace, so a caller must always check before using it.
|
|
2812
|
+
*/
|
|
2813
|
+
http?: IHttpScope;
|
|
2814
|
+
}
|
|
2815
|
+
/**
|
|
2816
|
+
* Filter for matching operations to processors.
|
|
2817
|
+
* All fields are optional arrays - when provided, operations must match at least one value in each specified field.
|
|
2818
|
+
* When a field is undefined or empty, it matches all values for that field.
|
|
2819
|
+
*/
|
|
2820
|
+
type ProcessorFilter = {
|
|
2821
|
+
documentType?: string[];
|
|
2822
|
+
scope?: string[];
|
|
2823
|
+
branch?: string[];
|
|
2824
|
+
documentId?: string[];
|
|
2825
|
+
};
|
|
2826
|
+
/**
|
|
2827
|
+
* Describes an object that can process operations.
|
|
2828
|
+
*/
|
|
2829
|
+
interface IProcessor {
|
|
2830
|
+
/**
|
|
2831
|
+
* Processes a list of operations with context.
|
|
2832
|
+
* Called when operations match this processor's filter.
|
|
2833
|
+
*
|
|
2834
|
+
* Delivery is at-least-once. Within a document's scope and branch, each
|
|
2835
|
+
* call is in ordinal order, and an operation delivered late comes with
|
|
2836
|
+
* every later operation of its stream this processor was already given.
|
|
2837
|
+
* Across documents there is no ordering guarantee. A processor receives one
|
|
2838
|
+
* `onOperations` call at a time; the next call begins after the previous
|
|
2839
|
+
* resolves.
|
|
2840
|
+
*
|
|
2841
|
+
* A drive's processors also receive the drive's own DELETE_DOCUMENT or
|
|
2842
|
+
* PURGE_DOCUMENT, whatever the filter, as the last delivery before
|
|
2843
|
+
* `onDisconnect`. A purged document's operations other than its marker are
|
|
2844
|
+
* not delivered. Erase a document's data on either deletion action.
|
|
2845
|
+
*
|
|
2846
|
+
* `context.resultingState` is the executor's state after the operation on a
|
|
2847
|
+
* live delivery. On a replay (first install, catch-up after a restart,
|
|
2848
|
+
* rerun, retry) it is what the record's `replayState` says: by default the
|
|
2849
|
+
* document's latest state, which can be newer than the operation.
|
|
2850
|
+
*/
|
|
2851
|
+
onOperations(operations: OperationWithContext[]): Promise<void>;
|
|
2852
|
+
/**
|
|
2853
|
+
* Called when the processor is disconnected.
|
|
2854
|
+
* Used to clean up any resources allocated during processor creation.
|
|
2855
|
+
* Also runs when the factory is unregistered, so it is not a deletion signal.
|
|
2856
|
+
*/
|
|
2857
|
+
onDisconnect(): Promise<void>;
|
|
2858
|
+
/**
|
|
2859
|
+
* Optional. Erases everything this processor derived, so that a replay from
|
|
2860
|
+
* its first ordinal rebuilds it. Called while none of the processors sharing
|
|
2861
|
+
* its {@link clearScope} is being delivered to.
|
|
2862
|
+
*/
|
|
2863
|
+
clear?(): Promise<void>;
|
|
2864
|
+
/**
|
|
2865
|
+
* What `clear` erases. Processors of one drive and factory with equal scopes
|
|
2866
|
+
* share what they derived, so they are cleared and replayed together. A
|
|
2867
|
+
* processor without one shares only with records holding the same instance.
|
|
2868
|
+
*/
|
|
2869
|
+
readonly clearScope?: string;
|
|
2870
|
+
}
|
|
2871
|
+
/**
|
|
2872
|
+
* Relates a processor to its filter configuration.
|
|
2873
|
+
*/
|
|
2874
|
+
/**
|
|
2875
|
+
* What a replayed operation carries. A replay (first install, catch-up after a
|
|
2876
|
+
* restart, rerun, retry) reads operations from the index, which keeps no
|
|
2877
|
+
* `resultingState`; a live delivery always carries the executor's.
|
|
2878
|
+
*
|
|
2879
|
+
* - `latest` (the default): every operation, with the document's latest state.
|
|
2880
|
+
* It can be newer than the operation, never older than a state already
|
|
2881
|
+
* delivered for that stream.
|
|
2882
|
+
* - `collapse`: per document stream, one delivery with the latest state; the
|
|
2883
|
+
* operations it includes are skipped. Only for processors whose output
|
|
2884
|
+
* depends on the latest state alone.
|
|
2885
|
+
* - `exact`: every operation, with its state at its own revision. Slower.
|
|
2886
|
+
* - `operations`: every operation, without state.
|
|
2887
|
+
*/
|
|
2888
|
+
type ReplayStateMode = "latest" | "collapse" | "exact" | "operations";
|
|
2889
|
+
type ProcessorRecord = {
|
|
2890
|
+
processor: IProcessor;
|
|
2891
|
+
filter: ProcessorFilter;
|
|
2892
|
+
startFrom?: "beginning" | "current";
|
|
2893
|
+
/** What a replayed operation carries; `latest` when omitted. */
|
|
2894
|
+
replayState?: ReplayStateMode;
|
|
2895
|
+
id?: string;
|
|
2896
|
+
};
|
|
2897
|
+
/**
|
|
2898
|
+
* A factory function that creates processor records for a given drive.
|
|
2899
|
+
* Called once per drive when the drive is first detected or when the factory is registered.
|
|
2900
|
+
* The header is the drive's header at creation. For a purged drive it is
|
|
2901
|
+
* minimal: only `id` and `documentType` are set, and `slug` and `name` are
|
|
2902
|
+
* empty, so a factory that selects drives by slug or name makes no processor
|
|
2903
|
+
* for it and the deletion stays owed.
|
|
2904
|
+
*/
|
|
2905
|
+
type ProcessorFactory = (driveHeader: PHDocumentHeader, processorApp?: ProcessorApp) => Promise<ProcessorRecord[]> | ProcessorRecord[];
|
|
2906
|
+
/** Takes a processor host module and builds processor factories using its context. */
|
|
2907
|
+
type ProcessorFactoryBuilder<TModule extends IProcessorHostModuleBase = IProcessorHostModuleBase> = {
|
|
2908
|
+
bivarianceHack(module: TModule): Promise<ProcessorFactory> | ProcessorFactory;
|
|
2909
|
+
}["bivarianceHack"];
|
|
2910
|
+
type ProcessorStatus = "active" | "errored";
|
|
2911
|
+
/**
|
|
2912
|
+
* Where a processor stands: replaying towards the head while a backfill,
|
|
2913
|
+
* retry or rerun is queued or running, keeping up with live operations, or
|
|
2914
|
+
* stopped on an error.
|
|
2915
|
+
*/
|
|
2916
|
+
type ProcessorPhase = "catching-up" | "live" | "errored";
|
|
2917
|
+
/** How {@link IProcessorManager.rerun} replays a processor. */
|
|
2918
|
+
type ProcessorRerunOptions = {
|
|
2919
|
+
/** Erase what it derived first; `fromOrdinal` is then its floor. */
|
|
2920
|
+
clear: boolean;
|
|
2921
|
+
/** Without `clear`: the ordinal the replay starts above. */
|
|
2922
|
+
fromOrdinal: number;
|
|
2923
|
+
};
|
|
2924
|
+
type TrackedProcessor = {
|
|
2925
|
+
processorId: string;
|
|
2926
|
+
factoryId: string;
|
|
2927
|
+
driveId: string;
|
|
2928
|
+
processorIndex: number;
|
|
2929
|
+
record: ProcessorRecord;
|
|
2930
|
+
lastOrdinal: number;
|
|
2931
|
+
status: ProcessorStatus;
|
|
2932
|
+
lastError: string | undefined;
|
|
2933
|
+
lastErrorTimestamp: Date | undefined;
|
|
2934
|
+
/** Ordinals at or below this are never delivered to it. */
|
|
2935
|
+
floor: number;
|
|
2936
|
+
/**
|
|
2937
|
+
* The cursor as its current backfill, retry or rerun began; equal to
|
|
2938
|
+
* `lastOrdinal` once live, so `lastOrdinal - runFrom` is the replay's
|
|
2939
|
+
* progress.
|
|
2940
|
+
*/
|
|
2941
|
+
runFrom: number;
|
|
2942
|
+
phase: ProcessorPhase;
|
|
2943
|
+
/**
|
|
2944
|
+
* Clears the error and resolves once the replay from the cursor completes.
|
|
2945
|
+
* Safe from anywhere, but awaiting it from this processor's own
|
|
2946
|
+
* `onOperations` waits on itself: the replay runs after that call returns.
|
|
2947
|
+
* A no-op once the processor has been removed.
|
|
2948
|
+
*/
|
|
2949
|
+
retry: () => Promise<void>;
|
|
2950
|
+
};
|
|
2951
|
+
/**
|
|
2952
|
+
* Manages processor creation and destruction based on drive operations.
|
|
2953
|
+
*/
|
|
2954
|
+
interface IProcessorManager {
|
|
2955
|
+
/**
|
|
2956
|
+
* Registers a processor factory.
|
|
2957
|
+
* Immediately creates processors for all existing drives and resolves once
|
|
2958
|
+
* every factory run has completed and its processors are bound. Their
|
|
2959
|
+
* backfills run afterwards, on each processor's own queue. A deleted drive
|
|
2960
|
+
* whose deletion one of the factory's processors never received (it was not
|
|
2961
|
+
* running, or its delivery threw) gets a processor too: it receives only the
|
|
2962
|
+
* drive's `DELETE_DOCUMENT`, or its `PURGE_DOCUMENT` once purged, and is
|
|
2963
|
+
* disconnected. That delivery is not awaited: it runs after this resolves,
|
|
2964
|
+
* so a processor that hangs on it does not hold the registration, nor a
|
|
2965
|
+
* later one: a drive whose deletion is still being delivered gets it from
|
|
2966
|
+
* the new registration only if that delivery leaves it owed. If processors
|
|
2967
|
+
* from an earlier registration under the same identifier are still
|
|
2968
|
+
* draining, or a call of the previous factory is still in flight, the
|
|
2969
|
+
* factory runs after they have settled, so awaiting a re-registration of
|
|
2970
|
+
* a factory from inside that factory or one of its processors'
|
|
2971
|
+
* `onOperations` waits on itself.
|
|
2972
|
+
*/
|
|
2973
|
+
registerFactory(identifier: string, factory: ProcessorFactory): Promise<void>;
|
|
2974
|
+
/**
|
|
2975
|
+
* Unregisters a processor factory. Resolves once its processors receive no
|
|
2976
|
+
* new deliveries and their cursors are released; each one's in-flight
|
|
2977
|
+
* delivery finishes first, then `onDisconnect` runs. A released cursor no
|
|
2978
|
+
* longer positions a processor: a re-registration starts each one afresh,
|
|
2979
|
+
* per `startFrom`. It only records that the factory held a drive's data, so
|
|
2980
|
+
* that a drive deleted before the factory registers again still gets its
|
|
2981
|
+
* deletion delivered then. Safe to call from
|
|
2982
|
+
* inside a processor's own `onOperations`.
|
|
2983
|
+
*/
|
|
2984
|
+
unregisterFactory(identifier: string): Promise<void>;
|
|
2985
|
+
/**
|
|
2986
|
+
* Replays a processor and resolves once the replay completes. With `clear`,
|
|
2987
|
+
* it and the processors sharing its clear scope are cleared, then replayed
|
|
2988
|
+
* from their floor; otherwise its cursor moves back to `fromOrdinal`, which
|
|
2989
|
+
* lies between its floor and its cursor, and the processor receives every
|
|
2990
|
+
* matching operation above it again. Rejects for an unknown processor, a
|
|
2991
|
+
* `clear` one of them cannot do, or an ordinal outside that range.
|
|
2992
|
+
*/
|
|
2993
|
+
rerun(processorId: string, options: ProcessorRerunOptions): Promise<void>;
|
|
2994
|
+
/**
|
|
2995
|
+
* Gets a tracked processor by its ID.
|
|
2996
|
+
*/
|
|
2997
|
+
get(processorId: string): TrackedProcessor | undefined;
|
|
2998
|
+
/**
|
|
2999
|
+
* Gets all tracked processors, including an errored entry for each
|
|
3000
|
+
* processor whose drive's deletion threw; its `retry()` delivers the
|
|
3001
|
+
* deletion again.
|
|
3002
|
+
*/
|
|
3003
|
+
getAll(): TrackedProcessor[];
|
|
3004
|
+
}
|
|
3005
|
+
type ProcessorApp = (typeof PROCESSOR_APPS)[number];
|
|
3006
|
+
type ProcessorApps = readonly ProcessorApp[];
|
|
3007
|
+
//#endregion
|
|
3008
|
+
//#region processors/relational/types.d.ts
|
|
3009
|
+
/** Columns {@link RelationalDbProcessor.deleteDocumentRows} matches. */
|
|
3010
|
+
declare const DOCUMENT_ID_COLUMNS: readonly ["document_id", "documentId"];
|
|
3011
|
+
type IRelationalQueryMethods = "selectFrom" | "selectNoFrom" | "with" | "withRecursive";
|
|
3012
|
+
type IRelationalQueryBuilder<Schema = unknown> = Pick<QueryCreator<Schema>, IRelationalQueryMethods> & {
|
|
3013
|
+
withSchema: (schema: string) => IRelationalQueryBuilder<Schema>;
|
|
3014
|
+
};
|
|
3015
|
+
type HashAlgorithms = "fnv1a";
|
|
3016
|
+
type IBaseRelationalDb<Schema = unknown> = Kysely<Schema>;
|
|
3017
|
+
/**
|
|
3018
|
+
* The standardized relational database interface for relational db processors.
|
|
3019
|
+
* This abstraction provides type-safe database operations while hiding the underlying
|
|
3020
|
+
* database framework implementation details.
|
|
3021
|
+
**/
|
|
3022
|
+
type IRelationalDb<Schema = unknown> = IBaseRelationalDb<Schema> & {
|
|
3023
|
+
createNamespace<NamespaceSchema>(namespace: string): Promise<IRelationalDb<ExtractProcessorSchemaOrSelf<NamespaceSchema>>>;
|
|
3024
|
+
queryNamespace<NamespaceSchema>(namespace: string): IRelationalQueryBuilder<NamespaceSchema>;
|
|
3025
|
+
};
|
|
3026
|
+
type ExtractProcessorSchemaOrSelf<TProcessor> = TProcessor extends RelationalDbProcessor<infer TSchema> ? TSchema : TProcessor;
|
|
3027
|
+
type RelationalDbProcessorClass<TSchema> = typeof RelationalDbProcessor<TSchema>;
|
|
3028
|
+
interface IRelationalDbProcessor<TDatabaseSchema = unknown> extends IProcessor {
|
|
3029
|
+
namespace: string;
|
|
3030
|
+
query: IRelationalQueryBuilder<TDatabaseSchema>;
|
|
3031
|
+
filter: ProcessorFilter;
|
|
3032
|
+
initAndUpgrade(): Promise<void>;
|
|
3033
|
+
}
|
|
3034
|
+
declare const IS_RELATIONAL_DB_PROCESSOR: unique symbol;
|
|
3035
|
+
/**
|
|
3036
|
+
* Base class for relational db processors that require a relational database storage.
|
|
3037
|
+
* This class abstracts database initialization, migration management, and resource cleanup,
|
|
3038
|
+
* allowing derived classes to focus on business logic.
|
|
3039
|
+
*/
|
|
3040
|
+
declare abstract class RelationalDbProcessor<TDatabaseSchema = unknown> implements IRelationalDbProcessor<TDatabaseSchema> {
|
|
3041
|
+
protected _namespace: string;
|
|
3042
|
+
protected _filter: ProcessorFilter;
|
|
3043
|
+
protected relationalDb: IRelationalDb<TDatabaseSchema>;
|
|
3044
|
+
/** The drive the factory created this processor for. */
|
|
3045
|
+
protected _driveId?: string | undefined;
|
|
3046
|
+
constructor(_namespace: string, _filter: ProcessorFilter, relationalDb: IRelationalDb<TDatabaseSchema>,
|
|
3047
|
+
/** The drive the factory created this processor for. */
|
|
3048
|
+
_driveId?: string | undefined);
|
|
3049
|
+
static [IS_RELATIONAL_DB_PROCESSOR]: boolean;
|
|
3050
|
+
/**
|
|
3051
|
+
* Returns the namespace for a given drive id.
|
|
3052
|
+
* This method can be overridden by derived classes to provide a custom namespace.
|
|
3053
|
+
*/
|
|
3054
|
+
static getNamespace(driveId: string): string;
|
|
3055
|
+
static query<Schema>(this: RelationalDbProcessorClass<Schema>, driveId: string, db: IRelationalDb<any>): IRelationalQueryBuilder<Schema>;
|
|
3056
|
+
/**
|
|
3057
|
+
* Processes a list of operations with context.
|
|
3058
|
+
* Called when operations match this processor's filter.
|
|
3059
|
+
*/
|
|
3060
|
+
abstract onOperations(operations: OperationWithContext[]): Promise<void>;
|
|
3061
|
+
/**
|
|
3062
|
+
* Returns the filter for the processor.
|
|
3063
|
+
* This method can be overridden by derived classes to provide a custom filter.
|
|
3064
|
+
*/
|
|
3065
|
+
get filter(): ProcessorFilter;
|
|
3066
|
+
/**
|
|
3067
|
+
* Returns the namespace used by the processor.
|
|
3068
|
+
*/
|
|
3069
|
+
get namespace(): string;
|
|
3070
|
+
/** Processors writing one namespace are cleared together. */
|
|
3071
|
+
get clearScope(): string;
|
|
3072
|
+
/** Drops the namespace and its tables, then migrates it afresh. */
|
|
3073
|
+
clear(): Promise<void>;
|
|
3074
|
+
get query(): IRelationalQueryBuilder<TDatabaseSchema>;
|
|
3075
|
+
/** True for this processor's drive when its namespace is that drive's alone. */
|
|
3076
|
+
protected isNamespaceDrive(documentId: string): boolean;
|
|
3077
|
+
/** Deletes a document's rows from every table with a document-id column. */
|
|
3078
|
+
protected deleteDocumentRows(documentId: string): Promise<void>;
|
|
3079
|
+
/** Drops this processor's namespace and every table in it. */
|
|
3080
|
+
protected dropNamespace(): Promise<void>;
|
|
3081
|
+
private namespaceSchema;
|
|
3082
|
+
/**
|
|
3083
|
+
* Abstract method that derived classes must implement.
|
|
3084
|
+
* This method is meant to be called on subclasses to initialize and upgrade the database.
|
|
3085
|
+
*/
|
|
3086
|
+
abstract initAndUpgrade(): Promise<void>;
|
|
3087
|
+
/**
|
|
3088
|
+
* Called when the processor is disconnected.
|
|
3089
|
+
* This method is meant to be overridden by subclasses to clean up resources.
|
|
3090
|
+
*/
|
|
3091
|
+
abstract onDisconnect(): Promise<void>;
|
|
3092
|
+
}
|
|
3093
|
+
//#endregion
|
|
3094
|
+
//#region processors/relational/utils.d.ts
|
|
3095
|
+
/**
|
|
3096
|
+
* Hashes a string to a lowercase base-26 string.
|
|
3097
|
+
* @param str The string to hash.
|
|
3098
|
+
* @param length The length of the hash. Defaults to 10.
|
|
3099
|
+
* @param algorithm The hashing algorithm to use. Defaults to "fnv1a".
|
|
3100
|
+
* @returns The hashed string.
|
|
3101
|
+
*/
|
|
3102
|
+
declare function hashNamespace(str: string, length?: number): string;
|
|
3103
|
+
/**
|
|
3104
|
+
* Creates a RelationalDb instance with namespace support.
|
|
3105
|
+
* @param baseDb The base RelationalDb instance to enhance.
|
|
3106
|
+
* @param baseOptions The default options for namespace creation. Hashes namespace by default.
|
|
3107
|
+
* @returns The enhanced RelationalDb instance.
|
|
3108
|
+
*/
|
|
3109
|
+
declare function createRelationalDb<Schema>(baseDb: IBaseRelationalDb<Schema>, baseOptions?: NamespaceOptions): IRelationalDb<Schema>;
|
|
3110
|
+
type NamespaceOptions = {
|
|
3111
|
+
hashNamespace?: boolean;
|
|
3112
|
+
};
|
|
3113
|
+
declare function createNamespacedDb<Schema>(db: IBaseRelationalDb<any>, namespace: string, options?: NamespaceOptions): Promise<IRelationalDb<Schema>>;
|
|
3114
|
+
/** The schema behind a handle from `createNamespace`; undefined otherwise. */
|
|
3115
|
+
declare function namespaceSchemaOf(db: object): string | undefined;
|
|
3116
|
+
declare function createNamespacedQueryBuilder<Schema>(db: IBaseRelationalDb<any>, namespace: string, options?: NamespaceOptions): IRelationalQueryBuilder<Schema>;
|
|
3117
|
+
/**
|
|
3118
|
+
* Returns a query builder for a RelationalDb instance.
|
|
3119
|
+
* @param query The RelationalDb instance to convert.
|
|
3120
|
+
* @returns The IRelationalQueryBuilder instance.
|
|
3121
|
+
*/
|
|
3122
|
+
declare function relationalDbToQueryBuilder<TSchema>(query: IBaseRelationalDb<TSchema>): IRelationalQueryBuilder<TSchema>;
|
|
3123
|
+
//#endregion
|
|
3124
|
+
//#region processors/codegen-status.d.ts
|
|
3125
|
+
/** Where a codegen job for one document stands; `done`, `failed` and `skipped` are settled. */
|
|
3126
|
+
type CodegenState = "queued" | "running" | "waiting-for-install" | "done" | "failed" | "skipped";
|
|
3127
|
+
declare const SETTLED_CODEGEN_STATES: readonly CodegenState[];
|
|
3128
|
+
type CodegenStatus = {
|
|
3129
|
+
documentId: string;
|
|
3130
|
+
documentType: string;
|
|
3131
|
+
/** The module's name, once the job has read the document. */
|
|
3132
|
+
name?: string;
|
|
3133
|
+
state: CodegenState;
|
|
3134
|
+
/** Why it was skipped or failed, or what it waits for. */
|
|
3135
|
+
message?: string;
|
|
3136
|
+
/** Project files the job wrote, relative to the project. */
|
|
3137
|
+
files?: string[];
|
|
3138
|
+
/** ISO timestamp of the last change. */
|
|
3139
|
+
updatedAt: string;
|
|
3140
|
+
};
|
|
3141
|
+
/** A package module the reactor failed to load, e.g. broken generated code. */
|
|
3142
|
+
type PackageLoadFailure = {
|
|
3143
|
+
package: string;
|
|
3144
|
+
/** What was loaded: "document models", "subgraphs", "processors", ... */
|
|
3145
|
+
kind: string;
|
|
3146
|
+
message: string;
|
|
3147
|
+
updatedAt: string;
|
|
3148
|
+
};
|
|
3149
|
+
declare function isSettledCodegenState(state: CodegenState): boolean;
|
|
3150
|
+
/** Vetra's codegen status per document, and failed package loads. The codegen
|
|
3151
|
+
* processor, the package loader and reactor-mcp share it in one process. */
|
|
3152
|
+
declare class CodegenStatusRegistry {
|
|
3153
|
+
#private;
|
|
3154
|
+
/** Records that a codegen processor generates code for `documentTypes`. */
|
|
3155
|
+
watch(documentTypes: readonly string[]): void;
|
|
3156
|
+
/** Whether a codegen processor runs in this process. */
|
|
3157
|
+
get active(): boolean;
|
|
3158
|
+
get documentTypes(): string[];
|
|
3159
|
+
watches(documentType: string): boolean;
|
|
3160
|
+
/** Replaces a document's status; `name` carries over unless given. */
|
|
3161
|
+
set(status: Omit<CodegenStatus, "updatedAt" | "name"> & {
|
|
3162
|
+
name?: string;
|
|
3163
|
+
}): CodegenStatus;
|
|
3164
|
+
get(documentId: string): CodegenStatus | undefined;
|
|
3165
|
+
/** Most recently updated first. */
|
|
3166
|
+
list(): CodegenStatus[];
|
|
3167
|
+
delete(documentId: string): void;
|
|
3168
|
+
/** Records a failed load of `kind` from `pkg`; no `failure` clears it. */
|
|
3169
|
+
reportLoad(pkg: string, kind: string, failure?: string): void;
|
|
3170
|
+
loadFailures(): PackageLoadFailure[];
|
|
3171
|
+
/** Whether `documentId`'s job, or every job when omitted, has settled. */
|
|
3172
|
+
settled(documentId?: string): boolean;
|
|
3173
|
+
/** Resolves to whether the jobs settled within `timeoutMs`. */
|
|
3174
|
+
waitUntilSettled(documentId: string | undefined, timeoutMs: number): Promise<boolean>;
|
|
3175
|
+
subscribe(listener: () => void): () => void;
|
|
3176
|
+
/** Forgets everything; for tests. */
|
|
3177
|
+
clear(): void;
|
|
3178
|
+
}
|
|
3179
|
+
/** The process's codegen status registry. */
|
|
3180
|
+
declare function getCodegenStatusRegistry(): CodegenStatusRegistry;
|
|
3181
|
+
//#endregion
|
|
3182
|
+
//#region document-model/types.d.ts
|
|
3183
|
+
type State = {
|
|
3184
|
+
examples: CodeExample[];
|
|
3185
|
+
initialValue: string;
|
|
3186
|
+
schema: string;
|
|
3187
|
+
};
|
|
3188
|
+
type ScopeState = {
|
|
3189
|
+
global: State;
|
|
3190
|
+
local: State;
|
|
3191
|
+
};
|
|
3192
|
+
type Author = {
|
|
3193
|
+
name: string;
|
|
3194
|
+
website: string | null;
|
|
3195
|
+
};
|
|
3196
|
+
type OperationErrorSpecification = {
|
|
3197
|
+
code: string | null;
|
|
3198
|
+
description: string | null;
|
|
3199
|
+
id: ID;
|
|
3200
|
+
name: string | null;
|
|
3201
|
+
template: string | null;
|
|
3202
|
+
};
|
|
3203
|
+
type CodeExample = {
|
|
3204
|
+
id: ID;
|
|
3205
|
+
value: string;
|
|
3206
|
+
};
|
|
3207
|
+
type OperationSpecification = {
|
|
3208
|
+
description: string | null;
|
|
3209
|
+
errors: OperationErrorSpecification[];
|
|
3210
|
+
examples: CodeExample[];
|
|
3211
|
+
id: ID;
|
|
3212
|
+
name: string | null;
|
|
3213
|
+
reducer: string | null;
|
|
3214
|
+
schema: string | null;
|
|
3215
|
+
template: string | null;
|
|
3216
|
+
scope: string;
|
|
3217
|
+
};
|
|
3218
|
+
type ModuleSpecification = {
|
|
3219
|
+
description: string | null;
|
|
3220
|
+
id: ID;
|
|
3221
|
+
name: string;
|
|
3222
|
+
operations: OperationSpecification[];
|
|
3223
|
+
};
|
|
3224
|
+
type DocumentSpecification = {
|
|
3225
|
+
changeLog: string[];
|
|
3226
|
+
modules: ModuleSpecification[];
|
|
3227
|
+
state: ScopeState;
|
|
3228
|
+
version: number;
|
|
3229
|
+
};
|
|
3230
|
+
type DocumentModelGlobalState = {
|
|
3231
|
+
author: Author;
|
|
3232
|
+
description: string;
|
|
3233
|
+
extension: string;
|
|
3234
|
+
id: string;
|
|
3235
|
+
name: string;
|
|
3236
|
+
specifications: DocumentSpecification[];
|
|
3237
|
+
};
|
|
3238
|
+
type DocumentModelLocalState = {};
|
|
3239
|
+
type DocumentModelPHState = PHBaseState & {
|
|
3240
|
+
global: DocumentModelGlobalState;
|
|
3241
|
+
local: DocumentModelLocalState;
|
|
3242
|
+
};
|
|
3243
|
+
type DocumentModelDocument = PHDocument$1<DocumentModelPHState>;
|
|
3244
|
+
type DocumentModelAction = DocumentModelHeaderAction | DocumentModelVersioningAction | DocumentModelModuleAction | DocumentModelOperationErrorAction | DocumentModelOperationExampleAction | DocumentModelOperationAction | DocumentModelStateAction;
|
|
3245
|
+
type AddChangeLogItemInput = {
|
|
3246
|
+
__typename?: "AddChangeLogItemInput";
|
|
3247
|
+
content: Scalars["String"]["output"];
|
|
3248
|
+
id: Scalars["ID"]["output"];
|
|
3249
|
+
insertBefore: Maybe<Scalars["ID"]["output"]>;
|
|
3250
|
+
};
|
|
3251
|
+
type AddModuleInput = {
|
|
3252
|
+
description?: InputMaybe<Scalars["String"]["input"]>;
|
|
3253
|
+
id: Scalars["ID"]["input"];
|
|
3254
|
+
name: Scalars["String"]["input"];
|
|
3255
|
+
};
|
|
3256
|
+
type AddOperationErrorInput = {
|
|
3257
|
+
errorCode?: InputMaybe<Scalars["String"]["input"]>;
|
|
3258
|
+
errorDescription?: InputMaybe<Scalars["String"]["input"]>;
|
|
3259
|
+
errorName?: InputMaybe<Scalars["String"]["input"]>;
|
|
3260
|
+
errorTemplate?: InputMaybe<Scalars["String"]["input"]>;
|
|
3261
|
+
id: Scalars["ID"]["input"];
|
|
3262
|
+
operationId: Scalars["ID"]["input"];
|
|
3263
|
+
};
|
|
3264
|
+
type AddOperationExampleInput = {
|
|
3265
|
+
example: Scalars["String"]["input"];
|
|
3266
|
+
id: Scalars["ID"]["input"];
|
|
3267
|
+
operationId: Scalars["ID"]["input"];
|
|
3268
|
+
};
|
|
3269
|
+
type AddOperationInput = {
|
|
3270
|
+
description?: InputMaybe<Scalars["String"]["input"]>;
|
|
3271
|
+
id: Scalars["ID"]["input"];
|
|
3272
|
+
moduleId: Scalars["ID"]["input"];
|
|
3273
|
+
name: Scalars["String"]["input"];
|
|
3274
|
+
reducer?: InputMaybe<Scalars["String"]["input"]>;
|
|
3275
|
+
schema?: InputMaybe<Scalars["String"]["input"]>;
|
|
3276
|
+
template?: InputMaybe<Scalars["String"]["input"]>;
|
|
3277
|
+
scope?: InputMaybe<string>;
|
|
3278
|
+
};
|
|
3279
|
+
type AddStateExampleInput = {
|
|
3280
|
+
scope: Scalars["String"]["input"];
|
|
3281
|
+
example: Scalars["String"]["input"];
|
|
3282
|
+
id: Scalars["ID"]["input"];
|
|
3283
|
+
insertBefore?: InputMaybe<Scalars["ID"]["input"]>;
|
|
3284
|
+
};
|
|
3285
|
+
type DeleteChangeLogItemInput = {
|
|
3286
|
+
__typename?: "DeleteChangeLogItemInput";
|
|
3287
|
+
id: Scalars["ID"]["output"];
|
|
3288
|
+
};
|
|
3289
|
+
type DeleteModuleInput = {
|
|
3290
|
+
id: Scalars["ID"]["input"];
|
|
3291
|
+
};
|
|
3292
|
+
type DeleteOperationErrorInput = {
|
|
3293
|
+
id: Scalars["ID"]["input"];
|
|
3294
|
+
};
|
|
3295
|
+
type DeleteOperationExampleInput = {
|
|
3296
|
+
id: Scalars["ID"]["input"];
|
|
3297
|
+
};
|
|
3298
|
+
type DeleteOperationInput = {
|
|
3299
|
+
id: Scalars["ID"]["input"];
|
|
3300
|
+
};
|
|
3301
|
+
type DeleteStateExampleInput = {
|
|
3302
|
+
scope: Scalars["String"]["input"];
|
|
3303
|
+
id: Scalars["ID"]["input"];
|
|
3304
|
+
};
|
|
3305
|
+
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;
|
|
3306
|
+
type MoveOperationInput = {
|
|
3307
|
+
newModuleId: Scalars["ID"]["input"];
|
|
3308
|
+
operationId: Scalars["ID"]["input"];
|
|
3309
|
+
};
|
|
3310
|
+
type Mutation = {
|
|
3311
|
+
__typename?: "Mutation";
|
|
3312
|
+
addChangeLogItemInput: DocumentModelGlobalState;
|
|
3313
|
+
addModule: DocumentModelGlobalState;
|
|
3314
|
+
addOperation: DocumentModelGlobalState;
|
|
3315
|
+
addOperationError: DocumentModelGlobalState;
|
|
3316
|
+
addOperationExample: DocumentModelGlobalState;
|
|
3317
|
+
addStateExample: DocumentModelGlobalState;
|
|
3318
|
+
deleteChangeLogItemInput: DocumentModelGlobalState;
|
|
3319
|
+
deleteModule: DocumentModelGlobalState;
|
|
3320
|
+
deleteOperation: DocumentModelGlobalState;
|
|
3321
|
+
deleteOperationError: DocumentModelGlobalState;
|
|
3322
|
+
deleteOperationExample: DocumentModelGlobalState;
|
|
3323
|
+
deleteStateExample: DocumentModelGlobalState;
|
|
3324
|
+
moveOperation: DocumentModelGlobalState;
|
|
3325
|
+
releaseNewVersion: DocumentModelGlobalState;
|
|
3326
|
+
reorderChangeLogItemsInput: DocumentModelGlobalState;
|
|
3327
|
+
reorderModuleOperations: DocumentModelGlobalState;
|
|
3328
|
+
reorderModules: DocumentModelGlobalState;
|
|
3329
|
+
reorderOperationErrors: DocumentModelGlobalState;
|
|
3330
|
+
reorderOperationExamples: DocumentModelGlobalState;
|
|
3331
|
+
reorderStateExamples: DocumentModelGlobalState;
|
|
3332
|
+
setAuthorName: DocumentModelGlobalState;
|
|
3333
|
+
setAuthorWebsite: DocumentModelGlobalState;
|
|
3334
|
+
setInitialState: DocumentModelGlobalState;
|
|
3335
|
+
setModelDescription: DocumentModelGlobalState;
|
|
3336
|
+
setModelExtension: DocumentModelGlobalState;
|
|
3337
|
+
setModelId: DocumentModelGlobalState;
|
|
3338
|
+
setModelName: DocumentModelGlobalState;
|
|
3339
|
+
setModuleDescription: DocumentModelGlobalState;
|
|
3340
|
+
setModuleName: DocumentModelGlobalState;
|
|
3341
|
+
setOperationDescription: DocumentModelGlobalState;
|
|
3342
|
+
setOperationErrorCode: DocumentModelGlobalState;
|
|
3343
|
+
setOperationErrorDescription: DocumentModelGlobalState;
|
|
3344
|
+
setOperationErrorName: DocumentModelGlobalState;
|
|
3345
|
+
setOperationErrorTemplate: DocumentModelGlobalState;
|
|
3346
|
+
setOperationName: DocumentModelGlobalState;
|
|
3347
|
+
setOperationReducer: DocumentModelGlobalState;
|
|
3348
|
+
setOperationSchema: DocumentModelGlobalState;
|
|
3349
|
+
setOperationTemplate: DocumentModelGlobalState;
|
|
3350
|
+
setStateSchema: DocumentModelGlobalState;
|
|
3351
|
+
updateChangeLogItemInput: DocumentModelGlobalState;
|
|
3352
|
+
updateOperationExample: DocumentModelGlobalState;
|
|
3353
|
+
updateStateExample: DocumentModelGlobalState;
|
|
3354
|
+
};
|
|
3355
|
+
type MutationAddChangeLogItemInputArgs = {
|
|
3356
|
+
input?: InputMaybe<AddChangeLogItemInput>;
|
|
3357
|
+
};
|
|
3358
|
+
type MutationAddModuleArgs = {
|
|
3359
|
+
input: AddModuleInput;
|
|
3360
|
+
};
|
|
3361
|
+
type MutationAddOperationArgs = {
|
|
3362
|
+
input: AddOperationInput;
|
|
3363
|
+
};
|
|
3364
|
+
type MutationAddOperationErrorArgs = {
|
|
3365
|
+
input: AddOperationErrorInput;
|
|
3366
|
+
};
|
|
3367
|
+
type MutationAddOperationExampleArgs = {
|
|
3368
|
+
input: AddOperationExampleInput;
|
|
3369
|
+
};
|
|
3370
|
+
type MutationAddStateExampleArgs = {
|
|
3371
|
+
input: AddStateExampleInput;
|
|
3372
|
+
};
|
|
3373
|
+
type MutationDeleteChangeLogItemInputArgs = {
|
|
3374
|
+
input?: InputMaybe<DeleteChangeLogItemInput>;
|
|
3375
|
+
};
|
|
3376
|
+
type MutationDeleteModuleArgs = {
|
|
3377
|
+
input: DeleteModuleInput;
|
|
3378
|
+
};
|
|
3379
|
+
type MutationDeleteOperationArgs = {
|
|
3380
|
+
input: DeleteOperationInput;
|
|
3381
|
+
};
|
|
3382
|
+
type MutationDeleteOperationErrorArgs = {
|
|
3383
|
+
input: DeleteOperationErrorInput;
|
|
3384
|
+
};
|
|
3385
|
+
type MutationDeleteOperationExampleArgs = {
|
|
3386
|
+
input: DeleteOperationExampleInput;
|
|
3387
|
+
};
|
|
3388
|
+
type MutationDeleteStateExampleArgs = {
|
|
3389
|
+
input: DeleteStateExampleInput;
|
|
3390
|
+
};
|
|
3391
|
+
type MutationMoveOperationArgs = {
|
|
3392
|
+
input: MoveOperationInput;
|
|
3393
|
+
};
|
|
3394
|
+
type MutationReorderChangeLogItemsInputArgs = {
|
|
3395
|
+
input?: InputMaybe<ReorderChangeLogItemsInput>;
|
|
3396
|
+
};
|
|
3397
|
+
type MutationReorderModuleOperationsArgs = {
|
|
3398
|
+
input: ReorderModuleOperationsInput;
|
|
3399
|
+
};
|
|
3400
|
+
type MutationReorderModulesArgs = {
|
|
3401
|
+
input: ReorderModulesInput;
|
|
3402
|
+
};
|
|
3403
|
+
type MutationReorderOperationErrorsArgs = {
|
|
3404
|
+
input: ReorderOperationErrorsInput;
|
|
3405
|
+
};
|
|
3406
|
+
type MutationReorderOperationExamplesArgs = {
|
|
3407
|
+
input: ReorderOperationExamplesInput;
|
|
3408
|
+
};
|
|
3409
|
+
type MutationReorderStateExamplesArgs = {
|
|
3410
|
+
input: ReorderStateExamplesInput;
|
|
3411
|
+
};
|
|
3412
|
+
type MutationSetAuthorNameArgs = {
|
|
3413
|
+
input: SetAuthorNameInput;
|
|
3414
|
+
};
|
|
3415
|
+
type MutationSetAuthorWebsiteArgs = {
|
|
3416
|
+
input: SetAuthorWebsiteInput;
|
|
3417
|
+
};
|
|
3418
|
+
type MutationSetInitialStateArgs = {
|
|
3419
|
+
input: SetInitialStateInput;
|
|
3420
|
+
};
|
|
3421
|
+
type MutationSetModelDescriptionArgs = {
|
|
3422
|
+
input: SetModelDescriptionInput;
|
|
3423
|
+
};
|
|
3424
|
+
type MutationSetModelExtensionArgs = {
|
|
3425
|
+
input: SetModelExtensionInput;
|
|
3426
|
+
};
|
|
3427
|
+
type MutationSetModelIdArgs = {
|
|
3428
|
+
input: SetModelIdInput;
|
|
3429
|
+
};
|
|
3430
|
+
type MutationSetModelNameArgs = {
|
|
3431
|
+
input: SetModelNameInput;
|
|
3432
|
+
};
|
|
3433
|
+
type MutationSetModuleDescriptionArgs = {
|
|
3434
|
+
input: SetModuleDescriptionInput;
|
|
3435
|
+
};
|
|
3436
|
+
type MutationSetModuleNameArgs = {
|
|
3437
|
+
input: SetModuleNameInput;
|
|
3438
|
+
};
|
|
3439
|
+
type MutationSetOperationDescriptionArgs = {
|
|
3440
|
+
input: SetOperationDescriptionInput;
|
|
3441
|
+
};
|
|
3442
|
+
type MutationSetOperationErrorCodeArgs = {
|
|
3443
|
+
input: SetOperationErrorCodeInput;
|
|
3444
|
+
};
|
|
3445
|
+
type MutationSetOperationErrorDescriptionArgs = {
|
|
3446
|
+
input: SetOperationErrorDescriptionInput;
|
|
3447
|
+
};
|
|
3448
|
+
type MutationSetOperationErrorNameArgs = {
|
|
3449
|
+
input: SetOperationErrorNameInput;
|
|
3450
|
+
};
|
|
3451
|
+
type MutationSetOperationErrorTemplateArgs = {
|
|
3452
|
+
input: SetOperationErrorTemplateInput;
|
|
3453
|
+
};
|
|
3454
|
+
type MutationSetOperationNameArgs = {
|
|
3455
|
+
input: SetOperationNameInput;
|
|
3456
|
+
};
|
|
3457
|
+
type MutationSetOperationReducerArgs = {
|
|
3458
|
+
input: SetOperationReducerInput;
|
|
3459
|
+
};
|
|
3460
|
+
type MutationSetOperationSchemaArgs = {
|
|
3461
|
+
input: SetOperationSchemaInput;
|
|
3462
|
+
};
|
|
3463
|
+
type MutationSetOperationTemplateArgs = {
|
|
3464
|
+
input: SetOperationTemplateInput;
|
|
3465
|
+
};
|
|
3466
|
+
type MutationSetStateSchemaArgs = {
|
|
3467
|
+
input: SetStateSchemaInput;
|
|
3468
|
+
};
|
|
3469
|
+
type MutationUpdateChangeLogItemInputArgs = {
|
|
3470
|
+
input?: InputMaybe<UpdateChangeLogItemInput>;
|
|
3471
|
+
};
|
|
3472
|
+
type MutationUpdateOperationExampleArgs = {
|
|
3473
|
+
input: UpdateOperationExampleInput;
|
|
3474
|
+
};
|
|
3475
|
+
type MutationUpdateStateExampleArgs = {
|
|
3476
|
+
input: UpdateStateExampleInput;
|
|
3477
|
+
};
|
|
3478
|
+
type ReorderChangeLogItemsInput = {
|
|
3479
|
+
__typename?: "ReorderChangeLogItemsInput";
|
|
3480
|
+
order: Array<Scalars["ID"]["output"]>;
|
|
3481
|
+
};
|
|
3482
|
+
type ReorderModuleOperationsInput = {
|
|
3483
|
+
moduleId: Scalars["ID"]["input"];
|
|
3484
|
+
order: Array<Scalars["ID"]["input"]>;
|
|
3485
|
+
};
|
|
3486
|
+
type ReorderModulesInput = {
|
|
3487
|
+
order: Array<Scalars["ID"]["input"]>;
|
|
3488
|
+
};
|
|
3489
|
+
type ReorderOperationErrorsInput = {
|
|
3490
|
+
operationId: Scalars["ID"]["input"];
|
|
3491
|
+
order: Array<Scalars["ID"]["input"]>;
|
|
3492
|
+
};
|
|
3493
|
+
type ReorderOperationExamplesInput = {
|
|
3494
|
+
operationId: Scalars["ID"]["input"];
|
|
3495
|
+
order: Array<Scalars["ID"]["input"]>;
|
|
3496
|
+
};
|
|
3497
|
+
type ReorderStateExamplesInput = {
|
|
3498
|
+
scope: Scalars["String"]["input"];
|
|
3499
|
+
order: Array<Scalars["ID"]["input"]>;
|
|
3500
|
+
};
|
|
3501
|
+
type SetAuthorNameInput = {
|
|
3502
|
+
authorName: Scalars["String"]["input"];
|
|
3503
|
+
};
|
|
3504
|
+
type SetAuthorWebsiteInput = {
|
|
3505
|
+
authorWebsite: Scalars["String"]["input"];
|
|
3506
|
+
};
|
|
3507
|
+
type SetInitialStateInput = {
|
|
3508
|
+
scope: Scalars["String"]["input"];
|
|
3509
|
+
initialValue: Scalars["String"]["input"];
|
|
3510
|
+
};
|
|
3511
|
+
type SetModelDescriptionInput = {
|
|
3512
|
+
description: Scalars["String"]["input"];
|
|
3513
|
+
};
|
|
3514
|
+
type SetModelExtensionInput = {
|
|
3515
|
+
extension: Scalars["String"]["input"];
|
|
3516
|
+
};
|
|
3517
|
+
type SetModelIdInput = {
|
|
3518
|
+
id: Scalars["String"]["input"];
|
|
3519
|
+
};
|
|
3520
|
+
type SetModelNameInput = {
|
|
3521
|
+
name: Scalars["String"]["input"];
|
|
3522
|
+
};
|
|
3523
|
+
type SetModuleDescriptionInput = {
|
|
3524
|
+
description?: InputMaybe<Scalars["String"]["input"]>;
|
|
3525
|
+
id: Scalars["ID"]["input"];
|
|
3526
|
+
};
|
|
3527
|
+
type SetModuleNameInput = {
|
|
3528
|
+
id: Scalars["ID"]["input"];
|
|
3529
|
+
name?: InputMaybe<Scalars["String"]["input"]>;
|
|
3530
|
+
};
|
|
3531
|
+
type SetOperationDescriptionInput = {
|
|
3532
|
+
description?: InputMaybe<Scalars["String"]["input"]>;
|
|
3533
|
+
id: Scalars["ID"]["input"];
|
|
3534
|
+
};
|
|
3535
|
+
type SetOperationErrorCodeInput = {
|
|
3536
|
+
errorCode?: InputMaybe<Scalars["String"]["input"]>;
|
|
3537
|
+
id: Scalars["ID"]["input"];
|
|
3538
|
+
};
|
|
3539
|
+
type SetOperationErrorDescriptionInput = {
|
|
3540
|
+
errorDescription?: InputMaybe<Scalars["String"]["input"]>;
|
|
3541
|
+
id: Scalars["ID"]["input"];
|
|
3542
|
+
};
|
|
3543
|
+
type SetOperationErrorNameInput = {
|
|
3544
|
+
errorName?: InputMaybe<Scalars["String"]["input"]>;
|
|
3545
|
+
id: Scalars["ID"]["input"];
|
|
3546
|
+
};
|
|
3547
|
+
type SetOperationErrorTemplateInput = {
|
|
3548
|
+
errorTemplate?: InputMaybe<Scalars["String"]["input"]>;
|
|
3549
|
+
id: Scalars["ID"]["input"];
|
|
3550
|
+
};
|
|
3551
|
+
type SetOperationNameInput = {
|
|
3552
|
+
id: Scalars["ID"]["input"];
|
|
3553
|
+
name?: InputMaybe<Scalars["String"]["input"]>;
|
|
3554
|
+
};
|
|
3555
|
+
type SetOperationScopeInput = {
|
|
3556
|
+
id: Scalars["ID"]["input"];
|
|
3557
|
+
scope?: InputMaybe<string>;
|
|
3558
|
+
};
|
|
3559
|
+
type SetOperationReducerInput = {
|
|
3560
|
+
id: Scalars["ID"]["input"];
|
|
3561
|
+
reducer?: InputMaybe<Scalars["String"]["input"]>;
|
|
3562
|
+
};
|
|
3563
|
+
type SetOperationSchemaInput = {
|
|
3564
|
+
id: Scalars["ID"]["input"];
|
|
3565
|
+
schema?: InputMaybe<Scalars["String"]["input"]>;
|
|
3566
|
+
};
|
|
3567
|
+
type SetOperationTemplateInput = {
|
|
3568
|
+
id: Scalars["ID"]["input"];
|
|
3569
|
+
template?: InputMaybe<Scalars["String"]["input"]>;
|
|
3570
|
+
};
|
|
3571
|
+
type SetStateSchemaInput = {
|
|
3572
|
+
scope: Scalars["String"]["input"];
|
|
3573
|
+
schema: Scalars["String"]["input"];
|
|
3574
|
+
};
|
|
3575
|
+
type UpdateChangeLogItemInput = {
|
|
3576
|
+
__typename?: "UpdateChangeLogItemInput";
|
|
3577
|
+
id: Scalars["ID"]["output"];
|
|
3578
|
+
newContent: Scalars["String"]["output"];
|
|
3579
|
+
};
|
|
3580
|
+
type UpdateOperationExampleInput = {
|
|
3581
|
+
example: Scalars["String"]["input"];
|
|
3582
|
+
id: Scalars["ID"]["input"];
|
|
3583
|
+
};
|
|
3584
|
+
type UpdateStateExampleInput = {
|
|
3585
|
+
scope: Scalars["String"]["input"];
|
|
3586
|
+
id: Scalars["ID"]["input"];
|
|
3587
|
+
newExample: Scalars["String"]["input"];
|
|
3588
|
+
};
|
|
3589
|
+
type SetModelNameAction = Action & {
|
|
3590
|
+
type: "SET_MODEL_NAME";
|
|
3591
|
+
input: SetModelNameInput;
|
|
3592
|
+
};
|
|
3593
|
+
type SetModelIdAction = Action & {
|
|
3594
|
+
type: "SET_MODEL_ID";
|
|
3595
|
+
input: SetModelIdInput;
|
|
3596
|
+
};
|
|
3597
|
+
type SetModelExtensionAction = Action & {
|
|
3598
|
+
type: "SET_MODEL_EXTENSION";
|
|
3599
|
+
input: SetModelExtensionInput;
|
|
3600
|
+
};
|
|
3601
|
+
type SetModelDescriptionAction = Action & {
|
|
3602
|
+
type: "SET_MODEL_DESCRIPTION";
|
|
3603
|
+
input: SetModelDescriptionInput;
|
|
3604
|
+
};
|
|
3605
|
+
type SetAuthorNameAction = Action & {
|
|
3606
|
+
type: "SET_AUTHOR_NAME";
|
|
3607
|
+
input: SetAuthorNameInput;
|
|
3608
|
+
};
|
|
3609
|
+
type SetAuthorWebsiteAction = Action & {
|
|
3610
|
+
type: "SET_AUTHOR_WEBSITE";
|
|
3611
|
+
input: SetAuthorWebsiteInput;
|
|
3612
|
+
};
|
|
3613
|
+
type DocumentModelHeaderAction = SetModelNameAction | SetModelIdAction | SetModelExtensionAction | SetModelDescriptionAction | SetAuthorNameAction | SetAuthorWebsiteAction;
|
|
3614
|
+
type AddModuleAction = Action & {
|
|
3615
|
+
type: "ADD_MODULE";
|
|
3616
|
+
input: AddModuleInput;
|
|
3617
|
+
};
|
|
3618
|
+
type SetModuleNameAction = Action & {
|
|
3619
|
+
type: "SET_MODULE_NAME";
|
|
3620
|
+
input: SetModuleNameInput;
|
|
3621
|
+
};
|
|
3622
|
+
type SetModuleDescriptionAction = Action & {
|
|
3623
|
+
type: "SET_MODULE_DESCRIPTION";
|
|
3624
|
+
input: SetModuleDescriptionInput;
|
|
3625
|
+
};
|
|
3626
|
+
type DeleteModuleAction = Action & {
|
|
3627
|
+
type: "DELETE_MODULE";
|
|
3628
|
+
input: DeleteModuleInput;
|
|
3629
|
+
};
|
|
3630
|
+
type ReorderModulesAction = Action & {
|
|
3631
|
+
type: "REORDER_MODULES";
|
|
3632
|
+
input: ReorderModulesInput;
|
|
3633
|
+
};
|
|
3634
|
+
type DocumentModelModuleAction = AddModuleAction | SetModuleNameAction | SetModuleDescriptionAction | DeleteModuleAction | ReorderModulesAction;
|
|
3635
|
+
type AddOperationAction = Action & {
|
|
3636
|
+
type: "ADD_OPERATION";
|
|
3637
|
+
input: AddOperationInput;
|
|
3638
|
+
};
|
|
3639
|
+
type SetOperationNameAction = Action & {
|
|
3640
|
+
type: "SET_OPERATION_NAME";
|
|
3641
|
+
input: SetOperationNameInput;
|
|
3642
|
+
};
|
|
3643
|
+
type SetOperationScopeAction = Action & {
|
|
3644
|
+
type: "SET_OPERATION_SCOPE";
|
|
3645
|
+
input: SetOperationScopeInput;
|
|
3646
|
+
};
|
|
3647
|
+
type SetOperationSchemaAction = Action & {
|
|
3648
|
+
type: "SET_OPERATION_SCHEMA";
|
|
3649
|
+
input: SetOperationSchemaInput;
|
|
3650
|
+
};
|
|
3651
|
+
type SetOperationDescriptionAction = Action & {
|
|
3652
|
+
type: "SET_OPERATION_DESCRIPTION";
|
|
3653
|
+
input: SetOperationDescriptionInput;
|
|
3654
|
+
};
|
|
3655
|
+
type SetOperationTemplateAction = Action & {
|
|
3656
|
+
type: "SET_OPERATION_TEMPLATE";
|
|
3657
|
+
input: SetOperationTemplateInput;
|
|
3658
|
+
};
|
|
3659
|
+
type SetOperationReducerAction = Action & {
|
|
3660
|
+
type: "SET_OPERATION_REDUCER";
|
|
3661
|
+
input: SetOperationReducerInput;
|
|
3662
|
+
};
|
|
3663
|
+
type MoveOperationAction = Action & {
|
|
3664
|
+
type: "MOVE_OPERATION";
|
|
3665
|
+
input: MoveOperationInput;
|
|
3666
|
+
};
|
|
3667
|
+
type DeleteOperationAction = Action & {
|
|
3668
|
+
type: "DELETE_OPERATION";
|
|
3669
|
+
input: DeleteOperationInput;
|
|
3670
|
+
};
|
|
3671
|
+
type ReorderModuleOperationsAction = Action & {
|
|
3672
|
+
type: "REORDER_MODULE_OPERATIONS";
|
|
3673
|
+
input: ReorderModuleOperationsInput;
|
|
3674
|
+
};
|
|
3675
|
+
type DocumentModelOperationAction = AddOperationAction | SetOperationNameAction | SetOperationScopeAction | SetOperationSchemaAction | SetOperationDescriptionAction | SetOperationTemplateAction | SetOperationReducerAction | MoveOperationAction | DeleteOperationAction | ReorderModuleOperationsAction;
|
|
3676
|
+
type AddOperationErrorAction = Action & {
|
|
3677
|
+
type: "ADD_OPERATION_ERROR";
|
|
3678
|
+
input: AddOperationErrorInput;
|
|
3679
|
+
};
|
|
3680
|
+
type SetOperationErrorCodeAction = Action & {
|
|
3681
|
+
type: "SET_OPERATION_ERROR_CODE";
|
|
3682
|
+
input: SetOperationErrorCodeInput;
|
|
3683
|
+
};
|
|
3684
|
+
type SetOperationErrorNameAction = Action & {
|
|
3685
|
+
type: "SET_OPERATION_ERROR_NAME";
|
|
3686
|
+
input: SetOperationErrorNameInput;
|
|
3687
|
+
};
|
|
3688
|
+
type SetOperationErrorDescriptionAction = Action & {
|
|
3689
|
+
type: "SET_OPERATION_ERROR_DESCRIPTION";
|
|
3690
|
+
input: SetOperationErrorDescriptionInput;
|
|
3691
|
+
};
|
|
3692
|
+
type SetOperationErrorTemplateAction = Action & {
|
|
3693
|
+
type: "SET_OPERATION_ERROR_TEMPLATE";
|
|
3694
|
+
input: SetOperationErrorTemplateInput;
|
|
3695
|
+
};
|
|
3696
|
+
type DeleteOperationErrorAction = Action & {
|
|
3697
|
+
type: "DELETE_OPERATION_ERROR";
|
|
3698
|
+
input: DeleteOperationErrorInput;
|
|
3699
|
+
};
|
|
3700
|
+
type ReorderOperationErrorsAction = Action & {
|
|
3701
|
+
type: "REORDER_OPERATION_ERRORS";
|
|
3702
|
+
input: ReorderOperationErrorsInput;
|
|
3703
|
+
};
|
|
3704
|
+
type DocumentModelOperationErrorAction = AddOperationErrorAction | SetOperationErrorCodeAction | SetOperationErrorNameAction | SetOperationErrorDescriptionAction | SetOperationErrorTemplateAction | DeleteOperationErrorAction | ReorderOperationErrorsAction;
|
|
3705
|
+
type AddOperationExampleAction = Action & {
|
|
3706
|
+
type: "ADD_OPERATION_EXAMPLE";
|
|
3707
|
+
input: AddOperationExampleInput;
|
|
3708
|
+
};
|
|
3709
|
+
type UpdateOperationExampleAction = Action & {
|
|
3710
|
+
type: "UPDATE_OPERATION_EXAMPLE";
|
|
3711
|
+
input: UpdateOperationExampleInput;
|
|
3712
|
+
};
|
|
3713
|
+
type DeleteOperationExampleAction = Action & {
|
|
3714
|
+
type: "DELETE_OPERATION_EXAMPLE";
|
|
3715
|
+
input: DeleteOperationExampleInput;
|
|
3716
|
+
};
|
|
3717
|
+
type ReorderOperationExamplesAction = Action & {
|
|
3718
|
+
type: "REORDER_OPERATION_EXAMPLES";
|
|
3719
|
+
input: ReorderOperationExamplesInput;
|
|
3720
|
+
};
|
|
3721
|
+
type DocumentModelOperationExampleAction = AddOperationExampleAction | UpdateOperationExampleAction | DeleteOperationExampleAction | ReorderOperationExamplesAction;
|
|
3722
|
+
type SetStateSchemaAction = Action & {
|
|
3723
|
+
type: "SET_STATE_SCHEMA";
|
|
3724
|
+
input: SetStateSchemaInput;
|
|
3725
|
+
};
|
|
3726
|
+
type SetInitialStateAction = Action & {
|
|
3727
|
+
type: "SET_INITIAL_STATE";
|
|
3728
|
+
input: SetInitialStateInput;
|
|
3729
|
+
};
|
|
3730
|
+
type AddStateExampleAction = Action & {
|
|
3731
|
+
type: "ADD_STATE_EXAMPLE";
|
|
3732
|
+
input: AddStateExampleInput;
|
|
3733
|
+
};
|
|
3734
|
+
type UpdateStateExampleAction = Action & {
|
|
3735
|
+
type: "UPDATE_STATE_EXAMPLE";
|
|
3736
|
+
input: UpdateStateExampleInput;
|
|
3737
|
+
};
|
|
3738
|
+
type DeleteStateExampleAction = Action & {
|
|
3739
|
+
type: "DELETE_STATE_EXAMPLE";
|
|
3740
|
+
input: DeleteStateExampleInput;
|
|
3741
|
+
};
|
|
3742
|
+
type ReorderStateExamplesAction = Action & {
|
|
3743
|
+
type: "REORDER_STATE_EXAMPLES";
|
|
3744
|
+
input: ReorderStateExamplesInput;
|
|
3745
|
+
};
|
|
3746
|
+
type DocumentModelStateAction = SetStateSchemaAction | SetInitialStateAction | AddStateExampleAction | UpdateStateExampleAction | DeleteStateExampleAction | ReorderStateExamplesAction;
|
|
3747
|
+
type AddChangeLogItemAction = Action & {
|
|
3748
|
+
type: "ADD_CHANGE_LOG_ITEM";
|
|
3749
|
+
input: AddChangeLogItemInput;
|
|
3750
|
+
};
|
|
3751
|
+
type UpdateChangeLogItemAction = Action & {
|
|
3752
|
+
type: "UPDATE_CHANGE_LOG_ITEM";
|
|
3753
|
+
input: UpdateChangeLogItemInput;
|
|
3754
|
+
};
|
|
3755
|
+
type DeleteChangeLogItemAction = Action & {
|
|
3756
|
+
type: "DELETE_CHANGE_LOG_ITEM";
|
|
3757
|
+
input: DeleteChangeLogItemInput;
|
|
3758
|
+
};
|
|
3759
|
+
type ReorderChangeLogItemsAction = Action & {
|
|
3760
|
+
type: "REORDER_CHANGE_LOG_ITEMS";
|
|
3761
|
+
input: ReorderChangeLogItemsInput;
|
|
3762
|
+
};
|
|
3763
|
+
type ReleaseNewVersionAction = Action & {
|
|
3764
|
+
type: "RELEASE_NEW_VERSION";
|
|
3765
|
+
input: {};
|
|
3766
|
+
};
|
|
3767
|
+
type DocumentModelVersioningAction = AddChangeLogItemAction | UpdateChangeLogItemAction | DeleteChangeLogItemAction | ReorderChangeLogItemsAction | ReleaseNewVersionAction;
|
|
3768
|
+
interface DocumentModelHeaderOperations {
|
|
3769
|
+
setModelNameOperation: (state: DocumentModelGlobalState, action: SetModelNameAction) => void;
|
|
3770
|
+
setModelIdOperation: (state: DocumentModelGlobalState, action: SetModelIdAction) => void;
|
|
3771
|
+
setModelExtensionOperation: (state: DocumentModelGlobalState, action: SetModelExtensionAction) => void;
|
|
3772
|
+
setModelDescriptionOperation: (state: DocumentModelGlobalState, action: SetModelDescriptionAction) => void;
|
|
3773
|
+
setAuthorNameOperation: (state: DocumentModelGlobalState, action: SetAuthorNameAction) => void;
|
|
3774
|
+
setAuthorWebsiteOperation: (state: DocumentModelGlobalState, action: SetAuthorWebsiteAction) => void;
|
|
3775
|
+
}
|
|
3776
|
+
interface DocumentModelModuleOperations {
|
|
3777
|
+
addModuleOperation: (state: DocumentModelGlobalState, action: AddModuleAction) => void;
|
|
3778
|
+
setModuleNameOperation: (state: DocumentModelGlobalState, action: SetModuleNameAction) => void;
|
|
3779
|
+
setModuleDescriptionOperation: (state: DocumentModelGlobalState, action: SetModuleDescriptionAction) => void;
|
|
3780
|
+
deleteModuleOperation: (state: DocumentModelGlobalState, action: DeleteModuleAction) => void;
|
|
3781
|
+
reorderModulesOperation: (state: DocumentModelGlobalState, action: ReorderModulesAction) => void;
|
|
3782
|
+
}
|
|
3783
|
+
type DocumentModelOperationOperations = {
|
|
3784
|
+
addOperationOperation: (state: DocumentModelGlobalState, action: AddOperationAction) => void;
|
|
3785
|
+
setOperationNameOperation: (state: DocumentModelGlobalState, action: SetOperationNameAction) => void;
|
|
3786
|
+
setOperationScopeOperation: (state: DocumentModelGlobalState, action: SetOperationScopeAction) => void;
|
|
3787
|
+
setOperationSchemaOperation: (state: DocumentModelGlobalState, action: SetOperationSchemaAction) => void;
|
|
3788
|
+
setOperationDescriptionOperation: (state: DocumentModelGlobalState, action: SetOperationDescriptionAction) => void;
|
|
3789
|
+
setOperationTemplateOperation: (state: DocumentModelGlobalState, action: SetOperationTemplateAction) => void;
|
|
3790
|
+
setOperationReducerOperation: (state: DocumentModelGlobalState, action: SetOperationReducerAction) => void;
|
|
3791
|
+
moveOperationOperation: (state: DocumentModelGlobalState, action: MoveOperationAction) => void;
|
|
3792
|
+
deleteOperationOperation: (state: DocumentModelGlobalState, action: DeleteOperationAction) => void;
|
|
3793
|
+
reorderModuleOperationsOperation: (state: DocumentModelGlobalState, action: ReorderModuleOperationsAction) => void;
|
|
3794
|
+
};
|
|
3795
|
+
interface DocumentModelOperationErrorOperations {
|
|
3796
|
+
addOperationErrorOperation: (state: DocumentModelGlobalState, action: AddOperationErrorAction) => void;
|
|
3797
|
+
setOperationErrorCodeOperation: (state: DocumentModelGlobalState, action: SetOperationErrorCodeAction) => void;
|
|
3798
|
+
setOperationErrorNameOperation: (state: DocumentModelGlobalState, action: SetOperationErrorNameAction) => void;
|
|
3799
|
+
setOperationErrorDescriptionOperation: (state: DocumentModelGlobalState, action: SetOperationErrorDescriptionAction) => void;
|
|
3800
|
+
setOperationErrorTemplateOperation: (state: DocumentModelGlobalState, action: SetOperationErrorTemplateAction) => void;
|
|
3801
|
+
deleteOperationErrorOperation: (state: DocumentModelGlobalState, action: DeleteOperationErrorAction) => void;
|
|
3802
|
+
reorderOperationErrorsOperation: (state: DocumentModelGlobalState, action: ReorderOperationErrorsAction) => void;
|
|
3803
|
+
}
|
|
3804
|
+
interface DocumentModelOperationExampleOperations {
|
|
3805
|
+
addOperationExampleOperation: (state: DocumentModelGlobalState, action: AddOperationExampleAction) => void;
|
|
3806
|
+
updateOperationExampleOperation: (state: DocumentModelGlobalState, action: UpdateOperationExampleAction) => void;
|
|
3807
|
+
deleteOperationExampleOperation: (state: DocumentModelGlobalState, action: DeleteOperationExampleAction) => void;
|
|
3808
|
+
reorderOperationExamplesOperation: (state: DocumentModelGlobalState, action: ReorderOperationExamplesAction) => void;
|
|
3809
|
+
}
|
|
3810
|
+
interface DocumentModelStateOperations {
|
|
3811
|
+
setStateSchemaOperation: (state: DocumentModelGlobalState, action: SetStateSchemaAction) => void;
|
|
3812
|
+
setInitialStateOperation: (state: DocumentModelGlobalState, action: SetInitialStateAction) => void;
|
|
3813
|
+
addStateExampleOperation: (state: DocumentModelGlobalState, action: AddStateExampleAction) => void;
|
|
3814
|
+
updateStateExampleOperation: (state: DocumentModelGlobalState, action: UpdateStateExampleAction) => void;
|
|
3815
|
+
deleteStateExampleOperation: (state: DocumentModelGlobalState, action: DeleteStateExampleAction) => void;
|
|
3816
|
+
reorderStateExamplesOperation: (state: DocumentModelGlobalState, action: ReorderStateExamplesAction) => void;
|
|
3817
|
+
}
|
|
3818
|
+
interface DocumentModelVersioningOperations {
|
|
3819
|
+
addChangeLogItemOperation: (state: DocumentModelGlobalState, action: AddChangeLogItemAction) => void;
|
|
3820
|
+
updateChangeLogItemOperation: (state: DocumentModelGlobalState, action: UpdateChangeLogItemAction) => void;
|
|
3821
|
+
deleteChangeLogItemOperation: (state: DocumentModelGlobalState, action: DeleteChangeLogItemAction) => void;
|
|
3822
|
+
reorderChangeLogItemsOperation: (state: DocumentModelGlobalState, action: ReorderChangeLogItemsAction) => void;
|
|
3823
|
+
releaseNewVersionOperation: (state: DocumentModelGlobalState, action: ReleaseNewVersionAction) => void;
|
|
3824
|
+
}
|
|
3825
|
+
type Maybe<T> = T | null;
|
|
3826
|
+
type InputMaybe<T> = T | null | undefined;
|
|
3827
|
+
type Exact<T extends Record<string, unknown>> = { [K in keyof T]: T[K]; };
|
|
3828
|
+
type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]>; };
|
|
3829
|
+
type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]>; };
|
|
3830
|
+
type MakeEmpty<T extends Record<string, unknown>, K extends keyof T> = { [_ in K]?: never; };
|
|
3831
|
+
type Incremental<T> = T | { [P in keyof T]?: P extends " $fragmentName" | "__typename" ? T[P] : never; };
|
|
3832
|
+
/** All built-in and custom scalars, mapped to their actual values */
|
|
3833
|
+
type Scalars = {
|
|
3834
|
+
ID: {
|
|
3835
|
+
input: string;
|
|
3836
|
+
output: string;
|
|
3837
|
+
};
|
|
3838
|
+
String: {
|
|
3839
|
+
input: string;
|
|
3840
|
+
output: string;
|
|
3841
|
+
};
|
|
3842
|
+
Boolean: {
|
|
3843
|
+
input: boolean;
|
|
3844
|
+
output: boolean;
|
|
3845
|
+
};
|
|
3846
|
+
Int: {
|
|
3847
|
+
input: number;
|
|
3848
|
+
output: number;
|
|
3849
|
+
};
|
|
3850
|
+
Float: {
|
|
3851
|
+
input: number;
|
|
3852
|
+
output: number;
|
|
3853
|
+
};
|
|
3854
|
+
Address: {
|
|
3855
|
+
input: `${string}:0x${string}`;
|
|
3856
|
+
output: `${string}:0x${string}`;
|
|
3857
|
+
};
|
|
3858
|
+
AttachmentRef: {
|
|
3859
|
+
input: `attachment://v${number}:${string}`;
|
|
3860
|
+
output: `attachment://v${number}:${string}`;
|
|
3861
|
+
};
|
|
3862
|
+
DateTime: {
|
|
3863
|
+
input: string;
|
|
3864
|
+
output: string;
|
|
3865
|
+
};
|
|
3866
|
+
Unknown: {
|
|
3867
|
+
input: unknown;
|
|
3868
|
+
output: unknown;
|
|
3869
|
+
};
|
|
3870
|
+
};
|
|
3871
|
+
type ID = string;
|
|
3872
|
+
type OperationsByScope = Partial<Record<string, Operation[]>>;
|
|
3873
|
+
type SkipHeaderOperationIndex = Partial<Pick<OperationIndex, "index">> & Pick<OperationIndex, "skip">;
|
|
3874
|
+
type UndoRedoAction = SchemaRedoAction | SchemaUndoAction;
|
|
3875
|
+
type IAction = {
|
|
3876
|
+
type: Scalars["String"]["output"];
|
|
3877
|
+
};
|
|
3878
|
+
type IDocument = {
|
|
3879
|
+
created: Scalars["DateTime"]["output"];
|
|
3880
|
+
documentType: Scalars["String"]["output"];
|
|
3881
|
+
lastModified: Scalars["DateTime"]["output"];
|
|
3882
|
+
name: Scalars["String"]["output"];
|
|
3883
|
+
operations: Array<IOperation>;
|
|
3884
|
+
revision: Scalars["Int"]["output"];
|
|
3885
|
+
};
|
|
3886
|
+
type IOperation = {
|
|
3887
|
+
hash: Scalars["String"]["output"];
|
|
3888
|
+
index: Scalars["Int"]["output"];
|
|
3889
|
+
timestampUtcMs: Scalars["DateTime"]["output"];
|
|
3890
|
+
type: Scalars["String"]["output"];
|
|
3891
|
+
};
|
|
3892
|
+
type MutationRedoArgs = {
|
|
3893
|
+
input: SchemaRedoAction;
|
|
3894
|
+
};
|
|
3895
|
+
type MutationSetNameArgs = {
|
|
3896
|
+
input: SchemaSetNameAction;
|
|
3897
|
+
};
|
|
3898
|
+
type MutationUndoArgs = {
|
|
3899
|
+
input: SchemaUndoAction;
|
|
3900
|
+
};
|
|
3901
|
+
type Query = {
|
|
3902
|
+
__typename?: "Query";
|
|
3903
|
+
document: Maybe<IDocument>;
|
|
3904
|
+
};
|
|
3905
|
+
type Redo = "REDO";
|
|
3906
|
+
type RedoActionInput = {
|
|
3907
|
+
count: Scalars["Int"]["input"];
|
|
3908
|
+
};
|
|
3909
|
+
type SchemaRedoAction = {
|
|
3910
|
+
id: Scalars["String"]["output"];
|
|
3911
|
+
timestampUtcMs: Scalars["DateTime"]["output"];
|
|
3912
|
+
input: RedoActionInput;
|
|
3913
|
+
type: Redo;
|
|
3914
|
+
scope: string;
|
|
3915
|
+
};
|
|
3916
|
+
type Set_Name = "SET_NAME";
|
|
3917
|
+
type SetNameActionInput = {
|
|
3918
|
+
name: Scalars["String"]["input"];
|
|
3919
|
+
};
|
|
3920
|
+
type SchemaSetNameAction = {
|
|
3921
|
+
id: Scalars["String"]["output"];
|
|
3922
|
+
timestampUtcMs: Scalars["DateTime"]["output"];
|
|
3923
|
+
input: SetNameActionInput;
|
|
3924
|
+
type: Set_Name;
|
|
3925
|
+
scope: "global";
|
|
3926
|
+
};
|
|
3927
|
+
type SetNameOperation = IOperation & {
|
|
3928
|
+
__typename?: "SetNameOperation";
|
|
3929
|
+
hash: Scalars["String"]["output"];
|
|
3930
|
+
index: Scalars["Int"]["output"];
|
|
3931
|
+
input: Scalars["String"]["output"];
|
|
3932
|
+
timestamp: Scalars["DateTime"]["output"];
|
|
3933
|
+
type: Scalars["String"]["output"];
|
|
3934
|
+
};
|
|
3935
|
+
type Set_PreferredEditor = "SET_PREFERRED_EDITOR";
|
|
3936
|
+
type SetPreferredEditorActionInput = {
|
|
3937
|
+
preferredEditor: Scalars["String"]["input"] | null;
|
|
3938
|
+
};
|
|
3939
|
+
type SchemaSetPreferredEditorAction = {
|
|
3940
|
+
id: Scalars["String"]["output"];
|
|
3941
|
+
timestampUtcMs: Scalars["DateTime"]["output"];
|
|
3942
|
+
input: SetPreferredEditorActionInput;
|
|
3943
|
+
type: Set_PreferredEditor;
|
|
3944
|
+
scope: "header";
|
|
3945
|
+
};
|
|
3946
|
+
type SetPreferredEditorOperation = IOperation & {
|
|
3947
|
+
__typename?: "SetPreferredEditorOperation";
|
|
3948
|
+
hash: Scalars["String"]["output"];
|
|
3949
|
+
index: Scalars["Int"]["output"];
|
|
3950
|
+
input: SetPreferredEditorActionInput;
|
|
3951
|
+
timestamp: Scalars["DateTime"]["output"];
|
|
3952
|
+
type: Scalars["String"]["output"];
|
|
3953
|
+
};
|
|
3954
|
+
type Undo = "UNDO";
|
|
3955
|
+
type UndoActionInput = {
|
|
3956
|
+
count: Scalars["Int"]["input"];
|
|
3957
|
+
};
|
|
3958
|
+
type SchemaUndoAction = {
|
|
3959
|
+
id: Scalars["String"]["output"];
|
|
3960
|
+
timestampUtcMs: Scalars["DateTime"]["output"];
|
|
3961
|
+
input: UndoActionInput;
|
|
3962
|
+
type: Undo;
|
|
3963
|
+
scope: string;
|
|
3964
|
+
};
|
|
3965
|
+
type SchemaNOOPAction = {
|
|
3966
|
+
id: Scalars["String"]["output"];
|
|
3967
|
+
input: Scalars["Unknown"]["input"];
|
|
3968
|
+
scope: string;
|
|
3969
|
+
timestampUtcMs: Scalars["DateTime"]["output"];
|
|
3970
|
+
type: "NOOP";
|
|
3971
|
+
};
|
|
3972
|
+
type RedoAction = Action & {
|
|
3973
|
+
type: "REDO";
|
|
3974
|
+
input: SchemaRedoAction["input"];
|
|
3975
|
+
};
|
|
3976
|
+
type SetNameAction = Action & {
|
|
3977
|
+
type: "SET_NAME";
|
|
3978
|
+
input: SchemaSetNameAction["input"];
|
|
3979
|
+
};
|
|
3980
|
+
type SetPreferredEditorAction = Action & {
|
|
3981
|
+
type: "SET_PREFERRED_EDITOR";
|
|
3982
|
+
input: SchemaSetPreferredEditorAction["input"];
|
|
3983
|
+
};
|
|
3984
|
+
type UndoAction = Action & {
|
|
3985
|
+
type: "UNDO";
|
|
3986
|
+
input: SchemaUndoAction["input"];
|
|
3987
|
+
};
|
|
3988
|
+
type NOOPAction = Action & {
|
|
3989
|
+
type: "NOOP";
|
|
3990
|
+
input: SchemaNOOPAction["input"];
|
|
3991
|
+
};
|
|
3992
|
+
type CreateDocumentActionInput = {
|
|
3993
|
+
model: string;
|
|
3994
|
+
version: 0;
|
|
3995
|
+
documentId: string;
|
|
3996
|
+
signing?: {
|
|
3997
|
+
signature: string;
|
|
3998
|
+
publicKey: JsonWebKey;
|
|
3999
|
+
nonce: string;
|
|
4000
|
+
createdAtUtcIso: string;
|
|
4001
|
+
documentType: string;
|
|
4002
|
+
};
|
|
4003
|
+
slug?: string;
|
|
4004
|
+
name?: string;
|
|
4005
|
+
branch?: string;
|
|
4006
|
+
meta?: Record<string, unknown>;
|
|
4007
|
+
protocolVersions?: {
|
|
4008
|
+
[key: string]: number;
|
|
4009
|
+
};
|
|
4010
|
+
};
|
|
4011
|
+
type UpgradeDocumentActionInput = {
|
|
4012
|
+
model: string;
|
|
4013
|
+
fromVersion: number;
|
|
4014
|
+
toVersion: number;
|
|
4015
|
+
documentId: string;
|
|
4016
|
+
initialState?: object;
|
|
4017
|
+
/**
|
|
4018
|
+
* Per-scope next-operation-index snapshot at the moment the upgrade executes.
|
|
4019
|
+
* Absent on legacy operations; loaders fall back to timestamp ordering when missing.
|
|
4020
|
+
* Stamped CLIENT-SIDE at action creation (before signing), NEVER at execution.
|
|
4021
|
+
*/
|
|
4022
|
+
revision?: Record<string, number>;
|
|
4023
|
+
};
|
|
4024
|
+
type DeleteDocumentActionInput = {
|
|
4025
|
+
documentId: string;
|
|
4026
|
+
propagate?: "none" | "cascade";
|
|
4027
|
+
};
|
|
4028
|
+
type PurgeDocumentActionInput = {
|
|
4029
|
+
documentId: string;
|
|
4030
|
+
documentType: string;
|
|
4031
|
+
/** The same instant as the action's timestampUtcMs. */
|
|
4032
|
+
purgedAtUtcIso: string;
|
|
4033
|
+
requestId: string;
|
|
4034
|
+
};
|
|
4035
|
+
type AddRelationshipActionInput = {
|
|
4036
|
+
sourceId: string;
|
|
4037
|
+
targetId: string;
|
|
4038
|
+
relationshipType: string;
|
|
4039
|
+
metadata?: Record<string, unknown>;
|
|
4040
|
+
};
|
|
4041
|
+
type RemoveRelationshipActionInput = {
|
|
4042
|
+
sourceId: string;
|
|
4043
|
+
targetId: string;
|
|
4044
|
+
relationshipType: string;
|
|
4045
|
+
};
|
|
4046
|
+
type UpdateRelationshipActionInput = {
|
|
4047
|
+
sourceId: string;
|
|
4048
|
+
targetId: string;
|
|
4049
|
+
relationshipType: string;
|
|
4050
|
+
metadata: Record<string, unknown> | null;
|
|
4051
|
+
};
|
|
4052
|
+
type CreateDocumentAction = Action & {
|
|
4053
|
+
type: "CREATE_DOCUMENT";
|
|
4054
|
+
input: CreateDocumentActionInput;
|
|
4055
|
+
};
|
|
4056
|
+
type UpgradeDocumentAction = Action & {
|
|
4057
|
+
type: "UPGRADE_DOCUMENT";
|
|
4058
|
+
input: UpgradeDocumentActionInput;
|
|
4059
|
+
};
|
|
4060
|
+
type DeleteDocumentAction = Action & {
|
|
4061
|
+
type: "DELETE_DOCUMENT";
|
|
4062
|
+
input: DeleteDocumentActionInput;
|
|
4063
|
+
};
|
|
4064
|
+
/** Reserved document-scope marker; a purged document's only operation. */
|
|
4065
|
+
type PurgeDocumentAction = Action & {
|
|
4066
|
+
type: "PURGE_DOCUMENT";
|
|
4067
|
+
scope: "document";
|
|
4068
|
+
input: PurgeDocumentActionInput;
|
|
4069
|
+
};
|
|
4070
|
+
type AddRelationshipAction = Action & {
|
|
4071
|
+
type: "ADD_RELATIONSHIP";
|
|
4072
|
+
input: AddRelationshipActionInput;
|
|
4073
|
+
};
|
|
4074
|
+
type RemoveRelationshipAction = Action & {
|
|
4075
|
+
type: "REMOVE_RELATIONSHIP";
|
|
4076
|
+
input: RemoveRelationshipActionInput;
|
|
4077
|
+
};
|
|
4078
|
+
type UpdateRelationshipAction = Action & {
|
|
4079
|
+
type: "UPDATE_RELATIONSHIP";
|
|
4080
|
+
input: UpdateRelationshipActionInput;
|
|
4081
|
+
};
|
|
4082
|
+
type DocumentAction = RedoAction | SetNameAction | SetPreferredEditorAction | UndoAction | NOOPAction;
|
|
4083
|
+
interface ISignal<TType extends string, TInput> {
|
|
4084
|
+
type: TType;
|
|
4085
|
+
input: TInput;
|
|
4086
|
+
}
|
|
4087
|
+
type ISignalResult<TTYpe, TInput, TResult> = {
|
|
4088
|
+
signal: {
|
|
4089
|
+
type: TTYpe;
|
|
4090
|
+
input: TInput;
|
|
4091
|
+
};
|
|
4092
|
+
result: TResult;
|
|
4093
|
+
};
|
|
4094
|
+
type CreateChildDocumentInput = {
|
|
4095
|
+
id: string;
|
|
4096
|
+
documentType: string;
|
|
4097
|
+
};
|
|
4098
|
+
type CreateChildDocumentSignal = ISignal<"CREATE_CHILD_DOCUMENT", CreateChildDocumentInput>;
|
|
4099
|
+
type DeleteChildDocumentInput = {
|
|
4100
|
+
id: string;
|
|
4101
|
+
};
|
|
4102
|
+
type DeleteChildDocumentSignal = ISignal<"DELETE_CHILD_DOCUMENT", DeleteChildDocumentInput>;
|
|
4103
|
+
type CopyChildDocumentInput = {
|
|
4104
|
+
id: string;
|
|
4105
|
+
newId: string;
|
|
4106
|
+
};
|
|
4107
|
+
type CopyChildDocumentSignal = ISignal<"COPY_CHILD_DOCUMENT", CopyChildDocumentInput>;
|
|
4108
|
+
type Signal = CreateChildDocumentSignal | CopyChildDocumentSignal | DeleteChildDocumentSignal;
|
|
4109
|
+
type SignalDispatch = (signal: Signal) => void;
|
|
4110
|
+
type SignalResult = ISignalResult<CreateChildDocumentSignal["type"], CreateChildDocumentSignal["input"], PHDocument$1> | ISignalResult<CopyChildDocumentSignal["type"], CopyChildDocumentSignal["input"], boolean> | ISignalResult<DeleteChildDocumentSignal["type"], DeleteChildDocumentSignal["input"], PHDocument$1>;
|
|
4111
|
+
type SignalResults = {
|
|
4112
|
+
CREATE_CHILD_DOCUMENT: PHDocument$1;
|
|
4113
|
+
COPY_CHILD_DOCUMENT: PHDocument$1;
|
|
4114
|
+
DELETE_CHILD_DOCUMENT: boolean;
|
|
4115
|
+
};
|
|
4116
|
+
type SignalType<T extends Signal> = T["type"];
|
|
4117
|
+
type FileInput = string | number[] | Uint8Array | ArrayBuffer | Blob;
|
|
4118
|
+
type ReducerOptions = {
|
|
4119
|
+
/** The number of operations to skip before this new action is applied. This overrides the skip count in the operation. */
|
|
4120
|
+
skip?: number;
|
|
4121
|
+
/** When true the skip count is ignored and the action is applied regardless of the skip count */
|
|
4122
|
+
ignoreSkipOperations?: boolean;
|
|
4123
|
+
/** if true reuses the provided action resulting state instead of replaying it */
|
|
4124
|
+
reuseOperationResultingState?: boolean;
|
|
4125
|
+
/** if true checks the hashes of the operations */
|
|
4126
|
+
checkHashes?: boolean;
|
|
4127
|
+
/** Options for performing a replay. */
|
|
4128
|
+
replayOptions?: {
|
|
4129
|
+
/** The previously created operation to verify against. */
|
|
4130
|
+
operation: Operation;
|
|
4131
|
+
};
|
|
4132
|
+
/** Optional parser for the operation resulting state, uses JSON.parse by default */
|
|
4133
|
+
operationResultingStateParser?: <TState>(state: string | null | undefined) => TState;
|
|
4134
|
+
/**
|
|
4135
|
+
* When true (default), the reducer will prune operations (garbage collect) when processing a skip.
|
|
4136
|
+
* When false, it will recompute state for the skip but preserve the existing operations history.
|
|
4137
|
+
*/
|
|
4138
|
+
pruneOnSkip?: boolean;
|
|
4139
|
+
/** The branch being operated on. Defaults to "main". */
|
|
4140
|
+
branch?: string;
|
|
4141
|
+
/**
|
|
4142
|
+
* Protocol version controlling undo/redo behavior.
|
|
4143
|
+
* - Version 1 (default): Legacy behavior with index reuse
|
|
4144
|
+
* - Version 2: Reactor behavior with monotonic indices
|
|
4145
|
+
*/
|
|
4146
|
+
protocolVersion?: number;
|
|
4147
|
+
/**
|
|
4148
|
+
* When true, skip index contiguity validation during replay.
|
|
4149
|
+
* Used for V2 state rebuild where gapped indices are expected.
|
|
4150
|
+
*/
|
|
4151
|
+
skipIndexValidation?: boolean;
|
|
4152
|
+
};
|
|
4153
|
+
/**
|
|
4154
|
+
* A pure function that takes an action and the previous state
|
|
4155
|
+
* of the document and returns the new state.
|
|
4156
|
+
*/
|
|
4157
|
+
type Reducer<TState extends PHBaseState = PHBaseState> = (document: PHDocument$1<TState>, action: Action, dispatch?: SignalDispatch, options?: ReducerOptions) => PHDocument$1<TState>;
|
|
4158
|
+
type StateReducer<TState extends PHBaseState = PHBaseState> = (state: Draft<TState>, action: Action, dispatch?: SignalDispatch) => TState | undefined;
|
|
4159
|
+
type MappedOperation = {
|
|
4160
|
+
ignore: boolean;
|
|
4161
|
+
operation: Operation;
|
|
4162
|
+
};
|
|
4163
|
+
type DocumentOperationsIgnoreMap = Record<string, MappedOperation[]>;
|
|
4164
|
+
type ActionSignatureContext = {
|
|
4165
|
+
documentId: string;
|
|
4166
|
+
signer: ActionSigner;
|
|
4167
|
+
action: Action;
|
|
4168
|
+
previousStateHash: string;
|
|
4169
|
+
};
|
|
4170
|
+
type ActionSigningHandler = (message: Uint8Array) => Promise<Uint8Array>;
|
|
4171
|
+
type ActionVerificationHandler = (publicKey: string, signature: Uint8Array, data: Uint8Array) => Promise<boolean>;
|
|
4172
|
+
/**
|
|
4173
|
+
* Handler for verifying operation signatures.
|
|
4174
|
+
*
|
|
4175
|
+
* @param operation - The operation to verify
|
|
4176
|
+
* @param publicKey - The public key to verify against (from signer.app.key)
|
|
4177
|
+
* @returns Promise that resolves to true if signature is valid, false otherwise
|
|
4178
|
+
*/
|
|
4179
|
+
type SignatureVerificationHandler = (operation: Operation, publicKey: string) => Promise<boolean>;
|
|
4180
|
+
type ENSInfo = {
|
|
4181
|
+
name?: string;
|
|
4182
|
+
avatarUrl?: string;
|
|
4183
|
+
};
|
|
4184
|
+
type User = {
|
|
4185
|
+
address: `0x${string}`;
|
|
4186
|
+
networkId: string;
|
|
4187
|
+
chainId: number;
|
|
4188
|
+
ens?: ENSInfo;
|
|
4189
|
+
};
|
|
4190
|
+
type PartialRecord<K extends keyof any, T> = { [P in K]?: T; };
|
|
4191
|
+
type RevisionsFilter = PartialRecord<string, number>;
|
|
4192
|
+
type GetDocumentOptions = ReducerOptions & {
|
|
4193
|
+
revisions?: RevisionsFilter;
|
|
4194
|
+
checkHashes?: boolean;
|
|
4195
|
+
};
|
|
4196
|
+
type ActionErrorCallback = (error: unknown) => void;
|
|
4197
|
+
type EditorDispatch = (action: Action, onErrorCallback?: ActionErrorCallback) => void;
|
|
4198
|
+
type EditorBaseProps = {
|
|
4199
|
+
children?: ReactNode;
|
|
4200
|
+
className?: string;
|
|
4201
|
+
};
|
|
4202
|
+
/** `EditorProps<MyDocument, MyAction>`: the document and dispatch a host passes
|
|
4203
|
+
* an editor. Bare `EditorProps` leaves them optional, as before. */
|
|
4204
|
+
type EditorProps<TDocument extends PHDocument$1 = never, TAction extends Action = Action> = [TDocument] extends [never] ? EditorBaseProps & {
|
|
4205
|
+
document?: PHDocument$1;
|
|
4206
|
+
dispatch?: DocumentDispatch;
|
|
4207
|
+
} : EditorBaseProps & {
|
|
4208
|
+
document: TDocument;
|
|
4209
|
+
dispatch: DocumentDispatch<TAction>;
|
|
4210
|
+
};
|
|
4211
|
+
type SubgraphModule = {
|
|
4212
|
+
id: string;
|
|
4213
|
+
name: string;
|
|
4214
|
+
gql: string;
|
|
4215
|
+
endpoint: string;
|
|
4216
|
+
};
|
|
4217
|
+
/** What hosts pass an editor besides `document` and `dispatch`. */
|
|
4218
|
+
type HostedEditorProps = {
|
|
4219
|
+
documentId?: string;
|
|
4220
|
+
context?: {
|
|
4221
|
+
readMode?: boolean;
|
|
4222
|
+
selectedTimelineRevision?: number;
|
|
4223
|
+
};
|
|
4224
|
+
displayToolbar?: boolean;
|
|
4225
|
+
};
|
|
4226
|
+
/** Hosts render `Component` with `document` and `dispatch`. */
|
|
4227
|
+
type EditorModule<TDocument extends PHDocument$1 = any, TAction extends Action = any, TProps = HostedEditorProps> = {
|
|
4228
|
+
Component: FC<EditorProps<TDocument, TAction> & TProps>;
|
|
4229
|
+
documentTypes: string[];
|
|
4230
|
+
config: {
|
|
4231
|
+
id: string;
|
|
4232
|
+
name: string;
|
|
4233
|
+
};
|
|
4234
|
+
};
|
|
4235
|
+
type ValidationError = {
|
|
4236
|
+
message: string;
|
|
4237
|
+
details: object;
|
|
4238
|
+
};
|
|
4239
|
+
type SkipHeaderOperations = Partial<Record<string, number>>;
|
|
4240
|
+
type ReplayDocumentOptions = {
|
|
4241
|
+
checkHashes?: boolean;
|
|
4242
|
+
reuseOperationResultingState?: boolean;
|
|
4243
|
+
operationResultingStateParser?: <TState>(state: string) => TState;
|
|
4244
|
+
skipIndexValidation?: boolean;
|
|
4245
|
+
};
|
|
4246
|
+
type OperationIndex = {
|
|
4247
|
+
index: number;
|
|
4248
|
+
skip: number;
|
|
4249
|
+
id?: string;
|
|
4250
|
+
timestampUtcMs?: string;
|
|
4251
|
+
};
|
|
4252
|
+
/**
|
|
4253
|
+
* Parameters used in a document signature.
|
|
4254
|
+
*/
|
|
4255
|
+
type SigningParameters = {
|
|
4256
|
+
documentType: string;
|
|
4257
|
+
createdAtUtcIso: string;
|
|
4258
|
+
/**
|
|
4259
|
+
* The nonce can act as both a salt and a typical nonce.
|
|
4260
|
+
*/
|
|
4261
|
+
nonce: string;
|
|
4262
|
+
};
|
|
4263
|
+
/**
|
|
4264
|
+
* Describes a signer that can sign both document headers and actions.
|
|
4265
|
+
*/
|
|
4266
|
+
interface ISigner {
|
|
4267
|
+
/** The user associated with the signer */
|
|
4268
|
+
user?: UserActionSigner;
|
|
4269
|
+
/** The app associated with the signer */
|
|
4270
|
+
app?: AppActionSigner;
|
|
4271
|
+
/** The corresponding public key */
|
|
4272
|
+
publicKey: CryptoKey;
|
|
4273
|
+
/**
|
|
4274
|
+
* Signs raw data (used for document header signing).
|
|
4275
|
+
*
|
|
4276
|
+
* @param data - The data to sign.
|
|
4277
|
+
* @returns The signature of the data.
|
|
4278
|
+
*/
|
|
4279
|
+
sign: (data: Uint8Array) => Promise<Uint8Array>;
|
|
4280
|
+
/**
|
|
4281
|
+
* Verifies a signature.
|
|
4282
|
+
*
|
|
4283
|
+
* @param data - The data to verify.
|
|
4284
|
+
* @param signature - The signature to verify.
|
|
4285
|
+
*/
|
|
4286
|
+
verify: (data: Uint8Array, signature: Uint8Array) => Promise<void>;
|
|
4287
|
+
/**
|
|
4288
|
+
* Signs an action for the log it is written to.
|
|
4289
|
+
*
|
|
4290
|
+
* @param action - The action to sign.
|
|
4291
|
+
* @param target - The document and branch whose log stores the action.
|
|
4292
|
+
* @param abortSignal - Optional abort signal to cancel the signing.
|
|
4293
|
+
* @returns The signature tuple.
|
|
4294
|
+
*/
|
|
4295
|
+
signAction: (action: Action, target: ActionSigningTarget, abortSignal?: AbortSignal) => Promise<Signature>;
|
|
4296
|
+
}
|
|
4297
|
+
type IsStateOfType<TState> = (state: unknown) => state is TState;
|
|
4298
|
+
type AssertIsStateOfType<TState> = (state: unknown) => asserts state is TState;
|
|
4299
|
+
type IsDocumentOfType<TState extends PHBaseState> = (document: unknown) => document is PHDocument$1<TState>;
|
|
4300
|
+
type AssertIsDocumentOfType<TState extends PHBaseState> = (document: unknown) => asserts document is PHDocument$1<TState>;
|
|
4301
|
+
type PartialState<TState> = TState | Partial<TState>;
|
|
4302
|
+
type CreateState<TState extends PHBaseState = PHBaseState> = (state?: PartialState<TState>) => TState;
|
|
4303
|
+
type SaveToFileHandle = (document: PHDocument$1, input: FileSystemFileHandle) => void | Promise<void>;
|
|
4304
|
+
type SaveToFile = (document: PHDocument$1, path: string, name?: string) => string | Promise<string>;
|
|
4305
|
+
type LoadFromInput<TState extends PHBaseState = PHBaseState> = (input: FileInput) => PHDocument$1<TState> | Promise<PHDocument$1<TState>>;
|
|
4306
|
+
type LoadFromFile<TState extends PHBaseState = PHBaseState> = (path: string) => PHDocument$1<TState> | Promise<PHDocument$1<TState>>;
|
|
4307
|
+
type CreateDocument<TState extends PHBaseState = PHBaseState> = (initialState?: Partial<TState>, createState?: CreateState<TState>) => PHDocument$1<TState>;
|
|
4308
|
+
type MinimalBackupData = {
|
|
4309
|
+
documentId: string;
|
|
4310
|
+
documentType: string;
|
|
4311
|
+
branch: string;
|
|
4312
|
+
state: PHBaseState;
|
|
4313
|
+
name: string;
|
|
4314
|
+
protocolVersions?: {
|
|
4315
|
+
[key: string]: number;
|
|
4316
|
+
};
|
|
4317
|
+
};
|
|
4318
|
+
type DocumentModelUtils<TState extends PHBaseState = PHBaseState> = {
|
|
4319
|
+
fileExtension: string;
|
|
4320
|
+
createState: CreateState<TState>;
|
|
4321
|
+
createDocument: CreateDocument<TState>;
|
|
4322
|
+
loadFromInput: LoadFromInput<TState>;
|
|
4323
|
+
saveToFileHandle: SaveToFileHandle;
|
|
4324
|
+
isStateOfType: IsStateOfType<TState>;
|
|
4325
|
+
assertIsStateOfType: AssertIsStateOfType<TState>;
|
|
4326
|
+
isDocumentOfType: IsDocumentOfType<TState>;
|
|
4327
|
+
assertIsDocumentOfType: AssertIsDocumentOfType<TState>;
|
|
4328
|
+
};
|
|
4329
|
+
type Actions = Record<string, (...args: any[]) => Action>;
|
|
4330
|
+
/** MCP-compatible annotation hints; structural, no MCP SDK dependency. */
|
|
4331
|
+
type PhAiToolAnnotations = {
|
|
4332
|
+
title?: string;
|
|
4333
|
+
readOnlyHint?: boolean;
|
|
4334
|
+
destructiveHint?: boolean;
|
|
4335
|
+
idempotentHint?: boolean;
|
|
4336
|
+
openWorldHint?: boolean;
|
|
4337
|
+
};
|
|
4338
|
+
/**
|
|
4339
|
+
* Provider-agnostic tool descriptor a package can offer to the in-browser
|
|
4340
|
+
* AI assistant (see `DocumentModelLib.aiTools`).
|
|
4341
|
+
*
|
|
4342
|
+
* Structurally compatible with the MCP tool records produced by
|
|
4343
|
+
* `toMcpTool`: the callback parameter is `never` so any
|
|
4344
|
+
* per-tool-args function type is assignable, and the result is `unknown`
|
|
4345
|
+
* because the envelope shape (MCP `CallToolResult`) is unwrapped at the
|
|
4346
|
+
* adapter boundary.
|
|
4347
|
+
*/
|
|
4348
|
+
type PhAiToolDescriptor = {
|
|
4349
|
+
name: string;
|
|
4350
|
+
description?: string;
|
|
4351
|
+
inputSchema: ZodRawShape;
|
|
4352
|
+
annotations?: PhAiToolAnnotations;
|
|
4353
|
+
callback: (args: never) => Promise<unknown>;
|
|
4354
|
+
};
|
|
4355
|
+
type DocumentModelModule<TState extends PHBaseState = PHBaseState> = {
|
|
4356
|
+
/** optional version field, should be made required */
|
|
4357
|
+
version?: number;
|
|
4358
|
+
reducer: Reducer<TState>;
|
|
4359
|
+
actions: Actions;
|
|
4360
|
+
utils: DocumentModelUtils<TState>;
|
|
4361
|
+
documentModel: DocumentModelPHState;
|
|
4362
|
+
};
|
|
4363
|
+
type DocumentModelLib<TState extends PHBaseState = PHBaseState> = {
|
|
4364
|
+
manifest: Manifest;
|
|
4365
|
+
documentModels: readonly DocumentModelModule<TState>[];
|
|
4366
|
+
editors: readonly EditorModule[];
|
|
4367
|
+
subgraphs?: readonly SubgraphModule[];
|
|
4368
|
+
upgradeManifests?: readonly UpgradeManifest<readonly number[]>[] | undefined;
|
|
4369
|
+
processorFactory?: ProcessorFactoryBuilder;
|
|
4370
|
+
/**
|
|
4371
|
+
* Optional: tool descriptors this package offers to the in-browser AI
|
|
4372
|
+
* assistant (merged into the chat agent's tool set by the host app).
|
|
4373
|
+
*/
|
|
4374
|
+
aiTools?: readonly PhAiToolDescriptor[];
|
|
4375
|
+
};
|
|
4376
|
+
type DocumentModelDocumentModelModule = DocumentModelModule<DocumentModelPHState>;
|
|
4377
|
+
type ConfigEntryType = z.infer<typeof ConfigEntryTypeSchema>;
|
|
4378
|
+
type ConfigEntry = z.infer<typeof ConfigEntrySchema>;
|
|
4379
|
+
type PowerhouseModule = z.infer<typeof PowerhouseModuleSchema>;
|
|
4380
|
+
type PieceModule = z.infer<typeof PieceModuleSchema>;
|
|
4381
|
+
type Publisher = z.infer<typeof PublisherSchema>;
|
|
4382
|
+
type Manifest = z.infer<typeof ManifestSchema>;
|
|
4383
|
+
//#endregion
|
|
4384
|
+
//#region clis/constants.d.ts
|
|
4385
|
+
declare const SERVICE_ACTIONS: readonly ["start", "stop", "status", "setup", "restart"];
|
|
4386
|
+
declare const DRIVES_PRESERVE_STRATEGIES: readonly ["preserve-all", "preserve-by-url-and-detach"];
|
|
4387
|
+
declare const LOG_LEVELS: readonly ["debug", "info", "warn", "error", "verbose"];
|
|
4388
|
+
declare const DEFAULT_REGISTRY_URL: "https://registry.vetra.io";
|
|
4389
|
+
//#endregion
|
|
4390
|
+
//#region clis/types.d.ts
|
|
4391
|
+
type ServiceActions = typeof SERVICE_ACTIONS;
|
|
4392
|
+
type ServiceAction = ServiceActions[number];
|
|
4393
|
+
type DrivePreserveStrategies = typeof DRIVES_PRESERVE_STRATEGIES;
|
|
4394
|
+
type DrivePreserveStrategy = DrivePreserveStrategies[number];
|
|
4395
|
+
type LogLevels = typeof LOG_LEVELS;
|
|
4396
|
+
type LogLevel = LogLevels[number];
|
|
4397
|
+
type ParsedCmdResult<P> = P extends ArgParser<infer Out> ? Out : never;
|
|
4398
|
+
type PackageManagerArgs = ParsedCmdResult<typeof getPackageManagerCommand>;
|
|
4399
|
+
type PHPackageProvider = "npm" | "github" | "local" | "registry";
|
|
4400
|
+
type PathValidation = (dir: string) => boolean;
|
|
4401
|
+
type PowerhousePackage = {
|
|
4402
|
+
packageName: string;
|
|
4403
|
+
version?: string;
|
|
4404
|
+
provider?: PHPackageProvider;
|
|
4405
|
+
url?: string;
|
|
4406
|
+
};
|
|
4407
|
+
type PHImageRef = z.infer<typeof connectImageRefSchema>;
|
|
4408
|
+
type PHSchemedImage = z.infer<typeof connectSchemedImageSchema>;
|
|
4409
|
+
type PHSchemedColor = z.infer<typeof connectSchemedColorSchema>;
|
|
4410
|
+
type PHLength = z.infer<typeof connectLengthSchema>;
|
|
4411
|
+
type PHEdges = z.infer<typeof connectEdgesSchema>;
|
|
4412
|
+
type PHBackgroundLayer = z.infer<typeof connectBackgroundLayerSchema>;
|
|
4413
|
+
type PHBackgroundLayers = z.infer<typeof connectBackgroundLayersSchema>;
|
|
4414
|
+
type PHBackground = z.infer<typeof connectBackgroundSchema>;
|
|
4415
|
+
type PHConnectBranding = z.infer<typeof connectBrandingSchema>;
|
|
4416
|
+
type PHConnectLoader = z.infer<typeof connectLoaderSchema>;
|
|
4417
|
+
type PHConnectHome = z.infer<typeof connectHomeSchema>;
|
|
4418
|
+
type PHConnectExplorerIcons = z.infer<typeof connectExplorerIconsSchema>;
|
|
4419
|
+
type PHConnectDefaultDriveRemote = z.infer<typeof connectDefaultDriveRemoteSchema>;
|
|
4420
|
+
type PHConnectDefaultDriveLocal = z.infer<typeof connectDefaultDriveLocalSchema>;
|
|
4421
|
+
type PHConnectDefaultDrive = z.infer<typeof connectDefaultDriveSchema>;
|
|
4422
|
+
type PHConnectDriveSection = z.infer<typeof connectDriveSectionSchema>;
|
|
4423
|
+
type PHConnectDriveSections = z.infer<typeof connectDriveSectionsSchema>;
|
|
4424
|
+
type PHConnectDrives = z.infer<typeof connectDrivesSchema>;
|
|
4425
|
+
type PHConnectApp = z.infer<typeof connectAppSchema>;
|
|
4426
|
+
type PHConnectAi = z.infer<typeof connectAiSchema>;
|
|
4427
|
+
type PHConnectPackages = z.infer<typeof connectPackagesSchema>;
|
|
4428
|
+
type PHRenownRainbowAdapterConfig = z.infer<typeof connectRenownRainbowAdapterSchema>;
|
|
4429
|
+
type PHRenownPrivyAdapterConfig = z.infer<typeof connectRenownPrivyAdapterSchema>;
|
|
4430
|
+
type PHConnectRenownAdapters = z.infer<typeof connectRenownAdaptersSchema>;
|
|
4431
|
+
type PHConnectRenown = z.infer<typeof connectRenownSchema>;
|
|
4432
|
+
type PHConnectSentry = z.infer<typeof connectSentrySchema>;
|
|
4433
|
+
type PHConnectOpenPanel = z.infer<typeof connectOpenPanelSchema>;
|
|
4434
|
+
/**
|
|
4435
|
+
* Which reactor client Connect runs. One field selects all four shapes the
|
|
4436
|
+
* multi-reactor work standardized (each a peer `IReactorClient`):
|
|
4437
|
+
* - `in-process`: the tab's own reactor on the main thread (PGlite in-tab).
|
|
4438
|
+
* - `worker`: the tab's own reactor in a SharedWorker (PGlite in-worker).
|
|
4439
|
+
* - `remote`: a pure client to a remote Switchboard reactor over GraphQL,
|
|
4440
|
+
* with NO local reactor and NO PGlite download.
|
|
4441
|
+
* - `router`: the tab's reactor (local) PLUS remote backends, routed.
|
|
4442
|
+
* Derived from the host's reactor backends (see reactorClientMode); when
|
|
4443
|
+
* unset, Connect falls back to the legacy `reactorWorker`/`multiReactor`
|
|
4444
|
+
* booleans.
|
|
4445
|
+
*/
|
|
4446
|
+
type PHReactorClientMode = z.infer<typeof connectReactorClientModeSchema>;
|
|
4447
|
+
/** Served `instance`: the authored fields plus the derived `reactorClient`. */
|
|
4448
|
+
type PHConnectInstance = z.infer<typeof connectRuntimeInstanceSchema>;
|
|
4449
|
+
/** Each flag implies its predecessors, and must match the fleet Connect syncs
|
|
4450
|
+
* with or the two compute different replay outcomes. */
|
|
4451
|
+
type PHConnectReactorFeatureFlags = z.infer<typeof connectReactorFeatureFlagsSchema>;
|
|
4452
|
+
type PHConnectReactor = z.infer<typeof connectReactorSchema>;
|
|
4453
|
+
type PHConnectPwaUrlPattern = z.infer<typeof connectPwaUrlPatternSchema>;
|
|
4454
|
+
type PHConnectPwaCacheStrategy = z.infer<typeof connectPwaCacheStrategySchema>;
|
|
4455
|
+
type PHConnectPwaRuntimeCaching = z.infer<typeof connectPwaRuntimeCachingSchema>;
|
|
4456
|
+
type PHConnectPwaIcon = z.infer<typeof connectPwaIconSchema>;
|
|
4457
|
+
type PHConnectPwaFileHandler = z.infer<typeof connectPwaFileHandlerSchema>;
|
|
4458
|
+
/** Served manifest overrides: the authored fields plus `categories`, derived
|
|
4459
|
+
* from every contributing `powerhouse.manifest.json`'s `category`. */
|
|
4460
|
+
type PHConnectPwaManifest = z.infer<typeof connectRuntimePwaManifestSchema>;
|
|
4461
|
+
/**
|
|
4462
|
+
* PWA / service-worker overrides contributed by a package or the project,
|
|
4463
|
+
* layered on Connect's hardcoded PWA defaults at build time. Scalars
|
|
4464
|
+
* deep-merge (later layer wins), arrays are additive and
|
|
4465
|
+
* `maximumFileSizeToCacheInBytes` takes the max. Precedence: defaults <
|
|
4466
|
+
* package fragments < project config.
|
|
4467
|
+
*/
|
|
4468
|
+
type PHConnectPwa = z.infer<typeof connectRuntimePwaSchema>;
|
|
4469
|
+
/** One entry of the host.js composition, projected into the served config as
|
|
4470
|
+
* DATA (module specifier + validated config). */
|
|
4471
|
+
type PHConnectCompositionEntry = z.infer<typeof connectCompositionEntrySchema>;
|
|
4472
|
+
/** The served `connect` block. For the authored block (powerhouse.config.json,
|
|
4473
|
+
* the connect host's `config`) see `ConnectConfig`. */
|
|
4474
|
+
type PHConnectRuntimeConfig = z.infer<typeof connectRuntimeConfigSchema>;
|
|
4475
|
+
/** Which Renown instance a reactor authenticates against, server-side. */
|
|
4476
|
+
type PHReactorRenown = {
|
|
4477
|
+
/** "self" reads this reactor's own renown read model; "remote" (default)
|
|
4478
|
+
* queries a Renown or Switchboard instance. */
|
|
4479
|
+
source?: "remote" | "self";
|
|
4480
|
+
/** Renown base URL; also the instance this reactor's own identity uses. */
|
|
4481
|
+
url?: string;
|
|
4482
|
+
/** Switchboard GraphQL endpoint to read credentials from directly. */
|
|
4483
|
+
switchboardUrl?: string;
|
|
4484
|
+
};
|
|
4485
|
+
type PowerhouseConfig = {
|
|
4486
|
+
logLevel: LogLevel;
|
|
4487
|
+
documentModelsDir: string;
|
|
4488
|
+
editorsDir: string;
|
|
4489
|
+
processorsDir: string;
|
|
4490
|
+
subgraphsDir: string;
|
|
4491
|
+
importScriptsDir: string;
|
|
4492
|
+
skipFormat: boolean;
|
|
4493
|
+
interactive?: boolean;
|
|
4494
|
+
watch?: boolean;
|
|
4495
|
+
reactor?: {
|
|
4496
|
+
port?: number;
|
|
4497
|
+
https?: undefined | boolean | {
|
|
4498
|
+
keyPath: string;
|
|
4499
|
+
certPath: string;
|
|
4500
|
+
};
|
|
4501
|
+
storage?: {
|
|
4502
|
+
type: "filesystem" | "memory" | "postgres" | "browser";
|
|
4503
|
+
filesystemPath?: string;
|
|
4504
|
+
postgresUrl?: string;
|
|
4505
|
+
};
|
|
4506
|
+
};
|
|
4507
|
+
auth?: {
|
|
4508
|
+
enabled?: boolean;
|
|
4509
|
+
admins: string[];
|
|
4510
|
+
renown?: PHReactorRenown;
|
|
4511
|
+
};
|
|
4512
|
+
switchboard?: {
|
|
4513
|
+
database?: {
|
|
4514
|
+
url?: string;
|
|
4515
|
+
};
|
|
4516
|
+
port?: number;
|
|
4517
|
+
};
|
|
4518
|
+
studio?: {
|
|
4519
|
+
port?: number;
|
|
4520
|
+
host?: string;
|
|
4521
|
+
https: boolean;
|
|
4522
|
+
openBrowser?: boolean;
|
|
4523
|
+
};
|
|
4524
|
+
packages?: PowerhousePackage[];
|
|
4525
|
+
vetra?: {
|
|
4526
|
+
driveId?: string;
|
|
4527
|
+
driveUrl?: string;
|
|
4528
|
+
connectPort?: number;
|
|
4529
|
+
/** The Vetra Preview drive `ph vetra` creates in watch mode. */
|
|
4530
|
+
previewDrive?: {
|
|
4531
|
+
/** The id of the drive app the drive opens in, set each time `ph vetra` starts. */
|
|
4532
|
+
app?: string;
|
|
4533
|
+
};
|
|
4534
|
+
};
|
|
4535
|
+
assistant?: {
|
|
4536
|
+
port?: number;
|
|
4537
|
+
};
|
|
4538
|
+
workflows?: {
|
|
4539
|
+
enabled?: boolean;
|
|
4540
|
+
};
|
|
4541
|
+
packageRegistryUrl?: string;
|
|
4542
|
+
connect?: PHConnectRuntimeConfig;
|
|
4543
|
+
};
|
|
4544
|
+
//#endregion
|
|
4545
|
+
export { ServiceActions as $, UpdateOperationExampleInput as $a, SetPreferredEditorActionInputSchema as $c, evaluateGrantStack as $d, actionSignerIdentity as $f, undoOperation as $h, SetModelNameInput as $i, peerSupports as $l, reshuffleByTimestamp as $m, ModuleSpecification as $n, NodeRouteSpec as $o, setName as $p, PartialState as $r, ConfigEntryTypeSchema as $s, DocumentModelAction as $t, documentModelDocumentType as $u, PHConnectPwaUrlPattern as A, SetStateSchemaAction as Aa, ReorderStateExamplesInputSchema as Ac, HASH_ALGORITHM_SHA1 as Ad, applySetGrantAction as Af, defaultPHState as Ah, RevisionsFilter as Ai, purgeDocumentAction as Al, filterDocumentOperationsResultingState as Am, FileInput as An, RelationalDbProcessorClass as Ao, moveOperation as Ap, MutationSetModuleDescriptionArgs as Ar, findModuleOrThrow as As, CreateDocument as At, zipEntries as Au, PHPackageProvider as B, SigningParameters as Ba, SetModuleNameInputSchema as Bc, AuthAdministrationMissingError as Bd, removeGrant as Bf, protocolVersionsFor as Bh, SetAuthorNameAction as Bi, PeerCapabilityFlags as Bl, isUndo as Bm, Incremental as Bn, ProcessorFactory as Bo, reorderModules as Bp, MutationSetOperationSchemaArgs as Br, validateModules as Bs, DeleteModuleAction as Bt, withProtocolVersions as Bu, PHConnectPackages as C, SetOperationScopeAction as Ca, RedoActionSchema as Cc, base64UrlToBytes as Cd, SetGrantAction as Cf, createLocalState as Ch, ReorderOperationErrorsAction as Ci, createReducer as Cl, appendWithoutApplying as Cm, DocumentOperationsIgnoreMap as Cn, HashAlgorithms as Co, deleteChangeLogItem as Cp, MutationSetAuthorNameArgs as Cr, OPERATION_NAME_PATTERN as Cs, CodeExample as Ct, documentModelSaveToFileHandle as Cu, PHConnectPwaIcon as D, SetPreferredEditorAction as Da, ReorderModulesInputSchema as Dc, getUnixTimestamp as Dd, applyInitializeAuthAction as Df, defaultDocumentState as Dh, ReorderStateExamplesAction as Di, PURGE_DOCUMENT as Dl, checkCleanedOperationsIntegrity as Dm, EditorModule as Dn, IRelationalQueryBuilder as Do, deleteOperationExample as Dp, MutationSetModelExtensionArgs as Dr, assertOperationErrorIdUnique as Ds, CopyChildDocumentSignal as Dt, parseBulkArchive as Du, PHConnectPwaFileHandler as E, SetOperationTemplateInput as Ea, ReorderModuleOperationsInputSchema as Ec, bytesToBase64Url as Ed, applyAuthAction as Ef, defaultBaseState as Eh, ReorderOperationExamplesInput as Ei, updateDocument as El, baseReducerVersion as Em, EditorDispatch as En, IRelationalDbProcessor as Eo, deleteOperationError as Ep, MutationSetModelDescriptionArgs as Er, assertModuleIdUnique as Es, CopyChildDocumentInput as Et, isDocumentZip as Eu, PHConnectRuntimeConfig as F, SignalDispatch as Fa, SetModelDescriptionInputSchema as Fc, documentModelFileExtension as Fd, initializeAuth as Ff, SIGNATURE_PROTOCOL_V2 as Fh, SchemaRedoAction as Fi, HoldReason as Fl, getDocumentLastModified as Fm, IDocument as Fn, ProcessorApp as Fo, operationWithContext as Fp, MutationSetOperationErrorDescriptionArgs as Fr, isReservedOperationName as Fs, DeleteChangeLogItemInput as Ft, UpgradeReducer as Fu, PHSchemedColor as G, SubgraphModule as Ga, SetOperationErrorDescriptionInputSchema as Gc, MAX_CAPABILITY_OPERATIONS as Gd, TransportSigner as Gf, Operation as Gh, SetInitialStateInput as Gi, coversLocal as Gl, nextSkipNumber as Gm, LoadFromInput as Gn, ProcessorRerunOptions as Go, setAuthorWebsite as Gp, MutationUpdateOperationExampleArgs as Gr, AddModuleInputSchema as Gs, DeleteOperationExampleAction as Gt, DowngradeNotSupportedError as Gu, PHReactorRenown as H, SkipHeaderOperations as Ha, SetNameActionSchema as Hc, GroupPrincipalNotAllowedError as Hd, setGrant as Hf, signaturePolicyOf as Hh, SetAuthorWebsiteAction as Hi, ProtocolCapability as Hl, mapSkippedOperations as Hm, IsDocumentOfType as Hn, ProcessorFilter as Ho, reorderOperationExamples as Hp, MutationSetStateSchemaArgs as Hr, validateOperations as Hs, DeleteOperationAction as Ht, AuthAlreadyInitializedError as Hu, PHConnectSentry as I, SignalResult as Ia, SetModelExtensionInputSchema as Ic, documentModelGlobalState as Id, isAuthAction as If, SignaturePolicy$1 as Ih, SchemaSetNameAction as Ii, MARKER_REFUSAL_FEATURE as Il, groupOperationsByScope as Im, IOperation as In, ProcessorApps as Io, redo as Ip, MutationSetOperationErrorNameArgs as Ir, isValidOperationNameFormat as Is, DeleteChildDocumentInput as It, UpgradeTransition as Iu, ParsedCmdResult as J, UndoActionInput as Ja, SetOperationNameInputSchema as Jc, assertAuthAdministrationRetained as Jd, ActionSignerIdentity as Jf, OperationWithContext$1 as Jh, SetModelExtensionAction as Ji, legacySupports as Jl, precedes as Jm, MakeOptional as Jn, TrackedProcessor as Jo, setModelExtension as Jp, OperationErrorSpecification as Jr, AddOperationInputSchema as Js, DeleteStateExampleAction as Jt, HashMismatchError as Ju, PHSchemedImage as K, Undo as Ka, SetOperationErrorNameInputSchema as Kc, MAX_CONDITION_DEPTH as Kd, toTransportAction as Kf, OperationContext as Kh, SetModelDescriptionAction as Ki, holdReason as Kl, operationsAreEqual as Km, MakeEmpty as Kn, ProcessorStatus as Ko, setInitialState as Kp, MutationUpdateStateExampleArgs as Kr, AddOperationErrorInputSchema as Ks, DeleteOperationExampleInput as Kt, FileSystemError as Ku, PHEdges as L, SignalResults as La, SetModelIdInputSchema as Lc, documentModelInitialGlobalState as Ld, isDocumentCreator as Lf, deriveDocumentId as Lh, SchemaSetPreferredEditorAction as Li, PEER_CAPABILITIES as Ll, hashDocumentStateForScope as Lm, ISignal as Ln, ProcessorDeletePropagation as Lo, releaseNewVersion as Lp, MutationSetOperationErrorTemplateArgs as Lr, validateInitialState as Ls, DeleteChildDocumentSignal as Lt, applyDeleteDocumentAction as Lu, PHConnectReactorFeatureFlags as M, Set_Name as Ma, SetAuthorNameInputSchema as Mc, HASH_ALGORITHM_SHA512 as Md, assertAuthScopeActionAllowed as Mf, DocumentIdParams as Mh, SaveToFileHandle as Mi, purgedProtocolVersions as Ml, garbageCollect as Mm, HostedEditorProps as Mn, IProcessorDispatch as Mo, operationExampleCreators as Mp, MutationSetNameArgs as Mr, findOperationExampleOrThrow as Ms, CreateDocumentActionInput as Mt, VersionedReplayConfig as Mu, PHConnectRenown as N, Set_PreferredEditor as Na, SetAuthorWebsiteInputSchema as Nc, HASH_ENCODING_BASE64 as Nd, decide as Nf, ProtocolVersions as Nh, Scalars as Ni, DOCUMENT_PURGE_PROTOCOL as Nl, garbageCollectDocumentOperations as Nm, IAction as Nn, IProcessorHostModuleBase as No, operationFromAction as Np, MutationSetOperationDescriptionArgs as Nr, findOperationOrThrow as Ns, CreateState as Nt, replayDocumentVersioned as Nu, PHConnectPwaManifest as O, SetPreferredEditorActionInput as Oa, ReorderOperationErrorsInputSchema as Oc, hashBrowser as Od, applyMoveGrantAction as Of, defaultGlobalState as Oh, ReorderStateExamplesInput as Oi, PurgeMarkerOperation as Ol, checkOperationsIntegrity as Om, EditorProps as On, IRelationalQueryMethods as Oo, deleteStateExample as Op, MutationSetModelIdArgs as Or, assertOperationExampleIdUnique as Os, CreateChildDocumentInput as Ot, readFileBrowser as Ou, PHConnectRenownAdapters as P, Signal as Pa, SetInitialStateInputSchema as Pc, HASH_ENCODING_HEX as Pd, evaluate as Pf, SIGNATURE_PROTOCOL as Ph, SchemaNOOPAction as Pi, FeatureCapability as Pl, garbageCollectV2 as Pm, ID as Pn, IProcessorManager as Po, operationFromOperation as Pp, MutationSetOperationErrorCodeArgs as Pr, getAllOperationNames as Ps, DeleteChangeLogItemAction as Pt, UpgradeManifest as Pu, ServiceAction as Q, UpdateOperationExampleAction as Qa, SetOperationTemplateInputSchema as Qc, evaluateCondition as Qd, actionPreimageV2 as Qf, setPreferredEditorOperation as Qh, SetModelNameAction as Qi, mergePeerCapabilities as Ql, replayDocument as Qm, MinimalBackupData as Qn, IWebhookScope as Qo, setModuleName as Qp, PartialRecord as Qr, ConfigEntrySchema as Qs, DocumentDispatch$1 as Qt, UnsupportedDocumentModelVersionError as Qu, PHImageRef as R, SignalType as Ra, SetModelNameInputSchema as Rc, documentModelInitialLocalState as Rd, mentionedGroupIds as Rf, isDerivedDocumentId as Rh, SchemaUndoAction as Ri, PEER_MANIFEST_FORMAT as Rl, isDocumentAction as Rm, ISignalResult as Rn, ProcessorDispatchCreateResult as Ro, reorderChangeLogItems as Rp, MutationSetOperationNameArgs as Rr, validateModule as Rs, DeleteDocumentAction as Rt, applyUpgradeDocumentAction as Ru, PHConnectOpenPanel as S, SetOperationSchemaInput as Sa, RedoActionInputSchema as Sc, base58Decode as Sd, RemoveGrantActionInputSchema as Sf, createGlobalState as Sh, ReorderModulesInput as Si, baseReducer as Sl, addUndo as Sm, DocumentModelVersioningOperations as Sn, ExtractProcessorSchemaOrSelf as So, createAction as Sp, MutationReorderStateExamplesArgs as Sr, deletedDocumentId as Ss, Author as St, documentModelLoadFromInput as Su, PHConnectPwaCacheStrategy as T, SetOperationTemplateAction as Ta, ReorderChangeLogItemsInputSchema as Tc, buildOperationSignatureParams as Td, SetGrantActionInputSchema as Tf, defaultAuthState as Th, ReorderOperationExamplesAction as Ti, replayOperations as Tl, baseCreateDocument as Tm, ENSInfo as Tn, IRelationalDb as To, deleteOperation as Tp, MutationSetInitialStateArgs as Tr, ReservedOperationName as Ts, ConfigEntryType as Tt, getFileBrowser as Tu, PHRenownPrivyAdapterConfig as U, State as Ua, SetOperationDescriptionInputSchema as Uc, InvalidGrantError as Ud, TransportAction as Uf, v2RequiredProtocolVersions as Uh, SetAuthorWebsiteInput as Ui, Supports as Ul, mapSkippedOperationsV2 as Um, IsStateOfType as Un, ProcessorPhase as Uo, reorderStateExamples as Up, MutationUndoArgs as Ur, validateStateSchemaName as Us, DeleteOperationErrorAction as Ut, AuthInitializerNotCreatorError as Uu, PHReactorClientMode as V, SkipHeaderOperationIndex as Va, SetNameActionInputSchema as Vc, GrantSchema as Vd, resolveSnapshotAuth as Vf, requestedSignaturePolicy as Vh, SetAuthorNameInput as Vi, PeerManifest as Vl, isUndoRedo as Vm, InputMaybe as Vn, ProcessorFactoryBuilder as Vo, reorderOperationErrors as Vp, MutationSetOperationTemplateArgs as Vr, validateOperationName as Vs, DeleteModuleInput as Vt, AuthActionNotAllowedError as Vu, PHRenownRainbowAdapterConfig as W, StateReducer as Wa, SetOperationErrorCodeInputSchema as Wc, MAX_AUTH_GRANTS as Wd, TransportActionContext as Wf, DocumentOperations as Wh, SetInitialStateAction as Wi, capSelection as Wl, merge as Wm, LoadFromFile as Wn, ProcessorRecord as Wo, setAuthorName as Wp, MutationUpdateChangeLogItemInputArgs as Wr, AddChangeLogItemInputSchema as Ws, DeleteOperationErrorInput as Wt, AuthPolicyNotPreservedError as Wu, PowerhouseConfig as X, UpdateChangeLogItemAction as Xa, SetOperationSchemaInputSchema as Xc, assertValidGrantUpsert as Xd, CanonicalJsonError as Xf, redoOperation as Xh, SetModelIdAction as Xi, localSupports as Xl, readOnly as Xm, MappedOperation as Xn, IHttpScope as Xo, setModelName as Xp, OperationSpecification as Xr, AuthorSchema as Xs, DispatchOutcome as Xt, InvalidActionInputZodError as Xu, PathValidation as Y, UndoRedoAction as Ya, SetOperationReducerInputSchema as Yc, assertValidGrant as Yd, ActionSigningTarget as Yf, operationOutcome as Yh, SetModelExtensionInput as Yi, localPeerManifest as Yl, prepareOperations as Ym, Manifest as Yn, AuthorizerResult as Yo, setModelId as Yp, OperationIndex as Yr, AddStateExampleInputSchema as Ys, DeleteStateExampleInput as Yt, InvalidActionInputError as Yu, PowerhousePackage as Z, UpdateChangeLogItemInput as Za, SetOperationScopeInputSchema as Zc, assertValidInitialGrants as Zd, DOCUMENT_SCOPE_ACTION_TYPES as Zf, setNameOperation as Zh, SetModelIdInput as Zi, manifestRevision as Zl, removeExistingOperations as Zm, Maybe as Zn, IWebhookEndpoints as Zo, setModuleDescription as Zp, OperationsByScope as Zr, CodeExampleSchema as Zs, DocumentAction as Zt, InvalidAuthVersionError as Zu, PHConnectDrives as _, SetOperationNameAction as _a, PieceModulesSchema as _c, creationActions as _d, MoveGrantAction as _f, Principal as _h, ReorderChangeLogItemsAction as _i, documentModelOperationReducer as _l, IntegrityIssueSubType as _m, DocumentModelPHState as _n, createRelationalDb as _o, addOperationExample as _p, MutationReorderChangeLogItemsInputArgs as _r, WebhookRequest as _s, AddRelationshipActionInput as _t, baseLoadFromInput as _u, PHBackground as a, SetNameActionInput as aa, DeleteStateExampleInputSchema as ac, DocumentModelPHStateSchema as ad, AuthAction as af, Signature as ag, updateHeaderRevision as ah, PurgeDocumentAction as ai, UndoActionInputSchema as al, setOperationName as am, DocumentModelInput as an, UpgradeDocumentActionInput as ao, targetDocumentId as ap, MutationAddOperationArgs as ar, RouteHandler as as, Actions as at, headNewDocument as au, PHConnectInstance as b, SetOperationReducerInput as ba, PublisherSchema as bc, upgradeDocumentAction as bd, RemoveGrantAction as bf, createBaseState as bh, ReorderModuleOperationsInput as bi, documentModelStateSchemaReducer as bl, PHDocumentHeader as bm, DocumentModelUtils as bn, relationalDbToQueryBuilder as bo, buildOperationSignature as bp, MutationReorderOperationErrorsArgs as br, WebhookSpec as bs, AssertIsDocumentOfType as bt, createMinimalZip as bu, PHConnectAi as c, SetOperationDescriptionInput as ca, DocumentModelInputSchema as cc, assertIsDocumentModelState as cd, AuthRefusal as cf, serializeSignature as cg, AuthGroups as ch, Redo as ci, UpdateChangeLogItemInputSchema as cl, setOperationScope as cm, DocumentModelModule as cn, CodegenState as co, ActionContext as cp, MutationAddStateExampleArgs as cr, RouteSpec as cs, AddModuleAction as ct, createPresignedHeader as cu, PHConnectCompositionEntry as d, SetOperationErrorDescriptionAction as da, ModuleSchema as dc, AUTH_DENIED_BY_GRANT_REASON as dd, AuthVerb as df, PROCESSOR_APPS as dg, Grant as dh, Reducer as di, definedNonNullAnySchema as dl, setStateSchema as dm, DocumentModelOperationAction as dn, PackageLoadFailure as do, actionSigner as dp, MutationDeleteOperationArgs as dr, ScopedRouteHandle as ds, AddOperationErrorAction as dt, createVerificationSigner as du, SetModuleDescriptionAction as ea, DeleteChangeLogItemInputSchema as ec, groupDocumentType as ed, evaluateGrants as ef, undoOperationV2 as eg, reshuffleByTimestampAndIndex as eh, PhAiToolAnnotations as ei, SetPreferredEditorActionSchema as el, setOperationDescription as em, DocumentModelDocument as en, UpdateRelationshipAction as eo, actionSigningTarget as ep, MoveOperationAction as er, RouteActor as es, DEFAULT_REGISTRY_URL as et, readPeerManifest as eu, PHConnectDefaultDrive as f, SetOperationErrorDescriptionInput as fa, MoveOperationInputSchema as fc, AUTH_NO_GRANT_REASON as fd, ConditionContext as ff, Operand as fh, ReducerOptions as fi, isDefinedNonNullAny as fl, undo as fm, DocumentModelOperationErrorAction as fn, SETTLED_CODEGEN_STATES as fo, actions as fp, MutationDeleteOperationErrorArgs as fr, WebhookEndpointInfo as fs, AddOperationErrorInput as ft, hasDerivedDocumentId as fu, PHConnectDriveSections as g, SetOperationErrorTemplateInput as ga, PieceModuleSchema as gc, createDocumentAction as gd, MAX_SUPPORTED_AUTH_VERSION as gf, PHGroupState as gh, RemoveRelationshipActionInput as gi, documentModelOperationExampleReducer as gl, verifyOperationSignature as gm, DocumentModelOperationOperations as gn, createNamespacedQueryBuilder as go, addOperationError as gp, MutationRedoArgs as gr, WebhookReply as gs, AddRelationshipAction as gt, BulkArchiveEntry as gu, PHConnectDriveSection as h, SetOperationErrorTemplateAction as ha, OperationSpecificationSchema as hc, isDenied as hd, InitializeAuthActionInputSchema as hf, PHDocumentState as hh, RemoveRelationshipAction as hi, documentModelOperationErrorReducer as hl, updateStateExample as hm, DocumentModelOperationExampleOperations as hn, createNamespacedDb as ho, addOperation as hp, MutationMoveOperationArgs as hr, WebhookPolicy as hs, AddOperationInput as ht, verify as hu, LogLevels as i, SetNameAction as ia, DeleteOperationInputSchema as ic, DocumentModelHeaderSchema as id, AUTH_ACTION_TYPES as if, PHDocumentSignatureInfo as ig, split as ih, Publisher as ii, StateSchema as il, setOperationErrorTemplate as im, DocumentModelHeaderOperations as in, UpgradeDocumentAction as io, signActionV2 as ip, MutationAddModuleArgs as ir, RouteContext as is, ActionVerificationHandler as it, createVersionsOf as iu, PHConnectReactor as j, SetStateSchemaInput as ja, ScopeStateSchema as jc, HASH_ALGORITHM_SHA256 as jd, assertAuthPreservedOnDuplicate as jf, DEFAULT_SIGNATURE_POLICY as jh, SaveToFile as ji, purgeMarkerOperation as jl, filterDuplicatedOperations as jm, GetDocumentOptions as jn, IProcessor as jo, noop as jp, MutationSetModuleNameArgs as jr, findOperationErrorOrThrow as js, CreateDocumentAction as jt, VersionedReducers as ju, PHConnectPwaRuntimeCaching as k, SetPreferredEditorOperation as ka, ReorderOperationExamplesInputSchema as kc, hex2ab as kd, applyRemoveGrantAction as kf, defaultLocalState as kh, ReplayDocumentOptions as ki, isPurgeMarker as kl, diffOperations as km, Exact as kn, RelationalDbProcessor as ko, documentModelActions as kp, MutationSetModelNameArgs as kr, assertOperationIdUnique as ks, CreateChildDocumentSignal as kt, writeFileBrowser as ku, PHConnectApp as l, SetOperationErrorCodeAction as la, DocumentSpecificationSchema as lc, isDocumentModelDocument as ld, AuthRequest as lf, DEFAULT_ANALYTICS_PROCESSOR_DB_NAME as lg, Capability as lh, RedoAction as li, UpdateOperationExampleInputSchema as ll, setOperationTemplate as lm, DocumentModelModuleAction as ln, CodegenStatus as lo, actionContext as lp, MutationDeleteChangeLogItemInputArgs as lr, RouteTransport as ls, AddModuleInput as lt, createSignedHeader as lu, PHConnectDefaultDriveRemote as m, SetOperationErrorNameInput as ma, OperationScopeSchema as mc, DOCUMENT_DELETED_REASON as md, InitializeAuthActionInput as mf, PHBaseState as mh, ReleaseNewVersionAction as mi, documentModelModuleReducer as ml, updateOperationExample as mm, DocumentModelOperationExampleAction as mn, isSettledCodegenState as mo, addModule as mp, MutationDeleteStateExampleArgs as mr, WebhookHashAlgorithm as ms, AddOperationExampleInput as mt, validateHeader as mu, DrivePreserveStrategy as n, SetModuleNameAction as na, DeleteOperationErrorInputSchema as nc, BaseDocumentHeaderSchema as nd, isPlainValue as nf, AppActionSigner as ng, sortMappedOperations as nh, PieceModule as ni, Set_NameSchema as nl, setOperationErrorDescription as nm, DocumentModelGlobalState as nn, UpdateStateExampleAction as no, hashActionV2 as np, Mutation as nr, RouteAuthorizer as ns, ActionSignatureContext as nt, CreateProtocolVersionsOptions as nu, PHBackgroundLayer as o, SetNameOperation as oa, DocumentActionSchema as oc, DocumentModelSchema as od, AuthDecision as of, UserActionSigner as og, withScopeRevisions as oh, PurgeDocumentActionInput as oi, UndoActionSchema as ol, setOperationReducer as om, DocumentModelLib as on, User as oo, v2TupleProblem as op, MutationAddOperationErrorArgs as or, RouteMethod as os, AddChangeLogItemAction as ot, selectDocumentModelModule as ou, PHConnectDefaultDriveLocal as p, SetOperationErrorNameAction as pa, OperationErrorSchema as pc, AUTH_VERSION_UNSUPPORTED_REASON as pd, InitializeAuthAction as pf, PHAuthState as ph, RejectedAction as pi, documentModelHeaderReducer as pl, updateChangeLogItem as pm, DocumentModelOperationErrorOperations as pn, getCodegenStatusRegistry as po, addChangeLogItem as pp, MutationDeleteOperationExampleArgs as pr, WebhookField as ps, AddOperationExampleAction as pt, sign as pu, PackageManagerArgs as q, UndoAction as qa, SetOperationErrorTemplateInputSchema as qc, MAX_CONDITION_NODES as qd, ACTION_SIGNATURE_V2_PREFIX as qf, OperationOutcome as qh, SetModelDescriptionInput as qi, isOlderManifest as ql, parseResultingState as qm, MakeMaybe as qn, ReplayStateMode as qo, setModelDescription as qp, NOOPAction as qr, AddOperationExampleInputSchema as qs, DeleteOperationInput as qt, GrantNotFoundError as qu, LogLevel as r, SetModuleNameInput as ra, DeleteOperationExampleInputSchema as rc, BaseDocumentStateSchema as rd, referencedGroupIds as rf, HashConfig as rg, sortOperations as rh, PowerhouseModule as ri, Set_PreferredEditorSchema as rl, setOperationErrorName as rm, DocumentModelHeaderAction as rn, UpdateStateExampleInput as ro, isV2ActionHash as rp, MutationAddChangeLogItemInputArgs as rr, RouteBody as rs, ActionSigningHandler as rt, NewDocumentHeaderOptions as ru, PHBackgroundLayers as s, SetOperationDescriptionAction as sa, DocumentModelGlobalStateSchema as sc, assertIsDocumentModelDocument as sd, AuthEvaluation as sf, deserializeSignature as sg, withSignaturePolicy as sh, Query as si, UndoSchema as sl, setOperationSchema as sm, DocumentModelLocalState as sn, ValidationError as so, Action as sp, MutationAddOperationExampleArgs as sr, RouteOptions as ss, AddChangeLogItemInput as st, createCopyHeader as su, DrivePreserveStrategies as t, SetModuleDescriptionInput as ta, DeleteModuleInputSchema as tc, groupMembershipActionTypes as td, grantProblem as tf, ActionSigner as tg, skipHeaderOperations as th, PhAiToolDescriptor as ti, SetStateSchemaInputSchema as tl, setOperationErrorCode as tm, DocumentModelDocumentModelModule as tn, UpdateRelationshipActionInput as to, canonicalJson as tp, MoveOperationInput as tr, RouteAuth as ts, ActionErrorCallback as tt, selectProtocolVersions as tu, PHConnectBranding as u, SetOperationErrorCodeInput as ua, ManifestSchema as uc, isDocumentModelState as ud, AuthSubject as uf, DEFAULT_RELATIONAL_PROCESSOR_DB_NAME as ug, Condition as uh, RedoActionInput as ui, UpdateStateExampleInputSchema as ul, setPreferredEditor as um, DocumentModelModuleOperations as un, CodegenStatusRegistry as uo, actionFromAction as up, MutationDeleteModuleArgs as ur, RouteUser as us, AddOperationAction as ut, createSignedHeaderForSigner as uu, PHConnectExplorerIcons as v, SetOperationNameInput as va, PowerhouseModuleSchema as vc, creationState as vd, MoveGrantActionInput as vf, backfillAuthState as vh, ReorderChangeLogItemsInput as vi, documentModelReducer as vl, IntegrityIssueType as vm, DocumentModelStateAction as vn, hashNamespace as vo, addStateExample as vp, MutationReorderModuleOperationsArgs as vr, WebhookScheme as vs, AddStateExampleAction as vt, baseLoadFromInputVersioned as vu, PHConnectPwa as w, SetOperationScopeInput as wa, RedoSchema as wc, buildOperationSignatureMessage as wd, SetGrantActionInput as wf, createState as wh, ReorderOperationErrorsInput as wi, processUndoRedo as wl, attachBranch as wm, DocumentSpecification as wn, IBaseRelationalDb as wo, deleteModule as wp, MutationSetAuthorWebsiteArgs as wr, RESERVED_OPERATION_NAMES as ws, ConfigEntry as wt, fetchFileBrowser as wu, PHConnectLoader as x, SetOperationSchemaAction as xa, PwaConfigSchema as xc, ab2hex as xd, RemoveGrantActionInput as xf, createDocumentState as xh, ReorderModulesAction as xi, documentModelVersioningReducer as xl, PHDocumentMeta as xm, DocumentModelVersioningAction as xn, DOCUMENT_ID_COLUMNS as xo, buildSignedAction as xp, MutationReorderOperationExamplesArgs as xr, WebhookVerification as xs, AssertIsStateOfType as xt, createZip as xu, PHConnectHome as y, SetOperationReducerAction as ya, PowerhouseModulesSchema as yc, documentFromCreation as yd, MoveGrantActionInputSchema as yf, createAuthState as yh, ReorderModuleOperationsAction as yi, documentModelStateReducer as yl, PHDocument$1 as ym, DocumentModelStateOperations as yn, namespaceSchemaOf as yo, baseActions as yp, MutationReorderModulesArgs as yr, WebhookSignatureEncoding as ys, AddStateExampleInput as yt, baseSaveToFileHandle as yu, PHLength as z, SignatureVerificationHandler as za, SetModuleDescriptionInputSchema as zc, AuthAdministrationLockoutError as zd, moveGrant as zf, isSignaturePolicy as zh, ScopeState as zi, PeerCapability as zl, isNoopOperation as zm, ISigner as zn, ProcessorDispatchResult as zo, reorderModuleOperations as zp, MutationSetOperationReducerArgs as zr, validateModuleOperation as zs, DeleteDocumentActionInput as zt, computeUpgradeTransitions as zu };
|
|
4546
|
+
export {};
|
|
4547
|
+
//# sourceMappingURL=types-CJNZYvPc.d.ts.map
|