@powerhousedao/shared 6.2.3-dev.5 → 6.2.3-dev.50
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/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-To5LaIfL.mjs → access-token-3Hqv_U8I.mjs} +2 -2
- package/dist/clis/args/{access-token-To5LaIfL.mjs.map → access-token-3Hqv_U8I.mjs.map} +1 -1
- package/dist/clis/args/access-token-C5sKsH2O.d.mts +16 -0
- package/dist/clis/args/access-token-C5sKsH2O.d.mts.map +1 -0
- package/dist/clis/args/access-token.d.mts +3 -2
- package/dist/clis/args/access-token.mjs +1 -1
- package/dist/clis/args/{common-CcYbXrBx.mjs → common-BXabdhiO.mjs} +30 -7
- package/dist/clis/args/common-BXabdhiO.mjs.map +1 -0
- package/dist/clis/args/common-Bnm859xU.d.mts +186 -0
- package/dist/clis/args/common-Bnm859xU.d.mts.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-BVVvCmL9.mjs → connect-BG3HkYBk.mjs} +8 -3
- package/dist/clis/args/connect-BG3HkYBk.mjs.map +1 -0
- package/dist/clis/args/connect-DjeiqXus.d.mts +450 -0
- package/dist/clis/args/connect-DjeiqXus.d.mts.map +1 -0
- package/dist/clis/args/connect.d.mts +3 -2
- package/dist/clis/args/connect.mjs +1 -1
- package/dist/clis/args/dist-CorQTQL-.mjs +1533 -0
- package/dist/clis/args/dist-CorQTQL-.mjs.map +1 -0
- package/dist/clis/args/{generate-CA916Fvj.mjs → generate-BOItUNvP.mjs} +40 -2
- package/dist/clis/args/generate-BOItUNvP.mjs.map +1 -0
- package/dist/clis/args/generate-BPBBLeUD.d.mts +103 -0
- package/dist/clis/args/generate-BPBBLeUD.d.mts.map +1 -0
- package/dist/clis/args/generate.d.mts +3 -2
- package/dist/clis/args/generate.mjs +1 -1
- package/dist/clis/args/{help-Bqbgbalu.mjs → help-DS1NlcJQ.mjs} +15 -15
- package/dist/clis/args/{help-Bqbgbalu.mjs.map → help-DS1NlcJQ.mjs.map} +1 -1
- package/dist/clis/args/help-DVPTARGn.d.mts +190 -0
- package/dist/clis/args/help-DVPTARGn.d.mts.map +1 -0
- package/dist/clis/args/help.d.mts +3 -2
- package/dist/clis/args/help.mjs +1 -1
- package/dist/clis/args/index.d.mts +20 -19
- package/dist/clis/args/index.mjs +18 -18
- package/dist/clis/args/init-CFeTq4Cq.d.mts +52 -0
- package/dist/clis/args/init-CFeTq4Cq.d.mts.map +1 -0
- package/dist/clis/args/{init-rz9Ei7nq.mjs → init-Dvb42Y87.mjs} +2 -2
- package/dist/clis/args/{init-rz9Ei7nq.mjs.map → init-Dvb42Y87.mjs.map} +1 -1
- package/dist/clis/args/init.d.mts +3 -2
- package/dist/clis/args/init.mjs +1 -1
- package/dist/clis/args/inspect-BjRmtB86.d.mts +13 -0
- package/dist/clis/args/inspect-BjRmtB86.d.mts.map +1 -0
- package/dist/clis/args/{inspect-tckH8mSw.mjs → inspect-UNQgtuR0.mjs} +2 -2
- package/dist/clis/args/{inspect-tckH8mSw.mjs.map → inspect-UNQgtuR0.mjs.map} +1 -1
- package/dist/clis/args/inspect.d.mts +3 -2
- package/dist/clis/args/inspect.mjs +1 -1
- package/dist/clis/args/install-B0tMyUMw.d.mts +37 -0
- package/dist/clis/args/install-B0tMyUMw.d.mts.map +1 -0
- package/dist/clis/args/{install-Sz2DlCHh.mjs → install-F-27kF6m.mjs} +2 -2
- package/dist/clis/args/{install-Sz2DlCHh.mjs.map → install-F-27kF6m.mjs.map} +1 -1
- package/dist/clis/args/install.d.mts +3 -2
- package/dist/clis/args/install.mjs +1 -1
- package/dist/clis/args/{list-DM2d6f1m.mjs → list-Bkfn8Yuo.mjs} +2 -2
- package/dist/clis/args/{list-DM2d6f1m.mjs.map → list-Bkfn8Yuo.mjs.map} +1 -1
- package/dist/clis/args/list-DrbxA7JJ.d.mts +10 -0
- package/dist/clis/args/list-DrbxA7JJ.d.mts.map +1 -0
- package/dist/clis/args/list.d.mts +3 -2
- package/dist/clis/args/list.mjs +1 -1
- package/dist/clis/args/{login-DiKT5Jfu.mjs → login-CIFkQExi.mjs} +2 -2
- package/dist/clis/args/{login-DiKT5Jfu.mjs.map → login-CIFkQExi.mjs.map} +1 -1
- package/dist/clis/args/login-CXRJXg71.d.mts +25 -0
- package/dist/clis/args/login-CXRJXg71.d.mts.map +1 -0
- package/dist/clis/args/login.d.mts +3 -2
- package/dist/clis/args/login.mjs +1 -1
- package/dist/clis/args/migrate-DkCQRL2D.d.mts +19 -0
- package/dist/clis/args/migrate-DkCQRL2D.d.mts.map +1 -0
- package/dist/clis/args/{migrate-CG_gWc4k.mjs → migrate-DwJGhc2d.mjs} +2 -2
- package/dist/clis/args/{migrate-CG_gWc4k.mjs.map → migrate-DwJGhc2d.mjs.map} +1 -1
- package/dist/clis/args/migrate.d.mts +3 -2
- package/dist/clis/args/migrate.mjs +1 -1
- package/dist/clis/args/publish-CeW4bOrl.d.mts +16 -0
- package/dist/clis/args/publish-CeW4bOrl.d.mts.map +1 -0
- package/dist/clis/args/{publish-DDZYsUfV.mjs → publish-DHqlGWmL.mjs} +2 -2
- package/dist/clis/args/{publish-DDZYsUfV.mjs.map → publish-DHqlGWmL.mjs.map} +1 -1
- package/dist/clis/args/publish.d.mts +3 -2
- package/dist/clis/args/publish.mjs +1 -1
- package/dist/clis/args/{registry-C_OVFQmI.mjs → registry-DIwES3l2.mjs} +2 -2
- package/dist/clis/args/{registry-C_OVFQmI.mjs.map → registry-DIwES3l2.mjs.map} +1 -1
- package/dist/clis/args/registry-DNH8xuaE.d.mts +17 -0
- package/dist/clis/args/registry-DNH8xuaE.d.mts.map +1 -0
- package/dist/clis/args/registry.d.mts +3 -2
- package/dist/clis/args/registry.mjs +1 -1
- package/dist/clis/args/service-CHjY5epu.d.mts +27 -0
- package/dist/clis/args/service-CHjY5epu.d.mts.map +1 -0
- package/dist/clis/args/{service-CHOOr0Gg.mjs → service-Cpjlyeu5.mjs} +2 -2
- package/dist/clis/args/{service-CHOOr0Gg.mjs.map → service-Cpjlyeu5.mjs.map} +1 -1
- package/dist/clis/args/service.d.mts +3 -2
- package/dist/clis/args/service.mjs +1 -1
- package/dist/clis/args/{switchboard-Dsp7nosi.mjs → switchboard-CCaAtU56.mjs} +2 -2
- package/dist/clis/args/{switchboard-Dsp7nosi.mjs.map → switchboard-CCaAtU56.mjs.map} +1 -1
- package/dist/clis/args/switchboard-RrNb1fUH.d.mts +70 -0
- package/dist/clis/args/switchboard-RrNb1fUH.d.mts.map +1 -0
- package/dist/clis/args/switchboard.d.mts +3 -2
- package/dist/clis/args/switchboard.mjs +1 -1
- package/dist/clis/args/{uninstall-CTwTX0u_.mjs → uninstall-3U0B8g5c.mjs} +2 -2
- package/dist/clis/args/{uninstall-CTwTX0u_.mjs.map → uninstall-3U0B8g5c.mjs.map} +1 -1
- package/dist/clis/args/uninstall-CDx7lwxn.d.mts +28 -0
- package/dist/clis/args/uninstall-CDx7lwxn.d.mts.map +1 -0
- package/dist/clis/args/uninstall.d.mts +3 -2
- package/dist/clis/args/uninstall.mjs +1 -1
- package/dist/clis/args/unpublish-CEDsk6uv.d.mts +22 -0
- package/dist/clis/args/unpublish-CEDsk6uv.d.mts.map +1 -0
- package/dist/clis/args/{unpublish-BPMkGEg5.mjs → unpublish-s9zUh6Gw.mjs} +2 -2
- package/dist/clis/args/{unpublish-BPMkGEg5.mjs.map → unpublish-s9zUh6Gw.mjs.map} +1 -1
- package/dist/clis/args/unpublish.d.mts +3 -2
- package/dist/clis/args/unpublish.mjs +1 -1
- package/dist/clis/args/{vetra-b4KUu1Ax.mjs → vetra-BUNlAAPp.mjs} +2 -2
- package/dist/clis/args/{vetra-b4KUu1Ax.mjs.map → vetra-BUNlAAPp.mjs.map} +1 -1
- package/dist/clis/args/vetra-DkDaWFPi.d.mts +111 -0
- package/dist/clis/args/vetra-DkDaWFPi.d.mts.map +1 -0
- package/dist/clis/args/vetra-ports.test.d.mts +2 -1
- package/dist/clis/args/vetra-ports.test.mjs +7366 -5728
- package/dist/clis/args/vetra-ports.test.mjs.map +1 -1
- package/dist/clis/args/vetra.d.mts +3 -2
- package/dist/clis/args/vetra.mjs +1 -1
- package/dist/clis/build-config-CR5lvv_A.mjs +231 -0
- package/dist/clis/build-config-CR5lvv_A.mjs.map +1 -0
- package/dist/clis/build-config.d.mts +44 -10614
- 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 +100 -0
- package/dist/clis/build-pieces.d.mts.map +1 -0
- package/dist/clis/build-pieces.mjs +371 -0
- package/dist/clis/build-pieces.mjs.map +1 -0
- package/dist/clis/command-names.d.mts +2 -2
- package/dist/clis/command-names.d.mts.map +1 -1
- package/dist/clis/command-names.mjs.map +1 -1
- package/dist/clis/constants.d.mts +3 -462
- package/dist/clis/constants.mjs +27 -10
- package/dist/clis/constants.mjs.map +1 -1
- package/dist/clis/index-6CZwrmQi.d.mts +11154 -0
- package/dist/clis/index-6CZwrmQi.d.mts.map +1 -0
- package/dist/clis/index.d.mts +1385 -1224
- package/dist/clis/index.d.mts.map +1 -1
- package/dist/clis/index.mjs +259 -74
- package/dist/clis/index.mjs.map +1 -1
- package/dist/clis/project-env.d.mts +4 -4
- package/dist/clis/project-env.d.mts.map +1 -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/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-Cc_rB0Yx.d.mts +541 -0
- package/dist/clis/types-Cc_rB0Yx.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-CXhzL512.js} +33 -8
- package/dist/config-loader-CXhzL512.js.map +1 -0
- package/dist/connect/config-loader.d.ts +15 -8
- package/dist/connect/config-loader.d.ts.map +1 -1
- package/dist/connect/config-loader.js +2 -2
- package/dist/connect/index.d.ts +198 -57
- package/dist/connect/index.d.ts.map +1 -1
- package/dist/connect/index.js +313 -31
- 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/constants-C2K-m7pp.d.ts +9 -0
- package/dist/constants-C2K-m7pp.d.ts.map +1 -0
- package/dist/constants.d.ts +3 -2
- package/dist/constants.js +10 -5
- package/dist/constants.js.map +1 -1
- package/dist/document-drive/index.d.ts +131 -105
- package/dist/document-drive/index.d.ts.map +1 -1
- package/dist/document-drive/index.js +116 -54
- package/dist/document-drive/index.js.map +1 -1
- 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 +5 -4
- package/dist/document-model/index.js +295 -390
- package/dist/document-model/index.js.map +1 -1
- 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 +3 -2
- package/dist/document-model/utils.js +1 -1
- 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/index-BhqNGLu9.d.ts +36 -0
- package/dist/index-BhqNGLu9.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 +63 -4
- package/dist/processors/index.js.map +1 -1
- package/dist/purge-v06m_oGz.js +381 -0
- package/dist/purge-v06m_oGz.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 +24 -6
- 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/{types-CpnWmiFY.d.ts → types-BRJfX8ck.d.ts} +2003 -821
- package/dist/types-BRJfX8ck.d.ts.map +1 -0
- package/dist/{types-YqLqb0Zb.d.ts → types-BTfv_ZzS.d.ts} +39 -43
- package/dist/types-BTfv_ZzS.d.ts.map +1 -0
- package/dist/{types-C1in4fl3.d.ts → types-Bsp8VL2y.d.ts} +2 -2
- package/dist/types-Bsp8VL2y.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/version-BxLITo9P.d.ts +6 -0
- package/dist/version-BxLITo9P.d.ts.map +1 -0
- package/package.json +11 -6
- 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/common-CcYbXrBx.mjs.map +0 -1
- package/dist/clis/args/common-Y8yh4ax1.d.mts +0 -183
- package/dist/clis/args/common-Y8yh4ax1.d.mts.map +0 -1
- package/dist/clis/args/connect-BUwHSfdh.d.mts +0 -443
- package/dist/clis/args/connect-BUwHSfdh.d.mts.map +0 -1
- package/dist/clis/args/connect-BVVvCmL9.mjs.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-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/inspect-DtZeoA5c.d.mts +0 -15
- package/dist/clis/args/inspect-DtZeoA5c.d.mts.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/list-BGf8s_gj.d.mts +0 -12
- package/dist/clis/args/list-BGf8s_gj.d.mts.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/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-sixkWhxm.d.mts +0 -21
- package/dist/clis/args/migrate-sixkWhxm.d.mts.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_RfTsKB.d.mts +0 -19
- package/dist/clis/args/registry-C_RfTsKB.d.mts.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/uninstall-BpA3YYbw.d.mts +0 -31
- package/dist/clis/args/uninstall-BpA3YYbw.d.mts.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-DUhIB7Zk.d.mts +0 -113
- package/dist/clis/args/vetra-DUhIB7Zk.d.mts.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/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.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
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
import { f as IAnalyticsStore } from "./types-
|
|
2
|
-
import
|
|
1
|
+
import { f as IAnalyticsStore } from "./types-Bsp8VL2y.js";
|
|
2
|
+
import "./utils-BrKxCmKx.js";
|
|
3
|
+
import { ZodIssue, ZodRawShape, z } from "zod";
|
|
3
4
|
import { Draft } from "mutative";
|
|
4
|
-
import
|
|
5
|
+
import { Kysely, QueryCreator } from "kysely";
|
|
5
6
|
import { ArgParser } from "cmd-ts/dist/cjs/argparser.js";
|
|
6
|
-
import * as cmd_ts_dist_cjs_helpdoc_js0 from "cmd-ts/dist/cjs/helpdoc.js";
|
|
7
|
-
import * as cmd_ts_dist_cjs_runner_js0 from "cmd-ts/dist/cjs/runner.js";
|
|
8
7
|
import { Agent } from "package-manager-detector";
|
|
9
8
|
import { OperationWithContext } from "@powerhousedao/shared/document-model";
|
|
10
|
-
import { Kysely, QueryCreator } from "kysely";
|
|
11
9
|
import { IncomingMessage, ServerResponse } from "node:http";
|
|
12
10
|
import { FC, ReactNode } from "react";
|
|
13
|
-
|
|
14
11
|
//#region clis/args/common.d.ts
|
|
15
|
-
declare const getPackageManagerCommand: Partial<
|
|
16
|
-
parse(context:
|
|
12
|
+
declare const getPackageManagerCommand: Partial<import("cmd-ts/dist/cjs/argparser.js").Register> & {
|
|
13
|
+
parse(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<{
|
|
17
14
|
packageManager: Agent | undefined;
|
|
18
15
|
npm: boolean | undefined;
|
|
19
16
|
pnpm: boolean | undefined;
|
|
20
17
|
yarn: boolean | undefined;
|
|
21
18
|
bun: boolean | undefined;
|
|
22
19
|
}>>;
|
|
23
|
-
} &
|
|
20
|
+
} & 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<{
|
|
24
21
|
packageManager: Agent | undefined;
|
|
25
22
|
npm: boolean | undefined;
|
|
26
23
|
pnpm: boolean | undefined;
|
|
@@ -33,14 +30,14 @@ declare const getPackageManagerCommand: Partial<cmd_ts_dist_cjs_argparser_js0.Re
|
|
|
33
30
|
yarn: boolean | undefined;
|
|
34
31
|
bun: boolean | undefined;
|
|
35
32
|
}> & {
|
|
36
|
-
run(context:
|
|
33
|
+
run(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<{
|
|
37
34
|
packageManager: Agent | undefined;
|
|
38
35
|
npm: boolean | undefined;
|
|
39
36
|
pnpm: boolean | undefined;
|
|
40
37
|
yarn: boolean | undefined;
|
|
41
38
|
bun: boolean | undefined;
|
|
42
39
|
}>>;
|
|
43
|
-
} & Partial<
|
|
40
|
+
} & 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>;
|
|
44
41
|
//#endregion
|
|
45
42
|
//#region processors/constants.d.ts
|
|
46
43
|
declare const PROCESSOR_APPS: readonly ["connect", "switchboard"];
|
|
@@ -79,7 +76,8 @@ type PHDocumentSignatureInfo = {
|
|
|
79
76
|
/**
|
|
80
77
|
* The public key of the document creator.
|
|
81
78
|
**/
|
|
82
|
-
publicKey: JsonWebKey;
|
|
79
|
+
publicKey: JsonWebKey;
|
|
80
|
+
/** The nonce that was appended to the message to create the signature. */
|
|
83
81
|
nonce: string;
|
|
84
82
|
};
|
|
85
83
|
/** Joins a signature's params for transport. Already-joined input passes through. */
|
|
@@ -96,11 +94,200 @@ declare function deserializeSignature(signature: Signature | string): Signature;
|
|
|
96
94
|
* Configuration for hashing document state in operations.
|
|
97
95
|
*/
|
|
98
96
|
type HashConfig = {
|
|
99
|
-
/** The hashing algorithm to use (e.g., "sha1", "sha256") */
|
|
100
|
-
|
|
97
|
+
/** The hashing algorithm to use (e.g., "sha1", "sha256") */
|
|
98
|
+
algorithm: string;
|
|
99
|
+
/** The encoding format for the hash output (e.g., "base64", "hex") */
|
|
100
|
+
encoding: string;
|
|
101
|
+
/** Optional algorithm-specific parameters */
|
|
101
102
|
params?: Record<string, unknown>;
|
|
102
103
|
};
|
|
103
104
|
//#endregion
|
|
105
|
+
//#region document-model/operations.d.ts
|
|
106
|
+
declare function setNameOperation<TDocument extends PHDocument>(document: TDocument, input: {
|
|
107
|
+
name: string;
|
|
108
|
+
}): TDocument & {
|
|
109
|
+
header: {
|
|
110
|
+
name: string;
|
|
111
|
+
id: string;
|
|
112
|
+
sig: PHDocumentSignatureInfo;
|
|
113
|
+
documentType: string;
|
|
114
|
+
createdAtUtcIso: string;
|
|
115
|
+
slug: string;
|
|
116
|
+
branch: string;
|
|
117
|
+
revision: {
|
|
118
|
+
[scope: string]: number;
|
|
119
|
+
};
|
|
120
|
+
lastModifiedAtUtcIso: string;
|
|
121
|
+
protocolVersions?: {
|
|
122
|
+
[key: string]: number;
|
|
123
|
+
};
|
|
124
|
+
meta?: PHDocumentMeta;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
declare function setPreferredEditorOperation<TDocument extends PHDocument>(document: TDocument, input: {
|
|
128
|
+
preferredEditor: string | null;
|
|
129
|
+
}): TDocument;
|
|
130
|
+
declare function undoOperation<TDocument extends PHDocument>(document: TDocument, action: Action, skip: number): {
|
|
131
|
+
document: TDocument;
|
|
132
|
+
action: Action;
|
|
133
|
+
skip: number;
|
|
134
|
+
reuseLastOperationIndex: boolean;
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* V2 of undoOperation for protocol version 2+.
|
|
138
|
+
* Key differences from undoOperation:
|
|
139
|
+
* - Never reuses operation index (always increments)
|
|
140
|
+
* - Always sets skip=1 (consecutive NOOPs are handled during rebuild/GC)
|
|
141
|
+
* - No complex skip calculation - simpler model where each UNDO is independent
|
|
142
|
+
*/
|
|
143
|
+
declare function undoOperationV2<TDocument extends PHDocument>(document: TDocument, action: Action, skip: number): {
|
|
144
|
+
document: TDocument;
|
|
145
|
+
action: Action;
|
|
146
|
+
skip: number;
|
|
147
|
+
reuseLastOperationIndex: false;
|
|
148
|
+
};
|
|
149
|
+
declare function redoOperation<TDocument extends PHDocument>(document: TDocument, action: Action, skip: number): {
|
|
150
|
+
document: TDocument;
|
|
151
|
+
action: Action;
|
|
152
|
+
skip: number;
|
|
153
|
+
reuseLastOperationIndex: boolean;
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* An operation that was applied to a {@link BaseDocument}.
|
|
157
|
+
*
|
|
158
|
+
* @remarks
|
|
159
|
+
* Wraps an action with an index, to be added to the operations history of a Document.
|
|
160
|
+
* The `index` field is used to keep all operations in order and enable replaying the
|
|
161
|
+
* document's history from the beginning. Note that indices and skips are relative to
|
|
162
|
+
* a specific reactor. Example below:
|
|
163
|
+
*
|
|
164
|
+
* For (index, skip, ts, action)
|
|
165
|
+
* A - [(0, 0, 1, "A0"), (1, 0, 2, "A1")]
|
|
166
|
+
* B - [(0, 0, 0, "B0"), (1, 0, 3, "B1")]
|
|
167
|
+
* ...
|
|
168
|
+
* B gets A's Operations Scenario:
|
|
169
|
+
* B' - [(0, 0, 0, "B0"), (1, 0, 3, "B1"), (2, 1, 1, "A0"), (3, 0, 2, "A1"), (4, 0, 3, "B1")]
|
|
170
|
+
* Then A needs to end up with:
|
|
171
|
+
* 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")]
|
|
172
|
+
* So that both A and B end up with the stream of actions (action):
|
|
173
|
+
* [("B0"), ("A0"), ("A1"), ("B1")]
|
|
174
|
+
*
|
|
175
|
+
* @typeParam A - The type of the action.
|
|
176
|
+
*/
|
|
177
|
+
type Operation = {
|
|
178
|
+
/**
|
|
179
|
+
* This is a stable id, derived from various document and action properties
|
|
180
|
+
* in deriveOperationId().
|
|
181
|
+
*
|
|
182
|
+
* It _cannot_ be an arbitrary string.
|
|
183
|
+
*
|
|
184
|
+
* It it also not unique per operation, as reshuffled operations will keep'
|
|
185
|
+
* the same id they had before they were reshuffled. This means that the
|
|
186
|
+
* IOperationStore may have multiple operations with the same operation id.
|
|
187
|
+
**/
|
|
188
|
+
id: string;
|
|
189
|
+
/** Position of the operation in the history. This is relative to a specific reactor -- they may not all agree on this value. */
|
|
190
|
+
index: number;
|
|
191
|
+
/** The number of operations skipped with this Operation. This is relative to a specific reactor -- they may not all agree on this value. */
|
|
192
|
+
skip: number;
|
|
193
|
+
/** Timestamp of when the operation was added */
|
|
194
|
+
timestampUtcMs: string;
|
|
195
|
+
/** Hash of the resulting document data after the operation */
|
|
196
|
+
hash: string;
|
|
197
|
+
/** Error message for a failed action */
|
|
198
|
+
error?: string;
|
|
199
|
+
/**
|
|
200
|
+
* If authorization rejected the action, this records the reason why.
|
|
201
|
+
*/
|
|
202
|
+
deniedReason?: string;
|
|
203
|
+
/** The resulting state after the operation */
|
|
204
|
+
resultingState?: string;
|
|
205
|
+
/**
|
|
206
|
+
* The action that was applied to the document to produce this operation.
|
|
207
|
+
*/
|
|
208
|
+
action: Action;
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* The operations history of the document by scope.
|
|
212
|
+
*
|
|
213
|
+
* This will be removed in a future release.
|
|
214
|
+
*
|
|
215
|
+
* TODO: Type should be Partial<Record<string, Operation[]>>,
|
|
216
|
+
* but that is a breaking change for codegen + external doc models.
|
|
217
|
+
*/
|
|
218
|
+
type DocumentOperations = Record<string, Operation[]>;
|
|
219
|
+
/**
|
|
220
|
+
* What happened to an operation. An operation that is not `applied` still
|
|
221
|
+
* occupies its index but contributes nothing to the document's state.
|
|
222
|
+
*/
|
|
223
|
+
type OperationOutcome = {
|
|
224
|
+
kind: "applied";
|
|
225
|
+
} | {
|
|
226
|
+
kind: "reducer-error";
|
|
227
|
+
message: string;
|
|
228
|
+
} | {
|
|
229
|
+
kind: "denied";
|
|
230
|
+
reason: string;
|
|
231
|
+
};
|
|
232
|
+
/**
|
|
233
|
+
* Reads an operation's outcome. A denial takes precedence over a reducer
|
|
234
|
+
* error, since a denied operation never reaches its reducer.
|
|
235
|
+
*/
|
|
236
|
+
declare function operationOutcome(operation: Operation): OperationOutcome;
|
|
237
|
+
type OperationContext = {
|
|
238
|
+
documentId: string;
|
|
239
|
+
documentType: string;
|
|
240
|
+
scope: string;
|
|
241
|
+
branch: string;
|
|
242
|
+
resultingState?: string;
|
|
243
|
+
ordinal: number;
|
|
244
|
+
};
|
|
245
|
+
type OperationWithContext$1 = {
|
|
246
|
+
operation: Operation;
|
|
247
|
+
context: OperationContext;
|
|
248
|
+
};
|
|
249
|
+
//#endregion
|
|
250
|
+
//#region document-model/signature-policy.d.ts
|
|
251
|
+
/** The `protocolVersions` key that fixes a document's signature requirement. */
|
|
252
|
+
declare const SIGNATURE_PROTOCOL = "signature";
|
|
253
|
+
/** `protocolVersions.signature` of a document that requires v2 tuples. */
|
|
254
|
+
declare const SIGNATURE_PROTOCOL_V2 = 2;
|
|
255
|
+
/** `v2-required`: v2 tuples only and a content-addressed id. */
|
|
256
|
+
type SignaturePolicy$1 = "legacy" | "v2-required";
|
|
257
|
+
/** What a new document is created as unless the caller or host says otherwise. */
|
|
258
|
+
declare const DEFAULT_SIGNATURE_POLICY: SignaturePolicy$1;
|
|
259
|
+
declare function isSignaturePolicy(value: unknown): value is SignaturePolicy$1;
|
|
260
|
+
type ProtocolVersions = {
|
|
261
|
+
[protocol: string]: number;
|
|
262
|
+
};
|
|
263
|
+
/** Read from a header, a CREATE_DOCUMENT input or a bare map. */
|
|
264
|
+
declare function signaturePolicyOf(source: {
|
|
265
|
+
protocolVersions?: ProtocolVersions | null;
|
|
266
|
+
} | ProtocolVersions | null | undefined): SignaturePolicy$1;
|
|
267
|
+
/** `protocolVersions` for a new v2-required document. */
|
|
268
|
+
declare function v2RequiredProtocolVersions(base?: ProtocolVersions): ProtocolVersions;
|
|
269
|
+
/**
|
|
270
|
+
* The policy a create call asks for: `signaturePolicy`, else the `signature`
|
|
271
|
+
* key of its `protocolVersions`, else `fallback`, the host's default.
|
|
272
|
+
*/
|
|
273
|
+
declare function requestedSignaturePolicy(request: {
|
|
274
|
+
signaturePolicy?: SignaturePolicy$1;
|
|
275
|
+
protocolVersions?: ProtocolVersions;
|
|
276
|
+
} | undefined, fallback: SignaturePolicy$1): SignaturePolicy$1;
|
|
277
|
+
/** `protocolVersions` for a new document under `policy`, over `base`. */
|
|
278
|
+
declare function protocolVersionsFor(policy: SignaturePolicy$1, base?: ProtocolVersions): ProtocolVersions;
|
|
279
|
+
/** What the id of a v2-required document is a hash of. */
|
|
280
|
+
type DocumentIdParams = {
|
|
281
|
+
documentType: string;
|
|
282
|
+
createdAtUtcIso: string;
|
|
283
|
+
nonce: string;
|
|
284
|
+
protocolVersions: ProtocolVersions;
|
|
285
|
+
};
|
|
286
|
+
/** `base64url(sha256(canonicalJson(params)))`, unpadded. */
|
|
287
|
+
declare function deriveDocumentId(params: DocumentIdParams): string;
|
|
288
|
+
/** Whether `id` has the shape `deriveDocumentId` produces. */
|
|
289
|
+
declare function isDerivedDocumentId(id: string): boolean;
|
|
290
|
+
//#endregion
|
|
104
291
|
//#region document-model/state.d.ts
|
|
105
292
|
/**
|
|
106
293
|
* Creates a default PHAuthState
|
|
@@ -140,11 +327,16 @@ type PHDocumentState = {
|
|
|
140
327
|
* with the UPGRADE_DOCUMENT operation to specify the DocumentModelModule
|
|
141
328
|
* version to use for reducer execution.
|
|
142
329
|
*/
|
|
143
|
-
version: number;
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
330
|
+
version: number;
|
|
331
|
+
/** Hash configuration for operation state verification */
|
|
332
|
+
hash: HashConfig;
|
|
333
|
+
/** True if and only if the document has been deleted */
|
|
334
|
+
isDeleted?: boolean;
|
|
335
|
+
/** The timestamp when the document was deleted, in UTC ISO format */
|
|
336
|
+
deletedAtUtcIso?: string;
|
|
337
|
+
/** Optional: who deleted the document */
|
|
338
|
+
deletedBy?: string;
|
|
339
|
+
/** Optional: reason for deletion */
|
|
148
340
|
deletionReason?: string;
|
|
149
341
|
};
|
|
150
342
|
/**
|
|
@@ -167,7 +359,8 @@ type PHAuthState = {
|
|
|
167
359
|
creator?: string;
|
|
168
360
|
};
|
|
169
361
|
type Grant = {
|
|
170
|
-
/** Stable id. */
|
|
362
|
+
/** Stable id. */
|
|
363
|
+
id: string;
|
|
171
364
|
description: string;
|
|
172
365
|
effect: "allow" | "deny";
|
|
173
366
|
principal: Principal;
|
|
@@ -252,7 +445,9 @@ type Operand = {
|
|
|
252
445
|
* The base state of the document.
|
|
253
446
|
*/
|
|
254
447
|
type PHBaseState = {
|
|
255
|
-
/** Carries authentication information. */
|
|
448
|
+
/** Carries authentication information. */
|
|
449
|
+
auth: PHAuthState;
|
|
450
|
+
/** Carries information about the document. */
|
|
256
451
|
document: PHDocumentState;
|
|
257
452
|
};
|
|
258
453
|
declare function defaultGlobalState(): DocumentModelGlobalState;
|
|
@@ -262,183 +457,47 @@ declare function createGlobalState(state?: Partial<DocumentModelGlobalState>): D
|
|
|
262
457
|
declare function createLocalState(state?: Partial<DocumentModelLocalState>): DocumentModelLocalState;
|
|
263
458
|
declare function createState(baseState?: Partial<PHBaseState>, globalState?: Partial<DocumentModelGlobalState>, localState?: Partial<DocumentModelLocalState>): DocumentModelPHState;
|
|
264
459
|
//#endregion
|
|
265
|
-
//#region document-model/
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
name: string;
|
|
271
|
-
id: string;
|
|
272
|
-
sig: PHDocumentSignatureInfo;
|
|
273
|
-
documentType: string;
|
|
274
|
-
createdAtUtcIso: string;
|
|
275
|
-
slug: string;
|
|
276
|
-
branch: string;
|
|
277
|
-
revision: {
|
|
278
|
-
[scope: string]: number;
|
|
279
|
-
};
|
|
280
|
-
lastModifiedAtUtcIso: string;
|
|
281
|
-
protocolVersions?: {
|
|
282
|
-
[key: string]: number;
|
|
283
|
-
};
|
|
284
|
-
meta?: PHDocumentMeta;
|
|
285
|
-
};
|
|
286
|
-
};
|
|
287
|
-
declare function setPreferredEditorOperation<TDocument extends PHDocument>(document: TDocument, input: {
|
|
288
|
-
preferredEditor: string | null;
|
|
289
|
-
}): TDocument;
|
|
290
|
-
declare function undoOperation<TDocument extends PHDocument>(document: TDocument, action: Action, skip: number): {
|
|
291
|
-
document: TDocument;
|
|
292
|
-
action: Action;
|
|
293
|
-
skip: number;
|
|
294
|
-
reuseLastOperationIndex: boolean;
|
|
295
|
-
};
|
|
296
|
-
/**
|
|
297
|
-
* V2 of undoOperation for protocol version 2+.
|
|
298
|
-
* Key differences from undoOperation:
|
|
299
|
-
* - Never reuses operation index (always increments)
|
|
300
|
-
* - Always sets skip=1 (consecutive NOOPs are handled during rebuild/GC)
|
|
301
|
-
* - No complex skip calculation - simpler model where each UNDO is independent
|
|
302
|
-
*/
|
|
303
|
-
declare function undoOperationV2<TDocument extends PHDocument>(document: TDocument, action: Action, skip: number): {
|
|
304
|
-
document: TDocument;
|
|
305
|
-
action: Action;
|
|
306
|
-
skip: number;
|
|
307
|
-
reuseLastOperationIndex: false;
|
|
308
|
-
};
|
|
309
|
-
declare function redoOperation<TDocument extends PHDocument>(document: TDocument, action: Action, skip: number): {
|
|
310
|
-
document: TDocument;
|
|
311
|
-
action: Action;
|
|
312
|
-
skip: number;
|
|
313
|
-
reuseLastOperationIndex: boolean;
|
|
460
|
+
//#region document-model/documents.d.ts
|
|
461
|
+
/** Meta information about the document. */
|
|
462
|
+
type PHDocumentMeta = {
|
|
463
|
+
/** The preferred editor for the document. */
|
|
464
|
+
preferredEditor?: string;
|
|
314
465
|
};
|
|
315
|
-
declare function loadStateOperation<TState extends PHBaseState>(document: PHDocument<TState>, action: LoadStateActionInput): PHDocument<TState>;
|
|
316
466
|
/**
|
|
317
|
-
*
|
|
318
|
-
*
|
|
319
|
-
* @remarks
|
|
320
|
-
* Wraps an action with an index, to be added to the operations history of a Document.
|
|
321
|
-
* The `index` field is used to keep all operations in order and enable replaying the
|
|
322
|
-
* document's history from the beginning. Note that indices and skips are relative to
|
|
323
|
-
* a specific reactor. Example below:
|
|
324
|
-
*
|
|
325
|
-
* For (index, skip, ts, action)
|
|
326
|
-
* A - [(0, 0, 1, "A0"), (1, 0, 2, "A1")]
|
|
327
|
-
* B - [(0, 0, 0, "B0"), (1, 0, 3, "B1")]
|
|
328
|
-
* ...
|
|
329
|
-
* B gets A's Operations Scenario:
|
|
330
|
-
* B' - [(0, 0, 0, "B0"), (1, 0, 3, "B1"), (2, 1, 1, "A0"), (3, 0, 2, "A1"), (4, 0, 3, "B1")]
|
|
331
|
-
* Then A needs to end up with:
|
|
332
|
-
* A' - [(0, 0, 1, "A0"), (1, 0, 2, "A1"), (2, 2, 0, "B0"), (3, 0, 1, "A0"), (4, 0, 2, "A1"), (5, 0, 3, "B1")]
|
|
333
|
-
* So that both A and B end up with the stream of actions (action):
|
|
334
|
-
* [("B0"), ("A0"), ("A1"), ("B1")]
|
|
335
|
-
*
|
|
336
|
-
* @typeParam A - The type of the action.
|
|
467
|
+
* The header of a document.
|
|
337
468
|
*/
|
|
338
|
-
type
|
|
469
|
+
type PHDocumentHeader = {
|
|
339
470
|
/**
|
|
340
|
-
*
|
|
341
|
-
* in deriveOperationId().
|
|
471
|
+
* The id of the document.
|
|
342
472
|
*
|
|
343
|
-
*
|
|
473
|
+
* This is a Ed25519 signature and is immutable.
|
|
474
|
+
**/
|
|
475
|
+
id: string;
|
|
476
|
+
/**
|
|
477
|
+
* Information to verify the document creator.
|
|
344
478
|
*
|
|
345
|
-
*
|
|
346
|
-
* the same id they had before they were reshuffled. This means that the
|
|
347
|
-
* IOperationStore may have multiple operations with the same operation id.
|
|
479
|
+
* This is immutable.
|
|
348
480
|
**/
|
|
349
|
-
|
|
350
|
-
index: number; /** The number of operations skipped with this Operation. This is relative to a specific reactor -- they may not all agree on this value. */
|
|
351
|
-
skip: number; /** Timestamp of when the operation was added */
|
|
352
|
-
timestampUtcMs: string; /** Hash of the resulting document data after the operation */
|
|
353
|
-
hash: string; /** Error message for a failed action */
|
|
354
|
-
error?: string;
|
|
481
|
+
sig: PHDocumentSignatureInfo;
|
|
355
482
|
/**
|
|
356
|
-
*
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
*/
|
|
363
|
-
action: Action;
|
|
364
|
-
};
|
|
365
|
-
/**
|
|
366
|
-
* The operations history of the document by scope.
|
|
367
|
-
*
|
|
368
|
-
* This will be removed in a future release.
|
|
369
|
-
*
|
|
370
|
-
* TODO: Type should be Partial<Record<string, Operation[]>>,
|
|
371
|
-
* but that is a breaking change for codegen + external doc models.
|
|
372
|
-
*/
|
|
373
|
-
type DocumentOperations = Record<string, Operation[]>;
|
|
374
|
-
/**
|
|
375
|
-
* What happened to an operation. An operation that is not `applied` still
|
|
376
|
-
* occupies its index but contributes nothing to the document's state.
|
|
377
|
-
*/
|
|
378
|
-
type OperationOutcome = {
|
|
379
|
-
kind: "applied";
|
|
380
|
-
} | {
|
|
381
|
-
kind: "reducer-error";
|
|
382
|
-
message: string;
|
|
383
|
-
} | {
|
|
384
|
-
kind: "denied";
|
|
385
|
-
reason: string;
|
|
386
|
-
};
|
|
387
|
-
/**
|
|
388
|
-
* Reads an operation's outcome. A denial takes precedence over a reducer
|
|
389
|
-
* error, since a denied operation never reaches its reducer.
|
|
390
|
-
*/
|
|
391
|
-
declare function operationOutcome(operation: Operation): OperationOutcome;
|
|
392
|
-
type OperationContext = {
|
|
393
|
-
documentId: string;
|
|
394
|
-
documentType: string;
|
|
395
|
-
scope: string;
|
|
396
|
-
branch: string;
|
|
397
|
-
resultingState?: string;
|
|
398
|
-
ordinal: number;
|
|
399
|
-
};
|
|
400
|
-
type OperationWithContext$1 = {
|
|
401
|
-
operation: Operation;
|
|
402
|
-
context: OperationContext;
|
|
403
|
-
};
|
|
404
|
-
//#endregion
|
|
405
|
-
//#region document-model/documents.d.ts
|
|
406
|
-
/** Meta information about the document. */
|
|
407
|
-
type PHDocumentMeta = {
|
|
408
|
-
/** The preferred editor for the document. */preferredEditor?: string;
|
|
409
|
-
};
|
|
410
|
-
/**
|
|
411
|
-
* The header of a document.
|
|
412
|
-
*/
|
|
413
|
-
type PHDocumentHeader = {
|
|
414
|
-
/**
|
|
415
|
-
* The id of the document.
|
|
416
|
-
*
|
|
417
|
-
* This is a Ed25519 signature and is immutable.
|
|
418
|
-
**/
|
|
419
|
-
id: string;
|
|
420
|
-
/**
|
|
421
|
-
* Information to verify the document creator.
|
|
422
|
-
*
|
|
423
|
-
* This is immutable.
|
|
424
|
-
**/
|
|
425
|
-
sig: PHDocumentSignatureInfo;
|
|
426
|
-
/**
|
|
427
|
-
* The type of the document.
|
|
428
|
-
*
|
|
429
|
-
* This is used as part of the signature payload and thus, cannot be changed
|
|
430
|
-
* after the document header has been created.
|
|
431
|
-
**/
|
|
432
|
-
documentType: string;
|
|
483
|
+
* The type of the document.
|
|
484
|
+
*
|
|
485
|
+
* This is used as part of the signature payload and thus, cannot be changed
|
|
486
|
+
* after the document header has been created.
|
|
487
|
+
**/
|
|
488
|
+
documentType: string;
|
|
433
489
|
/**
|
|
434
490
|
* The timestamp of the creation date of the document, in UTC ISO format.
|
|
435
491
|
*
|
|
436
492
|
* This is used as part of the signature payload and thus, cannot be changed
|
|
437
493
|
* after the document header has been created.
|
|
438
494
|
**/
|
|
439
|
-
createdAtUtcIso: string;
|
|
440
|
-
|
|
441
|
-
|
|
495
|
+
createdAtUtcIso: string;
|
|
496
|
+
/** The slug of the document. */
|
|
497
|
+
slug: string;
|
|
498
|
+
/** The name of the document. */
|
|
499
|
+
name: string;
|
|
500
|
+
/** The branch of this document. */
|
|
442
501
|
branch: string;
|
|
443
502
|
/**
|
|
444
503
|
* The revision of each scope of the document. This object is updated every
|
|
@@ -461,7 +520,8 @@ type PHDocumentHeader = {
|
|
|
461
520
|
*/
|
|
462
521
|
protocolVersions?: {
|
|
463
522
|
[key: string]: number;
|
|
464
|
-
};
|
|
523
|
+
};
|
|
524
|
+
/** Meta information about the document. */
|
|
465
525
|
meta?: PHDocumentMeta;
|
|
466
526
|
};
|
|
467
527
|
/**
|
|
@@ -473,7 +533,9 @@ type PHDocumentHeader = {
|
|
|
473
533
|
* @typeParam TState - The type of the document state.
|
|
474
534
|
*/
|
|
475
535
|
type PHDocument<TState extends PHBaseState = PHBaseState> = {
|
|
476
|
-
/** The header of the document. */
|
|
536
|
+
/** The header of the document. */
|
|
537
|
+
header: PHDocumentHeader;
|
|
538
|
+
/** The document model specific state. */
|
|
477
539
|
state: TState;
|
|
478
540
|
/**
|
|
479
541
|
* The initial state of the document, enabling replaying operations.
|
|
@@ -504,9 +566,23 @@ declare function isUndo(action: Action): action is UndoAction;
|
|
|
504
566
|
declare function isDocumentAction(action: Action): action is DocumentAction;
|
|
505
567
|
/**
|
|
506
568
|
* Creates a new document. When `documentType` is given the header is stamped
|
|
507
|
-
* with it and the document-scope operations are seeded.
|
|
569
|
+
* with it and the document-scope operations are seeded. Without
|
|
570
|
+
* `protocolVersions` the document is v2-required and takes a derived id; with
|
|
571
|
+
* them it is v2-required only if they say so (see {@link protocolVersionsFor}).
|
|
572
|
+
*/
|
|
573
|
+
declare function baseCreateDocument<TState extends PHBaseState = PHBaseState>(createState: CreateState<TState>, initialState?: Partial<TState>, documentType?: string, protocolVersions?: ProtocolVersions): PHDocument<TState>;
|
|
574
|
+
/**
|
|
575
|
+
* `document`, not yet created, under a fresh header for `policy`. A legacy
|
|
576
|
+
* header takes `id` when given; a v2-required one ignores `id` and derives its
|
|
577
|
+
* own, so a caller that needs a fixed id must ask for legacy.
|
|
578
|
+
* `protocolVersions` are merged over the document's. Name, slug, branch and
|
|
579
|
+
* meta carry over. A document already under `policy` is returned as is unless
|
|
580
|
+
* a legacy `id` or `protocolVersions` are given.
|
|
508
581
|
*/
|
|
509
|
-
declare function
|
|
582
|
+
declare function withSignaturePolicy<TDocument extends PHDocument>(document: TDocument, policy: SignaturePolicy$1, options?: {
|
|
583
|
+
id?: string;
|
|
584
|
+
protocolVersions?: ProtocolVersions;
|
|
585
|
+
}): TDocument;
|
|
510
586
|
declare function hashDocumentStateForScope(document: {
|
|
511
587
|
state: {
|
|
512
588
|
[key: string]: unknown;
|
|
@@ -670,31 +746,6 @@ declare const undo: (count?: number, scope?: string) => UndoAction;
|
|
|
670
746
|
* @category Actions
|
|
671
747
|
*/
|
|
672
748
|
declare const redo: (count?: number, scope?: string) => RedoAction;
|
|
673
|
-
/**
|
|
674
|
-
* Joins multiple operations into a single {@link loadState | LOAD_STATE} operation.
|
|
675
|
-
*
|
|
676
|
-
* @remarks
|
|
677
|
-
* Useful to keep operations history smaller. Operations to prune are selected by index,
|
|
678
|
-
* similar to the {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice | slice} method in Arrays.
|
|
679
|
-
*
|
|
680
|
-
* @param start - Index of the first operation to prune
|
|
681
|
-
* @param end - Index of the last operation to prune
|
|
682
|
-
* @category Actions
|
|
683
|
-
*/
|
|
684
|
-
declare const prune: (start?: number, end?: number, scope?: string) => SchemaPruneAction;
|
|
685
|
-
/**
|
|
686
|
-
* Replaces the state of the document.
|
|
687
|
-
*
|
|
688
|
-
* @remarks
|
|
689
|
-
* This action shouldn't be used directly. It is dispatched by the {@link prune} action.
|
|
690
|
-
*
|
|
691
|
-
* @param state - State to be set in the document.
|
|
692
|
-
* @param operations - Number of operations that were removed from the previous state.
|
|
693
|
-
* @category Actions
|
|
694
|
-
*/
|
|
695
|
-
declare const loadState: <TState extends PHBaseState = PHBaseState>(state: TState & {
|
|
696
|
-
name: string;
|
|
697
|
-
}, operations: number) => LoadStateAction;
|
|
698
749
|
declare const noop: (scope?: string) => NOOPAction;
|
|
699
750
|
/**
|
|
700
751
|
* Helper function to be used by action creators.
|
|
@@ -730,7 +781,9 @@ declare const operationWithContext: (operation: Operation, context: ActionContex
|
|
|
730
781
|
declare const actionContext: () => ActionContext;
|
|
731
782
|
declare const actionSigner: (user: UserActionSigner, app: AppActionSigner, signatures?: Signature[]) => ActionSigner;
|
|
732
783
|
declare function buildOperationSignature(context: ActionSignatureContext, signMethod: ActionSigningHandler): Promise<Signature>;
|
|
784
|
+
/** @deprecated Emits a legacy SHA-1 tuple; sign through `ISigner.signAction`. */
|
|
733
785
|
declare function buildSignedAction<TState extends PHBaseState = PHBaseState>(action: Action, reducer: Reducer<TState>, document: PHDocument<TState>, signer: ActionSigner, signHandler: ActionSigningHandler): Promise<Operation>;
|
|
786
|
+
/** @deprecated Use `verifyActionSignature` from `@powerhousedao/reactor`. */
|
|
734
787
|
declare function verifyOperationSignature(signature: Signature, signer: Omit<ActionSigner, "signatures">, verifyHandler: ActionVerificationHandler): Promise<boolean>;
|
|
735
788
|
/**
|
|
736
789
|
* Changes the name of the document.
|
|
@@ -784,10 +837,10 @@ declare const updateOperationExample: (input: UpdateOperationExampleInput) => Up
|
|
|
784
837
|
declare const deleteOperationExample: (input: DeleteOperationExampleInput) => DeleteOperationExampleAction;
|
|
785
838
|
declare const reorderOperationExamples: (input: ReorderOperationExamplesInput) => ReorderOperationExamplesAction;
|
|
786
839
|
declare const operationExampleCreators: {
|
|
787
|
-
addOperationExample:
|
|
788
|
-
updateOperationExample:
|
|
789
|
-
deleteOperationExample:
|
|
790
|
-
reorderOperationExamples:
|
|
840
|
+
addOperationExample: typeof addOperationExample;
|
|
841
|
+
updateOperationExample: typeof updateOperationExample;
|
|
842
|
+
deleteOperationExample: typeof deleteOperationExample;
|
|
843
|
+
reorderOperationExamples: typeof reorderOperationExamples;
|
|
791
844
|
};
|
|
792
845
|
declare const setStateSchema: (input: SetStateSchemaInput) => SetStateSchemaAction;
|
|
793
846
|
declare const setInitialState: (input: SetInitialStateInput) => SetInitialStateAction;
|
|
@@ -801,531 +854,1115 @@ declare const deleteChangeLogItem: (input: DeleteChangeLogItemInput) => DeleteCh
|
|
|
801
854
|
declare const reorderChangeLogItems: (input: ReorderChangeLogItemsInput) => ReorderChangeLogItemsAction;
|
|
802
855
|
declare const releaseNewVersion: () => ReleaseNewVersionAction;
|
|
803
856
|
declare const baseActions: {
|
|
804
|
-
setName:
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
}) => SetPreferredEditorAction;
|
|
810
|
-
undo: (count?: number, scope?: string) => UndoAction;
|
|
811
|
-
redo: (count?: number, scope?: string) => RedoAction;
|
|
812
|
-
prune: (start?: number, end?: number, scope?: string) => SchemaPruneAction;
|
|
813
|
-
loadState: <TState extends PHBaseState = PHBaseState>(state: TState & {
|
|
814
|
-
name: string;
|
|
815
|
-
}, operations: number) => LoadStateAction;
|
|
816
|
-
noop: (scope?: string) => NOOPAction;
|
|
857
|
+
setName: typeof setName;
|
|
858
|
+
setPreferredEditor: typeof setPreferredEditor;
|
|
859
|
+
undo: typeof undo;
|
|
860
|
+
redo: typeof redo;
|
|
861
|
+
noop: typeof noop;
|
|
817
862
|
};
|
|
818
863
|
declare const documentModelActions: {
|
|
819
|
-
setModelName:
|
|
820
|
-
setModelId:
|
|
821
|
-
setModelExtension:
|
|
822
|
-
setModelDescription:
|
|
823
|
-
setAuthorName:
|
|
824
|
-
setAuthorWebsite:
|
|
825
|
-
addModule:
|
|
826
|
-
setModuleName:
|
|
827
|
-
setModuleDescription:
|
|
828
|
-
deleteModule:
|
|
829
|
-
reorderModules:
|
|
830
|
-
addOperation:
|
|
831
|
-
setOperationName:
|
|
832
|
-
setOperationScope:
|
|
833
|
-
setOperationSchema:
|
|
834
|
-
setOperationDescription:
|
|
835
|
-
setOperationTemplate:
|
|
836
|
-
setOperationReducer:
|
|
837
|
-
moveOperation:
|
|
838
|
-
deleteOperation:
|
|
839
|
-
reorderModuleOperations:
|
|
840
|
-
addOperationError:
|
|
841
|
-
setOperationErrorCode:
|
|
842
|
-
setOperationErrorName:
|
|
843
|
-
setOperationErrorDescription:
|
|
844
|
-
setOperationErrorTemplate:
|
|
845
|
-
deleteOperationError:
|
|
846
|
-
reorderOperationErrors:
|
|
847
|
-
addOperationExample:
|
|
848
|
-
updateOperationExample:
|
|
849
|
-
deleteOperationExample:
|
|
850
|
-
reorderOperationExamples:
|
|
851
|
-
setStateSchema:
|
|
852
|
-
setInitialState:
|
|
853
|
-
addStateExample:
|
|
854
|
-
updateStateExample:
|
|
855
|
-
deleteStateExample:
|
|
856
|
-
reorderStateExamples:
|
|
857
|
-
addChangeLogItem:
|
|
858
|
-
updateChangeLogItem:
|
|
859
|
-
deleteChangeLogItem:
|
|
860
|
-
reorderChangeLogItems:
|
|
861
|
-
releaseNewVersion:
|
|
864
|
+
setModelName: typeof setModelName;
|
|
865
|
+
setModelId: typeof setModelId;
|
|
866
|
+
setModelExtension: typeof setModelExtension;
|
|
867
|
+
setModelDescription: typeof setModelDescription;
|
|
868
|
+
setAuthorName: typeof setAuthorName;
|
|
869
|
+
setAuthorWebsite: typeof setAuthorWebsite;
|
|
870
|
+
addModule: typeof addModule;
|
|
871
|
+
setModuleName: typeof setModuleName;
|
|
872
|
+
setModuleDescription: typeof setModuleDescription;
|
|
873
|
+
deleteModule: typeof deleteModule;
|
|
874
|
+
reorderModules: typeof reorderModules;
|
|
875
|
+
addOperation: typeof addOperation;
|
|
876
|
+
setOperationName: typeof setOperationName;
|
|
877
|
+
setOperationScope: typeof setOperationScope;
|
|
878
|
+
setOperationSchema: typeof setOperationSchema;
|
|
879
|
+
setOperationDescription: typeof setOperationDescription;
|
|
880
|
+
setOperationTemplate: typeof setOperationTemplate;
|
|
881
|
+
setOperationReducer: typeof setOperationReducer;
|
|
882
|
+
moveOperation: typeof moveOperation;
|
|
883
|
+
deleteOperation: typeof deleteOperation;
|
|
884
|
+
reorderModuleOperations: typeof reorderModuleOperations;
|
|
885
|
+
addOperationError: typeof addOperationError;
|
|
886
|
+
setOperationErrorCode: typeof setOperationErrorCode;
|
|
887
|
+
setOperationErrorName: typeof setOperationErrorName;
|
|
888
|
+
setOperationErrorDescription: typeof setOperationErrorDescription;
|
|
889
|
+
setOperationErrorTemplate: typeof setOperationErrorTemplate;
|
|
890
|
+
deleteOperationError: typeof deleteOperationError;
|
|
891
|
+
reorderOperationErrors: typeof reorderOperationErrors;
|
|
892
|
+
addOperationExample: typeof addOperationExample;
|
|
893
|
+
updateOperationExample: typeof updateOperationExample;
|
|
894
|
+
deleteOperationExample: typeof deleteOperationExample;
|
|
895
|
+
reorderOperationExamples: typeof reorderOperationExamples;
|
|
896
|
+
setStateSchema: typeof setStateSchema;
|
|
897
|
+
setInitialState: typeof setInitialState;
|
|
898
|
+
addStateExample: typeof addStateExample;
|
|
899
|
+
updateStateExample: typeof updateStateExample;
|
|
900
|
+
deleteStateExample: typeof deleteStateExample;
|
|
901
|
+
reorderStateExamples: typeof reorderStateExamples;
|
|
902
|
+
addChangeLogItem: typeof addChangeLogItem;
|
|
903
|
+
updateChangeLogItem: typeof updateChangeLogItem;
|
|
904
|
+
deleteChangeLogItem: typeof deleteChangeLogItem;
|
|
905
|
+
reorderChangeLogItems: typeof reorderChangeLogItems;
|
|
906
|
+
releaseNewVersion: typeof releaseNewVersion;
|
|
862
907
|
};
|
|
863
908
|
declare const actions: {
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
}) => SetPreferredEditorAction;
|
|
913
|
-
undo: (count?: number, scope?: string) => UndoAction;
|
|
914
|
-
redo: (count?: number, scope?: string) => RedoAction;
|
|
915
|
-
prune: (start?: number, end?: number, scope?: string) => SchemaPruneAction;
|
|
916
|
-
loadState: <TState extends PHBaseState = PHBaseState>(state: TState & {
|
|
917
|
-
name: string;
|
|
918
|
-
}, operations: number) => LoadStateAction;
|
|
919
|
-
noop: (scope?: string) => NOOPAction;
|
|
909
|
+
setName: typeof setName;
|
|
910
|
+
setPreferredEditor: typeof setPreferredEditor;
|
|
911
|
+
undo: typeof undo;
|
|
912
|
+
redo: typeof redo;
|
|
913
|
+
noop: typeof noop;
|
|
914
|
+
setModelName: typeof setModelName;
|
|
915
|
+
setModelId: typeof setModelId;
|
|
916
|
+
setModelExtension: typeof setModelExtension;
|
|
917
|
+
setModelDescription: typeof setModelDescription;
|
|
918
|
+
setAuthorName: typeof setAuthorName;
|
|
919
|
+
setAuthorWebsite: typeof setAuthorWebsite;
|
|
920
|
+
addModule: typeof addModule;
|
|
921
|
+
setModuleName: typeof setModuleName;
|
|
922
|
+
setModuleDescription: typeof setModuleDescription;
|
|
923
|
+
deleteModule: typeof deleteModule;
|
|
924
|
+
reorderModules: typeof reorderModules;
|
|
925
|
+
addOperation: typeof addOperation;
|
|
926
|
+
setOperationName: typeof setOperationName;
|
|
927
|
+
setOperationScope: typeof setOperationScope;
|
|
928
|
+
setOperationSchema: typeof setOperationSchema;
|
|
929
|
+
setOperationDescription: typeof setOperationDescription;
|
|
930
|
+
setOperationTemplate: typeof setOperationTemplate;
|
|
931
|
+
setOperationReducer: typeof setOperationReducer;
|
|
932
|
+
moveOperation: typeof moveOperation;
|
|
933
|
+
deleteOperation: typeof deleteOperation;
|
|
934
|
+
reorderModuleOperations: typeof reorderModuleOperations;
|
|
935
|
+
addOperationError: typeof addOperationError;
|
|
936
|
+
setOperationErrorCode: typeof setOperationErrorCode;
|
|
937
|
+
setOperationErrorName: typeof setOperationErrorName;
|
|
938
|
+
setOperationErrorDescription: typeof setOperationErrorDescription;
|
|
939
|
+
setOperationErrorTemplate: typeof setOperationErrorTemplate;
|
|
940
|
+
deleteOperationError: typeof deleteOperationError;
|
|
941
|
+
reorderOperationErrors: typeof reorderOperationErrors;
|
|
942
|
+
addOperationExample: typeof addOperationExample;
|
|
943
|
+
updateOperationExample: typeof updateOperationExample;
|
|
944
|
+
deleteOperationExample: typeof deleteOperationExample;
|
|
945
|
+
reorderOperationExamples: typeof reorderOperationExamples;
|
|
946
|
+
setStateSchema: typeof setStateSchema;
|
|
947
|
+
setInitialState: typeof setInitialState;
|
|
948
|
+
addStateExample: typeof addStateExample;
|
|
949
|
+
updateStateExample: typeof updateStateExample;
|
|
950
|
+
deleteStateExample: typeof deleteStateExample;
|
|
951
|
+
reorderStateExamples: typeof reorderStateExamples;
|
|
952
|
+
addChangeLogItem: typeof addChangeLogItem;
|
|
953
|
+
updateChangeLogItem: typeof updateChangeLogItem;
|
|
954
|
+
deleteChangeLogItem: typeof deleteChangeLogItem;
|
|
955
|
+
reorderChangeLogItems: typeof reorderChangeLogItems;
|
|
956
|
+
releaseNewVersion: typeof releaseNewVersion;
|
|
920
957
|
};
|
|
921
958
|
/**
|
|
922
959
|
* The context of an action.
|
|
923
960
|
*/
|
|
924
961
|
type ActionContext = {
|
|
925
|
-
/** The index of the previous operation, showing intended ordering. */
|
|
926
|
-
|
|
927
|
-
|
|
962
|
+
/** The index of the previous operation, showing intended ordering. */
|
|
963
|
+
prevOpIndex?: number;
|
|
964
|
+
/** The hash of the previous operation, showing intended state. */
|
|
965
|
+
prevOpHash?: string;
|
|
966
|
+
/** A nonce, to cover specific signing attacks and to prevent replay attacks from no-ops. */
|
|
967
|
+
nonce?: string;
|
|
968
|
+
/** The signer of the action. */
|
|
928
969
|
signer?: ActionSigner;
|
|
929
970
|
};
|
|
930
971
|
/**
|
|
931
972
|
* Defines the basic structure of an action.
|
|
932
973
|
*/
|
|
933
974
|
type Action = {
|
|
934
|
-
/** The id of the action. This is distinct from the operation id. */
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
975
|
+
/** The id of the action. This is distinct from the operation id. */
|
|
976
|
+
id: string;
|
|
977
|
+
/** The name of the action. */
|
|
978
|
+
type: string;
|
|
979
|
+
/** The timestamp of the action. */
|
|
980
|
+
timestampUtcMs: string;
|
|
981
|
+
/** The payload of the action. */
|
|
982
|
+
input: unknown;
|
|
983
|
+
/** The scope of the action */
|
|
984
|
+
scope: string;
|
|
985
|
+
/** The context of the action. */
|
|
939
986
|
context?: ActionContext;
|
|
940
987
|
};
|
|
941
988
|
//#endregion
|
|
942
|
-
//#region
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
989
|
+
//#region document-model/action-signature.d.ts
|
|
990
|
+
declare const ACTION_SIGNATURE_V2_PREFIX = "v2:";
|
|
991
|
+
/** The log an operation is stored in, which a v2 tuple is bound to. */
|
|
992
|
+
type ActionSigningTarget = {
|
|
993
|
+
documentId: string;
|
|
994
|
+
branch: string;
|
|
995
|
+
};
|
|
996
|
+
/** Who a v2 tuple attributes the action to; both halves are in the preimage. */
|
|
997
|
+
type ActionSignerIdentity = {
|
|
998
|
+
user: UserActionSigner;
|
|
999
|
+
app: AppActionSigner;
|
|
1000
|
+
};
|
|
1001
|
+
/** A value that would not survive a JSON store round trip unchanged. */
|
|
1002
|
+
declare class CanonicalJsonError extends Error {
|
|
1003
|
+
constructor(path: string, detail: string);
|
|
950
1004
|
}
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
1005
|
+
/** Sorted-key JSON, as the state hash encodes; drops `undefined` properties. */
|
|
1006
|
+
declare function canonicalJson(value: unknown, label?: string): string;
|
|
1007
|
+
/** Actions the reactor reduces itself, onto the document scope. */
|
|
1008
|
+
declare const DOCUMENT_SCOPE_ACTION_TYPES: ReadonlySet<string>;
|
|
1009
|
+
/** Where a document-scope action writes: `sourceId` or `documentId`. */
|
|
1010
|
+
declare function targetDocumentId(action: {
|
|
1011
|
+
type: string;
|
|
1012
|
+
input: unknown;
|
|
1013
|
+
}, fallback: string): string;
|
|
1014
|
+
/** The log an action submitted to a job on `documentId` is stored in. */
|
|
1015
|
+
declare function actionSigningTarget(action: {
|
|
1016
|
+
type: string;
|
|
1017
|
+
input: unknown;
|
|
1018
|
+
}, documentId: string, branch: string): ActionSigningTarget;
|
|
1019
|
+
/** The identity a signer writes into `context.signer`, and signs over. */
|
|
1020
|
+
declare function actionSignerIdentity(signer: {
|
|
1021
|
+
user?: UserActionSigner;
|
|
1022
|
+
app?: AppActionSigner;
|
|
1023
|
+
}): ActionSignerIdentity;
|
|
1024
|
+
/** The v2 preimage; throws `CanonicalJsonError` on an unsignable action. */
|
|
1025
|
+
declare function actionPreimageV2(action: Action, target: ActionSigningTarget, signer: ActionSignerIdentity): string;
|
|
1026
|
+
/** `"v2:" + base64url(sha256(preimage))`, unpadded. */
|
|
1027
|
+
declare function hashActionV2(action: Action, target: ActionSigningTarget, signer: ActionSignerIdentity): Promise<string>;
|
|
1028
|
+
/** Signs `action` as a v2 tuple; the message layout is the legacy one. */
|
|
1029
|
+
declare function signActionV2(params: {
|
|
1030
|
+
action: Action;
|
|
1031
|
+
target: ActionSigningTarget;
|
|
1032
|
+
signer: ActionSignerIdentity;
|
|
1033
|
+
sign: ActionSigningHandler;
|
|
1034
|
+
previousStateHash?: string;
|
|
1035
|
+
}): Promise<Signature>;
|
|
1036
|
+
/** Element [2] carries the v2 prefix, whether or not it is well formed. */
|
|
1037
|
+
declare function isV2ActionHash(hash: string): boolean;
|
|
1038
|
+
/** The strict shape of a v2 tuple, apart from what its hash covers. */
|
|
1039
|
+
declare function v2TupleProblem(tuple: Signature): string | undefined;
|
|
1040
|
+
//#endregion
|
|
1041
|
+
//#region document-model/action-transport.d.ts
|
|
1042
|
+
/**
|
|
1043
|
+
* An action's signer, as the wire declares it: signatures joined into strings,
|
|
1044
|
+
* because GraphQL declares them as a list of strings rather than of lists.
|
|
1045
|
+
*/
|
|
1046
|
+
type TransportSigner = {
|
|
1047
|
+
user?: {
|
|
1048
|
+
address: string;
|
|
1049
|
+
networkId: string;
|
|
1050
|
+
chainId: number;
|
|
1051
|
+
};
|
|
1052
|
+
app?: {
|
|
1053
|
+
name: string;
|
|
1054
|
+
key: string;
|
|
1055
|
+
};
|
|
1056
|
+
signatures: string[];
|
|
954
1057
|
};
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
1058
|
+
/** An action's context, as the wire declares it. */
|
|
1059
|
+
type TransportActionContext = {
|
|
1060
|
+
prevOpIndex?: number;
|
|
1061
|
+
prevOpHash?: string;
|
|
1062
|
+
nonce?: string;
|
|
1063
|
+
signer?: TransportSigner;
|
|
1064
|
+
};
|
|
1065
|
+
/** An action projected onto exactly the fields the wire declares. */
|
|
1066
|
+
type TransportAction = {
|
|
1067
|
+
id: string;
|
|
1068
|
+
type: string;
|
|
1069
|
+
timestampUtcMs: string;
|
|
1070
|
+
/**
|
|
1071
|
+
* Non-nullable, because the wire declares it so. An action's own type says
|
|
1072
|
+
* `unknown`, which admits the absent input an action creator called without
|
|
1073
|
+
* one produces - {@link toTransportAction} refuses that rather than passing
|
|
1074
|
+
* it on.
|
|
1075
|
+
*/
|
|
1076
|
+
input: NonNullable<unknown>;
|
|
1077
|
+
scope: string;
|
|
1078
|
+
context?: TransportActionContext;
|
|
1079
|
+
};
|
|
1080
|
+
/**
|
|
1081
|
+
* Projects an action onto the fields the GraphQL `ActionInput` declares.
|
|
1082
|
+
*
|
|
1083
|
+
* A projection rather than a spread, because an input object rejects a field it
|
|
1084
|
+
* does not declare, and that refusal takes the whole request with it. An action
|
|
1085
|
+
* read back out of storage can carry fields the type no longer has - a legacy
|
|
1086
|
+
* `attachments` array, or the operation fields left behind by a signing helper
|
|
1087
|
+
* that returns an operation - and any one of them would sink an otherwise valid
|
|
1088
|
+
* submission.
|
|
1089
|
+
*
|
|
1090
|
+
* Only fields the action actually carries are emitted, so an unsigned action
|
|
1091
|
+
* sends no context at all rather than a context full of nulls.
|
|
1092
|
+
*/
|
|
1093
|
+
declare function toTransportAction(action: Action): TransportAction;
|
|
1094
|
+
//#endregion
|
|
1095
|
+
//#region document-model/auth.d.ts
|
|
1096
|
+
type InitializeAuthActionInput = {
|
|
1097
|
+
version: number;
|
|
1098
|
+
grants: Grant[];
|
|
1099
|
+
};
|
|
1100
|
+
type SetGrantActionInput = {
|
|
1101
|
+
grant: Grant;
|
|
1102
|
+
};
|
|
1103
|
+
type RemoveGrantActionInput = {
|
|
1104
|
+
id: string;
|
|
1105
|
+
};
|
|
1106
|
+
type MoveGrantActionInput = {
|
|
1107
|
+
id: string;
|
|
1108
|
+
/** Target index in the grant list; clamped to the valid range. */
|
|
1109
|
+
index: number;
|
|
1110
|
+
};
|
|
1111
|
+
type InitializeAuthAction = Action & {
|
|
1112
|
+
type: "INITIALIZE_AUTH";
|
|
1113
|
+
input: InitializeAuthActionInput;
|
|
1114
|
+
};
|
|
1115
|
+
type SetGrantAction = Action & {
|
|
1116
|
+
type: "SET_GRANT";
|
|
1117
|
+
input: SetGrantActionInput;
|
|
1118
|
+
};
|
|
1119
|
+
type RemoveGrantAction = Action & {
|
|
1120
|
+
type: "REMOVE_GRANT";
|
|
1121
|
+
input: RemoveGrantActionInput;
|
|
1122
|
+
};
|
|
1123
|
+
type MoveGrantAction = Action & {
|
|
1124
|
+
type: "MOVE_GRANT";
|
|
1125
|
+
input: MoveGrantActionInput;
|
|
1126
|
+
};
|
|
1127
|
+
type AuthAction = InitializeAuthAction | SetGrantAction | RemoveGrantAction | MoveGrantAction;
|
|
1128
|
+
declare const AUTH_ACTION_TYPES: readonly ["INITIALIZE_AUTH", "SET_GRANT", "REMOVE_GRANT", "MOVE_GRANT"];
|
|
1129
|
+
declare function isAuthAction(action: Action): action is AuthAction;
|
|
1130
|
+
/** Highest known policy version; decide() fails closed above it. */
|
|
1131
|
+
declare const MAX_SUPPORTED_AUTH_VERSION = 1;
|
|
1132
|
+
declare const InitializeAuthActionInputSchema: () => z.ZodObject<{
|
|
1133
|
+
version: z.ZodNumber;
|
|
1134
|
+
grants: z.ZodArray<z.ZodCustom<Grant, Grant>>;
|
|
1135
|
+
}, z.core.$strip>;
|
|
1136
|
+
declare const SetGrantActionInputSchema: () => z.ZodObject<{
|
|
1137
|
+
grant: z.ZodCustom<Grant, Grant>;
|
|
1138
|
+
}, z.core.$strip>;
|
|
1139
|
+
declare const RemoveGrantActionInputSchema: () => z.ZodObject<{
|
|
1140
|
+
id: z.ZodString;
|
|
1141
|
+
}, z.core.$strip>;
|
|
1142
|
+
declare const MoveGrantActionInputSchema: () => z.ZodObject<{
|
|
1143
|
+
id: z.ZodString;
|
|
1144
|
+
index: z.ZodNumber;
|
|
1145
|
+
}, z.core.$strip>;
|
|
1146
|
+
declare const initializeAuth: (input: InitializeAuthActionInput) => InitializeAuthAction;
|
|
1147
|
+
declare const setGrant: (input: SetGrantActionInput) => SetGrantAction;
|
|
1148
|
+
declare const removeGrant: (input: RemoveGrantActionInput) => RemoveGrantAction;
|
|
1149
|
+
declare const moveGrant: (input: MoveGrantActionInput) => MoveGrantAction;
|
|
1150
|
+
/**
|
|
1151
|
+
* True when `signerKey` (an ActionSigner app key, a did:key) identifies the same
|
|
1152
|
+
* key recorded as the document creator. Returns false
|
|
1153
|
+
* when there is no creator (empty JWK) or no signer key.
|
|
1154
|
+
*/
|
|
1155
|
+
declare function isDocumentCreator(creatorKey: JsonWebKey | undefined, signerKey: string | undefined): boolean;
|
|
1156
|
+
/**
|
|
1157
|
+
* Sets the initial policy. Valid only while the auth scope is uninitialized
|
|
1158
|
+
* (version 0). The input version is the policy language version and must be an
|
|
1159
|
+
* integer >= 1; 0 is reserved for the uninitialized state. On a signed-header
|
|
1160
|
+
* document it must be signed by the document creator (`header.sig.publicKey`).
|
|
1161
|
+
* A creator-less policy must include a grant permitting execute on the auth
|
|
1162
|
+
* scope, or it would be born locked out.
|
|
1163
|
+
*/
|
|
1164
|
+
declare function applyInitializeAuthAction<TState extends PHBaseState>(document: PHDocument<TState>, action: InitializeAuthAction): PHDocument<TState>;
|
|
1165
|
+
/** Upserts a grant by id: replaces in place if present, otherwise appends. */
|
|
1166
|
+
declare function applySetGrantAction<TState extends PHBaseState>(document: PHDocument<TState>, action: SetGrantAction): PHDocument<TState>;
|
|
1167
|
+
/**
|
|
1168
|
+
* Removes a grant by id; throws if the id is not present or if the removal
|
|
1169
|
+
* would leave a creator-less policy with no auth-administration grant.
|
|
1170
|
+
*/
|
|
1171
|
+
declare function applyRemoveGrantAction<TState extends PHBaseState>(document: PHDocument<TState>, action: RemoveGrantAction): PHDocument<TState>;
|
|
1172
|
+
/**
|
|
1173
|
+
* Moves a grant by id to a new index. Order is load-bearing (the last
|
|
1174
|
+
* applicable grant wins), so the relative order of the other grants is kept.
|
|
1175
|
+
* The target index is clamped to the valid range; an unknown id throws.
|
|
1176
|
+
*
|
|
1177
|
+
* Order alone decides which grant wins, so a move can take administration away
|
|
1178
|
+
* without changing the list's contents. It carries the same retention rule as
|
|
1179
|
+
* the two mutation paths.
|
|
1180
|
+
*/
|
|
1181
|
+
declare function applyMoveGrantAction<TState extends PHBaseState>(document: PHDocument<TState>, action: MoveGrantAction): PHDocument<TState>;
|
|
1182
|
+
/**
|
|
1183
|
+
* Dispatches an auth-scope action to its handler. This is the auth scope's
|
|
1184
|
+
* dedicated reducer: it is applied by the base reducer instead of the model
|
|
1185
|
+
* reducer, mirroring the document-scope platform handlers. Unknown types are a
|
|
1186
|
+
* no-op, matching the model-reducer default.
|
|
1187
|
+
*/
|
|
1188
|
+
declare function applyAuthAction<TState extends PHBaseState>(document: PHDocument<TState>, action: Action): PHDocument<TState>;
|
|
1189
|
+
/**
|
|
1190
|
+
* Because only creators can initialize auth scopes, we must verify that either
|
|
1191
|
+
* the document has no auth or the version and creator match.
|
|
1192
|
+
*/
|
|
1193
|
+
declare function assertAuthPreservedOnDuplicate(documentId: string, source: PHAuthState | undefined, duplicated: PHAuthState | undefined): void;
|
|
1194
|
+
/**
|
|
1195
|
+
* The auth scope a state snapshot may install, given the policy already there.
|
|
1196
|
+
*
|
|
1197
|
+
* `applyAuthAction` is the validated door onto `state.auth`, but a whole-state
|
|
1198
|
+
* snapshot (UPGRADE_DOCUMENT's `initialState`) replaces the scope wholesale and
|
|
1199
|
+
* is authorized as a `document`-scope write. Without this, a subject holding
|
|
1200
|
+
* `execute` on `document` and no auth grant at all can install a policy of its
|
|
1201
|
+
* choosing, name itself `creator` (which exempts the policy from the retention
|
|
1202
|
+
* rule for good), or wipe an existing policy by carrying the default
|
|
1203
|
+
* uninitialized one.
|
|
1204
|
+
*
|
|
1205
|
+
* Three cases:
|
|
1206
|
+
*
|
|
1207
|
+
* - the snapshot carries no policy, or an uninitialized one: the document
|
|
1208
|
+
* keeps the policy it has, so a default-state upgrade cannot reset it;
|
|
1209
|
+
* - the document is uninitialized and the snapshot carries a policy: the
|
|
1210
|
+
* policy is installed after the same validation genesis applies, so it
|
|
1211
|
+
* cannot be born locked out;
|
|
1212
|
+
* - both carry a policy: they must agree. A duplicate preserves its source's
|
|
1213
|
+
* policy (see {@link assertAuthPreservedOnDuplicate}), and anything else is
|
|
1214
|
+
* an attempt to replace one policy with another.
|
|
1215
|
+
*/
|
|
1216
|
+
declare function resolveSnapshotAuth(documentId: string, documentType: string, current: PHAuthState | undefined, incoming: PHAuthState | undefined): PHAuthState;
|
|
1217
|
+
/** UNDO and REDO are rejected on the auth scope. */
|
|
1218
|
+
declare function assertAuthScopeActionAllowed(action: Action): void;
|
|
1219
|
+
type AuthVerb = "read" | "execute";
|
|
1220
|
+
type AuthRequest = {
|
|
1221
|
+
verb: AuthVerb;
|
|
1222
|
+
scope: string;
|
|
1223
|
+
/** For execute: the operation (action type) being attempted. Omitted for reads. */
|
|
1224
|
+
operation?: string;
|
|
1225
|
+
};
|
|
1226
|
+
type AuthSubject = {
|
|
1227
|
+
/** Verified signer address; undefined for an anonymous subject. */
|
|
1228
|
+
address?: string;
|
|
1229
|
+
/** The signer's app key (a did:key), used to match the document creator. */
|
|
1230
|
+
key?: string;
|
|
1231
|
+
};
|
|
1232
|
+
/**
|
|
1233
|
+
* What condition attr paths resolve against, beyond the subject. Supplied
|
|
1234
|
+
* only while authConditions enforcement is on: with no context a grant
|
|
1235
|
+
* carrying `where` or a { match } principal never applies.
|
|
1236
|
+
*/
|
|
1237
|
+
type ConditionContext = {
|
|
1238
|
+
/** The executing scope's own state, for `doc.<scope>.*` paths. */
|
|
1239
|
+
scopeState: unknown;
|
|
1240
|
+
/** The action's input, for `action.input.*` paths. Absent for reads. */
|
|
1241
|
+
actionInput?: unknown;
|
|
1242
|
+
};
|
|
1243
|
+
type AuthDecision = "allow" | "deny";
|
|
1244
|
+
/** Why the policy refused a request. */
|
|
1245
|
+
type AuthRefusal = "version-unsupported" | "no-applicable-grant" | "denied-by-grant";
|
|
1246
|
+
/**
|
|
1247
|
+
* A decision together with why it refused. A refusal names which of the
|
|
1248
|
+
* policy's rules produced it, so an operation records the reason it was refused
|
|
1249
|
+
* rather than one reason standing for every refusal.
|
|
1250
|
+
*/
|
|
1251
|
+
type AuthEvaluation = {
|
|
1252
|
+
decision: "allow";
|
|
961
1253
|
} | {
|
|
962
|
-
|
|
963
|
-
|
|
1254
|
+
decision: "deny";
|
|
1255
|
+
refusal: AuthRefusal;
|
|
1256
|
+
grantId?: string;
|
|
964
1257
|
};
|
|
965
|
-
/**
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
/**
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
}
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1258
|
+
/**
|
|
1259
|
+
* Evaluates the auth policy for a single request and reports why it refused.
|
|
1260
|
+
* Pure and deterministic.
|
|
1261
|
+
*
|
|
1262
|
+
* An uninitialized policy (version 0, absent auth state, or a legacy `{}`
|
|
1263
|
+
* auth scope serialized before PHAuthState had a version) leaves the document
|
|
1264
|
+
* open. Once a policy exists the default is deny, and grants stack in order.
|
|
1265
|
+
*
|
|
1266
|
+
* Group principals match only against a supplied groups map (the groups
|
|
1267
|
+
* projection, present when authGroups is on); with no map they never apply.
|
|
1268
|
+
* `where` clauses and { match } principals likewise evaluate only against a
|
|
1269
|
+
* supplied condition context (present when authConditions is on).
|
|
1270
|
+
*/
|
|
1271
|
+
declare function evaluate(auth: PHAuthState | undefined, subject: AuthSubject, request: AuthRequest, groups?: AuthGroups, conditions?: ConditionContext): AuthEvaluation;
|
|
1272
|
+
/**
|
|
1273
|
+
* Evaluates the auth policy for a single request. Pure and deterministic. This
|
|
1274
|
+
* is {@link evaluate} with the reason dropped.
|
|
1275
|
+
*/
|
|
1276
|
+
declare function decide(auth: PHAuthState | undefined, subject: AuthSubject, request: AuthRequest, groups?: AuthGroups, conditions?: ConditionContext): AuthDecision;
|
|
1277
|
+
/**
|
|
1278
|
+
* The group document ids a single auth action's input names with `{ group }`
|
|
1279
|
+
* principals. INITIALIZE_AUTH contributes the groups named across its grants,
|
|
1280
|
+
* SET_GRANT the groups named by its one grant; REMOVE_GRANT and MOVE_GRANT
|
|
1281
|
+
* contribute nothing. Total over any input shape, because references are read
|
|
1282
|
+
* from the input as it arrived, including inputs later stored as errors.
|
|
1283
|
+
*/
|
|
1284
|
+
declare function mentionedGroupIds(action: Action): string[];
|
|
1285
|
+
//#endregion
|
|
1286
|
+
//#region document-model/auth-v1.d.ts
|
|
1287
|
+
/** Maximum number of grants in a policy. */
|
|
1288
|
+
declare const MAX_AUTH_GRANTS = 100;
|
|
1289
|
+
/** Maximum nesting depth of a condition tree. */
|
|
1290
|
+
declare const MAX_CONDITION_DEPTH = 10;
|
|
1291
|
+
/** Maximum node count (conditions plus operands) of a condition tree. */
|
|
1292
|
+
declare const MAX_CONDITION_NODES = 100;
|
|
1293
|
+
/** Maximum entries in an execute capability's operation list. */
|
|
1294
|
+
declare const MAX_CAPABILITY_OPERATIONS = 100;
|
|
1295
|
+
/**
|
|
1296
|
+
* Thrown when a grant violates the v1 validation rules. The message is stored
|
|
1297
|
+
* on error operations, so it must be a pure function of the input.
|
|
1298
|
+
*/
|
|
1299
|
+
declare class InvalidGrantError extends Error {
|
|
1300
|
+
readonly grantId: string;
|
|
1301
|
+
constructor(grantId: string, problem: string);
|
|
1003
1302
|
}
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1303
|
+
/** Thrown for a `{ group }` principal on a group document: references never chain. */
|
|
1304
|
+
declare class GroupPrincipalNotAllowedError extends Error {
|
|
1305
|
+
readonly grantId: string;
|
|
1306
|
+
constructor(grantId: string);
|
|
1008
1307
|
}
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1308
|
+
/**
|
|
1309
|
+
* Thrown when a change would leave a creator-less policy with no grant
|
|
1310
|
+
* permitting execute on the auth scope. Without the creator carve-out no
|
|
1311
|
+
* subject could ever administer such a policy again.
|
|
1312
|
+
*/
|
|
1313
|
+
declare class AuthAdministrationLockoutError extends Error {
|
|
1314
|
+
readonly grantId: string;
|
|
1315
|
+
constructor(grantId: string);
|
|
1013
1316
|
}
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
/** Resolved value, never a reference — the caller resolves refs. */
|
|
1022
|
-
secret?: string;
|
|
1023
|
-
/** Overrides the scheme's conventional header. */
|
|
1024
|
-
header?: string;
|
|
1025
|
-
/** Replay window for timestamped schemes. */
|
|
1026
|
-
toleranceSeconds?: number;
|
|
1027
|
-
algorithm?: WebhookHashAlgorithm;
|
|
1028
|
-
/** Defaults to `hex`. Base64 comparison is case-sensitive; hex is not. */
|
|
1029
|
-
encoding?: WebhookSignatureEncoding;
|
|
1030
|
-
prefix?: string;
|
|
1317
|
+
/**
|
|
1318
|
+
* Thrown when INITIALIZE_AUTH would create a creator-less policy with no grant
|
|
1319
|
+
* permitting execute on the auth scope. Such a policy would be born with no
|
|
1320
|
+
* subject able to administer it.
|
|
1321
|
+
*/
|
|
1322
|
+
declare class AuthAdministrationMissingError extends Error {
|
|
1323
|
+
constructor();
|
|
1031
1324
|
}
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1325
|
+
declare function isPlainValue(value: unknown): value is Record<string, unknown>;
|
|
1326
|
+
/** Returns the first v1-rule violation, or null. Pure, total, deterministic. */
|
|
1327
|
+
declare function grantProblem(value: unknown): string | null;
|
|
1328
|
+
declare const GrantSchema: () => z.ZodCustom<Grant, Grant>;
|
|
1329
|
+
/** V1 shape rules plus the group-document group-principal ban. */
|
|
1330
|
+
declare function assertValidGrant(grant: unknown, documentType: string): void;
|
|
1331
|
+
/**
|
|
1332
|
+
* Validates an initial grant list: the count cap, every grant, and — on a
|
|
1333
|
+
* creator-less policy — that some grant keeps the auth scope administrable.
|
|
1334
|
+
*/
|
|
1335
|
+
declare function assertValidInitialGrants(grants: Grant[], documentType: string, creator: string | undefined): void;
|
|
1336
|
+
/**
|
|
1337
|
+
* Validates a grant upsert: the grant itself, the count cap on append, and
|
|
1338
|
+
* administration retention. Retention is checked on an append as well as an
|
|
1339
|
+
* in-place replace, because a grant appended after the administration grant can
|
|
1340
|
+
* shadow it (evaluation is last-applicable-grant-wins) and so take
|
|
1341
|
+
* administration away without removing anything.
|
|
1342
|
+
*/
|
|
1343
|
+
declare function assertValidGrantUpsert(grant: Grant, existing: Grant[], documentType: string, creator: string | undefined): void;
|
|
1344
|
+
/**
|
|
1345
|
+
* A creator-less policy must always retain a grant permitting execute on the
|
|
1346
|
+
* auth scope; on a signed document the creator carve-out keeps administration
|
|
1347
|
+
* reachable instead. Rejects a change that takes the last such grant away. A
|
|
1348
|
+
* policy already without one is left alone: the change is not what locks it.
|
|
1349
|
+
*/
|
|
1350
|
+
declare function assertAuthAdministrationRetained(creator: string | undefined, previous: Grant[], next: Grant[], grantId: string): void;
|
|
1351
|
+
/**
|
|
1352
|
+
* Evaluates a version-1 condition. Deterministic, total, and pure: any input
|
|
1353
|
+
* shape yields a boolean and never throws, and a malformed condition is
|
|
1354
|
+
* false. These are consensus semantics, versioned by `PHAuthState.version`;
|
|
1355
|
+
* changing them requires a new version.
|
|
1356
|
+
*/
|
|
1357
|
+
declare function evaluateCondition(condition: Condition, subject: AuthSubject, request: AuthRequest, conditions: ConditionContext): boolean;
|
|
1358
|
+
/**
|
|
1359
|
+
* The group document ids named by `{ group }` principals in a grant list, in
|
|
1360
|
+
* order of first appearance. These are the streams the groups projection reads.
|
|
1361
|
+
*/
|
|
1362
|
+
declare function referencedGroupIds(grants: Grant[]): string[];
|
|
1363
|
+
/**
|
|
1364
|
+
* Evaluates a v1 grant stack: default deny, last applicable grant wins, and
|
|
1365
|
+
* reports which grant decided it. Group principals match only against a
|
|
1366
|
+
* supplied groups map, and `where` clauses and { match } principals evaluate
|
|
1367
|
+
* only against a supplied condition context; a grant that uses an unsupplied
|
|
1368
|
+
* feature never applies.
|
|
1369
|
+
*/
|
|
1370
|
+
declare function evaluateGrantStack(grants: Grant[], subject: AuthSubject, request: AuthRequest, groups?: AuthGroups, conditions?: ConditionContext): AuthEvaluation;
|
|
1371
|
+
/**
|
|
1372
|
+
* Evaluates a v1 grant stack: default deny, last applicable grant wins. This is
|
|
1373
|
+
* {@link evaluateGrantStack} with the reason dropped.
|
|
1374
|
+
*/
|
|
1375
|
+
declare function evaluateGrants(grants: Grant[], subject: AuthSubject, request: AuthRequest, groups?: AuthGroups, conditions?: ConditionContext): AuthDecision;
|
|
1376
|
+
//#endregion
|
|
1377
|
+
//#region document-model/constants.d.ts
|
|
1378
|
+
declare const documentModelFileExtension: "phdm";
|
|
1379
|
+
declare const documentModelInitialLocalState: DocumentModelLocalState;
|
|
1380
|
+
declare const documentModelInitialGlobalState: DocumentModelGlobalState;
|
|
1381
|
+
declare const documentModelGlobalState: DocumentModelGlobalState;
|
|
1382
|
+
declare const HASH_ALGORITHM_SHA1 = "sha1";
|
|
1383
|
+
declare const HASH_ALGORITHM_SHA256 = "sha256";
|
|
1384
|
+
declare const HASH_ALGORITHM_SHA512 = "sha512";
|
|
1385
|
+
declare const HASH_ENCODING_BASE64 = "base64";
|
|
1386
|
+
declare const HASH_ENCODING_HEX = "hex";
|
|
1387
|
+
//#endregion
|
|
1388
|
+
//#region document-model/crypto.d.ts
|
|
1389
|
+
declare const hashBrowser: (data: string | Uint8Array | ArrayBufferView | DataView, algorithm?: string, encoding?: string, _params?: Record<string, unknown>) => string;
|
|
1390
|
+
declare function getUnixTimestamp(date: Date | string): string;
|
|
1391
|
+
declare function buildOperationSignatureParams({ documentId, signer, action, previousStateHash }: ActionSignatureContext): [string, string, string, string];
|
|
1392
|
+
declare function buildOperationSignatureMessage(params: [string, string, string, string]): Uint8Array;
|
|
1393
|
+
declare function ab2hex(ab: ArrayBuffer | ArrayBufferView): string;
|
|
1394
|
+
declare function hex2ab(hex: string): Uint8Array<ArrayBuffer>;
|
|
1395
|
+
/**
|
|
1396
|
+
* Decodes a base58btc (Bitcoin/IPFS alphabet) string to bytes. Returns null on
|
|
1397
|
+
* any character outside the alphabet.
|
|
1398
|
+
*/
|
|
1399
|
+
declare function base58Decode(input: string): Uint8Array | null;
|
|
1400
|
+
/** Encodes bytes as unpadded base64url. */
|
|
1401
|
+
declare function bytesToBase64Url(bytes: Uint8Array): string;
|
|
1402
|
+
/** Decodes a base64url string to bytes (portable across node, browsers, workers). */
|
|
1403
|
+
declare function base64UrlToBytes(input: string): Uint8Array;
|
|
1404
|
+
//#endregion
|
|
1405
|
+
//#region document-model/denied.d.ts
|
|
1406
|
+
/**
|
|
1407
|
+
* True iff authorization rejected the action.
|
|
1408
|
+
*/
|
|
1409
|
+
declare function isDenied(operation: Operation): boolean;
|
|
1410
|
+
/**
|
|
1411
|
+
* The closed set of strings persisted as `deniedReason`. Re-evaluation compares
|
|
1412
|
+
* them, so they are consensus data: exact strings that embed no grant id,
|
|
1413
|
+
* subject or timestamp. Changing one is history-visible.
|
|
1414
|
+
*/
|
|
1415
|
+
declare const DOCUMENT_DELETED_REASON = "document deleted";
|
|
1416
|
+
declare const AUTH_VERSION_UNSUPPORTED_REASON = "auth policy version unsupported";
|
|
1417
|
+
declare const AUTH_NO_GRANT_REASON = "no grant permits this operation";
|
|
1418
|
+
declare const AUTH_DENIED_BY_GRANT_REASON = "denied by grant";
|
|
1419
|
+
//#endregion
|
|
1420
|
+
//#region document-model/document-schema.d.ts
|
|
1421
|
+
declare const BaseDocumentHeaderSchema: z.ZodObject<{
|
|
1422
|
+
id: z.ZodString;
|
|
1423
|
+
name: z.ZodString;
|
|
1424
|
+
createdAtUtcIso: z.ZodString;
|
|
1425
|
+
lastModifiedAtUtcIso: z.ZodString;
|
|
1426
|
+
documentType: z.ZodString;
|
|
1427
|
+
}, z.core.$strip>;
|
|
1428
|
+
declare const BaseDocumentStateSchema: z.ZodObject<{
|
|
1429
|
+
global: z.ZodUnknown;
|
|
1430
|
+
}, z.core.$strip>;
|
|
1431
|
+
/** Schema for validating the header object of a DocumentModel document */
|
|
1432
|
+
declare const DocumentModelHeaderSchema: z.ZodObject<{
|
|
1433
|
+
id: z.ZodString;
|
|
1434
|
+
name: z.ZodString;
|
|
1435
|
+
createdAtUtcIso: z.ZodString;
|
|
1436
|
+
lastModifiedAtUtcIso: z.ZodString;
|
|
1437
|
+
documentType: z.ZodLiteral<"powerhouse/document-model">;
|
|
1438
|
+
}, z.core.$strip>;
|
|
1439
|
+
/** Schema for validating the state object of a DocumentModel document */
|
|
1440
|
+
declare const DocumentModelPHStateSchema: z.ZodObject<{
|
|
1441
|
+
global: z.ZodObject<Required<{
|
|
1442
|
+
author: z.ZodType<Author, Author, z.core.$ZodTypeInternals<Author, Author>>;
|
|
1443
|
+
description: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
1444
|
+
extension: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
1445
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
1446
|
+
name: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
1447
|
+
specifications: z.ZodType<DocumentSpecification[], DocumentSpecification[], z.core.$ZodTypeInternals<DocumentSpecification[], DocumentSpecification[]>>;
|
|
1448
|
+
}>, z.core.$strip>;
|
|
1449
|
+
}, z.core.$strip>;
|
|
1450
|
+
declare const DocumentModelSchema: z.ZodObject<{
|
|
1451
|
+
header: z.ZodObject<{
|
|
1452
|
+
id: z.ZodString;
|
|
1453
|
+
name: z.ZodString;
|
|
1454
|
+
createdAtUtcIso: z.ZodString;
|
|
1455
|
+
lastModifiedAtUtcIso: z.ZodString;
|
|
1456
|
+
documentType: z.ZodLiteral<"powerhouse/document-model">;
|
|
1457
|
+
}, z.core.$strip>;
|
|
1458
|
+
state: z.ZodObject<{
|
|
1459
|
+
global: z.ZodObject<Required<{
|
|
1460
|
+
author: z.ZodType<Author, Author, z.core.$ZodTypeInternals<Author, Author>>;
|
|
1461
|
+
description: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
1462
|
+
extension: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
1463
|
+
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
1464
|
+
name: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
1465
|
+
specifications: z.ZodType<DocumentSpecification[], DocumentSpecification[], z.core.$ZodTypeInternals<DocumentSpecification[], DocumentSpecification[]>>;
|
|
1466
|
+
}>, z.core.$strip>;
|
|
1467
|
+
}, z.core.$strip>;
|
|
1468
|
+
initialState: 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
|
+
}, z.core.$strip>;
|
|
1479
|
+
/** Simple helper function to check if a state object is a DocumentModel document state object */
|
|
1480
|
+
declare function isDocumentModelState(state: unknown): state is DocumentModelPHState;
|
|
1481
|
+
/** Simple helper function to assert that a document state object is a DocumentModel document state object */
|
|
1482
|
+
declare function assertIsDocumentModelState(state: unknown): asserts state is DocumentModelPHState;
|
|
1483
|
+
/** Simple helper function to check if a document is a DocumentModel document */
|
|
1484
|
+
declare function isDocumentModelDocument(document: unknown): document is DocumentModelDocument;
|
|
1485
|
+
/** Simple helper function to assert that a document is a DocumentModel document */
|
|
1486
|
+
declare function assertIsDocumentModelDocument(document: unknown): asserts document is DocumentModelDocument;
|
|
1487
|
+
//#endregion
|
|
1488
|
+
//#region document-model/document-type.d.ts
|
|
1489
|
+
declare const documentModelDocumentType = "powerhouse/document-model";
|
|
1490
|
+
declare const groupDocumentType = "powerhouse/reactor-group";
|
|
1491
|
+
/**
|
|
1492
|
+
* The group-model action types that change membership. The groups projection
|
|
1493
|
+
* filters its reads to these, so any other group operation is invisible to a
|
|
1494
|
+
* decision. Kept here so the reactor never depends on the group package; a
|
|
1495
|
+
* reactor-group test guards against drift.
|
|
1496
|
+
*/
|
|
1497
|
+
declare const groupMembershipActionTypes: readonly ["ADD_MEMBER", "REMOVE_MEMBER"];
|
|
1498
|
+
//#endregion
|
|
1499
|
+
//#region document-model/errors.d.ts
|
|
1500
|
+
declare const FileSystemError: Error;
|
|
1501
|
+
declare class InvalidActionInputError extends Error {
|
|
1502
|
+
data: unknown;
|
|
1503
|
+
constructor(data: unknown);
|
|
1049
1504
|
}
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
contentType?: string;
|
|
1505
|
+
declare class InvalidActionInputZodError extends InvalidActionInputError {
|
|
1506
|
+
issues: ZodIssue[];
|
|
1507
|
+
constructor(issues: ZodIssue[]);
|
|
1054
1508
|
}
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
challengeField?: WebhookField;
|
|
1064
|
-
maxBodyBytes?: number;
|
|
1509
|
+
/**
|
|
1510
|
+
* Error thrown when attempting to downgrade a document version.
|
|
1511
|
+
*/
|
|
1512
|
+
declare class DowngradeNotSupportedError extends Error {
|
|
1513
|
+
readonly documentType: string;
|
|
1514
|
+
readonly fromVersion: number;
|
|
1515
|
+
readonly toVersion: number;
|
|
1516
|
+
constructor(documentType: string, fromVersion: number, toVersion: number);
|
|
1065
1517
|
}
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1518
|
+
/**
|
|
1519
|
+
* Thrown when INITIALIZE_AUTH is applied to an already-initialized auth scope.
|
|
1520
|
+
* The genesis action is valid only at auth revision zero.
|
|
1521
|
+
*/
|
|
1522
|
+
declare class AuthAlreadyInitializedError extends Error {
|
|
1523
|
+
readonly documentId: string;
|
|
1524
|
+
constructor(documentId: string);
|
|
1072
1525
|
}
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1526
|
+
/**
|
|
1527
|
+
* Thrown when INITIALIZE_AUTH is not signed by the document creator (its signer
|
|
1528
|
+
* does not match `header.sig.publicKey`), so it cannot set the auth policy.
|
|
1529
|
+
*/
|
|
1530
|
+
declare class AuthInitializerNotCreatorError extends Error {
|
|
1531
|
+
readonly documentId: string;
|
|
1532
|
+
constructor(documentId: string);
|
|
1078
1533
|
}
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1534
|
+
/**
|
|
1535
|
+
* Thrown when INITIALIZE_AUTH carries a version below 1. Version 0 is reserved
|
|
1536
|
+
* for the uninitialized auth scope.
|
|
1537
|
+
*/
|
|
1538
|
+
declare class InvalidAuthVersionError extends Error {
|
|
1539
|
+
readonly documentId: string;
|
|
1540
|
+
readonly version: number;
|
|
1541
|
+
constructor(documentId: string, version: number);
|
|
1083
1542
|
}
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
readonly
|
|
1543
|
+
/** Thrown when a duplicate would lose the source policy's version or creator binding. */
|
|
1544
|
+
declare class AuthPolicyNotPreservedError extends Error {
|
|
1545
|
+
readonly documentId: string;
|
|
1546
|
+
constructor(documentId: string);
|
|
1087
1547
|
}
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
post(path: string, options: RouteOptions, handler: RouteHandler): ScopedRouteHandle;
|
|
1095
|
-
put(path: string, handler: RouteHandler): ScopedRouteHandle;
|
|
1096
|
-
put(path: string, options: RouteOptions, handler: RouteHandler): ScopedRouteHandle;
|
|
1097
|
-
patch(path: string, handler: RouteHandler): ScopedRouteHandle;
|
|
1098
|
-
patch(path: string, options: RouteOptions, handler: RouteHandler): ScopedRouteHandle;
|
|
1099
|
-
delete(path: string, handler: RouteHandler): ScopedRouteHandle;
|
|
1100
|
-
delete(path: string, options: RouteOptions, handler: RouteHandler): ScopedRouteHandle;
|
|
1101
|
-
/** Registered independently of GET: a HEAD response is not a bodyless GET. */
|
|
1102
|
-
head(path: string, handler: RouteHandler): ScopedRouteHandle;
|
|
1103
|
-
head(path: string, options: RouteOptions, handler: RouteHandler): ScopedRouteHandle;
|
|
1104
|
-
route(spec: RouteSpec): ScopedRouteHandle;
|
|
1105
|
-
nodeRoute(spec: NodeRouteSpec): ScopedRouteHandle;
|
|
1106
|
-
readonly webhooks: IWebhookScope;
|
|
1107
|
-
/** Release every route this scope registered. Called on package teardown. */
|
|
1108
|
-
dispose(): void;
|
|
1548
|
+
/**
|
|
1549
|
+
* Thrown when a grant referenced by REMOVE_GRANT or MOVE_GRANT does not exist.
|
|
1550
|
+
*/
|
|
1551
|
+
declare class GrantNotFoundError extends Error {
|
|
1552
|
+
readonly grantId: string;
|
|
1553
|
+
constructor(grantId: string);
|
|
1109
1554
|
}
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
interface IProcessorDispatch {
|
|
1117
|
-
execute(docId: string, branch: string, actions: Action[], signal?: AbortSignal, meta?: Record<string, unknown>): Promise<ProcessorDispatchResult>;
|
|
1555
|
+
/**
|
|
1556
|
+
* Thrown when a disallowed action (UNDO, REDO) targets the auth scope.
|
|
1557
|
+
*/
|
|
1558
|
+
declare class AuthActionNotAllowedError extends Error {
|
|
1559
|
+
readonly actionType: string;
|
|
1560
|
+
constructor(actionType: string);
|
|
1118
1561
|
}
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
* The package's slice of the HTTP surface, bound to its own namespace.
|
|
1128
|
-
*
|
|
1129
|
-
* Declared on the host-agnostic base rather than on each host's module so
|
|
1130
|
-
* the two cannot drift: codegen types generated processors against
|
|
1131
|
-
* reactor-browser's `IProcessorHostModule`, and the same source has to
|
|
1132
|
-
* compile against reactor-api's.
|
|
1133
|
-
*
|
|
1134
|
-
* Absent whenever the host has no HTTP server — processors also run in the
|
|
1135
|
-
* browser — and on the reactor when the package's name cannot be resolved to
|
|
1136
|
-
* a routable namespace, so a caller must always check before using it.
|
|
1137
|
-
*/
|
|
1138
|
-
http?: IHttpScope;
|
|
1562
|
+
declare class HashMismatchError extends Error {
|
|
1563
|
+
protected _scope: string;
|
|
1564
|
+
protected _document: PHDocument;
|
|
1565
|
+
protected _operation: Operation;
|
|
1566
|
+
constructor(scope: string, document: PHDocument, operation: Operation);
|
|
1567
|
+
get document(): PHDocument;
|
|
1568
|
+
get scope(): string;
|
|
1569
|
+
get operation(): Operation;
|
|
1139
1570
|
}
|
|
1140
1571
|
/**
|
|
1141
|
-
*
|
|
1142
|
-
*
|
|
1143
|
-
* When a field is undefined or empty, it matches all values for that field.
|
|
1572
|
+
* Thrown when replay or import requires a document model version that is not
|
|
1573
|
+
* registered. Carries the data the UI needs to explain the mismatch.
|
|
1144
1574
|
*/
|
|
1145
|
-
|
|
1146
|
-
documentType
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1575
|
+
declare class UnsupportedDocumentModelVersionError extends Error {
|
|
1576
|
+
readonly documentType: string;
|
|
1577
|
+
readonly requiredVersion: number;
|
|
1578
|
+
readonly availableVersions: number[];
|
|
1579
|
+
constructor(documentType: string, requiredVersion: number, availableVersions: number[]);
|
|
1580
|
+
static isError(error: unknown): error is UnsupportedDocumentModelVersionError;
|
|
1581
|
+
}
|
|
1582
|
+
//#endregion
|
|
1583
|
+
//#region document-model/upgrades.d.ts
|
|
1584
|
+
/** Upgrade reducer transforms a document from one version to another */
|
|
1585
|
+
type UpgradeReducer<TFrom extends PHBaseState, TTo extends PHBaseState> = (document: PHDocument<TFrom>, action: Action) => PHDocument<TTo>;
|
|
1586
|
+
type ModelVersion = number;
|
|
1587
|
+
/** Metadata about a version transition */
|
|
1588
|
+
type UpgradeTransition = {
|
|
1589
|
+
toVersion: ModelVersion;
|
|
1590
|
+
upgradeReducer: UpgradeReducer<any, any>;
|
|
1591
|
+
description?: string;
|
|
1592
|
+
};
|
|
1593
|
+
type TupleMember<T extends readonly unknown[]> = T[number];
|
|
1594
|
+
/** Manifest declaring all supported versions and upgrade paths */
|
|
1595
|
+
type UpgradeManifest<TVersions extends readonly number[]> = {
|
|
1596
|
+
documentType: string;
|
|
1597
|
+
latestVersion: TupleMember<TVersions>;
|
|
1598
|
+
supportedVersions: TVersions;
|
|
1599
|
+
upgrades: { [V in Exclude<TupleMember<TVersions>, 1> as `v${V}`]: UpgradeTransition; };
|
|
1150
1600
|
};
|
|
1151
1601
|
/**
|
|
1152
|
-
*
|
|
1602
|
+
* Applies an UPGRADE_DOCUMENT action to a document.
|
|
1603
|
+
* Handles all upgrade scenarios including initial upgrades, no-ops, and multi-step upgrades.
|
|
1604
|
+
*
|
|
1605
|
+
* Behavior based on fromVersion/toVersion:
|
|
1606
|
+
* - fromVersion === toVersion (and fromVersion > 0): No-op - return unchanged document
|
|
1607
|
+
* - fromVersion > toVersion: Throw DowngradeNotSupportedError
|
|
1608
|
+
* - All other cases: Apply upgradePath transitions (if provided), then apply initialState, set version
|
|
1153
1609
|
*/
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
* Called when operations match this processor's filter.
|
|
1158
|
-
*/
|
|
1159
|
-
onOperations(operations: OperationWithContext[]): Promise<void>;
|
|
1160
|
-
/**
|
|
1161
|
-
* Called when the processor is disconnected.
|
|
1162
|
-
* Used to clean up any resources allocated during processor creation.
|
|
1163
|
-
*/
|
|
1164
|
-
onDisconnect(): Promise<void>;
|
|
1165
|
-
}
|
|
1610
|
+
declare function applyUpgradeDocumentAction(document: PHDocument, action: UpgradeDocumentAction, upgradePath?: UpgradeTransition[]): PHDocument;
|
|
1611
|
+
/** CREATE_DOCUMENT fixes `protocolVersions`; this puts them back after a reducer. */
|
|
1612
|
+
declare function withProtocolVersions<TDocument extends PHDocument>(document: TDocument, protocolVersions: PHDocument["header"]["protocolVersions"]): TDocument;
|
|
1166
1613
|
/**
|
|
1167
|
-
*
|
|
1614
|
+
* Applies a DELETE_DOCUMENT action, or a PURGE_DOCUMENT marker, to a document.
|
|
1615
|
+
* Marks the document as deleted in the document scope state.
|
|
1168
1616
|
*/
|
|
1169
|
-
|
|
1170
|
-
processor: IProcessor;
|
|
1171
|
-
filter: ProcessorFilter;
|
|
1172
|
-
startFrom?: "beginning" | "current";
|
|
1173
|
-
id?: string;
|
|
1174
|
-
};
|
|
1617
|
+
declare function applyDeleteDocumentAction(document: PHDocument, action: DeleteDocumentAction | PurgeDocumentAction): PHDocument;
|
|
1175
1618
|
/**
|
|
1176
|
-
*
|
|
1177
|
-
*
|
|
1619
|
+
* Computes the ordered list of upgrade transitions needed to move from
|
|
1620
|
+
* fromVersion to toVersion using the provided manifest.
|
|
1621
|
+
* Walks keys v(fromVersion+1)..v(toVersion) and throws a descriptive Error
|
|
1622
|
+
* if the manifest is absent or any step is missing.
|
|
1178
1623
|
*/
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
processorId: string;
|
|
1187
|
-
factoryId: string;
|
|
1188
|
-
driveId: string;
|
|
1189
|
-
processorIndex: number;
|
|
1190
|
-
record: ProcessorRecord;
|
|
1191
|
-
lastOrdinal: number;
|
|
1192
|
-
status: ProcessorStatus;
|
|
1193
|
-
lastError: string | undefined;
|
|
1194
|
-
lastErrorTimestamp: Date | undefined;
|
|
1195
|
-
retry: () => Promise<void>;
|
|
1624
|
+
declare function computeUpgradeTransitions(manifest: UpgradeManifest<readonly number[]> | undefined, fromVersion: number, toVersion: number): UpgradeTransition[];
|
|
1625
|
+
//#endregion
|
|
1626
|
+
//#region document-model/versioned-replay.d.ts
|
|
1627
|
+
type VersionedReducers = Record<number, Reducer<PHBaseState>>;
|
|
1628
|
+
type VersionedReplayConfig = {
|
|
1629
|
+
reducers: VersionedReducers;
|
|
1630
|
+
upgradeManifest?: UpgradeManifest<readonly number[]>;
|
|
1196
1631
|
};
|
|
1197
1632
|
/**
|
|
1198
|
-
*
|
|
1633
|
+
* Version-aware document replay. Replays a versioned document through per-version
|
|
1634
|
+
* reducers, applying upgrade transitions at segment boundaries.
|
|
1635
|
+
*
|
|
1636
|
+
* Algorithm (D5):
|
|
1637
|
+
* a. Build spine from operations["document"]. Empty spine or no upgrades → legacy fallback.
|
|
1638
|
+
* b. Collect UPGRADE_DOCUMENT ops from the spine.
|
|
1639
|
+
* c. Seed state from the creation upgrade (fromVersion===0). Missing seed with validated
|
|
1640
|
+
* upgrades throws; otherwise falls back to legacy.
|
|
1641
|
+
* d. Identify validated upgrades (fromVersion > 0, version increases). Compute per-scope
|
|
1642
|
+
* boundaries using revision snapshot (preferred) or timestamp fallback.
|
|
1643
|
+
* e. Loop over version segments, replaying each scope's ops through the matching reducer,
|
|
1644
|
+
* then applying the upgrade transition before the next segment.
|
|
1645
|
+
* f. Set header.revision["document"], verify per-scope hashes against state at op-time
|
|
1646
|
+
* (not post-upgrade state) when checkHashes is false, and map timestamps from input.
|
|
1647
|
+
*
|
|
1648
|
+
* operations must include ALL scopes (document scope is NOT stripped).
|
|
1649
|
+
* reuseOperationResultingState is ignored by this function — zip operations never carry
|
|
1650
|
+
* resultingState.
|
|
1199
1651
|
*/
|
|
1200
|
-
|
|
1201
|
-
/**
|
|
1202
|
-
* Registers a processor factory.
|
|
1203
|
-
* Immediately creates processors for all existing drives.
|
|
1204
|
-
*/
|
|
1205
|
-
registerFactory(identifier: string, factory: ProcessorFactory): Promise<void>;
|
|
1206
|
-
/**
|
|
1207
|
-
* Unregisters a processor factory and disconnects all processors it created.
|
|
1208
|
-
*/
|
|
1209
|
-
unregisterFactory(identifier: string): Promise<void>;
|
|
1210
|
-
/**
|
|
1211
|
-
* Gets a tracked processor by its ID.
|
|
1212
|
-
*/
|
|
1213
|
-
get(processorId: string): TrackedProcessor | undefined;
|
|
1214
|
-
/**
|
|
1215
|
-
* Gets all tracked processors.
|
|
1216
|
-
*/
|
|
1217
|
-
getAll(): TrackedProcessor[];
|
|
1218
|
-
}
|
|
1219
|
-
type ProcessorApp = (typeof PROCESSOR_APPS)[number];
|
|
1220
|
-
type ProcessorApps = readonly ProcessorApp[];
|
|
1652
|
+
declare function replayDocumentVersioned<TState extends PHBaseState>(initialState: TState, operations: DocumentOperations, config: VersionedReplayConfig, header: PHDocumentHeader, dispatch?: SignalDispatch, options?: ReplayDocumentOptions): PHDocument<TState>;
|
|
1221
1653
|
//#endregion
|
|
1222
|
-
//#region
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1654
|
+
//#region document-model/files.d.ts
|
|
1655
|
+
declare function createZip(document: PHDocument): Promise<Uint8Array>;
|
|
1656
|
+
/**
|
|
1657
|
+
* Creates a minimal ZIP backup from strand data.
|
|
1658
|
+
* Used when the full document is not available (e.g., in onOperations handler).
|
|
1659
|
+
* Creates a ZIP with minimal header and empty operations.
|
|
1660
|
+
*/
|
|
1661
|
+
declare function createMinimalZip(data: MinimalBackupData): Promise<Uint8Array>;
|
|
1662
|
+
declare function baseSaveToFileHandle(document: PHDocument, input: FileSystemFileHandle): Promise<void>;
|
|
1663
|
+
declare function baseLoadFromInput<TState extends PHBaseState>(input: FileInput, reducer: Reducer<TState>, options?: ReplayDocumentOptions): Promise<PHDocument<TState>>;
|
|
1664
|
+
declare function baseLoadFromInputVersioned<TState extends PHBaseState>(input: FileInput, config: VersionedReplayConfig, options?: ReplayDocumentOptions): Promise<PHDocument<TState>>;
|
|
1665
|
+
type BulkArchiveEntry = {
|
|
1666
|
+
/** "/"-separated zip path of a file entry (no trailing slash). */
|
|
1667
|
+
path: string;
|
|
1668
|
+
data: Uint8Array;
|
|
1226
1669
|
};
|
|
1227
|
-
type HashAlgorithms = "fnv1a";
|
|
1228
|
-
type IBaseRelationalDb<Schema = unknown> = Kysely<Schema>;
|
|
1229
1670
|
/**
|
|
1230
|
-
*
|
|
1231
|
-
*
|
|
1232
|
-
*
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1671
|
+
* Whether this zip is a single Powerhouse document: the document's four JSON
|
|
1672
|
+
* entries (header/state/current-state/operations) at the archive root. A
|
|
1673
|
+
* bulk archive has a folder tree instead. Returns false for any input that
|
|
1674
|
+
* is not a readable zip.
|
|
1675
|
+
*/
|
|
1676
|
+
declare function isDocumentZip(data: Uint8Array): Promise<boolean>;
|
|
1677
|
+
/**
|
|
1678
|
+
* The file entries of a zip (directory entries excluded). Used for bulk
|
|
1679
|
+
* archives; throws when the archive holds no files. Note this does NOT
|
|
1680
|
+
* validate that the entries are document zips — pair with isDocumentZip.
|
|
1681
|
+
*/
|
|
1682
|
+
declare function parseBulkArchive(data: Uint8Array): Promise<BulkArchiveEntry[]>;
|
|
1683
|
+
/**
|
|
1684
|
+
* Assemble a zip from raw entries. A key ending in "/" with empty data is a
|
|
1685
|
+
* directory entry, so an archive's folder structure survives a round-trip.
|
|
1686
|
+
*/
|
|
1687
|
+
declare function zipEntries(entries: Record<string, Uint8Array>): Promise<Uint8Array>;
|
|
1688
|
+
declare const documentModelLoadFromInput: LoadFromInput<DocumentModelPHState>;
|
|
1689
|
+
declare const documentModelSaveToFileHandle: SaveToFileHandle;
|
|
1690
|
+
declare function writeFileBrowser(path: string, name: string, stream: Uint8Array): Promise<string>;
|
|
1691
|
+
declare function readFileBrowser(path: string): void;
|
|
1692
|
+
declare function fetchFileBrowser(url: string): Promise<{
|
|
1693
|
+
data: Buffer;
|
|
1694
|
+
mimeType?: string;
|
|
1695
|
+
}>;
|
|
1696
|
+
declare const getFileBrowser: (file: string) => Promise<void>;
|
|
1697
|
+
//#endregion
|
|
1698
|
+
//#region document-model/header.d.ts
|
|
1699
|
+
/**
|
|
1700
|
+
* Creates a verification-only signer from a public key.
|
|
1701
|
+
* This signer can only verify signatures, not sign data.
|
|
1702
|
+
*
|
|
1703
|
+
* @param pubKey - The public key to use for verification.
|
|
1704
|
+
* @returns An ISigner that can only verify signatures.
|
|
1705
|
+
*/
|
|
1706
|
+
declare function createVerificationSigner(pubKey: JsonWebKey): Promise<ISigner>;
|
|
1707
|
+
/**
|
|
1708
|
+
* Signs a header. Generally, this is not called directly, but rather through
|
|
1709
|
+
* {@link createSignedHeader}.
|
|
1710
|
+
*
|
|
1711
|
+
* @param parameters - The parameters used to sign the header.
|
|
1712
|
+
* @param signer - The signer of the document.
|
|
1713
|
+
*
|
|
1714
|
+
* @returns The signature of the header.
|
|
1715
|
+
*/
|
|
1716
|
+
declare const sign: (parameters: SigningParameters, signer: ISigner) => Promise<string>;
|
|
1717
|
+
/**
|
|
1718
|
+
* Verifies a header signature. Generally, this is not called directly, but
|
|
1719
|
+
* rather through {@link validateHeader}.
|
|
1720
|
+
*
|
|
1721
|
+
* @param parameters - The parameters used to sign the header.
|
|
1722
|
+
* @param signature - The signature to verify.
|
|
1723
|
+
* @param signer - The signer of the document.
|
|
1724
|
+
*/
|
|
1725
|
+
declare const verify: (parameters: SigningParameters, signature: string, signer: ISigner) => Promise<void>;
|
|
1726
|
+
/**
|
|
1727
|
+
* Validates a header signature.
|
|
1728
|
+
*/
|
|
1729
|
+
declare const validateHeader: (header: PHDocumentHeader) => Promise<void>;
|
|
1730
|
+
/**
|
|
1731
|
+
* Creates a header that has yet to be signed. This header is not valid, but
|
|
1732
|
+
* can be input into {@link createSignedHeader} to create a signed header.
|
|
1733
|
+
*
|
|
1734
|
+
* With `protocolVersions` requiring v2 signatures the header takes a random
|
|
1735
|
+
* nonce and the id {@link deriveDocumentId} gives, so `id` must be omitted.
|
|
1736
|
+
*
|
|
1737
|
+
* @returns An unsigned header for a document.
|
|
1738
|
+
*/
|
|
1739
|
+
declare const createPresignedHeader: (id?: string, documentType?: string, protocolVersions?: ProtocolVersions) => PHDocumentHeader;
|
|
1740
|
+
/**
|
|
1741
|
+
* A header for a copy of a document headed `source`. A copy is v2-required
|
|
1742
|
+
* when its source is or when `policy` asks for it, and then takes a derived id;
|
|
1743
|
+
* otherwise it takes `id`. It keeps the source's other protocol versions.
|
|
1744
|
+
*/
|
|
1745
|
+
declare function createCopyHeader(source: Pick<PHDocumentHeader, "documentType" | "protocolVersions">, id?: string, policy?: SignaturePolicy$1): PHDocumentHeader;
|
|
1746
|
+
/** Whether a v2-required `header` carries the id its params derive. */
|
|
1747
|
+
declare function hasDerivedDocumentId(header: PHDocumentHeader): boolean;
|
|
1748
|
+
/**
|
|
1749
|
+
* Creates a new, signed header for a document. This will replace the id of the
|
|
1750
|
+
* document.
|
|
1751
|
+
*
|
|
1752
|
+
* @param unsignedHeader - The unsigned header to created the signed header from.
|
|
1753
|
+
* @param signer - The signer of the document.
|
|
1754
|
+
*
|
|
1755
|
+
* @returns A new signed header for a document. Some fields are mutable and
|
|
1756
|
+
* some are not. See the PHDocumentHeader type for more information.
|
|
1757
|
+
*/
|
|
1758
|
+
declare const createSignedHeader: (unsignedHeader: PHDocumentHeader, documentType: string, signer: ISigner) => Promise<PHDocumentHeader>;
|
|
1759
|
+
/**
|
|
1760
|
+
* Creates a signed header for a document. The document header requires a signer
|
|
1761
|
+
* as the document id is a cryptographic signature.
|
|
1762
|
+
*
|
|
1763
|
+
* @param documentType - The type of the document.
|
|
1764
|
+
* @param signer - The signer of the document.
|
|
1765
|
+
*
|
|
1766
|
+
* @returns The signed header for a document. Some fields are mutable and
|
|
1767
|
+
* some are not. See the PHDocumentHeader type for more information.
|
|
1768
|
+
*/
|
|
1769
|
+
declare const createSignedHeaderForSigner: (documentType: string, signer: ISigner) => Promise<PHDocumentHeader>;
|
|
1770
|
+
//#endregion
|
|
1771
|
+
//#region document-model/peer-agreement.d.ts
|
|
1772
|
+
/** The reactor feature flags a capability's support is a function of. */
|
|
1773
|
+
type PeerCapabilityFlags = {
|
|
1774
|
+
readonly [flag: string]: boolean | undefined;
|
|
1775
|
+
};
|
|
1776
|
+
/** A document protocol, named by its `protocolVersions` key. */
|
|
1777
|
+
type ProtocolCapability = {
|
|
1778
|
+
kind: "protocol";
|
|
1779
|
+
name: string;
|
|
1780
|
+
/** What a peer that announces nothing is assumed to support. */
|
|
1781
|
+
baseline: readonly number[];
|
|
1782
|
+
supported(flags: PeerCapabilityFlags): readonly number[];
|
|
1783
|
+
/** The version new documents take when peers agree. Absent: not negotiated. */
|
|
1784
|
+
preferred?(flags: PeerCapabilityFlags): number;
|
|
1785
|
+
/** A header may omit the key. */
|
|
1786
|
+
optional: boolean;
|
|
1787
|
+
};
|
|
1788
|
+
/** A feature that changes what a peer sends or expects on the wire. */
|
|
1789
|
+
type FeatureCapability = {
|
|
1790
|
+
kind: "feature";
|
|
1791
|
+
name: string;
|
|
1792
|
+
baseline: readonly number[];
|
|
1793
|
+
supported(flags: PeerCapabilityFlags): readonly number[];
|
|
1794
|
+
};
|
|
1795
|
+
type PeerCapability = ProtocolCapability | FeatureCapability;
|
|
1796
|
+
/** A purged document's protocol; never preferred, so creation never selects it. */
|
|
1797
|
+
declare const DOCUMENT_PURGE_PROTOCOL = "document-purge";
|
|
1798
|
+
/** A peer that takes refusals of polled purge markers on the poll. */
|
|
1799
|
+
declare const MARKER_REFUSAL_FEATURE = "marker-refusal";
|
|
1800
|
+
declare const PEER_CAPABILITIES: readonly PeerCapability[];
|
|
1801
|
+
/** `base` plus `extra`; an extra replaces a base entry of the same name. */
|
|
1802
|
+
declare function mergePeerCapabilities(base: readonly PeerCapability[], extra: readonly PeerCapability[]): PeerCapability[];
|
|
1803
|
+
declare const PEER_MANIFEST_FORMAT = 1;
|
|
1804
|
+
type Supports = {
|
|
1805
|
+
protocols: {
|
|
1806
|
+
[protocol: string]: readonly number[];
|
|
1807
|
+
};
|
|
1808
|
+
features: {
|
|
1809
|
+
[feature: string]: readonly number[];
|
|
1810
|
+
};
|
|
1237
1811
|
};
|
|
1238
|
-
type
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1812
|
+
type PeerManifest = Supports & {
|
|
1813
|
+
format: 1;
|
|
1814
|
+
/** The signer's did:key, when configured; informational. */
|
|
1815
|
+
appKey?: string;
|
|
1816
|
+
/** Grows with every start of the reactor; a peer ignores an older one. */
|
|
1817
|
+
sequence: number;
|
|
1818
|
+
/** base64url(sha256(canonicalJson(Supports & { sequence }))) */
|
|
1819
|
+
revision: string;
|
|
1820
|
+
};
|
|
1821
|
+
/** What this reactor supports, for every capability it registers. */
|
|
1822
|
+
declare function localSupports(capabilities: readonly PeerCapability[], flags: PeerCapabilityFlags): Supports;
|
|
1823
|
+
/** What a peer that announces nothing supports. */
|
|
1824
|
+
declare function legacySupports(capabilities: readonly PeerCapability[]): Supports;
|
|
1825
|
+
declare function manifestRevision(supports: Supports, sequence?: number): string;
|
|
1826
|
+
declare function localPeerManifest(capabilities: readonly PeerCapability[], flags: PeerCapabilityFlags, appKey?: string, sequence?: number): PeerManifest;
|
|
1827
|
+
/** A manifest sent before the one already held; silence carries no sequence. */
|
|
1828
|
+
declare function isOlderManifest(next: PeerManifest | null, held: PeerManifest | null | undefined): boolean;
|
|
1829
|
+
/** A peer's manifest, or the baselines for a peer that announced none. */
|
|
1830
|
+
declare function peerSupports(manifest: PeerManifest | null, capabilities: readonly PeerCapability[]): Supports;
|
|
1247
1831
|
/**
|
|
1248
|
-
*
|
|
1249
|
-
*
|
|
1250
|
-
* allowing derived classes to focus on business logic.
|
|
1832
|
+
* A manifest as received from a peer, or null when it is not one. Formats only
|
|
1833
|
+
* add fields, so one of an unknown format is read as its two maps.
|
|
1251
1834
|
*/
|
|
1252
|
-
declare
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
* Abstract method that derived classes must implement.
|
|
1281
|
-
* This method is meant to be called on subclasses to initialize and upgrade the database.
|
|
1282
|
-
*/
|
|
1283
|
-
abstract initAndUpgrade(): Promise<void>;
|
|
1284
|
-
/**
|
|
1285
|
-
* Called when the processor is disconnected.
|
|
1286
|
-
* This method is meant to be overridden by subclasses to clean up resources.
|
|
1287
|
-
*/
|
|
1288
|
-
abstract onDisconnect(): Promise<void>;
|
|
1289
|
-
}
|
|
1835
|
+
declare function readPeerManifest(value: unknown): PeerManifest | null;
|
|
1836
|
+
/** Why a document may not go to a peer. */
|
|
1837
|
+
type HoldReason = {
|
|
1838
|
+
protocol: string;
|
|
1839
|
+
version: number;
|
|
1840
|
+
peerSupports: readonly number[];
|
|
1841
|
+
};
|
|
1842
|
+
/** Only keys this reactor registers are judged; an absent key agrees. */
|
|
1843
|
+
declare function holdReason(peer: Supports, versions: {
|
|
1844
|
+
readonly [protocol: string]: number;
|
|
1845
|
+
}, capabilities: readonly PeerCapability[]): HoldReason | undefined;
|
|
1846
|
+
/** Whether a peer runs every version this reactor does, so nothing is held. */
|
|
1847
|
+
declare function coversLocal(peer: Supports, local: Supports, capabilities: readonly PeerCapability[]): boolean;
|
|
1848
|
+
/**
|
|
1849
|
+
* protocolVersions for a new document: per negotiated protocol, the highest
|
|
1850
|
+
* version up to the local preference that every member supports, else the
|
|
1851
|
+
* lowest local one. `requested` wins over what is selected.
|
|
1852
|
+
*/
|
|
1853
|
+
declare function selectProtocolVersions(input: {
|
|
1854
|
+
capabilities: readonly PeerCapability[];
|
|
1855
|
+
flags: PeerCapabilityFlags;
|
|
1856
|
+
members: Iterable<Supports>;
|
|
1857
|
+
requested?: {
|
|
1858
|
+
readonly [protocol: string]: number;
|
|
1859
|
+
};
|
|
1860
|
+
}): {
|
|
1861
|
+
[protocol: string]: number;
|
|
1862
|
+
};
|
|
1290
1863
|
//#endregion
|
|
1291
|
-
//#region
|
|
1864
|
+
//#region document-model/purge.d.ts
|
|
1865
|
+
declare const PURGE_DOCUMENT = "PURGE_DOCUMENT";
|
|
1866
|
+
type PurgeMarkerOperation = Operation & {
|
|
1867
|
+
action: PurgeDocumentAction;
|
|
1868
|
+
};
|
|
1869
|
+
type ActionLike = Pick<Action, "type">;
|
|
1870
|
+
declare function isPurgeMarker(value: Action): value is PurgeDocumentAction;
|
|
1871
|
+
declare function isPurgeMarker(value: Operation): value is PurgeMarkerOperation;
|
|
1872
|
+
declare function isPurgeMarker(value: OperationWithContext$1): value is OperationWithContext$1 & {
|
|
1873
|
+
operation: PurgeMarkerOperation;
|
|
1874
|
+
};
|
|
1875
|
+
declare function isPurgeMarker(value: ActionLike | {
|
|
1876
|
+
action?: ActionLike;
|
|
1877
|
+
} | {
|
|
1878
|
+
operation: Operation;
|
|
1879
|
+
}): boolean;
|
|
1880
|
+
/** An unsigned marker; `purgedAtUtcIso` is the action's own timestamp. */
|
|
1881
|
+
declare function purgeDocumentAction(input: Omit<PurgeDocumentActionInput, "purgedAtUtcIso">, options?: {
|
|
1882
|
+
id?: string;
|
|
1883
|
+
timestampUtcMs?: string;
|
|
1884
|
+
}): PurgeDocumentAction;
|
|
1885
|
+
/** The sole row of a purged stream: document/main, index 0, skip 0, hash "". */
|
|
1886
|
+
declare function purgeMarkerOperation(action: PurgeDocumentAction): PurgeMarkerOperation;
|
|
1887
|
+
/** Protocol versions of a purged id; derived, never stored. */
|
|
1888
|
+
declare function purgedProtocolVersions(): {
|
|
1889
|
+
[protocol: string]: number;
|
|
1890
|
+
};
|
|
1891
|
+
//#endregion
|
|
1892
|
+
//#region document-model/reducer.d.ts
|
|
1893
|
+
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<TState>;
|
|
1292
1894
|
/**
|
|
1293
|
-
*
|
|
1294
|
-
*
|
|
1295
|
-
* @param
|
|
1296
|
-
* @param
|
|
1297
|
-
* @
|
|
1895
|
+
* Updates the document state based on the provided action.
|
|
1896
|
+
*
|
|
1897
|
+
* @param state The current state of the document.
|
|
1898
|
+
* @param action The action being applied to the document.
|
|
1899
|
+
* @param skip The number of operations to skip before applying the action.
|
|
1900
|
+
* @param reuseLastOperationIndex Whether to reuse the last operation index (used when a an UNDO operation is performed after an existing one).
|
|
1901
|
+
* @param context The operation context for deterministic ID generation.
|
|
1902
|
+
* @returns The updated document state.
|
|
1298
1903
|
*/
|
|
1299
|
-
declare function
|
|
1904
|
+
declare function updateDocument<TDocument extends PHDocument>(document: TDocument, action: Action, reuseLastOperationIndex: boolean, skip: number, context: OperationContext, operation?: Operation, skipIndexValidation?: boolean): TDocument;
|
|
1300
1905
|
/**
|
|
1301
|
-
*
|
|
1302
|
-
*
|
|
1303
|
-
* @param
|
|
1304
|
-
* @
|
|
1906
|
+
* Processes an UNDO or REDO action.
|
|
1907
|
+
*
|
|
1908
|
+
* @param document The current state of the document.
|
|
1909
|
+
* @param action The action being applied to the document.
|
|
1910
|
+
* @param skip The number of operations to skip before applying the action.
|
|
1911
|
+
* @returns The updated document, calculated skip value and transformed action (if applied).
|
|
1305
1912
|
*/
|
|
1306
|
-
declare function
|
|
1307
|
-
|
|
1308
|
-
|
|
1913
|
+
declare function processUndoRedo<TState extends PHBaseState = PHBaseState>(document: PHDocument<TState>, action: Action, skip: number, protocolVersion?: number): {
|
|
1914
|
+
document: PHDocument<TState>;
|
|
1915
|
+
action: Action;
|
|
1916
|
+
skip: number;
|
|
1917
|
+
reuseLastOperationIndex: boolean;
|
|
1309
1918
|
};
|
|
1310
|
-
declare function createNamespacedDb<Schema>(db: IBaseRelationalDb<any>, namespace: string, options?: NamespaceOptions): Promise<IRelationalDb<Schema>>;
|
|
1311
|
-
declare function createNamespacedQueryBuilder<Schema>(db: IBaseRelationalDb<any>, namespace: string, options?: NamespaceOptions): IRelationalQueryBuilder<Schema>;
|
|
1312
1919
|
/**
|
|
1313
|
-
*
|
|
1314
|
-
*
|
|
1315
|
-
*
|
|
1920
|
+
* Base document reducer that wraps a custom document reducer and handles
|
|
1921
|
+
* document-level actions such as undo, redo, and set name.
|
|
1922
|
+
*
|
|
1923
|
+
* @template TGlobalState - The type of the state of the custom reducer.
|
|
1924
|
+
* @template TAction - The type of the actions of the custom reducer.
|
|
1925
|
+
* @param state - The current state of the document.
|
|
1926
|
+
* @param action - The action object to apply to the state.
|
|
1927
|
+
* @param customReducer - The custom reducer that implements the application logic
|
|
1928
|
+
* specific to the document's state.
|
|
1929
|
+
* @returns The new state of the document.
|
|
1316
1930
|
*/
|
|
1317
|
-
declare function
|
|
1931
|
+
declare function baseReducer<TState extends PHBaseState = PHBaseState>(document: PHDocument<TState>, action: Action, customReducer: StateReducer<TState>, dispatch?: SignalDispatch, options?: ReducerOptions): PHDocument<TState>;
|
|
1932
|
+
/**
|
|
1933
|
+
* Helper function to create a document model reducer.
|
|
1934
|
+
*
|
|
1935
|
+
* @remarks
|
|
1936
|
+
* This function creates a new reducer that wraps the provided `reducer` with
|
|
1937
|
+
* `documentReducer`, adding support for document actions:
|
|
1938
|
+
* - `SET_NAME`
|
|
1939
|
+
* - `UNDO`
|
|
1940
|
+
* - `REDO`
|
|
1941
|
+
*
|
|
1942
|
+
* It also updates the document-related attributes on every operation.
|
|
1943
|
+
*
|
|
1944
|
+
* @param reducer - The custom reducer to wrap.
|
|
1945
|
+
* @param documentReducer - The document reducer to use.
|
|
1946
|
+
*
|
|
1947
|
+
* @returns The new reducer.
|
|
1948
|
+
*/
|
|
1949
|
+
declare function createReducer<TState extends PHBaseState = PHBaseState>(stateReducer: StateReducer<TState>, documentReducer?: typeof baseReducer): Reducer<TState>;
|
|
1950
|
+
//#endregion
|
|
1951
|
+
//#region document-model/reducers.d.ts
|
|
1952
|
+
declare const documentModelHeaderReducer: DocumentModelHeaderOperations;
|
|
1953
|
+
declare const documentModelModuleReducer: DocumentModelModuleOperations;
|
|
1954
|
+
declare const documentModelOperationErrorReducer: DocumentModelOperationErrorOperations;
|
|
1955
|
+
declare const documentModelOperationExampleReducer: DocumentModelOperationExampleOperations;
|
|
1956
|
+
declare const documentModelOperationReducer: DocumentModelOperationOperations;
|
|
1957
|
+
declare const documentModelStateSchemaReducer: DocumentModelStateOperations;
|
|
1958
|
+
declare const documentModelVersioningReducer: DocumentModelVersioningOperations;
|
|
1959
|
+
declare const documentModelStateReducer: StateReducer<DocumentModelPHState>;
|
|
1960
|
+
declare const documentModelReducer: Reducer<DocumentModelPHState>;
|
|
1318
1961
|
//#endregion
|
|
1319
1962
|
//#region document-model/schemas.d.ts
|
|
1320
1963
|
type definedNonNullAny = {};
|
|
1321
1964
|
declare const isDefinedNonNullAny: (v: any) => v is definedNonNullAny;
|
|
1322
1965
|
declare const definedNonNullAnySchema: z.ZodAny & z.ZodType<definedNonNullAny, any, z.core.$ZodTypeInternals<definedNonNullAny, any>>;
|
|
1323
|
-
declare const Load_StateSchema: z.ZodEnum<{
|
|
1324
|
-
LOAD_STATE: "LOAD_STATE";
|
|
1325
|
-
}>;
|
|
1326
|
-
declare const PruneSchema: z.ZodEnum<{
|
|
1327
|
-
PRUNE: "PRUNE";
|
|
1328
|
-
}>;
|
|
1329
1966
|
declare const RedoSchema: z.ZodEnum<{
|
|
1330
1967
|
REDO: "REDO";
|
|
1331
1968
|
}>;
|
|
@@ -1340,18 +1977,6 @@ declare const UndoSchema: z.ZodEnum<{
|
|
|
1340
1977
|
}>;
|
|
1341
1978
|
declare function OperationScopeSchema(): z.ZodString;
|
|
1342
1979
|
declare function DocumentActionSchema(): z.ZodUnion<readonly [z.ZodObject<Required<{
|
|
1343
|
-
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
1344
|
-
timestampUtcMs: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
1345
|
-
input: z.ZodType<LoadStateActionInput, LoadStateActionInput, z.core.$ZodTypeInternals<LoadStateActionInput, LoadStateActionInput>>;
|
|
1346
|
-
type: z.ZodType<"LOAD_STATE", "LOAD_STATE", z.core.$ZodTypeInternals<"LOAD_STATE", "LOAD_STATE">>;
|
|
1347
|
-
scope: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
1348
|
-
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
1349
|
-
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
1350
|
-
timestampUtcMs: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
1351
|
-
input: z.ZodType<PruneActionInput, PruneActionInput, z.core.$ZodTypeInternals<PruneActionInput, PruneActionInput>>;
|
|
1352
|
-
type: z.ZodType<"PRUNE", "PRUNE", z.core.$ZodTypeInternals<"PRUNE", "PRUNE">>;
|
|
1353
|
-
scope: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
1354
|
-
}>, z.core.$strip>, z.ZodObject<Required<{
|
|
1355
1980
|
id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
1356
1981
|
timestampUtcMs: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
1357
1982
|
input: z.ZodType<RedoActionInput, RedoActionInput, z.core.$ZodTypeInternals<RedoActionInput, RedoActionInput>>;
|
|
@@ -1376,11 +2001,6 @@ declare function DocumentActionSchema(): z.ZodUnion<readonly [z.ZodObject<Requir
|
|
|
1376
2001
|
type: z.ZodType<"UNDO", "UNDO", z.core.$ZodTypeInternals<"UNDO", "UNDO">>;
|
|
1377
2002
|
scope: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
1378
2003
|
}>, z.core.$strip>]>;
|
|
1379
|
-
declare function LoadStateActionSchema(): z.ZodObject<Properties<SchemaLoadStateAction>>;
|
|
1380
|
-
declare function LoadStateActionInputSchema(): z.ZodObject<Properties<LoadStateActionInput>>;
|
|
1381
|
-
declare function LoadStateActionStateInputSchema(): z.ZodObject<Properties<LoadStateActionStateInput>>;
|
|
1382
|
-
declare function PruneActionSchema(): z.ZodObject<Properties<SchemaPruneAction>>;
|
|
1383
|
-
declare function PruneActionInputSchema(): z.ZodObject<Properties<PruneActionInput>>;
|
|
1384
2004
|
declare function RedoActionInputSchema(): z.ZodObject<{
|
|
1385
2005
|
count: z.ZodNumber;
|
|
1386
2006
|
}, z.core.$strip>;
|
|
@@ -1397,7 +2017,7 @@ declare function UndoActionInputSchema(): z.ZodObject<{
|
|
|
1397
2017
|
count: z.ZodNumber;
|
|
1398
2018
|
}, z.core.$strip>;
|
|
1399
2019
|
declare function UndoActionSchema(): z.ZodObject<Properties<SchemaUndoAction>>;
|
|
1400
|
-
type Properties<T> = Required<{ [K in keyof T]: z.ZodType<T[K], T[K]
|
|
2020
|
+
type Properties<T> = Required<{ [K in keyof T]: z.ZodType<T[K], T[K]>; }>;
|
|
1401
2021
|
declare function AddChangeLogItemInputSchema(): z.ZodObject<Properties<AddChangeLogItemInput>>;
|
|
1402
2022
|
declare function AddModuleInputSchema(): z.ZodObject<Properties<AddModuleInput>>;
|
|
1403
2023
|
declare function AddOperationErrorInputSchema(): z.ZodObject<Properties<AddOperationErrorInput>>;
|
|
@@ -1590,6 +2210,24 @@ declare const PowerhouseModulesSchema: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
|
1590
2210
|
name: z.ZodString;
|
|
1591
2211
|
documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1592
2212
|
}, z.core.$strip>>>;
|
|
2213
|
+
declare const PieceModuleSchema: z.ZodObject<{
|
|
2214
|
+
id: z.ZodString;
|
|
2215
|
+
name: z.ZodString;
|
|
2216
|
+
documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2217
|
+
version: z.ZodOptional<z.ZodString>;
|
|
2218
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2219
|
+
bundle: z.ZodOptional<z.ZodString>;
|
|
2220
|
+
descriptor: z.ZodOptional<z.ZodString>;
|
|
2221
|
+
}, z.core.$strip>;
|
|
2222
|
+
declare const PieceModulesSchema: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2223
|
+
id: z.ZodString;
|
|
2224
|
+
name: z.ZodString;
|
|
2225
|
+
documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2226
|
+
version: z.ZodOptional<z.ZodString>;
|
|
2227
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2228
|
+
bundle: z.ZodOptional<z.ZodString>;
|
|
2229
|
+
descriptor: z.ZodOptional<z.ZodString>;
|
|
2230
|
+
}, z.core.$strip>>>;
|
|
1593
2231
|
declare const PublisherSchema: z.ZodObject<{
|
|
1594
2232
|
name: z.ZodOptional<z.ZodString>;
|
|
1595
2233
|
url: z.ZodOptional<z.ZodString>;
|
|
@@ -1600,7 +2238,7 @@ declare const ConfigEntrySchema: z.ZodObject<{
|
|
|
1600
2238
|
type: z.ZodUnion<readonly [z.ZodLiteral<"var">, z.ZodLiteral<"secret">]>;
|
|
1601
2239
|
description: z.ZodOptional<z.ZodString>;
|
|
1602
2240
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
1603
|
-
default: z.ZodOptional<z.
|
|
2241
|
+
default: z.ZodOptional<z.ZodString>;
|
|
1604
2242
|
}, z.core.$strip>;
|
|
1605
2243
|
declare const PwaConfigSchema: z.ZodType<PHConnectPwa>;
|
|
1606
2244
|
declare const ManifestSchema: z.ZodObject<{
|
|
@@ -1637,65 +2275,573 @@ declare const ManifestSchema: z.ZodObject<{
|
|
|
1637
2275
|
name: z.ZodString;
|
|
1638
2276
|
documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1639
2277
|
}, z.core.$strip>>>;
|
|
2278
|
+
pieces: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2279
|
+
id: z.ZodString;
|
|
2280
|
+
name: z.ZodString;
|
|
2281
|
+
documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2282
|
+
version: z.ZodOptional<z.ZodString>;
|
|
2283
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2284
|
+
bundle: z.ZodOptional<z.ZodString>;
|
|
2285
|
+
descriptor: z.ZodOptional<z.ZodString>;
|
|
2286
|
+
}, z.core.$strip>>>;
|
|
1640
2287
|
config: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1641
2288
|
name: z.ZodString;
|
|
1642
2289
|
type: z.ZodUnion<readonly [z.ZodLiteral<"var">, z.ZodLiteral<"secret">]>;
|
|
1643
2290
|
description: z.ZodOptional<z.ZodString>;
|
|
1644
2291
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
1645
|
-
default: z.ZodOptional<z.
|
|
2292
|
+
default: z.ZodOptional<z.ZodString>;
|
|
1646
2293
|
}, z.core.$strip>>>;
|
|
1647
2294
|
pwa: z.ZodOptional<z.ZodType<PHConnectPwa, unknown, z.core.$ZodTypeInternals<PHConnectPwa, unknown>>>;
|
|
1648
2295
|
}, z.core.$strip>;
|
|
1649
2296
|
//#endregion
|
|
1650
|
-
//#region document-model/
|
|
1651
|
-
/**
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
2297
|
+
//#region document-model/validation.d.ts
|
|
2298
|
+
/**
|
|
2299
|
+
* Reserved operation names from base reducer (core/actions.ts).
|
|
2300
|
+
* These names cannot be used for custom operations.
|
|
2301
|
+
*/
|
|
2302
|
+
declare const RESERVED_OPERATION_NAMES: readonly ["UNDO", "REDO", "SET_NAME", "SET_PREFERRED_EDITOR", "NOOP", "PURGE_DOCUMENT"];
|
|
2303
|
+
type ReservedOperationName = (typeof RESERVED_OPERATION_NAMES)[number];
|
|
2304
|
+
/**
|
|
2305
|
+
* Operation names become the literal action `type` string at runtime and the
|
|
2306
|
+
* key for codegen's action union. They must be SCREAMING_SNAKE_CASE so the
|
|
2307
|
+
* generated TypeScript is valid.
|
|
2308
|
+
*/
|
|
2309
|
+
declare const OPERATION_NAME_PATTERN: RegExp;
|
|
2310
|
+
declare function isValidOperationNameFormat(name: string): boolean;
|
|
2311
|
+
/**
|
|
2312
|
+
* Check if name conflicts with base reducer actions (case-insensitive).
|
|
2313
|
+
*/
|
|
2314
|
+
declare function isReservedOperationName(name: string): boolean;
|
|
2315
|
+
/**
|
|
2316
|
+
* Get all operation names from all modules in the latest specification.
|
|
2317
|
+
* Returns names in uppercase for case-insensitive comparison.
|
|
2318
|
+
*/
|
|
2319
|
+
declare function getAllOperationNames(state: DocumentModelGlobalState, excludeOperationId?: string): string[];
|
|
2320
|
+
/**
|
|
2321
|
+
* Validate operation name is not reserved or duplicate. Throws on failure.
|
|
2322
|
+
*
|
|
2323
|
+
* @param name - The operation name to validate
|
|
2324
|
+
* @param state - The document model global state
|
|
2325
|
+
* @param excludeOperationId - Optional operation ID to exclude (for rename validation)
|
|
2326
|
+
* @throws Error if the name is reserved or a duplicate
|
|
2327
|
+
*/
|
|
2328
|
+
declare function validateOperationName(name: string, state: DocumentModelGlobalState, excludeOperationId?: string): void;
|
|
2329
|
+
declare function validateInitialState(initialState: string, allowEmptyState?: boolean): ValidationError[];
|
|
2330
|
+
declare function validateStateSchemaName(schema: string, documentName: string, scope?: string, allowEmptySchema?: boolean): ValidationError[];
|
|
2331
|
+
declare function validateModules(modules: ModuleSpecification[]): ValidationError[];
|
|
2332
|
+
declare function validateModule(mod: ModuleSpecification): ValidationError[];
|
|
2333
|
+
declare function validateModuleOperation(operation: OperationSpecification): ValidationError[];
|
|
2334
|
+
/**
|
|
2335
|
+
* Find a module in the latest specification by id, or throw. Reducers that
|
|
2336
|
+
* mutate-by-id should call this up front so an unknown id fails loudly
|
|
2337
|
+
* instead of silently no-opping.
|
|
2338
|
+
*/
|
|
2339
|
+
declare function findModuleOrThrow(state: DocumentModelGlobalState, moduleId: string): ModuleSpecification;
|
|
2340
|
+
/**
|
|
2341
|
+
* Find an operation in the latest specification by id, or throw. Same
|
|
2342
|
+
* rationale as findModuleOrThrow — reducers that target an operation must
|
|
2343
|
+
* fail loudly when the operation doesn't exist.
|
|
2344
|
+
*/
|
|
2345
|
+
declare function findOperationOrThrow(state: DocumentModelGlobalState, operationId: string): OperationSpecification;
|
|
2346
|
+
/**
|
|
2347
|
+
* Find an operation error by id across all operations in the latest
|
|
2348
|
+
* specification, or throw. Throws on a duplicate id too: setters act on a
|
|
2349
|
+
* single error, so an ambiguous id must fail loudly rather than mutate an
|
|
2350
|
+
* arbitrary match.
|
|
2351
|
+
*/
|
|
2352
|
+
declare function findOperationErrorOrThrow(state: DocumentModelGlobalState, errorId: string): OperationErrorSpecification;
|
|
2353
|
+
/**
|
|
2354
|
+
* Find an operation example (code example) by id across all operations in the
|
|
2355
|
+
* latest specification, or throw. Throws on a duplicate id for the same reason
|
|
2356
|
+
* as findOperationErrorOrThrow.
|
|
2357
|
+
*/
|
|
2358
|
+
declare function findOperationExampleOrThrow(state: DocumentModelGlobalState, exampleId: string): CodeExample;
|
|
2359
|
+
/**
|
|
2360
|
+
* Assert no module in the latest specification already uses `id`. Modules are
|
|
2361
|
+
* targeted by id by the setter/delete/reorder reducers, so a duplicate id makes
|
|
2362
|
+
* those operations ambiguous.
|
|
2363
|
+
*/
|
|
2364
|
+
declare function assertModuleIdUnique(state: DocumentModelGlobalState, id: string): void;
|
|
2365
|
+
/**
|
|
2366
|
+
* Assert no operation in the latest specification already uses `id`. Operations
|
|
2367
|
+
* are targeted by id across all modules, so the id must be unique document-wide.
|
|
2368
|
+
*/
|
|
2369
|
+
declare function assertOperationIdUnique(state: DocumentModelGlobalState, id: string): void;
|
|
2370
|
+
/**
|
|
2371
|
+
* Assert no operation error in the latest specification already uses `id`.
|
|
2372
|
+
* Error ids are targeted document-wide by the setter/delete reducers, so the id
|
|
2373
|
+
* must be unique to keep those operations unambiguous.
|
|
2374
|
+
*/
|
|
2375
|
+
declare function assertOperationErrorIdUnique(state: DocumentModelGlobalState, id: string): void;
|
|
2376
|
+
/**
|
|
2377
|
+
* Assert no operation example in the latest specification already uses `id`.
|
|
2378
|
+
* Example ids are targeted document-wide by the update/delete reducers, so the
|
|
2379
|
+
* id must be unique to keep those operations unambiguous.
|
|
2380
|
+
*/
|
|
2381
|
+
declare function assertOperationExampleIdUnique(state: DocumentModelGlobalState, id: string): void;
|
|
2382
|
+
declare function validateOperations(operations: DocumentOperations): ValidationError[];
|
|
2383
|
+
//#endregion
|
|
2384
|
+
//#region processors/deletion.d.ts
|
|
2385
|
+
/** The id a DELETE_DOCUMENT or PURGE_DOCUMENT removes; undefined otherwise. */
|
|
2386
|
+
declare function deletedDocumentId(op: OperationWithContext$1): string | undefined;
|
|
2387
|
+
//#endregion
|
|
2388
|
+
//#region processors/http.d.ts
|
|
2389
|
+
/** Methods a package route may bind. OPTIONS belongs to the CORS layer. */
|
|
2390
|
+
type RouteMethod = "DELETE" | "GET" | "HEAD" | "PATCH" | "POST" | "PUT";
|
|
2391
|
+
interface RouteUser {
|
|
2392
|
+
address: string;
|
|
2393
|
+
chainId: number;
|
|
2394
|
+
networkId: string;
|
|
2395
|
+
appKey: string;
|
|
2396
|
+
}
|
|
2397
|
+
type RouteActor = {
|
|
2398
|
+
user: RouteUser | undefined;
|
|
2399
|
+
authEnabled: boolean;
|
|
2400
|
+
};
|
|
2401
|
+
type AuthorizerResult = {
|
|
2402
|
+
authorized: true;
|
|
2403
|
+
} |
|
|
2404
|
+
/** Refused; the scope answers with its own JSON error envelope. */
|
|
2405
|
+
{
|
|
2406
|
+
authorized: false;
|
|
2407
|
+
status: number;
|
|
2408
|
+
message: string;
|
|
2409
|
+
} | {
|
|
2410
|
+
authorized: false;
|
|
2411
|
+
response: Response;
|
|
2412
|
+
};
|
|
2413
|
+
/** A route-specific gate, for policies the standard modes cannot express. */
|
|
2414
|
+
type RouteAuthorizer = (req: IncomingMessage) => Promise<AuthorizerResult> | AuthorizerResult;
|
|
2415
|
+
/** How a route authenticates. */
|
|
2416
|
+
type RouteAuth =
|
|
2417
|
+
/** Default. A verifiable bearer is required; a caller without one gets 401. */
|
|
2418
|
+
"renown" | "renown-optional" | "public" | RouteAuthorizer;
|
|
2419
|
+
/** How the request body reaches the handler. */
|
|
2420
|
+
type RouteBody =
|
|
2421
|
+
/** Default. Buffered, and readable through the Fetch Request. */
|
|
2422
|
+
"parsed" |
|
|
2423
|
+
/** Buffered and also handed over as `ctx.rawBody`, byte for byte. */
|
|
2424
|
+
"raw" |
|
|
2425
|
+
/** Not buffered; the Fetch Request body is the live request stream. */
|
|
2426
|
+
"stream" |
|
|
2427
|
+
/** The body is not read at all. */
|
|
2428
|
+
"none";
|
|
2429
|
+
interface RouteOptions {
|
|
2430
|
+
auth?: RouteAuth;
|
|
2431
|
+
body?: RouteBody;
|
|
2432
|
+
/** Refuse a body larger than this with 413. Ignored when body is `stream`. */
|
|
2433
|
+
maxBodyBytes?: number;
|
|
2434
|
+
/** Serve sub-paths too, not just an exact match. */
|
|
2435
|
+
prefix?: boolean;
|
|
2436
|
+
}
|
|
2437
|
+
/** Where the request reached the host, resolved through any reverse proxy. */
|
|
2438
|
+
interface RouteTransport {
|
|
2439
|
+
proto: string;
|
|
2440
|
+
host: string;
|
|
2441
|
+
prefix: string;
|
|
2442
|
+
baseUrl: string;
|
|
2443
|
+
}
|
|
2444
|
+
interface RouteContext {
|
|
2445
|
+
/** Decoded path params. */
|
|
2446
|
+
params: Record<string, string>;
|
|
2447
|
+
user: RouteUser | undefined;
|
|
2448
|
+
authEnabled: boolean;
|
|
2449
|
+
/** The exact octets received. Present only when body is `raw`. */
|
|
2450
|
+
rawBody: Buffer | undefined;
|
|
2451
|
+
/** Aborts when the client disconnects. */
|
|
2452
|
+
signal: AbortSignal;
|
|
2453
|
+
transport: RouteTransport;
|
|
2454
|
+
}
|
|
2455
|
+
type RouteHandler = (request: Request, ctx: RouteContext) => Response | Promise<Response>;
|
|
2456
|
+
interface RouteSpec extends RouteOptions {
|
|
2457
|
+
method: RouteMethod | RouteMethod[];
|
|
2458
|
+
/** Relative to the scope: "runs/:id", never "/api/@scope/pkg/runs/:id". */
|
|
2459
|
+
path: string;
|
|
2460
|
+
handler: RouteHandler;
|
|
2461
|
+
}
|
|
2462
|
+
interface NodeRouteSpec extends Omit<RouteOptions, "body" | "maxBodyBytes"> {
|
|
2463
|
+
method: RouteMethod | RouteMethod[];
|
|
2464
|
+
path: string;
|
|
2465
|
+
handler: (req: IncomingMessage, res: ServerResponse, ctx: Omit<RouteContext, "rawBody" | "signal">) => void | Promise<void>;
|
|
2466
|
+
}
|
|
2467
|
+
interface ScopedRouteHandle {
|
|
2468
|
+
/** The absolute public URL this route answers on. */
|
|
2469
|
+
readonly url: string;
|
|
2470
|
+
dispose(): void;
|
|
2471
|
+
}
|
|
2472
|
+
type WebhookScheme = "none" |
|
|
2473
|
+
/** A shared secret presented verbatim. No digest, so no digest options. */
|
|
2474
|
+
"token" |
|
|
2475
|
+
/** The digest of the body, alone. */
|
|
2476
|
+
"hmac" |
|
|
2477
|
+
/** That digest behind a label, `sha256=<digest>`. */
|
|
2478
|
+
"hmac-prefixed" | "hmac-timestamped";
|
|
2479
|
+
/** Hashes a sender may compute the digest with. */
|
|
2480
|
+
type WebhookHashAlgorithm = "sha1" | "sha256" | "sha512";
|
|
2481
|
+
/** How the digest is written into the header. */
|
|
2482
|
+
type WebhookSignatureEncoding = "hex" | "base64";
|
|
2483
|
+
interface WebhookVerification {
|
|
2484
|
+
scheme: WebhookScheme;
|
|
2485
|
+
/** Resolved value, never a reference — the caller resolves refs. */
|
|
2486
|
+
secret?: string;
|
|
2487
|
+
/** Overrides the scheme's conventional header. */
|
|
2488
|
+
header?: string;
|
|
2489
|
+
/** Replay window for timestamped schemes. */
|
|
2490
|
+
toleranceSeconds?: number;
|
|
2491
|
+
algorithm?: WebhookHashAlgorithm;
|
|
2492
|
+
/** Defaults to `hex`. Base64 comparison is case-sensitive; hex is not. */
|
|
2493
|
+
encoding?: WebhookSignatureEncoding;
|
|
2494
|
+
prefix?: string;
|
|
2495
|
+
}
|
|
2496
|
+
type WebhookField = string | {
|
|
2497
|
+
header: string;
|
|
2498
|
+
} |
|
|
2499
|
+
/** Dot-separated path into the parsed body, e.g. `data.object.id`. */
|
|
2500
|
+
{
|
|
2501
|
+
body: string;
|
|
2502
|
+
};
|
|
2503
|
+
interface WebhookRequest {
|
|
2504
|
+
/** The caller's own key for this endpoint, e.g. a document id. */
|
|
2505
|
+
key: string;
|
|
2506
|
+
method: string;
|
|
2507
|
+
path: string;
|
|
2508
|
+
queryParams: Record<string, string>;
|
|
2509
|
+
/** Lowercased, with credentials redacted. */
|
|
2510
|
+
headers: Record<string, string>;
|
|
2511
|
+
/** The exact bytes received. */
|
|
2512
|
+
raw: Buffer;
|
|
2513
|
+
/** JSON and form bodies decoded; anything else as text. */
|
|
2514
|
+
body: unknown;
|
|
2515
|
+
}
|
|
2516
|
+
interface WebhookReply {
|
|
2517
|
+
status: number;
|
|
2518
|
+
body?: string;
|
|
2519
|
+
contentType?: string;
|
|
2520
|
+
}
|
|
2521
|
+
interface WebhookPolicy {
|
|
2522
|
+
verify?: WebhookVerification;
|
|
2523
|
+
/** Uppercase. Undefined accepts every method. */
|
|
2524
|
+
methods?: string[];
|
|
2525
|
+
dedupe?: {
|
|
2526
|
+
field: WebhookField;
|
|
2527
|
+
ttlSeconds?: number;
|
|
2528
|
+
};
|
|
2529
|
+
challengeField?: WebhookField;
|
|
2530
|
+
maxBodyBytes?: number;
|
|
2531
|
+
}
|
|
2532
|
+
interface WebhookSpec {
|
|
2533
|
+
/** Distinguishes several endpoint families within one package. */
|
|
2534
|
+
name: string;
|
|
2535
|
+
defaults?: WebhookPolicy;
|
|
2536
|
+
onRequest: (request: WebhookRequest) => Promise<WebhookReply> | WebhookReply;
|
|
2537
|
+
policyFor?: (key: string) => Promise<WebhookPolicy | undefined> | WebhookPolicy | undefined;
|
|
2538
|
+
}
|
|
2539
|
+
interface WebhookEndpointInfo {
|
|
2540
|
+
key: string;
|
|
2541
|
+
token: string;
|
|
2542
|
+
url: string;
|
|
2543
|
+
createdAt: string;
|
|
2544
|
+
}
|
|
2545
|
+
interface IWebhookEndpoints {
|
|
2546
|
+
endpointFor(key: string): Promise<Omit<WebhookEndpointInfo, "key">>;
|
|
2547
|
+
revoke(key: string): Promise<void>;
|
|
2548
|
+
list(): Promise<WebhookEndpointInfo[]>;
|
|
2549
|
+
}
|
|
2550
|
+
interface IWebhookScope {
|
|
2551
|
+
register(spec: WebhookSpec): Promise<IWebhookEndpoints>;
|
|
2552
|
+
readonly hasPublicOrigin: boolean;
|
|
2553
|
+
}
|
|
2554
|
+
interface IHttpScope {
|
|
2555
|
+
readonly owner: string;
|
|
2556
|
+
readonly baseUrl: string;
|
|
2557
|
+
get(path: string, handler: RouteHandler): ScopedRouteHandle;
|
|
2558
|
+
get(path: string, options: RouteOptions, handler: RouteHandler): ScopedRouteHandle;
|
|
2559
|
+
post(path: string, handler: RouteHandler): ScopedRouteHandle;
|
|
2560
|
+
post(path: string, options: RouteOptions, handler: RouteHandler): ScopedRouteHandle;
|
|
2561
|
+
put(path: string, handler: RouteHandler): ScopedRouteHandle;
|
|
2562
|
+
put(path: string, options: RouteOptions, handler: RouteHandler): ScopedRouteHandle;
|
|
2563
|
+
patch(path: string, handler: RouteHandler): ScopedRouteHandle;
|
|
2564
|
+
patch(path: string, options: RouteOptions, handler: RouteHandler): ScopedRouteHandle;
|
|
2565
|
+
delete(path: string, handler: RouteHandler): ScopedRouteHandle;
|
|
2566
|
+
delete(path: string, options: RouteOptions, handler: RouteHandler): ScopedRouteHandle;
|
|
2567
|
+
/** Registered independently of GET: a HEAD response is not a bodyless GET. */
|
|
2568
|
+
head(path: string, handler: RouteHandler): ScopedRouteHandle;
|
|
2569
|
+
head(path: string, options: RouteOptions, handler: RouteHandler): ScopedRouteHandle;
|
|
2570
|
+
route(spec: RouteSpec): ScopedRouteHandle;
|
|
2571
|
+
nodeRoute(spec: NodeRouteSpec): ScopedRouteHandle;
|
|
2572
|
+
readonly webhooks: IWebhookScope;
|
|
2573
|
+
/** Release every route this scope registered. Called on package teardown. */
|
|
2574
|
+
dispose(): void;
|
|
2575
|
+
}
|
|
2576
|
+
//#endregion
|
|
2577
|
+
//#region processors/types.d.ts
|
|
2578
|
+
type ProcessorDispatchResult = {
|
|
2579
|
+
id: string;
|
|
2580
|
+
status: string;
|
|
2581
|
+
};
|
|
2582
|
+
interface IProcessorDispatch {
|
|
2583
|
+
execute(docId: string, branch: string, actions: Action[], signal?: AbortSignal, meta?: Record<string, unknown>): Promise<ProcessorDispatchResult>;
|
|
2584
|
+
}
|
|
2585
|
+
interface IProcessorHostModuleBase {
|
|
2586
|
+
analyticsStore: IAnalyticsStore;
|
|
2587
|
+
relationalDb: IRelationalDb;
|
|
2588
|
+
processorApp: ProcessorApp;
|
|
2589
|
+
dispatch: IProcessorDispatch;
|
|
2590
|
+
getReadModel<T>(name: string): T;
|
|
2591
|
+
config?: Map<string, unknown>;
|
|
2592
|
+
/**
|
|
2593
|
+
* The package's slice of the HTTP surface, bound to its own namespace.
|
|
2594
|
+
*
|
|
2595
|
+
* Declared on the host-agnostic base rather than on each host's module so
|
|
2596
|
+
* the two cannot drift: codegen types generated processors against
|
|
2597
|
+
* reactor-browser's `IProcessorHostModule`, and the same source has to
|
|
2598
|
+
* compile against reactor-api's.
|
|
2599
|
+
*
|
|
2600
|
+
* Absent whenever the host has no HTTP server — processors also run in the
|
|
2601
|
+
* browser — and on the reactor when the package's name cannot be resolved to
|
|
2602
|
+
* a routable namespace, so a caller must always check before using it.
|
|
2603
|
+
*/
|
|
2604
|
+
http?: IHttpScope;
|
|
2605
|
+
}
|
|
2606
|
+
/**
|
|
2607
|
+
* Filter for matching operations to processors.
|
|
2608
|
+
* All fields are optional arrays - when provided, operations must match at least one value in each specified field.
|
|
2609
|
+
* When a field is undefined or empty, it matches all values for that field.
|
|
2610
|
+
*/
|
|
2611
|
+
type ProcessorFilter = {
|
|
2612
|
+
documentType?: string[];
|
|
2613
|
+
scope?: string[];
|
|
2614
|
+
branch?: string[];
|
|
2615
|
+
documentId?: string[];
|
|
2616
|
+
};
|
|
2617
|
+
/**
|
|
2618
|
+
* Describes an object that can process operations.
|
|
2619
|
+
*/
|
|
2620
|
+
interface IProcessor {
|
|
2621
|
+
/**
|
|
2622
|
+
* Processes a list of operations with context.
|
|
2623
|
+
* Called when operations match this processor's filter.
|
|
2624
|
+
*
|
|
2625
|
+
* Delivery is at-least-once. Within a document's scope and branch, each
|
|
2626
|
+
* call is in ordinal order, and an operation delivered late comes with
|
|
2627
|
+
* every later operation of its stream this processor was already given.
|
|
2628
|
+
* Across documents there is no ordering guarantee. A processor receives one
|
|
2629
|
+
* `onOperations` call at a time; the next call begins after the previous
|
|
2630
|
+
* resolves.
|
|
2631
|
+
*
|
|
2632
|
+
* A drive's processors also receive the drive's own DELETE_DOCUMENT or
|
|
2633
|
+
* PURGE_DOCUMENT, whatever the filter, as the last delivery before
|
|
2634
|
+
* `onDisconnect`. A purged document's operations other than its marker are
|
|
2635
|
+
* not delivered. Erase a document's data on either deletion action.
|
|
2636
|
+
*/
|
|
2637
|
+
onOperations(operations: OperationWithContext[]): Promise<void>;
|
|
2638
|
+
/**
|
|
2639
|
+
* Called when the processor is disconnected.
|
|
2640
|
+
* Used to clean up any resources allocated during processor creation.
|
|
2641
|
+
* Also runs when the factory is unregistered, so it is not a deletion signal.
|
|
2642
|
+
*/
|
|
2643
|
+
onDisconnect(): Promise<void>;
|
|
2644
|
+
}
|
|
2645
|
+
/**
|
|
2646
|
+
* Relates a processor to its filter configuration.
|
|
2647
|
+
*/
|
|
2648
|
+
type ProcessorRecord = {
|
|
2649
|
+
processor: IProcessor;
|
|
2650
|
+
filter: ProcessorFilter;
|
|
2651
|
+
startFrom?: "beginning" | "current";
|
|
2652
|
+
id?: string;
|
|
2653
|
+
};
|
|
2654
|
+
/**
|
|
2655
|
+
* A factory function that creates processor records for a given drive.
|
|
2656
|
+
* Called once per drive when the drive is first detected or when the factory is registered.
|
|
2657
|
+
* The header is the drive's header at creation. For a purged drive it is
|
|
2658
|
+
* minimal: only `id` and `documentType` are set, and `slug` and `name` are
|
|
2659
|
+
* empty, so a factory that selects drives by slug or name makes no processor
|
|
2660
|
+
* for it and the deletion stays owed.
|
|
2661
|
+
*/
|
|
2662
|
+
type ProcessorFactory = (driveHeader: PHDocumentHeader, processorApp?: ProcessorApp) => Promise<ProcessorRecord[]> | ProcessorRecord[];
|
|
2663
|
+
/** Takes a processor host module and builds processor factories using its context. */
|
|
2664
|
+
type ProcessorFactoryBuilder<TModule extends IProcessorHostModuleBase = IProcessorHostModuleBase> = {
|
|
2665
|
+
bivarianceHack(module: TModule): Promise<ProcessorFactory> | ProcessorFactory;
|
|
2666
|
+
}["bivarianceHack"];
|
|
2667
|
+
type ProcessorStatus = "active" | "errored";
|
|
2668
|
+
type TrackedProcessor = {
|
|
2669
|
+
processorId: string;
|
|
2670
|
+
factoryId: string;
|
|
2671
|
+
driveId: string;
|
|
2672
|
+
processorIndex: number;
|
|
2673
|
+
record: ProcessorRecord;
|
|
2674
|
+
lastOrdinal: number;
|
|
2675
|
+
status: ProcessorStatus;
|
|
2676
|
+
lastError: string | undefined;
|
|
2677
|
+
lastErrorTimestamp: Date | undefined;
|
|
2678
|
+
/**
|
|
2679
|
+
* Clears the error and resolves once the replay from the cursor completes.
|
|
2680
|
+
* Safe from anywhere, but awaiting it from this processor's own
|
|
2681
|
+
* `onOperations` waits on itself: the replay runs after that call returns.
|
|
2682
|
+
* A no-op once the processor has been removed.
|
|
2683
|
+
*/
|
|
2684
|
+
retry: () => Promise<void>;
|
|
2685
|
+
};
|
|
2686
|
+
/**
|
|
2687
|
+
* Manages processor creation and destruction based on drive operations.
|
|
2688
|
+
*/
|
|
2689
|
+
interface IProcessorManager {
|
|
2690
|
+
/**
|
|
2691
|
+
* Registers a processor factory.
|
|
2692
|
+
* Immediately creates processors for all existing drives and resolves once
|
|
2693
|
+
* every factory run has completed and its processors are bound. Their
|
|
2694
|
+
* backfills run afterwards, on each processor's own queue. A deleted drive
|
|
2695
|
+
* whose deletion one of the factory's processors never received (it was not
|
|
2696
|
+
* running, or its delivery threw) gets a processor too: it receives only the
|
|
2697
|
+
* drive's `DELETE_DOCUMENT`, or its `PURGE_DOCUMENT` once purged, and is
|
|
2698
|
+
* disconnected. That delivery is not awaited: it runs after this resolves,
|
|
2699
|
+
* so a processor that hangs on it does not hold the registration, nor a
|
|
2700
|
+
* later one: a drive whose deletion is still being delivered gets it from
|
|
2701
|
+
* the new registration only if that delivery leaves it owed. If processors
|
|
2702
|
+
* from an earlier registration under the same identifier are still
|
|
2703
|
+
* draining, or a call of the previous factory is still in flight, the
|
|
2704
|
+
* factory runs after they have settled, so awaiting a re-registration of
|
|
2705
|
+
* a factory from inside that factory or one of its processors'
|
|
2706
|
+
* `onOperations` waits on itself.
|
|
2707
|
+
*/
|
|
2708
|
+
registerFactory(identifier: string, factory: ProcessorFactory): Promise<void>;
|
|
2709
|
+
/**
|
|
2710
|
+
* Unregisters a processor factory. Resolves once its processors receive no
|
|
2711
|
+
* new deliveries and their cursors are released; each one's in-flight
|
|
2712
|
+
* delivery finishes first, then `onDisconnect` runs. A released cursor no
|
|
2713
|
+
* longer positions a processor: a re-registration starts each one afresh,
|
|
2714
|
+
* per `startFrom`. It only records that the factory held a drive's data, so
|
|
2715
|
+
* that a drive deleted before the factory registers again still gets its
|
|
2716
|
+
* deletion delivered then. Safe to call from
|
|
2717
|
+
* inside a processor's own `onOperations`.
|
|
2718
|
+
*/
|
|
2719
|
+
unregisterFactory(identifier: string): Promise<void>;
|
|
2720
|
+
/**
|
|
2721
|
+
* Gets a tracked processor by its ID.
|
|
2722
|
+
*/
|
|
2723
|
+
get(processorId: string): TrackedProcessor | undefined;
|
|
2724
|
+
/**
|
|
2725
|
+
* Gets all tracked processors, including an errored entry for each
|
|
2726
|
+
* processor whose drive's deletion threw; its `retry()` delivers the
|
|
2727
|
+
* deletion again.
|
|
2728
|
+
*/
|
|
2729
|
+
getAll(): TrackedProcessor[];
|
|
2730
|
+
}
|
|
2731
|
+
type ProcessorApp = (typeof PROCESSOR_APPS)[number];
|
|
2732
|
+
type ProcessorApps = readonly ProcessorApp[];
|
|
2733
|
+
//#endregion
|
|
2734
|
+
//#region processors/relational/types.d.ts
|
|
2735
|
+
/** Columns {@link RelationalDbProcessor.deleteDocumentRows} matches. */
|
|
2736
|
+
declare const DOCUMENT_ID_COLUMNS: readonly ["document_id", "documentId"];
|
|
2737
|
+
type IRelationalQueryMethods = "selectFrom" | "selectNoFrom" | "with" | "withRecursive";
|
|
2738
|
+
type IRelationalQueryBuilder<Schema = unknown> = Pick<QueryCreator<Schema>, IRelationalQueryMethods> & {
|
|
2739
|
+
withSchema: (schema: string) => IRelationalQueryBuilder<Schema>;
|
|
1659
2740
|
};
|
|
1660
|
-
type
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
2741
|
+
type HashAlgorithms = "fnv1a";
|
|
2742
|
+
type IBaseRelationalDb<Schema = unknown> = Kysely<Schema>;
|
|
2743
|
+
/**
|
|
2744
|
+
* The standardized relational database interface for relational db processors.
|
|
2745
|
+
* This abstraction provides type-safe database operations while hiding the underlying
|
|
2746
|
+
* database framework implementation details.
|
|
2747
|
+
**/
|
|
2748
|
+
type IRelationalDb<Schema = unknown> = IBaseRelationalDb<Schema> & {
|
|
2749
|
+
createNamespace<NamespaceSchema>(namespace: string): Promise<IRelationalDb<ExtractProcessorSchemaOrSelf<NamespaceSchema>>>;
|
|
2750
|
+
queryNamespace<NamespaceSchema>(namespace: string): IRelationalQueryBuilder<NamespaceSchema>;
|
|
1667
2751
|
};
|
|
2752
|
+
type ExtractProcessorSchemaOrSelf<TProcessor> = TProcessor extends RelationalDbProcessor<infer TSchema> ? TSchema : TProcessor;
|
|
2753
|
+
type RelationalDbProcessorClass<TSchema> = typeof RelationalDbProcessor<TSchema>;
|
|
2754
|
+
interface IRelationalDbProcessor<TDatabaseSchema = unknown> extends IProcessor {
|
|
2755
|
+
namespace: string;
|
|
2756
|
+
query: IRelationalQueryBuilder<TDatabaseSchema>;
|
|
2757
|
+
filter: ProcessorFilter;
|
|
2758
|
+
initAndUpgrade(): Promise<void>;
|
|
2759
|
+
}
|
|
2760
|
+
declare const IS_RELATIONAL_DB_PROCESSOR: unique symbol;
|
|
1668
2761
|
/**
|
|
1669
|
-
*
|
|
1670
|
-
*
|
|
1671
|
-
*
|
|
1672
|
-
* that resolves a module or compares versions must use this rule; resolving
|
|
1673
|
-
* 0 to "latest" instead re-pins a legacy document's history to whichever
|
|
1674
|
-
* module happens to be newest.
|
|
2762
|
+
* Base class for relational db processors that require a relational database storage.
|
|
2763
|
+
* This class abstracts database initialization, migration management, and resource cleanup,
|
|
2764
|
+
* allowing derived classes to focus on business logic.
|
|
1675
2765
|
*/
|
|
1676
|
-
declare
|
|
2766
|
+
declare abstract class RelationalDbProcessor<TDatabaseSchema = unknown> implements IRelationalDbProcessor<TDatabaseSchema> {
|
|
2767
|
+
protected _namespace: string;
|
|
2768
|
+
protected _filter: ProcessorFilter;
|
|
2769
|
+
protected relationalDb: IRelationalDb<TDatabaseSchema>;
|
|
2770
|
+
/** The drive the factory created this processor for. */
|
|
2771
|
+
protected _driveId?: string | undefined;
|
|
2772
|
+
constructor(_namespace: string, _filter: ProcessorFilter, relationalDb: IRelationalDb<TDatabaseSchema>,
|
|
2773
|
+
/** The drive the factory created this processor for. */
|
|
2774
|
+
_driveId?: string | undefined);
|
|
2775
|
+
static [IS_RELATIONAL_DB_PROCESSOR]: boolean;
|
|
2776
|
+
/**
|
|
2777
|
+
* Returns the namespace for a given drive id.
|
|
2778
|
+
* This method can be overridden by derived classes to provide a custom namespace.
|
|
2779
|
+
*/
|
|
2780
|
+
static getNamespace(driveId: string): string;
|
|
2781
|
+
static query<Schema>(this: RelationalDbProcessorClass<Schema>, driveId: string, db: IRelationalDb<any>): IRelationalQueryBuilder<Schema>;
|
|
2782
|
+
/**
|
|
2783
|
+
* Processes a list of operations with context.
|
|
2784
|
+
* Called when operations match this processor's filter.
|
|
2785
|
+
*/
|
|
2786
|
+
abstract onOperations(operations: OperationWithContext[]): Promise<void>;
|
|
2787
|
+
/**
|
|
2788
|
+
* Returns the filter for the processor.
|
|
2789
|
+
* This method can be overridden by derived classes to provide a custom filter.
|
|
2790
|
+
*/
|
|
2791
|
+
get filter(): ProcessorFilter;
|
|
2792
|
+
/**
|
|
2793
|
+
* Returns the namespace used by the processor.
|
|
2794
|
+
*/
|
|
2795
|
+
get namespace(): string;
|
|
2796
|
+
get query(): IRelationalQueryBuilder<TDatabaseSchema>;
|
|
2797
|
+
/** True for this processor's drive when its namespace is that drive's alone. */
|
|
2798
|
+
protected isNamespaceDrive(documentId: string): boolean;
|
|
2799
|
+
/** Deletes a document's rows from every table with a document-id column. */
|
|
2800
|
+
protected deleteDocumentRows(documentId: string): Promise<void>;
|
|
2801
|
+
/** Drops this processor's namespace and every table in it. */
|
|
2802
|
+
protected dropNamespace(): Promise<void>;
|
|
2803
|
+
private namespaceSchema;
|
|
2804
|
+
/**
|
|
2805
|
+
* Abstract method that derived classes must implement.
|
|
2806
|
+
* This method is meant to be called on subclasses to initialize and upgrade the database.
|
|
2807
|
+
*/
|
|
2808
|
+
abstract initAndUpgrade(): Promise<void>;
|
|
2809
|
+
/**
|
|
2810
|
+
* Called when the processor is disconnected.
|
|
2811
|
+
* This method is meant to be overridden by subclasses to clean up resources.
|
|
2812
|
+
*/
|
|
2813
|
+
abstract onDisconnect(): Promise<void>;
|
|
2814
|
+
}
|
|
2815
|
+
//#endregion
|
|
2816
|
+
//#region processors/relational/utils.d.ts
|
|
1677
2817
|
/**
|
|
1678
|
-
*
|
|
1679
|
-
*
|
|
1680
|
-
*
|
|
1681
|
-
*
|
|
1682
|
-
*
|
|
1683
|
-
* - fromVersion > toVersion: Throw DowngradeNotSupportedError
|
|
1684
|
-
* - All other cases: Apply upgradePath transitions (if provided), then apply initialState, set version
|
|
2818
|
+
* Hashes a string to a lowercase base-26 string.
|
|
2819
|
+
* @param str The string to hash.
|
|
2820
|
+
* @param length The length of the hash. Defaults to 10.
|
|
2821
|
+
* @param algorithm The hashing algorithm to use. Defaults to "fnv1a".
|
|
2822
|
+
* @returns The hashed string.
|
|
1685
2823
|
*/
|
|
1686
|
-
declare function
|
|
2824
|
+
declare function hashNamespace(str: string, length?: number): string;
|
|
1687
2825
|
/**
|
|
1688
|
-
*
|
|
1689
|
-
*
|
|
2826
|
+
* Creates a RelationalDb instance with namespace support.
|
|
2827
|
+
* @param baseDb The base RelationalDb instance to enhance.
|
|
2828
|
+
* @param baseOptions The default options for namespace creation. Hashes namespace by default.
|
|
2829
|
+
* @returns The enhanced RelationalDb instance.
|
|
1690
2830
|
*/
|
|
1691
|
-
declare function
|
|
2831
|
+
declare function createRelationalDb<Schema>(baseDb: IBaseRelationalDb<Schema>, baseOptions?: NamespaceOptions): IRelationalDb<Schema>;
|
|
2832
|
+
type NamespaceOptions = {
|
|
2833
|
+
hashNamespace?: boolean;
|
|
2834
|
+
};
|
|
2835
|
+
declare function createNamespacedDb<Schema>(db: IBaseRelationalDb<any>, namespace: string, options?: NamespaceOptions): Promise<IRelationalDb<Schema>>;
|
|
2836
|
+
/** The schema behind a handle from `createNamespace`; undefined otherwise. */
|
|
2837
|
+
declare function namespaceSchemaOf(db: object): string | undefined;
|
|
2838
|
+
declare function createNamespacedQueryBuilder<Schema>(db: IBaseRelationalDb<any>, namespace: string, options?: NamespaceOptions): IRelationalQueryBuilder<Schema>;
|
|
1692
2839
|
/**
|
|
1693
|
-
*
|
|
1694
|
-
*
|
|
1695
|
-
*
|
|
1696
|
-
* if the manifest is absent or any step is missing.
|
|
2840
|
+
* Returns a query builder for a RelationalDb instance.
|
|
2841
|
+
* @param query The RelationalDb instance to convert.
|
|
2842
|
+
* @returns The IRelationalQueryBuilder instance.
|
|
1697
2843
|
*/
|
|
1698
|
-
declare function
|
|
2844
|
+
declare function relationalDbToQueryBuilder<TSchema>(query: IBaseRelationalDb<TSchema>): IRelationalQueryBuilder<TSchema>;
|
|
1699
2845
|
//#endregion
|
|
1700
2846
|
//#region document-model/types.d.ts
|
|
1701
2847
|
type State = {
|
|
@@ -2342,11 +3488,11 @@ interface DocumentModelVersioningOperations {
|
|
|
2342
3488
|
}
|
|
2343
3489
|
type Maybe<T> = T | null;
|
|
2344
3490
|
type InputMaybe<T> = T | null | undefined;
|
|
2345
|
-
type Exact<T extends Record<string, unknown>> = { [K in keyof T]: T[K] };
|
|
2346
|
-
type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]
|
|
2347
|
-
type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]
|
|
2348
|
-
type MakeEmpty<T extends Record<string, unknown>, K extends keyof T> = { [_ in K]?: never };
|
|
2349
|
-
type Incremental<T> = T | { [P in keyof T]?: P extends " $fragmentName" | "__typename" ? T[P] : never };
|
|
3491
|
+
type Exact<T extends Record<string, unknown>> = { [K in keyof T]: T[K]; };
|
|
3492
|
+
type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]>; };
|
|
3493
|
+
type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]>; };
|
|
3494
|
+
type MakeEmpty<T extends Record<string, unknown>, K extends keyof T> = { [_ in K]?: never; };
|
|
3495
|
+
type Incremental<T> = T | { [P in keyof T]?: P extends " $fragmentName" | "__typename" ? T[P] : never; };
|
|
2350
3496
|
/** All built-in and custom scalars, mapped to their actual values */
|
|
2351
3497
|
type Scalars = {
|
|
2352
3498
|
ID: {
|
|
@@ -2407,28 +3553,6 @@ type IOperation = {
|
|
|
2407
3553
|
timestampUtcMs: Scalars["DateTime"]["output"];
|
|
2408
3554
|
type: Scalars["String"]["output"];
|
|
2409
3555
|
};
|
|
2410
|
-
type Load_State = "LOAD_STATE";
|
|
2411
|
-
type SchemaLoadStateAction = {
|
|
2412
|
-
id: Scalars["String"]["output"];
|
|
2413
|
-
timestampUtcMs: Scalars["DateTime"]["output"];
|
|
2414
|
-
input: LoadStateActionInput;
|
|
2415
|
-
type: Load_State;
|
|
2416
|
-
scope: string;
|
|
2417
|
-
};
|
|
2418
|
-
type LoadStateActionInput = {
|
|
2419
|
-
operations: Scalars["Int"]["input"];
|
|
2420
|
-
state: LoadStateActionStateInput;
|
|
2421
|
-
};
|
|
2422
|
-
type LoadStateActionStateInput = {
|
|
2423
|
-
data?: InputMaybe<Scalars["Unknown"]["input"]>;
|
|
2424
|
-
name: Scalars["String"]["input"];
|
|
2425
|
-
};
|
|
2426
|
-
type MutationLoadStateArgs = {
|
|
2427
|
-
input: SchemaLoadStateAction;
|
|
2428
|
-
};
|
|
2429
|
-
type MutationPruneArgs = {
|
|
2430
|
-
input: SchemaPruneAction;
|
|
2431
|
-
};
|
|
2432
3556
|
type MutationRedoArgs = {
|
|
2433
3557
|
input: SchemaRedoAction;
|
|
2434
3558
|
};
|
|
@@ -2438,18 +3562,6 @@ type MutationSetNameArgs = {
|
|
|
2438
3562
|
type MutationUndoArgs = {
|
|
2439
3563
|
input: SchemaUndoAction;
|
|
2440
3564
|
};
|
|
2441
|
-
type Prune = "PRUNE";
|
|
2442
|
-
type SchemaPruneAction = {
|
|
2443
|
-
id: Scalars["String"]["output"];
|
|
2444
|
-
timestampUtcMs: Scalars["DateTime"]["output"];
|
|
2445
|
-
input: PruneActionInput;
|
|
2446
|
-
type: Prune;
|
|
2447
|
-
scope: string;
|
|
2448
|
-
};
|
|
2449
|
-
type PruneActionInput = {
|
|
2450
|
-
end?: InputMaybe<Scalars["Int"]["input"]>;
|
|
2451
|
-
start?: InputMaybe<Scalars["Int"]["input"]>;
|
|
2452
|
-
};
|
|
2453
3565
|
type Query = {
|
|
2454
3566
|
__typename?: "Query";
|
|
2455
3567
|
document: Maybe<IDocument>;
|
|
@@ -2521,14 +3633,6 @@ type SchemaNOOPAction = {
|
|
|
2521
3633
|
timestampUtcMs: Scalars["DateTime"]["output"];
|
|
2522
3634
|
type: "NOOP";
|
|
2523
3635
|
};
|
|
2524
|
-
type LoadStateAction = Action & {
|
|
2525
|
-
type: "LOAD_STATE";
|
|
2526
|
-
input: LoadStateActionInput;
|
|
2527
|
-
};
|
|
2528
|
-
type PruneAction = Action & {
|
|
2529
|
-
type: "PRUNE";
|
|
2530
|
-
input: PruneActionInput;
|
|
2531
|
-
};
|
|
2532
3636
|
type RedoAction = Action & {
|
|
2533
3637
|
type: "REDO";
|
|
2534
3638
|
input: SchemaRedoAction["input"];
|
|
@@ -2585,6 +3689,13 @@ type DeleteDocumentActionInput = {
|
|
|
2585
3689
|
documentId: string;
|
|
2586
3690
|
propagate?: "none" | "cascade";
|
|
2587
3691
|
};
|
|
3692
|
+
type PurgeDocumentActionInput = {
|
|
3693
|
+
documentId: string;
|
|
3694
|
+
documentType: string;
|
|
3695
|
+
/** The same instant as the action's timestampUtcMs. */
|
|
3696
|
+
purgedAtUtcIso: string;
|
|
3697
|
+
requestId: string;
|
|
3698
|
+
};
|
|
2588
3699
|
type AddRelationshipActionInput = {
|
|
2589
3700
|
sourceId: string;
|
|
2590
3701
|
targetId: string;
|
|
@@ -2614,6 +3725,12 @@ type DeleteDocumentAction = Action & {
|
|
|
2614
3725
|
type: "DELETE_DOCUMENT";
|
|
2615
3726
|
input: DeleteDocumentActionInput;
|
|
2616
3727
|
};
|
|
3728
|
+
/** Reserved document-scope marker; a purged document's only operation. */
|
|
3729
|
+
type PurgeDocumentAction = Action & {
|
|
3730
|
+
type: "PURGE_DOCUMENT";
|
|
3731
|
+
scope: "document";
|
|
3732
|
+
input: PurgeDocumentActionInput;
|
|
3733
|
+
};
|
|
2617
3734
|
type AddRelationshipAction = Action & {
|
|
2618
3735
|
type: "ADD_RELATIONSHIP";
|
|
2619
3736
|
input: AddRelationshipActionInput;
|
|
@@ -2626,7 +3743,7 @@ type UpdateRelationshipAction = Action & {
|
|
|
2626
3743
|
type: "UPDATE_RELATIONSHIP";
|
|
2627
3744
|
input: UpdateRelationshipActionInput;
|
|
2628
3745
|
};
|
|
2629
|
-
type DocumentAction =
|
|
3746
|
+
type DocumentAction = RedoAction | SetNameAction | SetPreferredEditorAction | UndoAction | NOOPAction;
|
|
2630
3747
|
interface ISignal<TType extends string, TInput> {
|
|
2631
3748
|
type: TType;
|
|
2632
3749
|
input: TInput;
|
|
@@ -2663,19 +3780,27 @@ type SignalResults = {
|
|
|
2663
3780
|
type SignalType<T extends Signal> = T["type"];
|
|
2664
3781
|
type FileInput = string | number[] | Uint8Array | ArrayBuffer | Blob;
|
|
2665
3782
|
type ReducerOptions = {
|
|
2666
|
-
/** The number of operations to skip before this new action is applied. This overrides the skip count in the operation. */
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
3783
|
+
/** The number of operations to skip before this new action is applied. This overrides the skip count in the operation. */
|
|
3784
|
+
skip?: number;
|
|
3785
|
+
/** When true the skip count is ignored and the action is applied regardless of the skip count */
|
|
3786
|
+
ignoreSkipOperations?: boolean;
|
|
3787
|
+
/** if true reuses the provided action resulting state instead of replaying it */
|
|
3788
|
+
reuseOperationResultingState?: boolean;
|
|
3789
|
+
/** if true checks the hashes of the operations */
|
|
3790
|
+
checkHashes?: boolean;
|
|
3791
|
+
/** Options for performing a replay. */
|
|
2670
3792
|
replayOptions?: {
|
|
2671
|
-
/** The previously created operation to verify against. */
|
|
2672
|
-
|
|
3793
|
+
/** The previously created operation to verify against. */
|
|
3794
|
+
operation: Operation;
|
|
3795
|
+
};
|
|
3796
|
+
/** Optional parser for the operation resulting state, uses JSON.parse by default */
|
|
2673
3797
|
operationResultingStateParser?: <TState>(state: string | null | undefined) => TState;
|
|
2674
3798
|
/**
|
|
2675
3799
|
* When true (default), the reducer will prune operations (garbage collect) when processing a skip.
|
|
2676
3800
|
* When false, it will recompute state for the skip but preserve the existing operations history.
|
|
2677
3801
|
*/
|
|
2678
|
-
pruneOnSkip?: boolean;
|
|
3802
|
+
pruneOnSkip?: boolean;
|
|
3803
|
+
/** The branch being operated on. Defaults to "main". */
|
|
2679
3804
|
branch?: string;
|
|
2680
3805
|
/**
|
|
2681
3806
|
* Protocol version controlling undo/redo behavior.
|
|
@@ -2726,7 +3851,7 @@ type User = {
|
|
|
2726
3851
|
chainId: number;
|
|
2727
3852
|
ens?: ENSInfo;
|
|
2728
3853
|
};
|
|
2729
|
-
type PartialRecord<K extends keyof any, T> = { [P in K]?: T };
|
|
3854
|
+
type PartialRecord<K extends keyof any, T> = { [P in K]?: T; };
|
|
2730
3855
|
type RevisionsFilter = PartialRecord<string, number>;
|
|
2731
3856
|
type GetDocumentOptions = ReducerOptions & {
|
|
2732
3857
|
revisions?: RevisionsFilter;
|
|
@@ -2806,13 +3931,14 @@ interface ISigner {
|
|
|
2806
3931
|
*/
|
|
2807
3932
|
verify: (data: Uint8Array, signature: Uint8Array) => Promise<void>;
|
|
2808
3933
|
/**
|
|
2809
|
-
* Signs an action
|
|
3934
|
+
* Signs an action for the log it is written to.
|
|
2810
3935
|
*
|
|
2811
3936
|
* @param action - The action to sign.
|
|
3937
|
+
* @param target - The document and branch whose log stores the action.
|
|
2812
3938
|
* @param abortSignal - Optional abort signal to cancel the signing.
|
|
2813
3939
|
* @returns The signature tuple.
|
|
2814
3940
|
*/
|
|
2815
|
-
signAction: (action: Action, abortSignal?: AbortSignal) => Promise<Signature>;
|
|
3941
|
+
signAction: (action: Action, target: ActionSigningTarget, abortSignal?: AbortSignal) => Promise<Signature>;
|
|
2816
3942
|
}
|
|
2817
3943
|
type IsStateOfType<TState> = (state: unknown) => state is TState;
|
|
2818
3944
|
type AssertIsStateOfType<TState> = (state: unknown) => asserts state is TState;
|
|
@@ -2831,6 +3957,9 @@ type MinimalBackupData = {
|
|
|
2831
3957
|
branch: string;
|
|
2832
3958
|
state: PHBaseState;
|
|
2833
3959
|
name: string;
|
|
3960
|
+
protocolVersions?: {
|
|
3961
|
+
[key: string]: number;
|
|
3962
|
+
};
|
|
2834
3963
|
};
|
|
2835
3964
|
type DocumentModelUtils<TState extends PHBaseState = PHBaseState> = {
|
|
2836
3965
|
fileExtension: string;
|
|
@@ -2870,7 +3999,8 @@ type PhAiToolDescriptor = {
|
|
|
2870
3999
|
callback: (args: never) => Promise<unknown>;
|
|
2871
4000
|
};
|
|
2872
4001
|
type DocumentModelModule<TState extends PHBaseState = PHBaseState> = {
|
|
2873
|
-
/** optional version field, should be made required */
|
|
4002
|
+
/** optional version field, should be made required */
|
|
4003
|
+
version?: number;
|
|
2874
4004
|
reducer: Reducer<TState>;
|
|
2875
4005
|
actions: Actions;
|
|
2876
4006
|
utils: DocumentModelUtils<TState>;
|
|
@@ -2893,6 +4023,7 @@ type DocumentModelDocumentModelModule = DocumentModelModule<DocumentModelPHState
|
|
|
2893
4023
|
type ConfigEntryType = z.infer<typeof ConfigEntryTypeSchema>;
|
|
2894
4024
|
type ConfigEntry = z.infer<typeof ConfigEntrySchema>;
|
|
2895
4025
|
type PowerhouseModule = z.infer<typeof PowerhouseModuleSchema>;
|
|
4026
|
+
type PieceModule = z.infer<typeof PieceModuleSchema>;
|
|
2896
4027
|
type Publisher = z.infer<typeof PublisherSchema>;
|
|
2897
4028
|
type Manifest = z.infer<typeof ManifestSchema>;
|
|
2898
4029
|
//#endregion
|
|
@@ -2929,10 +4060,13 @@ type PHConnectDefaultDriveRemote = {
|
|
|
2929
4060
|
icon?: string | null;
|
|
2930
4061
|
};
|
|
2931
4062
|
type PHConnectDefaultDriveLocal = {
|
|
2932
|
-
/** Discriminator: this entry is a local drive created on first boot. */
|
|
4063
|
+
/** Discriminator: this entry is a local drive created on first boot. */
|
|
4064
|
+
local: true;
|
|
4065
|
+
/** Stable drive id; the drive is not re-created on later boots. */
|
|
2933
4066
|
id: string;
|
|
2934
4067
|
name?: string | null;
|
|
2935
|
-
icon?: string | null;
|
|
4068
|
+
icon?: string | null;
|
|
4069
|
+
/** Drive app (preferred editor) to open on the drive. */
|
|
2936
4070
|
app?: string;
|
|
2937
4071
|
};
|
|
2938
4072
|
type PHConnectDefaultDrive = PHConnectDefaultDriveRemote | PHConnectDefaultDriveLocal;
|
|
@@ -2956,21 +4090,29 @@ type PHConnectApp = {
|
|
|
2956
4090
|
basePath?: string;
|
|
2957
4091
|
offline?: boolean;
|
|
2958
4092
|
studioMode?: boolean;
|
|
4093
|
+
workflowsEnabled?: boolean;
|
|
2959
4094
|
};
|
|
2960
4095
|
type PHConnectAi = {
|
|
2961
|
-
/** Enables the in-browser AI assistant (chat FAB + window). Off by default. */
|
|
4096
|
+
/** Enables the in-browser AI assistant (chat FAB + window). Off by default. */
|
|
4097
|
+
assistantEnabled?: boolean;
|
|
2962
4098
|
};
|
|
2963
4099
|
type PHConnectPackages = {
|
|
2964
|
-
externalEnabled?: boolean;
|
|
4100
|
+
externalEnabled?: boolean;
|
|
4101
|
+
/** Subscribe to the static-mode `/__packages` SSE channel for live reload. */
|
|
2965
4102
|
liveReload?: boolean;
|
|
2966
4103
|
};
|
|
2967
4104
|
type PHRenownRainbowAdapterConfig = {
|
|
2968
|
-
/** WalletConnect project id; required for the rainbow adapter to function. */
|
|
4105
|
+
/** WalletConnect project id; required for the rainbow adapter to function. */
|
|
4106
|
+
walletConnectProjectId?: string;
|
|
4107
|
+
/** Optional Infura project id used to build RPC transports. */
|
|
2969
4108
|
infuraProjectId?: string;
|
|
2970
4109
|
};
|
|
2971
4110
|
type PHRenownPrivyAdapterConfig = {
|
|
2972
|
-
/** Privy application id; required for the privy adapter to function. */
|
|
2973
|
-
|
|
4111
|
+
/** Privy application id; required for the privy adapter to function. */
|
|
4112
|
+
appId?: string;
|
|
4113
|
+
/** Optional Privy client id. */
|
|
4114
|
+
clientId?: string;
|
|
4115
|
+
/** Login methods this adapter offers; defaults per adapter when omitted. */
|
|
2974
4116
|
methods?: string[];
|
|
2975
4117
|
};
|
|
2976
4118
|
type PHConnectRenownAdapters = {
|
|
@@ -2980,16 +4122,32 @@ type PHConnectRenownAdapters = {
|
|
|
2980
4122
|
type PHConnectRenown = {
|
|
2981
4123
|
url?: string;
|
|
2982
4124
|
networkId?: string;
|
|
2983
|
-
chainId?: number;
|
|
2984
|
-
|
|
2985
|
-
|
|
4125
|
+
chainId?: number;
|
|
4126
|
+
/** Renown localStorage namespace; share it across Connects to share login. */
|
|
4127
|
+
namespace?: string;
|
|
4128
|
+
/** Switchboard GraphQL URL; when set, enables in-page (no-redirect) auth. */
|
|
4129
|
+
switchboardUrl?: string;
|
|
4130
|
+
/** Per-adapter wallet config; presence of a key enables that adapter. */
|
|
2986
4131
|
adapters?: PHConnectRenownAdapters;
|
|
2987
4132
|
};
|
|
2988
4133
|
type PHConnectSentry = {
|
|
2989
|
-
/** Sentry DSN URL. `null` disables Sentry entirely. */
|
|
2990
|
-
|
|
4134
|
+
/** Sentry DSN URL. `null` disables Sentry entirely. */
|
|
4135
|
+
dsn?: string | null;
|
|
4136
|
+
/** Sentry environment label. */
|
|
4137
|
+
env?: string;
|
|
4138
|
+
/** Enable Sentry performance tracing. */
|
|
2991
4139
|
tracing?: boolean;
|
|
2992
4140
|
};
|
|
4141
|
+
type PHConnectOpenPanel = {
|
|
4142
|
+
/** OpenPanel client id. Empty string (the default) disables OpenPanel. */
|
|
4143
|
+
clientId?: string;
|
|
4144
|
+
/** OpenPanel API URL, for self-hosted instances. */
|
|
4145
|
+
apiUrl?: string;
|
|
4146
|
+
/** Track UI events. */
|
|
4147
|
+
trackUiEvents?: boolean;
|
|
4148
|
+
/** Track document operations. */
|
|
4149
|
+
trackOperations?: boolean;
|
|
4150
|
+
};
|
|
2993
4151
|
type PHConnectInstance = {
|
|
2994
4152
|
namespace: string | null;
|
|
2995
4153
|
reactorWorker: boolean;
|
|
@@ -2997,13 +4155,21 @@ type PHConnectInstance = {
|
|
|
2997
4155
|
/** Each flag implies its predecessors, and must match the fleet Connect syncs
|
|
2998
4156
|
* with or the two compute different replay outcomes. */
|
|
2999
4157
|
type PHConnectReactorFeatureFlags = {
|
|
3000
|
-
/** Decide writes from the document stream instead of the meta cache. */
|
|
3001
|
-
|
|
3002
|
-
|
|
4158
|
+
/** Decide writes from the document stream instead of the meta cache. */
|
|
4159
|
+
documentDecisions?: boolean;
|
|
4160
|
+
/** Enforce the auth scope's policy at admission, replay, and read. */
|
|
4161
|
+
authEnforcement?: boolean;
|
|
4162
|
+
/** Let `{ group }` principals match, via the group documents' rosters. */
|
|
4163
|
+
authGroups?: boolean;
|
|
4164
|
+
/** Evaluate `where` / `match` conditions on grants. */
|
|
3003
4165
|
authConditions?: boolean;
|
|
3004
4166
|
};
|
|
3005
4167
|
type PHConnectReactor = {
|
|
3006
4168
|
featureFlags?: PHConnectReactorFeatureFlags;
|
|
4169
|
+
/** What new documents are created as; `legacy` while peers predate v2-required documents. */
|
|
4170
|
+
createSignaturePolicy?: "legacy" | "v2-required";
|
|
4171
|
+
/** Stored documents at protocol versions this build does not run: refuse to boot, or keep them read-only. */
|
|
4172
|
+
unsupportedStoredDocuments?: "refuse" | "read-only";
|
|
3007
4173
|
};
|
|
3008
4174
|
/**
|
|
3009
4175
|
* A URL-matching pattern for a service-worker runtime-caching rule, in
|
|
@@ -3052,7 +4218,9 @@ type PHConnectPwaIcon = {
|
|
|
3052
4218
|
* at Connect's app root, injected at build time.
|
|
3053
4219
|
*/
|
|
3054
4220
|
type PHConnectPwaFileHandler = {
|
|
3055
|
-
/** MIME type → file extensions (each must start with "."). */
|
|
4221
|
+
/** MIME type → file extensions (each must start with "."). */
|
|
4222
|
+
accept: Record<string, string[]>;
|
|
4223
|
+
/** OS-level file-type icons. */
|
|
3056
4224
|
icons?: PHConnectPwaIcon[];
|
|
3057
4225
|
launch_type?: "single-client" | "multiple-clients";
|
|
3058
4226
|
};
|
|
@@ -3066,8 +4234,10 @@ type PHConnectPwaManifest = {
|
|
|
3066
4234
|
display?: "fullscreen" | "standalone" | "minimal-ui" | "browser";
|
|
3067
4235
|
start_url?: string;
|
|
3068
4236
|
scope?: string;
|
|
3069
|
-
icons?: PHConnectPwaIcon[];
|
|
3070
|
-
|
|
4237
|
+
icons?: PHConnectPwaIcon[];
|
|
4238
|
+
/** Extra file associations, appended after Connect's built-in `.phd`/`.phdm` handler. */
|
|
4239
|
+
file_handlers?: PHConnectPwaFileHandler[];
|
|
4240
|
+
/** How the OS launches the app for handled files/links. */
|
|
3071
4241
|
launch_handler?: {
|
|
3072
4242
|
client_mode: "auto" | "focus-existing" | "navigate-existing" | "navigate-new";
|
|
3073
4243
|
};
|
|
@@ -3087,11 +4257,16 @@ type PHConnectPwaManifest = {
|
|
|
3087
4257
|
* Precedence: defaults < package fragments < project config.
|
|
3088
4258
|
*/
|
|
3089
4259
|
type PHConnectPwa = {
|
|
3090
|
-
manifest?: PHConnectPwaManifest;
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
4260
|
+
manifest?: PHConnectPwaManifest;
|
|
4261
|
+
/** Extra Workbox precache globs, unioned with the built-in patterns. */
|
|
4262
|
+
globPatterns?: string[];
|
|
4263
|
+
/** Extra Workbox precache ignore globs, unioned with the built-in list. */
|
|
4264
|
+
globIgnores?: string[];
|
|
4265
|
+
/** Raise the precache file-size ceiling; the max across contributors wins. */
|
|
4266
|
+
maximumFileSizeToCacheInBytes?: number;
|
|
4267
|
+
/** Additional runtime-caching rules, appended after the built-in rules. */
|
|
4268
|
+
runtimeCaching?: PHConnectPwaRuntimeCaching[];
|
|
4269
|
+
/** Extra SPA-fallback denylist patterns, unioned with the built-in list. */
|
|
3095
4270
|
navigateFallbackDenylist?: PHConnectPwaUrlPattern[];
|
|
3096
4271
|
};
|
|
3097
4272
|
type PHConnectRuntimeConfig = {
|
|
@@ -3102,6 +4277,7 @@ type PHConnectRuntimeConfig = {
|
|
|
3102
4277
|
drives?: PHConnectDrives;
|
|
3103
4278
|
renown?: PHConnectRenown;
|
|
3104
4279
|
sentry?: PHConnectSentry;
|
|
4280
|
+
openPanel?: PHConnectOpenPanel;
|
|
3105
4281
|
instance?: PHConnectInstance;
|
|
3106
4282
|
reactor?: PHConnectReactor;
|
|
3107
4283
|
pwa?: PHConnectPwa;
|
|
@@ -3110,8 +4286,10 @@ type PHConnectRuntimeConfig = {
|
|
|
3110
4286
|
type PHReactorRenown = {
|
|
3111
4287
|
/** "self" reads this reactor's own renown read model; "remote" (default)
|
|
3112
4288
|
* queries a Renown or Switchboard instance. */
|
|
3113
|
-
source?: "remote" | "self";
|
|
3114
|
-
|
|
4289
|
+
source?: "remote" | "self";
|
|
4290
|
+
/** Renown base URL; also the instance this reactor's own identity uses. */
|
|
4291
|
+
url?: string;
|
|
4292
|
+
/** Switchboard GraphQL endpoint to read credentials from directly. */
|
|
3115
4293
|
switchboardUrl?: string;
|
|
3116
4294
|
};
|
|
3117
4295
|
type PowerhouseConfig = {
|
|
@@ -3159,9 +4337,13 @@ type PowerhouseConfig = {
|
|
|
3159
4337
|
driveUrl?: string;
|
|
3160
4338
|
connectPort?: number;
|
|
3161
4339
|
};
|
|
4340
|
+
workflows?: {
|
|
4341
|
+
enabled?: boolean;
|
|
4342
|
+
};
|
|
3162
4343
|
packageRegistryUrl?: string;
|
|
3163
4344
|
connect?: PHConnectRuntimeConfig;
|
|
3164
4345
|
};
|
|
3165
4346
|
//#endregion
|
|
3166
|
-
export { AddOperationExampleAction as $, UpgradeReducer as $a, deleteOperationExample as $c, SetOperationErrorCodeAction as $i, baseCreateDocument as $l, MutationDeleteOperationErrorArgs as $n, SetAuthorWebsiteInputSchema as $o, RedoActionInput as $r, ProcessorDispatchResult as $s, DocumentModelOperationExampleOperations as $t, PHDocumentState as $u, PHReactorRenown as A, SigningParameters as Aa, WebhookSignatureEncoding as Ac, SetAuthorNameAction as Ai, setOperationErrorDescription as Al, LoadStateActionInput as An, ModuleSchema as Ao, MutationSetOperationTemplateArgs as Ar, UpdateStateExampleInputSchema as As, DeleteOperationErrorInput as At, sortMappedOperations as Au, DEFAULT_REGISTRY_URL as B, UpdateChangeLogItemAction as Ba, addModule as Bc, SetModelIdAction as Bi, undo as Bl, ModuleSpecification as Bn, PublisherSchema as Bo, OperationsByScope as Br, IBaseRelationalDb as Bs, DocumentModelGlobalState as Bt, operationOutcome as Bu, PHConnectReactor as C, Set_PreferredEditor as Ca, WebhookEndpointInfo as Cc, DEFAULT_ANALYTICS_PROCESSOR_DB_NAME as Cd, SchemaNOOPAction as Ci, setModelId as Cl, Incremental as Cn, DocumentModelInputSchema as Co, MutationSetOperationErrorCodeArgs as Cr, Set_PreferredEditorSchema as Cs, DeleteChildDocumentSignal as Ct, prepareOperations as Cu, PHConnectRuntimeConfig as D, SignalResults as Da, WebhookReply as Dc, SchemaSetPreferredEditorAction as Di, setName as Dl, LoadFromFile as Dn, LoadStateActionStateInputSchema as Do, MutationSetOperationNameArgs as Dr, UndoSchema as Ds, DeleteModuleInput as Dt, reshuffleByTimestamp as Du, PHConnectRenownAdapters as E, SignalResult as Ea, WebhookPolicy as Ec, SchemaSetNameAction as Ei, setModuleName as El, IsStateOfType as En, LoadStateActionSchema as Eo, MutationSetOperationErrorTemplateArgs as Er, UndoActionSchema as Es, DeleteModuleAction as Et, replayDocument as Eu, PathValidation as F, SubgraphModule as Fa, actionContext as Fc, SetInitialStateInput as Fi, setOperationSchema as Fl, MakeOptional as Fn, PowerhouseModuleSchema as Fo, MutationUpdateStateExampleArgs as Fr, createRelationalDb as Fs, DeleteStateExampleInput as Ft, Operation as Fu, Actions as G, UpdateRelationshipActionInput as Ga, baseActions as Gc, SetModuleDescriptionInput as Gi, IntegrityIssueSubType as Gl, MutationAddModuleArgs as Gn, ReorderChangeLogItemsInputSchema as Go, PowerhouseModule as Gr, RelationalDbProcessor as Gs, DocumentModelLocalState as Gt, undoOperationV2 as Gu, ActionSignatureContext as H, UpdateOperationExampleAction as Ha, addOperationError as Hc, SetModelNameAction as Hi, updateOperationExample as Hl, MoveOperationInput as Hn, RedoActionInputSchema as Ho, PartialState as Hr, IRelationalDbProcessor as Hs, DocumentModelHeaderOperations as Ht, setNameOperation as Hu, PowerhouseConfig as I, Undo as Ia, actionFromAction as Ic, SetModelDescriptionAction as Ii, setOperationScope as Il, Manifest as In, PowerhouseModulesSchema as Io, NOOPAction as Ir, hashNamespace as Is, DocumentAction as It, OperationContext as Iu, AddModuleAction as J, UpgradeDocumentAction as Ja, createAction as Jc, SetNameAction as Ji, PHDocumentHeader as Jl, MutationAddOperationExampleArgs as Jn, ReorderOperationErrorsInputSchema as Jo, PruneActionInput as Jr, IProcessorDispatch as Js, DocumentModelModuleOperations as Jt, Condition as Ju, AddChangeLogItemAction as K, UpdateStateExampleAction as Ka, buildOperationSignature as Kc, SetModuleNameAction as Ki, IntegrityIssueType as Kl, MutationAddOperationArgs as Kn, ReorderModuleOperationsInputSchema as Ko, Prune as Kr, RelationalDbProcessorClass as Ks, DocumentModelModule as Kt, AuthGroups as Ku, PowerhousePackage as L, UndoAction as La, actionSigner as Lc, SetModelDescriptionInput as Li, setOperationTemplate as Ll, MappedOperation as Ln, PruneActionInputSchema as Lo, OperationErrorSpecification as Lr, relationalDbToQueryBuilder as Ls, DocumentModelAction as Lt, OperationOutcome as Lu, PHRenownRainbowAdapterConfig as M, SkipHeaderOperations as Ma, WebhookVerification as Mc, SetAuthorWebsiteAction as Mi, setOperationErrorTemplate as Ml, Load_State as Mn, OperationErrorSchema as Mo, MutationUndoArgs as Mr, isDefinedNonNullAny as Ms, DeleteOperationExampleInput as Mt, split as Mu, PackageManagerArgs as N, State as Na, Action as Nc, SetAuthorWebsiteInput as Ni, setOperationName as Nl, MakeEmpty as Nn, OperationScopeSchema as No, MutationUpdateChangeLogItemInputArgs as Nr, createNamespacedDb as Ns, DeleteOperationInput as Nt, updateHeaderRevision as Nu, PHConnectSentry as O, SignalType as Oa, WebhookRequest as Oc, SchemaUndoAction as Oi, setOperationDescription as Ol, LoadFromInput as On, Load_StateSchema as Oo, MutationSetOperationReducerArgs as Or, UpdateChangeLogItemInputSchema as Os, DeleteOperationAction as Ot, reshuffleByTimestampAndIndex as Ou, ParsedCmdResult as P, StateReducer as Pa, ActionContext as Pc, SetInitialStateAction as Pi, setOperationReducer as Pl, MakeMaybe as Pn, OperationSpecificationSchema as Po, MutationUpdateOperationExampleArgs as Pr, createNamespacedQueryBuilder as Ps, DeleteStateExampleAction as Pt, DocumentOperations as Pu, AddOperationErrorInput as Q, UpgradeManifest as Qa, deleteOperationError as Qc, SetOperationDescriptionInput as Qi, attachBranch as Ql, MutationDeleteOperationArgs as Qn, SetAuthorNameInputSchema as Qo, RedoAction as Qr, ProcessorApps as Qs, DocumentModelOperationExampleAction as Qt, PHBaseState as Qu, ServiceAction as R, UndoActionInput as Ra, actions as Rc, SetModelExtensionAction as Ri, setPreferredEditor as Rl, Maybe as Rn, PruneActionSchema as Ro, OperationIndex as Rr, ExtractProcessorSchemaOrSelf as Rs, DocumentModelDocument as Rt, OperationWithContext$1 as Ru, PHConnectPwaUrlPattern as S, Set_Name as Sa, ScopedRouteHandle as Sc, serializeSignature as Sd, SchemaLoadStateAction as Si, setModelExtension as Sl, ISigner as Sn, DocumentModelGlobalStateSchema as So, MutationSetOperationDescriptionArgs as Sr, Set_NameSchema as Ss, DeleteChildDocumentInput as St, precedes as Su, PHConnectRenown as T, SignalDispatch as Ta, WebhookHashAlgorithm as Tc, PROCESSOR_APPS as Td, SchemaRedoAction as Ti, setModuleDescription as Tl, IsDocumentOfType as Tn, LoadStateActionInputSchema as To, MutationSetOperationErrorNameArgs as Tr, UndoActionInputSchema as Ts, DeleteDocumentActionInput as Tt, removeExistingOperations as Tu, ActionSigningHandler as U, UpdateOperationExampleInput as Ua, addOperationExample as Uc, SetModelNameInput as Ui, updateStateExample as Ul, Mutation as Un, RedoActionSchema as Uo, PhAiToolAnnotations as Ur, IRelationalQueryBuilder as Us, DocumentModelInput as Ut, setPreferredEditorOperation as Uu, ActionErrorCallback as V, UpdateChangeLogItemInput as Va, addOperation as Vc, SetModelIdInput as Vi, updateChangeLogItem as Vl, MoveOperationAction as Vn, PwaConfigSchema as Vo, PartialRecord as Vr, IRelationalDb as Vs, DocumentModelHeaderAction as Vt, redoOperation as Vu, ActionVerificationHandler as W, UpdateRelationshipAction as Wa, addStateExample as Wc, SetModuleDescriptionAction as Wi, verifyOperationSignature as Wl, MutationAddChangeLogItemInputArgs as Wn, RedoSchema as Wo, PhAiToolDescriptor as Wr, IRelationalQueryMethods as Ws, DocumentModelLib as Wt, undoOperation as Wu, AddOperationAction as X, User as Xa, deleteModule as Xc, SetNameOperation as Xi, addUndo as Xl, MutationDeleteChangeLogItemInputArgs as Xn, ReorderStateExamplesInputSchema as Xo, Query as Xr, IProcessorManager as Xs, DocumentModelOperationErrorAction as Xt, Operand as Xu, AddModuleInput as Y, UpgradeDocumentActionInput as Ya, deleteChangeLogItem as Yc, SetNameActionInput as Yi, PHDocumentMeta as Yl, MutationAddStateExampleArgs as Yn, ReorderOperationExamplesInputSchema as Yo, Publisher as Yr, IProcessorHostModuleBase as Ys, DocumentModelOperationAction as Yt, Grant as Yu, AddOperationErrorAction as Z, ValidationError as Za, deleteOperation as Zc, SetOperationDescriptionAction as Zi, appendWithoutApplying as Zl, MutationDeleteModuleArgs as Zn, ScopeStateSchema as Zo, Redo as Zr, ProcessorApp as Zs, DocumentModelOperationErrorOperations as Zt, PHAuthState as Zu, PHConnectPwaCacheStrategy as _, SetPreferredEditorAction as _a, RouteMethod as _c, HashConfig as _d, ReplayDocumentOptions as _i, reorderStateExamples as _l, ID as _n, DeleteOperationErrorInputSchema as _o, MutationSetModelIdArgs as _r, SetOperationScopeInputSchema as _s, CreateDocumentAction as _t, mapSkippedOperationsV2 as _u, PHConnectAi as a, SetOperationErrorTemplateAction as aa, TrackedProcessor as ac, createDocumentState as ad, ReorderChangeLogItemsAction as ai, operationExampleCreators as al, DocumentModelVersioningAction as an, AddChangeLogItemInputSchema as ao, MutationRedoArgs as ar, SetModuleDescriptionInputSchema as as, AddStateExampleInput as at, filterDuplicatedOperations as au, PHConnectPwaManifest as b, SetStateSchemaAction as ba, RouteTransport as bc, UserActionSigner as bd, SaveToFileHandle as bi, setInitialState as bl, ISignal as bn, DeleteStateExampleInputSchema as bo, MutationSetModuleNameArgs as br, SetPreferredEditorActionSchema as bs, DeleteChangeLogItemAction as bt, operationsAreEqual as bu, PHConnectDefaultDrive as c, SetOperationNameInput as ca, IWebhookEndpoints as cc, createState as cd, ReorderModuleOperationsInput as ci, operationWithContext as cl, DocumentSpecification as cn, AddOperationExampleInputSchema as co, MutationReorderModulesArgs as cr, SetNameActionSchema as cs, Author as ct, garbageCollectV2 as cu, PHConnectDriveSection as d, SetOperationSchemaAction as da, RouteActor as dc, defaultDocumentState as dd, ReorderOperationErrorsAction as di, releaseNewVersion as dl, EditorModule as dn, AuthorSchema as do, MutationReorderStateExamplesArgs as dr, SetOperationErrorDescriptionInputSchema as ds, ConfigEntryType as dt, hashDocumentStateForScope as du, SetOperationErrorCodeInput as ea, ProcessorFactory as ec, PHGroupState as ed, Reducer as ei, deleteStateExample as el, DocumentModelOperationOperations as en, UpgradeTransition as eo, MutationDeleteOperationExampleArgs as er, SetInitialStateInputSchema as es, AddOperationExampleInput as et, baseReducerVersion as eu, PHConnectDriveSections as f, SetOperationSchemaInput as fa, RouteAuth as fc, defaultGlobalState as fd, ReorderOperationErrorsInput as fi, reorderChangeLogItems as fl, EditorProps as fn, CodeExampleSchema as fo, MutationSetAuthorNameArgs as fr, SetOperationErrorNameInputSchema as fs, CopyChildDocumentInput as ft, isDocumentAction as fu, PHConnectPwa as g, SetOperationTemplateInput as ga, RouteHandler as gc, AppActionSigner as gd, ReorderStateExamplesInput as gi, reorderOperationExamples as gl, IAction as gn, DeleteModuleInputSchema as go, MutationSetModelExtensionArgs as gr, SetOperationSchemaInputSchema as gs, CreateDocument as gt, mapSkippedOperations as gu, PHConnectPackages as h, SetOperationTemplateAction as ha, RouteContext as hc, ActionSigner as hd, ReorderStateExamplesAction as hi, reorderOperationErrors as hl, GetDocumentOptions as hn, DeleteChangeLogItemInputSchema as ho, MutationSetModelDescriptionArgs as hr, SetOperationReducerInputSchema as hs, CreateChildDocumentSignal as ht, isUndoRedo as hu, LogLevels as i, SetOperationErrorNameInput as ia, ProcessorStatus as ic, createBaseState as id, RemoveRelationshipActionInput as ii, noop as il, DocumentModelUtils as in, normalizeDocumentModelVersion as io, MutationPruneArgs as ir, SetModelNameInputSchema as is, AddStateExampleAction as it, filterDocumentOperationsResultingState as iu, PHRenownPrivyAdapterConfig as j, SkipHeaderOperationIndex as ja, WebhookSpec as jc, SetAuthorNameInput as ji, setOperationErrorName as jl, LoadStateActionStateInput as jn, MoveOperationInputSchema as jo, MutationSetStateSchemaArgs as jr, definedNonNullAnySchema as js, DeleteOperationExampleAction as jt, sortOperations as ju, PHPackageProvider as k, SignatureVerificationHandler as ka, WebhookScheme as kc, ScopeState as ki, setOperationErrorCode as kl, LoadStateAction as kn, ManifestSchema as ko, MutationSetOperationSchemaArgs as kr, UpdateOperationExampleInputSchema as ks, DeleteOperationErrorAction as kt, skipHeaderOperations as ku, PHConnectDefaultDriveLocal as l, SetOperationReducerAction as la, IWebhookScope as lc, defaultAuthState as ld, ReorderModulesAction as li, prune as ll, ENSInfo as ln, AddOperationInputSchema as lo, MutationReorderOperationErrorsArgs as lr, SetOperationDescriptionInputSchema as ls, CodeExample as lt, getDocumentLastModified as lu, PHConnectInstance as m, SetOperationScopeInput as ma, RouteBody as mc, defaultPHState as md, ReorderOperationExamplesInput as mi, reorderModules as ml, FileInput as mn, ConfigEntryTypeSchema as mo, MutationSetInitialStateArgs as mr, SetOperationNameInputSchema as ms, CreateChildDocumentInput as mt, isUndo as mu, DrivePreserveStrategy as n, SetOperationErrorDescriptionInput as na, ProcessorFilter as nc, backfillAuthState as nd, ReleaseNewVersionAction as ni, loadState as nl, DocumentModelStateAction as nn, applyUpgradeDocumentAction as no, MutationLoadStateArgs as nr, SetModelExtensionInputSchema as ns, AddRelationshipAction as nt, checkOperationsIntegrity as nu, PHConnectApp as o, SetOperationErrorTemplateInput as oa, AuthorizerResult as oc, createGlobalState as od, ReorderChangeLogItemsInput as oi, operationFromAction as ol, DocumentModelVersioningOperations as on, AddModuleInputSchema as oo, MutationReorderChangeLogItemsInputArgs as or, SetModuleNameInputSchema as os, AssertIsDocumentOfType as ot, garbageCollect as ou, PHConnectDrives as p, SetOperationScopeAction as pa, RouteAuthorizer as pc, defaultLocalState as pd, ReorderOperationExamplesAction as pi, reorderModuleOperations as pl, Exact as pn, ConfigEntrySchema as po, MutationSetAuthorWebsiteArgs as pr, SetOperationErrorTemplateInputSchema as ps, CopyChildDocumentSignal as pt, isNoopOperation as pu, AddChangeLogItemInput as q, UpdateStateExampleInput as qa, buildSignedAction as qc, SetModuleNameInput as qi, PHDocument as ql, MutationAddOperationErrorArgs as qn, ReorderModulesInputSchema as qo, PruneAction as qr, IProcessor as qs, DocumentModelModuleAction as qt, Capability as qu, LogLevel as r, SetOperationErrorNameAction as ra, ProcessorRecord as rc, createAuthState as rd, RemoveRelationshipAction as ri, moveOperation as rl, DocumentModelStateOperations as rn, computeUpgradeTransitions as ro, MutationMoveOperationArgs as rr, SetModelIdInputSchema as rs, AddRelationshipActionInput as rt, diffOperations as ru, PHConnectBranding as s, SetOperationNameAction as sa, IHttpScope as sc, createLocalState as sd, ReorderModuleOperationsAction as si, operationFromOperation as sl, DocumentOperationsIgnoreMap as sn, AddOperationErrorInputSchema as so, MutationReorderModuleOperationsArgs as sr, SetNameActionInputSchema as ss, AssertIsStateOfType as st, garbageCollectDocumentOperations as su, DrivePreserveStrategies as t, SetOperationErrorDescriptionAction as ta, ProcessorFactoryBuilder as tc, Principal as td, ReducerOptions as ti, documentModelActions as tl, DocumentModelPHState as tn, applyDeleteDocumentAction as to, MutationDeleteStateExampleArgs as tr, SetModelDescriptionInputSchema as ts, AddOperationInput as tt, checkCleanedOperationsIntegrity as tu, PHConnectDefaultDriveRemote as u, SetOperationReducerInput as ua, NodeRouteSpec as uc, defaultBaseState as ud, ReorderModulesInput as ui, redo as ul, EditorDispatch as un, AddStateExampleInputSchema as uo, MutationReorderOperationExamplesArgs as ur, SetOperationErrorCodeInputSchema as us, ConfigEntry as ut, groupOperationsByScope as uu, PHConnectPwaFileHandler as v, SetPreferredEditorActionInput as va, RouteOptions as vc, PHDocumentSignatureInfo as vd, RevisionsFilter as vi, setAuthorName as vl, IDocument as vn, DeleteOperationExampleInputSchema as vo, MutationSetModelNameArgs as vr, SetOperationTemplateInputSchema as vs, CreateDocumentActionInput as vt, merge as vu, PHConnectReactorFeatureFlags as w, Signal as wa, WebhookField as wc, DEFAULT_RELATIONAL_PROCESSOR_DB_NAME as wd, SchemaPruneAction as wi, setModelName as wl, InputMaybe as wn, DocumentSpecificationSchema as wo, MutationSetOperationErrorDescriptionArgs as wr, StateSchema as ws, DeleteDocumentAction as wt, readOnly as wu, PHConnectPwaRuntimeCaching as x, SetStateSchemaInput as xa, RouteUser as xc, deserializeSignature as xd, Scalars as xi, setModelDescription as xl, ISignalResult as xn, DocumentActionSchema as xo, MutationSetNameArgs as xr, SetStateSchemaInputSchema as xs, DeleteChangeLogItemInput as xt, parseResultingState as xu, PHConnectPwaIcon as y, SetPreferredEditorOperation as ya, RouteSpec as yc, Signature as yd, SaveToFile as yi, setAuthorWebsite as yl, IOperation as yn, DeleteOperationInputSchema as yo, MutationSetModuleDescriptionArgs as yr, SetPreferredEditorActionInputSchema as ys, CreateState as yt, nextSkipNumber as yu, ServiceActions as z, UndoRedoAction as za, addChangeLogItem as zc, SetModelExtensionInput as zi, setStateSchema as zl, MinimalBackupData as zn, PruneSchema as zo, OperationSpecification as zr, HashAlgorithms as zs, DocumentModelDocumentModelModule as zt, loadStateOperation as zu };
|
|
3167
|
-
|
|
4347
|
+
export { AddOperationErrorInput as $, HashAlgorithms as $a, PurgeMarkerOperation as $c, moveGrant as $d, reorderModuleOperations as $f, SetOperationErrorTemplateInput as $i, UpgradeManifest as $l, protocolVersionsFor as $m, MutationMoveOperationArgs as $n, assertOperationExampleIdUnique as $o, isNoopOperation as $p, RemoveRelationshipActionInput as $r, ReorderOperationErrorsInputSchema as $s, DocumentModelOperationExampleAction as $t, AuthAdministrationLockoutError as $u, PHPackageProvider as A, UndoAction as Aa, UndoActionInputSchema as Ac, MAX_SUPPORTED_AUTH_VERSION as Ad, addOperationError as Af, SetModelDescriptionInput as Ai, createVerificationSigner as Al, Principal as Am, MakeEmpty as An, RouteHandler as Ao, verifyOperationSignature as Ap, MutationUpdateStateExampleArgs as Ar, DeleteStateExampleInputSchema as As, DeleteOperationErrorAction as At, AUTH_DENIED_BY_GRANT_REASON as Au, ServiceActions as B, UpdateStateExampleInput as Ba, documentModelOperationErrorReducer as Bc, applyAuthAction as Bd, deleteOperationError as Bf, SetModuleNameInput as Bi, createZip as Bl, defaultDocumentState as Bm, Mutation as Bn, WebhookPolicy as Bo, baseReducerVersion as Bp, PieceModule as Br, OperationSpecificationSchema as Bs, DocumentModelDocumentModelModule as Bt, bytesToBase64Url as Bu, PHConnectPwaUrlPattern as C, SigningParameters as Ca, SetOperationTemplateInputSchema as Cc, AuthRequest as Cd, actionContext as Cf, DEFAULT_RELATIONAL_PROCESSOR_DB_NAME as Ch, SetAuthorNameAction as Ci, peerSupports as Cl, Condition as Cm, ISigner as Cn, IWebhookScope as Co, setOperationTemplate as Cp, MutationSetOperationReducerArgs as Cr, ConfigEntrySchema as Cs, DeleteChildDocumentInput as Ct, DocumentModelHeaderSchema as Cu, PHConnectRenownAdapters as D, StateReducer as Da, Set_NameSchema as Dc, InitializeAuthAction as Dd, addChangeLogItem as Df, SetInitialStateAction as Di, createPresignedHeader as Dl, PHBaseState as Dm, IsStateOfType as Dn, RouteAuthorizer as Do, updateChangeLogItem as Dp, MutationUndoArgs as Dr, DeleteOperationErrorInputSchema as Ds, DeleteModuleAction as Dt, assertIsDocumentModelState as Du, PHConnectRenown as E, State as Ea, SetStateSchemaInputSchema as Ec, ConditionContext as Ed, actions as Ef, SetAuthorWebsiteInput as Ei, createCopyHeader as El, PHAuthState as Em, IsDocumentOfType as En, RouteAuth as Eo, undo as Ep, MutationSetStateSchemaArgs as Er, DeleteModuleInputSchema as Es, DeleteDocumentActionInput as Et, assertIsDocumentModelDocument as Eu, ParsedCmdResult as F, UpdateOperationExampleAction as Fa, UpdateStateExampleInputSchema as Fc, RemoveGrantActionInput as Fd, buildSignedAction as Ff, SetModelNameAction as Fi, BulkArchiveEntry as Fl, createGlobalState as Fm, Maybe as Fn, RouteUser as Fo, PHDocumentMeta as Fp, OperationsByScope as Fr, ManifestSchema as Fs, DeleteStateExampleAction as Ft, ab2hex as Fu, ActionVerificationHandler as G, createNamespacedDb as Ga, documentModelStateSchemaReducer as Gc, assertAuthPreservedOnDuplicate as Gd, noop as Gf, SetOperationDescriptionInput as Gi, isDocumentZip as Gl, DocumentIdParams as Gm, MutationAddOperationExampleArgs as Gn, WebhookSpec as Go, filterDuplicatedOperations as Gp, Query as Gr, PublisherSchema as Gs, DocumentModelLib as Gt, HASH_ALGORITHM_SHA256 as Gu, ActionErrorCallback as H, UpgradeDocumentActionInput as Ha, documentModelOperationReducer as Hc, applyMoveGrantAction as Hd, deleteStateExample as Hf, SetNameActionInput as Hi, documentModelSaveToFileHandle as Hl, defaultLocalState as Hm, MutationAddModuleArgs as Hn, WebhookRequest as Ho, checkOperationsIntegrity as Hp, Publisher as Hr, PieceModulesSchema as Hs, DocumentModelHeaderAction as Ht, hashBrowser as Hu, PathValidation as I, UpdateOperationExampleInput as Ia, definedNonNullAnySchema as Ic, RemoveGrantActionInputSchema as Id, createAction as If, SetModelNameInput as Ii, baseLoadFromInput as Il, createLocalState as Im, MinimalBackupData as In, ScopedRouteHandle as Io, addUndo as Ip, PartialRecord as Ir, ModuleSchema as Is, DeleteStateExampleInput as It, base58Decode as Iu, AddChangeLogItemInput as J, hashNamespace as Ja, createReducer as Jc, evaluate as Jd, operationFromOperation as Jf, SetOperationErrorDescriptionAction as Ji, writeFileBrowser as Jl, SIGNATURE_PROTOCOL_V2 as Jm, MutationDeleteModuleArgs as Jn, OPERATION_NAME_PATTERN as Jo, garbageCollectV2 as Jp, RedoActionInput as Jr, RedoActionSchema as Js, DocumentModelModuleAction as Jt, HASH_ENCODING_HEX as Ju, Actions as K, createNamespacedQueryBuilder as Ka, documentModelVersioningReducer as Kc, assertAuthScopeActionAllowed as Kd, operationExampleCreators as Kf, SetOperationErrorCodeAction as Ki, parseBulkArchive as Kl, ProtocolVersions as Km, MutationAddStateExampleArgs as Kn, WebhookVerification as Ko, garbageCollect as Kp, Redo as Kr, PwaConfigSchema as Ks, DocumentModelLocalState as Kt, HASH_ALGORITHM_SHA512 as Ku, PowerhouseConfig as L, UpdateRelationshipAction as La, isDefinedNonNullAny as Lc, SetGrantAction as Ld, deleteChangeLogItem as Lf, SetModuleDescriptionAction as Li, baseLoadFromInputVersioned as Ll, createState as Lm, ModuleSpecification as Ln, WebhookEndpointInfo as Lo, appendWithoutApplying as Lp, PartialState as Lr, MoveOperationInputSchema as Ls, DocumentAction as Lt, base64UrlToBytes as Lu, PHRenownPrivyAdapterConfig as M, UndoRedoAction as Ma, UndoSchema as Mc, MoveGrantActionInput as Md, addStateExample as Mf, SetModelExtensionInput as Mi, sign as Ml, createAuthState as Mm, MakeOptional as Mn, RouteOptions as Mo, IntegrityIssueType as Mp, OperationErrorSpecification as Mr, DocumentModelGlobalStateSchema as Ms, DeleteOperationExampleAction as Mt, AUTH_VERSION_UNSUPPORTED_REASON as Mu, PHRenownRainbowAdapterConfig as N, UpdateChangeLogItemAction as Na, UpdateChangeLogItemInputSchema as Nc, MoveGrantActionInputSchema as Nd, baseActions as Nf, SetModelIdAction as Ni, validateHeader as Nl, createBaseState as Nm, Manifest as Nn, RouteSpec as No, PHDocument as Np, OperationIndex as Nr, DocumentModelInputSchema as Ns, DeleteOperationExampleInput as Nt, DOCUMENT_DELETED_REASON as Nu, PHConnectRuntimeConfig as O, SubgraphModule as Oa, Set_PreferredEditorSchema as Oc, InitializeAuthActionInput as Od, addModule as Of, SetInitialStateInput as Oi, createSignedHeader as Ol, PHDocumentState as Om, LoadFromFile as On, RouteBody as Oo, updateOperationExample as Op, MutationUpdateChangeLogItemInputArgs as Or, DeleteOperationExampleInputSchema as Os, DeleteModuleInput as Ot, isDocumentModelDocument as Ou, PackageManagerArgs as P, UpdateChangeLogItemInput as Pa, UpdateOperationExampleInputSchema as Pc, RemoveGrantAction as Pd, buildOperationSignature as Pf, SetModelIdInput as Pi, verify as Pl, createDocumentState as Pm, MappedOperation as Pn, RouteTransport as Po, PHDocumentHeader as Pp, OperationSpecification as Pr, DocumentSpecificationSchema as Ps, DeleteOperationInput as Pt, isDenied as Pu, AddOperationErrorAction as Q, ExtractProcessorSchemaOrSelf as Qa, PURGE_DOCUMENT as Qc, mentionedGroupIds as Qd, reorderChangeLogItems as Qf, SetOperationErrorTemplateAction as Qi, replayDocumentVersioned as Ql, isSignaturePolicy as Qm, MutationDeleteStateExampleArgs as Qn, assertOperationErrorIdUnique as Qo, isDocumentAction as Qp, RemoveRelationshipAction as Qr, ReorderModulesInputSchema as Qs, DocumentModelOperationErrorOperations as Qt, documentModelInitialLocalState as Qu, PowerhousePackage as R, UpdateRelationshipActionInput as Ra, documentModelHeaderReducer as Rc, SetGrantActionInput as Rd, deleteModule as Rf, SetModuleDescriptionInput as Ri, baseSaveToFileHandle as Rl, defaultAuthState as Rm, MoveOperationAction as Rn, WebhookField as Ro, attachBranch as Rp, PhAiToolAnnotations as Rr, OperationErrorSchema as Rs, DocumentModelAction as Rt, buildOperationSignatureMessage as Ru, PHConnectPwaRuntimeCaching as S, SignatureVerificationHandler as Sa, SetOperationScopeInputSchema as Sc, AuthRefusal as Sd, ActionContext as Sf, DEFAULT_ANALYTICS_PROCESSOR_DB_NAME as Sh, ScopeState as Si, mergePeerCapabilities as Sl, Capability as Sm, ISignalResult as Sn, IWebhookEndpoints as So, setOperationScope as Sp, MutationSetOperationNameArgs as Sr, CodeExampleSchema as Ss, DeleteChangeLogItemInput as St, BaseDocumentStateSchema as Su, PHConnectReactorFeatureFlags as T, SkipHeaderOperations as Ta, SetPreferredEditorActionSchema as Tc, AuthVerb as Td, actionSigner as Tf, SetAuthorWebsiteAction as Ti, selectProtocolVersions as Tl, Operand as Tm, InputMaybe as Tn, RouteActor as To, setStateSchema as Tp, MutationSetOperationTemplateArgs as Tr, DeleteChangeLogItemInputSchema as Ts, DeleteDocumentAction as Tt, DocumentModelSchema as Tu, ActionSignatureContext as U, User as Ua, documentModelReducer as Uc, applyRemoveGrantAction as Ud, documentModelActions as Uf, SetNameOperation as Ui, fetchFileBrowser as Ul, defaultPHState as Um, MutationAddOperationArgs as Un, WebhookScheme as Uo, diffOperations as Up, PurgeDocumentAction as Ur, PowerhouseModuleSchema as Us, DocumentModelHeaderOperations as Ut, hex2ab as Uu, DEFAULT_REGISTRY_URL as V, UpgradeDocumentAction as Va, documentModelOperationExampleReducer as Vc, applyInitializeAuthAction as Vd, deleteOperationExample as Vf, SetNameAction as Vi, documentModelLoadFromInput as Vl, defaultGlobalState as Vm, MutationAddChangeLogItemInputArgs as Vn, WebhookReply as Vo, checkCleanedOperationsIntegrity as Vp, PowerhouseModule as Vr, PieceModuleSchema as Vs, DocumentModelGlobalState as Vt, getUnixTimestamp as Vu, ActionSigningHandler as W, ValidationError as Wa, documentModelStateReducer as Wc, applySetGrantAction as Wd, moveOperation as Wf, SetOperationDescriptionAction as Wi, getFileBrowser as Wl, DEFAULT_SIGNATURE_POLICY as Wm, MutationAddOperationErrorArgs as Wn, WebhookSignatureEncoding as Wo, filterDocumentOperationsResultingState as Wp, PurgeDocumentActionInput as Wr, PowerhouseModulesSchema as Ws, DocumentModelInput as Wt, HASH_ALGORITHM_SHA1 as Wu, AddModuleInput as X, relationalDbToQueryBuilder as Xa, replayOperations as Xc, isAuthAction as Xd, redo as Xf, SetOperationErrorNameAction as Xi, VersionedReducers as Xl, deriveDocumentId as Xm, MutationDeleteOperationErrorArgs as Xn, ReservedOperationName as Xo, groupOperationsByScope as Xp, ReducerOptions as Xr, ReorderChangeLogItemsInputSchema as Xs, DocumentModelOperationAction as Xt, documentModelGlobalState as Xu, AddModuleAction as Y, namespaceSchemaOf as Ya, processUndoRedo as Yc, initializeAuth as Yd, operationWithContext as Yf, SetOperationErrorDescriptionInput as Yi, zipEntries as Yl, SignaturePolicy$1 as Ym, MutationDeleteOperationArgs as Yn, RESERVED_OPERATION_NAMES as Yo, getDocumentLastModified as Yp, Reducer as Yr, RedoSchema as Ys, DocumentModelModuleOperations as Yt, documentModelFileExtension as Yu, AddOperationAction as Z, DOCUMENT_ID_COLUMNS as Za, updateDocument as Zc, isDocumentCreator as Zd, releaseNewVersion as Zf, SetOperationErrorNameInput as Zi, VersionedReplayConfig as Zl, isDerivedDocumentId as Zm, MutationDeleteOperationExampleArgs as Zn, assertModuleIdUnique as Zo, hashDocumentStateForScope as Zp, ReleaseNewVersionAction as Zr, ReorderModuleOperationsInputSchema as Zs, DocumentModelOperationErrorAction as Zt, documentModelInitialGlobalState as Zu, PHConnectPwa as _, Signal as _a, SetOperationErrorNameInputSchema as _c, referencedGroupIds as _d, isV2ActionHash as _f, PHDocumentSignatureInfo as _h, SchemaNOOPAction as _i, isOlderManifest as _l, sortOperations as _m, IAction as _n, ProcessorRecord as _o, setOperationErrorName as _p, MutationSetOperationDescriptionArgs as _r, AddOperationErrorInputSchema as _s, CreateDocument as _t, UnsupportedDocumentModelVersionError as _u, PHConnectAi as a, SetOperationSchemaInput as aa, SetInitialStateInputSchema as ac, MAX_CAPABILITY_OPERATIONS as ad, TransportSigner as af, OperationContext as ah, ReorderModulesInput as ai, FeatureCapability as al, nextSkipNumber as am, DocumentModelUtils as an, RelationalDbProcessor as ao, setAuthorWebsite as ap, MutationReorderOperationExamplesArgs as ar, getAllOperationNames as as, AddStateExampleAction as at, withProtocolVersions as au, PHConnectPwaIcon as b, SignalResults as ba, SetOperationReducerInputSchema as bc, AuthDecision as bd, v2TupleProblem as bf, deserializeSignature as bh, SchemaSetPreferredEditorAction as bi, localSupports as bl, withSignaturePolicy as bm, IOperation as bn, AuthorizerResult as bo, setOperationReducer as bp, MutationSetOperationErrorNameArgs as br, AddStateExampleInputSchema as bs, CreateState as bt, groupMembershipActionTypes as bu, PHConnectDefaultDrive as c, SetOperationTemplateAction as ca, SetModelIdInputSchema as cc, assertAuthAdministrationRetained as cd, ActionSignerIdentity as cf, operationOutcome as ch, ReorderOperationExamplesAction as ci, PEER_CAPABILITIES as cl, precedes as cm, DocumentOperationsIgnoreMap as cn, IProcessorDispatch as co, setModelExtension as cp, MutationSetAuthorWebsiteArgs as cr, validateInitialState as cs, AssertIsStateOfType as ct, AuthInitializerNotCreatorError as cu, PHConnectDriveSection as d, SetPreferredEditorActionInput as da, SetModuleNameInputSchema as dc, assertValidInitialGrants as dd, DOCUMENT_SCOPE_ACTION_TYPES as df, setPreferredEditorOperation as dh, ReorderStateExamplesInput as di, PeerCapabilityFlags as dl, removeExistingOperations as dm, EditorDispatch as dn, ProcessorApp as do, setModuleDescription as dp, MutationSetModelExtensionArgs as dr, validateModules as ds, ConfigEntry as dt, FileSystemError as du, SetOperationNameAction as ea, ReorderOperationExamplesInputSchema as ec, AuthAdministrationMissingError as ed, removeGrant as ef, requestedSignaturePolicy as eh, ReorderChangeLogItemsAction as ei, isPurgeMarker as el, isUndo as em, DocumentModelOperationExampleOperations as en, IBaseRelationalDb as eo, reorderModules as ep, MutationRedoArgs as er, assertOperationIdUnique as es, AddOperationExampleAction as et, UpgradeReducer as eu, PHConnectDriveSections as f, SetPreferredEditorOperation as fa, SetNameActionInputSchema as fc, evaluateCondition as fd, actionPreimageV2 as ff, undoOperation as fh, ReplayDocumentOptions as fi, PeerManifest as fl, replayDocument as fm, EditorModule as fn, ProcessorApps as fo, setModuleName as fp, MutationSetModelIdArgs as fr, validateOperationName as fs, ConfigEntryType as ft, GrantNotFoundError as fu, PHConnectPackages as g, Set_PreferredEditor as ga, SetOperationErrorDescriptionInputSchema as gc, isPlainValue as gd, hashActionV2 as gf, HashConfig as gh, Scalars as gi, holdReason as gl, sortMappedOperations as gm, GetDocumentOptions as gn, ProcessorFilter as go, setOperationErrorDescription as gp, MutationSetNameArgs as gr, AddModuleInputSchema as gs, CreateChildDocumentSignal as gt, InvalidAuthVersionError as gu, PHConnectOpenPanel as h, Set_Name as ha, SetOperationErrorCodeInputSchema as hc, grantProblem as hd, canonicalJson as hf, AppActionSigner as hh, SaveToFileHandle as hi, coversLocal as hl, skipHeaderOperations as hm, FileInput as hn, ProcessorFactoryBuilder as ho, setOperationErrorCode as hp, MutationSetModuleNameArgs as hr, AddChangeLogItemInputSchema as hs, CreateChildDocumentInput as ht, InvalidActionInputZodError as hu, LogLevels as i, SetOperationSchemaAction as ia, SetAuthorWebsiteInputSchema as ic, MAX_AUTH_GRANTS as id, TransportActionContext as if, Operation as ih, ReorderModulesAction as ii, DOCUMENT_PURGE_PROTOCOL as il, merge as im, DocumentModelStateOperations as in, IRelationalQueryMethods as io, setAuthorName as ip, MutationReorderOperationErrorsArgs as ir, findOperationOrThrow as is, AddRelationshipActionInput as it, computeUpgradeTransitions as iu, PHReactorRenown as j, UndoActionInput as ja, UndoActionSchema as jc, MoveGrantAction as jd, addOperationExample as jf, SetModelExtensionAction as ji, hasDerivedDocumentId as jl, backfillAuthState as jm, MakeMaybe as jn, RouteMethod as jo, IntegrityIssueSubType as jp, NOOPAction as jr, DocumentActionSchema as js, DeleteOperationErrorInput as jt, AUTH_NO_GRANT_REASON as ju, PHConnectSentry as k, Undo as ka, StateSchema as kc, InitializeAuthActionInputSchema as kd, addOperation as kf, SetModelDescriptionAction as ki, createSignedHeaderForSigner as kl, PHGroupState as km, LoadFromInput as kn, RouteContext as ko, updateStateExample as kp, MutationUpdateOperationExampleArgs as kr, DeleteOperationInputSchema as ks, DeleteOperationAction as kt, isDocumentModelState as ku, PHConnectDefaultDriveLocal as l, SetOperationTemplateInput as la, SetModelNameInputSchema as lc, assertValidGrant as ld, ActionSigningTarget as lf, redoOperation as lh, ReorderOperationExamplesInput as li, PEER_MANIFEST_FORMAT as ll, prepareOperations as lm, DocumentSpecification as ln, IProcessorHostModuleBase as lo, setModelId as lp, MutationSetInitialStateArgs as lr, validateModule as ls, Author as lt, AuthPolicyNotPreservedError as lu, PHConnectInstance as m, SetStateSchemaInput as ma, SetOperationDescriptionInputSchema as mc, evaluateGrants as md, actionSigningTarget as mf, ActionSigner as mh, SaveToFile as mi, Supports as ml, reshuffleByTimestampAndIndex as mm, Exact as mn, ProcessorFactory as mo, setOperationDescription as mp, MutationSetModuleDescriptionArgs as mr, validateStateSchemaName as ms, CopyChildDocumentSignal as mt, InvalidActionInputError as mu, DrivePreserveStrategy as n, SetOperationReducerAction as na, ScopeStateSchema as nc, GroupPrincipalNotAllowedError as nd, setGrant as nf, v2RequiredProtocolVersions as nh, ReorderModuleOperationsAction as ni, purgeMarkerOperation as nl, mapSkippedOperations as nm, DocumentModelPHState as nn, IRelationalDbProcessor as no, reorderOperationExamples as np, MutationReorderModuleOperationsArgs as nr, findOperationErrorOrThrow as ns, AddOperationInput as nt, applyDeleteDocumentAction as nu, PHConnectApp as o, SetOperationScopeAction as oa, SetModelDescriptionInputSchema as oc, MAX_CONDITION_DEPTH as od, toTransportAction as of, OperationOutcome as oh, ReorderOperationErrorsAction as oi, HoldReason as ol, operationsAreEqual as om, DocumentModelVersioningAction as on, RelationalDbProcessorClass as oo, setInitialState as op, MutationReorderStateExamplesArgs as or, isReservedOperationName as os, AddStateExampleInput as ot, AuthActionNotAllowedError as ou, PHConnectDrives as p, SetStateSchemaAction as pa, SetNameActionSchema as pc, evaluateGrantStack as pd, actionSignerIdentity as pf, undoOperationV2 as ph, RevisionsFilter as pi, ProtocolCapability as pl, reshuffleByTimestamp as pm, EditorProps as pn, ProcessorDispatchResult as po, setName as pp, MutationSetModelNameArgs as pr, validateOperations as ps, CopyChildDocumentInput as pt, HashMismatchError as pu, AddChangeLogItemAction as q, createRelationalDb as qa, baseReducer as qc, decide as qd, operationFromAction as qf, SetOperationErrorCodeInput as qi, readFileBrowser as ql, SIGNATURE_PROTOCOL as qm, MutationDeleteChangeLogItemInputArgs as qn, deletedDocumentId as qo, garbageCollectDocumentOperations as qp, RedoAction as qr, RedoActionInputSchema as qs, DocumentModelModule as qt, HASH_ENCODING_BASE64 as qu, LogLevel as r, SetOperationReducerInput as ra, SetAuthorNameInputSchema as rc, InvalidGrantError as rd, TransportAction as rf, DocumentOperations as rh, ReorderModuleOperationsInput as ri, purgedProtocolVersions as rl, mapSkippedOperationsV2 as rm, DocumentModelStateAction as rn, IRelationalQueryBuilder as ro, reorderStateExamples as rp, MutationReorderModulesArgs as rr, findOperationExampleOrThrow as rs, AddRelationshipAction as rt, applyUpgradeDocumentAction as ru, PHConnectBranding as s, SetOperationScopeInput as sa, SetModelExtensionInputSchema as sc, MAX_CONDITION_NODES as sd, ACTION_SIGNATURE_V2_PREFIX as sf, OperationWithContext$1 as sh, ReorderOperationErrorsInput as si, MARKER_REFUSAL_FEATURE as sl, parseResultingState as sm, DocumentModelVersioningOperations as sn, IProcessor as so, setModelDescription as sp, MutationSetAuthorNameArgs as sr, isValidOperationNameFormat as ss, AssertIsDocumentOfType as st, AuthAlreadyInitializedError as su, DrivePreserveStrategies as t, SetOperationNameInput as ta, ReorderStateExamplesInputSchema as tc, GrantSchema as td, resolveSnapshotAuth as tf, signaturePolicyOf as th, ReorderChangeLogItemsInput as ti, purgeDocumentAction as tl, isUndoRedo as tm, DocumentModelOperationOperations as tn, IRelationalDb as to, reorderOperationErrors as tp, MutationReorderChangeLogItemsInputArgs as tr, findModuleOrThrow as ts, AddOperationExampleInput as tt, UpgradeTransition as tu, PHConnectDefaultDriveRemote as u, SetPreferredEditorAction as ua, SetModuleDescriptionInputSchema as uc, assertValidGrantUpsert as ud, CanonicalJsonError as uf, setNameOperation as uh, ReorderStateExamplesAction as ui, PeerCapability as ul, readOnly as um, ENSInfo as un, IProcessorManager as uo, setModelName as up, MutationSetModelDescriptionArgs as ur, validateModuleOperation as us, CodeExample as ut, DowngradeNotSupportedError as uu, PHConnectPwaCacheStrategy as v, SignalDispatch as va, SetOperationErrorTemplateInputSchema as vc, AUTH_ACTION_TYPES as vd, signActionV2 as vf, Signature as vh, SchemaRedoAction as vi, legacySupports as vl, split as vm, ID as vn, ProcessorStatus as vo, setOperationErrorTemplate as vp, MutationSetOperationErrorCodeArgs as vr, AddOperationExampleInputSchema as vs, CreateDocumentAction as vt, documentModelDocumentType as vu, PHConnectReactor as w, SkipHeaderOperationIndex as wa, SetPreferredEditorActionInputSchema as wc, AuthSubject as wd, actionFromAction as wf, PROCESSOR_APPS as wh, SetAuthorNameInput as wi, readPeerManifest as wl, Grant as wm, Incremental as wn, NodeRouteSpec as wo, setPreferredEditor as wp, MutationSetOperationSchemaArgs as wr, ConfigEntryTypeSchema as ws, DeleteChildDocumentSignal as wt, DocumentModelPHStateSchema as wu, PHConnectPwaManifest as x, SignalType as xa, SetOperationSchemaInputSchema as xc, AuthEvaluation as xd, Action as xf, serializeSignature as xh, SchemaUndoAction as xi, manifestRevision as xl, AuthGroups as xm, ISignal as xn, IHttpScope as xo, setOperationSchema as xp, MutationSetOperationErrorTemplateArgs as xr, AuthorSchema as xs, DeleteChangeLogItemAction as xt, BaseDocumentHeaderSchema as xu, PHConnectPwaFileHandler as y, SignalResult as ya, SetOperationNameInputSchema as yc, AuthAction as yd, targetDocumentId as yf, UserActionSigner as yh, SchemaSetNameAction as yi, localPeerManifest as yl, updateHeaderRevision as ym, IDocument as yn, TrackedProcessor as yo, setOperationName as yp, MutationSetOperationErrorDescriptionArgs as yr, AddOperationInputSchema as ys, CreateDocumentActionInput as yt, groupDocumentType as yu, ServiceAction as z, UpdateStateExampleAction as za, documentModelModuleReducer as zc, SetGrantActionInputSchema as zd, deleteOperation as zf, SetModuleNameAction as zi, createMinimalZip as zl, defaultBaseState as zm, MoveOperationInput as zn, WebhookHashAlgorithm as zo, baseCreateDocument as zp, PhAiToolDescriptor as zr, OperationScopeSchema as zs, DocumentModelDocument as zt, buildOperationSignatureParams as zu };
|
|
4348
|
+
export {};
|
|
4349
|
+
//# sourceMappingURL=types-BRJfX8ck.d.ts.map
|