@powerhousedao/shared 6.2.3-dev.7 → 6.2.3-dev.71
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-BLAht4dO.mjs} +9 -4
- package/dist/clis/args/connect-BLAht4dO.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-Dejwe6Bz.mjs} +43 -16
- package/dist/clis/args/help-Dejwe6Bz.mjs.map +1 -0
- package/dist/clis/args/help-KuqI-EEG.d.mts +203 -0
- package/dist/clis/args/help-KuqI-EEG.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-CTaK80wE.d.mts +55 -0
- package/dist/clis/args/init-CTaK80wE.d.mts.map +1 -0
- package/dist/clis/args/{init-rz9Ei7nq.mjs → init-xlCNZ8Oe.mjs} +7 -2
- package/dist/clis/args/{init-rz9Ei7nq.mjs.map → init-xlCNZ8Oe.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/run-l_LiMplO.mjs +28 -0
- package/dist/clis/args/run-l_LiMplO.mjs.map +1 -0
- package/dist/clis/args/run.d.mts +18 -0
- package/dist/clis/args/run.d.mts.map +1 -0
- package/dist/clis/args/run.mjs +2 -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-DiTFThbn.d.mts +27 -0
- package/dist/clis/args/service-DiTFThbn.d.mts.map +1 -0
- 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-tJhHVdPm.mjs +277 -0
- package/dist/clis/build-config-tJhHVdPm.mjs.map +1 -0
- package/dist/clis/build-config.d.mts +56 -10616
- package/dist/clis/build-config.d.mts.map +1 -1
- package/dist/clis/build-config.mjs +2 -88
- package/dist/clis/build-pieces.d.mts +160 -0
- package/dist/clis/build-pieces.d.mts.map +1 -0
- package/dist/clis/build-pieces.mjs +549 -0
- package/dist/clis/build-pieces.mjs.map +1 -0
- package/dist/clis/command-names.d.mts +2 -2
- package/dist/clis/command-names.d.mts.map +1 -1
- package/dist/clis/command-names.mjs +1 -0
- package/dist/clis/command-names.mjs.map +1 -1
- package/dist/clis/constants.d.mts +3 -462
- package/dist/clis/constants.mjs +46 -13
- package/dist/clis/constants.mjs.map +1 -1
- package/dist/clis/feature-flags.d.mts +17 -0
- package/dist/clis/feature-flags.d.mts.map +1 -0
- package/dist/clis/feature-flags.mjs +21 -0
- package/dist/clis/feature-flags.mjs.map +1 -0
- package/dist/clis/index-DnZYG-8g.d.mts +11154 -0
- package/dist/clis/index-DnZYG-8g.d.mts.map +1 -0
- package/dist/clis/index.d.mts +3390 -1963
- package/dist/clis/index.d.mts.map +1 -1
- package/dist/clis/index.mjs +1052 -854
- package/dist/clis/index.mjs.map +1 -1
- package/dist/clis/package-style.d.mts +32 -0
- package/dist/clis/package-style.d.mts.map +1 -0
- package/dist/clis/package-style.mjs +102 -0
- package/dist/clis/package-style.mjs.map +1 -0
- package/dist/clis/ph-dir.d.mts +26 -0
- package/dist/clis/ph-dir.d.mts.map +1 -0
- package/dist/clis/ph-dir.mjs +37 -0
- package/dist/clis/ph-dir.mjs.map +1 -0
- package/dist/clis/project-env.d.mts +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/rolldown-runtime-B4iAMlE-.mjs +35 -0
- package/dist/clis/services/telemetry.d.mts +7 -7
- package/dist/clis/services/telemetry.d.mts.map +1 -1
- package/dist/clis/services/telemetry.mjs.map +1 -1
- package/dist/clis/types-DT6KawYx.d.mts +2317 -0
- package/dist/clis/types-DT6KawYx.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-BWt0c0eU.js} +48 -11
- package/dist/config-loader-BWt0c0eU.js.map +1 -0
- package/dist/connect/config-loader.d.ts +21 -8
- package/dist/connect/config-loader.d.ts.map +1 -1
- package/dist/connect/config-loader.js +2 -2
- package/dist/connect/connect-config-schema.d.ts +3 -0
- package/dist/connect/connect-config-schema.js +445 -0
- package/dist/connect/connect-config-schema.js.map +1 -0
- package/dist/connect/image-ref.d.ts +32 -0
- package/dist/connect/image-ref.d.ts.map +1 -0
- package/dist/connect/image-ref.js +80 -0
- package/dist/connect/image-ref.js.map +1 -0
- package/dist/connect/index.d.ts +220 -643
- package/dist/connect/index.d.ts.map +1 -1
- package/dist/connect/index.js +432 -507
- package/dist/connect/index.js.map +1 -1
- package/dist/connect/json-adapter.d.ts +3 -4
- package/dist/connect/json-adapter.d.ts.map +1 -1
- package/dist/connect/json-adapter.js.map +1 -1
- package/dist/connect-config-schema-1-O1CQ4v.d.ts +1731 -0
- package/dist/connect-config-schema-1-O1CQ4v.d.ts.map +1 -0
- package/dist/constants-CcaK3k1D.d.ts +9 -0
- package/dist/constants-CcaK3k1D.d.ts.map +1 -0
- package/dist/constants.d.ts +3 -2
- package/dist/constants.js +15 -5
- package/dist/constants.js.map +1 -1
- package/dist/document-drive/index.d.ts +103 -101
- package/dist/document-drive/index.d.ts.map +1 -1
- package/dist/document-drive/index.js +40 -31
- 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 +298 -391
- 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/host-tokens/index.d.ts +3 -0
- package/dist/host-tokens/index.js +278 -0
- package/dist/host-tokens/index.js.map +1 -0
- package/dist/index-DIM6qtzj.d.ts +227 -0
- package/dist/index-DIM6qtzj.d.ts.map +1 -0
- package/dist/index-DvbhwImT.d.ts +36 -0
- package/dist/index-DvbhwImT.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 +25 -7
- package/dist/registry/index.js.map +1 -1
- package/dist/registry/manifest-slim.d.ts +4 -3
- package/dist/registry/manifest-slim.d.ts.map +1 -1
- package/dist/registry/manifest-slim.js +21 -0
- package/dist/registry/manifest-slim.js.map +1 -1
- package/dist/registry/updates.d.ts +3 -3
- package/dist/registry/updates.d.ts.map +1 -1
- package/dist/registry/updates.js.map +1 -1
- package/dist/registry/urls.d.ts +2 -2
- package/dist/registry/urls.d.ts.map +1 -1
- package/dist/registry/urls.js.map +1 -1
- package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
- package/dist/{types-CpnWmiFY.d.ts → types-BpO4LIKj.d.ts} +2149 -985
- package/dist/types-BpO4LIKj.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/{types-YqLqb0Zb.d.ts → types-OXIqeH8W.d.ts} +39 -43
- package/dist/types-OXIqeH8W.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 +28 -7
- package/dist/clis/args/access-token--9H57y8J.d.mts +0 -18
- package/dist/clis/args/access-token--9H57y8J.d.mts.map +0 -1
- package/dist/clis/args/common-CcYbXrBx.mjs.map +0 -1
- package/dist/clis/args/common-zPBoTNJF.d.mts +0 -183
- package/dist/clis/args/common-zPBoTNJF.d.mts.map +0 -1
- package/dist/clis/args/connect-BVVvCmL9.mjs.map +0 -1
- package/dist/clis/args/connect-BtU0MTTc.d.mts +0 -443
- package/dist/clis/args/connect-BtU0MTTc.d.mts.map +0 -1
- package/dist/clis/args/generate-CA916Fvj.mjs.map +0 -1
- package/dist/clis/args/generate-DnV-bfXt.d.mts +0 -87
- package/dist/clis/args/generate-DnV-bfXt.d.mts.map +0 -1
- package/dist/clis/args/help-Bqbgbalu.mjs.map +0 -1
- package/dist/clis/args/help-CjAsudUn.d.mts +0 -193
- package/dist/clis/args/help-CjAsudUn.d.mts.map +0 -1
- package/dist/clis/args/init-CUXyfquF.d.mts +0 -55
- package/dist/clis/args/init-CUXyfquF.d.mts.map +0 -1
- package/dist/clis/args/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-CoMvTJK7.d.mts +0 -113
- package/dist/clis/args/vetra-CoMvTJK7.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
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region host-tokens/index.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Output tokens (typed-host-configs G3): plain-JSON operators a host file
|
|
5
|
+
* uses to consume values another host's creation produces. An object whose
|
|
6
|
+
* SOLE key is one of TOKEN_KEYS is an operator; `$$` escapes a literal
|
|
7
|
+
* `$`-prefixed sole key. Host-core fields accept them through `tokenable()`
|
|
8
|
+
* (declared form); host-core's `resolveHostOutputs` replaces them before a
|
|
9
|
+
* verb runs, and `validateHost` rejects any that remain.
|
|
10
|
+
*
|
|
11
|
+
* `@powerhousedao/shared/host-tokens`: zod only, no `node:` import (a test
|
|
12
|
+
* walks the import graph), so Connect's config schema (../connect/) can
|
|
13
|
+
* declare token-able fields; `@powerhousedao/host-core` re-exports all of it.
|
|
14
|
+
*/
|
|
15
|
+
type OutputPath = (string | number)[];
|
|
16
|
+
/** `{ $output: { host, member?, path } }` — the value at `path` in that
|
|
17
|
+
* host's outputs. `T` is a phantom brand for generated `outputs.d.ts`. */
|
|
18
|
+
interface OutputToken<T = unknown> {
|
|
19
|
+
$output: {
|
|
20
|
+
host: string;
|
|
21
|
+
member?: string;
|
|
22
|
+
path: OutputPath;
|
|
23
|
+
};
|
|
24
|
+
readonly "~value"?: T;
|
|
25
|
+
}
|
|
26
|
+
/** `{ $concat: [...] }` — a string; every part resolves to string|number. */
|
|
27
|
+
interface ConcatToken {
|
|
28
|
+
$concat: (string | number | Token)[];
|
|
29
|
+
}
|
|
30
|
+
/** `$item` inside a `$map` template: the current element (innermost map, or
|
|
31
|
+
* the named outer binding). */
|
|
32
|
+
interface ItemToken<T = unknown> {
|
|
33
|
+
$item: OutputPath | {
|
|
34
|
+
as: string;
|
|
35
|
+
path: OutputPath;
|
|
36
|
+
};
|
|
37
|
+
readonly "~value"?: T;
|
|
38
|
+
}
|
|
39
|
+
/** `$key` inside a `$map` template: the current key (`true` = innermost). */
|
|
40
|
+
interface KeyToken {
|
|
41
|
+
$key: true | string;
|
|
42
|
+
}
|
|
43
|
+
/** `{ $map: { over, as?, to, into? } }`: `to` rendered once per element of
|
|
44
|
+
* `over` (arrays in order, records key-sorted); an array, or a record
|
|
45
|
+
* keeping the input keys with `into: "record"` (3.3). */
|
|
46
|
+
interface MapToken<To = unknown> {
|
|
47
|
+
$map: {
|
|
48
|
+
over: OutputToken | ItemToken;
|
|
49
|
+
as?: string;
|
|
50
|
+
to: To;
|
|
51
|
+
into?: "record";
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/** `{ $env: "NAME" }` or `{ $env: { name, optional: true } }`. */
|
|
55
|
+
interface EnvToken {
|
|
56
|
+
$env: string | {
|
|
57
|
+
name: string;
|
|
58
|
+
optional: true;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
type Token = OutputToken | ConcatToken | MapToken | ItemToken | KeyToken | EnvToken;
|
|
62
|
+
declare const TOKEN_KEYS: readonly ["$output", "$concat", "$map", "$item", "$key", "$env"];
|
|
63
|
+
type TokenKey = (typeof TOKEN_KEYS)[number];
|
|
64
|
+
/** The escape key: `{ $$: { $output: … } }` is the literal object. */
|
|
65
|
+
declare const TOKEN_ESCAPE_KEY = "$$";
|
|
66
|
+
/** A value with the (untyped) tokens of its own union removed: what a
|
|
67
|
+
* token in that position must produce. */
|
|
68
|
+
type Untokened<T> = Exclude<T, Token>;
|
|
69
|
+
/** What `{ $key: true }` reads inside a `$map` template: the innermost
|
|
70
|
+
* map's key, a number over an array and a string over a record. */
|
|
71
|
+
type MapKey = string | number;
|
|
72
|
+
/** A branded array `over` (an `ItemToken<X[]>` from outputs.d.ts). */
|
|
73
|
+
type ArrayOver = OutputToken<readonly unknown[]> | ItemToken<readonly unknown[]>;
|
|
74
|
+
/** A branded record `over`. An array does not fit it (no string index). */
|
|
75
|
+
type RecordOver = OutputToken<Readonly<Record<string, unknown>>> | ItemToken<Readonly<Record<string, unknown>>>;
|
|
76
|
+
/**
|
|
77
|
+
* `$map` producing an array of `E` (no `into`). `$key: true` in `to` reads
|
|
78
|
+
* a number over an array and a string over a record, so its slot is typed
|
|
79
|
+
* by the `over`: a branded array `over` keeps `$key` out of string slots.
|
|
80
|
+
* A hand-written `$output` literal carries no brand and fits both forms;
|
|
81
|
+
* there, a misplaced `$key` fails at resolved validation instead.
|
|
82
|
+
*/
|
|
83
|
+
type ArrayMapToken<E> = {
|
|
84
|
+
$map: {
|
|
85
|
+
over: ArrayOver;
|
|
86
|
+
as?: string;
|
|
87
|
+
to: Template<E, number>;
|
|
88
|
+
into?: never;
|
|
89
|
+
};
|
|
90
|
+
} | {
|
|
91
|
+
$map: {
|
|
92
|
+
over: RecordOver;
|
|
93
|
+
as?: string;
|
|
94
|
+
to: Template<E, string>;
|
|
95
|
+
into?: never;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
/** `$map` producing a record of `V` (`into: "record"`, record `over`). */
|
|
99
|
+
interface RecordMapToken<V> {
|
|
100
|
+
$map: {
|
|
101
|
+
over: RecordOver;
|
|
102
|
+
as?: string;
|
|
103
|
+
to: Template<V, string>;
|
|
104
|
+
into: "record";
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
type MapTokenFor<T> = T extends readonly unknown[] ? ArrayMapToken<T[number]> : T extends object ? string extends keyof T ? RecordMapToken<T[string & keyof T]> : never : never;
|
|
108
|
+
/** `true` when some member of `K` fits `T` (else `never`). */
|
|
109
|
+
type SomeFits<K, T> = K extends T ? true : never;
|
|
110
|
+
/** The `$key` tokens that fit `T`: `{ $key: true }` (the innermost map's
|
|
111
|
+
* key, typed `K`) and `{ $key: "<as>" }` (a named outer map's key, whose
|
|
112
|
+
* type is not tracked: a string or a number). */
|
|
113
|
+
type KeyTokenFor<T, K extends MapKey> = ([SomeFits<K, T>] extends [never] ? never : {
|
|
114
|
+
$key: true;
|
|
115
|
+
}) | ([SomeFits<MapKey, T>] extends [never] ? never : {
|
|
116
|
+
$key: string;
|
|
117
|
+
});
|
|
118
|
+
/**
|
|
119
|
+
* The tokens that may stand where a value of type `T` is expected:
|
|
120
|
+
* `$output`/`$item` whose (branded) value fits `T` (a hand-written literal
|
|
121
|
+
* carries no brand and fits anywhere; the loader checks its path),
|
|
122
|
+
* `$concat`/`$env` where a string fits, `$key` where the key fits (`K`: the
|
|
123
|
+
* innermost `$map`'s key type inside a template), and `$map` where `T` is
|
|
124
|
+
* an array (or, `into: "record"`, a record).
|
|
125
|
+
*/
|
|
126
|
+
type TokenFor<T, K extends MapKey = MapKey> = unknown extends T ? Token : OutputToken<T> | ItemToken<T> | (string extends T ? ConcatToken | EnvToken : never) | KeyTokenFor<T, K> | MapTokenFor<T>;
|
|
127
|
+
/**
|
|
128
|
+
* A `$map` template for an element of type `T`: `T`'s shape with a fitting
|
|
129
|
+
* token allowed at EVERY position (the rendered element is validated
|
|
130
|
+
* against the field's schema after resolution, so non-ref fields such as a
|
|
131
|
+
* drive `slug` may take `$key`/`$item` here). `K` is the type `$key: true`
|
|
132
|
+
* reads (see {@link ArrayMapToken}).
|
|
133
|
+
*/
|
|
134
|
+
type Template<T, K extends MapKey = MapKey> = TokenFor<Untokened<T>, K> | TemplateShape<Untokened<T>, K>;
|
|
135
|
+
type TemplateShape<T, K extends MapKey> = T extends readonly unknown[] ? Template<T[number], K>[] : T extends object ? { [P in keyof T]: TemplateSlot<T[P], K>; } : T;
|
|
136
|
+
/** One property of a template. Its tokens may produce `undefined` where
|
|
137
|
+
* the property is optional (a codegen'd `ItemToken<X | undefined>`: the
|
|
138
|
+
* rendered property is then left out), but the property is never written
|
|
139
|
+
* as a literal `undefined`: a host file is JSON, so an optional property is
|
|
140
|
+
* omitted instead (enforced by the type under exactOptionalPropertyTypes,
|
|
141
|
+
* which generated hosts/tsconfig.json enables). */
|
|
142
|
+
type TemplateSlot<V, K extends MapKey> = TokenFor<Untokened<V>, K> | TemplateShape<Exclude<Untokened<V>, undefined>, K>;
|
|
143
|
+
declare const outputTokenSchema: z.ZodObject<{
|
|
144
|
+
$output: z.ZodObject<{
|
|
145
|
+
host: z.ZodString;
|
|
146
|
+
member: z.ZodOptional<z.ZodString>;
|
|
147
|
+
path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
148
|
+
}, z.core.$strict>;
|
|
149
|
+
}, z.core.$strict>;
|
|
150
|
+
declare const itemTokenSchema: z.ZodObject<{
|
|
151
|
+
$item: z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>, z.ZodObject<{
|
|
152
|
+
as: z.ZodString;
|
|
153
|
+
path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
154
|
+
}, z.core.$strict>]>;
|
|
155
|
+
}, z.core.$strict>;
|
|
156
|
+
declare const keyTokenSchema: z.ZodObject<{
|
|
157
|
+
$key: z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodString]>;
|
|
158
|
+
}, z.core.$strict>;
|
|
159
|
+
declare const envTokenSchema: z.ZodObject<{
|
|
160
|
+
$env: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
161
|
+
name: z.ZodString;
|
|
162
|
+
optional: z.ZodLiteral<true>;
|
|
163
|
+
}, z.core.$strict>]>;
|
|
164
|
+
}, z.core.$strict>;
|
|
165
|
+
declare const mapTokenSchema: z.ZodObject<{
|
|
166
|
+
$map: z.ZodObject<{
|
|
167
|
+
over: z.ZodUnion<readonly [z.ZodObject<{
|
|
168
|
+
$output: z.ZodObject<{
|
|
169
|
+
host: z.ZodString;
|
|
170
|
+
member: z.ZodOptional<z.ZodString>;
|
|
171
|
+
path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
172
|
+
}, z.core.$strict>;
|
|
173
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
174
|
+
$item: z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>, z.ZodObject<{
|
|
175
|
+
as: z.ZodString;
|
|
176
|
+
path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
177
|
+
}, z.core.$strict>]>;
|
|
178
|
+
}, z.core.$strict>]>;
|
|
179
|
+
as: z.ZodOptional<z.ZodString>;
|
|
180
|
+
to: z.ZodUnknown;
|
|
181
|
+
into: z.ZodOptional<z.ZodLiteral<"record">>;
|
|
182
|
+
}, z.core.$strict>;
|
|
183
|
+
}, z.core.$strict>;
|
|
184
|
+
declare const concatTokenSchema: z.ZodType<ConcatToken, ConcatToken>;
|
|
185
|
+
declare const tokenSchema: z.ZodType<Token, Token>;
|
|
186
|
+
/** The operator key of a token-shaped value (sole key among TOKEN_KEYS), or
|
|
187
|
+
* undefined. Shape-level only: the operand is not validated here. */
|
|
188
|
+
declare function tokenKeyOf(value: unknown): TokenKey | undefined;
|
|
189
|
+
declare function isToken(value: unknown): boolean;
|
|
190
|
+
/** The path (`a.b[2].c`) of the first token in a JSON-shaped value, or
|
|
191
|
+
* undefined. A `$$` escape hides its operand from the walk. */
|
|
192
|
+
declare function findToken(value: unknown, trail?: string): {
|
|
193
|
+
path: string;
|
|
194
|
+
key: TokenKey;
|
|
195
|
+
} | undefined;
|
|
196
|
+
/** A token-able field: `T | Token` (declared form). Host schemas take it
|
|
197
|
+
* through `makeHostSchemas`' ref function; plugin configSchemas use it
|
|
198
|
+
* directly. */
|
|
199
|
+
declare function ref<S extends z.ZodType>(schema: S): z.ZodUnion<[S, z.ZodType<Token, TokenFor<Untokened<z.input<S>>>>]>;
|
|
200
|
+
/** Resolved form of a ref field: tokens are not accepted. */
|
|
201
|
+
declare function forbidRef<S extends z.ZodType>(schema: S): S;
|
|
202
|
+
type TokenMode = "allow" | "forbid";
|
|
203
|
+
type RefFn = typeof ref | typeof forbidRef;
|
|
204
|
+
/** A token-able host field as runners see it: authors may write `T | Token`
|
|
205
|
+
* (z.input), verbs receive `T` (z.output). */
|
|
206
|
+
type TokenableSchema<S extends z.ZodType, K = TokenFor<Untokened<z.input<S>>>> = z.ZodType<z.output<S>, z.input<S> | K>;
|
|
207
|
+
/** A schema set's wrapper for its token-able fields: `tokenable` in the
|
|
208
|
+
* declared form, a plain one-option union in the resolved form (host-core's
|
|
209
|
+
* `s.tokenable`). Both share this static type: declared input, resolved
|
|
210
|
+
* output. */
|
|
211
|
+
type TokenField = <S extends z.ZodType>(schema: S) => TokenableSchema<S>;
|
|
212
|
+
/**
|
|
213
|
+
* The host-core field wrapper (declared input, resolved output): accepts
|
|
214
|
+
* `T` or an output token that fits it (`TokenFor<T>`: `$output`, `$concat`,
|
|
215
|
+
* `$env`, `$map` for a collection, …). Plugin
|
|
216
|
+
* configSchemas keep using `ref()`; this is for schemas whose verbs must see
|
|
217
|
+
* resolved types (the base host schemas every runner extends).
|
|
218
|
+
*/
|
|
219
|
+
declare function tokenable<S extends z.ZodType>(schema: S): TokenableSchema<S>;
|
|
220
|
+
/** Like `tokenable`, but the only token accepted is `$env` (e.g.
|
|
221
|
+
* `storage.dataDir`: a path is an environment fact, never another host's
|
|
222
|
+
* output). */
|
|
223
|
+
declare function envTokenable<S extends z.ZodType>(schema: S): TokenableSchema<S, EnvToken>;
|
|
224
|
+
//#endregion
|
|
225
|
+
export { ref as A, findToken as C, keyTokenSchema as D, itemTokenSchema as E, tokenSchema as M, tokenable as N, mapTokenSchema as O, envTokenable as S, isToken as T, TokenKey as _, KeyToken as a, concatTokenSchema as b, OutputToken as c, TOKEN_ESCAPE_KEY as d, TOKEN_KEYS as f, TokenFor as g, TokenField as h, ItemToken as i, tokenKeyOf as j, outputTokenSchema as k, RecordMapToken as l, Token as m, ConcatToken as n, MapToken as o, Template as p, EnvToken as r, OutputPath as s, ArrayMapToken as t, RefFn as u, TokenMode as v, forbidRef as w, envTokenSchema as x, TokenableSchema as y };
|
|
226
|
+
export {};
|
|
227
|
+
//# sourceMappingURL=index-DIM6qtzj.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-DIM6qtzj.d.ts","names":[],"sources":["../host-tokens/index.ts"],"mappings":";;;;;;;;;;;;;;KAeY;;;UAWK,YAAY;EAC3B;IAAW;IAAc;IAAiB,MAAM;;WACvC,WAAW;;;UAIL;EACf,4BAA4B;;;;UAKb,UAAU;EACzB,OAAO;IAAe;IAAY,MAAM;;WAC/B,WAAW;;;UAIL;EACf;;;;;UAMe,SAAS;EACxB;IACE,MAAM,cAAc;IACpB;IACA,IAAI;IACJ;;;;UAKa;EACf;IAAiB;IAAc;;;KAGrB,QACR,cACA,cACA,WACA,YACA,WACA;cAES;KASD,mBAAmB;;cAGlB;;;KAMR,UAAU,KAAK,QAAQ,GAAG;;;KAI1B;;KAGA,YACD,kCACA;;KAEC,aACD,YAAY,SAAS,4BACrB,UAAU,SAAS;;;;;;;;KASX,cAAc;EAEpB;IACE,MAAM;IACN;IACA,IAAI,SAAS;IACb;;;EAIF;IACE,MAAM;IACN;IACA,IAAI,SAAS;IACb;;;;UAKS,eAAe;EAC9B;IACE,MAAM;IACN;IACA,IAAI,SAAS;IACb;;;KAIC,YAAY,KAAK,+BAClB,cAAc,aACd,wCACuB,IACnB,eAAe,iBAAiB;;KAKnC,SAAS,GAAG,KAAK,UAAU;;;;KAK3B,YAAY,GAAG,UAAU,YACxB,SAAS,GAAG;EAAgC;OAC5C,SAAS,QAAQ;EAAgC;;;;;;;;;;KAU3C,SAAS,GAAG,UAAU,SAAS,0BAA0B,IACjE,QAEI,YAAY,KACZ,UAAU,qBACM,IAAI,cAAc,oBAClC,YAAY,GAAG,KACf,YAAY;;;;;;;;KASR,SAAS,GAAG,UAAU,SAAS,UACvC,SAAS,UAAU,IAAI,KACvB,cAAc,UAAU,IAAI;KAE3B,cAAc,GAAG,UAAU,UAAU,+BACtC,SAAS,WAAW,OACpB,sBACK,WAAW,IAAI,aAAa,EAAE,IAAI,QACrC;;;;;;;KAQD,aAAa,GAAG,UAAU,UAC3B,SAAS,UAAU,IAAI,KACvB,cAAc,QAAQ,UAAU,gBAAgB;cAMvC,mBAAiB,EAAA;;;;;;GAM5B,EAAA,KAAA;cAEW,iBAAe,EAAA;;;;;GAK1B,EAAA,KAAA;cAEW,gBAAc,EAAA;;GAEzB,EAAA,KAAA;cAEW,gBAAc,EAAA;;;;;GAKzB,EAAA,KAAA;cAEW,gBAAc,EAAA;;;;;;;;;;;;;;;;;;GAOzB,EAAA,KAAA;cAGW,mBAAmB,EAAE,QAAQ,aAAa;cAO1C,aAAa,EAAE,QAAQ,OAAO;;;iBAqB3B,WAAW,iBAAiB;iBAO5B,QAAQ;;;iBAMR,UACd,gBACA;EACG;EAAc,KAAK;;;;;iBA4OR,IAAI,UAAU,EAAE,SAC9B,QAAQ,IACP,EAAE,UAAU,GAAG,EAAE,QAAQ,OAAO,SAAS,UAAU,EAAE,MAAM;;iBAW9C,UAAU,UAAU,EAAE,SAAS,QAAQ,IAAI;KAI/C;KACA,eAAe,aAAa;;;KAI5B,gBACV,UAAU,EAAE,SACZ,IAAI,SAAS,UAAU,EAAE,MAAM,QAC7B,EAAE,QAAQ,EAAE,OAAO,IAAI,EAAE,MAAM,KAAK;;;;;KAM5B,cAAc,UAAU,EAAE,SAAS,QAAQ,MAAM,gBAAgB;;;;;;;;iBAgB7D,UAAU,UAAU,EAAE,SAAS,QAAQ,IAAI,gBAAgB;;;;iBAc3D,aAAa,UAAU,EAAE,SACvC,QAAQ,IACP,gBAAgB,GAAG"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import "./types-OXIqeH8W.js";
|
|
2
|
+
import { SignaturePolicy } from "@powerhousedao/shared/document-model";
|
|
3
|
+
import { DocumentDriveLocalState, Node } from "@powerhousedao/shared/document-drive";
|
|
4
|
+
//#region document-drive/src/types.d.ts
|
|
5
|
+
type GenerateNodesCopySrc = {
|
|
6
|
+
srcId: Node["id"];
|
|
7
|
+
targetName?: Node["name"];
|
|
8
|
+
targetParentFolder?: Node["parentFolder"];
|
|
9
|
+
};
|
|
10
|
+
type GenerateNodesCopyIdGenerator = (nodeToCopy: Node) => Node["id"];
|
|
11
|
+
type DriveInput = {
|
|
12
|
+
global: {
|
|
13
|
+
name: string;
|
|
14
|
+
icon?: string | null;
|
|
15
|
+
};
|
|
16
|
+
id?: string;
|
|
17
|
+
slug?: string;
|
|
18
|
+
preferredEditor?: string;
|
|
19
|
+
local?: Partial<DocumentDriveLocalState>;
|
|
20
|
+
/** Merged over the drive's defaults; `signature: 2` makes it v2-required. */
|
|
21
|
+
protocolVersions?: {
|
|
22
|
+
[protocol: string]: number;
|
|
23
|
+
};
|
|
24
|
+
/** Overrides the client's creation default for this drive. */
|
|
25
|
+
signaturePolicy?: SignaturePolicy;
|
|
26
|
+
};
|
|
27
|
+
type SharingType = "LOCAL" | "CLOUD" | "PUBLIC";
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region git.d.ts
|
|
30
|
+
declare const GITHUB_REPO_URL = "https://github.com/powerhouse-inc/powerhouse";
|
|
31
|
+
declare function buildTreeUrl(sha: string): string | null;
|
|
32
|
+
declare function shortGitSha(sha: string): string;
|
|
33
|
+
//#endregion
|
|
34
|
+
export { GenerateNodesCopyIdGenerator as a, DriveInput as i, buildTreeUrl as n, GenerateNodesCopySrc as o, shortGitSha as r, SharingType as s, GITHUB_REPO_URL as t };
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=index-DvbhwImT.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-DvbhwImT.d.ts","names":[],"sources":["../document-drive/src/types.ts","../git.ts"],"mappings":";;;;KAMY;EACV,OAAO;EACP,aAAa;EACb,qBAAqB;;KAGX,gCAAgC,YAAY,SAAS;KAErD;EACV;IACE;IACA;;EAEF;EACA;EACA;EACA,QAAQ,QAAQ;;EAEhB;KAAsB;;;EAEtB,kBAAkB;;KAGR;;;cC7BC;iBAEG,aAAa;iBAKb,YAAY"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { a as AnalyticsSeriesInput, c as CompoundAnalyticsExpression, d as ConversionMetric, f as IAnalyticsStore, i as AnalyticsSeries, l as CompoundAnalyticsInputs, n as AnalyticsOperand, o as AnalyticsSeriesQuery, p as MultiCurrencyConversion, r as AnalyticsQuery, s as AnalyticsUpdateCallback, t as AnalyticsDimension, u as CompoundAnalyticsQuery } from "./types-
|
|
2
|
-
import { $ as
|
|
3
|
-
import { i as PACKAGES_DEPENDENCIES, n as APPS_DEPENDENCIES, r as CLIS_DEPENDENCIES, t as ALL_POWERHOUSE_DEPENDENCIES } from "./constants-
|
|
4
|
-
import { $ as LegacySynchronizationUnit, A as TriggerData, B as
|
|
5
|
-
import { n as buildTreeUrl, r as shortGitSha, t as GITHUB_REPO_URL } from "./index-
|
|
6
|
-
export { ALL_POWERHOUSE_DEPENDENCIES, APPS_DEPENDENCIES, ActionErrorCallback, ActionSignatureContext, ActionSigningHandler, ActionVerificationHandler, Actions, AddChangeLogItemAction, AddChangeLogItemInput, AddFileAction, AddFileInput, AddFolderAction, AddFolderInput, AddListenerAction, AddListenerInput, AddModuleAction, AddModuleInput, AddOperationAction, AddOperationErrorAction, AddOperationErrorInput, AddOperationExampleAction, AddOperationExampleInput, AddOperationInput, AddRelationshipAction, AddRelationshipActionInput, AddStateExampleAction, AddStateExampleInput, AddTriggerAction, AddTriggerInput, AnalyticsDimension, AnalyticsOperand, AnalyticsQuery, AnalyticsSeries, AnalyticsSeriesInput, AnalyticsSeriesQuery, AnalyticsUpdateCallback, AssertIsDocumentOfType, AssertIsStateOfType, Author, CLIS_DEPENDENCIES, CodeExample, CompoundAnalyticsExpression, CompoundAnalyticsInputs, CompoundAnalyticsQuery, ConfigEntry, ConfigEntryType, ConversionMetric, CopyChildDocumentInput, CopyChildDocumentSignal, CopyNodeAction, CopyNodeInput, CreateChildDocumentInput, CreateChildDocumentSignal, CreateDocument, CreateDocumentAction, CreateDocumentActionInput, CreateState, DeleteChangeLogItemAction, DeleteChangeLogItemInput, DeleteChildDocumentInput, DeleteChildDocumentSignal, DeleteDocumentAction, DeleteDocumentActionInput, DeleteModuleAction, DeleteModuleInput, DeleteNodeAction, DeleteNodeInput, DeleteOperationAction, DeleteOperationErrorAction, DeleteOperationErrorInput, DeleteOperationExampleAction, DeleteOperationExampleInput, DeleteOperationInput, DeleteStateExampleAction, DeleteStateExampleInput, DocumentAction, DocumentDriveAction, DocumentDriveDocument, DocumentDriveDriveAction, DocumentDriveDriveOperations, DocumentDriveGlobalState, DocumentDriveLocalState, DocumentDriveNodeAction, DocumentDriveNodeOperations, DocumentDrivePHState, DocumentModelAction, DocumentModelDocument, DocumentModelDocumentModelModule, DocumentModelGlobalState, DocumentModelHeaderAction, DocumentModelHeaderOperations, DocumentModelInput, DocumentModelLib, DocumentModelLocalState, DocumentModelModule, DocumentModelModuleAction, DocumentModelModuleOperations, DocumentModelOperationAction, DocumentModelOperationErrorAction, DocumentModelOperationErrorOperations, DocumentModelOperationExampleAction, DocumentModelOperationExampleOperations, DocumentModelOperationOperations, DocumentModelPHState, DocumentModelStateAction, DocumentModelStateOperations, DocumentModelUtils, DocumentModelVersioningAction, DocumentModelVersioningOperations, DocumentOperationsIgnoreMap, DocumentSpecification, DriveDocumentModelModule, DriveInput, DrivePreserveStrategies, DrivePreserveStrategy, ENSInfo, EditorDispatch, EditorModule, EditorProps, Exact, FileInput, FileNode, FolderNode, GITHUB_REPO_URL, GenerateNodesCopyIdGenerator, GenerateNodesCopySrc, GetDocumentOptions, IAction, IAnalyticsStore, ID, IDocument, IOperation, IProcessor, IProcessorDispatch, IProcessorHostModuleBase, IProcessorManager, ISignal, ISignalResult, ISigner, Incremental, InputMaybe, IsDocumentOfType, IsStateOfType, LegacyAddFileAction, LegacyAddFileInput, LegacySynchronizationUnit, Listener, ListenerCallInfo, ListenerCallInfoInput, ListenerFilter, ListenerFilterInput, ListenerInput, LoadFromFile, LoadFromInput, LoadStateAction, LoadStateActionInput, LoadStateActionStateInput, Load_State, LogLevel, LogLevels, MakeEmpty, MakeMaybe, MakeOptional, Manifest, MappedOperation, Maybe, MinimalBackupData, ModuleSpecification, MoveNodeAction, MoveNodeInput, MoveOperationAction, MoveOperationInput, MultiCurrencyConversion, Mutation, MutationAddChangeLogItemInputArgs, MutationAddModuleArgs, MutationAddOperationArgs, MutationAddOperationErrorArgs, MutationAddOperationExampleArgs, MutationAddStateExampleArgs, MutationDeleteChangeLogItemInputArgs, MutationDeleteModuleArgs, MutationDeleteOperationArgs, MutationDeleteOperationErrorArgs, MutationDeleteOperationExampleArgs, MutationDeleteStateExampleArgs, MutationLoadStateArgs, MutationMoveOperationArgs, MutationPruneArgs, MutationRedoArgs, MutationReorderChangeLogItemsInputArgs, MutationReorderModuleOperationsArgs, MutationReorderModulesArgs, MutationReorderOperationErrorsArgs, MutationReorderOperationExamplesArgs, MutationReorderStateExamplesArgs, MutationSetAuthorNameArgs, MutationSetAuthorWebsiteArgs, MutationSetInitialStateArgs, MutationSetModelDescriptionArgs, MutationSetModelExtensionArgs, MutationSetModelIdArgs, MutationSetModelNameArgs, MutationSetModuleDescriptionArgs, MutationSetModuleNameArgs, MutationSetNameArgs, MutationSetOperationDescriptionArgs, MutationSetOperationErrorCodeArgs, MutationSetOperationErrorDescriptionArgs, MutationSetOperationErrorNameArgs, MutationSetOperationErrorTemplateArgs, MutationSetOperationNameArgs, MutationSetOperationReducerArgs, MutationSetOperationSchemaArgs, MutationSetOperationTemplateArgs, MutationSetStateSchemaArgs, MutationUndoArgs, MutationUpdateChangeLogItemInputArgs, MutationUpdateOperationExampleArgs, MutationUpdateStateExampleArgs, NOOPAction, Node, OperationErrorSpecification, OperationIndex, OperationSpecification, OperationsByScope, PACKAGES_DEPENDENCIES, PHConnectAi, PHConnectApp, PHConnectBranding, PHConnectDefaultDrive, PHConnectDefaultDriveLocal, PHConnectDefaultDriveRemote, PHConnectDriveSection, PHConnectDriveSections, PHConnectDrives, PHConnectInstance, PHConnectPackages, PHConnectPwa, PHConnectPwaCacheStrategy, PHConnectPwaFileHandler, PHConnectPwaIcon, PHConnectPwaManifest, PHConnectPwaRuntimeCaching, PHConnectPwaUrlPattern, PHConnectReactor, PHConnectReactorFeatureFlags, PHConnectRenown, PHConnectRenownAdapters, PHConnectRuntimeConfig, PHConnectSentry, PHPackageProvider, PHReactorRenown, PHRenownPrivyAdapterConfig, PHRenownRainbowAdapterConfig, PackageInfo, PackageListItem, PackageManagerArgs, PackagePage, ParsedCmdResult, PartialRecord, PartialState, PathValidation, PhAiToolAnnotations, PhAiToolDescriptor, PowerhouseConfig, PowerhouseModule, PowerhousePackage, ProcessorApp, ProcessorApps, ProcessorDispatchResult, ProcessorFactory, ProcessorFactoryBuilder, ProcessorFilter, ProcessorRecord, ProcessorStatus, Prune, PruneAction, PruneActionInput, Publisher, PullResponderTriggerData, PullResponderTriggerDataInput, Query, Redo, RedoAction, RedoActionInput, Reducer, ReducerOptions, RegistryPackage, RegistryPackageList, RegistryPackageMap, RegistryPackageSource, RegistryPackageStatus, ReleaseNewVersionAction, RemoveListenerAction, RemoveListenerInput, RemoveRelationshipAction, RemoveRelationshipActionInput, RemoveTriggerAction, RemoveTriggerInput, ReorderChangeLogItemsAction, ReorderChangeLogItemsInput, ReorderModuleOperationsAction, ReorderModuleOperationsInput, ReorderModulesAction, ReorderModulesInput, ReorderOperationErrorsAction, ReorderOperationErrorsInput, ReorderOperationExamplesAction, ReorderOperationExamplesInput, ReorderStateExamplesAction, ReorderStateExamplesInput, ReplayDocumentOptions, RevisionsFilter, SaveToFile, SaveToFileHandle, Scalars, SchemaLoadStateAction, SchemaNOOPAction, SchemaPruneAction, SchemaRedoAction, SchemaSetNameAction, SchemaSetPreferredEditorAction, SchemaUndoAction, ScopeState, ServiceAction, ServiceActions, SetAuthorNameAction, SetAuthorNameInput, SetAuthorWebsiteAction, SetAuthorWebsiteInput, SetAvailableOfflineAction, SetAvailableOfflineInput, SetDriveIconAction, SetDriveIconInput, SetDriveNameAction, SetDriveNameInput, SetInitialStateAction, SetInitialStateInput, SetModelDescriptionAction, SetModelDescriptionInput, SetModelExtensionAction, SetModelExtensionInput, SetModelIdAction, SetModelIdInput, SetModelNameAction, SetModelNameInput, SetModuleDescriptionAction, SetModuleDescriptionInput, SetModuleNameAction, SetModuleNameInput, SetNameAction, SetNameActionInput, SetNameOperation, SetOperationDescriptionAction, SetOperationDescriptionInput, SetOperationErrorCodeAction, SetOperationErrorCodeInput, SetOperationErrorDescriptionAction, SetOperationErrorDescriptionInput, SetOperationErrorNameAction, SetOperationErrorNameInput, SetOperationErrorTemplateAction, SetOperationErrorTemplateInput, SetOperationNameAction, SetOperationNameInput, SetOperationReducerAction, SetOperationReducerInput, SetOperationSchemaAction, SetOperationSchemaInput, SetOperationScopeAction, SetOperationScopeInput, SetOperationTemplateAction, SetOperationTemplateInput, SetPreferredEditorAction, SetPreferredEditorActionInput, SetPreferredEditorOperation, SetSharingTypeAction, SetSharingTypeInput, SetStateSchemaAction, SetStateSchemaInput, Set_Name, Set_PreferredEditor, SharingType, Signal, SignalDispatch, SignalResult, SignalResults, SignalType, SignatureVerificationHandler, SigningParameters, SkipHeaderOperationIndex, SkipHeaderOperations, State, StateReducer, SubgraphModule, TrackedProcessor, TransmitterType, Trigger, TriggerData, TriggerInput, TriggerType, Undo, UndoAction, UndoActionInput, UndoRedoAction, UpdateChangeLogItemAction, UpdateChangeLogItemInput, UpdateFileAction, UpdateFileInput, UpdateNodeAction, UpdateNodeInput, UpdateOperationExampleAction, UpdateOperationExampleInput, UpdateRelationshipAction, UpdateRelationshipActionInput, UpdateStateExampleAction, UpdateStateExampleInput, UpgradeDocumentAction, UpgradeDocumentActionInput, User, ValidationError, buildTreeUrl, shortGitSha };
|
|
1
|
+
import { a as AnalyticsSeriesInput, c as CompoundAnalyticsExpression, d as ConversionMetric, f as IAnalyticsStore, i as AnalyticsSeries, l as CompoundAnalyticsInputs, n as AnalyticsOperand, o as AnalyticsSeriesQuery, p as MultiCurrencyConversion, r as AnalyticsQuery, s as AnalyticsUpdateCallback, t as AnalyticsDimension, u as CompoundAnalyticsQuery } from "./types-Bsp8VL2y.js";
|
|
2
|
+
import { $ as ServiceActions, $a as UpdateRelationshipActionInput, $i as SetModuleDescriptionInput, $n as MoveOperationAction, $r as PhAiToolAnnotations, $t as DocumentModelDocument, A as PHConnectPwaUrlPattern, Aa as Set_Name, Ai as SaveToFileHandle, An as GetDocumentOptions, Ao as ProcessorFactoryBuilder, Ar as MutationSetModuleNameArgs, At as CreateDocument, B as PHPackageProvider, Ba as SkipHeaderOperations, Bi as SetAuthorWebsiteAction, Bn as InputMaybe, Br as MutationSetOperationTemplateArgs, Bt as DeleteModuleAction, C as PHConnectPackages, Ca as SetOperationTemplateAction, Ci as ReorderOperationExamplesAction, Cn as DocumentSpecification, Co as IProcessorDispatch, Cr as MutationSetAuthorWebsiteArgs, Ct as CodeExample, D as PHConnectPwaIcon, Da as SetPreferredEditorOperation, Di as ReplayDocumentOptions, Dn as EditorProps, Do as ProcessorApps, Dr as MutationSetModelIdArgs, Dt as CopyChildDocumentSignal, E as PHConnectPwaFileHandler, Ea as SetPreferredEditorActionInput, Ei as ReorderStateExamplesInput, En as EditorModule, Eo as ProcessorApp, Er as MutationSetModelExtensionArgs, Et as CopyChildDocumentInput, F as PHConnectRuntimeConfig, Fa as SignalResults, Fi as SchemaSetPreferredEditorAction, Fn as IOperation, Fr as MutationSetOperationErrorNameArgs, Ft as DeleteChangeLogItemInput, G as PHSchemedColor, Ga as UndoAction, Gi as SetModelDescriptionInput, Gn as MakeEmpty, Gr as MutationUpdateStateExampleArgs, Gt as DeleteOperationExampleAction, H as PHReactorRenown, Ha as StateReducer, Hi as SetInitialStateAction, Hn as IsStateOfType, Hr as MutationUndoArgs, Ht as DeleteOperationAction, I as PHConnectSentry, Ia as SignalType, Ii as SchemaUndoAction, In as ISignal, Ir as MutationSetOperationErrorTemplateArgs, It as DeleteChildDocumentInput, J as ParsedCmdResult, Ja as UpdateChangeLogItemAction, Ji as SetModelIdAction, Jn as Manifest, Jr as OperationIndex, Jt as DeleteStateExampleAction, K as PHSchemedImage, Ka as UndoActionInput, Ki as SetModelExtensionAction, Kn as MakeMaybe, Kr as NOOPAction, Kt as DeleteOperationExampleInput, L as PHEdges, La as SignatureVerificationHandler, Li as ScopeState, Ln as ISignalResult, Lr as MutationSetOperationNameArgs, Lt as DeleteChildDocumentSignal, M as PHConnectReactorFeatureFlags, Ma as Signal, Mi as SchemaNOOPAction, Mn as IAction, Mo as ProcessorRecord, Mr as MutationSetOperationDescriptionArgs, Mt as CreateDocumentActionInput, N as PHConnectRenown, Na as SignalDispatch, Ni as SchemaRedoAction, Nn as ID, No as ProcessorStatus, Nr as MutationSetOperationErrorCodeArgs, Nt as CreateState, O as PHConnectPwaManifest, Oa as SetStateSchemaAction, Oi as RevisionsFilter, On as Exact, Oo as ProcessorDispatchResult, Or as MutationSetModelNameArgs, Ot as CreateChildDocumentInput, P as PHConnectRenownAdapters, Pa as SignalResult, Pi as SchemaSetNameAction, Pn as IDocument, Po as TrackedProcessor, Pr as MutationSetOperationErrorDescriptionArgs, Pt as DeleteChangeLogItemAction, Q as ServiceAction, Qa as UpdateRelationshipAction, Qi as SetModuleDescriptionAction, Qn as ModuleSpecification, Qr as PartialState, Qt as DocumentModelAction, R as PHImageRef, Ra as SigningParameters, Ri as SetAuthorNameAction, Rn as ISigner, Rr as MutationSetOperationReducerArgs, Rt as DeleteDocumentAction, S as PHConnectOpenPanel, Sa as SetOperationScopeInput, Si as ReorderOperationErrorsInput, Sn as DocumentOperationsIgnoreMap, So as IProcessor, Sr as MutationSetAuthorNameArgs, St as Author, T as PHConnectPwaCacheStrategy, Ta as SetPreferredEditorAction, Ti as ReorderStateExamplesAction, Tn as EditorDispatch, To as IProcessorManager, Tr as MutationSetModelDescriptionArgs, Tt as ConfigEntryType, U as PHRenownPrivyAdapterConfig, Ua as SubgraphModule, Ui as SetInitialStateInput, Un as LoadFromFile, Ur as MutationUpdateChangeLogItemInputArgs, Ut as DeleteOperationErrorAction, V as PHReactorClientMode, Va as State, Vi as SetAuthorWebsiteInput, Vn as IsDocumentOfType, Vr as MutationSetStateSchemaArgs, Vt as DeleteModuleInput, W as PHRenownRainbowAdapterConfig, Wa as Undo, Wi as SetModelDescriptionAction, Wn as LoadFromInput, Wr as MutationUpdateOperationExampleArgs, Wt as DeleteOperationErrorInput, X as PowerhouseConfig, Xa as UpdateOperationExampleAction, Xi as SetModelNameAction, Xn as Maybe, Xr as OperationsByScope, Xt as DocumentAction, Y as PathValidation, Ya as UpdateChangeLogItemInput, Yi as SetModelIdInput, Yn as MappedOperation, Yr as OperationSpecification, Yt as DeleteStateExampleInput, Z as PowerhousePackage, Za as UpdateOperationExampleInput, Zi as SetModelNameInput, Zn as MinimalBackupData, Zr as PartialRecord, Zt as DocumentDispatch, _ as PHConnectDrives, _a as SetOperationReducerAction, _i as ReorderModuleOperationsAction, _n as DocumentModelStateAction, _r as MutationReorderModuleOperationsArgs, _t as AddRelationshipActionInput, a as PHBackground, aa as SetOperationDescriptionAction, ai as PurgeDocumentActionInput, an as DocumentModelLib, ao as ValidationError, ar as MutationAddOperationErrorArgs, at as Actions, b as PHConnectInstance, ba as SetOperationSchemaInput, bi as ReorderModulesInput, bn as DocumentModelVersioningAction, br as MutationReorderOperationExamplesArgs, bt as AssertIsDocumentOfType, c as PHConnectAi, ca as SetOperationErrorCodeInput, ci as RedoAction, cn as DocumentModelModuleAction, cr as MutationDeleteChangeLogItemInputArgs, ct as AddModuleAction, d as PHConnectCompositionEntry, da as SetOperationErrorNameAction, di as ReducerOptions, dn as DocumentModelOperationErrorAction, dr as MutationDeleteOperationErrorArgs, dt as AddOperationErrorAction, ea as SetModuleNameAction, ei as PhAiToolDescriptor, en as DocumentModelDocumentModelModule, eo as UpdateStateExampleAction, er as MoveOperationInput, f as PHConnectDefaultDrive, fa as SetOperationErrorNameInput, fi as ReleaseNewVersionAction, fn as DocumentModelOperationErrorOperations, fr as MutationDeleteOperationExampleArgs, ft as AddOperationErrorInput, g as PHConnectDriveSections, ga as SetOperationNameInput, gi as ReorderChangeLogItemsInput, gn as DocumentModelPHState, gr as MutationReorderChangeLogItemsInputArgs, gt as AddRelationshipAction, h as PHConnectDriveSection, ha as SetOperationNameAction, hi as ReorderChangeLogItemsAction, hn as DocumentModelOperationOperations, hr as MutationRedoArgs, ht as AddOperationInput, i as LogLevels, ia as SetNameOperation, ii as PurgeDocumentAction, in as DocumentModelInput, io as User, ir as MutationAddOperationArgs, it as ActionVerificationHandler, j as PHConnectReactor, ja as Set_PreferredEditor, ji as Scalars, jn as HostedEditorProps, jo as ProcessorFilter, jr as MutationSetNameArgs, jt as CreateDocumentAction, k as PHConnectPwaRuntimeCaching, ka as SetStateSchemaInput, ki as SaveToFile, kn as FileInput, ko as ProcessorFactory, kr as MutationSetModuleDescriptionArgs, kt as CreateChildDocumentSignal, l as PHConnectApp, la as SetOperationErrorDescriptionAction, li as RedoActionInput, ln as DocumentModelModuleOperations, lr as MutationDeleteModuleArgs, lt as AddModuleInput, m as PHConnectDefaultDriveRemote, ma as SetOperationErrorTemplateInput, mi as RemoveRelationshipActionInput, mn as DocumentModelOperationExampleOperations, mr as MutationMoveOperationArgs, mt as AddOperationExampleInput, n as DrivePreserveStrategy, na as SetNameAction, ni as PowerhouseModule, nn as DocumentModelHeaderAction, no as UpgradeDocumentAction, nr as MutationAddChangeLogItemInputArgs, nt as ActionSignatureContext, o as PHBackgroundLayer, oa as SetOperationDescriptionInput, oi as Query, on as DocumentModelLocalState, or as MutationAddOperationExampleArgs, ot as AddChangeLogItemAction, p as PHConnectDefaultDriveLocal, pa as SetOperationErrorTemplateAction, pi as RemoveRelationshipAction, pn as DocumentModelOperationExampleAction, pr as MutationDeleteStateExampleArgs, pt as AddOperationExampleAction, q as PackageManagerArgs, qa as UndoRedoAction, qi as SetModelExtensionInput, qn as MakeOptional, qr as OperationErrorSpecification, qt as DeleteOperationInput, r as LogLevel, ra as SetNameActionInput, ri as Publisher, rn as DocumentModelHeaderOperations, ro as UpgradeDocumentActionInput, rr as MutationAddModuleArgs, rt as ActionSigningHandler, s as PHBackgroundLayers, sa as SetOperationErrorCodeAction, si as Redo, sn as DocumentModelModule, sr as MutationAddStateExampleArgs, st as AddChangeLogItemInput, t as DrivePreserveStrategies, ta as SetModuleNameInput, ti as PieceModule, tn as DocumentModelGlobalState, to as UpdateStateExampleInput, tr as Mutation, tt as ActionErrorCallback, u as PHConnectBranding, ua as SetOperationErrorDescriptionInput, ui as Reducer, un as DocumentModelOperationAction, ur as MutationDeleteOperationArgs, ut as AddOperationAction, v as PHConnectExplorerIcons, va as SetOperationReducerInput, vi as ReorderModuleOperationsInput, vn as DocumentModelStateOperations, vr as MutationReorderModulesArgs, vt as AddStateExampleAction, w as PHConnectPwa, wa as SetOperationTemplateInput, wi as ReorderOperationExamplesInput, wn as ENSInfo, wo as IProcessorHostModuleBase, wr as MutationSetInitialStateArgs, wt as ConfigEntry, x as PHConnectLoader, xa as SetOperationScopeAction, xi as ReorderOperationErrorsAction, xn as DocumentModelVersioningOperations, xr as MutationReorderStateExamplesArgs, xt as AssertIsStateOfType, y as PHConnectHome, ya as SetOperationSchemaAction, yi as ReorderModulesAction, yn as DocumentModelUtils, yr as MutationReorderOperationErrorsArgs, yt as AddStateExampleInput, z as PHLength, za as SkipHeaderOperationIndex, zi as SetAuthorNameInput, zn as Incremental, zr as MutationSetOperationSchemaArgs, zt as DeleteDocumentActionInput } from "./types-BpO4LIKj.js";
|
|
3
|
+
import { i as PACKAGES_DEPENDENCIES, n as APPS_DEPENDENCIES, r as CLIS_DEPENDENCIES, t as ALL_POWERHOUSE_DEPENDENCIES } from "./constants-CcaK3k1D.js";
|
|
4
|
+
import { $ as LegacySynchronizationUnit, A as TriggerData, B as PackagePage, C as RemoveTriggerInput, D as SetSharingTypeInput, E as SetDriveNameInput, F as PACKAGE_MODULE_TYPES, G as RegistryPackageSource, H as RegistryPackage, I as PackageFacets, J as DriveDocumentModelModule, K as RegistryPackageStatus, L as PackageInfo, M as TriggerType, N as UpdateFileInput, O as TransmitterType, P as UpdateNodeInput, Q as LegacyAddFileInput, R as PackageListItem, S as RemoveListenerInput, T as SetDriveIconInput, U as RegistryPackageList, V as Page, W as RegistryPackageMap, X as DocumentDriveDocument, Y as DocumentDriveAction, Z as LegacyAddFileAction, _ as ListenerInput, _t as SetDriveNameAction, a as CopyNodeInput, at as DocumentDriveNodeOperations, b as PullResponderTriggerData, c as DocumentDriveLocalState, ct as UpdateNodeAction, d as FolderNode, dt as DocumentDriveDriveAction, et as AddFileAction, f as Listener, ft as DocumentDriveDriveOperations, g as ListenerFilterInput, gt as SetDriveIconAction, h as ListenerFilter, ht as SetAvailableOfflineAction, i as AddTriggerInput, it as DocumentDriveNodeAction, j as TriggerInput, k as Trigger, lt as AddListenerAction, m as ListenerCallInfoInput, mt as RemoveTriggerAction, n as AddFolderInput, nt as CopyNodeAction, o as DeleteNodeInput, ot as MoveNodeAction, p as ListenerCallInfo, pt as RemoveListenerAction, q as DocumentDrivePHState, r as AddListenerInput, rt as DeleteNodeAction, s as DocumentDriveGlobalState, st as UpdateFileAction, t as AddFileInput, tt as AddFolderAction, u as FileNode, ut as AddTriggerAction, v as MoveNodeInput, vt as SetSharingTypeAction, w as SetAvailableOfflineInput, x as PullResponderTriggerDataInput, y as Node, z as PackageModuleType } from "./types-OXIqeH8W.js";
|
|
5
|
+
import { a as GenerateNodesCopyIdGenerator, i as DriveInput, n as buildTreeUrl, o as GenerateNodesCopySrc, r as shortGitSha, s as SharingType, t as GITHUB_REPO_URL } from "./index-DvbhwImT.js";
|
|
6
|
+
export { ALL_POWERHOUSE_DEPENDENCIES, APPS_DEPENDENCIES, type ActionErrorCallback, type ActionSignatureContext, type ActionSigningHandler, type ActionVerificationHandler, type Actions, type AddChangeLogItemAction, type AddChangeLogItemInput, type AddFileAction, type AddFileInput, type AddFolderAction, type AddFolderInput, type AddListenerAction, type AddListenerInput, type AddModuleAction, type AddModuleInput, type AddOperationAction, type AddOperationErrorAction, type AddOperationErrorInput, type AddOperationExampleAction, type AddOperationExampleInput, type AddOperationInput, type AddRelationshipAction, type AddRelationshipActionInput, type AddStateExampleAction, type AddStateExampleInput, type AddTriggerAction, type AddTriggerInput, type AnalyticsDimension, type AnalyticsOperand, type AnalyticsQuery, type AnalyticsSeries, type AnalyticsSeriesInput, type AnalyticsSeriesQuery, type AnalyticsUpdateCallback, type AssertIsDocumentOfType, type AssertIsStateOfType, type Author, CLIS_DEPENDENCIES, type CodeExample, type CompoundAnalyticsExpression, type CompoundAnalyticsInputs, type CompoundAnalyticsQuery, type ConfigEntry, type ConfigEntryType, type ConversionMetric, type CopyChildDocumentInput, type CopyChildDocumentSignal, type CopyNodeAction, type CopyNodeInput, type CreateChildDocumentInput, type CreateChildDocumentSignal, type CreateDocument, type CreateDocumentAction, type CreateDocumentActionInput, type CreateState, type DeleteChangeLogItemAction, type DeleteChangeLogItemInput, type DeleteChildDocumentInput, type DeleteChildDocumentSignal, type DeleteDocumentAction, type DeleteDocumentActionInput, type DeleteModuleAction, type DeleteModuleInput, type DeleteNodeAction, type DeleteNodeInput, type DeleteOperationAction, type DeleteOperationErrorAction, type DeleteOperationErrorInput, type DeleteOperationExampleAction, type DeleteOperationExampleInput, type DeleteOperationInput, type DeleteStateExampleAction, type DeleteStateExampleInput, type DocumentAction, type DocumentDispatch, type DocumentDriveAction, type DocumentDriveDocument, type DocumentDriveDriveAction, type DocumentDriveDriveOperations, type DocumentDriveGlobalState, type DocumentDriveLocalState, type DocumentDriveNodeAction, type DocumentDriveNodeOperations, type DocumentDrivePHState, type DocumentModelAction, type DocumentModelDocument, type DocumentModelDocumentModelModule, type DocumentModelGlobalState, type DocumentModelHeaderAction, type DocumentModelHeaderOperations, type DocumentModelInput, type DocumentModelLib, type DocumentModelLocalState, type DocumentModelModule, type DocumentModelModuleAction, type DocumentModelModuleOperations, type DocumentModelOperationAction, type DocumentModelOperationErrorAction, type DocumentModelOperationErrorOperations, type DocumentModelOperationExampleAction, type DocumentModelOperationExampleOperations, type DocumentModelOperationOperations, type DocumentModelPHState, type DocumentModelStateAction, type DocumentModelStateOperations, type DocumentModelUtils, type DocumentModelVersioningAction, type DocumentModelVersioningOperations, type DocumentOperationsIgnoreMap, type DocumentSpecification, type DriveDocumentModelModule, type DriveInput, type DrivePreserveStrategies, type DrivePreserveStrategy, type ENSInfo, type EditorDispatch, type EditorModule, type EditorProps, type Exact, type FileInput, type FileNode, type FolderNode, GITHUB_REPO_URL, type GenerateNodesCopyIdGenerator, type GenerateNodesCopySrc, type GetDocumentOptions, type HostedEditorProps, type IAction, type IAnalyticsStore, type ID, type IDocument, type IOperation, type IProcessor, type IProcessorDispatch, type IProcessorHostModuleBase, type IProcessorManager, type ISignal, type ISignalResult, type ISigner, type Incremental, type InputMaybe, type IsDocumentOfType, type IsStateOfType, type LegacyAddFileAction, type LegacyAddFileInput, type LegacySynchronizationUnit, type Listener, type ListenerCallInfo, type ListenerCallInfoInput, type ListenerFilter, type ListenerFilterInput, type ListenerInput, type LoadFromFile, type LoadFromInput, type LogLevel, type LogLevels, type MakeEmpty, type MakeMaybe, type MakeOptional, type Manifest, type MappedOperation, type Maybe, type MinimalBackupData, type ModuleSpecification, type MoveNodeAction, type MoveNodeInput, type MoveOperationAction, type MoveOperationInput, type MultiCurrencyConversion, type Mutation, type MutationAddChangeLogItemInputArgs, type MutationAddModuleArgs, type MutationAddOperationArgs, type MutationAddOperationErrorArgs, type MutationAddOperationExampleArgs, type MutationAddStateExampleArgs, type MutationDeleteChangeLogItemInputArgs, type MutationDeleteModuleArgs, type MutationDeleteOperationArgs, type MutationDeleteOperationErrorArgs, type MutationDeleteOperationExampleArgs, type MutationDeleteStateExampleArgs, type MutationMoveOperationArgs, type MutationRedoArgs, type MutationReorderChangeLogItemsInputArgs, type MutationReorderModuleOperationsArgs, type MutationReorderModulesArgs, type MutationReorderOperationErrorsArgs, type MutationReorderOperationExamplesArgs, type MutationReorderStateExamplesArgs, type MutationSetAuthorNameArgs, type MutationSetAuthorWebsiteArgs, type MutationSetInitialStateArgs, type MutationSetModelDescriptionArgs, type MutationSetModelExtensionArgs, type MutationSetModelIdArgs, type MutationSetModelNameArgs, type MutationSetModuleDescriptionArgs, type MutationSetModuleNameArgs, type MutationSetNameArgs, type MutationSetOperationDescriptionArgs, type MutationSetOperationErrorCodeArgs, type MutationSetOperationErrorDescriptionArgs, type MutationSetOperationErrorNameArgs, type MutationSetOperationErrorTemplateArgs, type MutationSetOperationNameArgs, type MutationSetOperationReducerArgs, type MutationSetOperationSchemaArgs, type MutationSetOperationTemplateArgs, type MutationSetStateSchemaArgs, type MutationUndoArgs, type MutationUpdateChangeLogItemInputArgs, type MutationUpdateOperationExampleArgs, type MutationUpdateStateExampleArgs, type NOOPAction, type Node, type OperationErrorSpecification, type OperationIndex, type OperationSpecification, type OperationsByScope, PACKAGES_DEPENDENCIES, type PACKAGE_MODULE_TYPES, type PHBackground, type PHBackgroundLayer, type PHBackgroundLayers, type PHConnectAi, type PHConnectApp, type PHConnectBranding, type PHConnectCompositionEntry, type PHConnectDefaultDrive, type PHConnectDefaultDriveLocal, type PHConnectDefaultDriveRemote, type PHConnectDriveSection, type PHConnectDriveSections, type PHConnectDrives, type PHConnectExplorerIcons, type PHConnectHome, type PHConnectInstance, type PHConnectLoader, type PHConnectOpenPanel, type PHConnectPackages, type PHConnectPwa, type PHConnectPwaCacheStrategy, type PHConnectPwaFileHandler, type PHConnectPwaIcon, type PHConnectPwaManifest, type PHConnectPwaRuntimeCaching, type PHConnectPwaUrlPattern, type PHConnectReactor, type PHConnectReactorFeatureFlags, type PHConnectRenown, type PHConnectRenownAdapters, type PHConnectRuntimeConfig, type PHConnectSentry, type PHEdges, type PHImageRef, type PHLength, type PHPackageProvider, type PHReactorClientMode, type PHReactorRenown, type PHRenownPrivyAdapterConfig, type PHRenownRainbowAdapterConfig, type PHSchemedColor, type PHSchemedImage, type PackageFacets, type PackageInfo, type PackageListItem, type PackageManagerArgs, type PackageModuleType, type PackagePage, type Page, type ParsedCmdResult, type PartialRecord, type PartialState, type PathValidation, type PhAiToolAnnotations, type PhAiToolDescriptor, type PieceModule, type PowerhouseConfig, type PowerhouseModule, type PowerhousePackage, type ProcessorApp, type ProcessorApps, type ProcessorDispatchResult, type ProcessorFactory, type ProcessorFactoryBuilder, type ProcessorFilter, type ProcessorRecord, type ProcessorStatus, type Publisher, type PullResponderTriggerData, type PullResponderTriggerDataInput, type PurgeDocumentAction, type PurgeDocumentActionInput, type Query, type Redo, type RedoAction, type RedoActionInput, type Reducer, type ReducerOptions, type RegistryPackage, type RegistryPackageList, type RegistryPackageMap, type RegistryPackageSource, type RegistryPackageStatus, type ReleaseNewVersionAction, type RemoveListenerAction, type RemoveListenerInput, type RemoveRelationshipAction, type RemoveRelationshipActionInput, type RemoveTriggerAction, type RemoveTriggerInput, type ReorderChangeLogItemsAction, type ReorderChangeLogItemsInput, type ReorderModuleOperationsAction, type ReorderModuleOperationsInput, type ReorderModulesAction, type ReorderModulesInput, type ReorderOperationErrorsAction, type ReorderOperationErrorsInput, type ReorderOperationExamplesAction, type ReorderOperationExamplesInput, type ReorderStateExamplesAction, type ReorderStateExamplesInput, type ReplayDocumentOptions, type RevisionsFilter, type SaveToFile, type SaveToFileHandle, type Scalars, type SchemaNOOPAction, type SchemaRedoAction, type SchemaSetNameAction, type SchemaSetPreferredEditorAction, type SchemaUndoAction, type ScopeState, type ServiceAction, type ServiceActions, type SetAuthorNameAction, type SetAuthorNameInput, type SetAuthorWebsiteAction, type SetAuthorWebsiteInput, type SetAvailableOfflineAction, type SetAvailableOfflineInput, type SetDriveIconAction, type SetDriveIconInput, type SetDriveNameAction, type SetDriveNameInput, type SetInitialStateAction, type SetInitialStateInput, type SetModelDescriptionAction, type SetModelDescriptionInput, type SetModelExtensionAction, type SetModelExtensionInput, type SetModelIdAction, type SetModelIdInput, type SetModelNameAction, type SetModelNameInput, type SetModuleDescriptionAction, type SetModuleDescriptionInput, type SetModuleNameAction, type SetModuleNameInput, type SetNameAction, type SetNameActionInput, type SetNameOperation, type SetOperationDescriptionAction, type SetOperationDescriptionInput, type SetOperationErrorCodeAction, type SetOperationErrorCodeInput, type SetOperationErrorDescriptionAction, type SetOperationErrorDescriptionInput, type SetOperationErrorNameAction, type SetOperationErrorNameInput, type SetOperationErrorTemplateAction, type SetOperationErrorTemplateInput, type SetOperationNameAction, type SetOperationNameInput, type SetOperationReducerAction, type SetOperationReducerInput, type SetOperationSchemaAction, type SetOperationSchemaInput, type SetOperationScopeAction, type SetOperationScopeInput, type SetOperationTemplateAction, type SetOperationTemplateInput, type SetPreferredEditorAction, type SetPreferredEditorActionInput, type SetPreferredEditorOperation, type SetSharingTypeAction, type SetSharingTypeInput, type SetStateSchemaAction, type SetStateSchemaInput, type Set_Name, type Set_PreferredEditor, type SharingType, type Signal, type SignalDispatch, type SignalResult, type SignalResults, type SignalType, type SignatureVerificationHandler, type SigningParameters, type SkipHeaderOperationIndex, type SkipHeaderOperations, type State, type StateReducer, type SubgraphModule, type TrackedProcessor, type TransmitterType, type Trigger, type TriggerData, type TriggerInput, type TriggerType, type Undo, type UndoAction, type UndoActionInput, type UndoRedoAction, type UpdateChangeLogItemAction, type UpdateChangeLogItemInput, type UpdateFileAction, type UpdateFileInput, type UpdateNodeAction, type UpdateNodeInput, type UpdateOperationExampleAction, type UpdateOperationExampleInput, type UpdateRelationshipAction, type UpdateRelationshipActionInput, type UpdateStateExampleAction, type UpdateStateExampleInput, type UpgradeDocumentAction, type UpgradeDocumentActionInput, type User, type ValidationError, buildTreeUrl, shortGitSha };
|
|
7
|
+
export {};
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../git.ts"],"sourcesContent":["export const GITHUB_REPO_URL = \"https://github.com/powerhouse-inc/powerhouse\";\n\nexport function buildTreeUrl(sha: string): string | null {\n if (!sha || sha === \"unknown\") return null;\n return `${GITHUB_REPO_URL}/tree/${sha}`;\n}\n\nexport function shortGitSha(sha: string): string {\n return sha === \"unknown\" ? sha : sha.slice(0, 7);\n}\n"],"mappings":";;AAAA,MAAa,kBAAkB;AAE/B,SAAgB,aAAa,KAA4B;
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../git.ts"],"sourcesContent":["export const GITHUB_REPO_URL = \"https://github.com/powerhouse-inc/powerhouse\";\n\nexport function buildTreeUrl(sha: string): string | null {\n if (!sha || sha === \"unknown\") return null;\n return `${GITHUB_REPO_URL}/tree/${sha}`;\n}\n\nexport function shortGitSha(sha: string): string {\n return sha === \"unknown\" ? sha : sha.slice(0, 7);\n}\n"],"mappings":";;AAAA,MAAa,kBAAkB;AAE/B,SAAgB,aAAa,KAA4B;CACvD,IAAI,CAAC,OAAO,QAAQ,WAAW,OAAO;CACtC,OAAO,GAAG,gBAAgB,QAAQ;AACpC;AAEA,SAAgB,YAAY,KAAqB;CAC/C,OAAO,QAAQ,YAAY,MAAM,IAAI,MAAM,GAAG,CAAC;AACjD"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { $
|
|
2
|
-
export { AuthorizerResult, DEFAULT_ANALYTICS_PROCESSOR_DB_NAME, DEFAULT_RELATIONAL_PROCESSOR_DB_NAME, ExtractProcessorSchemaOrSelf, HashAlgorithms, IBaseRelationalDb, IHttpScope, IProcessor, IProcessorDispatch, IProcessorHostModuleBase, IProcessorManager, IRelationalDb, IRelationalDbProcessor, IRelationalQueryBuilder, IRelationalQueryMethods, IWebhookEndpoints, IWebhookScope, NodeRouteSpec, PROCESSOR_APPS, ProcessorApp, ProcessorApps, ProcessorDispatchResult, ProcessorFactory, ProcessorFactoryBuilder, ProcessorFilter, ProcessorRecord, ProcessorStatus, RelationalDbProcessor, RelationalDbProcessorClass, RouteActor, RouteAuth, RouteAuthorizer, RouteBody, RouteContext, RouteHandler, RouteMethod, RouteOptions, RouteSpec, RouteTransport, RouteUser, ScopedRouteHandle, TrackedProcessor, WebhookEndpointInfo, WebhookField, WebhookHashAlgorithm, WebhookPolicy, WebhookReply, WebhookRequest, WebhookScheme, WebhookSignatureEncoding, WebhookSpec, WebhookVerification, createNamespacedDb, createNamespacedQueryBuilder, createRelationalDb, hashNamespace, relationalDbToQueryBuilder };
|
|
1
|
+
import { $o as WebhookField, Ao as ProcessorFactoryBuilder, Bo as RouteActor, Co as IProcessorDispatch, Do as ProcessorApps, Eo as ProcessorApp, Fo as AuthorizerResult, Go as RouteHandler, Ho as RouteAuthorizer, Io as IHttpScope, Jo as RouteSpec, Ko as RouteMethod, Lh as DEFAULT_ANALYTICS_PROCESSOR_DB_NAME, Lo as IWebhookEndpoints, Mo as ProcessorRecord, No as ProcessorStatus, Oo as ProcessorDispatchResult, Po as TrackedProcessor, Qo as WebhookEndpointInfo, Rh as DEFAULT_RELATIONAL_PROCESSOR_DB_NAME, Ro as IWebhookScope, So as IProcessor, To as IProcessorManager, Uo as RouteBody, Vo as RouteAuth, Wo as RouteContext, Xo as RouteUser, Yo as RouteTransport, Zo as ScopedRouteHandle, _o as IRelationalDbProcessor, as as WebhookSignatureEncoding, bo as RelationalDbProcessor, co as createRelationalDb, cs as deletedDocumentId, do as relationalDbToQueryBuilder, es as WebhookHashAlgorithm, fo as DOCUMENT_ID_COLUMNS, go as IRelationalDb, ho as IBaseRelationalDb, is as WebhookScheme, jo as ProcessorFilter, ko as ProcessorFactory, lo as hashNamespace, mo as HashAlgorithms, ns as WebhookReply, oo as createNamespacedDb, os as WebhookSpec, po as ExtractProcessorSchemaOrSelf, qo as RouteOptions, rs as WebhookRequest, so as createNamespacedQueryBuilder, ss as WebhookVerification, ts as WebhookPolicy, uo as namespaceSchemaOf, vo as IRelationalQueryBuilder, wo as IProcessorHostModuleBase, xo as RelationalDbProcessorClass, yo as IRelationalQueryMethods, zh as PROCESSOR_APPS, zo as NodeRouteSpec } from "../types-BpO4LIKj.js";
|
|
2
|
+
export { type AuthorizerResult, DEFAULT_ANALYTICS_PROCESSOR_DB_NAME, DEFAULT_RELATIONAL_PROCESSOR_DB_NAME, DOCUMENT_ID_COLUMNS, ExtractProcessorSchemaOrSelf, HashAlgorithms, IBaseRelationalDb, type IHttpScope, type IProcessor, type IProcessorDispatch, type IProcessorHostModuleBase, type IProcessorManager, IRelationalDb, IRelationalDbProcessor, IRelationalQueryBuilder, IRelationalQueryMethods, type IWebhookEndpoints, type IWebhookScope, type NodeRouteSpec, PROCESSOR_APPS, type ProcessorApp, type ProcessorApps, type ProcessorDispatchResult, type ProcessorFactory, type ProcessorFactoryBuilder, type ProcessorFilter, type ProcessorRecord, type ProcessorStatus, RelationalDbProcessor, RelationalDbProcessorClass, type RouteActor, type RouteAuth, type RouteAuthorizer, type RouteBody, type RouteContext, type RouteHandler, type RouteMethod, type RouteOptions, type RouteSpec, type RouteTransport, type RouteUser, type ScopedRouteHandle, type TrackedProcessor, type WebhookEndpointInfo, type WebhookField, type WebhookHashAlgorithm, type WebhookPolicy, type WebhookReply, type WebhookRequest, type WebhookScheme, type WebhookSignatureEncoding, type WebhookSpec, type WebhookVerification, createNamespacedDb, createNamespacedQueryBuilder, createRelationalDb, deletedDocumentId, hashNamespace, namespaceSchemaOf, relationalDbToQueryBuilder };
|
|
3
|
+
export {};
|
package/dist/processors/index.js
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
|
+
import "../purge-v06m_oGz.js";
|
|
2
|
+
import { sql } from "kysely";
|
|
1
3
|
import fnv1a from "@sindresorhus/fnv1a";
|
|
2
4
|
//#region processors/constants.ts
|
|
3
5
|
const PROCESSOR_APPS = ["connect", "switchboard"];
|
|
4
6
|
const DEFAULT_RELATIONAL_PROCESSOR_DB_NAME = "relational-db";
|
|
5
7
|
const DEFAULT_ANALYTICS_PROCESSOR_DB_NAME = "analytics-db";
|
|
6
8
|
//#endregion
|
|
9
|
+
//#region processors/deletion.ts
|
|
10
|
+
/** The id a DELETE_DOCUMENT or PURGE_DOCUMENT removes; undefined otherwise. */
|
|
11
|
+
function deletedDocumentId(op) {
|
|
12
|
+
const { type, input } = op.operation.action;
|
|
13
|
+
if (type !== "DELETE_DOCUMENT" && type !== "PURGE_DOCUMENT") return void 0;
|
|
14
|
+
const documentId = input?.documentId;
|
|
15
|
+
return typeof documentId === "string" ? documentId : op.context.documentId;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
7
18
|
//#region processors/relational/utils.ts
|
|
8
19
|
const SUPPORTED_SIZES = [
|
|
9
20
|
32,
|
|
@@ -23,7 +34,8 @@ const LOG2_26 = Math.log2(26);
|
|
|
23
34
|
*/
|
|
24
35
|
function hashNamespace(str, length = 10) {
|
|
25
36
|
const requiredBits = Math.ceil(length * LOG2_26);
|
|
26
|
-
|
|
37
|
+
const bitSize = SUPPORTED_SIZES.find((size) => size && size >= requiredBits) ?? 1024;
|
|
38
|
+
return toBase26(fnv1a(str, { size: bitSize }), length);
|
|
27
39
|
}
|
|
28
40
|
function toBase26(num, length = 10) {
|
|
29
41
|
const alphabet = "abcdefghijklmnopqrstuvwxyz";
|
|
@@ -49,7 +61,14 @@ function createRelationalDb(baseDb, baseOptions) {
|
|
|
49
61
|
async function createNamespacedDb(db, namespace, options) {
|
|
50
62
|
const hashValue = options?.hashNamespace ?? true ? hashNamespace(namespace) : namespace;
|
|
51
63
|
await db.schema.createSchema(hashValue).ifNotExists().execute();
|
|
52
|
-
|
|
64
|
+
const schemaRelationalDb = db.withSchema(hashValue);
|
|
65
|
+
Object.defineProperty(schemaRelationalDb, NAMESPACE_SCHEMA, { value: hashValue });
|
|
66
|
+
return schemaRelationalDb;
|
|
67
|
+
}
|
|
68
|
+
const NAMESPACE_SCHEMA = Symbol.for("ph.relational.namespaceSchema");
|
|
69
|
+
/** The schema behind a handle from `createNamespace`; undefined otherwise. */
|
|
70
|
+
function namespaceSchemaOf(db) {
|
|
71
|
+
return db[NAMESPACE_SCHEMA];
|
|
53
72
|
}
|
|
54
73
|
function createNamespacedQueryBuilder(db, namespace, options) {
|
|
55
74
|
const hashValue = options?.hashNamespace ?? true ? hashNamespace(namespace) : namespace;
|
|
@@ -71,6 +90,8 @@ function relationalDbToQueryBuilder(query) {
|
|
|
71
90
|
}
|
|
72
91
|
//#endregion
|
|
73
92
|
//#region processors/relational/types.ts
|
|
93
|
+
/** Columns {@link RelationalDbProcessor.deleteDocumentRows} matches. */
|
|
94
|
+
const DOCUMENT_ID_COLUMNS = ["document_id", "documentId"];
|
|
74
95
|
const IS_RELATIONAL_DB_PROCESSOR = Symbol.for("ph.IS_RELATIONAL_DB_PROCESSOR");
|
|
75
96
|
/**
|
|
76
97
|
* Base class for relational db processors that require a relational database storage.
|
|
@@ -78,10 +99,15 @@ const IS_RELATIONAL_DB_PROCESSOR = Symbol.for("ph.IS_RELATIONAL_DB_PROCESSOR");
|
|
|
78
99
|
* allowing derived classes to focus on business logic.
|
|
79
100
|
*/
|
|
80
101
|
var RelationalDbProcessor = class {
|
|
81
|
-
|
|
102
|
+
_namespace;
|
|
103
|
+
_filter;
|
|
104
|
+
relationalDb;
|
|
105
|
+
_driveId;
|
|
106
|
+
constructor(_namespace, _filter, relationalDb, _driveId) {
|
|
82
107
|
this._namespace = _namespace;
|
|
83
108
|
this._filter = _filter;
|
|
84
109
|
this.relationalDb = relationalDb;
|
|
110
|
+
this._driveId = _driveId;
|
|
85
111
|
}
|
|
86
112
|
static [IS_RELATIONAL_DB_PROCESSOR] = true;
|
|
87
113
|
/**
|
|
@@ -110,8 +136,41 @@ var RelationalDbProcessor = class {
|
|
|
110
136
|
get query() {
|
|
111
137
|
return relationalDbToQueryBuilder(this.relationalDb);
|
|
112
138
|
}
|
|
139
|
+
/** True for this processor's drive when its namespace is that drive's alone. */
|
|
140
|
+
isNamespaceDrive(documentId) {
|
|
141
|
+
const driveId = this._driveId;
|
|
142
|
+
if (driveId === void 0 || documentId !== driveId) return false;
|
|
143
|
+
const processorClass = this.constructor;
|
|
144
|
+
if (processorClass.getNamespace(driveId) !== this._namespace) return false;
|
|
145
|
+
return processorClass.getNamespace(`${driveId}-other`) !== this._namespace;
|
|
146
|
+
}
|
|
147
|
+
/** Deletes a document's rows from every table with a document-id column. */
|
|
148
|
+
async deleteDocumentRows(documentId) {
|
|
149
|
+
const schema = this.namespaceSchema();
|
|
150
|
+
const columns = await sql`
|
|
151
|
+
select c.table_name, c.column_name
|
|
152
|
+
from information_schema.columns c
|
|
153
|
+
join information_schema.tables t
|
|
154
|
+
on t.table_schema = c.table_schema and t.table_name = c.table_name
|
|
155
|
+
where c.table_schema = ${schema}
|
|
156
|
+
and t.table_type = 'BASE TABLE'
|
|
157
|
+
and c.column_name in (${sql.join([...DOCUMENT_ID_COLUMNS])})
|
|
158
|
+
order by c.table_name, c.column_name
|
|
159
|
+
`.execute(this.relationalDb);
|
|
160
|
+
const db = this.relationalDb;
|
|
161
|
+
for (const { table_name, column_name } of columns.rows) await db.deleteFrom(table_name).where(column_name, "=", documentId).execute();
|
|
162
|
+
}
|
|
163
|
+
/** Drops this processor's namespace and every table in it. */
|
|
164
|
+
async dropNamespace() {
|
|
165
|
+
await this.relationalDb.schema.dropSchema(this.namespaceSchema()).ifExists().cascade().execute();
|
|
166
|
+
}
|
|
167
|
+
namespaceSchema() {
|
|
168
|
+
const schema = namespaceSchemaOf(this.relationalDb);
|
|
169
|
+
if (schema === void 0) throw new Error(`Namespace '${this._namespace}' was not opened with createNamespace`);
|
|
170
|
+
return schema;
|
|
171
|
+
}
|
|
113
172
|
};
|
|
114
173
|
//#endregion
|
|
115
|
-
export { DEFAULT_ANALYTICS_PROCESSOR_DB_NAME, DEFAULT_RELATIONAL_PROCESSOR_DB_NAME, PROCESSOR_APPS, RelationalDbProcessor, createNamespacedDb, createNamespacedQueryBuilder, createRelationalDb, hashNamespace, relationalDbToQueryBuilder };
|
|
174
|
+
export { DEFAULT_ANALYTICS_PROCESSOR_DB_NAME, DEFAULT_RELATIONAL_PROCESSOR_DB_NAME, DOCUMENT_ID_COLUMNS, PROCESSOR_APPS, RelationalDbProcessor, createNamespacedDb, createNamespacedQueryBuilder, createRelationalDb, deletedDocumentId, hashNamespace, namespaceSchemaOf, relationalDbToQueryBuilder };
|
|
116
175
|
|
|
117
176
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../processors/constants.ts","../../processors/relational/utils.ts","../../processors/relational/types.ts"],"sourcesContent":["export const PROCESSOR_APPS = [\"connect\", \"switchboard\"] as const;\nexport const DEFAULT_RELATIONAL_PROCESSOR_DB_NAME = \"relational-db\";\nexport const DEFAULT_ANALYTICS_PROCESSOR_DB_NAME = \"analytics-db\";\n","import type { Options } from \"@sindresorhus/fnv1a\";\nimport fnv1a from \"@sindresorhus/fnv1a\";\nimport type {\n IBaseRelationalDb,\n IRelationalDb,\n IRelationalQueryBuilder,\n} from \"./types.js\";\n\nconst SUPPORTED_SIZES: Options[\"size\"][] = [32, 64, 128, 256, 512, 1024];\nconst LOG2_26 = Math.log2(26); //\n/**\n * Hashes a string to a lowercase base-26 string.\n * @param str The string to hash.\n * @param length The length of the hash. Defaults to 10.\n * @param algorithm The hashing algorithm to use. Defaults to \"fnv1a\".\n * @returns The hashed string.\n */\nexport function hashNamespace(str: string, length = 10) {\n const requiredBits = Math.ceil(length * LOG2_26);\n const bitSize =\n SUPPORTED_SIZES.find((size) => size && size >= requiredBits) ?? 1024;\n const hash = fnv1a(str, { size: bitSize });\n return toBase26(hash, length);\n}\n\n// converts hash to lowercase letters\nfunction toBase26(num: bigint, length = 10): string {\n const alphabet = \"abcdefghijklmnopqrstuvwxyz\";\n let out = \"\";\n while (num > 0n && out.length < length) {\n out = alphabet[Number(num % 26n)] + out;\n num /= 26n;\n }\n return out.padStart(length, \"a\"); // optional padding\n}\n\n/**\n * Creates a RelationalDb instance with namespace support.\n * @param baseDb The base RelationalDb instance to enhance.\n * @param baseOptions The default options for namespace creation. Hashes namespace by default.\n * @returns The enhanced RelationalDb instance.\n */\nexport function createRelationalDb<Schema>(\n baseDb: IBaseRelationalDb<Schema>,\n baseOptions?: NamespaceOptions,\n): IRelationalDb<Schema> {\n const relationalDb = baseDb as IRelationalDb<Schema>;\n\n relationalDb.createNamespace = <NamespaceSchema>(\n namespace: string,\n options?: NamespaceOptions,\n ) =>\n createNamespacedDb<NamespaceSchema>(\n baseDb,\n namespace,\n options ?? baseOptions,\n );\n\n relationalDb.queryNamespace = <NamespaceSchema>(\n namespace: string,\n options?: NamespaceOptions,\n ) =>\n createNamespacedQueryBuilder<NamespaceSchema>(\n baseDb,\n namespace,\n options ?? baseOptions,\n );\n\n return relationalDb;\n}\n\ntype NamespaceOptions = {\n hashNamespace?: boolean;\n};\n\nexport async function createNamespacedDb<Schema>(\n db: IBaseRelationalDb<any>,\n namespace: string,\n options?: NamespaceOptions,\n): Promise<IRelationalDb<Schema>> {\n // hash the namespace to avoid too long namespaces\n const shouldHash = options?.hashNamespace ?? true;\n const hashValue = shouldHash ? hashNamespace(namespace) : namespace;\n await db.schema.createSchema(hashValue).ifNotExists().execute();\n const schemaRelationalDb = db.withSchema(hashValue);\n return schemaRelationalDb as IRelationalDb<Schema>;\n}\n\nexport function createNamespacedQueryBuilder<Schema>(\n db: IBaseRelationalDb<any>,\n namespace: string,\n options?: NamespaceOptions,\n): IRelationalQueryBuilder<Schema> {\n const shouldHash = options?.hashNamespace ?? true;\n const hashValue = shouldHash ? hashNamespace(namespace) : namespace;\n const namespacedDb = db.withSchema(hashValue) as IRelationalDb<Schema>;\n return relationalDbToQueryBuilder(namespacedDb);\n}\n\n/**\n * Returns a query builder for a RelationalDb instance.\n * @param query The RelationalDb instance to convert.\n * @returns The IRelationalQueryBuilder instance.\n */\nexport function relationalDbToQueryBuilder<TSchema>(\n query: IBaseRelationalDb<TSchema>,\n): IRelationalQueryBuilder<TSchema> {\n return {\n selectFrom: query.selectFrom.bind(query),\n selectNoFrom: query.selectNoFrom.bind(query),\n with: query.with.bind(query),\n withRecursive: query.withRecursive.bind(query),\n withSchema: (schema: string) =>\n relationalDbToQueryBuilder<TSchema>(query.withSchema(schema)),\n };\n}\n","import type { OperationWithContext } from \"@powerhousedao/shared/document-model\";\nimport type { Kysely, QueryCreator } from \"kysely\";\nimport type { IProcessor, ProcessorFilter } from \"../types.js\";\nimport { relationalDbToQueryBuilder } from \"./utils.js\";\n\nexport type IRelationalQueryMethods =\n | \"selectFrom\"\n | \"selectNoFrom\"\n | \"with\"\n | \"withRecursive\";\n\nexport type IRelationalQueryBuilder<Schema = unknown> = Pick<\n QueryCreator<Schema>,\n IRelationalQueryMethods\n> & {\n withSchema: (schema: string) => IRelationalQueryBuilder<Schema>;\n};\n\nexport type HashAlgorithms = \"fnv1a\";\nexport type IBaseRelationalDb<Schema = unknown> = Kysely<Schema>;\n\n/**\n * The standardized relational database interface for relational db processors.\n * This abstraction provides type-safe database operations while hiding the underlying\n * database framework implementation details.\n **/\nexport type IRelationalDb<Schema = unknown> = IBaseRelationalDb<Schema> & {\n createNamespace<NamespaceSchema>(\n namespace: string,\n ): Promise<IRelationalDb<ExtractProcessorSchemaOrSelf<NamespaceSchema>>>;\n queryNamespace<NamespaceSchema>(\n namespace: string,\n ): IRelationalQueryBuilder<NamespaceSchema>;\n};\n\nexport type ExtractProcessorSchemaOrSelf<TProcessor> =\n TProcessor extends RelationalDbProcessor<infer TSchema>\n ? TSchema\n : TProcessor;\n\nexport type RelationalDbProcessorClass<TSchema> =\n typeof RelationalDbProcessor<TSchema>;\n\nexport interface IRelationalDbProcessor<\n TDatabaseSchema = unknown,\n> extends IProcessor {\n namespace: string;\n query: IRelationalQueryBuilder<TDatabaseSchema>;\n filter: ProcessorFilter;\n initAndUpgrade(): Promise<void>;\n}\n\nconst IS_RELATIONAL_DB_PROCESSOR = Symbol.for(\"ph.IS_RELATIONAL_DB_PROCESSOR\");\n\n/**\n * Base class for relational db processors that require a relational database storage.\n * This class abstracts database initialization, migration management, and resource cleanup,\n * allowing derived classes to focus on business logic.\n */\nexport abstract class RelationalDbProcessor<\n TDatabaseSchema = unknown,\n> implements IRelationalDbProcessor<TDatabaseSchema> {\n constructor(\n protected _namespace: string,\n protected _filter: ProcessorFilter,\n protected relationalDb: IRelationalDb<TDatabaseSchema>,\n ) {}\n\n static [IS_RELATIONAL_DB_PROCESSOR] = true;\n\n /**\n * Returns the namespace for a given drive id.\n * This method can be overridden by derived classes to provide a custom namespace.\n */\n static getNamespace(driveId: string): string {\n return `${this.name}_${driveId.replaceAll(\"-\", \"_\")}`;\n }\n\n static query<Schema>(\n this: RelationalDbProcessorClass<Schema>,\n driveId: string,\n db: IRelationalDb<any>,\n ): IRelationalQueryBuilder<Schema> {\n return db.queryNamespace(this.getNamespace(driveId));\n }\n\n /**\n * Processes a list of operations with context.\n * Called when operations match this processor's filter.\n */\n abstract onOperations(operations: OperationWithContext[]): Promise<void>;\n\n /**\n * Returns the filter for the processor.\n * This method can be overridden by derived classes to provide a custom filter.\n */\n get filter(): ProcessorFilter {\n return this._filter;\n }\n\n /**\n * Returns the namespace used by the processor.\n */\n get namespace(): string {\n return this._namespace;\n }\n\n get query(): IRelationalQueryBuilder<TDatabaseSchema> {\n return relationalDbToQueryBuilder(this.relationalDb);\n }\n\n /**\n * Abstract method that derived classes must implement.\n * This method is meant to be called on subclasses to initialize and upgrade the database.\n */\n abstract initAndUpgrade(): Promise<void>;\n\n /**\n * Called when the processor is disconnected.\n * This method is meant to be overridden by subclasses to clean up resources.\n */\n abstract onDisconnect(): Promise<void>;\n}\n"],"mappings":";;AAAA,MAAa,iBAAiB,CAAC,WAAW,cAAc;AACxD,MAAa,uCAAuC;AACpD,MAAa,sCAAsC;;;ACMnD,MAAM,kBAAqC;CAAC;CAAI;CAAI;CAAK;CAAK;CAAK;CAAK;AACxE,MAAM,UAAU,KAAK,KAAK,GAAG;;;;;;;;AAQ7B,SAAgB,cAAc,KAAa,SAAS,IAAI;CACtD,MAAM,eAAe,KAAK,KAAK,SAAS,QAAQ;AAIhD,QAAO,SADM,MAAM,KAAK,EAAE,MADxB,gBAAgB,MAAM,SAAS,QAAQ,QAAQ,aAAa,IAAI,MACzB,CAAC,EACpB,OAAO;;AAI/B,SAAS,SAAS,KAAa,SAAS,IAAY;CAClD,MAAM,WAAW;CACjB,IAAI,MAAM;AACV,QAAO,MAAM,MAAM,IAAI,SAAS,QAAQ;AACtC,QAAM,SAAS,OAAO,MAAM,IAAI,IAAI;AACpC,SAAO;;AAET,QAAO,IAAI,SAAS,QAAQ,IAAI;;;;;;;;AASlC,SAAgB,mBACd,QACA,aACuB;CACvB,MAAM,eAAe;AAErB,cAAa,mBACX,WACA,YAEA,mBACE,QACA,WACA,WAAW,YACZ;AAEH,cAAa,kBACX,WACA,YAEA,6BACE,QACA,WACA,WAAW,YACZ;AAEH,QAAO;;AAOT,eAAsB,mBACpB,IACA,WACA,SACgC;CAGhC,MAAM,YADa,SAAS,iBAAiB,OACd,cAAc,UAAU,GAAG;AAC1D,OAAM,GAAG,OAAO,aAAa,UAAU,CAAC,aAAa,CAAC,SAAS;AAE/D,QAD2B,GAAG,WAAW,UAAU;;AAIrD,SAAgB,6BACd,IACA,WACA,SACiC;CAEjC,MAAM,YADa,SAAS,iBAAiB,OACd,cAAc,UAAU,GAAG;AAE1D,QAAO,2BADc,GAAG,WAAW,UAAU,CACE;;;;;;;AAQjD,SAAgB,2BACd,OACkC;AAClC,QAAO;EACL,YAAY,MAAM,WAAW,KAAK,MAAM;EACxC,cAAc,MAAM,aAAa,KAAK,MAAM;EAC5C,MAAM,MAAM,KAAK,KAAK,MAAM;EAC5B,eAAe,MAAM,cAAc,KAAK,MAAM;EAC9C,aAAa,WACX,2BAAoC,MAAM,WAAW,OAAO,CAAC;EAChE;;;;AC9DH,MAAM,6BAA6B,OAAO,IAAI,gCAAgC;;;;;;AAO9E,IAAsB,wBAAtB,MAEqD;CACnD,YACE,YACA,SACA,cACA;AAHU,OAAA,aAAA;AACA,OAAA,UAAA;AACA,OAAA,eAAA;;CAGZ,QAAQ,8BAA8B;;;;;CAMtC,OAAO,aAAa,SAAyB;AAC3C,SAAO,GAAG,KAAK,KAAK,GAAG,QAAQ,WAAW,KAAK,IAAI;;CAGrD,OAAO,MAEL,SACA,IACiC;AACjC,SAAO,GAAG,eAAe,KAAK,aAAa,QAAQ,CAAC;;;;;;CAatD,IAAI,SAA0B;AAC5B,SAAO,KAAK;;;;;CAMd,IAAI,YAAoB;AACtB,SAAO,KAAK;;CAGd,IAAI,QAAkD;AACpD,SAAO,2BAA2B,KAAK,aAAa"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../processors/constants.ts","../../processors/deletion.ts","../../processors/relational/utils.ts","../../processors/relational/types.ts"],"sourcesContent":["export const PROCESSOR_APPS = [\"connect\", \"switchboard\"] as const;\nexport const DEFAULT_RELATIONAL_PROCESSOR_DB_NAME = \"relational-db\";\nexport const DEFAULT_ANALYTICS_PROCESSOR_DB_NAME = \"analytics-db\";\n","import type { OperationWithContext } from \"../document-model/index.js\";\nimport { PURGE_DOCUMENT } from \"../document-model/purge.js\";\n\n/** The id a DELETE_DOCUMENT or PURGE_DOCUMENT removes; undefined otherwise. */\nexport function deletedDocumentId(\n op: OperationWithContext,\n): string | undefined {\n const { type, input } = op.operation.action;\n if (type !== \"DELETE_DOCUMENT\" && type !== PURGE_DOCUMENT) return undefined;\n const documentId = (input as { documentId?: unknown } | undefined)\n ?.documentId;\n return typeof documentId === \"string\" ? documentId : op.context.documentId;\n}\n","import type { Options } from \"@sindresorhus/fnv1a\";\nimport fnv1a from \"@sindresorhus/fnv1a\";\nimport type {\n IBaseRelationalDb,\n IRelationalDb,\n IRelationalQueryBuilder,\n} from \"./types.js\";\n\nconst SUPPORTED_SIZES: Options[\"size\"][] = [32, 64, 128, 256, 512, 1024];\nconst LOG2_26 = Math.log2(26); //\n/**\n * Hashes a string to a lowercase base-26 string.\n * @param str The string to hash.\n * @param length The length of the hash. Defaults to 10.\n * @param algorithm The hashing algorithm to use. Defaults to \"fnv1a\".\n * @returns The hashed string.\n */\nexport function hashNamespace(str: string, length = 10) {\n const requiredBits = Math.ceil(length * LOG2_26);\n const bitSize =\n SUPPORTED_SIZES.find((size) => size && size >= requiredBits) ?? 1024;\n const hash = fnv1a(str, { size: bitSize });\n return toBase26(hash, length);\n}\n\n// converts hash to lowercase letters\nfunction toBase26(num: bigint, length = 10): string {\n const alphabet = \"abcdefghijklmnopqrstuvwxyz\";\n let out = \"\";\n while (num > 0n && out.length < length) {\n out = alphabet[Number(num % 26n)] + out;\n num /= 26n;\n }\n return out.padStart(length, \"a\"); // optional padding\n}\n\n/**\n * Creates a RelationalDb instance with namespace support.\n * @param baseDb The base RelationalDb instance to enhance.\n * @param baseOptions The default options for namespace creation. Hashes namespace by default.\n * @returns The enhanced RelationalDb instance.\n */\nexport function createRelationalDb<Schema>(\n baseDb: IBaseRelationalDb<Schema>,\n baseOptions?: NamespaceOptions,\n): IRelationalDb<Schema> {\n const relationalDb = baseDb as IRelationalDb<Schema>;\n\n relationalDb.createNamespace = <NamespaceSchema>(\n namespace: string,\n options?: NamespaceOptions,\n ) =>\n createNamespacedDb<NamespaceSchema>(\n baseDb,\n namespace,\n options ?? baseOptions,\n );\n\n relationalDb.queryNamespace = <NamespaceSchema>(\n namespace: string,\n options?: NamespaceOptions,\n ) =>\n createNamespacedQueryBuilder<NamespaceSchema>(\n baseDb,\n namespace,\n options ?? baseOptions,\n );\n\n return relationalDb;\n}\n\ntype NamespaceOptions = {\n hashNamespace?: boolean;\n};\n\nexport async function createNamespacedDb<Schema>(\n db: IBaseRelationalDb<any>,\n namespace: string,\n options?: NamespaceOptions,\n): Promise<IRelationalDb<Schema>> {\n // hash the namespace to avoid too long namespaces\n const shouldHash = options?.hashNamespace ?? true;\n const hashValue = shouldHash ? hashNamespace(namespace) : namespace;\n await db.schema.createSchema(hashValue).ifNotExists().execute();\n const schemaRelationalDb = db.withSchema(hashValue);\n Object.defineProperty(schemaRelationalDb, NAMESPACE_SCHEMA, {\n value: hashValue,\n });\n return schemaRelationalDb as IRelationalDb<Schema>;\n}\n\nconst NAMESPACE_SCHEMA = Symbol.for(\"ph.relational.namespaceSchema\");\n\n/** The schema behind a handle from `createNamespace`; undefined otherwise. */\nexport function namespaceSchemaOf(db: object): string | undefined {\n return (db as { [NAMESPACE_SCHEMA]?: string })[NAMESPACE_SCHEMA];\n}\n\nexport function createNamespacedQueryBuilder<Schema>(\n db: IBaseRelationalDb<any>,\n namespace: string,\n options?: NamespaceOptions,\n): IRelationalQueryBuilder<Schema> {\n const shouldHash = options?.hashNamespace ?? true;\n const hashValue = shouldHash ? hashNamespace(namespace) : namespace;\n const namespacedDb = db.withSchema(hashValue) as IRelationalDb<Schema>;\n return relationalDbToQueryBuilder(namespacedDb);\n}\n\n/**\n * Returns a query builder for a RelationalDb instance.\n * @param query The RelationalDb instance to convert.\n * @returns The IRelationalQueryBuilder instance.\n */\nexport function relationalDbToQueryBuilder<TSchema>(\n query: IBaseRelationalDb<TSchema>,\n): IRelationalQueryBuilder<TSchema> {\n return {\n selectFrom: query.selectFrom.bind(query),\n selectNoFrom: query.selectNoFrom.bind(query),\n with: query.with.bind(query),\n withRecursive: query.withRecursive.bind(query),\n withSchema: (schema: string) =>\n relationalDbToQueryBuilder<TSchema>(query.withSchema(schema)),\n };\n}\n","import type { OperationWithContext } from \"@powerhousedao/shared/document-model\";\nimport { sql, type Kysely, type QueryCreator } from \"kysely\";\nimport type { IProcessor, ProcessorFilter } from \"../types.js\";\nimport { namespaceSchemaOf, relationalDbToQueryBuilder } from \"./utils.js\";\n\n/** Columns {@link RelationalDbProcessor.deleteDocumentRows} matches. */\nexport const DOCUMENT_ID_COLUMNS = [\"document_id\", \"documentId\"] as const;\n\nexport type IRelationalQueryMethods =\n | \"selectFrom\"\n | \"selectNoFrom\"\n | \"with\"\n | \"withRecursive\";\n\nexport type IRelationalQueryBuilder<Schema = unknown> = Pick<\n QueryCreator<Schema>,\n IRelationalQueryMethods\n> & {\n withSchema: (schema: string) => IRelationalQueryBuilder<Schema>;\n};\n\nexport type HashAlgorithms = \"fnv1a\";\nexport type IBaseRelationalDb<Schema = unknown> = Kysely<Schema>;\n\n/**\n * The standardized relational database interface for relational db processors.\n * This abstraction provides type-safe database operations while hiding the underlying\n * database framework implementation details.\n **/\nexport type IRelationalDb<Schema = unknown> = IBaseRelationalDb<Schema> & {\n createNamespace<NamespaceSchema>(\n namespace: string,\n ): Promise<IRelationalDb<ExtractProcessorSchemaOrSelf<NamespaceSchema>>>;\n queryNamespace<NamespaceSchema>(\n namespace: string,\n ): IRelationalQueryBuilder<NamespaceSchema>;\n};\n\nexport type ExtractProcessorSchemaOrSelf<TProcessor> =\n TProcessor extends RelationalDbProcessor<infer TSchema>\n ? TSchema\n : TProcessor;\n\nexport type RelationalDbProcessorClass<TSchema> =\n typeof RelationalDbProcessor<TSchema>;\n\nexport interface IRelationalDbProcessor<\n TDatabaseSchema = unknown,\n> extends IProcessor {\n namespace: string;\n query: IRelationalQueryBuilder<TDatabaseSchema>;\n filter: ProcessorFilter;\n initAndUpgrade(): Promise<void>;\n}\n\nconst IS_RELATIONAL_DB_PROCESSOR = Symbol.for(\"ph.IS_RELATIONAL_DB_PROCESSOR\");\n\n/**\n * Base class for relational db processors that require a relational database storage.\n * This class abstracts database initialization, migration management, and resource cleanup,\n * allowing derived classes to focus on business logic.\n */\nexport abstract class RelationalDbProcessor<\n TDatabaseSchema = unknown,\n> implements IRelationalDbProcessor<TDatabaseSchema> {\n constructor(\n protected _namespace: string,\n protected _filter: ProcessorFilter,\n protected relationalDb: IRelationalDb<TDatabaseSchema>,\n /** The drive the factory created this processor for. */\n protected _driveId?: string,\n ) {}\n\n static [IS_RELATIONAL_DB_PROCESSOR] = true;\n\n /**\n * Returns the namespace for a given drive id.\n * This method can be overridden by derived classes to provide a custom namespace.\n */\n static getNamespace(driveId: string): string {\n return `${this.name}_${driveId.replaceAll(\"-\", \"_\")}`;\n }\n\n static query<Schema>(\n this: RelationalDbProcessorClass<Schema>,\n driveId: string,\n db: IRelationalDb<any>,\n ): IRelationalQueryBuilder<Schema> {\n return db.queryNamespace(this.getNamespace(driveId));\n }\n\n /**\n * Processes a list of operations with context.\n * Called when operations match this processor's filter.\n */\n abstract onOperations(operations: OperationWithContext[]): Promise<void>;\n\n /**\n * Returns the filter for the processor.\n * This method can be overridden by derived classes to provide a custom filter.\n */\n get filter(): ProcessorFilter {\n return this._filter;\n }\n\n /**\n * Returns the namespace used by the processor.\n */\n get namespace(): string {\n return this._namespace;\n }\n\n get query(): IRelationalQueryBuilder<TDatabaseSchema> {\n return relationalDbToQueryBuilder(this.relationalDb);\n }\n\n /** True for this processor's drive when its namespace is that drive's alone. */\n protected isNamespaceDrive(documentId: string): boolean {\n const driveId = this._driveId;\n if (driveId === undefined || documentId !== driveId) return false;\n const processorClass = this.constructor as typeof RelationalDbProcessor;\n if (processorClass.getNamespace(driveId) !== this._namespace) return false;\n return processorClass.getNamespace(`${driveId}-other`) !== this._namespace;\n }\n\n /** Deletes a document's rows from every table with a document-id column. */\n protected async deleteDocumentRows(documentId: string): Promise<void> {\n const schema = this.namespaceSchema();\n const columns = await sql<{ table_name: string; column_name: string }>`\n select c.table_name, c.column_name\n from information_schema.columns c\n join information_schema.tables t\n on t.table_schema = c.table_schema and t.table_name = c.table_name\n where c.table_schema = ${schema}\n and t.table_type = 'BASE TABLE'\n and c.column_name in (${sql.join([...DOCUMENT_ID_COLUMNS])})\n order by c.table_name, c.column_name\n `.execute(this.relationalDb);\n const db = this.relationalDb as unknown as Kysely<any>;\n for (const { table_name, column_name } of columns.rows) {\n await db\n .deleteFrom(table_name)\n .where(column_name, \"=\", documentId)\n .execute();\n }\n }\n\n /** Drops this processor's namespace and every table in it. */\n protected async dropNamespace(): Promise<void> {\n await this.relationalDb.schema\n .dropSchema(this.namespaceSchema())\n .ifExists()\n .cascade()\n .execute();\n }\n\n private namespaceSchema(): string {\n const schema = namespaceSchemaOf(this.relationalDb);\n if (schema === undefined) {\n throw new Error(\n `Namespace '${this._namespace}' was not opened with createNamespace`,\n );\n }\n return schema;\n }\n\n /**\n * Abstract method that derived classes must implement.\n * This method is meant to be called on subclasses to initialize and upgrade the database.\n */\n abstract initAndUpgrade(): Promise<void>;\n\n /**\n * Called when the processor is disconnected.\n * This method is meant to be overridden by subclasses to clean up resources.\n */\n abstract onDisconnect(): Promise<void>;\n}\n"],"mappings":";;;;AAAA,MAAa,iBAAiB,CAAC,WAAW,aAAa;AACvD,MAAa,uCAAuC;AACpD,MAAa,sCAAsC;;;;ACEnD,SAAgB,kBACd,IACoB;CACpB,MAAM,EAAE,MAAM,UAAU,GAAG,UAAU;CACrC,IAAI,SAAS,qBAAqB,SAAA,kBAAyB,OAAO,KAAA;CAClE,MAAM,aAAc,OAChB;CACJ,OAAO,OAAO,eAAe,WAAW,aAAa,GAAG,QAAQ;AAClE;;;ACJA,MAAM,kBAAqC;CAAC;CAAI;CAAI;CAAK;CAAK;CAAK;AAAI;AACvE,MAAM,UAAU,KAAK,KAAK,EAAE;;;;;;;;AAQ5B,SAAgB,cAAc,KAAa,SAAS,IAAI;CACtD,MAAM,eAAe,KAAK,KAAK,SAAS,OAAO;CAC/C,MAAM,UACJ,gBAAgB,MAAM,SAAS,QAAQ,QAAQ,YAAY,KAAK;CAElE,OAAO,SADM,MAAM,KAAK,EAAE,MAAM,QAAQ,CACrB,GAAG,MAAM;AAC9B;AAGA,SAAS,SAAS,KAAa,SAAS,IAAY;CAClD,MAAM,WAAW;CACjB,IAAI,MAAM;CACV,OAAO,MAAM,MAAM,IAAI,SAAS,QAAQ;EACtC,MAAM,SAAS,OAAO,MAAM,GAAG,KAAK;EACpC,OAAO;CACT;CACA,OAAO,IAAI,SAAS,QAAQ,GAAG;AACjC;;;;;;;AAQA,SAAgB,mBACd,QACA,aACuB;CACvB,MAAM,eAAe;CAErB,aAAa,mBACX,WACA,YAEA,mBACE,QACA,WACA,WAAW,WACb;CAEF,aAAa,kBACX,WACA,YAEA,6BACE,QACA,WACA,WAAW,WACb;CAEF,OAAO;AACT;AAMA,eAAsB,mBACpB,IACA,WACA,SACgC;CAGhC,MAAM,YADa,SAAS,iBAAiB,OACd,cAAc,SAAS,IAAI;CAC1D,MAAM,GAAG,OAAO,aAAa,SAAS,CAAC,CAAC,YAAY,CAAC,CAAC,QAAQ;CAC9D,MAAM,qBAAqB,GAAG,WAAW,SAAS;CAClD,OAAO,eAAe,oBAAoB,kBAAkB,EAC1D,OAAO,UACT,CAAC;CACD,OAAO;AACT;AAEA,MAAM,mBAAmB,OAAO,IAAI,+BAA+B;;AAGnE,SAAgB,kBAAkB,IAAgC;CAChE,OAAQ,GAAuC;AACjD;AAEA,SAAgB,6BACd,IACA,WACA,SACiC;CAEjC,MAAM,YADa,SAAS,iBAAiB,OACd,cAAc,SAAS,IAAI;CAE1D,OAAO,2BADc,GAAG,WAAW,SACU,CAAC;AAChD;;;;;;AAOA,SAAgB,2BACd,OACkC;CAClC,OAAO;EACL,YAAY,MAAM,WAAW,KAAK,KAAK;EACvC,cAAc,MAAM,aAAa,KAAK,KAAK;EAC3C,MAAM,MAAM,KAAK,KAAK,KAAK;EAC3B,eAAe,MAAM,cAAc,KAAK,KAAK;EAC7C,aAAa,WACX,2BAAoC,MAAM,WAAW,MAAM,CAAC;CAChE;AACF;;;;ACvHA,MAAa,sBAAsB,CAAC,eAAe,YAAY;AAiD/D,MAAM,6BAA6B,OAAO,IAAI,+BAA+B;;;;;;AAO7E,IAAsB,wBAAtB,MAEqD;CAEvC;CACA;CACA;CAEA;CALZ,YACE,YACA,SACA,cAEA,UACA;EALU,KAAA,aAAA;EACA,KAAA,UAAA;EACA,KAAA,eAAA;EAEA,KAAA,WAAA;CACT;CAEH,QAAQ,8BAA8B;;;;;CAMtC,OAAO,aAAa,SAAyB;EAC3C,OAAO,GAAG,KAAK,KAAK,GAAG,QAAQ,WAAW,KAAK,GAAG;CACpD;CAEA,OAAO,MAEL,SACA,IACiC;EACjC,OAAO,GAAG,eAAe,KAAK,aAAa,OAAO,CAAC;CACrD;;;;;CAYA,IAAI,SAA0B;EAC5B,OAAO,KAAK;CACd;;;;CAKA,IAAI,YAAoB;EACtB,OAAO,KAAK;CACd;CAEA,IAAI,QAAkD;EACpD,OAAO,2BAA2B,KAAK,YAAY;CACrD;;CAGA,iBAA2B,YAA6B;EACtD,MAAM,UAAU,KAAK;EACrB,IAAI,YAAY,KAAA,KAAa,eAAe,SAAS,OAAO;EAC5D,MAAM,iBAAiB,KAAK;EAC5B,IAAI,eAAe,aAAa,OAAO,MAAM,KAAK,YAAY,OAAO;EACrE,OAAO,eAAe,aAAa,GAAG,QAAQ,OAAO,MAAM,KAAK;CAClE;;CAGA,MAAgB,mBAAmB,YAAmC;EACpE,MAAM,SAAS,KAAK,gBAAgB;EACpC,MAAM,UAAU,MAAM,GAAgD;;;;;+BAK3C,OAAO;;gCAEN,IAAI,KAAK,CAAC,GAAG,mBAAmB,CAAC,EAAE;;MAE7D,QAAQ,KAAK,YAAY;EAC3B,MAAM,KAAK,KAAK;EAChB,KAAK,MAAM,EAAE,YAAY,iBAAiB,QAAQ,MAChD,MAAM,GACH,WAAW,UAAU,CAAC,CACtB,MAAM,aAAa,KAAK,UAAU,CAAC,CACnC,QAAQ;CAEf;;CAGA,MAAgB,gBAA+B;EAC7C,MAAM,KAAK,aAAa,OACrB,WAAW,KAAK,gBAAgB,CAAC,CAAC,CAClC,SAAS,CAAC,CACV,QAAQ,CAAC,CACT,QAAQ;CACb;CAEA,kBAAkC;EAChC,MAAM,SAAS,kBAAkB,KAAK,YAAY;EAClD,IAAI,WAAW,KAAA,GACb,MAAM,IAAI,MACR,cAAc,KAAK,WAAW,sCAChC;EAEF,OAAO;CACT;AAaF"}
|