@powerhousedao/shared 6.2.3-dev.3 → 6.2.3-dev.30
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-B6xK4YI_.mjs} +7 -2
- package/dist/clis/args/connect-B6xK4YI_.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/{generate-CA916Fvj.mjs → generate-10dooJ-D.mjs} +45 -2
- package/dist/clis/args/generate-10dooJ-D.mjs.map +1 -0
- package/dist/clis/args/generate-DmgiCzuf.d.mts +106 -0
- package/dist/clis/args/generate-DmgiCzuf.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-DVPTARGn.d.mts +190 -0
- package/dist/clis/args/help-DVPTARGn.d.mts.map +1 -0
- package/dist/clis/args/{help-Bqbgbalu.mjs → help-yRmplJjW.mjs} +15 -15
- package/dist/clis/args/{help-Bqbgbalu.mjs.map → help-yRmplJjW.mjs.map} +1 -1
- package/dist/clis/args/help.d.mts +3 -2
- package/dist/clis/args/help.mjs +1 -1
- package/dist/clis/args/index.d.mts +20 -19
- package/dist/clis/args/index.mjs +18 -18
- package/dist/clis/args/init-CFeTq4Cq.d.mts +52 -0
- package/dist/clis/args/init-CFeTq4Cq.d.mts.map +1 -0
- package/dist/clis/args/{init-rz9Ei7nq.mjs → init-Dvb42Y87.mjs} +2 -2
- package/dist/clis/args/{init-rz9Ei7nq.mjs.map → init-Dvb42Y87.mjs.map} +1 -1
- package/dist/clis/args/init.d.mts +3 -2
- package/dist/clis/args/init.mjs +1 -1
- package/dist/clis/args/inspect-BjRmtB86.d.mts +13 -0
- package/dist/clis/args/inspect-BjRmtB86.d.mts.map +1 -0
- package/dist/clis/args/{inspect-tckH8mSw.mjs → inspect-UNQgtuR0.mjs} +2 -2
- package/dist/clis/args/{inspect-tckH8mSw.mjs.map → inspect-UNQgtuR0.mjs.map} +1 -1
- package/dist/clis/args/inspect.d.mts +3 -2
- package/dist/clis/args/inspect.mjs +1 -1
- package/dist/clis/args/install-B0tMyUMw.d.mts +37 -0
- package/dist/clis/args/install-B0tMyUMw.d.mts.map +1 -0
- package/dist/clis/args/{install-Sz2DlCHh.mjs → install-F-27kF6m.mjs} +2 -2
- package/dist/clis/args/{install-Sz2DlCHh.mjs.map → install-F-27kF6m.mjs.map} +1 -1
- package/dist/clis/args/install.d.mts +3 -2
- package/dist/clis/args/install.mjs +1 -1
- package/dist/clis/args/{list-DM2d6f1m.mjs → list-Bkfn8Yuo.mjs} +2 -2
- package/dist/clis/args/{list-DM2d6f1m.mjs.map → list-Bkfn8Yuo.mjs.map} +1 -1
- package/dist/clis/args/list-DrbxA7JJ.d.mts +10 -0
- package/dist/clis/args/list-DrbxA7JJ.d.mts.map +1 -0
- package/dist/clis/args/list.d.mts +3 -2
- package/dist/clis/args/list.mjs +1 -1
- package/dist/clis/args/{login-DiKT5Jfu.mjs → login-CIFkQExi.mjs} +2 -2
- package/dist/clis/args/{login-DiKT5Jfu.mjs.map → login-CIFkQExi.mjs.map} +1 -1
- package/dist/clis/args/login-CXRJXg71.d.mts +25 -0
- package/dist/clis/args/login-CXRJXg71.d.mts.map +1 -0
- package/dist/clis/args/login.d.mts +3 -2
- package/dist/clis/args/login.mjs +1 -1
- package/dist/clis/args/{magic-string.es-h_0HDQBQ.mjs → magic-string.es-BWtG0AyA.mjs} +33 -27
- package/dist/clis/args/magic-string.es-BWtG0AyA.mjs.map +1 -0
- package/dist/clis/args/migrate-DkCQRL2D.d.mts +19 -0
- package/dist/clis/args/migrate-DkCQRL2D.d.mts.map +1 -0
- package/dist/clis/args/{migrate-CG_gWc4k.mjs → migrate-DwJGhc2d.mjs} +2 -2
- package/dist/clis/args/{migrate-CG_gWc4k.mjs.map → migrate-DwJGhc2d.mjs.map} +1 -1
- package/dist/clis/args/migrate.d.mts +3 -2
- package/dist/clis/args/migrate.mjs +1 -1
- package/dist/clis/args/publish-CeW4bOrl.d.mts +16 -0
- package/dist/clis/args/publish-CeW4bOrl.d.mts.map +1 -0
- package/dist/clis/args/{publish-DDZYsUfV.mjs → publish-DHqlGWmL.mjs} +2 -2
- package/dist/clis/args/{publish-DDZYsUfV.mjs.map → publish-DHqlGWmL.mjs.map} +1 -1
- package/dist/clis/args/publish.d.mts +3 -2
- package/dist/clis/args/publish.mjs +1 -1
- package/dist/clis/args/{registry-C_OVFQmI.mjs → registry-DIwES3l2.mjs} +2 -2
- package/dist/clis/args/{registry-C_OVFQmI.mjs.map → registry-DIwES3l2.mjs.map} +1 -1
- package/dist/clis/args/registry-DNH8xuaE.d.mts +17 -0
- package/dist/clis/args/registry-DNH8xuaE.d.mts.map +1 -0
- package/dist/clis/args/registry.d.mts +3 -2
- package/dist/clis/args/registry.mjs +1 -1
- package/dist/clis/args/service-BBx5GDTc.d.mts +27 -0
- package/dist/clis/args/service-BBx5GDTc.d.mts.map +1 -0
- package/dist/clis/args/{service-CHOOr0Gg.mjs → service-Cpjlyeu5.mjs} +2 -2
- package/dist/clis/args/{service-CHOOr0Gg.mjs.map → service-Cpjlyeu5.mjs.map} +1 -1
- package/dist/clis/args/service.d.mts +3 -2
- package/dist/clis/args/service.mjs +1 -1
- package/dist/clis/args/{switchboard-Dsp7nosi.mjs → switchboard-CCaAtU56.mjs} +2 -2
- package/dist/clis/args/{switchboard-Dsp7nosi.mjs.map → switchboard-CCaAtU56.mjs.map} +1 -1
- package/dist/clis/args/switchboard-RrNb1fUH.d.mts +70 -0
- package/dist/clis/args/switchboard-RrNb1fUH.d.mts.map +1 -0
- package/dist/clis/args/switchboard.d.mts +3 -2
- package/dist/clis/args/switchboard.mjs +1 -1
- package/dist/clis/args/{uninstall-CTwTX0u_.mjs → uninstall-3U0B8g5c.mjs} +2 -2
- package/dist/clis/args/{uninstall-CTwTX0u_.mjs.map → uninstall-3U0B8g5c.mjs.map} +1 -1
- package/dist/clis/args/uninstall-CDx7lwxn.d.mts +28 -0
- package/dist/clis/args/uninstall-CDx7lwxn.d.mts.map +1 -0
- package/dist/clis/args/uninstall.d.mts +3 -2
- package/dist/clis/args/uninstall.mjs +1 -1
- package/dist/clis/args/unpublish-CEDsk6uv.d.mts +22 -0
- package/dist/clis/args/unpublish-CEDsk6uv.d.mts.map +1 -0
- package/dist/clis/args/{unpublish-BPMkGEg5.mjs → unpublish-s9zUh6Gw.mjs} +2 -2
- package/dist/clis/args/{unpublish-BPMkGEg5.mjs.map → unpublish-s9zUh6Gw.mjs.map} +1 -1
- package/dist/clis/args/unpublish.d.mts +3 -2
- package/dist/clis/args/unpublish.mjs +1 -1
- package/dist/clis/args/{vetra-b4KUu1Ax.mjs → vetra-BUNlAAPp.mjs} +2 -2
- package/dist/clis/args/{vetra-b4KUu1Ax.mjs.map → vetra-BUNlAAPp.mjs.map} +1 -1
- package/dist/clis/args/vetra-DkDaWFPi.d.mts +111 -0
- package/dist/clis/args/vetra-DkDaWFPi.d.mts.map +1 -0
- package/dist/clis/args/vetra-ports.test.d.mts +2 -1
- package/dist/clis/args/vetra-ports.test.mjs +285 -180
- 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-CmdMi_wu.mjs +230 -0
- package/dist/clis/build-config-CmdMi_wu.mjs.map +1 -0
- package/dist/clis/build-config.d.mts +44 -10614
- package/dist/clis/build-config.d.mts.map +1 -1
- package/dist/clis/build-config.mjs +2 -88
- package/dist/clis/build-pieces.d.mts +101 -0
- package/dist/clis/build-pieces.d.mts.map +1 -0
- package/dist/clis/build-pieces.mjs +364 -0
- package/dist/clis/build-pieces.mjs.map +1 -0
- package/dist/clis/command-names.d.mts +2 -2
- package/dist/clis/command-names.d.mts.map +1 -1
- package/dist/clis/command-names.mjs.map +1 -1
- package/dist/clis/constants.d.mts +3 -462
- package/dist/clis/constants.mjs +25 -8
- package/dist/clis/constants.mjs.map +1 -1
- package/dist/clis/index-6CZwrmQi.d.mts +11154 -0
- package/dist/clis/index-6CZwrmQi.d.mts.map +1 -0
- package/dist/clis/index.d.mts +1339 -1221
- package/dist/clis/index.d.mts.map +1 -1
- package/dist/clis/index.mjs +186 -63
- package/dist/clis/index.mjs.map +1 -1
- package/dist/clis/project-env.d.mts +4 -4
- package/dist/clis/project-env.d.mts.map +1 -1
- package/dist/clis/project-env.mjs.map +1 -1
- package/dist/clis/project-ports.d.mts +5 -5
- package/dist/clis/project-ports.d.mts.map +1 -1
- package/dist/clis/project-ports.mjs +1 -1
- package/dist/clis/project-ports.mjs.map +1 -1
- package/dist/clis/services/telemetry.d.mts +7 -7
- package/dist/clis/services/telemetry.d.mts.map +1 -1
- package/dist/clis/services/telemetry.mjs.map +1 -1
- package/dist/clis/types-CMFHKrgv.d.mts +528 -0
- package/dist/clis/types-CMFHKrgv.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-SYDWHtqk.js} +14 -8
- package/dist/config-loader-SYDWHtqk.js.map +1 -0
- package/dist/connect/config-loader.d.ts +7 -8
- package/dist/connect/config-loader.d.ts.map +1 -1
- package/dist/connect/config-loader.js +1 -1
- package/dist/connect/index.d.ts +158 -55
- package/dist/connect/index.d.ts.map +1 -1
- package/dist/connect/index.js +272 -30
- package/dist/connect/index.js.map +1 -1
- package/dist/connect/json-adapter.d.ts +3 -4
- package/dist/connect/json-adapter.d.ts.map +1 -1
- package/dist/connect/json-adapter.js.map +1 -1
- package/dist/{constants-BP_gjn8g.d.ts → constants-DO4IYxuR.d.ts} +2 -1
- package/dist/constants-DO4IYxuR.d.ts.map +1 -0
- package/dist/constants.d.ts +3 -2
- package/dist/constants.js.map +1 -1
- package/dist/document-drive/index.d.ts +134 -100
- package/dist/document-drive/index.d.ts.map +1 -1
- package/dist/document-drive/index.js +120 -52
- package/dist/document-drive/index.js.map +1 -1
- package/dist/document-model/index.d.ts +5 -4
- package/dist/document-model/index.js +449 -227
- 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/{index-DyYIJtVy.d.ts → index-CDDyUSHE.d.ts} +40 -28
- package/dist/index-CDDyUSHE.d.ts.map +1 -0
- package/dist/index-D0JljlgO.d.ts +36 -0
- package/dist/index-D0JljlgO.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 +5 -1
- package/dist/processors/index.js.map +1 -1
- package/dist/registry/index.d.ts +15 -15
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +14 -5
- package/dist/registry/index.js.map +1 -1
- package/dist/registry/manifest-slim.d.ts +4 -3
- package/dist/registry/manifest-slim.d.ts.map +1 -1
- package/dist/registry/manifest-slim.js +21 -0
- package/dist/registry/manifest-slim.js.map +1 -1
- package/dist/registry/updates.d.ts +3 -3
- package/dist/registry/updates.d.ts.map +1 -1
- package/dist/registry/updates.js.map +1 -1
- package/dist/registry/urls.d.ts +2 -2
- package/dist/registry/urls.d.ts.map +1 -1
- package/dist/registry/urls.js.map +1 -1
- package/dist/{types-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-VDHUeQnm.d.ts} +23 -35
- package/dist/types-VDHUeQnm.d.ts.map +1 -0
- package/dist/{types-CpnWmiFY.d.ts → types-xLPOHE23.d.ts} +593 -437
- package/dist/types-xLPOHE23.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-XotexSsQ.js} +3 -2
- package/dist/{utils-aaTmfxFW.js.map → utils-XotexSsQ.js.map} +1 -1
- package/package.json +10 -5
- 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-Dsf1vpHV.d.mts +0 -183
- package/dist/clis/args/common-Dsf1vpHV.d.mts.map +0 -1
- package/dist/clis/args/connect-BVVvCmL9.mjs.map +0 -1
- package/dist/clis/args/connect-DetTnI8g.d.mts +0 -443
- package/dist/clis/args/connect-DetTnI8g.d.mts.map +0 -1
- package/dist/clis/args/generate-CA916Fvj.mjs.map +0 -1
- package/dist/clis/args/generate-DnV-bfXt.d.mts +0 -87
- package/dist/clis/args/generate-DnV-bfXt.d.mts.map +0 -1
- package/dist/clis/args/help-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.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-DLQ6lhLl.d.mts +0 -113
- package/dist/clis/args/vetra-DLQ6lhLl.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.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.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
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
3
2
|
//#region document-model/mock.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Builds a mock value for a schema, with `overrides` taking precedence.
|
|
@@ -16,7 +15,7 @@ import { z } from "zod";
|
|
|
16
15
|
* override still throws, which is correct: there is no way to invent a value
|
|
17
16
|
* for it, and the caller needs to say what it should be.
|
|
18
17
|
*/
|
|
19
|
-
declare function generateMock<TSchema extends z.ZodType>(schema: TSchema, overrides?: Partial<z.infer<TSchema>>): z.infer<TSchema>;
|
|
18
|
+
export declare function generateMock<TSchema extends z.ZodType>(schema: TSchema, overrides?: Partial<z.infer<TSchema>>): z.infer<TSchema>;
|
|
20
19
|
//#endregion
|
|
21
|
-
export {
|
|
20
|
+
export {};
|
|
22
21
|
//# sourceMappingURL=mock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock.d.ts","names":[],"sources":["../../document-model/mock.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"mock.d.ts","names":[],"sources":["../../document-model/mock.ts"],"mappings":";;;;;;;;;;;;;;;;;wBA0BgB,aAAa,gBAAgB,EAAE,SAC7C,QAAQ,SACR,YAAY,QAAQ,EAAE,MAAM,YAC3B,EAAE,MAAM"}
|
|
@@ -32,8 +32,9 @@ function generateMock(schema, overrides) {
|
|
|
32
32
|
};
|
|
33
33
|
const omittable = overriddenKeys.filter((key) => key in schema.shape);
|
|
34
34
|
const mask = Object.fromEntries(omittable.map((key) => [key, true]));
|
|
35
|
+
const schemaToGenerate = omittable.length ? schema.omit(mask) : schema;
|
|
35
36
|
return {
|
|
36
|
-
...zocker(
|
|
37
|
+
...zocker(schemaToGenerate).generate(),
|
|
37
38
|
...overrides
|
|
38
39
|
};
|
|
39
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock.js","names":[],"sources":["../../document-model/mock.ts"],"sourcesContent":["import { zocker } from \"zocker\";\nimport { z } from \"zod\";\n\n/**\n * Narrows to an object schema whose shape we can omit keys from. Callers may\n * pass any `ZodType`, so this has to be checked rather than assumed.\n */\nfunction isObjectSchema(schema: z.ZodType): schema is z.ZodObject {\n return schema instanceof z.ZodObject;\n}\n\n/**\n * Builds a mock value for a schema, with `overrides` taking precedence.\n *\n * Overridden fields are removed from the schema *before* generation rather than\n * being overwritten afterwards. That ordering is what makes overrides usable as\n * an escape hatch: some scalars compile to `z.custom(...)` (`AttachmentRef`,\n * `Address`), and zocker cannot synthesise a value satisfying an arbitrary\n * predicate — it throws. Generating first meant the throw happened before the\n * caller's value was ever applied, so an override could not rescue the field it\n * was written for.\n *\n * Only the overridden keys are skipped. A `z.custom(...)` field with no\n * override still throws, which is correct: there is no way to invent a value\n * for it, and the caller needs to say what it should be.\n */\nexport function generateMock<TSchema extends z.ZodType>(\n schema: TSchema,\n overrides?: Partial<z.infer<TSchema>>,\n): z.infer<TSchema> {\n if (!overrides) return zocker(schema).generate() as z.infer<TSchema>;\n\n const overriddenKeys = Object.keys(overrides);\n if (overriddenKeys.length === 0 || !isObjectSchema(schema)) {\n // Nothing to skip, or a schema with no shape to omit from: generate the\n // whole value and let the overrides win by merge, as before.\n const generated = zocker(schema).generate() as z.infer<TSchema>;\n return { ...(generated as object), ...overrides } as z.infer<TSchema>;\n }\n\n // Omitting a key the shape does not have is an error in zod, and an override\n // for an unknown key should still pass through to the result.\n const omittable = overriddenKeys.filter((key) => key in schema.shape);\n // `omit` is typed against the shape's literal keys; ours are only known at\n // runtime, so the mask has to be asserted into that parameter type.\n const mask = Object.fromEntries(\n omittable.map((key) => [key, true]),\n ) as Parameters<typeof schema.omit>[0];\n const schemaToGenerate = omittable.length ? schema.omit(mask) : schema;\n\n const generated = zocker(schemaToGenerate).generate() as object;\n return { ...generated, ...overrides } as z.infer<TSchema>;\n}\n"],"mappings":";;;;;;;AAOA,SAAS,eAAe,QAA0C;
|
|
1
|
+
{"version":3,"file":"mock.js","names":[],"sources":["../../document-model/mock.ts"],"sourcesContent":["import { zocker } from \"zocker\";\nimport { z } from \"zod\";\n\n/**\n * Narrows to an object schema whose shape we can omit keys from. Callers may\n * pass any `ZodType`, so this has to be checked rather than assumed.\n */\nfunction isObjectSchema(schema: z.ZodType): schema is z.ZodObject {\n return schema instanceof z.ZodObject;\n}\n\n/**\n * Builds a mock value for a schema, with `overrides` taking precedence.\n *\n * Overridden fields are removed from the schema *before* generation rather than\n * being overwritten afterwards. That ordering is what makes overrides usable as\n * an escape hatch: some scalars compile to `z.custom(...)` (`AttachmentRef`,\n * `Address`), and zocker cannot synthesise a value satisfying an arbitrary\n * predicate — it throws. Generating first meant the throw happened before the\n * caller's value was ever applied, so an override could not rescue the field it\n * was written for.\n *\n * Only the overridden keys are skipped. A `z.custom(...)` field with no\n * override still throws, which is correct: there is no way to invent a value\n * for it, and the caller needs to say what it should be.\n */\nexport function generateMock<TSchema extends z.ZodType>(\n schema: TSchema,\n overrides?: Partial<z.infer<TSchema>>,\n): z.infer<TSchema> {\n if (!overrides) return zocker(schema).generate() as z.infer<TSchema>;\n\n const overriddenKeys = Object.keys(overrides);\n if (overriddenKeys.length === 0 || !isObjectSchema(schema)) {\n // Nothing to skip, or a schema with no shape to omit from: generate the\n // whole value and let the overrides win by merge, as before.\n const generated = zocker(schema).generate() as z.infer<TSchema>;\n return { ...(generated as object), ...overrides } as z.infer<TSchema>;\n }\n\n // Omitting a key the shape does not have is an error in zod, and an override\n // for an unknown key should still pass through to the result.\n const omittable = overriddenKeys.filter((key) => key in schema.shape);\n // `omit` is typed against the shape's literal keys; ours are only known at\n // runtime, so the mask has to be asserted into that parameter type.\n const mask = Object.fromEntries(\n omittable.map((key) => [key, true]),\n ) as Parameters<typeof schema.omit>[0];\n const schemaToGenerate = omittable.length ? schema.omit(mask) : schema;\n\n const generated = zocker(schemaToGenerate).generate() as object;\n return { ...generated, ...overrides } as z.infer<TSchema>;\n}\n"],"mappings":";;;;;;;AAOA,SAAS,eAAe,QAA0C;CAChE,OAAO,kBAAkB,EAAE;AAC7B;;;;;;;;;;;;;;;;AAiBA,SAAgB,aACd,QACA,WACkB;CAClB,IAAI,CAAC,WAAW,OAAO,OAAO,MAAM,CAAC,CAAC,SAAS;CAE/C,MAAM,iBAAiB,OAAO,KAAK,SAAS;CAC5C,IAAI,eAAe,WAAW,KAAK,CAAC,eAAe,MAAM,GAIvD,OAAO;EAAE,GADS,OAAO,MAAM,CAAC,CAAC,SACZ;EAAc,GAAG;CAAU;CAKlD,MAAM,YAAY,eAAe,QAAQ,QAAQ,OAAO,OAAO,KAAK;CAGpE,MAAM,OAAO,OAAO,YAClB,UAAU,KAAK,QAAQ,CAAC,KAAK,IAAI,CAAC,CACpC;CACA,MAAM,mBAAmB,UAAU,SAAS,OAAO,KAAK,IAAI,IAAI;CAGhE,OAAO;EAAE,GADS,OAAO,gBAAgB,CAAC,CAAC,SACvB;EAAG,GAAG;CAAU;AACtC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { n as generateId, r as generateMock, t as deriveOperationId } from "../utils-
|
|
2
|
-
export { deriveOperationId, generateId, generateMock };
|
|
1
|
+
import { n as generateId, r as generateMock, t as deriveOperationId } from "../utils-BrKxCmKx.js";
|
|
2
|
+
export { deriveOperationId, generateId, generateMock };
|
|
3
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as generateId, r as generateMock, t as deriveOperationId } from "../utils-
|
|
1
|
+
import { n as generateId, r as generateMock, t as deriveOperationId } from "../utils-XotexSsQ.js";
|
|
2
2
|
export { deriveOperationId, generateId, generateMock };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $t as DocumentModelOperationExampleOperations,
|
|
1
|
+
import { $t as DocumentModelOperationExampleOperations, Bt as DocumentModelGlobalState, Fn as MinimalBackupData, Fu as Condition, Gl as PHDocument, Gt as DocumentModelLocalState, H as ActionSignatureContext, Ha as UpgradeManifest, Ht as DocumentModelHeaderOperations, In as ModuleSpecification, Iu as Grant, Jt as DocumentModelModuleOperations, Kl as PHDocumentHeader, Kr as Reducer, Nc as Action, Nr as OperationSpecification, Nu as AuthGroups, On as LoadFromInput, Rt as DocumentModelDocument, Ru as PHAuthState, Sa as SkipHeaderOperations, Sn as ISigner, Va as ValidationError, Zt as DocumentModelOperationErrorOperations, _d as OperationContext, ba as SigningParameters, cn as DocumentSpecification, ct as Author, en as DocumentModelOperationOperations, fi as SaveToFileHandle, gd as Operation, ha as SignalDispatch, hd as DocumentOperations, id as ProtocolVersions, jr as OperationErrorSpecification, li as ReplayDocumentOptions, lt as CodeExample, mn as FileInput, on as DocumentModelVersioningOperations, qr as ReducerOptions, rn as DocumentModelStateOperations, sd as SignaturePolicy, tn as DocumentModelPHState, wa as StateReducer, zu as PHBaseState } from "./types-xLPOHE23.js";
|
|
2
|
+
import "./utils-BrKxCmKx.js";
|
|
2
3
|
import { ZodIssue, z } from "zod";
|
|
3
|
-
|
|
4
4
|
//#region document-model/action-transport.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* An action's signer, as the wire declares it: signatures joined into strings,
|
|
@@ -67,7 +67,8 @@ type RemoveGrantActionInput = {
|
|
|
67
67
|
id: string;
|
|
68
68
|
};
|
|
69
69
|
type MoveGrantActionInput = {
|
|
70
|
-
id: string;
|
|
70
|
+
id: string;
|
|
71
|
+
/** Target index in the grant list; clamped to the valid range. */
|
|
71
72
|
index: number;
|
|
72
73
|
};
|
|
73
74
|
type InitializeAuthAction = Action & {
|
|
@@ -157,12 +158,12 @@ declare function assertAuthPreservedOnDuplicate(documentId: string, source: PHAu
|
|
|
157
158
|
* The auth scope a state snapshot may install, given the policy already there.
|
|
158
159
|
*
|
|
159
160
|
* `applyAuthAction` is the validated door onto `state.auth`, but a whole-state
|
|
160
|
-
* snapshot (UPGRADE_DOCUMENT's `initialState
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
161
|
+
* snapshot (UPGRADE_DOCUMENT's `initialState`) replaces the scope wholesale and
|
|
162
|
+
* is authorized as a `document`-scope write. Without this, a subject holding
|
|
163
|
+
* `execute` on `document` and no auth grant at all can install a policy of its
|
|
164
|
+
* choosing, name itself `creator` (which exempts the policy from the retention
|
|
165
|
+
* rule for good), or wipe an existing policy by carrying the default
|
|
166
|
+
* uninitialized one.
|
|
166
167
|
*
|
|
167
168
|
* Three cases:
|
|
168
169
|
*
|
|
@@ -176,16 +177,19 @@ declare function assertAuthPreservedOnDuplicate(documentId: string, source: PHAu
|
|
|
176
177
|
* an attempt to replace one policy with another.
|
|
177
178
|
*/
|
|
178
179
|
declare function resolveSnapshotAuth(documentId: string, documentType: string, current: PHAuthState | undefined, incoming: PHAuthState | undefined): PHAuthState;
|
|
179
|
-
/** UNDO
|
|
180
|
+
/** UNDO and REDO are rejected on the auth scope. */
|
|
180
181
|
declare function assertAuthScopeActionAllowed(action: Action): void;
|
|
181
182
|
type AuthVerb = "read" | "execute";
|
|
182
183
|
type AuthRequest = {
|
|
183
184
|
verb: AuthVerb;
|
|
184
|
-
scope: string;
|
|
185
|
+
scope: string;
|
|
186
|
+
/** For execute: the operation (action type) being attempted. Omitted for reads. */
|
|
185
187
|
operation?: string;
|
|
186
188
|
};
|
|
187
189
|
type AuthSubject = {
|
|
188
|
-
/** Verified signer address; undefined for an anonymous subject. */
|
|
190
|
+
/** Verified signer address; undefined for an anonymous subject. */
|
|
191
|
+
address?: string;
|
|
192
|
+
/** The signer's app key (a did:key), used to match the document creator. */
|
|
189
193
|
key?: string;
|
|
190
194
|
};
|
|
191
195
|
/**
|
|
@@ -194,7 +198,9 @@ type AuthSubject = {
|
|
|
194
198
|
* carrying `where` or a { match } principal never applies.
|
|
195
199
|
*/
|
|
196
200
|
type ConditionContext = {
|
|
197
|
-
/** The executing scope's own state, for `doc.<scope>.*` paths. */
|
|
201
|
+
/** The executing scope's own state, for `doc.<scope>.*` paths. */
|
|
202
|
+
scopeState: unknown;
|
|
203
|
+
/** The action's input, for `action.input.*` paths. Absent for reads. */
|
|
198
204
|
actionInput?: unknown;
|
|
199
205
|
};
|
|
200
206
|
type AuthDecision = "allow" | "deny";
|
|
@@ -345,12 +351,7 @@ declare const HASH_ENCODING_HEX = "hex";
|
|
|
345
351
|
//#region document-model/crypto.d.ts
|
|
346
352
|
declare const hashBrowser: (data: string | Uint8Array | ArrayBufferView | DataView, algorithm?: string, encoding?: string, _params?: Record<string, unknown>) => string;
|
|
347
353
|
declare function getUnixTimestamp(date: Date | string): string;
|
|
348
|
-
declare function buildOperationSignatureParams({
|
|
349
|
-
documentId,
|
|
350
|
-
signer,
|
|
351
|
-
action,
|
|
352
|
-
previousStateHash
|
|
353
|
-
}: ActionSignatureContext): [string, string, string, string];
|
|
354
|
+
declare function buildOperationSignatureParams({ documentId, signer, action, previousStateHash }: ActionSignatureContext): [string, string, string, string];
|
|
354
355
|
declare function buildOperationSignatureMessage(params: [string, string, string, string]): Uint8Array;
|
|
355
356
|
declare function ab2hex(ab: ArrayBuffer | ArrayBufferView): string;
|
|
356
357
|
declare function hex2ab(hex: string): Uint8Array<ArrayBuffer>;
|
|
@@ -513,7 +514,7 @@ declare class GrantNotFoundError extends Error {
|
|
|
513
514
|
constructor(grantId: string);
|
|
514
515
|
}
|
|
515
516
|
/**
|
|
516
|
-
* Thrown when a disallowed action (UNDO, REDO
|
|
517
|
+
* Thrown when a disallowed action (UNDO, REDO) targets the auth scope.
|
|
517
518
|
*/
|
|
518
519
|
declare class AuthActionNotAllowedError extends Error {
|
|
519
520
|
readonly actionType: string;
|
|
@@ -580,7 +581,8 @@ declare function baseSaveToFileHandle(document: PHDocument, input: FileSystemFil
|
|
|
580
581
|
declare function baseLoadFromInput<TState extends PHBaseState>(input: FileInput, reducer: Reducer<TState>, options?: ReplayDocumentOptions): Promise<PHDocument<TState>>;
|
|
581
582
|
declare function baseLoadFromInputVersioned<TState extends PHBaseState>(input: FileInput, config: VersionedReplayConfig, options?: ReplayDocumentOptions): Promise<PHDocument<TState>>;
|
|
582
583
|
type BulkArchiveEntry = {
|
|
583
|
-
/** "/"-separated zip path of a file entry (no trailing slash). */
|
|
584
|
+
/** "/"-separated zip path of a file entry (no trailing slash). */
|
|
585
|
+
path: string;
|
|
584
586
|
data: Uint8Array;
|
|
585
587
|
};
|
|
586
588
|
/**
|
|
@@ -647,9 +649,20 @@ declare const validateHeader: (header: PHDocumentHeader) => Promise<void>;
|
|
|
647
649
|
* Creates a header that has yet to be signed. This header is not valid, but
|
|
648
650
|
* can be input into {@link createSignedHeader} to create a signed header.
|
|
649
651
|
*
|
|
652
|
+
* With `protocolVersions` requiring v2 signatures the header takes a random
|
|
653
|
+
* nonce and the id {@link deriveDocumentId} gives, so `id` must be omitted.
|
|
654
|
+
*
|
|
650
655
|
* @returns An unsigned header for a document.
|
|
651
656
|
*/
|
|
652
|
-
declare const createPresignedHeader: (id?: string, documentType?: string) => PHDocumentHeader;
|
|
657
|
+
declare const createPresignedHeader: (id?: string, documentType?: string, protocolVersions?: ProtocolVersions) => PHDocumentHeader;
|
|
658
|
+
/**
|
|
659
|
+
* A header for a copy of a document headed `source`. A copy is v2-required
|
|
660
|
+
* when its source is or when `policy` asks for it, and then takes a derived id;
|
|
661
|
+
* otherwise it takes `id`. It keeps the source's other protocol versions.
|
|
662
|
+
*/
|
|
663
|
+
declare function createCopyHeader(source: Pick<PHDocumentHeader, "documentType" | "protocolVersions">, id?: string, policy?: SignaturePolicy): PHDocumentHeader;
|
|
664
|
+
/** Whether a v2-required `header` carries the id its params derive. */
|
|
665
|
+
declare function hasDerivedDocumentId(header: PHDocumentHeader): boolean;
|
|
653
666
|
/**
|
|
654
667
|
* Creates a new, signed header for a document. This will replace the id of the
|
|
655
668
|
* document.
|
|
@@ -702,7 +715,7 @@ declare function processUndoRedo<TState extends PHBaseState = PHBaseState>(docum
|
|
|
702
715
|
};
|
|
703
716
|
/**
|
|
704
717
|
* Base document reducer that wraps a custom document reducer and handles
|
|
705
|
-
* document-level actions such as undo, redo,
|
|
718
|
+
* document-level actions such as undo, redo, and set name.
|
|
706
719
|
*
|
|
707
720
|
* @template TGlobalState - The type of the state of the custom reducer.
|
|
708
721
|
* @template TAction - The type of the actions of the custom reducer.
|
|
@@ -722,7 +735,6 @@ declare function baseReducer<TState extends PHBaseState = PHBaseState>(document:
|
|
|
722
735
|
* - `SET_NAME`
|
|
723
736
|
* - `UNDO`
|
|
724
737
|
* - `REDO`
|
|
725
|
-
* - `PRUNE`
|
|
726
738
|
*
|
|
727
739
|
* It also updates the document-related attributes on every operation.
|
|
728
740
|
*
|
|
@@ -732,7 +744,6 @@ declare function baseReducer<TState extends PHBaseState = PHBaseState>(document:
|
|
|
732
744
|
* @returns The new reducer.
|
|
733
745
|
*/
|
|
734
746
|
declare function createReducer<TState extends PHBaseState = PHBaseState>(stateReducer: StateReducer<TState>, documentReducer?: typeof baseReducer): Reducer<TState>;
|
|
735
|
-
declare function pruneOperation<TState extends PHBaseState = PHBaseState>(document: PHDocument<TState>, input: PruneActionInput, wrappedReducer: StateReducer<TState>): PHDocument<TState>;
|
|
736
747
|
//#endregion
|
|
737
748
|
//#region document-model/reducers.d.ts
|
|
738
749
|
declare const documentModelHeaderReducer: DocumentModelHeaderOperations;
|
|
@@ -750,7 +761,7 @@ declare const documentModelReducer: Reducer<DocumentModelPHState>;
|
|
|
750
761
|
* Reserved operation names from base reducer (core/actions.ts).
|
|
751
762
|
* These names cannot be used for custom operations.
|
|
752
763
|
*/
|
|
753
|
-
declare const RESERVED_OPERATION_NAMES: readonly ["UNDO", "REDO", "
|
|
764
|
+
declare const RESERVED_OPERATION_NAMES: readonly ["UNDO", "REDO", "SET_NAME", "SET_PREFERRED_EDITOR", "NOOP"];
|
|
754
765
|
type ReservedOperationName = (typeof RESERVED_OPERATION_NAMES)[number];
|
|
755
766
|
/**
|
|
756
767
|
* Operation names become the literal action `type` string at runtime and the
|
|
@@ -832,5 +843,6 @@ declare function assertOperationErrorIdUnique(state: DocumentModelGlobalState, i
|
|
|
832
843
|
declare function assertOperationExampleIdUnique(state: DocumentModelGlobalState, id: string): void;
|
|
833
844
|
declare function validateOperations(operations: DocumentOperations): ValidationError[];
|
|
834
845
|
//#endregion
|
|
835
|
-
export {
|
|
836
|
-
|
|
846
|
+
export { fetchFileBrowser as $, isDocumentCreator as $n, documentModelInitialGlobalState as $t, documentModelVersioningReducer as A, InitializeAuthActionInput as An, assertIsDocumentModelState as At, createVerificationSigner as B, SetGrantActionInput as Bn, base64UrlToBytes as Bt, documentModelModuleReducer as C, AuthEvaluation as Cn, groupMembershipActionTypes as Ct, documentModelReducer as D, AuthVerb as Dn, DocumentModelPHStateSchema as Dt, documentModelOperationReducer as E, AuthSubject as En, DocumentModelHeaderSchema as Et, updateDocument as F, MoveGrantActionInputSchema as Fn, AUTH_VERSION_UNSUPPORTED_REASON as Ft, BulkArchiveEntry as G, applyRemoveGrantAction as Gn, hex2ab as Gt, sign as H, applyAuthAction as Hn, buildOperationSignatureParams as Ht, createCopyHeader as I, RemoveGrantAction as In, DOCUMENT_DELETED_REASON as It, baseSaveToFileHandle as J, assertAuthScopeActionAllowed as Jn, HASH_ALGORITHM_SHA512 as Jt, baseLoadFromInput as K, applySetGrantAction as Kn, HASH_ALGORITHM_SHA1 as Kt, createPresignedHeader as L, RemoveGrantActionInput as Ln, isDenied as Lt, createReducer as M, MAX_SUPPORTED_AUTH_VERSION as Mn, isDocumentModelState as Mt, processUndoRedo as N, MoveGrantAction as Nn, AUTH_DENIED_BY_GRANT_REASON as Nt, documentModelStateReducer as O, ConditionContext as On, DocumentModelSchema as Ot, replayOperations as P, MoveGrantActionInput as Pn, AUTH_NO_GRANT_REASON as Pt, documentModelSaveToFileHandle as Q, isAuthAction as Qn, documentModelGlobalState as Qt, createSignedHeader as R, RemoveGrantActionInputSchema as Rn, ab2hex as Rt, documentModelHeaderReducer as S, AuthDecision as Sn, groupDocumentType as St, documentModelOperationExampleReducer as T, AuthRequest as Tn, BaseDocumentStateSchema as Tt, validateHeader as U, applyInitializeAuthAction as Un, getUnixTimestamp as Ut, hasDerivedDocumentId as V, SetGrantActionInputSchema as Vn, buildOperationSignatureMessage as Vt, verify as W, applyMoveGrantAction as Wn, hashBrowser as Wt, createZip as X, evaluate as Xn, HASH_ENCODING_HEX as Xt, createMinimalZip as Y, decide as Yn, HASH_ENCODING_BASE64 as Yt, documentModelLoadFromInput as Z, initializeAuth as Zn, documentModelFileExtension as Zt, validateModuleOperation as _, grantProblem as _n, InvalidActionInputError as _t, assertOperationErrorIdUnique as a, InvalidGrantError as an, TransportAction as ar, zipEntries as at, validateOperations as b, AUTH_ACTION_TYPES as bn, UnsupportedDocumentModelVersionError as bt, findModuleOrThrow as c, MAX_CONDITION_DEPTH as cn, toTransportAction as cr, replayDocumentVersioned as ct, findOperationOrThrow as d, assertValidGrant as dn, AuthInitializerNotCreatorError as dt, documentModelInitialLocalState as en, mentionedGroupIds as er, getFileBrowser as et, getAllOperationNames as f, assertValidGrantUpsert as fn, AuthPolicyNotPreservedError as ft, validateModule as g, evaluateGrants as gn, HashMismatchError as gt, validateInitialState as h, evaluateGrantStack as hn, GrantNotFoundError as ht, assertModuleIdUnique as i, GroupPrincipalNotAllowedError as in, setGrant as ir, writeFileBrowser as it, baseReducer as j, InitializeAuthActionInputSchema as jn, isDocumentModelDocument as jt, documentModelStateSchemaReducer as k, InitializeAuthAction as kn, assertIsDocumentModelDocument as kt, findOperationErrorOrThrow as l, MAX_CONDITION_NODES as ln, AuthActionNotAllowedError as lt, isValidOperationNameFormat as m, evaluateCondition as mn, FileSystemError as mt, RESERVED_OPERATION_NAMES as n, AuthAdministrationMissingError as nn, removeGrant as nr, parseBulkArchive as nt, assertOperationExampleIdUnique as o, MAX_AUTH_GRANTS as on, TransportActionContext as or, VersionedReducers as ot, isReservedOperationName as p, assertValidInitialGrants as pn, DowngradeNotSupportedError as pt, baseLoadFromInputVersioned as q, assertAuthPreservedOnDuplicate as qn, HASH_ALGORITHM_SHA256 as qt, ReservedOperationName as r, GrantSchema as rn, resolveSnapshotAuth as rr, readFileBrowser as rt, assertOperationIdUnique as s, MAX_CAPABILITY_OPERATIONS as sn, TransportSigner as sr, VersionedReplayConfig as st, OPERATION_NAME_PATTERN as t, AuthAdministrationLockoutError as tn, moveGrant as tr, isDocumentZip as tt, findOperationExampleOrThrow as u, assertAuthAdministrationRetained as un, AuthAlreadyInitializedError as ut, validateModules as v, isPlainValue as vn, InvalidActionInputZodError as vt, documentModelOperationErrorReducer as w, AuthRefusal as wn, BaseDocumentHeaderSchema as wt, validateStateSchemaName as x, AuthAction as xn, documentModelDocumentType as xt, validateOperationName as y, referencedGroupIds as yn, InvalidAuthVersionError as yt, createSignedHeaderForSigner as z, SetGrantAction as zn, base58Decode as zt };
|
|
847
|
+
export {};
|
|
848
|
+
//# sourceMappingURL=index-CDDyUSHE.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CDDyUSHE.d.ts","names":[],"sources":["../document-model/action-transport.ts","../document-model/auth.ts","../document-model/auth-v1.ts","../document-model/constants.ts","../document-model/crypto.ts","../document-model/denied.ts","../document-model/document-schema.ts","../document-model/document-type.ts","../document-model/errors.ts","../document-model/versioned-replay.ts","../document-model/files.ts","../document-model/header.ts","../document-model/reducer.ts","../document-model/reducers.ts","../document-model/validation.ts"],"mappings":";;;;;;;;KAWY;EACV;IAAS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AAO,0BACP;;;;;iBAcc,wBACd,OAAO,0BACP;;;;;;iBAkBc,6BACd,OAAO,0BACP;;;;;;iBAkBc,+BACd,OAAO,0BACP;iBAac,mBAAmB,YAAY,qBAAkB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import "./types-VDHUeQnm.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-D0JljlgO.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-D0JljlgO.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 AddOperationExampleAction, $i 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
|
|
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 AddOperationExampleAction, $i as SetOperationReducerAction, $n as MutationRedoArgs, $r as ReorderModuleOperationsAction, $s as ProcessorDispatchResult, $t as DocumentModelOperationExampleOperations, A as PHReactorRenown, Aa as UpdateChangeLogItemAction, Ai as SetModelIdAction, An as MakeMaybe, Ar as NOOPAction, At as DeleteOperationErrorInput, Ba as User, Bi as SetNameOperation, Bn as MutationAddChangeLogItemInputArgs, Br as PowerhouseModule, Bt as DocumentModelGlobalState, C as PHConnectReactor, Ca as State, Ci as SetAuthorWebsiteInput, Cn as Incremental, Cr as MutationSetOperationSchemaArgs, Ct as DeleteChildDocumentSignal, D as PHConnectRuntimeConfig, Da as UndoAction, Di as SetModelDescriptionInput, Dn as LoadFromFile, Dr as MutationUpdateChangeLogItemInputArgs, Dt as DeleteModuleInput, E as PHConnectRenownAdapters, Ea as Undo, Ei as SetModelDescriptionAction, En as IsStateOfType, Er as MutationUndoArgs, Et as DeleteModuleAction, F as PathValidation, Fa as UpdateRelationshipActionInput, Fi as SetModuleDescriptionInput, Fn as MinimalBackupData, Fr as PartialRecord, Ft as DeleteStateExampleInput, G as Actions, Gi as SetOperationErrorDescriptionAction, Gn as MutationAddStateExampleArgs, Gr as RedoActionInput, Gt as DocumentModelLocalState, H as ActionSignatureContext, Hi as SetOperationDescriptionInput, Hn as MutationAddOperationArgs, Hr as Query, Ht as DocumentModelHeaderOperations, I as PowerhouseConfig, Ia as UpdateStateExampleAction, Ii as SetModuleNameAction, In as ModuleSpecification, Ir as PartialState, It as DocumentAction, J as AddModuleAction, Ji as SetOperationErrorNameInput, Jn as MutationDeleteOperationArgs, Jr as ReleaseNewVersionAction, Js as IProcessorDispatch, Jt as DocumentModelModuleOperations, K as AddChangeLogItemAction, Ki as SetOperationErrorDescriptionInput, Kn as MutationDeleteChangeLogItemInputArgs, Kr as Reducer, Kt as DocumentModelModule, L as PowerhousePackage, La as UpdateStateExampleInput, Li as SetModuleNameInput, Ln as MoveOperationAction, Lr as PhAiToolAnnotations, Lt as DocumentModelAction, M as PHRenownRainbowAdapterConfig, Ma as UpdateOperationExampleAction, Mi as SetModelNameAction, Mn as Manifest, Mr as OperationIndex, Mt as DeleteOperationExampleInput, N as PackageManagerArgs, Na as UpdateOperationExampleInput, Ni as SetModelNameInput, Nn as MappedOperation, Nr as OperationSpecification, Nt as DeleteOperationInput, O as PHConnectSentry, Oa as UndoActionInput, Oi as SetModelExtensionAction, On as LoadFromInput, Or as MutationUpdateOperationExampleArgs, Ot as DeleteOperationAction, P as ParsedCmdResult, Pa as UpdateRelationshipAction, Pi as SetModuleDescriptionAction, Pn as Maybe, Pr as OperationsByScope, Pt as DeleteStateExampleAction, Q as AddOperationErrorInput, Qi as SetOperationNameInput, Qn as MutationMoveOperationArgs, Qr as ReorderChangeLogItemsInput, Qs as ProcessorApps, Qt as DocumentModelOperationExampleAction, R as ServiceAction, Ra as UpgradeDocumentAction, Ri as SetNameAction, Rn as MoveOperationInput, Rr as PhAiToolDescriptor, Rt as DocumentModelDocument, S as PHConnectPwaUrlPattern, Sa as SkipHeaderOperations, Si as SetAuthorWebsiteAction, Sn as ISigner, Sr as MutationSetOperationReducerArgs, St as DeleteChildDocumentInput, T as PHConnectRenown, Ta as SubgraphModule, Ti as SetInitialStateInput, Tn as IsDocumentOfType, Tr as MutationSetStateSchemaArgs, Tt as DeleteDocumentActionInput, U as ActionSigningHandler, Ui as SetOperationErrorCodeAction, Un as MutationAddOperationErrorArgs, Ur as Redo, Ut as DocumentModelInput, V as ActionErrorCallback, Va as ValidationError, Vi as SetOperationDescriptionAction, Vn as MutationAddModuleArgs, Vr as Publisher, Vt as DocumentModelHeaderAction, W as ActionVerificationHandler, Wi as SetOperationErrorCodeInput, Wn as MutationAddOperationExampleArgs, Wr as RedoAction, Wt as DocumentModelLib, X as AddOperationAction, Xi as SetOperationErrorTemplateInput, Xn as MutationDeleteOperationExampleArgs, Xr as RemoveRelationshipActionInput, Xs as IProcessorManager, Xt as DocumentModelOperationErrorAction, Y as AddModuleInput, Yi as SetOperationErrorTemplateAction, Yn as MutationDeleteOperationErrorArgs, Yr as RemoveRelationshipAction, Ys as IProcessorHostModuleBase, Yt as DocumentModelOperationAction, Z as AddOperationErrorAction, Zi as SetOperationNameAction, Zn as MutationDeleteStateExampleArgs, Zr as ReorderChangeLogItemsAction, Zs as ProcessorApp, Zt as DocumentModelOperationErrorOperations, _ as PHConnectPwaCacheStrategy, _a as SignalResults, _i as SchemaSetPreferredEditorAction, _n as ID, _r as MutationSetOperationErrorCodeArgs, _t as CreateDocumentAction, a as PHConnectAi, aa as SetOperationTemplateAction, ac as TrackedProcessor, ai as ReorderOperationExamplesAction, an as DocumentModelVersioningAction, ar as MutationReorderStateExamplesArgs, at as AddStateExampleInput, b as PHConnectPwaManifest, ba as SigningParameters, bi as SetAuthorNameAction, bn as ISignal, br as MutationSetOperationErrorTemplateArgs, bt as DeleteChangeLogItemAction, c as PHConnectDefaultDrive, ca as SetPreferredEditorActionInput, ci as ReorderStateExamplesInput, cn as DocumentSpecification, cr as MutationSetInitialStateArgs, ct as Author, d as PHConnectDriveSection, da as SetStateSchemaInput, di as SaveToFile, dn as EditorModule, dr as MutationSetModelIdArgs, dt as ConfigEntryType, ea as SetOperationReducerInput, ec as ProcessorFactory, ei as ReorderModuleOperationsInput, en as DocumentModelOperationOperations, er as MutationReorderChangeLogItemsInputArgs, et as AddOperationExampleInput, f as PHConnectDriveSections, fa as Set_Name, fi as SaveToFileHandle, fn as EditorProps, fr as MutationSetModelNameArgs, ft as CopyChildDocumentInput, g as PHConnectPwa, ga as SignalResult, gi as SchemaSetNameAction, gn as IAction, gr as MutationSetOperationDescriptionArgs, gt as CreateDocument, h as PHConnectPackages, ha as SignalDispatch, hi as SchemaRedoAction, hn as GetDocumentOptions, hr as MutationSetNameArgs, ht as CreateChildDocumentSignal, i as LogLevels, ia as SetOperationScopeInput, ic as ProcessorStatus, ii as ReorderOperationErrorsInput, in as DocumentModelUtils, ir as MutationReorderOperationExamplesArgs, it as AddStateExampleAction, j as PHRenownPrivyAdapterConfig, ja as UpdateChangeLogItemInput, ji as SetModelIdInput, jn as MakeOptional, jr as OperationErrorSpecification, jt as DeleteOperationExampleAction, k as PHPackageProvider, ka as UndoRedoAction, ki as SetModelExtensionInput, kn as MakeEmpty, kr as MutationUpdateStateExampleArgs, kt as DeleteOperationErrorAction, l as PHConnectDefaultDriveLocal, la as SetPreferredEditorOperation, li as ReplayDocumentOptions, ln as ENSInfo, lr as MutationSetModelDescriptionArgs, lt as CodeExample, m as PHConnectInstance, ma as Signal, mi as SchemaNOOPAction, mn as FileInput, mr as MutationSetModuleNameArgs, mt as CreateChildDocumentInput, n as DrivePreserveStrategy, na as SetOperationSchemaInput, nc as ProcessorFilter, ni as ReorderModulesInput, nn as DocumentModelStateAction, nr as MutationReorderModulesArgs, nt as AddRelationshipAction, o as PHConnectApp, oa as SetOperationTemplateInput, oi as ReorderOperationExamplesInput, on as DocumentModelVersioningOperations, or as MutationSetAuthorNameArgs, ot as AssertIsDocumentOfType, p as PHConnectDrives, pa as Set_PreferredEditor, pi as Scalars, pn as Exact, pr as MutationSetModuleDescriptionArgs, pt as CopyChildDocumentSignal, q as AddChangeLogItemInput, qi as SetOperationErrorNameAction, qn as MutationDeleteModuleArgs, qr as ReducerOptions, qs as IProcessor, qt as DocumentModelModuleAction, r as LogLevel, ra as SetOperationScopeAction, rc as ProcessorRecord, ri as ReorderOperationErrorsAction, rn as DocumentModelStateOperations, rr as MutationReorderOperationErrorsArgs, rt as AddRelationshipActionInput, s as PHConnectBranding, sa as SetPreferredEditorAction, si as ReorderStateExamplesAction, sn as DocumentOperationsIgnoreMap, sr as MutationSetAuthorWebsiteArgs, st as AssertIsStateOfType, t as DrivePreserveStrategies, ta as SetOperationSchemaAction, tc as ProcessorFactoryBuilder, ti as ReorderModulesAction, tn as DocumentModelPHState, tr as MutationReorderModuleOperationsArgs, tt as AddOperationInput, u as PHConnectDefaultDriveRemote, ua as SetStateSchemaAction, ui as RevisionsFilter, un as EditorDispatch, ur as MutationSetModelExtensionArgs, ut as ConfigEntry, v as PHConnectPwaFileHandler, va as SignalType, vi as SchemaUndoAction, vn as IDocument, vr as MutationSetOperationErrorDescriptionArgs, vt as CreateDocumentActionInput, w as PHConnectReactorFeatureFlags, wa as StateReducer, wi as SetInitialStateAction, wn as InputMaybe, wr as MutationSetOperationTemplateArgs, wt as DeleteDocumentAction, x as PHConnectPwaRuntimeCaching, xa as SkipHeaderOperationIndex, xi as SetAuthorNameInput, xn as ISignalResult, xr as MutationSetOperationNameArgs, xt as DeleteChangeLogItemInput, y as PHConnectPwaIcon, ya as SignatureVerificationHandler, yi as ScopeState, yn as IOperation, yr as MutationSetOperationErrorNameArgs, yt as CreateState, z as ServiceActions, za as UpgradeDocumentActionInput, zi as SetNameActionInput, zn as Mutation, zr as PieceModule, zt as DocumentModelDocumentModelModule } from "./types-xLPOHE23.js";
|
|
3
|
+
import { i as PACKAGES_DEPENDENCIES, n as APPS_DEPENDENCIES, r as CLIS_DEPENDENCIES, t as ALL_POWERHOUSE_DEPENDENCIES } from "./constants-DO4IYxuR.js";
|
|
4
|
+
import { $ as DeleteNodeAction, A as TriggerData, B as RegistryPackageMap, C as RemoveTriggerInput, D as SetSharingTypeInput, E as SetDriveNameInput, F as PackageInfo, G as DocumentDriveAction, H as RegistryPackageStatus, I as PackageListItem, J as LegacyAddFileInput, K as DocumentDriveDocument, L as PackagePage, M as TriggerType, N as UpdateFileInput, O as TransmitterType, P as UpdateNodeInput, Q as CopyNodeAction, R as RegistryPackage, S as RemoveListenerInput, T as SetDriveIconInput, U as DocumentDrivePHState, V as RegistryPackageSource, W as DriveDocumentModelModule, X as AddFileAction, Y as LegacySynchronizationUnit, Z as AddFolderAction, _ as ListenerInput, a as CopyNodeInput, at as AddListenerAction, b as PullResponderTriggerData, c as DocumentDriveLocalState, ct as DocumentDriveDriveOperations, d as FolderNode, dt as SetAvailableOfflineAction, et as DocumentDriveNodeAction, f as Listener, ft as SetDriveIconAction, g as ListenerFilterInput, h as ListenerFilter, i as AddTriggerInput, it as UpdateNodeAction, j as TriggerInput, k as Trigger, lt as RemoveListenerAction, m as ListenerCallInfoInput, mt as SetSharingTypeAction, n as AddFolderInput, nt as MoveNodeAction, o as DeleteNodeInput, ot as AddTriggerAction, p as ListenerCallInfo, pt as SetDriveNameAction, q as LegacyAddFileAction, r as AddListenerInput, rt as UpdateFileAction, s as DocumentDriveGlobalState, st as DocumentDriveDriveAction, t as AddFileInput, tt as DocumentDriveNodeOperations, u as FileNode, ut as RemoveTriggerAction, v as MoveNodeInput, w as SetAvailableOfflineInput, x as PullResponderTriggerDataInput, y as Node, z as RegistryPackageList } from "./types-VDHUeQnm.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-D0JljlgO.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 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 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 PHConnectAi, type PHConnectApp, type PHConnectBranding, type PHConnectDefaultDrive, type PHConnectDefaultDriveLocal, type PHConnectDefaultDriveRemote, type PHConnectDriveSection, type PHConnectDriveSections, type PHConnectDrives, type PHConnectInstance, 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 PHPackageProvider, type PHReactorRenown, type PHRenownPrivyAdapterConfig, type PHRenownRainbowAdapterConfig, type PackageInfo, type PackageListItem, type PackageManagerArgs, type PackagePage, 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 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 { $s as ProcessorDispatchResult, Ac as WebhookSignatureEncoding, Bs as IBaseRelationalDb, Cc as WebhookEndpointInfo,
|
|
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 { $s as ProcessorDispatchResult, Ac as WebhookSignatureEncoding, Bs as IBaseRelationalDb, Cc as WebhookEndpointInfo, Dc as WebhookReply, Ec as WebhookPolicy, Fd as DEFAULT_RELATIONAL_PROCESSOR_DB_NAME, Fs as createRelationalDb, Gs as RelationalDbProcessor, Hs as IRelationalDbProcessor, Id as PROCESSOR_APPS, Is as hashNamespace, Js as IProcessorDispatch, Ks as RelationalDbProcessorClass, Ls as relationalDbToQueryBuilder, Mc as WebhookVerification, Ns as createNamespacedDb, Oc as WebhookRequest, Pd as DEFAULT_ANALYTICS_PROCESSOR_DB_NAME, Ps as createNamespacedQueryBuilder, Qs as ProcessorApps, Rs as ExtractProcessorSchemaOrSelf, Sc as ScopedRouteHandle, Tc as WebhookHashAlgorithm, Us as IRelationalQueryBuilder, Vs as IRelationalDb, Ws as IRelationalQueryMethods, Xs as IProcessorManager, Ys as IProcessorHostModuleBase, Zs as ProcessorApp, _c as RouteMethod, ac as TrackedProcessor, bc as RouteTransport, cc as IWebhookEndpoints, dc as RouteActor, ec as ProcessorFactory, fc as RouteAuth, gc as RouteHandler, hc as RouteContext, ic as ProcessorStatus, jc as WebhookSpec, kc as WebhookScheme, lc as IWebhookScope, mc as RouteBody, nc as ProcessorFilter, oc as AuthorizerResult, pc as RouteAuthorizer, qs as IProcessor, rc as ProcessorRecord, sc as IHttpScope, tc as ProcessorFactoryBuilder, uc as NodeRouteSpec, vc as RouteOptions, wc as WebhookField, xc as RouteUser, yc as RouteSpec, zs as HashAlgorithms } from "../types-xLPOHE23.js";
|
|
2
|
+
export { type AuthorizerResult, DEFAULT_ANALYTICS_PROCESSOR_DB_NAME, DEFAULT_RELATIONAL_PROCESSOR_DB_NAME, 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, hashNamespace, relationalDbToQueryBuilder };
|
|
3
|
+
export {};
|
package/dist/processors/index.js
CHANGED
|
@@ -23,7 +23,8 @@ const LOG2_26 = Math.log2(26);
|
|
|
23
23
|
*/
|
|
24
24
|
function hashNamespace(str, length = 10) {
|
|
25
25
|
const requiredBits = Math.ceil(length * LOG2_26);
|
|
26
|
-
|
|
26
|
+
const bitSize = SUPPORTED_SIZES.find((size) => size && size >= requiredBits) ?? 1024;
|
|
27
|
+
return toBase26(fnv1a(str, { size: bitSize }), length);
|
|
27
28
|
}
|
|
28
29
|
function toBase26(num, length = 10) {
|
|
29
30
|
const alphabet = "abcdefghijklmnopqrstuvwxyz";
|
|
@@ -78,6 +79,9 @@ const IS_RELATIONAL_DB_PROCESSOR = Symbol.for("ph.IS_RELATIONAL_DB_PROCESSOR");
|
|
|
78
79
|
* allowing derived classes to focus on business logic.
|
|
79
80
|
*/
|
|
80
81
|
var RelationalDbProcessor = class {
|
|
82
|
+
_namespace;
|
|
83
|
+
_filter;
|
|
84
|
+
relationalDb;
|
|
81
85
|
constructor(_namespace, _filter, relationalDb) {
|
|
82
86
|
this._namespace = _namespace;
|
|
83
87
|
this._filter = _filter;
|
|
@@ -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,
|
|
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,aAAa;AACvD,MAAa,uCAAuC;AACpD,MAAa,sCAAsC;;;ACMnD,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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