@pikku/cli 0.12.105 → 0.12.109
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/CHANGELOG.md +7433 -0
- package/console-app/assets/abnfDiagram-N423BO3Z-Bz2Ycfpe.js +1 -0
- package/console-app/assets/arc-D8VmsdJb.js +1 -0
- package/console-app/assets/architecture-TIHT7OUA-5QhJKy4P.js +1 -0
- package/console-app/assets/architectureDiagram-T3A2C74G-CvAkxhy0.js +36 -0
- package/console-app/assets/{blockDiagram-677ZJIJ3-CMNoQhwm.js → blockDiagram-VBNYF7ZC-CuVOo2PB.js} +5 -5
- package/console-app/assets/c4Diagram-5PPSVZJV-4Vg8SxCa.js +10 -0
- package/console-app/assets/channel-DoE3nnYB.js +1 -0
- package/console-app/assets/{chunk-32BRIVSS-DC3ZGIPN.js → chunk-2GRJ4B5K-CKKR4_dC.js} +1 -1
- package/console-app/assets/{chunk-HOUHSVGY-DMorD8Ib.js → chunk-4I5QYGJK-C-m_kVjm.js} +1 -1
- package/console-app/assets/chunk-5RXB4S5H-CyUGtd0h.js +231 -0
- package/console-app/assets/{chunk-MOJQB5TN-6BhXmDyj.js → chunk-6Q2QTUOP-BuzItInf.js} +1 -1
- package/console-app/assets/chunk-7Z6QIM7H-BGiBPuWt.js +10 -0
- package/console-app/assets/{chunk-V7JOEXUC-JMjbqEgu.js → chunk-GF5L2VYU-D8jaliB9.js} +3 -3
- package/console-app/assets/chunk-I66GZJ75-C-Lq_UXl.js +127 -0
- package/console-app/assets/chunk-JQJVKLGR-D7viK-tf.js +156 -0
- package/console-app/assets/{chunk-VR4S4FIN-BcHHugM0.js → chunk-KBJHAD2P-BS9N9gG4.js} +1 -1
- package/console-app/assets/{chunk-KEIR6QF5-DNzq6p3w.js → chunk-KEIR6QF5-BICK3FdT.js} +32 -32
- package/console-app/assets/chunk-NSK5VX7P-Fi_H0vaS.js +2 -0
- package/console-app/assets/{chunk-ZGVPDNZ5-CENGdlFJ.js → chunk-QR6OTTB3-BJdg-tcL.js} +3 -3
- package/console-app/assets/chunk-RYQCIY6F-CVbGA6YZ.js +1 -0
- package/console-app/assets/chunk-UBXNYLIW-BF-sAqEK.js +1 -0
- package/console-app/assets/{chunk-C7G6YPKG-BVtRZIEZ.js → chunk-W5SLKNZC-CXrJJ0BX.js} +1 -1
- package/console-app/assets/{chunk-Q4XR5HBZ-i4zkt4cc.js → chunk-WRU74C26-CGzysGBy.js} +7 -7
- package/console-app/assets/chunk-XXDRQBXY-BDALKVU4.js +1 -0
- package/console-app/assets/classDiagram-JCYQIIEL-BgrrHQtN.js +1 -0
- package/console-app/assets/classDiagram-v2-OCEON4UE-BgrrHQtN.js +1 -0
- package/console-app/assets/cose-bilkent-JH36ORCC-BvFZIDHb.js +1 -0
- package/console-app/assets/cynefin-VYW2F7L2-DRQ8xGmN.js +1 -0
- package/console-app/assets/cynefinDiagram-MW4NZA55-BwxQ4C1z.js +62 -0
- package/console-app/assets/cytoscape.esm-B-NFISlW.js +321 -0
- package/console-app/assets/dagre-J22zmNeE.js +1 -0
- package/console-app/assets/dagre-VZM6K2ZE-DPtUyvjD.js +4 -0
- package/console-app/assets/defaultLocale-BFoDCU3G.js +1 -0
- package/console-app/assets/{diagram-OA4YK3LP-BmjCoGBZ.js → diagram-7IWD3JNH-DGAzJ2Ln.js} +3 -3
- package/console-app/assets/{diagram-FQU43EPY-C667dC19.js → diagram-B4RE2ZJO-D14cIfto.js} +1 -1
- package/console-app/assets/diagram-LBJQPF4R-CUscJ_pO.js +24 -0
- package/console-app/assets/diagram-Q27KOJAE-CehBHMt3.js +24 -0
- package/console-app/assets/diagram-UB23O5K3-BvazI_qH.js +41 -0
- package/console-app/assets/dist-CsdsWTxp.js +1 -0
- package/console-app/assets/ebnfDiagram-BXEA7PRR-CBZPYFwZ.js +1 -0
- package/console-app/assets/{erDiagram-Q63AITRT-BAtdfbq3.js → erDiagram-JOGREHBK-BN3FevvT.js} +3 -3
- package/console-app/assets/eventmodeling-45OFAUF4-D2SxzJUl.js +1 -0
- package/console-app/assets/flowDiagram-UKHOOZJN-CQXuJ0z2.js +1 -0
- package/console-app/assets/ganttDiagram-PKOTCBZU-03mWH2kB.js +292 -0
- package/console-app/assets/gitGraph-TEB2WS4Q-By2486wn.js +1 -0
- package/console-app/assets/{gitGraphDiagram-IHSO6WYX-D9fpmYRm.js → gitGraphDiagram-DS77QQ5N-CCzKPRBJ.js} +4 -4
- package/console-app/assets/graphlib-IlWVLY3o.js +1 -0
- package/console-app/assets/index-snBzz_U8.js +290 -0
- package/console-app/assets/index-suVNAhyL.css +1 -0
- package/console-app/assets/info-DKCQHKI2-C_vsavqC.js +1 -0
- package/console-app/assets/infoDiagram-6WML65LV-BKvU8du7.js +2 -0
- package/console-app/assets/init-C-OQMol4.js +1 -0
- package/console-app/assets/isUndefined-T4snU1Mx.js +1 -0
- package/console-app/assets/{ishikawaDiagram-FXEZZL3T-CWHvEncb.js → ishikawaDiagram-WSZJBQD7-CnF0qm0n.js} +3 -3
- package/console-app/assets/{journeyDiagram-5HDEW3XC-DKH8UvEq.js → journeyDiagram-NVQOT4AX-DxKe9OZ7.js} +3 -3
- package/console-app/assets/{kanban-definition-HUTT4EX6-BODtp_fB.js → kanban-definition-27J2QSJJ-CB8lgPxU.js} +6 -6
- package/console-app/assets/{katex-Vhh-h91d.js → katex-CXMH3UgJ.js} +3 -3
- package/console-app/assets/{line-Do9j3HRL.js → line-DFNLso1I.js} +1 -1
- package/console-app/assets/linear-D1cspVtk.js +1 -0
- package/console-app/assets/map-BmPfXn7V.js +1 -0
- package/console-app/assets/{mermaid-parser.core-CYJsdwMO.js → mermaid-parser.core-BtmN233C.js} +3 -3
- package/console-app/assets/mermaid.core-37H5_HoB.js +42 -0
- package/console-app/assets/{mindmap-definition-LN4V7U3C-D7IWNYnf.js → mindmap-definition-FAOFIHXS-Czf82JOB.js} +3 -3
- package/console-app/assets/{ordinal-hYBb2elL.js → ordinal-BDEzSJ7C.js} +1 -1
- package/console-app/assets/packet-7NZHBO7P-CErYxAQM.js +1 -0
- package/console-app/assets/path-fybaL0A-.js +1 -0
- package/console-app/assets/pegDiagram-VL7TDLO6-CRKX6HOt.js +1 -0
- package/console-app/assets/pie-RZYD4A2V-YmMmh6Nq.js +1 -0
- package/console-app/assets/pieDiagram-7S7Q4E2Y-Cot0Fu5q.js +39 -0
- package/console-app/assets/{quadrantDiagram-ABIIQ3AL-CI840rae.js → quadrantDiagram-CIZ2JOQS-DPEonVYT.js} +2 -2
- package/console-app/assets/radar-I7S5WNFK-Pf_KiQJM.js +1 -0
- package/console-app/assets/railroad-3IZDKUUU-BYoOMoQY.js +1 -0
- package/console-app/assets/railroad-abnf-AHOZXSZD-CCRXsRRD.js +1 -0
- package/console-app/assets/railroad-ebnf-EBAXGLYW-DVRSVgn8.js +1 -0
- package/console-app/assets/railroad-peg-LSFZ7HO6-COUBoNH3.js +1 -0
- package/console-app/assets/railroadDiagram-AXF67PYL-Di8N9tHD.js +1 -0
- package/console-app/assets/{requirementDiagram-TGXJPOKE-CyHrMdrC.js → requirementDiagram-LRYGKXZP-2yZZ753q.js} +2 -2
- package/console-app/assets/rolldown-runtime-BcKkbAw3.js +1 -0
- package/console-app/assets/{rough.esm-CSKSodPl.js → rough.esm-Dy-Kn_BL.js} +1 -1
- package/console-app/assets/{sankeyDiagram-HTMAVEWB-DL0eJ1aK.js → sankeyDiagram-W5VNT64P-BwYA-xq1.js} +2 -2
- package/console-app/assets/sequenceDiagram-SI44F4Z6-odIxlx8J.js +162 -0
- package/console-app/assets/src-CxJwpjvz.js +1 -0
- package/console-app/assets/stateDiagram-OKZ733FA-Du2S0qU9.js +1 -0
- package/console-app/assets/stateDiagram-v2-UEYNNEHI-CTXOGDRR.js +1 -0
- package/console-app/assets/swimlanes-SLNWSIFB-JZ3swzI2.js +2 -0
- package/console-app/assets/swimlanesDiagram-ULZ7WXOC-DRrggQgK.js +8 -0
- package/console-app/assets/timeline-definition-Z64GVDOM-CsppAEWi.js +120 -0
- package/console-app/assets/treeView-QDETBFTQ-DkkO8peQ.js +1 -0
- package/console-app/assets/treemap-6X3UGDF4-hjLkPCJI.js +1 -0
- package/console-app/assets/vennDiagram-T6HMQDX7-BOfgM1xp.js +34 -0
- package/console-app/assets/wardley-OPB4EBWU-C5ZtGfBa.js +1 -0
- package/console-app/assets/{wardleyDiagram-EHGQE667-Cw2M8s0p.js → wardleyDiagram-T6FBY63Y-ymf3Vm6A.js} +36 -36
- package/console-app/assets/{xychartDiagram-FW5EYKEG-BxMLZdbF.js → xychartDiagram-ELKLHX3M-DdxXIoKz.js} +4 -4
- package/console-app/index.html +4 -2
- package/dist/.pikku/addon/index.d.ts +7 -0
- package/dist/.pikku/addon/index.js +7 -0
- package/dist/.pikku/addon/pikku-addon-types.gen.d.ts +7 -0
- package/dist/.pikku/addon/pikku-addon-types.gen.js +7 -0
- package/dist/.pikku/agent/index.d.ts +7 -0
- package/dist/.pikku/agent/index.js +7 -0
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +9 -8
- package/dist/.pikku/agent/pikku-agent-types.gen.js +2 -3
- package/dist/.pikku/agent/pikku-model-aliases.gen.js +2 -2
- package/dist/.pikku/auth/index.d.ts +8 -0
- package/dist/.pikku/auth/index.js +8 -0
- package/dist/.pikku/auth/pikku-auth-types.gen.d.ts +118 -0
- package/dist/.pikku/auth/pikku-auth-types.gen.js +92 -0
- package/dist/.pikku/channel/index.d.ts +7 -0
- package/dist/.pikku/channel/index.js +7 -0
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +7 -9
- package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -9
- package/dist/.pikku/cli/index.d.ts +7 -0
- package/dist/.pikku/cli/index.js +7 -0
- package/dist/.pikku/cli/pikku-cli-channel.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-channel.js +6 -5
- package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +2 -2
- package/dist/.pikku/cli/pikku-cli-client.gen.js +2 -2
- package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +4 -3
- package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +2 -2
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +45 -60
- package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli.gen.js +2 -2
- package/dist/.pikku/console/index.d.ts +1 -0
- package/dist/.pikku/console/index.js +1 -0
- package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
- package/dist/.pikku/error/index.d.ts +7 -0
- package/dist/.pikku/error/index.js +7 -0
- package/dist/.pikku/error/pikku-error-types.gen.d.ts +7 -0
- package/dist/.pikku/error/pikku-error-types.gen.js +7 -0
- package/dist/.pikku/function/index.d.ts +7 -0
- package/dist/.pikku/function/index.js +7 -0
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +28 -262
- package/dist/.pikku/function/pikku-function-types.gen.js +2 -237
- package/dist/.pikku/function/pikku-functions-meta.gen.js +2 -2
- package/dist/.pikku/function/pikku-functions-meta.gen.json +124 -102
- package/dist/.pikku/function/pikku-functions.gen.js +7 -5
- package/dist/.pikku/gateway/index.d.ts +7 -0
- package/dist/.pikku/gateway/index.js +7 -0
- package/dist/.pikku/gateway/pikku-gateway-types.gen.d.ts +36 -0
- package/dist/.pikku/gateway/pikku-gateway-types.gen.js +25 -0
- package/dist/.pikku/http/index.d.ts +7 -0
- package/dist/.pikku/http/index.js +7 -0
- package/dist/.pikku/http/pikku-http-types.gen.d.ts +6 -24
- package/dist/.pikku/http/pikku-http-types.gen.js +2 -24
- package/dist/.pikku/mcp/index.d.ts +7 -0
- package/dist/.pikku/mcp/index.js +7 -0
- package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +6 -4
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
- package/dist/.pikku/middleware/index.d.ts +7 -0
- package/dist/.pikku/middleware/index.js +7 -0
- package/dist/.pikku/middleware/pikku-middleware-types.gen.d.ts +117 -0
- package/dist/.pikku/middleware/pikku-middleware-types.gen.js +108 -0
- package/dist/.pikku/node/index.d.ts +1 -0
- package/dist/.pikku/node/index.js +1 -0
- package/dist/.pikku/pikku-bootstrap-scenarios.gen.d.ts +1 -1
- package/dist/.pikku/pikku-bootstrap-scenarios.gen.js +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
- package/dist/.pikku/pikku-meta-service.gen.d.ts +1 -1
- package/dist/.pikku/pikku-meta-service.gen.js +1 -1
- package/dist/.pikku/pikku-services.gen.d.ts +1 -1
- package/dist/.pikku/pikku-types.gen.d.ts +1 -1
- package/dist/.pikku/pikku-types.gen.js +1 -1
- package/dist/.pikku/queue/index.d.ts +7 -0
- package/dist/.pikku/queue/index.js +7 -0
- package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +2 -2
- package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +2 -2
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +2 -2
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +3 -2
- package/dist/.pikku/scenarios/index.d.ts +7 -0
- package/dist/.pikku/scenarios/index.js +7 -0
- package/dist/.pikku/scenarios/pikku-personas.gen.d.ts +17 -0
- package/dist/.pikku/scenarios/pikku-personas.gen.js +17 -0
- package/dist/.pikku/scenarios/pikku-scenario-functions-meta.gen.js +2 -2
- package/dist/.pikku/scenarios/pikku-scenario-functions.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-types.gen.d.ts +310 -0
- package/dist/.pikku/scenarios/pikku-scenario-types.gen.js +71 -0
- package/dist/.pikku/scenarios/pikku-scenario-wirings-meta.gen.js +2 -2
- package/dist/.pikku/scenarios/pikku-scenario-wirings.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/schemas/register.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/schemas/register.gen.js +1 -1
- package/dist/.pikku/scheduler/index.d.ts +7 -0
- package/dist/.pikku/scheduler/index.js +7 -0
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +4 -3
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
- package/dist/.pikku/schemas/register.gen.js +4 -4
- package/dist/.pikku/scopes/index.d.ts +7 -0
- package/dist/.pikku/scopes/index.js +7 -0
- package/dist/.pikku/scopes/pikku-personas.gen.d.ts +4 -13
- package/dist/.pikku/scopes/pikku-personas.gen.js +1 -1
- package/dist/.pikku/scopes/pikku-roles.gen.d.ts +2 -2
- package/dist/.pikku/scopes/pikku-roles.gen.js +1 -1
- package/dist/.pikku/scopes/pikku-scope-types.gen.d.ts +3 -5
- package/dist/.pikku/scopes/pikku-scope-types.gen.js +3 -3
- package/dist/.pikku/scopes/pikku-scopes.gen.d.ts +2 -2
- package/dist/.pikku/scopes/pikku-scopes.gen.js +1 -1
- package/dist/.pikku/secrets/index.d.ts +8 -0
- package/dist/.pikku/secrets/index.js +8 -0
- package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -3
- package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +8 -12
- package/dist/.pikku/secrets/pikku-secrets.gen.js +7 -9
- package/dist/.pikku/services/pikku-meta-service.gen.d.ts +7 -0
- package/dist/.pikku/services/pikku-meta-service.gen.js +9 -0
- package/dist/.pikku/setup/index.d.ts +7 -0
- package/dist/.pikku/setup/index.js +7 -0
- package/dist/.pikku/setup/pikku-setup-types.gen.d.ts +66 -0
- package/dist/.pikku/setup/pikku-setup-types.gen.js +87 -0
- package/dist/.pikku/trigger/index.d.ts +7 -0
- package/dist/.pikku/trigger/index.js +7 -0
- package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +8 -8
- package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
- package/dist/.pikku/variables/index.d.ts +8 -0
- package/dist/.pikku/variables/index.js +8 -0
- package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -2
- package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.d.ts +8 -11
- package/dist/.pikku/variables/pikku-variables.gen.js +8 -10
- package/dist/.pikku/workflow/index.d.ts +7 -0
- package/dist/.pikku/workflow/index.js +7 -0
- package/dist/.pikku/workflow/meta/allWorkflow.gen.json +97 -74
- package/dist/.pikku/workflow/pikku-personas.gen.d.ts +1 -3
- package/dist/.pikku/workflow/pikku-personas.gen.js +2 -2
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +22 -264
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -64
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +2 -2
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +0 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
- package/dist/bin/pikku-bin.mjs +2 -2
- package/dist/src/cli.wiring.js +19 -45
- package/dist/src/deploy/analyzer/analyzer.js +34 -12
- package/dist/src/deploy/build-pipeline.d.ts +13 -0
- package/dist/src/deploy/build-pipeline.js +22 -0
- package/dist/src/deploy/server-entry.js +1 -1
- package/dist/src/fabric/fabric-commands.d.ts +104 -104
- package/dist/src/fabric/functions/add.function.d.ts +4 -4
- package/dist/src/fabric/functions/add.function.js +1 -1
- package/dist/src/fabric/functions/addon-verify.function.d.ts +4 -4
- package/dist/src/fabric/functions/addon-verify.function.js +1 -1
- package/dist/src/fabric/functions/db-schema.function.d.ts +4 -4
- package/dist/src/fabric/functions/db-schema.function.js +1 -1
- package/dist/src/fabric/functions/deploy-list.function.d.ts +4 -4
- package/dist/src/fabric/functions/deploy-list.function.js +1 -1
- package/dist/src/fabric/functions/deploy-units.function.d.ts +4 -4
- package/dist/src/fabric/functions/deploy-units.function.js +1 -1
- package/dist/src/fabric/functions/deploy.function.d.ts +8 -8
- package/dist/src/fabric/functions/deploy.function.js +1 -1
- package/dist/src/fabric/functions/domains-add.function.d.ts +4 -4
- package/dist/src/fabric/functions/domains-add.function.js +1 -1
- package/dist/src/fabric/functions/domains-list.function.d.ts +4 -4
- package/dist/src/fabric/functions/domains-list.function.js +1 -1
- package/dist/src/fabric/functions/domains-remove.function.d.ts +4 -4
- package/dist/src/fabric/functions/domains-remove.function.js +1 -1
- package/dist/src/fabric/functions/errors.function.d.ts +4 -4
- package/dist/src/fabric/functions/errors.function.js +1 -1
- package/dist/src/fabric/functions/init.function.d.ts +4 -4
- package/dist/src/fabric/functions/init.function.js +1 -1
- package/dist/src/fabric/functions/link.function.d.ts +4 -4
- package/dist/src/fabric/functions/link.function.js +1 -1
- package/dist/src/fabric/functions/llm-key.function.d.ts +4 -4
- package/dist/src/fabric/functions/llm-key.function.js +1 -1
- package/dist/src/fabric/functions/login.function.d.ts +4 -4
- package/dist/src/fabric/functions/login.function.js +1 -1
- package/dist/src/fabric/functions/logs.function.d.ts +4 -4
- package/dist/src/fabric/functions/logs.function.js +1 -1
- package/dist/src/fabric/functions/metrics.function.d.ts +4 -4
- package/dist/src/fabric/functions/metrics.function.js +1 -1
- package/dist/src/fabric/functions/publish.function.d.ts +4 -4
- package/dist/src/fabric/functions/publish.function.js +1 -1
- package/dist/src/fabric/functions/rollback.function.d.ts +4 -4
- package/dist/src/fabric/functions/rollback.function.js +1 -1
- package/dist/src/fabric/functions/secrets-list.function.d.ts +4 -4
- package/dist/src/fabric/functions/secrets-list.function.js +1 -1
- package/dist/src/fabric/functions/secrets-rotate.function.d.ts +4 -4
- package/dist/src/fabric/functions/secrets-rotate.function.js +1 -1
- package/dist/src/fabric/functions/secrets-set.function.d.ts +4 -4
- package/dist/src/fabric/functions/secrets-set.function.js +1 -1
- package/dist/src/fabric/functions/smoke.function.d.ts +4 -4
- package/dist/src/fabric/functions/smoke.function.js +13 -13
- package/dist/src/fabric/functions/status.function.d.ts +4 -4
- package/dist/src/fabric/functions/status.function.js +1 -1
- package/dist/src/fabric/functions/trace.function.d.ts +4 -4
- package/dist/src/fabric/functions/trace.function.js +1 -1
- package/dist/src/fabric/functions/validate.function.d.ts +4 -4
- package/dist/src/fabric/functions/validate.function.js +114 -31
- package/dist/src/fabric/lib/git.d.ts +23 -0
- package/dist/src/fabric/lib/git.js +39 -0
- package/dist/src/functions/commands/all.d.ts +1 -1
- package/dist/src/functions/commands/all.js +1 -1
- package/dist/src/functions/commands/audit.d.ts +11 -1
- package/dist/src/functions/commands/audit.js +26 -14
- package/dist/src/functions/commands/binary.d.ts +4 -4
- package/dist/src/functions/commands/binary.js +1 -1
- package/dist/src/functions/commands/bootstrap.d.ts +1 -1
- package/dist/src/functions/commands/bootstrap.js +4 -3
- package/dist/src/functions/commands/bun-coverage-loader.js +4 -1
- package/dist/src/functions/commands/db-audit.d.ts +1 -1
- package/dist/src/functions/commands/db-audit.js +1 -1
- package/dist/src/functions/commands/db-baseline.d.ts +1 -1
- package/dist/src/functions/commands/db-baseline.js +1 -1
- package/dist/src/functions/commands/db-check.d.ts +1 -1
- package/dist/src/functions/commands/db-check.js +1 -1
- package/dist/src/functions/commands/db-codegen.d.ts +1 -1
- package/dist/src/functions/commands/db-codegen.js +1 -1
- package/dist/src/functions/commands/db-export.d.ts +1 -1
- package/dist/src/functions/commands/db-export.js +1 -1
- package/dist/src/functions/commands/db-generate.d.ts +1 -1
- package/dist/src/functions/commands/db-generate.js +1 -1
- package/dist/src/functions/commands/db-migrate.d.ts +1 -1
- package/dist/src/functions/commands/db-migrate.js +1 -1
- package/dist/src/functions/commands/db-reset.d.ts +4 -4
- package/dist/src/functions/commands/db-reset.js +1 -1
- package/dist/src/functions/commands/deploy-apply.d.ts +4 -4
- package/dist/src/functions/commands/deploy-apply.js +14 -2
- package/dist/src/functions/commands/deploy-info.d.ts +1 -1
- package/dist/src/functions/commands/deploy-info.js +1 -1
- package/dist/src/functions/commands/deploy-plan.d.ts +4 -4
- package/dist/src/functions/commands/deploy-plan.js +6 -2
- package/dist/src/functions/commands/dev-agent-runner.d.ts +2 -1
- package/dist/src/functions/commands/dev-agent-runner.js +48 -13
- package/dist/src/functions/commands/dev.d.ts +4 -4
- package/dist/src/functions/commands/dev.js +10 -10
- package/dist/src/functions/commands/emails-init.d.ts +1 -1
- package/dist/src/functions/commands/emails-init.js +19 -6
- package/dist/src/functions/commands/enable.d.ts +8 -8
- package/dist/src/functions/commands/enable.js +12 -26
- package/dist/src/functions/commands/environment.d.ts +27 -0
- package/dist/src/functions/commands/environment.js +36 -2
- package/dist/src/functions/commands/import-n8n.d.ts +4 -4
- package/dist/src/functions/commands/import-n8n.js +1 -1
- package/dist/src/functions/commands/info.d.ts +4 -4
- package/dist/src/functions/commands/info.js +1 -1
- package/dist/src/functions/commands/knowledge-index.d.ts +4 -4
- package/dist/src/functions/commands/knowledge-index.js +1 -1
- package/dist/src/functions/commands/knowledge-validate.d.ts +4 -4
- package/dist/src/functions/commands/knowledge-validate.js +1 -1
- package/dist/src/functions/commands/login.d.ts +9 -9
- package/dist/src/functions/commands/login.js +1 -1
- package/dist/src/functions/commands/meta.d.ts +37 -37
- package/dist/src/functions/commands/meta.js +1 -1
- package/dist/src/functions/commands/new-addon.d.ts +5 -4
- package/dist/src/functions/commands/new-addon.js +27 -25
- package/dist/src/functions/commands/new-function.d.ts +4 -4
- package/dist/src/functions/commands/new-function.js +4 -4
- package/dist/src/functions/commands/new-middleware.d.ts +4 -4
- package/dist/src/functions/commands/new-middleware.js +3 -3
- package/dist/src/functions/commands/new-permission.d.ts +4 -4
- package/dist/src/functions/commands/new-permission.js +3 -3
- package/dist/src/functions/commands/new-wiring.d.ts +4 -4
- package/dist/src/functions/commands/new-wiring.js +8 -8
- package/dist/src/functions/commands/persona-sync.d.ts +4 -4
- package/dist/src/functions/commands/persona-sync.js +3 -3
- package/dist/src/functions/commands/persona.d.ts +5 -5
- package/dist/src/functions/commands/persona.js +3 -4
- package/dist/src/functions/commands/pikku-command-bootstrap.d.ts +1 -1
- package/dist/src/functions/commands/pikku-command-bootstrap.js +7 -2
- package/dist/src/functions/commands/pikku-command-summary.d.ts +1 -1
- package/dist/src/functions/commands/pikku-command-summary.js +2 -2
- package/dist/src/functions/commands/roles-audit.d.ts +1 -1
- package/dist/src/functions/commands/roles-audit.js +1 -1
- package/dist/src/functions/commands/roles-prune.d.ts +4 -4
- package/dist/src/functions/commands/roles-prune.js +1 -1
- package/dist/src/functions/commands/roles-shared.d.ts +1 -1
- package/dist/src/functions/commands/roles-shared.js +1 -1
- package/dist/src/functions/commands/scenario-browser.d.ts +19 -13
- package/dist/src/functions/commands/scenario-browser.js +20 -6
- package/dist/src/functions/commands/scenario-formatter.d.ts +6 -52
- package/dist/src/functions/commands/scenario-ladder.d.ts +4 -5
- package/dist/src/functions/commands/scenario-ladder.js +1 -1
- package/dist/src/functions/commands/scenario-plan.d.ts +2 -2
- package/dist/src/functions/commands/scenario-plan.js +1 -1
- package/dist/src/functions/commands/scenario.d.ts +8 -8
- package/dist/src/functions/commands/scenario.js +73 -23
- package/dist/src/functions/commands/scopes-audit.d.ts +1 -1
- package/dist/src/functions/commands/scopes-audit.js +1 -1
- package/dist/src/functions/commands/scopes-prune.d.ts +4 -4
- package/dist/src/functions/commands/scopes-prune.js +1 -1
- package/dist/src/functions/commands/scopes-shared.d.ts +1 -1
- package/dist/src/functions/commands/scopes-shared.js +1 -1
- package/dist/src/functions/commands/semver.d.ts +1 -1
- package/dist/src/functions/commands/semver.js +1 -1
- package/dist/src/functions/commands/serve.d.ts +4 -4
- package/dist/src/functions/commands/serve.js +9 -8
- package/dist/src/functions/commands/skills.d.ts +8 -8
- package/dist/src/functions/commands/skills.js +1 -1
- package/dist/src/functions/commands/start-coverage.d.ts +1 -1
- package/dist/src/functions/commands/start-coverage.js +2 -2
- package/dist/src/functions/commands/update.d.ts +1 -1
- package/dist/src/functions/commands/update.js +1 -1
- package/dist/src/functions/commands/validate.d.ts +4 -4
- package/dist/src/functions/commands/validate.js +1 -1
- package/dist/src/functions/commands/versions-check.d.ts +1 -1
- package/dist/src/functions/commands/versions-check.js +1 -1
- package/dist/src/functions/commands/versions-init.d.ts +4 -4
- package/dist/src/functions/commands/versions-init.js +1 -1
- package/dist/src/functions/commands/versions-update.d.ts +1 -1
- package/dist/src/functions/commands/versions-update.js +1 -1
- package/dist/src/functions/commands/virtual-user-formatter.d.ts +1 -1
- package/dist/src/functions/commands/watch.d.ts +4 -4
- package/dist/src/functions/commands/watch.js +1 -1
- package/dist/src/functions/db/annotation-parser.d.ts +11 -3
- package/dist/src/functions/db/better-auth-schema.js +1 -1
- package/dist/src/functions/db/db-codegen.js +4 -2
- package/dist/src/functions/db/local-db.js +3 -3
- package/dist/src/functions/runtimes/fetch/index.d.ts +1 -1
- package/dist/src/functions/runtimes/fetch/index.js +1 -1
- package/dist/src/functions/runtimes/nextjs/pikku-command-nextjs.d.ts +1 -1
- package/dist/src/functions/runtimes/nextjs/pikku-command-nextjs.js +1 -1
- package/dist/src/functions/runtimes/tanstack-start/pikku-command-tanstack-start.d.ts +1 -1
- package/dist/src/functions/runtimes/tanstack-start/pikku-command-tanstack-start.js +7 -7
- package/dist/src/functions/runtimes/websocket/pikku-command-websocket-typed.d.ts +1 -1
- package/dist/src/functions/runtimes/websocket/pikku-command-websocket-typed.js +1 -1
- package/dist/src/functions/surface/build-surface-doc.d.ts +22 -0
- package/dist/src/functions/surface/build-surface-doc.js +151 -0
- package/dist/src/functions/surface/collect-surface-usage.d.ts +16 -0
- package/dist/src/functions/surface/collect-surface-usage.js +35 -0
- package/dist/src/functions/surface/collect-surface.d.ts +19 -1
- package/dist/src/functions/surface/collect-surface.js +104 -16
- package/dist/src/functions/surface/generate-surface-doc.d.ts +1 -0
- package/dist/src/functions/surface/generate-surface-doc.js +46 -0
- package/dist/src/functions/surface/shipped-surface-doc.d.ts +16 -0
- package/dist/src/functions/surface/shipped-surface-doc.js +44 -0
- package/dist/src/functions/surface/surface-doc.types.d.ts +69 -0
- package/dist/src/functions/surface/surface-doc.types.js +1 -0
- package/dist/src/functions/surface/surface-editorial.d.ts +25 -0
- package/dist/src/functions/surface/surface-editorial.js +101 -0
- package/dist/src/functions/surface/write-surface-usage.d.ts +12 -0
- package/dist/src/functions/surface/write-surface-usage.js +18 -0
- package/dist/src/functions/validate/pikku-barrel-checks.d.ts +12 -0
- package/dist/src/functions/validate/pikku-barrel-checks.js +97 -0
- package/dist/src/functions/validate/shared-checks.d.ts +10 -0
- package/dist/src/functions/validate/shared-checks.js +17 -3
- package/dist/src/functions/validate/validate-registry.js +10 -0
- package/dist/src/functions/wirings/agent/pikku-command-agent-types.d.ts +1 -1
- package/dist/src/functions/wirings/agent/pikku-command-agent-types.js +3 -2
- package/dist/src/functions/wirings/agent/pikku-command-agent.d.ts +1 -1
- package/dist/src/functions/wirings/agent/pikku-command-agent.js +4 -4
- package/dist/src/functions/wirings/agent/pikku-command-public-agent.d.ts +1 -1
- package/dist/src/functions/wirings/agent/pikku-command-public-agent.js +4 -5
- package/dist/src/functions/wirings/agent/serialize-agent-map.d.ts +1 -1
- package/dist/src/functions/wirings/agent/serialize-agent-types.d.ts +1 -1
- package/dist/src/functions/wirings/agent/serialize-agent-types.js +17 -12
- package/dist/src/functions/wirings/agent/serialize-model-aliases.js +1 -1
- package/dist/src/functions/wirings/agent/serialize-public-agent.d.ts +1 -1
- package/dist/src/functions/wirings/agent/serialize-public-agent.js +14 -13
- package/dist/src/functions/wirings/agent-scorer/pikku-command-agent-scorer.d.ts +1 -1
- package/dist/src/functions/wirings/agent-scorer/pikku-command-agent-scorer.js +4 -4
- package/dist/src/functions/wirings/agent-scorer/serialize-scorer-names.d.ts +1 -1
- package/dist/src/functions/wirings/auth/pikku-command-auth.d.ts +4 -4
- package/dist/src/functions/wirings/auth/pikku-command-auth.js +5 -4
- package/dist/src/functions/wirings/auth/serialize-auth-gen.d.ts +1 -1
- package/dist/src/functions/wirings/auth/serialize-auth-gen.js +3 -8
- package/dist/src/functions/wirings/auth/serialize-auth-guards.d.ts +12 -0
- package/dist/src/functions/wirings/auth/serialize-auth-guards.js +168 -0
- package/dist/src/functions/wirings/auth/serialize-auth-types.d.ts +4 -4
- package/dist/src/functions/wirings/auth/serialize-auth-types.js +4 -4
- package/dist/src/functions/wirings/channels/pikku-channels.d.ts +1 -1
- package/dist/src/functions/wirings/channels/pikku-channels.js +2 -2
- package/dist/src/functions/wirings/channels/pikku-command-channel-types.d.ts +1 -1
- package/dist/src/functions/wirings/channels/pikku-command-channel-types.js +6 -3
- package/dist/src/functions/wirings/channels/pikku-command-channels-map.d.ts +1 -1
- package/dist/src/functions/wirings/channels/pikku-command-channels-map.js +1 -1
- package/dist/src/functions/wirings/channels/pikku-command-channels.d.ts +1 -1
- package/dist/src/functions/wirings/channels/pikku-command-channels.js +2 -2
- package/dist/src/functions/wirings/channels/serialize-channel-types.d.ts +3 -1
- package/dist/src/functions/wirings/channels/serialize-channel-types.js +18 -25
- package/dist/src/functions/wirings/channels/serialize-typed-channel-map.d.ts +2 -3
- package/dist/src/functions/wirings/cli/pikku-command-cli-entry.d.ts +1 -1
- package/dist/src/functions/wirings/cli/pikku-command-cli-entry.js +2 -2
- package/dist/src/functions/wirings/cli/pikku-command-cli-types.d.ts +1 -1
- package/dist/src/functions/wirings/cli/pikku-command-cli-types.js +3 -3
- package/dist/src/functions/wirings/cli/pikku-command-cli.d.ts +1 -1
- package/dist/src/functions/wirings/cli/pikku-command-cli.js +2 -2
- package/dist/src/functions/wirings/cli/serialize-channel-cli-client.d.ts +1 -1
- package/dist/src/functions/wirings/cli/serialize-channel-cli-client.js +3 -3
- package/dist/src/functions/wirings/cli/serialize-channel-cli.d.ts +2 -2
- package/dist/src/functions/wirings/cli/serialize-channel-cli.js +11 -5
- package/dist/src/functions/wirings/cli/serialize-cli-types.d.ts +1 -1
- package/dist/src/functions/wirings/cli/serialize-cli-types.js +8 -3
- package/dist/src/functions/wirings/cli/serialize-local-cli-bootstrap.js +1 -1
- package/dist/src/functions/wirings/console/pikku-command-console-functions.d.ts +1 -1
- package/dist/src/functions/wirings/console/pikku-command-console-functions.js +6 -5
- package/dist/src/functions/wirings/console/pikku-command-nodes-meta.d.ts +1 -1
- package/dist/src/functions/wirings/console/pikku-command-nodes-meta.js +2 -2
- package/dist/src/functions/wirings/console/serialize-console-functions.d.ts +1 -1
- package/dist/src/functions/wirings/console/serialize-console-functions.js +20 -4
- package/dist/src/functions/wirings/credentials/pikku-command-credentials.d.ts +1 -1
- package/dist/src/functions/wirings/credentials/pikku-command-credentials.js +2 -2
- package/dist/src/functions/wirings/credentials/serialize-credentials-types.d.ts +1 -1
- package/dist/src/functions/wirings/credentials/serialize-credentials-types.js +4 -6
- package/dist/src/functions/wirings/emails/pikku-command-emails.d.ts +1 -1
- package/dist/src/functions/wirings/emails/pikku-command-emails.js +3 -3
- package/dist/src/functions/wirings/emails/serialize-emails.js +114 -44
- package/dist/src/functions/wirings/errors/pikku-command-error-types.d.ts +1 -0
- package/dist/src/functions/wirings/errors/pikku-command-error-types.js +17 -0
- package/dist/src/functions/wirings/errors/serialize-error-types.d.ts +9 -0
- package/dist/src/functions/wirings/errors/serialize-error-types.js +16 -0
- package/dist/src/functions/wirings/functions/pikku-command-addon-types.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-addon-types.js +20 -8
- package/dist/src/functions/wirings/functions/pikku-command-function-types-split.d.ts +4 -4
- package/dist/src/functions/wirings/functions/pikku-command-function-types-split.js +17 -3
- package/dist/src/functions/wirings/functions/pikku-command-functions.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-functions.js +2 -2
- package/dist/src/functions/wirings/functions/pikku-command-leaf-indexes.d.ts +14 -0
- package/dist/src/functions/wirings/functions/pikku-command-leaf-indexes.js +119 -0
- package/dist/src/functions/wirings/functions/pikku-command-services.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-services.js +18 -3
- package/dist/src/functions/wirings/functions/schemas.d.ts +1 -1
- package/dist/src/functions/wirings/functions/schemas.js +1 -1
- package/dist/src/functions/wirings/functions/serialize-addon-types.d.ts +13 -0
- package/dist/src/functions/wirings/functions/serialize-addon-types.js +20 -2
- package/dist/src/functions/wirings/functions/serialize-function-imports.d.ts +1 -1
- package/dist/src/functions/wirings/functions/serialize-function-types.d.ts +7 -2
- package/dist/src/functions/wirings/functions/serialize-function-types.js +47 -361
- package/dist/src/functions/wirings/functions/serialize-leaf-index.d.ts +17 -0
- package/dist/src/functions/wirings/functions/serialize-leaf-index.js +27 -0
- package/dist/src/functions/wirings/gateway/pikku-command-gateway-types.d.ts +7 -0
- package/dist/src/functions/wirings/gateway/pikku-command-gateway-types.js +24 -0
- package/dist/src/functions/wirings/gateway/pikku-command-gateway.d.ts +1 -1
- package/dist/src/functions/wirings/gateway/pikku-command-gateway.js +1 -1
- package/dist/src/functions/wirings/gateway/serialize-gateway-meta.d.ts +1 -1
- package/dist/src/functions/wirings/gateway/serialize-gateway-types.d.ts +6 -0
- package/dist/src/functions/wirings/gateway/serialize-gateway-types.js +55 -0
- package/dist/src/functions/wirings/graph/pikku-command-graph-wirings.d.ts +1 -1
- package/dist/src/functions/wirings/graph/pikku-command-graph-wirings.js +3 -4
- package/dist/src/functions/wirings/graph/serialize-graph-wirings.d.ts +1 -1
- package/dist/src/functions/wirings/graph/serialize-graph-wirings.js +2 -2
- package/dist/src/functions/wirings/http/pikku-command-http-map.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-command-http-map.js +3 -3
- package/dist/src/functions/wirings/http/pikku-command-http-routes.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-command-http-routes.js +2 -2
- package/dist/src/functions/wirings/http/pikku-command-http-types.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-command-http-types.js +7 -3
- package/dist/src/functions/wirings/http/pikku-command-openapi.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-command-openapi.js +1 -1
- package/dist/src/functions/wirings/http/pikku-http-routes.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-http-routes.js +2 -2
- package/dist/src/functions/wirings/http/serialize-http-types.d.ts +3 -1
- package/dist/src/functions/wirings/http/serialize-http-types.js +20 -36
- package/dist/src/functions/wirings/http/serialize-typed-http-map.d.ts +6 -2
- package/dist/src/functions/wirings/http/serialize-typed-http-map.js +5 -4
- package/dist/src/functions/wirings/mcp/pikku-command-mcp-json.d.ts +1 -1
- package/dist/src/functions/wirings/mcp/pikku-command-mcp-json.js +1 -1
- package/dist/src/functions/wirings/mcp/pikku-command-mcp-types.d.ts +1 -1
- package/dist/src/functions/wirings/mcp/pikku-command-mcp-types.js +5 -2
- package/dist/src/functions/wirings/mcp/pikku-command-mcp.d.ts +1 -1
- package/dist/src/functions/wirings/mcp/pikku-command-mcp.js +7 -3
- package/dist/src/functions/wirings/mcp/serialize-mcp-types.d.ts +3 -1
- package/dist/src/functions/wirings/mcp/serialize-mcp-types.js +17 -9
- package/dist/src/functions/wirings/middleware/pikku-command-middleware.d.ts +1 -1
- package/dist/src/functions/wirings/middleware/pikku-command-middleware.js +1 -1
- package/dist/src/functions/wirings/middleware/serialize-middleware-types.d.ts +9 -0
- package/dist/src/functions/wirings/middleware/serialize-middleware-types.js +176 -0
- package/dist/src/functions/wirings/package/pikku-command-package-types.d.ts +3 -3
- package/dist/src/functions/wirings/package/pikku-command-package-types.js +1 -1
- package/dist/src/functions/wirings/package/pikku-command-package.d.ts +1 -1
- package/dist/src/functions/wirings/package/pikku-command-package.js +1 -1
- package/dist/src/functions/wirings/package/serialize-package-types.js +2 -7
- package/dist/src/functions/wirings/package/serialize-package.js +1 -1
- package/dist/src/functions/wirings/permissions/pikku-command-permissions.d.ts +1 -1
- package/dist/src/functions/wirings/permissions/pikku-command-permissions.js +1 -1
- package/dist/src/functions/wirings/personas/pikku-command-personas.d.ts +4 -4
- package/dist/src/functions/wirings/personas/pikku-command-personas.js +2 -2
- package/dist/src/functions/wirings/personas/serialize-personas-secrets.d.ts +5 -0
- package/dist/src/functions/wirings/personas/serialize-personas-secrets.js +6 -0
- package/dist/src/functions/wirings/personas/serialize-personas-types.d.ts +2 -2
- package/dist/src/functions/wirings/personas/serialize-personas-types.js +4 -27
- package/dist/src/functions/wirings/queue/pikku-command-queue-map.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue-map.js +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue-service.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue-service.js +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue-types.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue-types.js +4 -2
- package/dist/src/functions/wirings/queue/pikku-command-queue.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue.js +1 -1
- package/dist/src/functions/wirings/queue/pikku-queue-map.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-queue-map.js +1 -1
- package/dist/src/functions/wirings/queue/pikku-queue.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-queue.js +1 -1
- package/dist/src/functions/wirings/queue/serialize-queue-map.d.ts +1 -1
- package/dist/src/functions/wirings/queue/serialize-queue-map.js +1 -1
- package/dist/src/functions/wirings/queue/serialize-queue-meta.d.ts +1 -1
- package/dist/src/functions/wirings/queue/serialize-queue-types.d.ts +3 -1
- package/dist/src/functions/wirings/queue/serialize-queue-types.js +8 -6
- package/dist/src/functions/wirings/queue/serialize-queue-wrapper.js +1 -1
- package/dist/src/functions/wirings/realtime/pikku-command-events-scaffold.d.ts +1 -1
- package/dist/src/functions/wirings/realtime/pikku-command-events-scaffold.js +3 -6
- package/dist/src/functions/wirings/realtime/pikku-command-realtime.d.ts +1 -1
- package/dist/src/functions/wirings/realtime/pikku-command-realtime.js +1 -1
- package/dist/src/functions/wirings/realtime/serialize-events-scaffold.d.ts +1 -1
- package/dist/src/functions/wirings/realtime/serialize-events-scaffold.js +6 -11
- package/dist/src/functions/wirings/roles/pikku-command-roles.d.ts +4 -4
- package/dist/src/functions/wirings/roles/pikku-command-roles.js +3 -3
- package/dist/src/functions/wirings/roles/serialize-roles-types.d.ts +1 -1
- package/dist/src/functions/wirings/roles/serialize-roles-types.js +2 -2
- package/dist/src/functions/wirings/rpc/pikku-command-public-rpc.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-public-rpc.js +6 -7
- package/dist/src/functions/wirings/rpc/pikku-command-react-query.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-react-query.js +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-remote-rpc.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-remote-rpc.js +6 -6
- package/dist/src/functions/wirings/rpc/pikku-command-rpc-client.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc-client.js +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc-map.d.ts +3 -3
- package/dist/src/functions/wirings/rpc/pikku-command-rpc-map.js +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc.js +2 -2
- package/dist/src/functions/wirings/rpc/serialize-public-rpc.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/serialize-public-rpc.js +5 -5
- package/dist/src/functions/wirings/rpc/serialize-remote-rpc.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/serialize-remote-rpc.js +5 -3
- package/dist/src/functions/wirings/rpc/serialize-rpc-wrapper.js +1 -1
- package/dist/src/functions/wirings/rpc/serialize-typed-rpc-map.js +1 -1
- package/dist/src/functions/wirings/scenarios/register-scenario-instrumentation.d.ts +4 -5
- package/dist/src/functions/wirings/scenarios/register-scenario-instrumentation.js +8 -10
- package/dist/src/functions/wirings/scenarios/scenario-partition.d.ts +1 -1
- package/dist/src/functions/wirings/scenarios/scenario-schema-partition.d.ts +1 -1
- package/dist/src/functions/wirings/scenarios/serialize-feature-meta.d.ts +1 -1
- package/dist/src/functions/wirings/scenarios/serialize-scenario-meta.js +4 -4
- package/dist/src/functions/wirings/scenarios/serialize-scenario-registration.js +1 -1
- package/dist/src/functions/wirings/scheduler/pikku-command-scheduler-types.d.ts +1 -1
- package/dist/src/functions/wirings/scheduler/pikku-command-scheduler-types.js +5 -2
- package/dist/src/functions/wirings/scheduler/pikku-command-scheduler.d.ts +1 -1
- package/dist/src/functions/wirings/scheduler/pikku-command-scheduler.js +1 -1
- package/dist/src/functions/wirings/scheduler/serialize-scheduler-meta.d.ts +1 -1
- package/dist/src/functions/wirings/scheduler/serialize-scheduler-types.d.ts +3 -1
- package/dist/src/functions/wirings/scheduler/serialize-scheduler-types.js +10 -6
- package/dist/src/functions/wirings/scopes/pikku-command-scopes.d.ts +4 -4
- package/dist/src/functions/wirings/scopes/pikku-command-scopes.js +10 -4
- package/dist/src/functions/wirings/scopes/serialize-scopes-client.d.ts +16 -0
- package/dist/src/functions/wirings/scopes/serialize-scopes-client.js +72 -0
- package/dist/src/functions/wirings/scopes/serialize-scopes-types.d.ts +1 -1
- package/dist/src/functions/wirings/scopes/serialize-scopes-types.js +3 -3
- package/dist/src/functions/wirings/secrets/pikku-command-secrets.d.ts +1 -1
- package/dist/src/functions/wirings/secrets/pikku-command-secrets.js +2 -2
- package/dist/src/functions/wirings/secrets/serialize-secrets-types.d.ts +1 -1
- package/dist/src/functions/wirings/secrets/serialize-secrets-types.js +14 -21
- package/dist/src/functions/wirings/setup/serialize-setup-types.d.ts +7 -0
- package/dist/src/functions/wirings/setup/serialize-setup-types.js +111 -0
- package/dist/src/functions/wirings/triggers/pikku-command-trigger-types.d.ts +4 -4
- package/dist/src/functions/wirings/triggers/pikku-command-trigger-types.js +2 -2
- package/dist/src/functions/wirings/triggers/pikku-command-trigger.d.ts +1 -1
- package/dist/src/functions/wirings/triggers/pikku-command-trigger.js +1 -1
- package/dist/src/functions/wirings/triggers/serialize-trigger-meta.d.ts +1 -1
- package/dist/src/functions/wirings/triggers/serialize-trigger-meta.js +4 -4
- package/dist/src/functions/wirings/triggers/serialize-trigger-types.d.ts +3 -1
- package/dist/src/functions/wirings/triggers/serialize-trigger-types.js +19 -13
- package/dist/src/functions/wirings/user-admin/pikku-command-user-admin-functions.d.ts +1 -1
- package/dist/src/functions/wirings/user-admin/pikku-command-user-admin-functions.js +18 -18
- package/dist/src/functions/wirings/user-admin/serialize-user-admin-functions.d.ts +10 -9
- package/dist/src/functions/wirings/user-admin/serialize-user-admin-functions.js +67 -56
- package/dist/src/functions/wirings/variables/pikku-command-variables.d.ts +1 -1
- package/dist/src/functions/wirings/variables/pikku-command-variables.js +2 -2
- package/dist/src/functions/wirings/variables/serialize-variables-types.d.ts +1 -1
- package/dist/src/functions/wirings/variables/serialize-variables-types.js +13 -17
- package/dist/src/functions/wirings/virtual-user/pikku-command-virtual-user-functions.d.ts +1 -1
- package/dist/src/functions/wirings/virtual-user/pikku-command-virtual-user-functions.js +4 -4
- package/dist/src/functions/wirings/virtual-user/serialize-virtual-user-functions.d.ts +1 -1
- package/dist/src/functions/wirings/virtual-user/serialize-virtual-user-functions.js +7 -6
- package/dist/src/functions/wirings/webhook/pikku-command-webhook.d.ts +1 -1
- package/dist/src/functions/wirings/webhook/pikku-command-webhook.js +6 -6
- package/dist/src/functions/wirings/webhook/serialize-webhook.d.ts +1 -1
- package/dist/src/functions/wirings/webhook/serialize-webhook.js +4 -3
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-routes.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-routes.js +4 -5
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.js +14 -5
- package/dist/src/functions/wirings/workflow/serialize-personas.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/serialize-personas.js +3 -3
- package/dist/src/functions/wirings/workflow/serialize-scenario-step-map.d.ts +1 -2
- package/dist/src/functions/wirings/workflow/serialize-scenario-types.d.ts +2 -0
- package/dist/src/functions/wirings/workflow/serialize-scenario-types.js +511 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-bootstrap-map.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/serialize-workflow-map.d.ts +2 -3
- package/dist/src/functions/wirings/workflow/serialize-workflow-map.js +1 -1
- package/dist/src/functions/wirings/workflow/serialize-workflow-meta.js +4 -4
- package/dist/src/functions/wirings/workflow/serialize-workflow-registration.js +0 -4
- package/dist/src/functions/wirings/workflow/serialize-workflow-routes.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/serialize-workflow-routes.js +11 -11
- package/dist/src/functions/wirings/workflow/serialize-workflow-types.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/serialize-workflow-types.js +28 -438
- package/dist/src/functions/workflows/all.workflow.d.ts +1 -1
- package/dist/src/functions/workflows/all.workflow.js +77 -22
- package/dist/src/middleware/log-command-info-and-time.d.ts +1 -1
- package/dist/src/server/bun-server-runner.d.ts +1 -1
- package/dist/src/server/content-signing-jwt.js +1 -1
- package/dist/src/server/dev-server-runner.interface.d.ts +1 -1
- package/dist/src/server/node-server-runner.d.ts +1 -1
- package/dist/src/services/cli-logger.service.d.ts +1 -1
- package/dist/src/services/cli-logger.service.js +1 -1
- package/dist/src/services.d.ts +9 -6
- package/dist/src/services.js +22 -6
- package/dist/src/utils/file-writer.d.ts +2 -0
- package/dist/src/utils/file-writer.js +37 -1
- package/dist/src/utils/is-deploy-codegen.d.ts +21 -0
- package/dist/src/utils/is-deploy-codegen.js +23 -0
- package/dist/src/utils/leaf-import-path.d.ts +16 -0
- package/dist/src/utils/leaf-import-path.js +15 -0
- package/dist/src/utils/parse-cli-filters.js +15 -35
- package/dist/src/utils/pikku-cli-config.d.ts +11 -0
- package/dist/src/utils/pikku-cli-config.js +90 -16
- package/dist/src/utils/precise-coverage-map.d.ts +1 -1
- package/dist/src/utils/remove-legacy-scaffold-file.d.ts +1 -1
- package/dist/src/utils/remove-legacy-scaffold-file.js +11 -3
- package/dist/src/utils/resolve-personas.d.ts +3 -3
- package/dist/src/utils/resolve-personas.js +2 -2
- package/dist/src/utils/resolve-scaffold-feature.d.ts +7 -6
- package/dist/src/utils/resolve-scaffold-feature.js +11 -31
- package/dist/src/utils/serialize-meta-ts.js +1 -1
- package/dist/src/utils/serialize-schemas.d.ts +1 -1
- package/dist/src/utils/serialize-schemas.js +1 -1
- package/dist/src/utils/surface.js +1 -1
- package/dist/src/utils/tsc-check.d.ts +1 -1
- package/dist/src/utils/tsc-check.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +48 -47
- package/surface.json +4464 -0
- package/console-app/assets/abnfDiagram-VRR7QNED-QRjCVsso.js +0 -1
- package/console-app/assets/arc-CloGjkHW.js +0 -1
- package/console-app/assets/architecture-TIHT7OUA-Cz78Qi5H.js +0 -1
- package/console-app/assets/architectureDiagram-ZJ3FMSHR-Dl10fVqw.js +0 -36
- package/console-app/assets/c4Diagram-LMCZKHZV-C2pWYCa6.js +0 -10
- package/console-app/assets/channel-Bm4o-pNB.js +0 -1
- package/console-app/assets/chunk-52WLFC77-DuAheIlc.js +0 -10
- package/console-app/assets/chunk-EX3LRPZG-CWXF7N33.js +0 -231
- package/console-app/assets/chunk-FWX5IMBZ-UN3i5qMG.js +0 -2
- package/console-app/assets/chunk-ICXQ74PX-BiuzWyj2.js +0 -2
- package/console-app/assets/chunk-OGEWGWER-BNi3Gsmc.js +0 -1
- package/console-app/assets/chunk-PUDLZKDR-DNWGCeoL.js +0 -156
- package/console-app/assets/chunk-RYQCIY6F-DvRUzuDz.js +0 -1
- package/console-app/assets/chunk-VAUOI2AC-D4_whP-t.js +0 -1
- package/console-app/assets/chunk-WYO6CB5R-COKjEQwP.js +0 -127
- package/console-app/assets/chunk-XXDRQBXY-mkAF2YHU.js +0 -1
- package/console-app/assets/chunk-ZIRB5QZD-H-kepumB.js +0 -32
- package/console-app/assets/classDiagram-OUVF2IWQ-B2cEvfK0.js +0 -1
- package/console-app/assets/classDiagram-v2-EOCWNBFH-B2cEvfK0.js +0 -1
- package/console-app/assets/cose-bilkent-JH36ORCC-D6F1MghO.js +0 -1
- package/console-app/assets/cynefin-VYW2F7L2-BIhff1Ln.js +0 -1
- package/console-app/assets/cynefinDiagram-TSTJHNR4-DrlBq_QP.js +0 -62
- package/console-app/assets/cytoscape.esm-h6BdjjI9.js +0 -321
- package/console-app/assets/dagre-CXRCoUWR.js +0 -1
- package/console-app/assets/dagre-VKFMJZFB-Cm2eP0ez.js +0 -4
- package/console-app/assets/defaultLocale-C8Fc0cco.js +0 -1
- package/console-app/assets/diagram-G47NLZAW-3K3OPEuG.js +0 -24
- package/console-app/assets/diagram-NH7WQ7WH-CUK-d5iT.js +0 -24
- package/console-app/assets/diagram-WEI45ONY-D33qA2d9.js +0 -41
- package/console-app/assets/dist-jqlCD26w.js +0 -1
- package/console-app/assets/ebnfDiagram-CCIWWBDH-DUHkt7z6.js +0 -1
- package/console-app/assets/eventmodeling-45OFAUF4-iK6rmyk3.js +0 -1
- package/console-app/assets/flowDiagram-23GEKE2U-CSYhKO9Y.js +0 -1
- package/console-app/assets/ganttDiagram-NO4QXBWP-64_vh9rj.js +0 -292
- package/console-app/assets/gitGraph-TEB2WS4Q-DlFJY0cQ.js +0 -1
- package/console-app/assets/graphlib-B8gBHxth.js +0 -1
- package/console-app/assets/index-Byf4wkdP.js +0 -261
- package/console-app/assets/index-CTO5cTAD.css +0 -1
- package/console-app/assets/info-DKCQHKI2-DhyT_-b1.js +0 -1
- package/console-app/assets/infoDiagram-FWYZ7A6U-ufTemVSR.js +0 -2
- package/console-app/assets/init-D6jRqBbL.js +0 -1
- package/console-app/assets/linear-5Z8stnH-.js +0 -1
- package/console-app/assets/map-DsCK-0Cs.js +0 -1
- package/console-app/assets/mermaid.core-DwI4IdKs.js +0 -11
- package/console-app/assets/packet-7NZHBO7P-comMLvz_.js +0 -1
- package/console-app/assets/path-BWPyau1x.js +0 -1
- package/console-app/assets/pegDiagram-2B236MQR-CbqiI_m5.js +0 -1
- package/console-app/assets/pie-RZYD4A2V-VZXoX73g.js +0 -1
- package/console-app/assets/pieDiagram-ENE6RG2P-SA-sCnrt.js +0 -39
- package/console-app/assets/radar-I7S5WNFK-W0UH9BdP.js +0 -1
- package/console-app/assets/railroad-3IZDKUUU-_HEtbruA.js +0 -1
- package/console-app/assets/railroad-abnf-AHOZXSZD-ghLnUEfg.js +0 -1
- package/console-app/assets/railroad-ebnf-EBAXGLYW-D8JHCZD5.js +0 -1
- package/console-app/assets/railroad-peg-LSFZ7HO6-C9eC4l2D.js +0 -1
- package/console-app/assets/railroadDiagram-RFXS5EU6-Cm2SfP9Z.js +0 -1
- package/console-app/assets/sequenceDiagram-DBY2YBRQ-B2AvEvXu.js +0 -162
- package/console-app/assets/src-72nNqhBu.js +0 -1
- package/console-app/assets/stateDiagram-2N3HPSRC-vgyc-CMC.js +0 -1
- package/console-app/assets/stateDiagram-v2-6OUMAXLB-B2WCkCZh.js +0 -1
- package/console-app/assets/swimlanes-5IMT3BWC-GiOMMhZh.js +0 -2
- package/console-app/assets/swimlanesDiagram-G3AALYLV-CkCbtoLb.js +0 -8
- package/console-app/assets/timeline-definition-FHXFAJF6-DTJQsTn8.js +0 -120
- package/console-app/assets/treeView-QDETBFTQ-aizmbgl7.js +0 -1
- package/console-app/assets/treemap-6X3UGDF4-DIBl6bfV.js +0 -1
- package/console-app/assets/vennDiagram-L72KCM5P-C4Ngu7VX.js +0 -34
- package/console-app/assets/wardley-OPB4EBWU-BqdXyJTm.js +0 -1
- package/dist/src/functions/db/coercion-plugin.d.ts +0 -7
- package/dist/src/functions/db/coercion-plugin.js +0 -103
- package/dist/src/functions/wirings/console/pikku-command-node-types.d.ts +0 -1
- package/dist/src/functions/wirings/console/pikku-command-node-types.js +0 -21
- package/dist/src/functions/wirings/console/serialize-node-types.d.ts +0 -1
- package/dist/src/functions/wirings/console/serialize-node-types.js +0 -11
- package/dist/src/functions/wirings/functions/pikku-command-function-types.d.ts +0 -7
- package/dist/src/functions/wirings/functions/pikku-command-function-types.js +0 -43
- package/dist/src/functions/wirings/functions/serialize-pikku-types-hub.d.ts +0 -4
- package/dist/src/functions/wirings/functions/serialize-pikku-types-hub.js +0 -36
- /package/dist/.pikku/schemas/schemas/{PikkuFunctionTypesInput.schema.json → PikkuGatewayTypesInput.schema.json} +0 -0
|
@@ -1,10 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The install side of `#pikku/addon`, written for an application rather than an
|
|
3
|
+
* addon. Installing an addon and authoring one are the same concept approached
|
|
4
|
+
* from opposite ends, and a project is only ever one of the two — but they
|
|
5
|
+
* cannot share a tree, because a runtime template maps `#pikku/*` onto a
|
|
6
|
+
* sibling package through tsconfig `paths`, and `paths` are global to a tsx
|
|
7
|
+
* process rather than scoped to the package that declared them. A linked
|
|
8
|
+
* addon's leaves would otherwise resolve against the host application's, so an
|
|
9
|
+
* addon generates its whole tree one level down and authors against
|
|
10
|
+
* `#pikku/addon/<leaf>` — a depth at which an application has nothing to match,
|
|
11
|
+
* leaving the resolver to fall back to Node's per-package `imports`.
|
|
12
|
+
*/
|
|
13
|
+
export const serializeAddonInstallTypes = () => `/**
|
|
14
|
+
* Installing an addon into this application
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export { wireAddon, wireRemoteAddon } from '@pikku/core/addon'
|
|
18
|
+
`;
|
|
1
19
|
export const serializeAddonTypes = (singletonServicesTypeImport, singletonServicesTypeName, configTypeImport, requiredServicesTypeImport, typedSecretServiceImport, typedVariablesServiceImport, typedCredentialServiceImport = null) => {
|
|
2
20
|
return `/**
|
|
3
21
|
* Addon package types for pikkuAddonConfig and pikkuAddonServices
|
|
4
22
|
*/
|
|
5
23
|
|
|
6
|
-
import type { CreateConfig } from '@pikku/core'
|
|
7
|
-
import type { PikkuWire } from '@pikku/core/
|
|
24
|
+
import type { CreateConfig } from '@pikku/core/types'
|
|
25
|
+
import type { PikkuWire } from '@pikku/core/types'
|
|
8
26
|
${singletonServicesTypeImport}
|
|
9
27
|
${configTypeImport}
|
|
10
28
|
${requiredServicesTypeImport}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generates
|
|
2
|
+
* Generates the function authoring surface — the definers every wiring points
|
|
3
|
+
* at and the types they are written against. Middleware, permissions and the
|
|
4
|
+
* bootstrap factories used to live here too; each is its own decision taken at
|
|
5
|
+
* its own time, so each is now its own leaf.
|
|
3
6
|
*/
|
|
4
|
-
export declare const serializeFunctionTypes: (userSessionTypeImport: string, userSessionTypeName: string, singletonServicesTypeImport: string, singletonServicesTypeName: string, wireServicesTypeImport: string, wireServicesTypeName: string, rpcMapTypeImport: string, requiredServicesTypeImport: string, configTypeImport: string,
|
|
7
|
+
export declare const serializeFunctionTypes: (userSessionTypeImport: string, userSessionTypeName: string, singletonServicesTypeImport: string, singletonServicesTypeName: string, wireServicesTypeImport: string, wireServicesTypeName: string, rpcMapTypeImport: string, requiredServicesTypeImport: string, configTypeImport: string, authTypesImportPath?: string, workflowTypesImport?: string, nodeCategories?: string[], scopesTypeImport?: string, credentialsTypeImport?: string, middlewareTypesImportPath?: string, { addon }?: {
|
|
8
|
+
addon?: boolean;
|
|
9
|
+
}) => string;
|
|
@@ -1,37 +1,50 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generates
|
|
2
|
+
* Generates the function authoring surface — the definers every wiring points
|
|
3
|
+
* at and the types they are written against. Middleware, permissions and the
|
|
4
|
+
* bootstrap factories used to live here too; each is its own decision taken at
|
|
5
|
+
* its own time, so each is now its own leaf.
|
|
3
6
|
*/
|
|
4
|
-
export const serializeFunctionTypes = (userSessionTypeImport, userSessionTypeName, singletonServicesTypeImport, singletonServicesTypeName, wireServicesTypeImport, wireServicesTypeName, rpcMapTypeImport, requiredServicesTypeImport, configTypeImport,
|
|
5
|
-
const packageNameValue = packageName ? `'${packageName}'` : 'null';
|
|
7
|
+
export const serializeFunctionTypes = (userSessionTypeImport, userSessionTypeName, singletonServicesTypeImport, singletonServicesTypeName, wireServicesTypeImport, wireServicesTypeName, rpcMapTypeImport, requiredServicesTypeImport, configTypeImport, authTypesImportPath = '../auth/pikku-auth-types.gen.js', workflowTypesImport, nodeCategories, scopesTypeImport, credentialsTypeImport, middlewareTypesImportPath = '../middleware/pikku-middleware-types.gen.js', { addon = false } = {}) => {
|
|
6
8
|
const nodeCategoryType = nodeCategories?.length
|
|
7
9
|
? nodeCategories.map((c) => `'${c}'`).join(' | ')
|
|
8
10
|
: 'string';
|
|
9
11
|
const workflowImport = workflowTypesImport ||
|
|
10
|
-
`import type { TypedWorkflow
|
|
12
|
+
`import type { TypedWorkflow } from '../workflow/pikku-workflow-types.gen.js'
|
|
13
|
+
import type { TypedScenario, TypedPersonas } from '../scenarios/pikku-scenario-types.gen.js'`;
|
|
11
14
|
// Falls back to `string` when a project has no scopes codegen, so that
|
|
12
15
|
// `scopes` stays usable rather than resolving to an unbound type name.
|
|
13
16
|
const scopesImport = scopesTypeImport || `type ScopeId = string`;
|
|
17
|
+
// Same fallback reasoning as scopes: a project that declares no credentials
|
|
18
|
+
// never has a credentials leaf to import from, and `wire.getCredential` stays
|
|
19
|
+
// callable with an explicit type argument.
|
|
20
|
+
const credentialsImport = credentialsTypeImport || `type CredentialsMap = Record<string, unknown>`;
|
|
14
21
|
return `/**
|
|
15
|
-
* Core function
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
import type {
|
|
19
|
-
import type { ListInput, ListOutput } from '@pikku/core/
|
|
20
|
-
import type { CorePermissionGroup
|
|
21
|
-
import type {
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
* Core function types for all wirings
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import type { PickRequired } from '@pikku/core/utils'
|
|
26
|
+
import type { ListInput, ListOutput } from '@pikku/core/function'
|
|
27
|
+
import type { CorePermissionGroup } from '@pikku/core/function'
|
|
28
|
+
import type { PikkuWire, SecretlessServices } from '@pikku/core/types'
|
|
29
|
+
import type {
|
|
30
|
+
CorePikkuFunctionConfig,
|
|
31
|
+
CorePikkuSessionlessFunctionConfig,
|
|
32
|
+
CorePikkuPermission,
|
|
33
|
+
} from '@pikku/core/function'
|
|
34
|
+
import type { NodeType } from '@pikku/core/node'
|
|
35
|
+
import type { PikkuMiddleware } from '${middlewareTypesImportPath}'
|
|
36
|
+
import type { PikkuPermission } from '${authTypesImportPath}'
|
|
27
37
|
${scopesImport}
|
|
38
|
+
${credentialsImport}
|
|
28
39
|
import type { StandardSchemaV1 } from '@standard-schema/spec'
|
|
29
|
-
import {
|
|
40
|
+
import {
|
|
41
|
+
CorePikkuFunction,
|
|
42
|
+
CorePikkuFunctionSessionless,
|
|
43
|
+
} from '@pikku/core/function'
|
|
30
44
|
|
|
31
45
|
${userSessionTypeImport}
|
|
32
46
|
${singletonServicesTypeImport}
|
|
33
47
|
${wireServicesTypeImport}
|
|
34
|
-
${configTypeImport}
|
|
35
48
|
${rpcMapTypeImport}
|
|
36
49
|
${requiredServicesTypeImport}
|
|
37
50
|
${workflowImport}
|
|
@@ -39,7 +52,6 @@ ${workflowImport}
|
|
|
39
52
|
${singletonServicesTypeName !== 'SingletonServices' ? `export type SingletonServices = ${singletonServicesTypeName}` : `export type { ${singletonServicesTypeName} as SingletonServices }`}
|
|
40
53
|
${wireServicesTypeName !== 'Services' ? `export type Services = ${wireServicesTypeName}` : `export type { ${wireServicesTypeName} as Services }`}
|
|
41
54
|
${userSessionTypeName !== 'Session' ? `export type Session = ${userSessionTypeName}` : `export type { ${userSessionTypeName} as Session }`}
|
|
42
|
-
${configTypeImport.includes('Config type not found') ? 'export type Config = any' : ''}
|
|
43
55
|
|
|
44
56
|
/**
|
|
45
57
|
* The services a wired function actually receives. The inspector records which
|
|
@@ -52,9 +64,6 @@ ${configTypeImport.includes('Config type not found') ? 'export type Config = any
|
|
|
52
64
|
export type WiredSingletonServices = RequiredSingletonServices & SingletonServices
|
|
53
65
|
export type WiredServices = SecretlessServices<RequiredSingletonServices & Services>
|
|
54
66
|
|
|
55
|
-
/** \`WiredSingletonServices\` without \`secrets\`, for auth gates. */
|
|
56
|
-
export type WiredAuthServices = SecretlessServices<WiredSingletonServices>
|
|
57
|
-
|
|
58
67
|
/**
|
|
59
68
|
* Inline node configuration for function definitions.
|
|
60
69
|
*/
|
|
@@ -65,193 +74,6 @@ export type NodeConfig = {
|
|
|
65
74
|
errorOutput?: boolean
|
|
66
75
|
}
|
|
67
76
|
|
|
68
|
-
/**
|
|
69
|
-
* Type-safe API permission definition that integrates with your application's session type.
|
|
70
|
-
* Use this to define authorization logic for your API endpoints.
|
|
71
|
-
*
|
|
72
|
-
* @template In - The input type that the permission check will receive
|
|
73
|
-
* @template RequiredServices - The services required for this permission check
|
|
74
|
-
*/
|
|
75
|
-
export type PikkuPermission<In = unknown, RequiredServices extends SecretlessServices<Services> = WiredServices> = CorePikkuPermission<In, RequiredServices, PikkuWire<In, never, false, Session>>
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Type-safe middleware definition that can access your application's services and session.
|
|
79
|
-
* Use this to define reusable middleware that can be applied to multiple wirings.
|
|
80
|
-
*
|
|
81
|
-
* @template RequiredServices - The services required for this middleware
|
|
82
|
-
*/
|
|
83
|
-
export type PikkuMiddleware<RequiredServices extends SingletonServices = WiredSingletonServices> = CorePikkuMiddleware<RequiredServices>
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Configuration object for creating a permission with metadata
|
|
87
|
-
*/
|
|
88
|
-
export type PikkuPermissionConfig<In = unknown, RequiredServices extends SecretlessServices<Services> = WiredServices> = {
|
|
89
|
-
/** The permission function */
|
|
90
|
-
func: PikkuPermission<In, RequiredServices>
|
|
91
|
-
/** Optional human-readable name for the permission */
|
|
92
|
-
name?: string
|
|
93
|
-
/** Optional description of what the permission checks */
|
|
94
|
-
description?: string
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Factory function for creating permissions with tree-shaking support.
|
|
99
|
-
* Supports both direct function and configuration object syntax.
|
|
100
|
-
*
|
|
101
|
-
* @example
|
|
102
|
-
* \`\`\`typescript
|
|
103
|
-
* // Direct function syntax
|
|
104
|
-
* const permission = pikkuPermission(async ({ logger }, data, { session }) => {
|
|
105
|
-
* const session = await session?.get()
|
|
106
|
-
* return session?.role === 'admin'
|
|
107
|
-
* })
|
|
108
|
-
*
|
|
109
|
-
* // Configuration object syntax with metadata
|
|
110
|
-
* const adminPermission = pikkuPermission({
|
|
111
|
-
* name: 'Admin Permission',
|
|
112
|
-
* description: 'Checks if user has admin role',
|
|
113
|
-
* func: async ({ logger }, data, { session }) => {
|
|
114
|
-
* const session = await session?.get()
|
|
115
|
-
* return session?.role === 'admin'
|
|
116
|
-
* }
|
|
117
|
-
* })
|
|
118
|
-
* \`\`\`
|
|
119
|
-
*/
|
|
120
|
-
export const pikkuPermission = <In>(
|
|
121
|
-
permission: PikkuPermission<In> | PikkuPermissionConfig<In>
|
|
122
|
-
): PikkuPermission<In> => {
|
|
123
|
-
return typeof permission === 'function' ? permission : permission.func
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Type-safe auth-only permission that only needs services and session.
|
|
128
|
-
* Use this for upfront authorization gates (MCP tools, AI agents, workflows)
|
|
129
|
-
* where request data isn't available yet.
|
|
130
|
-
*
|
|
131
|
-
* @template RequiredServices - The services required for this auth check
|
|
132
|
-
*/
|
|
133
|
-
export type PikkuAuth<RequiredServices extends SecretlessServices<SingletonServices> = WiredAuthServices> = CorePikkuAuth<RequiredServices, Session>
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Configuration object for creating an auth permission with metadata
|
|
137
|
-
*/
|
|
138
|
-
export type PikkuAuthConfig<RequiredServices extends SecretlessServices<SingletonServices> = WiredAuthServices> = CorePikkuAuthConfig<RequiredServices, Session>
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Factory function for creating auth-only permissions with tree-shaking support.
|
|
142
|
-
* Auth permissions only receive services and session (no request data),
|
|
143
|
-
* making them evaluable before request data is available.
|
|
144
|
-
*
|
|
145
|
-
* @example
|
|
146
|
-
* \\\`\\\`\\\`typescript
|
|
147
|
-
* const isAuthenticated = pikkuAuth(async ({ logger }, session) => {
|
|
148
|
-
* return !!session
|
|
149
|
-
* })
|
|
150
|
-
*
|
|
151
|
-
* const isAdmin = pikkuAuth({
|
|
152
|
-
* name: 'Admin Auth',
|
|
153
|
-
* description: 'Checks if user is an admin',
|
|
154
|
-
* func: async ({ logger }, session) => {
|
|
155
|
-
* return session?.role === 'admin'
|
|
156
|
-
* }
|
|
157
|
-
* })
|
|
158
|
-
* \\\`\\\`\\\`
|
|
159
|
-
*/
|
|
160
|
-
export const pikkuAuth = <RequiredServices extends SecretlessServices<SingletonServices> = WiredAuthServices>(
|
|
161
|
-
auth: PikkuAuth<RequiredServices> | PikkuAuthConfig<RequiredServices>
|
|
162
|
-
): PikkuPermission<any, any> => {
|
|
163
|
-
return pikkuAuthCore(auth as any) as any
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* Configuration object for creating middleware with metadata
|
|
168
|
-
*/
|
|
169
|
-
export type PikkuMiddlewareConfig<RequiredServices extends SingletonServices = WiredSingletonServices> = {
|
|
170
|
-
/** The middleware function */
|
|
171
|
-
func: PikkuMiddleware<RequiredServices>
|
|
172
|
-
/** Optional human-readable name for the middleware */
|
|
173
|
-
name?: string
|
|
174
|
-
/** Optional description of what the middleware does */
|
|
175
|
-
description?: string
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* Factory function for creating middleware with tree-shaking support.
|
|
180
|
-
* Supports both direct function and configuration object syntax.
|
|
181
|
-
*
|
|
182
|
-
* @example
|
|
183
|
-
* \`\`\`typescript
|
|
184
|
-
* // Direct function syntax
|
|
185
|
-
* const middleware = pikkuMiddleware(({ logger }, wires, next) => {
|
|
186
|
-
* logger.info('Middleware executed')
|
|
187
|
-
* await next()
|
|
188
|
-
* })
|
|
189
|
-
*
|
|
190
|
-
* // Configuration object syntax with metadata
|
|
191
|
-
* const logMiddleware = pikkuMiddleware({
|
|
192
|
-
* name: 'Request Logger',
|
|
193
|
-
* description: 'Logs all incoming requests',
|
|
194
|
-
* func: async ({ logger }, wires, next) => {
|
|
195
|
-
* logger.info('Request started')
|
|
196
|
-
* await next()
|
|
197
|
-
* }
|
|
198
|
-
* })
|
|
199
|
-
* \`\`\`
|
|
200
|
-
*/
|
|
201
|
-
export const pikkuMiddleware = <RequiredServices extends SingletonServices = WiredSingletonServices>(
|
|
202
|
-
middleware: PikkuMiddleware<RequiredServices> | PikkuMiddlewareConfig<RequiredServices>
|
|
203
|
-
): PikkuMiddleware<RequiredServices> => {
|
|
204
|
-
return typeof middleware === 'function' ? middleware : middleware.func
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* Factory function for creating middleware factories
|
|
209
|
-
* Use this when your middleware needs configuration/input parameters
|
|
210
|
-
*
|
|
211
|
-
* @example
|
|
212
|
-
* \`\`\`typescript
|
|
213
|
-
* export const logMiddleware = pikkuMiddlewareFactory<LogOptions>(({
|
|
214
|
-
* message,
|
|
215
|
-
* level = 'info'
|
|
216
|
-
* }) => {
|
|
217
|
-
* return pikkuMiddleware(async ({ logger }, next) => {
|
|
218
|
-
* logger[level](message)
|
|
219
|
-
* await next()
|
|
220
|
-
* })
|
|
221
|
-
* })
|
|
222
|
-
* \`\`\`
|
|
223
|
-
*/
|
|
224
|
-
export const pikkuMiddlewareFactory = <In = any>(
|
|
225
|
-
factory: (input: In) => PikkuMiddleware
|
|
226
|
-
): ((input: In) => PikkuMiddleware) => {
|
|
227
|
-
return factory
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* Factory function for creating permission factories
|
|
232
|
-
* Use this when your permission needs configuration/input parameters
|
|
233
|
-
*
|
|
234
|
-
* @example
|
|
235
|
-
* \`\`\`typescript
|
|
236
|
-
* export const requireRole = pikkuPermissionFactory<{ role: string }>(({
|
|
237
|
-
* role
|
|
238
|
-
* }) => {
|
|
239
|
-
* return pikkuPermission(async ({ logger }, data, { session }) => {
|
|
240
|
-
* if (!session || session.role !== role) {
|
|
241
|
-
* logger.warn(\`Permission denied: required role '\${role}'\`)
|
|
242
|
-
* return false
|
|
243
|
-
* }
|
|
244
|
-
* return true
|
|
245
|
-
* })
|
|
246
|
-
* })
|
|
247
|
-
* \`\`\`
|
|
248
|
-
*/
|
|
249
|
-
export const pikkuPermissionFactory = <In = any>(
|
|
250
|
-
factory: (input: In) => PikkuPermission<any>
|
|
251
|
-
): ((input: In) => PikkuPermission<any>) => {
|
|
252
|
-
return factory
|
|
253
|
-
}
|
|
254
|
-
|
|
255
77
|
/**
|
|
256
78
|
* A function that generates a human-readable description of a pending approval action.
|
|
257
79
|
* Used by AI agents to show meaningful approval prompts instead of raw tool arguments.
|
|
@@ -306,7 +128,7 @@ export type PikkuFunctionSessionless<
|
|
|
306
128
|
Out,
|
|
307
129
|
RequiredServices,
|
|
308
130
|
Session,
|
|
309
|
-
PickRequired<PikkuWire<In, Out, false, Session, TypedPikkuRPC, null, any, TypedWorkflow, unknown, TypedScenario<ScenarioOut>, TypedPersonas>, RequiredWires>
|
|
131
|
+
PickRequired<PikkuWire<In, Out, false, Session, TypedPikkuRPC, null, any, TypedWorkflow, unknown, TypedScenario<ScenarioOut>, TypedPersonas, CredentialsMap>, RequiredWires>
|
|
310
132
|
>
|
|
311
133
|
|
|
312
134
|
/**
|
|
@@ -327,7 +149,7 @@ export type PikkuFunction<
|
|
|
327
149
|
Out,
|
|
328
150
|
RequiredServices,
|
|
329
151
|
Session,
|
|
330
|
-
PickRequired<PikkuWire<In, Out, true, Session, TypedPikkuRPC, null, any, TypedWorkflow, unknown, TypedScenario, TypedPersonas>, RequiredWires>
|
|
152
|
+
PickRequired<PikkuWire<In, Out, true, Session, TypedPikkuRPC, null, any, TypedWorkflow, unknown, TypedScenario, TypedPersonas, CredentialsMap>, RequiredWires>
|
|
331
153
|
>
|
|
332
154
|
|
|
333
155
|
/**
|
|
@@ -352,20 +174,24 @@ export type PikkuFunctionConfig<
|
|
|
352
174
|
PikkuFunc extends PikkuFunction<In, Out, RequiredWires, any> | PikkuFunctionSessionless<In, Out, RequiredWires, any, any> = PikkuFunction<In, Out, RequiredWires> | PikkuFunctionSessionless<In, Out, RequiredWires>,
|
|
353
175
|
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
354
176
|
OutputSchema extends StandardSchemaV1 | undefined = undefined
|
|
355
|
-
> = CorePikkuFunctionConfig<PikkuFunc, PikkuPermission<In>, PikkuMiddleware, InputSchema, OutputSchema, ScopeId>
|
|
177
|
+
> = Omit<CorePikkuFunctionConfig<PikkuFunc, PikkuPermission<In>, PikkuMiddleware, InputSchema, OutputSchema, ScopeId>, 'node'> & {
|
|
178
|
+
node?: NodeConfig
|
|
179
|
+
}
|
|
356
180
|
|
|
357
181
|
/**
|
|
358
182
|
* {@link PikkuFunctionConfig} for a function that runs without a session.
|
|
359
183
|
* Has no \`scopes\`: an anonymous caller holds none, so none can ever be met.
|
|
360
184
|
*/
|
|
361
|
-
|
|
185
|
+
type PikkuFunctionSessionlessConfig<
|
|
362
186
|
In = unknown,
|
|
363
187
|
Out = unknown,
|
|
364
188
|
RequiredWires extends keyof PikkuWire = never,
|
|
365
189
|
PikkuFunc extends PikkuFunctionSessionless<In, Out, RequiredWires, any> = PikkuFunctionSessionless<In, Out, RequiredWires>,
|
|
366
190
|
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
367
191
|
OutputSchema extends StandardSchemaV1 | undefined = undefined
|
|
368
|
-
> = CorePikkuSessionlessFunctionConfig<PikkuFunc, PikkuPermission<In>, PikkuMiddleware, InputSchema, OutputSchema>
|
|
192
|
+
> = Omit<CorePikkuSessionlessFunctionConfig<PikkuFunc, PikkuPermission<In>, PikkuMiddleware, InputSchema, OutputSchema>, 'node'> & {
|
|
193
|
+
node?: NodeConfig
|
|
194
|
+
}
|
|
369
195
|
|
|
370
196
|
/**
|
|
371
197
|
* Configuration object for Pikku functions with Zod schema validation.
|
|
@@ -380,7 +206,7 @@ type SchemaInferred<S, Fallback = unknown> = S extends StandardSchemaV1
|
|
|
380
206
|
* Schema-overload variant for pikkuFunc. Derived from CorePikkuFunctionConfig
|
|
381
207
|
* so adding a field on the core type automatically propagates here.
|
|
382
208
|
*/
|
|
383
|
-
|
|
209
|
+
type PikkuFunctionConfigWithSchema<
|
|
384
210
|
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
385
211
|
OutputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
386
212
|
RequiredWires extends keyof PikkuWire = never,
|
|
@@ -395,13 +221,14 @@ export type PikkuFunctionConfigWithSchema<
|
|
|
395
221
|
undefined,
|
|
396
222
|
ScopeId
|
|
397
223
|
>,
|
|
398
|
-
'func' | 'input' | 'output' | 'permissions' | 'approvalDescription'
|
|
224
|
+
'func' | 'input' | 'output' | 'permissions' | 'approvalDescription' | 'node'
|
|
399
225
|
> & {
|
|
400
226
|
func:
|
|
401
227
|
| PikkuFunction<SchemaInferred<InputSchema>, SchemaInferred<OutputSchema>, RequiredWires, RequiredServices>
|
|
402
228
|
| PikkuFunctionSessionless<SchemaInferred<InputSchema>, SchemaInferred<OutputSchema>, RequiredWires, RequiredServices>
|
|
403
229
|
input?: InputSchema
|
|
404
230
|
output?: OutputSchema
|
|
231
|
+
node?: NodeConfig
|
|
405
232
|
permissions?: InputSchema extends StandardSchemaV1
|
|
406
233
|
? CorePermissionGroup<PikkuPermission<InferSchemaOutput<InputSchema>>>
|
|
407
234
|
: undefined
|
|
@@ -451,18 +278,6 @@ export function pikkuFunc(func: any) {
|
|
|
451
278
|
return typeof func === 'function' ? { func } : func
|
|
452
279
|
}
|
|
453
280
|
|
|
454
|
-
export type PikkuListFunction<
|
|
455
|
-
F extends Record<string, unknown> = {},
|
|
456
|
-
Row = unknown,
|
|
457
|
-
S extends string = never
|
|
458
|
-
> =
|
|
459
|
-
| PikkuFunction<ListInput<F, S>, ListOutput<Row>, 'session' | 'rpc'>
|
|
460
|
-
| PikkuFunctionSessionless<
|
|
461
|
-
ListInput<F, S>,
|
|
462
|
-
ListOutput<Row>,
|
|
463
|
-
'session' | 'rpc'
|
|
464
|
-
>
|
|
465
|
-
|
|
466
281
|
export const pikkuListFunc = <
|
|
467
282
|
F extends Record<string, unknown> = {},
|
|
468
283
|
Row = unknown,
|
|
@@ -485,7 +300,7 @@ export const pikkuListFunc = <
|
|
|
485
300
|
* CorePikkuSessionlessFunctionConfig to stay in sync with the generic-typed
|
|
486
301
|
* config — so it has no \`scopes\` either.
|
|
487
302
|
*/
|
|
488
|
-
|
|
303
|
+
type PikkuFunctionSessionlessConfigWithSchema<
|
|
489
304
|
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
490
305
|
OutputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
491
306
|
RequiredWires extends keyof PikkuWire = never,
|
|
@@ -494,7 +309,7 @@ export type PikkuFunctionSessionlessConfigWithSchema<
|
|
|
494
309
|
CorePikkuSessionlessFunctionConfig<
|
|
495
310
|
PikkuFunctionSessionless<SchemaInferred<InputSchema>, SchemaInferred<OutputSchema>, RequiredWires, RequiredServices>
|
|
496
311
|
>,
|
|
497
|
-
'func' | 'input' | 'output' | 'permissions' | 'approvalDescription'
|
|
312
|
+
'func' | 'input' | 'output' | 'permissions' | 'approvalDescription' | 'node'
|
|
498
313
|
> & {
|
|
499
314
|
func: PikkuFunctionSessionless<
|
|
500
315
|
SchemaInferred<InputSchema>,
|
|
@@ -504,6 +319,7 @@ export type PikkuFunctionSessionlessConfigWithSchema<
|
|
|
504
319
|
>
|
|
505
320
|
input?: InputSchema
|
|
506
321
|
output?: OutputSchema
|
|
322
|
+
node?: NodeConfig
|
|
507
323
|
permissions?: InputSchema extends StandardSchemaV1
|
|
508
324
|
? CorePermissionGroup<PikkuPermission<InferSchemaOutput<InputSchema>>>
|
|
509
325
|
: undefined
|
|
@@ -572,7 +388,7 @@ export const pikkuVoidFunc = (
|
|
|
572
388
|
func:
|
|
573
389
|
| PikkuFunctionSessionless<void, void, 'session' | 'rpc'>
|
|
574
390
|
| PikkuFunctionSessionlessConfig<void, void, 'session' | 'rpc'>
|
|
575
|
-
) => {
|
|
391
|
+
): PikkuFunctionConfig<void, void, 'session' | 'rpc'> => {
|
|
576
392
|
return typeof func === 'function' ? { func } : func
|
|
577
393
|
}
|
|
578
394
|
|
|
@@ -648,136 +464,6 @@ export function pikkuRemoteChannelFunc<
|
|
|
648
464
|
} as any
|
|
649
465
|
}
|
|
650
466
|
|
|
651
|
-
/**
|
|
652
|
-
* Creates a Pikku config factory.
|
|
653
|
-
* Use this to define your application's configuration factory.
|
|
654
|
-
*
|
|
655
|
-
* @param func - Config factory function that returns your application's config
|
|
656
|
-
* @returns The config factory function
|
|
657
|
-
*
|
|
658
|
-
* @example
|
|
659
|
-
* \`\`\`typescript
|
|
660
|
-
* export const createConfig = pikkuConfig(async () => {
|
|
661
|
-
* return {
|
|
662
|
-
* apiUrl: process.env.API_URL || 'http://localhost:3000',
|
|
663
|
-
* dbUrl: process.env.DATABASE_URL
|
|
664
|
-
* }
|
|
665
|
-
* })
|
|
666
|
-
* \`\`\`
|
|
667
|
-
*/
|
|
668
|
-
export const pikkuConfig = (
|
|
669
|
-
func: (variables?: any, ...args: any[]) => Promise<Config>
|
|
670
|
-
) => func
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
/**
|
|
674
|
-
* Creates a Pikku singleton services factory.
|
|
675
|
-
* Use this to define services that are created once and shared across all requests.
|
|
676
|
-
*
|
|
677
|
-
* @param func - Singleton services factory function
|
|
678
|
-
* @returns The singleton services factory function
|
|
679
|
-
*
|
|
680
|
-
* @example
|
|
681
|
-
* \`\`\`typescript
|
|
682
|
-
* export const createSingletonServices = pikkuServices(async (config, existingServices) => {
|
|
683
|
-
* return {
|
|
684
|
-
* config,
|
|
685
|
-
* logger: new CustomLogger(),
|
|
686
|
-
* db: await createDatabaseConnection(config.dbUrl)
|
|
687
|
-
* }
|
|
688
|
-
* })
|
|
689
|
-
* \`\`\`
|
|
690
|
-
*/
|
|
691
|
-
export const pikkuServices = (
|
|
692
|
-
func: (config: Config, existingServices: Partial<SingletonServices>) => Promise<Partial<Omit<RequiredSingletonServices, 'auth'>>>
|
|
693
|
-
) => {
|
|
694
|
-
return async (config: Config, existingServices: Partial<SingletonServices> = {}) => {
|
|
695
|
-
const createdServices = await func(config, existingServices)
|
|
696
|
-
const services = { ...existingServices, ...createdServices }
|
|
697
|
-
const authFactory = __pikkuState(null, 'package', 'authFactory')
|
|
698
|
-
if (authFactory) {
|
|
699
|
-
let authInstance: Promise<unknown> | undefined
|
|
700
|
-
;(services as any).auth = () => {
|
|
701
|
-
authInstance ??= Promise.resolve()
|
|
702
|
-
.then(() => authFactory(services as any))
|
|
703
|
-
.catch((error) => {
|
|
704
|
-
authInstance = undefined
|
|
705
|
-
throw error
|
|
706
|
-
})
|
|
707
|
-
return authInstance
|
|
708
|
-
}
|
|
709
|
-
}
|
|
710
|
-
const resolved = services as RequiredSingletonServices
|
|
711
|
-
__pikkuState(null, 'package', 'singletonServices', resolved as any)
|
|
712
|
-
return resolved
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
/**
|
|
717
|
-
* Creates a Pikku wire services factory.
|
|
718
|
-
* Use this to define services that are created per-request/session.
|
|
719
|
-
*
|
|
720
|
-
* @param func - Wire services factory function
|
|
721
|
-
* @returns The wire services factory function
|
|
722
|
-
*
|
|
723
|
-
* @example
|
|
724
|
-
* \`\`\`typescript
|
|
725
|
-
* export const createWireServices = pikkuWireServices(async (services, wire) => {
|
|
726
|
-
* const session = await wire.session?.get()
|
|
727
|
-
* return {
|
|
728
|
-
* userCache: new UserCache(session?.userId)
|
|
729
|
-
* }
|
|
730
|
-
* })
|
|
731
|
-
* \`\`\`
|
|
732
|
-
*/
|
|
733
|
-
export const pikkuWireServices = (
|
|
734
|
-
func: (
|
|
735
|
-
services: SingletonServices,
|
|
736
|
-
wire: any
|
|
737
|
-
) => Promise<RequiredWireServices>
|
|
738
|
-
): CreateWireServices => {
|
|
739
|
-
const factories = __pikkuState(null, 'package', 'factories')
|
|
740
|
-
__pikkuState(null, 'package', 'factories', { ...factories, createWireServices: func as any })
|
|
741
|
-
return func as unknown as CreateWireServices
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
/**
|
|
745
|
-
* Tag-scoped middleware. Applies to any wiring that carries the matching tag.
|
|
746
|
-
*
|
|
747
|
-
* @example
|
|
748
|
-
* addTagMiddleware('admin', [adminMiddleware])
|
|
749
|
-
*/
|
|
750
|
-
export const addTagMiddleware = (tag: string, middleware: PikkuMiddleware[]) => {
|
|
751
|
-
addTagMiddlewareCore(tag, middleware as any, ${packageNameValue})
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
/**
|
|
755
|
-
* Wire-agnostic global middleware. Runs at the top of every wiring's
|
|
756
|
-
* middleware chain — before wire-, tag-, and function-level entries.
|
|
757
|
-
*
|
|
758
|
-
* Resolution order: global -> wire -> tag -> function.
|
|
759
|
-
*
|
|
760
|
-
* @example
|
|
761
|
-
* addGlobalMiddleware([telemetryMiddleware])
|
|
762
|
-
*/
|
|
763
|
-
export const addGlobalMiddleware = (middleware: PikkuMiddleware[]) => {
|
|
764
|
-
addGlobalMiddlewareCore(middleware as any, ${packageNameValue})
|
|
765
|
-
}
|
|
766
|
-
|
|
767
|
-
/**
|
|
768
|
-
* Wire-agnostic global permissions. Runs at the top of every wiring's
|
|
769
|
-
* permission resolution — before wire-, tag-, and function-level entries.
|
|
770
|
-
*
|
|
771
|
-
* Resolution order: global -> wire -> tag -> function.
|
|
772
|
-
*
|
|
773
|
-
* @example
|
|
774
|
-
* addGlobalPermission([signedInUser])
|
|
775
|
-
*/
|
|
776
|
-
export const addGlobalPermission = <In = unknown>(permissions: CorePermissionGroup<PikkuPermission<In>> | PikkuPermission<In>[]) => {
|
|
777
|
-
addGlobalPermissionCore(permissions as any, ${packageNameValue})
|
|
778
|
-
}
|
|
779
467
|
|
|
780
|
-
export { wireAddon, wireRemoteAddon } from '@pikku/core/ecosystem/rpc'
|
|
781
|
-
export type { WireAddonConfig, WireRemoteAddonConfig, RemoteAddonAuth } from '@pikku/core/ecosystem/rpc'
|
|
782
468
|
`;
|
|
783
469
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates a leaf's `index.ts`, the file `#pikku/<leaf>` resolves to.
|
|
3
|
+
*
|
|
4
|
+
* The indirection exists because the entry filenames differ per leaf
|
|
5
|
+
* (`pikku-http-types.gen.ts`, `pikku-channel-types.gen.ts`) and are themselves
|
|
6
|
+
* overridable in `pikku.config.json`, so no single `#pikku/*` pattern can reach
|
|
7
|
+
* them by name. One generated re-export per leaf gives every wiring a stable
|
|
8
|
+
* specifier while leaving the entry file wherever the project put it.
|
|
9
|
+
*
|
|
10
|
+
* A leaf may have more than one entry. `credentials` splits its definer
|
|
11
|
+
* (`defineCredential`) from its map (`CredentialsMap`, `TypedCredentialService`)
|
|
12
|
+
* across two generated files, as `secrets` and `variables` do, and both halves
|
|
13
|
+
* are the app's to import — so the index re-exports each of them rather than
|
|
14
|
+
* picking one and leaving the other reachable only by a relative path into
|
|
15
|
+
* `.pikku`.
|
|
16
|
+
*/
|
|
17
|
+
export declare const serializeLeafIndex: (leaf: string, entryImportPaths: string[]) => string;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates a leaf's `index.ts`, the file `#pikku/<leaf>` resolves to.
|
|
3
|
+
*
|
|
4
|
+
* The indirection exists because the entry filenames differ per leaf
|
|
5
|
+
* (`pikku-http-types.gen.ts`, `pikku-channel-types.gen.ts`) and are themselves
|
|
6
|
+
* overridable in `pikku.config.json`, so no single `#pikku/*` pattern can reach
|
|
7
|
+
* them by name. One generated re-export per leaf gives every wiring a stable
|
|
8
|
+
* specifier while leaving the entry file wherever the project put it.
|
|
9
|
+
*
|
|
10
|
+
* A leaf may have more than one entry. `credentials` splits its definer
|
|
11
|
+
* (`defineCredential`) from its map (`CredentialsMap`, `TypedCredentialService`)
|
|
12
|
+
* across two generated files, as `secrets` and `variables` do, and both halves
|
|
13
|
+
* are the app's to import — so the index re-exports each of them rather than
|
|
14
|
+
* picking one and leaving the other reachable only by a relative path into
|
|
15
|
+
* `.pikku`.
|
|
16
|
+
*/
|
|
17
|
+
export const serializeLeafIndex = (leaf, entryImportPaths) => {
|
|
18
|
+
const exports = entryImportPaths
|
|
19
|
+
.map((path) => `export * from '${path}'`)
|
|
20
|
+
.join('\n');
|
|
21
|
+
return `/**
|
|
22
|
+
* Subpath entry — \`#pikku/${leaf}\` resolves here.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
${exports}
|
|
26
|
+
`;
|
|
27
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const pikkuGatewayTypes: import("#pikku/function").PikkuFunctionConfig<{
|
|
2
|
+
bootstrap?: boolean;
|
|
3
|
+
}, void, "rpc" | "session", import("#pikku/function").PikkuFunctionSessionless<{
|
|
4
|
+
bootstrap?: boolean;
|
|
5
|
+
}, void, "rpc" | "session", import("#pikku/function").WiredServices, unknown> | import("#pikku/function").PikkuFunction<{
|
|
6
|
+
bootstrap?: boolean;
|
|
7
|
+
}, void, "rpc" | "session", import("#pikku/function").WiredServices>, undefined, undefined>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { pikkuSessionlessFunc } from '#pikku/function';
|
|
2
|
+
import { writeFileInDir } from '../../../utils/file-writer.js';
|
|
3
|
+
import { getFileImportRelativePath } from '../../../utils/file-import-path.js';
|
|
4
|
+
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
|
|
5
|
+
import { serializeGatewayTypes } from './serialize-gateway-types.js';
|
|
6
|
+
export const pikkuGatewayTypes = pikkuSessionlessFunc({
|
|
7
|
+
func: async ({ logger, config, getInspectorState }, data) => {
|
|
8
|
+
const { gatewaysTypesFile, packageMappings } = config;
|
|
9
|
+
const visitState = await getInspectorState(false, true, data?.bootstrap ?? false);
|
|
10
|
+
const { singletonServicesType } = visitState.filesAndMethods;
|
|
11
|
+
if (!singletonServicesType) {
|
|
12
|
+
throw new Error('SingletonServices type not found');
|
|
13
|
+
}
|
|
14
|
+
const singletonServicesTypeImport = `import type { ${singletonServicesType.type} } from '${getFileImportRelativePath(gatewaysTypesFile, singletonServicesType.typePath, packageMappings)}'`;
|
|
15
|
+
const content = serializeGatewayTypes(singletonServicesTypeImport, singletonServicesType.type, { addon: !!config.addon });
|
|
16
|
+
await writeFileInDir(logger, gatewaysTypesFile, content);
|
|
17
|
+
},
|
|
18
|
+
middleware: [
|
|
19
|
+
logCommandInfoAndTime({
|
|
20
|
+
commandStart: 'Creating gateway types',
|
|
21
|
+
commandEnd: 'Created gateway types',
|
|
22
|
+
}),
|
|
23
|
+
],
|
|
24
|
+
});
|