@pikku/cli 0.12.145 → 0.12.151
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/console-app/assets/HelpPanel-CxjgE40i.js +1 -0
- package/console-app/assets/{abnfDiagram-N423BO3Z-BIPJyOId.js → abnfDiagram-VCTEODGH-UPW1PlxM.js} +1 -1
- package/console-app/assets/architecture-7GRP2DOG-BQN972Vc.js +1 -0
- package/console-app/assets/architectureDiagram-5GKGNRK7-B3XFrvZk.js +36 -0
- package/console-app/assets/blockDiagram-I7D4REHJ-Ca0v9UJQ.js +129 -0
- package/console-app/assets/c4Diagram-7LVT6UL2-CLewVsj_.js +38 -0
- package/console-app/assets/channel-B8xtOmL3.js +1 -0
- package/console-app/assets/chunk-4HAMMTFA-BwhbhOD9.js +62 -0
- package/console-app/assets/{chunk-NSK5VX7P-VK0slsok.js → chunk-75Z2AOVW-C7nAgNk0.js} +1 -1
- package/console-app/assets/chunk-DU6HZSFF-D4yYAcHt.js +127 -0
- package/console-app/assets/{chunk-2GRJ4B5K-pBREt5-Y.js → chunk-F27PBJKO-UHllOPps.js} +1 -1
- package/console-app/assets/{chunk-KEIR6QF5-BICK3FdT.js → chunk-FOHPRMQF-CoA4358r.js} +9 -9
- package/console-app/assets/chunk-GMAD6QVW-C0l_vm7T.js +72 -0
- package/console-app/assets/chunk-GVQU2GXP-h-H2Oird.js +1 -0
- package/console-app/assets/{chunk-5RXB4S5H-wo8Xtqiv.js → chunk-IMKFNOWR-DJ_W9CSg.js} +2 -2
- package/console-app/assets/chunk-L3NEJ4N5-Ce9oniwE.js +1 -0
- package/console-app/assets/chunk-OSK3NFVY-CdGE5qxS.js +10 -0
- package/console-app/assets/chunk-P2QGCYS3-DK1pHDdz.js +1 -0
- package/console-app/assets/{chunk-KBJHAD2P-PiPaopal.js → chunk-POPQ4Y6H-DjevEFNo.js} +1 -1
- package/console-app/assets/{chunk-4I5QYGJK-SmJ1Rqsn.js → chunk-PWAF6VOD-BVF5N1No.js} +1 -1
- package/console-app/assets/chunk-SHT3W25Y-BX8We-wN.js +168 -0
- package/console-app/assets/{chunk-6Q2QTUOP-B6uqaxr0.js → chunk-SVP7TREG-Cl0GgAPC.js} +1 -1
- package/console-app/assets/{chunk-GF5L2VYU-Cw7tsTe6.js → chunk-TICWLB2K-IWZAWDhu.js} +2 -2
- package/console-app/assets/chunk-XXDRQBXY-CGWcS5Ol.js +1 -0
- package/console-app/assets/classDiagram-ZZMXUADV-OGsmOlmO.js +1 -0
- package/console-app/assets/classDiagram-v2-VYDZK3BY-OGsmOlmO.js +1 -0
- package/console-app/assets/cose-bilkent-JH36ORCC-GsQ0JAnL.js +1 -0
- package/console-app/assets/cynefin-OW5HDTMX-hZsAZp_5.js +1 -0
- package/console-app/assets/{cynefinDiagram-MW4NZA55-BzFWEf8Y.js → cynefinDiagram-5FMLGOSQ-CsyMovx1.js} +1 -1
- package/console-app/assets/cytoscape.esm-B-1iW2ft.js +321 -0
- package/console-app/assets/dagre-BP8XEFz-.js +1 -0
- package/console-app/assets/dagre-GXQ25YYZ-Jg5285rx.js +4 -0
- package/console-app/assets/{diagram-7IWD3JNH-C58VaHJt.js → diagram-S7CK7UJ4-n9JiR8HK.js} +4 -4
- package/console-app/assets/{diagram-UB23O5K3-CmRNd5vm.js → diagram-UQ7AKVKN-Cde-dgbI.js} +1 -1
- package/console-app/assets/{diagram-B4RE2ZJO-B3w3TcXn.js → diagram-VSXAHHWV-CPZUg4FP.js} +1 -1
- package/console-app/assets/{diagram-Q27KOJAE-7oaP3D-d.js → diagram-VX7I27RA-B2rCDWvn.js} +1 -1
- package/console-app/assets/{diagram-LBJQPF4R-L1ZkDsab.js → diagram-Z3DM3KII-UwO0hte3.js} +1 -1
- package/console-app/assets/{ebnfDiagram-BXEA7PRR-D0rxzLaa.js → ebnfDiagram-PWID7BFC-BGJ_PBlS.js} +1 -1
- package/console-app/assets/erDiagram-RLTQ6QDP-CKsTScr3.js +99 -0
- package/console-app/assets/eventmodeling-NTZA5JFV-CnZOTLz3.js +1 -0
- package/console-app/assets/flowDiagram-HODETNUW-TYMCrte8.js +1 -0
- package/console-app/assets/ganttDiagram-EL5Y4UJY-koeTkIEA.js +292 -0
- package/console-app/assets/gitGraph-4MIJSDKK-DyRPbcM4.js +1 -0
- package/console-app/assets/{gitGraphDiagram-DS77QQ5N-JaW7OYCY.js → gitGraphDiagram-WWUBYQGX-DSIejrYw.js} +1 -1
- package/console-app/assets/graphlib-BpQ_697T.js +1 -0
- package/console-app/assets/index-BbJGr-r1.css +1 -0
- package/console-app/assets/index-Du9_fRSw.js +262 -0
- package/console-app/assets/info-A6RAGUB7-C63f9an_.js +1 -0
- package/console-app/assets/{infoDiagram-6WML65LV-DIbMcTbW.js → infoDiagram-27XIBGKW-Dz5gMcUF.js} +1 -1
- package/console-app/assets/{ishikawaDiagram-WSZJBQD7-mozqgfxi.js → ishikawaDiagram-5VMMS53U-m-nTAZTH.js} +1 -1
- package/console-app/assets/{journeyDiagram-NVQOT4AX-CKDrjPz5.js → journeyDiagram-3NMN7TZE-C7mjFY7i.js} +2 -2
- package/console-app/assets/{kanban-definition-27J2QSJJ-B9shPbST.js → kanban-definition-UXKFOSKX-Cm7PqOOP.js} +2 -2
- package/console-app/assets/{katex-CXMH3UgJ.js → katex-ZlcWpGUi.js} +2 -2
- package/console-app/assets/{line-DLrnl2PN.js → line-RZNRGurC.js} +1 -1
- package/console-app/assets/linear-C2IGWMlF.js +1 -0
- package/console-app/assets/{mermaid-parser.core-ElI_yw4f.js → mermaid-parser.core-DN1yDqgB.js} +3 -3
- package/console-app/assets/mermaid.core-DDRs3TbC.js +44 -0
- package/console-app/assets/{mindmap-definition-FAOFIHXS-BTvmLZE7.js → mindmap-definition-YA3MSWOX-o6riOwlF.js} +1 -1
- package/console-app/assets/packet-AYTQ26CC-B89F6gXG.js +1 -0
- package/console-app/assets/{pegDiagram-VL7TDLO6-1hBiUSmO.js → pegDiagram-XKGWAZYB-BQ1AAIaV.js} +1 -1
- package/console-app/assets/pie-WAS4IAKB-CzuwQlQz.js +1 -0
- package/console-app/assets/{pieDiagram-7S7Q4E2Y-vvgYfdFq.js → pieDiagram-E7YTZNPT-DlcGHWGT.js} +1 -1
- package/console-app/assets/{quadrantDiagram-CIZ2JOQS-B_emxK6O.js → quadrantDiagram-AXDQQJYC-DdITwqw-.js} +1 -1
- package/console-app/assets/radar-RG4KPBEZ-DlJ29jAN.js +1 -0
- package/console-app/assets/railroad-74A4TZTK-BL49fdM8.js +1 -0
- package/console-app/assets/railroad-abnf-HS5TGJTU-D9Ej_sin.js +1 -0
- package/console-app/assets/railroad-ebnf-LZEXJU2U-CjzlC3qv.js +1 -0
- package/console-app/assets/railroad-peg-WCYAUIDC-BPa6lIrj.js +1 -0
- package/console-app/assets/{railroadDiagram-AXF67PYL-IXXj_KlB.js → railroadDiagram-O6MQD6OU-BNgQGtF5.js} +1 -1
- package/console-app/assets/{requirementDiagram-LRYGKXZP-B15ZEbec.js → requirementDiagram-BXWQKSXE-48lE_WeD.js} +2 -2
- package/console-app/assets/{sankeyDiagram-W5VNT64P-w-sj_WN8.js → sankeyDiagram-P5KCCOFB-WmTardCP.js} +1 -1
- package/console-app/assets/{sequenceDiagram-SI44F4Z6-BP1UgEbX.js → sequenceDiagram-WJ2MYXX4-Bd5cHDMs.js} +1 -1
- package/console-app/assets/src-BTXg_NtK.js +1 -0
- package/console-app/assets/{stateDiagram-OKZ733FA-DE4L-y3n.js → stateDiagram-D77RDMKH-DBoCkqGv.js} +1 -1
- package/console-app/assets/stateDiagram-v2-MP3YSRHH-BLbaZawL.js +1 -0
- package/console-app/assets/swimlanes-42K2YHIH-lecUPBaK.js +1 -0
- package/console-app/assets/swimlanesDiagram-VR7AAH4N-CM_5HS_7.js +8 -0
- package/console-app/assets/{timeline-definition-Z64GVDOM-Cc8M2qee.js → timeline-definition-24CTP7MA-CWq0OWm1.js} +1 -1
- package/console-app/assets/treeView-Q6P3EWNA-C7lEeqUz.js +1 -0
- package/console-app/assets/treemap-WGGIJYW6-Bkx2DAoI.js +1 -0
- package/console-app/assets/{vennDiagram-T6HMQDX7-dpGyGzMg.js → vennDiagram-4TSXK5OY-Bw_kGRL3.js} +1 -1
- package/console-app/assets/wardley-WFR3VGLG-V0zki2L0.js +1 -0
- package/console-app/assets/{wardleyDiagram-T6FBY63Y-CBvRf8GJ.js → wardleyDiagram-VM6X3IG4-C5vrwEHM.js} +1 -1
- package/console-app/assets/{xychartDiagram-ELKLHX3M-UlPqx-ve.js → xychartDiagram-S5SC5T6Z-B9uA0moC.js} +3 -3
- package/console-app/index.html +2 -3
- package/dist/.pikku/addon/index.d.ts +1 -1
- package/dist/.pikku/addon/index.js +1 -1
- package/dist/.pikku/addon/pikku-addon-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/pikku-addon-types.gen.js +1 -1
- package/dist/.pikku/agent/index.d.ts +1 -1
- package/dist/.pikku/agent/index.js +1 -1
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +6 -6
- package/dist/.pikku/agent/pikku-model-aliases.gen.js +1 -1
- package/dist/.pikku/analytics/index.d.ts +7 -0
- package/dist/.pikku/analytics/index.js +7 -0
- package/dist/.pikku/analytics/pikku-analytics-types.gen.d.ts +5 -0
- package/dist/.pikku/analytics/pikku-analytics-types.gen.js +4 -0
- package/dist/.pikku/auth/auth.types.d.ts +1 -1
- package/dist/.pikku/auth/auth.types.js +1 -1
- package/dist/.pikku/auth/index.d.ts +1 -1
- package/dist/.pikku/auth/index.js +1 -1
- package/dist/.pikku/auth/pikku-auth-types.gen.d.ts +1 -1
- package/dist/.pikku/auth/pikku-auth-types.gen.js +1 -1
- package/dist/.pikku/channel/index.d.ts +1 -1
- package/dist/.pikku/channel/index.js +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +3 -3
- package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
- package/dist/.pikku/cli/index.d.ts +1 -1
- package/dist/.pikku/cli/index.js +1 -1
- package/dist/.pikku/cli/pikku-cli-channel.d.ts +7 -7
- package/dist/.pikku/cli/pikku-cli-channel.js +31 -1
- package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-client.gen.js +1 -1
- 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-contracts-meta.gen.json +170 -0
- package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +2 -2
- package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +170 -0
- 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 +1 -1
- package/dist/.pikku/error/index.d.ts +1 -1
- package/dist/.pikku/error/index.js +1 -1
- package/dist/.pikku/error/pikku-error-types.gen.d.ts +1 -1
- package/dist/.pikku/error/pikku-error-types.gen.js +1 -1
- package/dist/.pikku/function/index.d.ts +1 -1
- package/dist/.pikku/function/index.js +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +8 -7
- package/dist/.pikku/function/pikku-function-types.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.json +234 -26
- package/dist/.pikku/function/pikku-functions.gen.js +9 -1
- package/dist/.pikku/gateway/index.d.ts +1 -1
- package/dist/.pikku/gateway/index.js +1 -1
- package/dist/.pikku/gateway/pikku-gateway-types.gen.d.ts +1 -1
- package/dist/.pikku/gateway/pikku-gateway-types.gen.js +1 -1
- package/dist/.pikku/http/index.d.ts +1 -1
- package/dist/.pikku/http/index.js +1 -1
- package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
- package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
- package/dist/.pikku/mcp/index.d.ts +1 -1
- package/dist/.pikku/mcp/index.js +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
- package/dist/.pikku/middleware/index.d.ts +1 -1
- package/dist/.pikku/middleware/index.js +1 -1
- package/dist/.pikku/middleware/pikku-middleware-types.gen.d.ts +1 -1
- package/dist/.pikku/middleware/pikku-middleware-types.gen.js +1 -1
- 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-services.gen.d.ts +5 -1
- package/dist/.pikku/pikku-services.gen.js +4 -0
- package/dist/.pikku/queue/index.d.ts +1 -1
- package/dist/.pikku/queue/index.js +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +1 -1
- 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 +1 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +10 -0
- package/dist/.pikku/scenarios/index.d.ts +1 -1
- package/dist/.pikku/scenarios/index.js +1 -1
- package/dist/.pikku/scenarios/pikku-personas.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/pikku-personas.gen.js +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-functions-meta.gen.js +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-functions.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-types.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-wirings-meta.gen.js +1 -1
- 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 +1 -1
- package/dist/.pikku/scheduler/index.js +1 -1
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
- package/dist/.pikku/schemas/register.gen.js +31 -1
- package/dist/.pikku/schemas/schemas/FabricChangesAskInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricChangesAskOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricChangesClaimInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricChangesClaimOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricChangesDoneInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricChangesDoneOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricChangesListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricChangesListOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricChangesShotInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricChangesShotOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricChangesShowInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricChangesShowOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployApplyOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/FabricFindingsListOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/FabricProjectsListOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/FabricPublishOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/FabricRollbackOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/FabricSecretsDeleteOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/FabricSecretsRotateOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuAnalyticsOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuFeatureFlagsScaffoldOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuFlagsInput.schema.json +1 -0
- package/dist/.pikku/scopes/index.d.ts +2 -1
- package/dist/.pikku/scopes/index.js +2 -1
- package/dist/.pikku/scopes/pikku-flags-meta.gen.json +1 -0
- package/dist/.pikku/scopes/pikku-flags.gen.d.ts +41 -0
- package/dist/.pikku/scopes/pikku-flags.gen.js +34 -0
- package/dist/.pikku/scopes/pikku-personas.gen.js +1 -1
- package/dist/.pikku/scopes/pikku-roles.gen.d.ts +1 -1
- package/dist/.pikku/scopes/pikku-scope-types.gen.d.ts +2 -1
- package/dist/.pikku/scopes/pikku-scope-types.gen.js +2 -1
- package/dist/.pikku/scopes/pikku-scopes.gen.d.ts +1 -1
- package/dist/.pikku/secrets/index.d.ts +1 -1
- package/dist/.pikku/secrets/index.js +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
- package/dist/.pikku/services/pikku-meta-service.gen.d.ts +1 -1
- package/dist/.pikku/services/pikku-meta-service.gen.js +1 -1
- package/dist/.pikku/setup/index.d.ts +1 -1
- package/dist/.pikku/setup/index.js +1 -1
- package/dist/.pikku/setup/pikku-setup-types.gen.d.ts +2 -2
- package/dist/.pikku/setup/pikku-setup-types.gen.js +1 -1
- package/dist/.pikku/trigger/index.d.ts +1 -1
- package/dist/.pikku/trigger/index.js +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
- package/dist/.pikku/variables/index.d.ts +1 -1
- package/dist/.pikku/variables/index.js +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
- package/dist/.pikku/workflow/index.d.ts +1 -1
- package/dist/.pikku/workflow/index.js +1 -1
- package/dist/.pikku/workflow/meta/allWorkflow.gen.json +42 -6
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
- package/dist/bin/pikku-bin.mjs +2 -2
- package/dist/src/deploy/analyzer/analyzer.d.ts +1 -1
- package/dist/src/deploy/analyzer/analyzer.js +40 -2
- package/dist/src/deploy/analyzer/grouping.d.ts +41 -7
- package/dist/src/deploy/analyzer/grouping.js +76 -2
- package/dist/src/deploy/build-pipeline.js +4 -0
- package/dist/src/fabric/fabric-commands.d.ts +323 -138
- package/dist/src/fabric/fabric-commands.js +135 -0
- package/dist/src/fabric/functions/add.function.d.ts +3 -3
- package/dist/src/fabric/functions/addon-verify.function.d.ts +9 -9
- package/dist/src/fabric/functions/changes-ask.function.d.ts +34 -0
- package/dist/src/fabric/functions/changes-ask.function.js +30 -0
- package/dist/src/fabric/functions/changes-claim.function.d.ts +50 -0
- package/dist/src/fabric/functions/changes-claim.function.js +43 -0
- package/dist/src/fabric/functions/changes-done.function.d.ts +55 -0
- package/dist/src/fabric/functions/changes-done.function.js +59 -0
- package/dist/src/fabric/functions/changes-list.function.d.ts +60 -0
- package/dist/src/fabric/functions/changes-list.function.js +82 -0
- package/dist/src/fabric/functions/changes-shot.function.d.ts +66 -0
- package/dist/src/fabric/functions/changes-shot.function.js +56 -0
- package/dist/src/fabric/functions/changes-show.function.d.ts +41 -0
- package/dist/src/fabric/functions/changes-show.function.js +80 -0
- package/dist/src/fabric/functions/db-schema.function.d.ts +3 -3
- package/dist/src/fabric/functions/deploy-list.function.d.ts +3 -3
- package/dist/src/fabric/functions/deploy-units.function.d.ts +3 -3
- package/dist/src/fabric/functions/deploy.function.d.ts +12 -12
- package/dist/src/fabric/functions/deploy.function.js +6 -5
- package/dist/src/fabric/functions/domains-add.function.d.ts +7 -7
- package/dist/src/fabric/functions/domains-list.function.d.ts +3 -3
- package/dist/src/fabric/functions/domains-remove.function.d.ts +3 -3
- package/dist/src/fabric/functions/errors.function.d.ts +3 -3
- package/dist/src/fabric/functions/findings-clear.function.d.ts +3 -3
- package/dist/src/fabric/functions/findings-flush.function.d.ts +3 -3
- package/dist/src/fabric/functions/findings-list.function.d.ts +3 -3
- package/dist/src/fabric/functions/init.function.d.ts +3 -3
- package/dist/src/fabric/functions/link.function.d.ts +3 -3
- package/dist/src/fabric/functions/link.function.js +3 -2
- package/dist/src/fabric/functions/llm-key.function.d.ts +9 -9
- package/dist/src/fabric/functions/login.function.d.ts +3 -3
- package/dist/src/fabric/functions/logs.function.d.ts +3 -3
- package/dist/src/fabric/functions/logs.function.js +2 -1
- package/dist/src/fabric/functions/metrics.function.d.ts +3 -3
- package/dist/src/fabric/functions/projects-list.function.d.ts +3 -3
- package/dist/src/fabric/functions/publish.function.d.ts +3 -3
- package/dist/src/fabric/functions/report.function.d.ts +15 -15
- package/dist/src/fabric/functions/rollback.function.d.ts +9 -9
- package/dist/src/fabric/functions/secrets-delete.function.d.ts +3 -3
- package/dist/src/fabric/functions/secrets-list.function.d.ts +3 -3
- package/dist/src/fabric/functions/secrets-rotate.function.d.ts +3 -3
- package/dist/src/fabric/functions/secrets-set.function.d.ts +3 -3
- package/dist/src/fabric/functions/smoke.function.d.ts +3 -3
- package/dist/src/fabric/functions/status.function.d.ts +3 -3
- package/dist/src/fabric/functions/trace.function.d.ts +3 -3
- package/dist/src/fabric/functions/validate.function.d.ts +7 -7
- package/dist/src/fabric/functions/variables-get.function.d.ts +3 -3
- package/dist/src/fabric/functions/variables-set.function.d.ts +6 -6
- package/dist/src/fabric/lib/changes.d.ts +38 -0
- package/dist/src/fabric/lib/changes.js +70 -0
- package/dist/src/fabric/lib/errors.d.ts +21 -0
- package/dist/src/fabric/lib/errors.js +21 -0
- package/dist/src/fabric/lib/finding.d.ts +3 -3
- package/dist/src/fabric/lib/git.d.ts +3 -2
- package/dist/src/fabric/lib/git.js +10 -8
- package/dist/src/fabric/lib/output.d.ts +20 -0
- package/dist/src/fabric/lib/output.js +32 -7
- package/dist/src/functions/commands/all.d.ts +1 -1
- package/dist/src/functions/commands/audit.d.ts +1 -1
- package/dist/src/functions/commands/binary.d.ts +3 -3
- package/dist/src/functions/commands/bootstrap.d.ts +1 -1
- package/dist/src/functions/commands/bootstrap.js +3 -0
- package/dist/src/functions/commands/db-audit.d.ts +1 -1
- package/dist/src/functions/commands/db-baseline.d.ts +1 -1
- package/dist/src/functions/commands/db-check.d.ts +1 -1
- package/dist/src/functions/commands/db-codegen.d.ts +1 -1
- package/dist/src/functions/commands/db-export.d.ts +1 -1
- package/dist/src/functions/commands/db-generate.d.ts +1 -1
- package/dist/src/functions/commands/db-migrate.d.ts +1 -1
- package/dist/src/functions/commands/db-reset.d.ts +3 -3
- package/dist/src/functions/commands/deploy-apply.d.ts +3 -3
- package/dist/src/functions/commands/deploy-apply.js +35 -3
- package/dist/src/functions/commands/deploy-info.d.ts +1 -1
- package/dist/src/functions/commands/deploy-plan.d.ts +3 -3
- package/dist/src/functions/commands/deploy-plan.js +1 -0
- package/dist/src/functions/commands/dev-agent-runner.d.ts +9 -7
- package/dist/src/functions/commands/dev-agent-runner.js +56 -12
- package/dist/src/functions/commands/dev.d.ts +3 -3
- package/dist/src/functions/commands/dev.js +60 -6
- package/dist/src/functions/commands/dist.d.ts +3 -3
- package/dist/src/functions/commands/dist.js +2 -9
- package/dist/src/functions/commands/doc.d.ts +3 -3
- package/dist/src/functions/commands/emails-init.d.ts +1 -1
- package/dist/src/functions/commands/enable.d.ts +9 -9
- package/dist/src/functions/commands/import-n8n.d.ts +3 -3
- package/dist/src/functions/commands/info.d.ts +4 -4
- package/dist/src/functions/commands/init-or-warn.d.ts +19 -0
- package/dist/src/functions/commands/init-or-warn.js +25 -0
- package/dist/src/functions/commands/knowledge-index.d.ts +6 -6
- package/dist/src/functions/commands/knowledge-plan.d.ts +15 -15
- package/dist/src/functions/commands/knowledge-reconcile.d.ts +6 -6
- package/dist/src/functions/commands/knowledge-validate.d.ts +6 -6
- package/dist/src/functions/commands/login.d.ts +7 -7
- package/dist/src/functions/commands/meta.d.ts +34 -34
- package/dist/src/functions/commands/new-addon.d.ts +3 -3
- package/dist/src/functions/commands/new-function.d.ts +3 -3
- package/dist/src/functions/commands/new-middleware.d.ts +3 -3
- package/dist/src/functions/commands/new-permission.d.ts +3 -3
- package/dist/src/functions/commands/new-wiring.d.ts +3 -3
- package/dist/src/functions/commands/persona-sync.d.ts +3 -3
- package/dist/src/functions/commands/persona.d.ts +7 -7
- package/dist/src/functions/commands/pikku-command-bootstrap.d.ts +1 -1
- package/dist/src/functions/commands/pikku-command-summary.d.ts +1 -1
- package/dist/src/functions/commands/roles-audit.d.ts +1 -1
- package/dist/src/functions/commands/roles-prune.d.ts +3 -3
- package/dist/src/functions/commands/scenario.d.ts +7 -7
- package/dist/src/functions/commands/scopes-audit.d.ts +1 -1
- package/dist/src/functions/commands/scopes-prune.d.ts +3 -3
- package/dist/src/functions/commands/semver.d.ts +1 -1
- package/dist/src/functions/commands/serve.d.ts +3 -3
- package/dist/src/functions/commands/serve.js +40 -3
- package/dist/src/functions/commands/skills.d.ts +6 -6
- package/dist/src/functions/commands/update.d.ts +1 -1
- package/dist/src/functions/commands/validate.d.ts +6 -6
- package/dist/src/functions/commands/versions-check.d.ts +1 -1
- package/dist/src/functions/commands/versions-init.d.ts +3 -3
- package/dist/src/functions/commands/versions-update.d.ts +1 -1
- package/dist/src/functions/commands/watch.d.ts +3 -3
- package/dist/src/functions/db/zod-codegen.d.ts +19 -19
- package/dist/src/functions/knowledge/schemas.d.ts +5 -5
- package/dist/src/functions/runtimes/fetch/index.d.ts +1 -1
- package/dist/src/functions/runtimes/nextjs/pikku-command-nextjs.d.ts +1 -1
- package/dist/src/functions/runtimes/tanstack-start/pikku-command-tanstack-start.d.ts +1 -1
- package/dist/src/functions/runtimes/websocket/pikku-command-websocket-typed.d.ts +1 -1
- package/dist/src/functions/surface/build-surface-doc.js +1 -1
- package/dist/src/functions/surface/surface-doc.types.d.ts +1 -1
- package/dist/src/functions/surface/surface-editorial.js +5 -0
- package/dist/src/functions/validate/pikku-barrel-checks.js +2 -22
- package/dist/src/functions/validate/validate.d.ts +2 -2
- package/dist/src/functions/validate/websocket-deps-checks.d.ts +1 -1
- package/dist/src/functions/wirings/agent/pikku-command-agent-types.d.ts +1 -1
- package/dist/src/functions/wirings/agent/pikku-command-agent.d.ts +1 -1
- package/dist/src/functions/wirings/agent/pikku-command-public-agent.d.ts +1 -1
- package/dist/src/functions/wirings/agent-scorer/pikku-command-agent-scorer.d.ts +1 -1
- package/dist/src/functions/wirings/analytics/pikku-command-analytics.d.ts +11 -0
- package/dist/src/functions/wirings/analytics/pikku-command-analytics.js +66 -0
- package/dist/src/functions/wirings/analytics/serialize-analytics.d.ts +30 -0
- package/dist/src/functions/wirings/analytics/serialize-analytics.js +141 -0
- package/dist/src/functions/wirings/auth/pikku-command-auth.d.ts +3 -3
- package/dist/src/functions/wirings/auth/pikku-command-auth.js +2 -6
- package/dist/src/functions/wirings/auth/serialize-auth-gen.d.ts +1 -1
- package/dist/src/functions/wirings/auth/serialize-auth-gen.js +15 -36
- package/dist/src/functions/wirings/channels/pikku-command-channel-types.d.ts +1 -1
- package/dist/src/functions/wirings/channels/pikku-command-channels-map.d.ts +1 -1
- package/dist/src/functions/wirings/channels/pikku-command-channels.d.ts +1 -1
- package/dist/src/functions/wirings/cli/pikku-command-cli-entry.d.ts +1 -1
- package/dist/src/functions/wirings/cli/pikku-command-cli-types.d.ts +1 -1
- package/dist/src/functions/wirings/cli/pikku-command-cli.d.ts +1 -1
- package/dist/src/functions/wirings/console/pikku-command-console-functions.d.ts +1 -1
- package/dist/src/functions/wirings/console/pikku-command-nodes-meta.d.ts +1 -1
- package/dist/src/functions/wirings/credentials/pikku-command-credentials.d.ts +1 -1
- package/dist/src/functions/wirings/emails/pikku-command-emails.d.ts +1 -1
- package/dist/src/functions/wirings/errors/pikku-command-error-types.d.ts +1 -1
- package/dist/src/functions/wirings/flags/pikku-command-feature-flags-scaffold.d.ts +1 -0
- package/dist/src/functions/wirings/flags/pikku-command-feature-flags-scaffold.js +36 -0
- package/dist/src/functions/wirings/flags/pikku-command-flags.d.ts +7 -0
- package/dist/src/functions/wirings/flags/pikku-command-flags.js +36 -0
- package/dist/src/functions/wirings/flags/serialize-feature-flags-scaffold.d.ts +13 -0
- package/dist/src/functions/wirings/flags/serialize-feature-flags-scaffold.js +73 -0
- package/dist/src/functions/wirings/flags/serialize-flags-types.d.ts +14 -0
- package/dist/src/functions/wirings/flags/serialize-flags-types.js +68 -0
- package/dist/src/functions/wirings/functions/pikku-command-addon-types.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-function-types-split.d.ts +3 -3
- package/dist/src/functions/wirings/functions/pikku-command-function-types-split.js +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-functions.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-leaf-indexes.d.ts +2 -2
- package/dist/src/functions/wirings/functions/pikku-command-leaf-indexes.js +2 -1
- package/dist/src/functions/wirings/functions/pikku-command-services.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-services.js +9 -2
- package/dist/src/functions/wirings/functions/schemas.d.ts +1 -1
- package/dist/src/functions/wirings/functions/serialize-function-types.d.ts +1 -1
- package/dist/src/functions/wirings/functions/serialize-function-types.js +9 -4
- package/dist/src/functions/wirings/gateway/pikku-command-gateway-types.d.ts +3 -3
- package/dist/src/functions/wirings/gateway/pikku-command-gateway.d.ts +1 -1
- package/dist/src/functions/wirings/graph/pikku-command-graph-wirings.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-command-http-map.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-command-http-routes.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-command-http-types.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-command-openapi.d.ts +1 -1
- package/dist/src/functions/wirings/mcp/pikku-command-mcp-json.d.ts +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.d.ts +1 -1
- package/dist/src/functions/wirings/middleware/pikku-command-middleware.d.ts +1 -1
- package/dist/src/functions/wirings/package/pikku-command-package-types.d.ts +4 -3
- package/dist/src/functions/wirings/package/pikku-command-package-types.js +14 -1
- package/dist/src/functions/wirings/package/pikku-command-package.d.ts +1 -1
- package/dist/src/functions/wirings/package/serialize-package-types.d.ts +1 -0
- package/dist/src/functions/wirings/package/serialize-package-types.js +15 -0
- package/dist/src/functions/wirings/permissions/pikku-command-permissions.d.ts +1 -1
- package/dist/src/functions/wirings/personas/pikku-command-personas.d.ts +3 -3
- package/dist/src/functions/wirings/queue/pikku-command-queue-map.d.ts +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-types.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-queue-map.d.ts +1 -1
- package/dist/src/functions/wirings/realtime/pikku-command-events-scaffold.d.ts +1 -1
- package/dist/src/functions/wirings/realtime/pikku-command-realtime.d.ts +1 -1
- package/dist/src/functions/wirings/remote-jobs/pikku-command-remote-jobs.d.ts +1 -1
- package/dist/src/functions/wirings/roles/pikku-command-roles.d.ts +3 -3
- package/dist/src/functions/wirings/rpc/pikku-command-public-rpc.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-react-query.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-remote-rpc.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc-client.d.ts +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.d.ts +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.d.ts +1 -1
- package/dist/src/functions/wirings/scopes/pikku-command-scopes.d.ts +3 -3
- package/dist/src/functions/wirings/secrets/pikku-command-secrets.d.ts +1 -1
- package/dist/src/functions/wirings/triggers/pikku-command-trigger-types.d.ts +3 -3
- package/dist/src/functions/wirings/triggers/pikku-command-trigger.d.ts +1 -1
- package/dist/src/functions/wirings/variables/pikku-command-variables.d.ts +1 -1
- package/dist/src/functions/wirings/virtual-user/pikku-command-virtual-user-functions.d.ts +1 -1
- package/dist/src/functions/wirings/webhook/pikku-command-webhook.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-routes.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.d.ts +1 -1
- package/dist/src/functions/workflows/all.workflow.js +34 -9
- package/dist/src/services.js +7 -0
- package/dist/src/utils/analytics-schemas-file.d.ts +6 -0
- package/dist/src/utils/analytics-schemas-file.js +9 -0
- package/dist/src/utils/file-import-path.js +4 -1
- package/dist/src/utils/pikku-cli-config.d.ts +2 -2
- package/dist/src/utils/pikku-cli-config.js +28 -0
- package/dist/src/utils/remove-legacy-scaffold-file.js +4 -0
- package/dist/src/utils/resolve-from-project.d.ts +5 -0
- package/dist/src/utils/resolve-from-project.js +8 -2
- package/dist/src/utils/tsc-check.d.ts +11 -15
- package/dist/src/utils/tsc-check.js +97 -86
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +32 -25
- package/snippets.json +1 -1
- package/surface.json +743 -27
- package/CHANGELOG.md +0 -9620
- package/console-app/assets/HelpPanel-nYO2hRY5.js +0 -1
- package/console-app/assets/architecture-TIHT7OUA-B-c05-x5.js +0 -1
- package/console-app/assets/architectureDiagram-T3A2C74G-BAH1O4B7.js +0 -36
- package/console-app/assets/blockDiagram-VBNYF7ZC-T3kmcPgj.js +0 -132
- package/console-app/assets/c4Diagram-5PPSVZJV-DRva89Br.js +0 -10
- package/console-app/assets/channel-DJ3jfSNX.js +0 -1
- package/console-app/assets/chunk-7BUUIJ7U-Bb538aSH.js +0 -1
- package/console-app/assets/chunk-7Z6QIM7H-uxzNGOHh.js +0 -10
- package/console-app/assets/chunk-I66GZJ75-DksrbEtn.js +0 -127
- package/console-app/assets/chunk-JQJVKLGR-BnRvPhDK.js +0 -156
- package/console-app/assets/chunk-QR6OTTB3-CgQotuzQ.js +0 -62
- package/console-app/assets/chunk-RYQCIY6F-Cei0abOq.js +0 -1
- package/console-app/assets/chunk-UBXNYLIW-B55XJk4O.js +0 -1
- package/console-app/assets/chunk-W5SLKNZC-gFa01tuI.js +0 -1
- package/console-app/assets/chunk-WRU74C26-C3ESZQ-F.js +0 -70
- package/console-app/assets/chunk-XXDRQBXY-D0tL6SVk.js +0 -1
- package/console-app/assets/classDiagram-JCYQIIEL-BqEwCDi8.js +0 -1
- package/console-app/assets/classDiagram-v2-OCEON4UE-BqEwCDi8.js +0 -1
- package/console-app/assets/cose-bilkent-JH36ORCC-CUxqwjs-.js +0 -1
- package/console-app/assets/cynefin-VYW2F7L2-Dh1yOBBs.js +0 -1
- package/console-app/assets/cytoscape.esm-B-NFISlW.js +0 -321
- package/console-app/assets/dagre-DKjebq_c.js +0 -1
- package/console-app/assets/dagre-VZM6K2ZE-BllFBMe9.js +0 -4
- package/console-app/assets/erDiagram-JOGREHBK-Bg0FPLS0.js +0 -85
- package/console-app/assets/eventmodeling-45OFAUF4-CVovwmpS.js +0 -1
- package/console-app/assets/flowDiagram-UKHOOZJN-DwRgEyXD.js +0 -1
- package/console-app/assets/ganttDiagram-PKOTCBZU-BBxxHrPG.js +0 -292
- package/console-app/assets/gitGraph-TEB2WS4Q-Cn1MjFvM.js +0 -1
- package/console-app/assets/graphlib-IlWVLY3o.js +0 -1
- package/console-app/assets/index-C8MC-uMB.css +0 -1
- package/console-app/assets/index-Deds7K2I.js +0 -290
- package/console-app/assets/info-DKCQHKI2-C2R7hV-y.js +0 -1
- package/console-app/assets/isUndefined-T4snU1Mx.js +0 -1
- package/console-app/assets/linear-BQOZezXu.js +0 -1
- package/console-app/assets/map-BmPfXn7V.js +0 -1
- package/console-app/assets/mermaid.core-B02bSmuz.js +0 -42
- package/console-app/assets/packet-7NZHBO7P-CkYMF0Cd.js +0 -1
- package/console-app/assets/pie-RZYD4A2V-BFMvieVM.js +0 -1
- package/console-app/assets/radar-I7S5WNFK-C_2tp7_w.js +0 -1
- package/console-app/assets/railroad-3IZDKUUU-DwlFJLv5.js +0 -1
- package/console-app/assets/railroad-abnf-AHOZXSZD-Cyu_rpdZ.js +0 -1
- package/console-app/assets/railroad-ebnf-EBAXGLYW-BLiwK-H7.js +0 -1
- package/console-app/assets/railroad-peg-LSFZ7HO6-BUDTDYmP.js +0 -1
- package/console-app/assets/src-BI35UZf8.js +0 -1
- package/console-app/assets/stateDiagram-v2-UEYNNEHI-BsP8TwKV.js +0 -1
- package/console-app/assets/swimlanes-SLNWSIFB-DvAJxCGQ.js +0 -2
- package/console-app/assets/swimlanesDiagram-ULZ7WXOC-BAXO3Id2.js +0 -8
- package/console-app/assets/treeView-QDETBFTQ-DnlS0s0_.js +0 -1
- package/console-app/assets/treemap-6X3UGDF4-CiUoxlJe.js +0 -1
- package/console-app/assets/wardley-OPB4EBWU-DrTySJtR.js +0 -1
- package/dist/.pikku/console/index.d.ts +0 -1
- package/dist/.pikku/console/index.js +0 -1
- package/dist/.pikku/console/pikku-node-types.gen.d.ts +0 -6
- package/dist/.pikku/console/pikku-node-types.gen.js +0 -1
- package/dist/.pikku/pikku-meta-service.gen.d.ts +0 -7
- package/dist/.pikku/pikku-meta-service.gen.js +0 -9
- package/dist/.pikku/pikku-types.gen.d.ts +0 -17
- package/dist/.pikku/pikku-types.gen.js +0 -28
- package/dist/.pikku/workflow/pikku-personas.gen.d.ts +0 -15
- package/dist/.pikku/workflow/pikku-personas.gen.js +0 -17
- package/dist/src/functions/surface/collect-surface.d.ts +0 -58
- package/dist/src/functions/surface/collect-surface.js +0 -613
- /package/console-app/assets/{sizeCapture-X5ZJPWSS-B0uUizjq.js → sizeCapture-INFHLROL-B0uUizjq.js} +0 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The declarations flattened to one entry per event, which is how every reader
|
|
3
|
+
* wants them: an event name belongs to exactly one declaration — the inspector
|
|
4
|
+
* refuses a second — so keying by name loses nothing and spares each caller the
|
|
5
|
+
* walk.
|
|
6
|
+
*/
|
|
7
|
+
export const buildAnalyticsEventsMeta = (declarations) => {
|
|
8
|
+
const meta = {};
|
|
9
|
+
for (const declaration of declarations) {
|
|
10
|
+
for (const name of declaration.events) {
|
|
11
|
+
const props = declaration.props?.[name];
|
|
12
|
+
meta[name] = {
|
|
13
|
+
name,
|
|
14
|
+
file: declaration.file,
|
|
15
|
+
variable: declaration.variable,
|
|
16
|
+
...(props ? { props } : {}),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return meta;
|
|
21
|
+
};
|
|
22
|
+
/** So two modules can both export `analyticsEvents` without colliding. */
|
|
23
|
+
const alias = (index) => `events${index}`;
|
|
24
|
+
/**
|
|
25
|
+
* Generate the ingest wire and its schemas. No middleware is emitted: an origin
|
|
26
|
+
* lock is not a security boundary and rejects every native client, so which
|
|
27
|
+
* guard belongs here is the project's call.
|
|
28
|
+
*/
|
|
29
|
+
export const serializeAnalytics = (leaf, declarations, globalHTTPPrefix = '') => {
|
|
30
|
+
const imports = declarations
|
|
31
|
+
.map((declaration, index) => `import { ${declaration.variable} as ${alias(index)} } from '${declaration.specifier}'`)
|
|
32
|
+
.join('\n');
|
|
33
|
+
const members = declarations
|
|
34
|
+
.flatMap((declaration, index) => declaration.events.map((event) => ` z\n .object(${alias(index)}['${event}'].shape)\n .extend({ name: z.literal('${event}') }),`))
|
|
35
|
+
.join('\n');
|
|
36
|
+
const schemas = `/**
|
|
37
|
+
* Auto-generated analytics ingest schemas
|
|
38
|
+
* Do not edit manually - regenerate with 'npx pikku'
|
|
39
|
+
*/
|
|
40
|
+
import { z } from 'zod'
|
|
41
|
+
${imports}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The name is the declaration's key, reattached here as the discriminator —
|
|
45
|
+
* last, so a declaration that happens to carry a 'name' prop of its own
|
|
46
|
+
* cannot overwrite the literal the union discriminates on.
|
|
47
|
+
*/
|
|
48
|
+
export const AnalyticsEventSchema = z.discriminatedUnion('name', [
|
|
49
|
+
${members}
|
|
50
|
+
])
|
|
51
|
+
|
|
52
|
+
export type AnalyticsEvent = z.infer<typeof AnalyticsEventSchema>
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Batched because a browser sends these on unload, where one request survives
|
|
56
|
+
* and several may not. Capped so an unauthenticated request cannot ask for
|
|
57
|
+
* unbounded work.
|
|
58
|
+
*/
|
|
59
|
+
export const AnalyticsIngest = z.object({
|
|
60
|
+
events: z
|
|
61
|
+
.array(
|
|
62
|
+
z.object({
|
|
63
|
+
at: z.number().int().optional(),
|
|
64
|
+
event: AnalyticsEventSchema,
|
|
65
|
+
})
|
|
66
|
+
)
|
|
67
|
+
.min(1)
|
|
68
|
+
.max(50),
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
export const AnalyticsIngestOutput = z.object({
|
|
72
|
+
accepted: z.number(),
|
|
73
|
+
})
|
|
74
|
+
`;
|
|
75
|
+
const functions = `/**
|
|
76
|
+
* Auto-generated analytics ingest
|
|
77
|
+
* Do not edit manually - regenerate with 'npx pikku'
|
|
78
|
+
*/
|
|
79
|
+
import { pikkuSessionlessFunc } from '${leaf('function')}'
|
|
80
|
+
import { wireHTTP } from '${leaf('http')}'
|
|
81
|
+
import {
|
|
82
|
+
AnalyticsIngest,
|
|
83
|
+
AnalyticsIngestOutput,
|
|
84
|
+
} from './analytics.schemas.gen.js'
|
|
85
|
+
|
|
86
|
+
export type { AnalyticsEvent } from './analytics.schemas.gen.js'
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Re-exported so an app reaches the whole analytics surface through one
|
|
90
|
+
* specifier. Where events go is wired next to where they are declared, and
|
|
91
|
+
* making that import '@pikku/core/analytics' while the event type comes from
|
|
92
|
+
* '#pikku/analytics' splits one concern across two names.
|
|
93
|
+
*/
|
|
94
|
+
export {
|
|
95
|
+
fanOutAnalytics,
|
|
96
|
+
cookieAnalyticsIdentity,
|
|
97
|
+
composeAnalyticsIdentity,
|
|
98
|
+
anonymousAnalyticsIdentity,
|
|
99
|
+
mintCookie,
|
|
100
|
+
randomDigits,
|
|
101
|
+
LoggerAnalyticsService,
|
|
102
|
+
} from '@pikku/core/analytics'
|
|
103
|
+
export type {
|
|
104
|
+
AnalyticsIdentity,
|
|
105
|
+
AnalyticsIdentityResolver,
|
|
106
|
+
AnalyticsRecord,
|
|
107
|
+
AnalyticsService,
|
|
108
|
+
AnalyticsSink,
|
|
109
|
+
} from '@pikku/core/analytics'
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Unauthenticated by necessity: anonymous visitors are most of what this
|
|
113
|
+
* measures. Identity is stamped from the session and never read from the body,
|
|
114
|
+
* so no caller can attribute events to someone else. An anonymous visitor is
|
|
115
|
+
* identified only where the app wired a resolver that mints one — nothing here
|
|
116
|
+
* stores anything on a device by itself.
|
|
117
|
+
*/
|
|
118
|
+
export const analyticsIngest = pikkuSessionlessFunc({
|
|
119
|
+
auth: false,
|
|
120
|
+
tags: ['analytics'],
|
|
121
|
+
description: 'Records product-analytics events from a client.',
|
|
122
|
+
input: AnalyticsIngest,
|
|
123
|
+
output: AnalyticsIngestOutput,
|
|
124
|
+
func: async ({ analytics }, { events }) => {
|
|
125
|
+
for (const { at, event } of events) {
|
|
126
|
+
await analytics!.record(event, { at })
|
|
127
|
+
}
|
|
128
|
+
return { accepted: events.length }
|
|
129
|
+
},
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
wireHTTP({
|
|
133
|
+
route: '${globalHTTPPrefix}/analytics',
|
|
134
|
+
method: 'post',
|
|
135
|
+
auth: false,
|
|
136
|
+
tags: ['analytics'],
|
|
137
|
+
func: analyticsIngest,
|
|
138
|
+
})
|
|
139
|
+
`;
|
|
140
|
+
return { schemas, functions };
|
|
141
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const pikkuAuth: import("#pikku/function").PikkuFunctionConfig<{
|
|
2
2
|
bootstrap?: boolean;
|
|
3
|
-
}, void, "rpc" | "session", import("#pikku/function").
|
|
3
|
+
}, void, "rpc" | "session", import("#pikku/function").PikkuFunction<{
|
|
4
4
|
bootstrap?: boolean;
|
|
5
|
-
}, void, "rpc" | "session", import("#pikku/function").WiredServices
|
|
5
|
+
}, void, "rpc" | "session", import("#pikku/function").WiredServices> | import("#pikku/function").PikkuFunctionSessionless<{
|
|
6
6
|
bootstrap?: boolean;
|
|
7
|
-
}, void, "rpc" | "session", import("#pikku/function").WiredServices>, undefined, undefined>;
|
|
7
|
+
}, void, "rpc" | "session", import("#pikku/function").WiredServices, unknown>, undefined, undefined>;
|
|
@@ -32,7 +32,7 @@ export const pikkuAuth = pikkuSessionlessFunc({
|
|
|
32
32
|
// has no OAuth providers — still generates its /auth/* wiring.
|
|
33
33
|
if (!state.auth.definition)
|
|
34
34
|
return;
|
|
35
|
-
const { wiring, secrets, middleware } = serializeAuthGen(state.auth.definition, state.auth.providers, authFile, (name) => getLeafImportPath(authFile, name, config), packageMappings ?? {},
|
|
35
|
+
const { wiring, secrets, middleware } = serializeAuthGen(state.auth.definition, state.auth.providers, authFile, (name) => getLeafImportPath(authFile, name, config), packageMappings ?? {}, Boolean(config.scaffold?.console));
|
|
36
36
|
// The secrets file sits alongside authFile so re-inspection rediscovers it.
|
|
37
37
|
// It is kept separate from the wiring file because the CLI forbids Zod
|
|
38
38
|
// schemas and HTTP wiring (wireHTTPRoutes) in the same file (PKU490).
|
|
@@ -40,12 +40,8 @@ export const pikkuAuth = pikkuSessionlessFunc({
|
|
|
40
40
|
await writeFileInDir(logger, authFile, wiring);
|
|
41
41
|
await writeFileInDir(logger, secretsFile, secrets);
|
|
42
42
|
// Stateless split: session middleware in its own file (see serializeAuthGen).
|
|
43
|
-
// Skip it when the project registers its own betterAuthStatelessSession — the
|
|
44
|
-
// generated default-map one would run first and pre-empt the user's custom
|
|
45
|
-
// mapSession (pikkujs/pikku#754). Remove a stale file so it can't linger and
|
|
46
|
-
// double-register.
|
|
47
43
|
const middlewareFile = join(dirname(authFile), 'auth-middleware.gen.ts');
|
|
48
|
-
if (middleware
|
|
44
|
+
if (middleware) {
|
|
49
45
|
await writeFileInDir(logger, middlewareFile, middleware);
|
|
50
46
|
}
|
|
51
47
|
else if (existsSync(middlewareFile)) {
|
|
@@ -18,4 +18,4 @@ export interface AuthGenOutput {
|
|
|
18
18
|
* `session.cookieCache` is enabled (stateless path); undefined otherwise. */
|
|
19
19
|
middleware?: string;
|
|
20
20
|
}
|
|
21
|
-
export declare const serializeAuthGen: (definition: AuthDefinition, providers: string[], authFile: string, leaf: (name: string) => string, packageMappings: Record<string, string>,
|
|
21
|
+
export declare const serializeAuthGen: (definition: AuthDefinition, providers: string[], authFile: string, leaf: (name: string) => string, packageMappings: Record<string, string>, includeConsoleToken?: boolean) => AuthGenOutput;
|
|
@@ -36,12 +36,7 @@ function variableSchemaName(name, field) {
|
|
|
36
36
|
// External consoles (served from another origin) cannot carry the session
|
|
37
37
|
// cookie, so they authenticate with 'Authorization: Bearer <PIKKU_CONSOLE_TOKEN>'.
|
|
38
38
|
// The expected token resolves through the secrets service per request and the
|
|
39
|
-
// middleware is a no-op while the secret is unset.
|
|
40
|
-
// middleware in one addGlobalMiddleware call. This used to be an
|
|
41
|
-
// addHTTPMiddleware('*') call and had to be a single one, because the inspector
|
|
42
|
-
// keys route-middleware groups by pattern and a second '*' registration would
|
|
43
|
-
// silently displace it; global middleware is an append-only list, so that
|
|
44
|
-
// hazard is gone.
|
|
39
|
+
// middleware is a no-op while the secret is unset.
|
|
45
40
|
//
|
|
46
41
|
// The session carries the two scope roots the console's functions gate
|
|
47
42
|
// themselves on. Without them this token authenticates but authorizes nothing:
|
|
@@ -65,7 +60,7 @@ const consoleTokenMiddlewareLines = () => [
|
|
|
65
60
|
` },`,
|
|
66
61
|
` }),`,
|
|
67
62
|
];
|
|
68
|
-
export const serializeAuthGen = (definition, providers, authFile, leaf, packageMappings,
|
|
63
|
+
export const serializeAuthGen = (definition, providers, authFile, leaf, packageMappings, includeConsoleToken = false) => {
|
|
69
64
|
const known = providers.filter((p) => p in PROVIDER_REGISTRY);
|
|
70
65
|
const basePath = definition.basePath;
|
|
71
66
|
// Side-effect import of the user's auth file so `pikkuBetterAuth` runs and
|
|
@@ -143,25 +138,21 @@ export const serializeAuthGen = (definition, providers, authFile, leaf, packageM
|
|
|
143
138
|
// file's auth.wiring import (the full better-auth server) isn't dragged into
|
|
144
139
|
// every unit — only the auth unit bundles it.
|
|
145
140
|
const stateless = definition.cookieCache;
|
|
146
|
-
//
|
|
147
|
-
//
|
|
148
|
-
//
|
|
149
|
-
//
|
|
150
|
-
//
|
|
151
|
-
|
|
152
|
-
const emitStatefulSession = !stateless && !hasUserSessionMiddleware;
|
|
141
|
+
// The generated session middleware is always emitted, at `lowest` priority. An
|
|
142
|
+
// app's own registration defaults to `medium`, so it resolves the session
|
|
143
|
+
// first and this one short-circuits on `if (session) next()`. That is what
|
|
144
|
+
// pikkujs/pikku#754 needed: the CLI used to detect a user registration and
|
|
145
|
+
// skip generating at all, which silently dropped anything emitted alongside.
|
|
146
|
+
const emitStatefulSession = !stateless;
|
|
153
147
|
const wiring = [
|
|
154
148
|
'// AUTO-GENERATED by pikku CLI — do not edit',
|
|
155
149
|
'',
|
|
156
150
|
emitStatefulSession
|
|
157
|
-
? `import { pikkuSessionlessFunc } from '${leaf('function')}'\nimport { wireHTTPRoutes } from '${leaf('http')}'\nimport { addGlobalMiddleware } from '@pikku/core/middleware'`
|
|
151
|
+
? `import { pikkuSessionlessFunc } from '${leaf('function')}'\nimport { wireHTTPRoutes } from '${leaf('http')}'\nimport { addGlobalMiddleware${includeConsoleToken ? ', authBearer' : ''} } from '@pikku/core/middleware'`
|
|
158
152
|
: `import { pikkuSessionlessFunc } from '${leaf('function')}'\nimport { wireHTTPRoutes } from '${leaf('http')}'`,
|
|
159
153
|
emitStatefulSession
|
|
160
154
|
? `import { createAuthHandler, betterAuthSession } from '@pikku/better-auth'`
|
|
161
155
|
: `import { createAuthHandler } from '@pikku/better-auth'`,
|
|
162
|
-
...(emitStatefulSession && includeConsoleToken
|
|
163
|
-
? [`import { authBearer } from '@pikku/core/middleware'`]
|
|
164
|
-
: []),
|
|
165
156
|
`import '${configImportPath}'`,
|
|
166
157
|
'',
|
|
167
158
|
// createAuthHandler is called once at module load; the exported handler is a
|
|
@@ -179,12 +170,7 @@ export const serializeAuthGen = (definition, providers, authFile, leaf, packageM
|
|
|
179
170
|
if (emitStatefulSession) {
|
|
180
171
|
// Stateful: betterAuthSession calls services.auth(), so it stays here with
|
|
181
172
|
// the auth.wiring import.
|
|
182
|
-
|
|
183
|
-
wiring.push(`addGlobalMiddleware([`, ` betterAuthSession(),`, ...consoleTokenMiddlewareLines(), `])`, '');
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
wiring.push(`addGlobalMiddleware([betterAuthSession()])`, '');
|
|
187
|
-
}
|
|
173
|
+
wiring.push(`addGlobalMiddleware([`, ` betterAuthSession({ priority: 'lowest' }),`, ...(includeConsoleToken ? consoleTokenMiddlewareLines() : []), `])`, '');
|
|
188
174
|
}
|
|
189
175
|
// `pikku` tag marks these as scaffold plumbing (not user-authored wiring) so
|
|
190
176
|
// visualizers like the console's woven build view can hide them.
|
|
@@ -223,20 +209,13 @@ export const serializeAuthGen = (definition, providers, authFile, leaf, packageM
|
|
|
223
209
|
const middleware = [
|
|
224
210
|
'// AUTO-GENERATED by pikku CLI — do not edit',
|
|
225
211
|
'',
|
|
226
|
-
`import { addGlobalMiddleware } from '@pikku/core/middleware'`,
|
|
212
|
+
`import { addGlobalMiddleware${includeConsoleToken ? ', authBearer' : ''} } from '@pikku/core/middleware'`,
|
|
227
213
|
`import { betterAuthStatelessSession } from '@pikku/better-auth'`,
|
|
228
|
-
...(includeConsoleToken
|
|
229
|
-
? [`import { authBearer } from '@pikku/core/middleware'`]
|
|
230
|
-
: []),
|
|
231
214
|
'',
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
...consoleTokenMiddlewareLines(),
|
|
237
|
-
`])`,
|
|
238
|
-
]
|
|
239
|
-
: [`addGlobalMiddleware([betterAuthStatelessSession()])`]),
|
|
215
|
+
`addGlobalMiddleware([`,
|
|
216
|
+
` betterAuthStatelessSession({ priority: 'lowest' }),`,
|
|
217
|
+
...(includeConsoleToken ? consoleTokenMiddlewareLines() : []),
|
|
218
|
+
`])`,
|
|
240
219
|
'',
|
|
241
220
|
];
|
|
242
221
|
output.middleware = middleware.join('\n');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const pikkuChannelTypes: import("#pikku/function").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku/function").
|
|
1
|
+
export declare const pikkuChannelTypes: import("#pikku/function").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku/function").PikkuFunction<void, void, "rpc" | "session", import("#pikku/function").WiredServices> | import("#pikku/function").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku/function").WiredServices, unknown>, undefined, undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const pikkuChannelsMap: import("#pikku/function").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku/function").
|
|
1
|
+
export declare const pikkuChannelsMap: import("#pikku/function").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku/function").PikkuFunction<void, void, "rpc" | "session", import("#pikku/function").WiredServices> | import("#pikku/function").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku/function").WiredServices, unknown>, undefined, undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const pikkuCommandChannels: import("#pikku/function").PikkuFunctionConfig<void, boolean | undefined, "rpc" | "session", import("#pikku/function").
|
|
1
|
+
export declare const pikkuCommandChannels: import("#pikku/function").PikkuFunctionConfig<void, boolean | undefined, "rpc" | "session", import("#pikku/function").PikkuFunction<void, boolean | undefined, "rpc" | "session", import("#pikku/function").WiredServices> | import("#pikku/function").PikkuFunctionSessionless<void, boolean | undefined, "rpc" | "session", import("#pikku/function").WiredServices, unknown>, undefined, undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const pikkuCLIEntry: import("#pikku/function").PikkuFunctionConfig<void, boolean, "rpc" | "session", import("#pikku/function").
|
|
1
|
+
export declare const pikkuCLIEntry: import("#pikku/function").PikkuFunctionConfig<void, boolean, "rpc" | "session", import("#pikku/function").PikkuFunction<void, boolean, "rpc" | "session", import("#pikku/function").WiredServices> | import("#pikku/function").PikkuFunctionSessionless<void, boolean, "rpc" | "session", import("#pikku/function").WiredServices, unknown>, undefined, undefined>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
type CLITypesCommandInput = {
|
|
2
2
|
bootstrap?: boolean;
|
|
3
3
|
};
|
|
4
|
-
export declare const pikkuCLITypes: import("#pikku/function").PikkuFunctionConfig<CLITypesCommandInput, void, "rpc" | "session", import("#pikku/function").
|
|
4
|
+
export declare const pikkuCLITypes: import("#pikku/function").PikkuFunctionConfig<CLITypesCommandInput, void, "rpc" | "session", import("#pikku/function").PikkuFunction<CLITypesCommandInput, void, "rpc" | "session", import("#pikku/function").WiredServices> | import("#pikku/function").PikkuFunctionSessionless<CLITypesCommandInput, void, "rpc" | "session", import("#pikku/function").WiredServices, unknown>, undefined, undefined>;
|
|
5
5
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const pikkuCLI: import("#pikku/function").PikkuFunctionConfig<void, boolean | undefined, "rpc" | "session", import("#pikku/function").
|
|
1
|
+
export declare const pikkuCLI: import("#pikku/function").PikkuFunctionConfig<void, boolean | undefined, "rpc" | "session", import("#pikku/function").PikkuFunction<void, boolean | undefined, "rpc" | "session", import("#pikku/function").WiredServices> | import("#pikku/function").PikkuFunctionSessionless<void, boolean | undefined, "rpc" | "session", import("#pikku/function").WiredServices, unknown>, undefined, undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const pikkuConsoleFunctions: import("#pikku/function").PikkuFunctionConfig<void, boolean, "rpc" | "session", import("#pikku/function").
|
|
1
|
+
export declare const pikkuConsoleFunctions: import("#pikku/function").PikkuFunctionConfig<void, boolean, "rpc" | "session", import("#pikku/function").PikkuFunction<void, boolean, "rpc" | "session", import("#pikku/function").WiredServices> | import("#pikku/function").PikkuFunctionSessionless<void, boolean, "rpc" | "session", import("#pikku/function").WiredServices, unknown>, undefined, undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const pikkuNodesMeta: import("#pikku/function").PikkuFunctionConfig<void, boolean | undefined, "rpc" | "session", import("#pikku/function").
|
|
1
|
+
export declare const pikkuNodesMeta: import("#pikku/function").PikkuFunctionConfig<void, boolean | undefined, "rpc" | "session", import("#pikku/function").PikkuFunction<void, boolean | undefined, "rpc" | "session", import("#pikku/function").WiredServices> | import("#pikku/function").PikkuFunctionSessionless<void, boolean | undefined, "rpc" | "session", import("#pikku/function").WiredServices, unknown>, undefined, undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const pikkuCredentials: import("#pikku/function").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku/function").
|
|
1
|
+
export declare const pikkuCredentials: import("#pikku/function").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku/function").PikkuFunction<void, void, "rpc" | "session", import("#pikku/function").WiredServices> | import("#pikku/function").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku/function").WiredServices, unknown>, undefined, undefined>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PikkuCLIConfig } from '../../../../types/config.js';
|
|
2
2
|
import type { CLILogger } from '../../../services/cli-logger.service.js';
|
|
3
|
-
export declare const pikkuEmails: import("#pikku/function").PikkuFunctionConfig<void, boolean | undefined, "rpc" | "session", import("#pikku/function").
|
|
3
|
+
export declare const pikkuEmails: import("#pikku/function").PikkuFunctionConfig<void, boolean | undefined, "rpc" | "session", import("#pikku/function").PikkuFunction<void, boolean | undefined, "rpc" | "session", import("#pikku/function").WiredServices> | import("#pikku/function").PikkuFunctionSessionless<void, boolean | undefined, "rpc" | "session", import("#pikku/function").WiredServices, unknown>, undefined, undefined>;
|
|
4
4
|
export declare function generateEmailsArtifacts(logger: CLILogger, config: Pick<PikkuCLIConfig, 'outDir'> & {
|
|
5
5
|
emailTemplatesDir?: string;
|
|
6
6
|
}): Promise<true | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const pikkuErrorTypes: import("#pikku/function").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku/function").
|
|
1
|
+
export declare const pikkuErrorTypes: import("#pikku/function").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku/function").PikkuFunction<void, void, "rpc" | "session", import("#pikku/function").WiredServices> | import("#pikku/function").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku/function").WiredServices, unknown>, undefined, undefined>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const pikkuFeatureFlagsScaffold: import("#pikku/function").PikkuFunctionConfig<void, boolean, "rpc" | "session", import("#pikku/function").PikkuFunction<void, boolean, "rpc" | "session", import("#pikku/function").WiredServices> | import("#pikku/function").PikkuFunctionSessionless<void, boolean, "rpc" | "session", import("#pikku/function").WiredServices, unknown>, undefined, undefined>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { pikkuSessionlessFunc } from '#pikku/function';
|
|
2
|
+
import { getLeafImportPath } from '../../../utils/leaf-import-path.js';
|
|
3
|
+
import { writeFileInDir } from '../../../utils/file-writer.js';
|
|
4
|
+
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
|
|
5
|
+
import { removeLegacyScaffoldFile } from '../../../utils/remove-legacy-scaffold-file.js';
|
|
6
|
+
import { serializeFeatureFlagsScaffold } from './serialize-feature-flags-scaffold.js';
|
|
7
|
+
import { isDeployCodegen } from '../../../utils/is-deploy-codegen.js';
|
|
8
|
+
export const pikkuFeatureFlagsScaffold = pikkuSessionlessFunc({
|
|
9
|
+
func: async ({ logger, config, variables, getInspectorState }) => {
|
|
10
|
+
if (await isDeployCodegen(variables)) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
if (!config.scaffold?.featureFlags || !config.featureFlagsFile) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
const { featureFlags } = await getInspectorState();
|
|
17
|
+
// Refuse rather than emit a wire whose response type is an empty union:
|
|
18
|
+
// `Record<never, boolean>` compiles and is useless, and a client would
|
|
19
|
+
// discover the project declared nothing by reading an empty object.
|
|
20
|
+
if (featureFlags.definitions.length === 0) {
|
|
21
|
+
logger.error(`scaffold.featureFlags is enabled but no defineFeatureFlags declaration was found. ` +
|
|
22
|
+
`Add one in a source directory: \`defineFeatureFlags({ newCheckout: { description: 'The new checkout' } })\`.`);
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
const leaf = (name) => getLeafImportPath(config.featureFlagsFile, name, config);
|
|
26
|
+
await writeFileInDir(logger, config.featureFlagsFile, serializeFeatureFlagsScaffold(leaf, config.globalHTTPPrefix || ''));
|
|
27
|
+
await removeLegacyScaffoldFile(config.featureFlagsFile);
|
|
28
|
+
return true;
|
|
29
|
+
},
|
|
30
|
+
middleware: [
|
|
31
|
+
logCommandInfoAndTime({
|
|
32
|
+
commandStart: 'Generating Feature Flag Wire',
|
|
33
|
+
commandEnd: 'Generated Feature Flag Wire',
|
|
34
|
+
}),
|
|
35
|
+
],
|
|
36
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const pikkuFlags: import("#pikku/function").PikkuFunctionConfig<{
|
|
2
|
+
bootstrap?: boolean;
|
|
3
|
+
}, void, "rpc" | "session", import("#pikku/function").PikkuFunction<{
|
|
4
|
+
bootstrap?: boolean;
|
|
5
|
+
}, void, "rpc" | "session", import("#pikku/function").WiredServices> | import("#pikku/function").PikkuFunctionSessionless<{
|
|
6
|
+
bootstrap?: boolean;
|
|
7
|
+
}, void, "rpc" | "session", import("#pikku/function").WiredServices, unknown>, undefined, undefined>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { pikkuSessionlessFunc } from '#pikku/function';
|
|
2
|
+
import { writeFileInDir } from '../../../utils/file-writer.js';
|
|
3
|
+
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
|
|
4
|
+
import { serializeFlagsTypes } from './serialize-flags-types.js';
|
|
5
|
+
import { validateAndBuildFeatureFlagDefinitionsMeta } from '@pikku/core/flag';
|
|
6
|
+
export const pikkuFlags = pikkuSessionlessFunc({
|
|
7
|
+
func: async ({ logger, config, getInspectorState }, data) => {
|
|
8
|
+
const { flagsFile, flagsMetaJsonFile } = config;
|
|
9
|
+
if (!flagsFile) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
// Same cold-start reasoning as Roles: on a bare .pikku this runs before the
|
|
13
|
+
// function leaf exists, so it takes the zero state. The file only has to
|
|
14
|
+
// exist so a function can import FeatureFlagName; the real Flags step
|
|
15
|
+
// regenerates it with the declarations once setup has run.
|
|
16
|
+
const bootstrap = data?.bootstrap ?? false;
|
|
17
|
+
const state = await getInspectorState(false, bootstrap, bootstrap);
|
|
18
|
+
// Validate before writing anything, and emit the union from the same
|
|
19
|
+
// validated set the sidecar is built from. Two derivations of one
|
|
20
|
+
// vocabulary can disagree, and a conflicting redeclaration used to throw
|
|
21
|
+
// only after the .ts had already been written — leaving a union describing
|
|
22
|
+
// a set the sidecar never got.
|
|
23
|
+
const meta = validateAndBuildFeatureFlagDefinitionsMeta(state.featureFlags.definitions);
|
|
24
|
+
const content = serializeFlagsTypes({ definitions: Object.values(meta) });
|
|
25
|
+
await writeFileInDir(logger, flagsFile, content);
|
|
26
|
+
if (flagsMetaJsonFile) {
|
|
27
|
+
await writeFileInDir(logger, flagsMetaJsonFile, JSON.stringify(meta, null, 2));
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
middleware: [
|
|
31
|
+
logCommandInfoAndTime({
|
|
32
|
+
commandStart: 'Creating PikkuFlags types',
|
|
33
|
+
commandEnd: 'Created PikkuFlags types',
|
|
34
|
+
}),
|
|
35
|
+
],
|
|
36
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate the read wire a client asks for its own flags on.
|
|
3
|
+
*
|
|
4
|
+
* Generated into the app rather than shipped in an addon because the map is
|
|
5
|
+
* keyed by the app's own `FeatureFlagName`. An addon merges its declarations
|
|
6
|
+
* through the metadata sidecar but never sees the host's union, so the same
|
|
7
|
+
* endpoint written there could only return `Record<string, boolean>` — losing
|
|
8
|
+
* the one thing generating a union was for.
|
|
9
|
+
*
|
|
10
|
+
* No middleware, on the same terms as the analytics ingest: who may ask is the
|
|
11
|
+
* project's call, and the answer is already per-caller.
|
|
12
|
+
*/
|
|
13
|
+
export declare const serializeFeatureFlagsScaffold: (leaf: (name: string) => string, globalHTTPPrefix?: string) => string;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate the read wire a client asks for its own flags on.
|
|
3
|
+
*
|
|
4
|
+
* Generated into the app rather than shipped in an addon because the map is
|
|
5
|
+
* keyed by the app's own `FeatureFlagName`. An addon merges its declarations
|
|
6
|
+
* through the metadata sidecar but never sees the host's union, so the same
|
|
7
|
+
* endpoint written there could only return `Record<string, boolean>` — losing
|
|
8
|
+
* the one thing generating a union was for.
|
|
9
|
+
*
|
|
10
|
+
* No middleware, on the same terms as the analytics ingest: who may ask is the
|
|
11
|
+
* project's call, and the answer is already per-caller.
|
|
12
|
+
*/
|
|
13
|
+
export const serializeFeatureFlagsScaffold = (leaf, globalHTTPPrefix = '') => `/**
|
|
14
|
+
* Auto-generated feature flag read wire
|
|
15
|
+
* Do not edit manually - regenerate with 'npx pikku'
|
|
16
|
+
*/
|
|
17
|
+
import { pikkuSessionlessFunc } from '${leaf('function')}'
|
|
18
|
+
import { wireHTTP } from '${leaf('http')}'
|
|
19
|
+
import {
|
|
20
|
+
FEATURE_FLAGS,
|
|
21
|
+
FEATURE_FLAGS_FALLBACK,
|
|
22
|
+
type FeatureFlagName,
|
|
23
|
+
} from '${leaf('scopes')}'
|
|
24
|
+
import { resolveFlagsForClient } from '@pikku/core/flag'
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Every declared flag resolved for the caller, in one request.
|
|
28
|
+
*
|
|
29
|
+
* Asked once per session and read from memory after — a flag is checked
|
|
30
|
+
* wherever a component renders, and a request each would put the network in
|
|
31
|
+
* front of a paint.
|
|
32
|
+
*
|
|
33
|
+
* Unauthenticated by necessity: a signed-out visitor still renders a page, and
|
|
34
|
+
* a flag it cannot hold resolves false rather than being withheld. The session
|
|
35
|
+
* is the server's, never read from the body, so no caller can ask what someone
|
|
36
|
+
* else would see.
|
|
37
|
+
*
|
|
38
|
+
* Booleans, not the two halves of a flag's state. \`show\` is their collapse,
|
|
39
|
+
* and sending \`available\` apart from \`capable\` would tell every visitor which
|
|
40
|
+
* features exist but are dark.
|
|
41
|
+
*/
|
|
42
|
+
export const featureFlagsForCaller = pikkuSessionlessFunc<
|
|
43
|
+
null,
|
|
44
|
+
Record<FeatureFlagName, boolean>
|
|
45
|
+
>({
|
|
46
|
+
auth: false,
|
|
47
|
+
tags: ['feature-flags'],
|
|
48
|
+
description: 'Resolves every declared feature flag for the calling session.',
|
|
49
|
+
func: async ({ featureFlags }, _data, { session }) => {
|
|
50
|
+
// No source wired resolves against the compiled declaration, the same
|
|
51
|
+
// fallback a source uses on a cold start. Availability fails open, so a
|
|
52
|
+
// project that has not chosen a store yet does not have its clients start
|
|
53
|
+
// hiding every flagged feature — but \`anyOf\` is still read off the
|
|
54
|
+
// session, so a scoped flag is not handed to a caller who cannot hold it.
|
|
55
|
+
const snapshot = featureFlags
|
|
56
|
+
? await featureFlags.snapshot()
|
|
57
|
+
: FEATURE_FLAGS_FALLBACK
|
|
58
|
+
return resolveFlagsForClient(
|
|
59
|
+
FEATURE_FLAGS,
|
|
60
|
+
session,
|
|
61
|
+
snapshot
|
|
62
|
+
) as Record<FeatureFlagName, boolean>
|
|
63
|
+
},
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
wireHTTP({
|
|
67
|
+
route: '${globalHTTPPrefix}/feature-flags',
|
|
68
|
+
method: 'get',
|
|
69
|
+
auth: false,
|
|
70
|
+
tags: ['feature-flags'],
|
|
71
|
+
func: featureFlagsForCaller,
|
|
72
|
+
})
|
|
73
|
+
`;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FeatureFlagDefinitions } from '@pikku/core/flag';
|
|
2
|
+
export interface SerializeFlagsOptions {
|
|
3
|
+
definitions: FeatureFlagDefinitions;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Generates the `FeatureFlagName` union and flag metadata from
|
|
7
|
+
* `defineFeatureFlags` declarations.
|
|
8
|
+
*
|
|
9
|
+
* The union is what makes `featureFlag: 'sandboxes'` on a function checkable. A
|
|
10
|
+
* typo in a flag name would otherwise fail open — an unknown key is absent from
|
|
11
|
+
* every snapshot, and an absent key is available — so the misspelled gate would
|
|
12
|
+
* silently never close.
|
|
13
|
+
*/
|
|
14
|
+
export declare const serializeFlagsTypes: ({ definitions }: SerializeFlagsOptions) => string;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { tsLiteral } from '../../../utils/ts-literal.js';
|
|
2
|
+
/**
|
|
3
|
+
* Generates the `FeatureFlagName` union and flag metadata from
|
|
4
|
+
* `defineFeatureFlags` declarations.
|
|
5
|
+
*
|
|
6
|
+
* The union is what makes `featureFlag: 'sandboxes'` on a function checkable. A
|
|
7
|
+
* typo in a flag name would otherwise fail open — an unknown key is absent from
|
|
8
|
+
* every snapshot, and an absent key is available — so the misspelled gate would
|
|
9
|
+
* silently never close.
|
|
10
|
+
*/
|
|
11
|
+
export const serializeFlagsTypes = ({ definitions }) => {
|
|
12
|
+
const names = [...new Set(definitions.map((d) => d.name))].sort();
|
|
13
|
+
const union = names.length > 0
|
|
14
|
+
? `\n${names.map((name) => ` | ${tsLiteral(name)}`).join('\n')}`
|
|
15
|
+
: ' never';
|
|
16
|
+
return `/**
|
|
17
|
+
* This file was generated by the @pikku/cli
|
|
18
|
+
*/
|
|
19
|
+
import type { DeclaredFlag, FeatureFlagDefinitionsMeta } from '@pikku/core/flag'
|
|
20
|
+
import {
|
|
21
|
+
compiledFallbackSnapshot,
|
|
22
|
+
flattenFeatureFlagDefinitions,
|
|
23
|
+
} from '@pikku/core/flag'
|
|
24
|
+
import definitions from './pikku-flags-meta.gen.json' with { type: 'json' }
|
|
25
|
+
|
|
26
|
+
/** Every feature flag declared in this application. */
|
|
27
|
+
export type FeatureFlagName =${union}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The declared flag set, for a FeatureFlagStore to sync into its store.
|
|
31
|
+
*
|
|
32
|
+
* Derived from the metadata sidecar rather than inlined, so the import above
|
|
33
|
+
* forces tsc to emit the .json alongside this file — an addon publishes only
|
|
34
|
+
* its compiled output, and a host reads that .json to merge the addon's flags
|
|
35
|
+
* into its own union.
|
|
36
|
+
*
|
|
37
|
+
* Additive on removal: a deleted declaration leaves the row marked
|
|
38
|
+
* \`declared: false\` rather than switching a feature off on deploy. Use
|
|
39
|
+
* \`pikku flags prune\` to remove them.
|
|
40
|
+
*/
|
|
41
|
+
export const FEATURE_FLAGS: DeclaredFlag[] = flattenFeatureFlagDefinitions(
|
|
42
|
+
Object.values(definitions as FeatureFlagDefinitionsMeta)
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Declared flags, keyed by name. Rendered by the console beside each switch.
|
|
47
|
+
*
|
|
48
|
+
* Keyed by \`FeatureFlagName\` so a misspelled lookup is a type error, which is
|
|
49
|
+
* the whole point of generating the union. The assertion is what
|
|
50
|
+
* \`Object.fromEntries\` costs — it returns an index signature — and it is
|
|
51
|
+
* sound here because both this object and the union are built from
|
|
52
|
+
* \`FEATURE_FLAGS\`, so every key of the union is present.
|
|
53
|
+
*/
|
|
54
|
+
export const FEATURE_FLAGS_META = Object.fromEntries(
|
|
55
|
+
FEATURE_FLAGS.map((flag) => [flag.name, flag])
|
|
56
|
+
) as Record<FeatureFlagName, DeclaredFlag>
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* What a flag source falls back to when its backing store cannot be read: every
|
|
60
|
+
* declared flag on, no rollout, no overrides.
|
|
61
|
+
*
|
|
62
|
+
* Failing open is deliberate. A flag store is not an authorization boundary —
|
|
63
|
+
* \`scopes:\` is — so an unreadable config must not take the product down with
|
|
64
|
+
* it.
|
|
65
|
+
*/
|
|
66
|
+
export const FEATURE_FLAGS_FALLBACK = compiledFallbackSnapshot(FEATURE_FLAGS)
|
|
67
|
+
`;
|
|
68
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
type AddonTypesCommandInput = {
|
|
2
2
|
bootstrap?: boolean;
|
|
3
3
|
};
|
|
4
|
-
export declare const pikkuAddonTypes: import("#pikku/function").PikkuFunctionConfig<AddonTypesCommandInput, void, "rpc" | "session", import("#pikku/function").
|
|
4
|
+
export declare const pikkuAddonTypes: import("#pikku/function").PikkuFunctionConfig<AddonTypesCommandInput, void, "rpc" | "session", import("#pikku/function").PikkuFunction<AddonTypesCommandInput, void, "rpc" | "session", import("#pikku/function").WiredServices> | import("#pikku/function").PikkuFunctionSessionless<AddonTypesCommandInput, void, "rpc" | "session", import("#pikku/function").WiredServices, unknown>, undefined, undefined>;
|
|
5
5
|
export {};
|