@pikku/cli 0.12.134 → 0.12.136

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.
Files changed (233) hide show
  1. package/CHANGELOG.md +83 -0
  2. package/console-app/assets/{abnfDiagram-N423BO3Z-BQPUva28.js → abnfDiagram-N423BO3Z-W1UI4BWy.js} +1 -1
  3. package/console-app/assets/architecture-TIHT7OUA-ChuyZvLt.js +1 -0
  4. package/console-app/assets/{architectureDiagram-T3A2C74G-Cjzy66o9.js → architectureDiagram-T3A2C74G-Dgnhu9J8.js} +1 -1
  5. package/console-app/assets/{blockDiagram-VBNYF7ZC-DVasSXpX.js → blockDiagram-VBNYF7ZC-Da-H9pFU.js} +1 -1
  6. package/console-app/assets/{c4Diagram-5PPSVZJV-FB0YMoOr.js → c4Diagram-5PPSVZJV-CPQ006DM.js} +1 -1
  7. package/console-app/assets/channel-Bk5Nkkn2.js +1 -0
  8. package/console-app/assets/{chunk-2GRJ4B5K-BLGsmyy4.js → chunk-2GRJ4B5K-B3QE8g_6.js} +1 -1
  9. package/console-app/assets/{chunk-4I5QYGJK-DCgTj78f.js → chunk-4I5QYGJK-D04DssN0.js} +1 -1
  10. package/console-app/assets/{chunk-5RXB4S5H-CX9hS68x.js → chunk-5RXB4S5H-CXe_vAKZ.js} +1 -1
  11. package/console-app/assets/{chunk-6Q2QTUOP-xrgFRP4Y.js → chunk-6Q2QTUOP-DhpMC5UR.js} +1 -1
  12. package/console-app/assets/{chunk-7Z6QIM7H-CbBMe7ej.js → chunk-7Z6QIM7H-CtoQQGfm.js} +1 -1
  13. package/console-app/assets/{chunk-GF5L2VYU-BXraqZ7w.js → chunk-GF5L2VYU-BovriS0p.js} +1 -1
  14. package/console-app/assets/{chunk-I66GZJ75-CbpQtX8e.js → chunk-I66GZJ75-Goasace2.js} +1 -1
  15. package/console-app/assets/{chunk-JQJVKLGR-Cp9FHSH6.js → chunk-JQJVKLGR-Dy3HStoh.js} +1 -1
  16. package/console-app/assets/{chunk-KBJHAD2P-Brvmen34.js → chunk-KBJHAD2P-Cm5EwbeQ.js} +1 -1
  17. package/console-app/assets/{chunk-NSK5VX7P-Bo-dbDZD.js → chunk-NSK5VX7P-DZ-VVQUA.js} +1 -1
  18. package/console-app/assets/{chunk-QR6OTTB3-B5Al5KEo.js → chunk-QR6OTTB3-W5GRG-wW.js} +1 -1
  19. package/console-app/assets/{chunk-RYQCIY6F-WOZyn5It.js → chunk-RYQCIY6F-_xvZ8Hx8.js} +1 -1
  20. package/console-app/assets/{chunk-UBXNYLIW-D9OoHV5X.js → chunk-UBXNYLIW-C0L1Tpxq.js} +1 -1
  21. package/console-app/assets/{chunk-W5SLKNZC-BNTcVpi3.js → chunk-W5SLKNZC-DAyLbBQq.js} +1 -1
  22. package/console-app/assets/{chunk-WRU74C26-DXijYjrx.js → chunk-WRU74C26-BrL4inwu.js} +1 -1
  23. package/console-app/assets/chunk-XXDRQBXY-CCdCi2uV.js +1 -0
  24. package/console-app/assets/classDiagram-JCYQIIEL-Dgekxp3j.js +1 -0
  25. package/console-app/assets/classDiagram-v2-OCEON4UE-Dgekxp3j.js +1 -0
  26. package/console-app/assets/{cose-bilkent-JH36ORCC-CPN5VkQC.js → cose-bilkent-JH36ORCC-DxHzzMQL.js} +1 -1
  27. package/console-app/assets/{cynefin-VYW2F7L2-CuBPO3Z0.js → cynefin-VYW2F7L2-7ytt-CDO.js} +1 -1
  28. package/console-app/assets/{cynefinDiagram-MW4NZA55-BYc2PGXv.js → cynefinDiagram-MW4NZA55-Cq-zIV7s.js} +1 -1
  29. package/console-app/assets/{dagre-7HV9Jfb_.js → dagre-Dl-9JF5i.js} +1 -1
  30. package/console-app/assets/{dagre-VZM6K2ZE-BpPyuM7i.js → dagre-VZM6K2ZE-DLlanPb9.js} +1 -1
  31. package/console-app/assets/{diagram-7IWD3JNH-DTH9ID9z.js → diagram-7IWD3JNH-NTCRs_uw.js} +1 -1
  32. package/console-app/assets/{diagram-B4RE2ZJO-DwZb9gPm.js → diagram-B4RE2ZJO-Dwf7hoRU.js} +1 -1
  33. package/console-app/assets/{diagram-LBJQPF4R-DfvBayzk.js → diagram-LBJQPF4R-2h_a7jsr.js} +1 -1
  34. package/console-app/assets/{diagram-Q27KOJAE-hksFpSxs.js → diagram-Q27KOJAE-DuOfl1WJ.js} +1 -1
  35. package/console-app/assets/{diagram-UB23O5K3-5hEVCouO.js → diagram-UB23O5K3-Blp2hikL.js} +1 -1
  36. package/console-app/assets/{ebnfDiagram-BXEA7PRR-D0v6RJvf.js → ebnfDiagram-BXEA7PRR-BwdeYz2Z.js} +1 -1
  37. package/console-app/assets/{erDiagram-JOGREHBK-DGps-M4l.js → erDiagram-JOGREHBK-DY_x1XSg.js} +1 -1
  38. package/console-app/assets/eventmodeling-45OFAUF4-2ImzjrgM.js +1 -0
  39. package/console-app/assets/flowDiagram-UKHOOZJN-DmrgHe66.js +1 -0
  40. package/console-app/assets/{ganttDiagram-PKOTCBZU-Dok7ME1t.js → ganttDiagram-PKOTCBZU-DxiIwMWB.js} +1 -1
  41. package/console-app/assets/{gitGraph-TEB2WS4Q-8492lYYh.js → gitGraph-TEB2WS4Q-C3DsIpZV.js} +1 -1
  42. package/console-app/assets/{gitGraphDiagram-DS77QQ5N-sPOnBy5f.js → gitGraphDiagram-DS77QQ5N-C2pPy08m.js} +1 -1
  43. package/console-app/assets/{index-DqNqujdF.js → index-D6aBqNnO.js} +179 -179
  44. package/console-app/assets/{info-DKCQHKI2-U4uEmX4H.js → info-DKCQHKI2-FJuVYZ8D.js} +1 -1
  45. package/console-app/assets/{infoDiagram-6WML65LV-CNV12_Nx.js → infoDiagram-6WML65LV-Bih5T82B.js} +1 -1
  46. package/console-app/assets/{ishikawaDiagram-WSZJBQD7-CcnTBGLj.js → ishikawaDiagram-WSZJBQD7-jOkuIgMl.js} +1 -1
  47. package/console-app/assets/{journeyDiagram-NVQOT4AX-MX-UQBJ7.js → journeyDiagram-NVQOT4AX-CZ9yVscx.js} +1 -1
  48. package/console-app/assets/{kanban-definition-27J2QSJJ-BXh1Eu4D.js → kanban-definition-27J2QSJJ-Dpmgfv5c.js} +1 -1
  49. package/console-app/assets/{line-2B2dlQbw.js → line-DjmQl1gv.js} +1 -1
  50. package/console-app/assets/{linear-DAVRH-Dp.js → linear-B8fAzric.js} +1 -1
  51. package/console-app/assets/{mermaid-parser.core-DxPo1qbR.js → mermaid-parser.core-BxoecV24.js} +3 -3
  52. package/console-app/assets/{mermaid.core-DpvXaF3y.js → mermaid.core-D2Ux-Rs7.js} +4 -4
  53. package/console-app/assets/{mindmap-definition-FAOFIHXS-wIEKn4qe.js → mindmap-definition-FAOFIHXS-5xpWfvPY.js} +1 -1
  54. package/console-app/assets/{packet-7NZHBO7P-CXySycDQ.js → packet-7NZHBO7P-Bq9JPqWg.js} +1 -1
  55. package/console-app/assets/{pegDiagram-VL7TDLO6-CDGkzO6q.js → pegDiagram-VL7TDLO6-BKWLK1GI.js} +1 -1
  56. package/console-app/assets/{pie-RZYD4A2V-9woSahH7.js → pie-RZYD4A2V-CsGG-f-c.js} +1 -1
  57. package/console-app/assets/{pieDiagram-7S7Q4E2Y-DLoZWnVF.js → pieDiagram-7S7Q4E2Y-BRy6lUc2.js} +1 -1
  58. package/console-app/assets/{quadrantDiagram-CIZ2JOQS-NBGRoga7.js → quadrantDiagram-CIZ2JOQS-OcYHZLLg.js} +1 -1
  59. package/console-app/assets/{radar-I7S5WNFK-BYhW66ZA.js → radar-I7S5WNFK-8MO05jdC.js} +1 -1
  60. package/console-app/assets/{railroad-3IZDKUUU-BqHXlwF5.js → railroad-3IZDKUUU-CLs1yR0q.js} +1 -1
  61. package/console-app/assets/railroad-abnf-AHOZXSZD-CA9-7Fw1.js +1 -0
  62. package/console-app/assets/railroad-ebnf-EBAXGLYW-BhkwTTAW.js +1 -0
  63. package/console-app/assets/railroad-peg-LSFZ7HO6-BEaB8UlJ.js +1 -0
  64. package/console-app/assets/{railroadDiagram-AXF67PYL-FYQaHJ6A.js → railroadDiagram-AXF67PYL-DjpHDwhw.js} +1 -1
  65. package/console-app/assets/{requirementDiagram-LRYGKXZP-ihhW1kgC.js → requirementDiagram-LRYGKXZP-CyKaqOMR.js} +1 -1
  66. package/console-app/assets/{sankeyDiagram-W5VNT64P-Dw2EbW8v.js → sankeyDiagram-W5VNT64P-0WoWlmdY.js} +1 -1
  67. package/console-app/assets/{sequenceDiagram-SI44F4Z6-C6i_U4QX.js → sequenceDiagram-SI44F4Z6-kd31YoP4.js} +1 -1
  68. package/console-app/assets/{src-DF-84qwJ.js → src-CGPyCqg2.js} +1 -1
  69. package/console-app/assets/{stateDiagram-OKZ733FA-xH4wcMO4.js → stateDiagram-OKZ733FA-Cwy-Xwqp.js} +1 -1
  70. package/console-app/assets/stateDiagram-v2-UEYNNEHI-DExEOOCw.js +1 -0
  71. package/console-app/assets/{swimlanes-SLNWSIFB-CkFlU1Qc.js → swimlanes-SLNWSIFB-Cq0Pq-Qq.js} +1 -1
  72. package/console-app/assets/swimlanesDiagram-ULZ7WXOC-B0RUxlCH.js +8 -0
  73. package/console-app/assets/{timeline-definition-Z64GVDOM-BQE9-7mm.js → timeline-definition-Z64GVDOM-CgFH2I_j.js} +1 -1
  74. package/console-app/assets/{treeView-QDETBFTQ-C4hse2Wn.js → treeView-QDETBFTQ-CmeHYUxi.js} +1 -1
  75. package/console-app/assets/{treemap-6X3UGDF4-Bi7ORgq6.js → treemap-6X3UGDF4-B6JWxyQe.js} +1 -1
  76. package/console-app/assets/{vennDiagram-T6HMQDX7-DbUdNREA.js → vennDiagram-T6HMQDX7-DdGYpKcz.js} +1 -1
  77. package/console-app/assets/{wardley-OPB4EBWU-BHqXIxRe.js → wardley-OPB4EBWU-BVF8AOCQ.js} +1 -1
  78. package/console-app/assets/{wardleyDiagram-T6FBY63Y-1VOvM_bb.js → wardleyDiagram-T6FBY63Y-BUFon1WP.js} +1 -1
  79. package/console-app/assets/{xychartDiagram-ELKLHX3M-C3DVfSR9.js → xychartDiagram-ELKLHX3M-Bu-WJdeF.js} +1 -1
  80. package/console-app/index.html +1 -1
  81. package/dist/.pikku/addon/index.d.ts +1 -1
  82. package/dist/.pikku/addon/index.js +1 -1
  83. package/dist/.pikku/addon/pikku-addon-types.gen.d.ts +1 -1
  84. package/dist/.pikku/addon/pikku-addon-types.gen.js +1 -1
  85. package/dist/.pikku/agent/index.d.ts +1 -1
  86. package/dist/.pikku/agent/index.js +1 -1
  87. package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
  88. package/dist/.pikku/agent/pikku-model-aliases.gen.js +1 -1
  89. package/dist/.pikku/auth/index.d.ts +1 -1
  90. package/dist/.pikku/auth/index.js +1 -1
  91. package/dist/.pikku/auth/pikku-auth-types.gen.d.ts +1 -1
  92. package/dist/.pikku/auth/pikku-auth-types.gen.js +1 -1
  93. package/dist/.pikku/channel/index.d.ts +1 -1
  94. package/dist/.pikku/channel/index.js +1 -1
  95. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +1 -1
  96. package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
  97. package/dist/.pikku/cli/index.d.ts +1 -1
  98. package/dist/.pikku/cli/index.js +1 -1
  99. package/dist/.pikku/cli/pikku-cli-channel.js +1 -1
  100. package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +1 -1
  101. package/dist/.pikku/cli/pikku-cli-client.gen.js +1 -1
  102. package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.d.ts +1 -1
  103. package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.js +1 -1
  104. package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
  105. package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
  106. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +1 -1
  107. package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -1
  108. package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -1
  109. package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
  110. package/dist/.pikku/cli/pikku-cli.gen.js +1 -1
  111. package/dist/.pikku/error/index.d.ts +1 -1
  112. package/dist/.pikku/error/index.js +1 -1
  113. package/dist/.pikku/error/pikku-error-types.gen.d.ts +1 -1
  114. package/dist/.pikku/error/pikku-error-types.gen.js +1 -1
  115. package/dist/.pikku/function/index.d.ts +1 -1
  116. package/dist/.pikku/function/index.js +1 -1
  117. package/dist/.pikku/function/pikku-function-types.gen.d.ts +1 -1
  118. package/dist/.pikku/function/pikku-function-types.gen.js +1 -1
  119. package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
  120. package/dist/.pikku/function/pikku-functions-meta.gen.json +1 -25
  121. package/dist/.pikku/function/pikku-functions.gen.js +1 -3
  122. package/dist/.pikku/gateway/index.d.ts +1 -1
  123. package/dist/.pikku/gateway/index.js +1 -1
  124. package/dist/.pikku/gateway/pikku-gateway-types.gen.d.ts +1 -1
  125. package/dist/.pikku/gateway/pikku-gateway-types.gen.js +1 -1
  126. package/dist/.pikku/http/index.d.ts +1 -1
  127. package/dist/.pikku/http/index.js +1 -1
  128. package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
  129. package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
  130. package/dist/.pikku/mcp/index.d.ts +1 -1
  131. package/dist/.pikku/mcp/index.js +1 -1
  132. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
  133. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
  134. package/dist/.pikku/middleware/index.d.ts +1 -1
  135. package/dist/.pikku/middleware/index.js +1 -1
  136. package/dist/.pikku/middleware/pikku-middleware-types.gen.d.ts +1 -1
  137. package/dist/.pikku/middleware/pikku-middleware-types.gen.js +1 -1
  138. package/dist/.pikku/pikku-bootstrap-scenarios.gen.d.ts +1 -1
  139. package/dist/.pikku/pikku-bootstrap-scenarios.gen.js +1 -1
  140. package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -1
  141. package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
  142. package/dist/.pikku/pikku-services.gen.d.ts +1 -1
  143. package/dist/.pikku/queue/index.d.ts +1 -1
  144. package/dist/.pikku/queue/index.js +1 -1
  145. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
  146. package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
  147. package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +1 -1
  148. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
  149. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
  150. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
  151. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +0 -1
  152. package/dist/.pikku/scenarios/index.d.ts +1 -1
  153. package/dist/.pikku/scenarios/index.js +1 -1
  154. package/dist/.pikku/scenarios/pikku-personas.gen.js +1 -1
  155. package/dist/.pikku/scenarios/pikku-scenario-functions-meta.gen.js +1 -1
  156. package/dist/.pikku/scenarios/pikku-scenario-functions.gen.d.ts +1 -1
  157. package/dist/.pikku/scenarios/pikku-scenario-types.gen.d.ts +1 -1
  158. package/dist/.pikku/scenarios/pikku-scenario-wirings-meta.gen.js +1 -1
  159. package/dist/.pikku/scenarios/pikku-scenario-wirings.gen.d.ts +1 -1
  160. package/dist/.pikku/scenarios/schemas/register.gen.d.ts +1 -1
  161. package/dist/.pikku/scenarios/schemas/register.gen.js +1 -1
  162. package/dist/.pikku/scheduler/index.d.ts +1 -1
  163. package/dist/.pikku/scheduler/index.js +1 -1
  164. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
  165. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
  166. package/dist/.pikku/schemas/register.gen.js +1 -3
  167. package/dist/.pikku/scopes/index.d.ts +1 -1
  168. package/dist/.pikku/scopes/index.js +1 -1
  169. package/dist/.pikku/scopes/pikku-personas.gen.js +1 -1
  170. package/dist/.pikku/scopes/pikku-roles.gen.d.ts +1 -1
  171. package/dist/.pikku/scopes/pikku-scope-types.gen.d.ts +1 -1
  172. package/dist/.pikku/scopes/pikku-scope-types.gen.js +1 -1
  173. package/dist/.pikku/scopes/pikku-scopes.gen.d.ts +1 -1
  174. package/dist/.pikku/secrets/index.d.ts +1 -1
  175. package/dist/.pikku/secrets/index.js +1 -1
  176. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
  177. package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
  178. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
  179. package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
  180. package/dist/.pikku/services/pikku-meta-service.gen.d.ts +1 -1
  181. package/dist/.pikku/services/pikku-meta-service.gen.js +1 -1
  182. package/dist/.pikku/setup/index.d.ts +1 -1
  183. package/dist/.pikku/setup/index.js +1 -1
  184. package/dist/.pikku/setup/pikku-setup-types.gen.d.ts +1 -1
  185. package/dist/.pikku/setup/pikku-setup-types.gen.js +1 -1
  186. package/dist/.pikku/trigger/index.d.ts +1 -1
  187. package/dist/.pikku/trigger/index.js +1 -1
  188. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
  189. package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
  190. package/dist/.pikku/variables/index.d.ts +1 -1
  191. package/dist/.pikku/variables/index.js +1 -1
  192. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
  193. package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
  194. package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
  195. package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
  196. package/dist/.pikku/workflow/index.d.ts +1 -1
  197. package/dist/.pikku/workflow/index.js +1 -1
  198. package/dist/.pikku/workflow/meta/allWorkflow.gen.json +2 -8
  199. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +1 -1
  200. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
  201. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
  202. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
  203. package/dist/bin/pikku-bin.mjs +2 -2
  204. package/dist/src/deploy/bundler/bundler.d.ts +9 -0
  205. package/dist/src/deploy/bundler/bundler.js +38 -13
  206. package/dist/src/deploy/bundler/service-module-map.d.ts +0 -16
  207. package/dist/src/deploy/bundler/service-module-map.js +20 -3
  208. package/dist/src/functions/validate/shared-checks.js +6 -4
  209. package/dist/src/functions/workflows/all.workflow.js +0 -6
  210. package/dist/src/utils/pikku-cli-config.js +1 -7
  211. package/dist/src/utils/remove-legacy-scaffold-file.d.ts +5 -0
  212. package/dist/src/utils/remove-legacy-scaffold-file.js +11 -2
  213. package/dist/tsconfig.tsbuildinfo +1 -1
  214. package/package.json +3 -3
  215. package/snippets.json +1 -1
  216. package/surface.json +2 -2
  217. package/console-app/assets/architecture-TIHT7OUA-G_ldr-C2.js +0 -1
  218. package/console-app/assets/channel-CuDpOUYn.js +0 -1
  219. package/console-app/assets/chunk-XXDRQBXY-DRMEt0Gf.js +0 -1
  220. package/console-app/assets/classDiagram-JCYQIIEL-Bjgk6QkN.js +0 -1
  221. package/console-app/assets/classDiagram-v2-OCEON4UE-Bjgk6QkN.js +0 -1
  222. package/console-app/assets/eventmodeling-45OFAUF4-DWRslJcU.js +0 -1
  223. package/console-app/assets/flowDiagram-UKHOOZJN-CE3qN_pH.js +0 -1
  224. package/console-app/assets/railroad-abnf-AHOZXSZD-BfGOy69e.js +0 -1
  225. package/console-app/assets/railroad-ebnf-EBAXGLYW-BbGv9WfS.js +0 -1
  226. package/console-app/assets/railroad-peg-LSFZ7HO6-CCiPI8BL.js +0 -1
  227. package/console-app/assets/stateDiagram-v2-UEYNNEHI-BJln5PLd.js +0 -1
  228. package/console-app/assets/swimlanesDiagram-ULZ7WXOC-CSLhmtbh.js +0 -8
  229. package/dist/.pikku/schemas/schemas/PikkuUserAdminFunctionsOutput.schema.json +0 -1
  230. package/dist/src/functions/wirings/user-admin/pikku-command-user-admin-functions.d.ts +0 -1
  231. package/dist/src/functions/wirings/user-admin/pikku-command-user-admin-functions.js +0 -55
  232. package/dist/src/functions/wirings/user-admin/serialize-user-admin-functions.d.ts +0 -25
  233. package/dist/src/functions/wirings/user-admin/serialize-user-admin-functions.js +0 -294
package/snippets.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "aiAgentStream": "// Streaming endpoint — sends text-delta, tool-call, and usage events as they arrive.\nwireHTTP({\n method: 'post',\n route: '/agents/shop/stream',\n func: agentStream('shopAssistant'),\n auth: true,\n})",
15
15
  "aiAgentStreamClient": "export async function agentStreamExamples() {\n pikkuRPC.setServerUrl('http://localhost:4000')\n pikkuRPC.setAuthorizationJWT('user-jwt-token')\n\n const stream = await pikkuRPC.agent.stream('shopAssistant', {\n message: 'Add the cheapest USB hub to my basket',\n threadId: 'thread-123',\n resourceId: 'user-456',\n })\n return stream\n}",
16
16
  "auditDispatch": "await audit?.audit({\n type: 'order.created',\n source: 'explicit',\n occurredAt: new Date().toISOString(),\n metadata: { orderId, userId },\n})",
17
- "betterAuthConfig": "export const auth = pikkuBetterAuth(\n async ({\n kysely,\n secrets,\n variables,\n emailService,\n scopeService,\n logger,\n }) => {\n // `.reveal()` at the sink, not earlier: getSecret hands back a nominal\n // SecretValue that no concretely-typed parameter accepts, so every disclosure\n // is one greppable call. Better Auth wants the raw string, and this is where\n // it stops being a secret in the type system.\n const BETTER_AUTH_SECRET = (\n await secrets.getSecret('BETTER_AUTH_SECRET')\n ).reveal()\n // Genuinely optional: unset simply disables /api/auth/sign-in/actor (scenarios\n // off for this deployment) — the actor plugin refuses all sign-ins\n // without it.\n const SCENARIO_ACTOR_SECRET = await secrets\n .getSecret('SCENARIO_ACTOR_SECRET')\n .then((value) => value?.reveal())\n .catch(() => undefined)\n // Fabric operator admin: the RSA public key the control plane's token is\n // verified against. The Fabric deployer pushes FABRIC_AUTH_PUBLIC_KEY onto\n // every stage; locally it's simply absent, which disables /sign-in/fabric.\n // Asymmetric — the app verifies, it can never forge an operator login.\n const FABRIC_AUTH_PUBLIC_KEY = await variables.get('FABRIC_AUTH_PUBLIC_KEY')\n\n return betterAuth({\n secret: BETTER_AUTH_SECRET,\n database: { db: kysely, type: 'sqlite' },\n emailAndPassword: {\n enabled: true,\n // Without this, `requestPasswordReset` succeeds on the client and silently\n // sends nothing — the \"Forgot password?\" flow looks wired and dead-ends.\n // Better Auth builds `url` from its baseURL + the client's redirectTo, so\n // the app only supplies the message. Errors are logged, never swallowed:\n // a reset the user never receives must be visible in the logs.\n sendResetPassword: async ({ user, url }) => {\n await emailService.send({\n to: user.email,\n template: {\n name: 'reset-password',\n data: { email: user.email, resetUrl: url },\n },\n })\n },\n },\n // Stateless session: CLI splits out betterAuthStatelessSession so non-auth\n // units verify the signed cookie instead of bundling better-auth. pikku #737.\n session: { cookieCache: { enabled: true } },\n advanced: { database: { generateId: 'uuid' } },\n // Scenario actors: synthetic users (user.actor = true, see\n // db/sqlite/0002-user-actor.sql) signed in by pikkuScenario via\n // POST /api/auth/sign-in/actor { email, secret }. Never signs in real users.\n //\n // pikkuBan(): adds the banned/banExpires/banReason columns (see\n // db/sqlite/0003-admin.sql) and the session hook that refuses a banned\n // user a session. better-auth's own admin() is refused by the inspector:\n // it authorizes on a `user.role` column while pikku authorizes on scopes,\n // and everything else it offered — list, create, ban, remove, revoke\n // sessions, set password — is scoped RPCs in @pikku/addon-admin.\n //\n // pikkuFabric(): exposes /api/auth/sign-in/fabric — the Fabric control plane\n // mints a short-lived RS256 token and signs in as a synthetic `fabric: true`\n // admin operator (db/sqlite/0004-fabric.sql), so the console Users tab can\n // list/impersonate real users without the operator being one of them. It\n // verifies against FABRIC_AUTH_PUBLIC_KEY; a missing key disables the\n // endpoint.\n //\n // `personas` is what provisions the scenario actors. The plugin creates a\n // declared persona's account the first time an operator asks to act as an\n // address the stage has no row for, so a deploy carries its actors with it\n // without a bootstrap step. This does NOT belong in `pikkuServerLifecycle`'s\n // afterStart: that hook only ever runs under `pikku dev` and `pikku serve`,\n // so a deployed stage would provision nobody.\n plugins: [\n pikkuActor({ secret: SCENARIO_ACTOR_SECRET }),\n pikkuBan(),\n pikkuFabric({\n publicKey: FABRIC_AUTH_PUBLIC_KEY,\n scopeService,\n logger,\n personas: {\n personas: personaConfigs,\n environments: personaEnvironments,\n },\n }),\n ],\n })\n }\n)",
17
+ "betterAuthConfig": "export const auth = pikkuBetterAuth(\n async ({\n kysely,\n secrets,\n variables,\n emailService,\n scopeService,\n logger,\n }) => {\n // `.reveal()` at the sink, not earlier: getSecret hands back a nominal\n // SecretValue that no concretely-typed parameter accepts, so every disclosure\n // is one greppable call. Better Auth wants the raw string, and this is where\n // it stops being a secret in the type system.\n const BETTER_AUTH_SECRET = (\n await secrets.getSecret('BETTER_AUTH_SECRET')\n ).reveal()\n // Genuinely optional: unset simply disables /api/auth/sign-in/actor (scenarios\n // off for this deployment) — the actor plugin refuses all sign-ins\n // without it.\n const SCENARIO_ACTOR_SECRET = await secrets\n .getSecret('SCENARIO_ACTOR_SECRET')\n .then((value) => value?.reveal())\n .catch(() => undefined)\n // Fabric operator admin: the RSA public key the control plane's token is\n // verified against. The Fabric deployer pushes FABRIC_AUTH_PUBLIC_KEY onto\n // every stage; locally it's simply absent, which disables /sign-in/fabric.\n // Asymmetric — the app verifies, it can never forge an operator login.\n const FABRIC_AUTH_PUBLIC_KEY = await variables.get('FABRIC_AUTH_PUBLIC_KEY')\n // The opt-in that lets a deployed stage run scenarios. Read through\n // `variables` rather than left to `process.env`, because a Worker receives\n // it as a binding and has no populated environment to find it in.\n const ALLOW_ACTOR_SIGN_IN = await variables.get(ACTOR_SIGN_IN_OPT_IN_ENV)\n\n return betterAuth({\n secret: BETTER_AUTH_SECRET,\n database: { db: kysely, type: 'sqlite' },\n emailAndPassword: {\n enabled: true,\n // Without this, `requestPasswordReset` succeeds on the client and silently\n // sends nothing — the \"Forgot password?\" flow looks wired and dead-ends.\n // Better Auth builds `url` from its baseURL + the client's redirectTo, so\n // the app only supplies the message. Errors are logged, never swallowed:\n // a reset the user never receives must be visible in the logs.\n sendResetPassword: async ({ user, url }) => {\n await emailService.send({\n to: user.email,\n template: {\n name: 'reset-password',\n data: { email: user.email, resetUrl: url },\n },\n })\n },\n },\n // Stateless session: CLI splits out betterAuthStatelessSession so non-auth\n // units verify the signed cookie instead of bundling better-auth. pikku #737.\n session: { cookieCache: { enabled: true } },\n advanced: { database: { generateId: 'uuid' } },\n // Scenario actors: synthetic users (user.actor = true, see\n // db/sqlite/0002-user-actor.sql) signed in by pikkuScenario via\n // POST /api/auth/sign-in/actor { email, secret }. Never signs in real users.\n //\n // pikkuBan(): adds the banned/banExpires/banReason columns (see\n // db/sqlite/0003-admin.sql) and the session hook that refuses a banned\n // user a session. better-auth's own admin() is refused by the inspector:\n // it authorizes on a `user.role` column while pikku authorizes on scopes,\n // and everything else it offered — list, create, ban, remove, revoke\n // sessions, set password — is scoped RPCs in @pikku/addon-admin.\n //\n // pikkuFabric(): exposes /api/auth/sign-in/fabric — the Fabric control plane\n // mints a short-lived RS256 token and signs in as a synthetic `fabric: true`\n // admin operator (db/sqlite/0004-fabric.sql), so the console Users tab can\n // list/impersonate real users without the operator being one of them. It\n // verifies against FABRIC_AUTH_PUBLIC_KEY; a missing key disables the\n // endpoint.\n //\n // `personas` is what provisions the scenario actors. The plugin creates a\n // declared persona's account the first time an operator asks to act as an\n // address the stage has no row for, so a deploy carries its actors with it\n // without a bootstrap step. This does NOT belong in `pikkuServerLifecycle`'s\n // afterStart: that hook only ever runs under `pikku dev` and `pikku serve`,\n // so a deployed stage would provision nobody.\n plugins: [\n pikkuActor({\n secret: SCENARIO_ACTOR_SECRET,\n allowSignIn: ALLOW_ACTOR_SIGN_IN,\n }),\n pikkuBan(),\n pikkuFabric({\n publicKey: FABRIC_AUTH_PUBLIC_KEY,\n scopeService,\n logger,\n personas: {\n personas: personaConfigs,\n environments: personaEnvironments,\n },\n }),\n ],\n })\n }\n)",
18
18
  "cancelOrder": "export const cancelOrder = pikkuFunc({\n expose: true,\n description: 'Cancel a pending order and restore stock.',\n input: CancelOrderInput,\n // Authorization is declared, not written. `scopes` is what the role\n // entitles the caller to and is AND-ed; `permissions` is what is true of\n // this particular row and is OR-ed across keys. Both run before the body,\n // so the function below only ever sees a caller who is allowed to be there.\n //\n // The `support` role holds `orders:cancel` without owning the order, so it\n // passes on the scope; a customer passes on ownership. Neither case needs a\n // branch in the body.\n scopes: ['orders:cancel'],\n permissions: {\n owner: isOrderOwner,\n },\n // `node` describes this function as a step someone can drop into a visual\n // flow: what to call it, where it files, and whether it starts a flow\n // ('trigger'), continues one ('action') or ends it ('end'). Without it the\n // function still works everywhere else — it just does not appear as a node.\n node: {\n displayName: 'Cancel Order',\n category: 'Orders',\n type: 'action',\n },\n func: async ({ kysely, queueService }, { orderId }, { session }) => {\n const order = await kysely\n .selectFrom('order')\n .select(['orderId', 'userId', 'status'])\n .where('orderId', '=', orderId)\n .executeTakeFirst()\n\n if (!order) throw new Error('Order not found')\n if (!['pending', 'paid'].includes(order.status)) {\n throw new Error(`Cannot cancel order in status: ${order.status}`)\n }\n\n // Restore stock\n const items = await kysely\n .selectFrom('orderItem')\n .select(['itemId', 'quantity'])\n .where('orderId', '=', orderId)\n .execute()\n\n const now = new Date().toISOString()\n for (const item of items) {\n await kysely\n .updateTable('item')\n .set((eb) => ({\n stock: eb('stock', '+', item.quantity),\n updatedAt: now,\n }))\n .where('itemId', '=', item.itemId)\n .execute()\n }\n\n await kysely\n .updateTable('order')\n .set({ status: 'cancelled', updatedAt: now })\n .where('orderId', '=', orderId)\n .execute()\n\n await queueService.add('audit-event', {\n entityType: 'order',\n entityId: orderId,\n action: 'cancelled',\n actorId: session.userId,\n })\n },\n})",
19
19
  "channelLifecycle": "export const onConnect = pikkuChannelConnectionFunc(\n async ({ logger }, _, { channel }) => {\n logger.info({ event: 'ws_connected', channelId: channel.channelId })\n }\n)\n\nexport const onDisconnect = pikkuChannelDisconnectionFunc(\n async ({ logger }, _, { channel }) => {\n logger.info({ event: 'ws_disconnected', channelId: channel.channelId })\n }\n)",
20
20
  "channelMiddleware": "export const traceAgentStream = pikkuChannelMiddleware<any, AgentStreamEvent>(\n async ({ logger }, event, next) => {\n logger.debug({ event: 'agent_stream', type: event.type })\n await next(event)\n }\n)",
package/surface.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.12.134",
2
+ "version": "0.12.136",
3
3
  "entryPoints": [
4
4
  {
5
5
  "id": "app",
@@ -3356,7 +3356,7 @@
3356
3356
  "docs": "Builds this project's Better Auth instance. The factory is handed the\nsingleton services, with typed `secrets` and `variables`, and is called\nlazily so config and secrets are resolved before auth is constructed.",
3357
3357
  "signature": "<I extends BetterAuthInstance>(factory: (services: AuthSingletonServices) => I | Promise<I>) => PikkuBetterAuthFactory<I>",
3358
3358
  "examples": [
3359
- "export const auth = pikkuBetterAuth(\n async ({\n kysely,\n secrets,\n variables,\n emailService,\n scopeService,\n logger,\n }) => {\n // `.reveal()` at the sink, not earlier: getSecret hands back a nominal\n // SecretValue that no concretely-typed parameter accepts, so every disclosure\n // is one greppable call. Better Auth wants the raw string, and this is where\n // it stops being a secret in the type system.\n const BETTER_AUTH_SECRET = (\n await secrets.getSecret('BETTER_AUTH_SECRET')\n ).reveal()\n // Genuinely optional: unset simply disables /api/auth/sign-in/actor (scenarios\n // off for this deployment) — the actor plugin refuses all sign-ins\n // without it.\n const SCENARIO_ACTOR_SECRET = await secrets\n .getSecret('SCENARIO_ACTOR_SECRET')\n .then((value) => value?.reveal())\n .catch(() => undefined)\n // Fabric operator admin: the RSA public key the control plane's token is\n // verified against. The Fabric deployer pushes FABRIC_AUTH_PUBLIC_KEY onto\n // every stage; locally it's simply absent, which disables /sign-in/fabric.\n // Asymmetric — the app verifies, it can never forge an operator login.\n const FABRIC_AUTH_PUBLIC_KEY = await variables.get('FABRIC_AUTH_PUBLIC_KEY')\n\n return betterAuth({\n secret: BETTER_AUTH_SECRET,\n database: { db: kysely, type: 'sqlite' },\n emailAndPassword: {\n enabled: true,\n // Without this, `requestPasswordReset` succeeds on the client and silently\n // sends nothing — the \"Forgot password?\" flow looks wired and dead-ends.\n // Better Auth builds `url` from its baseURL + the client's redirectTo, so\n // the app only supplies the message. Errors are logged, never swallowed:\n // a reset the user never receives must be visible in the logs.\n sendResetPassword: async ({ user, url }) => {\n await emailService.send({\n to: user.email,\n template: {\n name: 'reset-password',\n data: { email: user.email, resetUrl: url },\n },\n })\n },\n },\n // Stateless session: CLI splits out betterAuthStatelessSession so non-auth\n // units verify the signed cookie instead of bundling better-auth. pikku #737.\n session: { cookieCache: { enabled: true } },\n advanced: { database: { generateId: 'uuid' } },\n // Scenario actors: synthetic users (user.actor = true, see\n // db/sqlite/0002-user-actor.sql) signed in by pikkuScenario via\n // POST /api/auth/sign-in/actor { email, secret }. Never signs in real users.\n //\n // pikkuBan(): adds the banned/banExpires/banReason columns (see\n // db/sqlite/0003-admin.sql) and the session hook that refuses a banned\n // user a session. better-auth's own admin() is refused by the inspector:\n // it authorizes on a `user.role` column while pikku authorizes on scopes,\n // and everything else it offered — list, create, ban, remove, revoke\n // sessions, set password — is scoped RPCs in @pikku/addon-admin.\n //\n // pikkuFabric(): exposes /api/auth/sign-in/fabric — the Fabric control plane\n // mints a short-lived RS256 token and signs in as a synthetic `fabric: true`\n // admin operator (db/sqlite/0004-fabric.sql), so the console Users tab can\n // list/impersonate real users without the operator being one of them. It\n // verifies against FABRIC_AUTH_PUBLIC_KEY; a missing key disables the\n // endpoint.\n //\n // `personas` is what provisions the scenario actors. The plugin creates a\n // declared persona's account the first time an operator asks to act as an\n // address the stage has no row for, so a deploy carries its actors with it\n // without a bootstrap step. This does NOT belong in `pikkuServerLifecycle`'s\n // afterStart: that hook only ever runs under `pikku dev` and `pikku serve`,\n // so a deployed stage would provision nobody.\n plugins: [\n pikkuActor({ secret: SCENARIO_ACTOR_SECRET }),\n pikkuBan(),\n pikkuFabric({\n publicKey: FABRIC_AUTH_PUBLIC_KEY,\n scopeService,\n logger,\n personas: {\n personas: personaConfigs,\n environments: personaEnvironments,\n },\n }),\n ],\n })\n }\n)"
3359
+ "export const auth = pikkuBetterAuth(\n async ({\n kysely,\n secrets,\n variables,\n emailService,\n scopeService,\n logger,\n }) => {\n // `.reveal()` at the sink, not earlier: getSecret hands back a nominal\n // SecretValue that no concretely-typed parameter accepts, so every disclosure\n // is one greppable call. Better Auth wants the raw string, and this is where\n // it stops being a secret in the type system.\n const BETTER_AUTH_SECRET = (\n await secrets.getSecret('BETTER_AUTH_SECRET')\n ).reveal()\n // Genuinely optional: unset simply disables /api/auth/sign-in/actor (scenarios\n // off for this deployment) — the actor plugin refuses all sign-ins\n // without it.\n const SCENARIO_ACTOR_SECRET = await secrets\n .getSecret('SCENARIO_ACTOR_SECRET')\n .then((value) => value?.reveal())\n .catch(() => undefined)\n // Fabric operator admin: the RSA public key the control plane's token is\n // verified against. The Fabric deployer pushes FABRIC_AUTH_PUBLIC_KEY onto\n // every stage; locally it's simply absent, which disables /sign-in/fabric.\n // Asymmetric — the app verifies, it can never forge an operator login.\n const FABRIC_AUTH_PUBLIC_KEY = await variables.get('FABRIC_AUTH_PUBLIC_KEY')\n // The opt-in that lets a deployed stage run scenarios. Read through\n // `variables` rather than left to `process.env`, because a Worker receives\n // it as a binding and has no populated environment to find it in.\n const ALLOW_ACTOR_SIGN_IN = await variables.get(ACTOR_SIGN_IN_OPT_IN_ENV)\n\n return betterAuth({\n secret: BETTER_AUTH_SECRET,\n database: { db: kysely, type: 'sqlite' },\n emailAndPassword: {\n enabled: true,\n // Without this, `requestPasswordReset` succeeds on the client and silently\n // sends nothing — the \"Forgot password?\" flow looks wired and dead-ends.\n // Better Auth builds `url` from its baseURL + the client's redirectTo, so\n // the app only supplies the message. Errors are logged, never swallowed:\n // a reset the user never receives must be visible in the logs.\n sendResetPassword: async ({ user, url }) => {\n await emailService.send({\n to: user.email,\n template: {\n name: 'reset-password',\n data: { email: user.email, resetUrl: url },\n },\n })\n },\n },\n // Stateless session: CLI splits out betterAuthStatelessSession so non-auth\n // units verify the signed cookie instead of bundling better-auth. pikku #737.\n session: { cookieCache: { enabled: true } },\n advanced: { database: { generateId: 'uuid' } },\n // Scenario actors: synthetic users (user.actor = true, see\n // db/sqlite/0002-user-actor.sql) signed in by pikkuScenario via\n // POST /api/auth/sign-in/actor { email, secret }. Never signs in real users.\n //\n // pikkuBan(): adds the banned/banExpires/banReason columns (see\n // db/sqlite/0003-admin.sql) and the session hook that refuses a banned\n // user a session. better-auth's own admin() is refused by the inspector:\n // it authorizes on a `user.role` column while pikku authorizes on scopes,\n // and everything else it offered — list, create, ban, remove, revoke\n // sessions, set password — is scoped RPCs in @pikku/addon-admin.\n //\n // pikkuFabric(): exposes /api/auth/sign-in/fabric — the Fabric control plane\n // mints a short-lived RS256 token and signs in as a synthetic `fabric: true`\n // admin operator (db/sqlite/0004-fabric.sql), so the console Users tab can\n // list/impersonate real users without the operator being one of them. It\n // verifies against FABRIC_AUTH_PUBLIC_KEY; a missing key disables the\n // endpoint.\n //\n // `personas` is what provisions the scenario actors. The plugin creates a\n // declared persona's account the first time an operator asks to act as an\n // address the stage has no row for, so a deploy carries its actors with it\n // without a bootstrap step. This does NOT belong in `pikkuServerLifecycle`'s\n // afterStart: that hook only ever runs under `pikku dev` and `pikku serve`,\n // so a deployed stage would provision nobody.\n plugins: [\n pikkuActor({\n secret: SCENARIO_ACTOR_SECRET,\n allowSignIn: ALLOW_ACTOR_SIGN_IN,\n }),\n pikkuBan(),\n pikkuFabric({\n publicKey: FABRIC_AUTH_PUBLIC_KEY,\n scopeService,\n logger,\n personas: {\n personas: personaConfigs,\n environments: personaEnvironments,\n },\n }),\n ],\n })\n }\n)"
3360
3360
  ]
3361
3361
  },
3362
3362
  {
@@ -1 +0,0 @@
1
- import"./chunk-KEIR6QF5-BICK3FdT.js";import{M as e}from"./mermaid-parser.core-DxPo1qbR.js";export{e as createArchitectureServices};
@@ -1 +0,0 @@
1
- import{at as e,ot as t}from"./chunk-I66GZJ75-CbpQtX8e.js";var n=(n,r)=>t.lang.round(e.parse(n)[r]);export{n as t};
@@ -1 +0,0 @@
1
- import{p as e}from"./index-DqNqujdF.js";import{n as t}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import"./src-DF-84qwJ.js";var n=t((t,n)=>{let r;return n===`sandbox`&&(r=e(`#i`+t)),e(n===`sandbox`?r.nodes()[0].contentDocument.body:`body`).select(`[id="${t}"]`)},`getDiagramElement`);export{n as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import"./src-DF-84qwJ.js";import"./chunk-I66GZJ75-CbpQtX8e.js";import"./chunk-NSK5VX7P-Bo-dbDZD.js";import"./chunk-4I5QYGJK-DCgTj78f.js";import"./chunk-WRU74C26-DXijYjrx.js";import"./chunk-7BUUIJ7U-Bb538aSH.js";import"./chunk-UBXNYLIW-D9OoHV5X.js";import"./chunk-2GRJ4B5K-BLGsmyy4.js";import"./chunk-XXDRQBXY-DRMEt0Gf.js";import"./chunk-KBJHAD2P-Brvmen34.js";import"./chunk-W5SLKNZC-BNTcVpi3.js";import"./chunk-QR6OTTB3-B5Al5KEo.js";import"./chunk-7Z6QIM7H-CbBMe7ej.js";import{i as t,n,r,t as i}from"./chunk-GF5L2VYU-BXraqZ7w.js";import"./mermaid.core-DpvXaF3y.js";var a={parser:n,get db(){return new i},renderer:r,styles:t,init:e(e=>{e.class||={},e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
@@ -1 +0,0 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import"./src-DF-84qwJ.js";import"./chunk-I66GZJ75-CbpQtX8e.js";import"./chunk-NSK5VX7P-Bo-dbDZD.js";import"./chunk-4I5QYGJK-DCgTj78f.js";import"./chunk-WRU74C26-DXijYjrx.js";import"./chunk-7BUUIJ7U-Bb538aSH.js";import"./chunk-UBXNYLIW-D9OoHV5X.js";import"./chunk-2GRJ4B5K-BLGsmyy4.js";import"./chunk-XXDRQBXY-DRMEt0Gf.js";import"./chunk-KBJHAD2P-Brvmen34.js";import"./chunk-W5SLKNZC-BNTcVpi3.js";import"./chunk-QR6OTTB3-B5Al5KEo.js";import"./chunk-7Z6QIM7H-CbBMe7ej.js";import{i as t,n,r,t as i}from"./chunk-GF5L2VYU-BXraqZ7w.js";import"./mermaid.core-DpvXaF3y.js";var a={parser:n,get db(){return new i},renderer:r,styles:t,init:e(e=>{e.class||={},e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
@@ -1 +0,0 @@
1
- import"./chunk-KEIR6QF5-BICK3FdT.js";import{O as e}from"./mermaid-parser.core-DxPo1qbR.js";export{e as createEventModelingServices};
@@ -1 +0,0 @@
1
- import"./src-DF-84qwJ.js";import"./chunk-I66GZJ75-CbpQtX8e.js";import"./chunk-NSK5VX7P-Bo-dbDZD.js";import"./chunk-4I5QYGJK-DCgTj78f.js";import"./chunk-WRU74C26-DXijYjrx.js";import"./chunk-7BUUIJ7U-Bb538aSH.js";import"./chunk-UBXNYLIW-D9OoHV5X.js";import"./chunk-2GRJ4B5K-BLGsmyy4.js";import"./chunk-XXDRQBXY-DRMEt0Gf.js";import"./chunk-KBJHAD2P-Brvmen34.js";import"./chunk-W5SLKNZC-BNTcVpi3.js";import"./chunk-QR6OTTB3-B5Al5KEo.js";import"./chunk-7Z6QIM7H-CbBMe7ej.js";import{n as e}from"./chunk-JQJVKLGR-Cp9FHSH6.js";import"./mermaid.core-DpvXaF3y.js";export{e as diagram};
@@ -1 +0,0 @@
1
- import"./chunk-KEIR6QF5-BICK3FdT.js";import{m as e}from"./mermaid-parser.core-DxPo1qbR.js";export{e as createRailroadAbnfServices};
@@ -1 +0,0 @@
1
- import"./chunk-KEIR6QF5-BICK3FdT.js";import{f as e}from"./mermaid-parser.core-DxPo1qbR.js";export{e as createRailroadEbnfServices};
@@ -1 +0,0 @@
1
- import"./chunk-KEIR6QF5-BICK3FdT.js";import{u as e}from"./mermaid-parser.core-DxPo1qbR.js";export{e as createRailroadPegServices};
@@ -1 +0,0 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import"./src-DF-84qwJ.js";import"./chunk-I66GZJ75-CbpQtX8e.js";import"./chunk-NSK5VX7P-Bo-dbDZD.js";import"./chunk-4I5QYGJK-DCgTj78f.js";import"./chunk-WRU74C26-DXijYjrx.js";import"./chunk-7BUUIJ7U-Bb538aSH.js";import"./chunk-UBXNYLIW-D9OoHV5X.js";import"./chunk-2GRJ4B5K-BLGsmyy4.js";import"./chunk-XXDRQBXY-DRMEt0Gf.js";import"./chunk-KBJHAD2P-Brvmen34.js";import"./chunk-W5SLKNZC-BNTcVpi3.js";import"./chunk-QR6OTTB3-B5Al5KEo.js";import"./chunk-7Z6QIM7H-CbBMe7ej.js";import{i as t,n,r,t as i}from"./chunk-5RXB4S5H-CX9hS68x.js";import"./mermaid.core-DpvXaF3y.js";var a={parser:n,get db(){return new i(2)},renderer:r,styles:t,init:e(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
@@ -1,8 +0,0 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import"./src-DF-84qwJ.js";import"./chunk-I66GZJ75-CbpQtX8e.js";import"./chunk-NSK5VX7P-Bo-dbDZD.js";import"./chunk-4I5QYGJK-DCgTj78f.js";import"./chunk-WRU74C26-DXijYjrx.js";import"./chunk-7BUUIJ7U-Bb538aSH.js";import"./chunk-UBXNYLIW-D9OoHV5X.js";import"./chunk-2GRJ4B5K-BLGsmyy4.js";import"./chunk-XXDRQBXY-DRMEt0Gf.js";import"./chunk-KBJHAD2P-Brvmen34.js";import"./chunk-W5SLKNZC-BNTcVpi3.js";import"./chunk-QR6OTTB3-B5Al5KEo.js";import"./chunk-7Z6QIM7H-CbBMe7ej.js";import{r as t,t as n}from"./chunk-JQJVKLGR-Cp9FHSH6.js";import"./mermaid.core-DpvXaF3y.js";var r=n({defaultLayout:`swimlane`,styles:e(e=>`${t(e)}
2
- .swimlane.cluster rect {
3
- stroke: ${e.clusterBorder} !important;
4
- }
5
- [data-look="neo"].cluster rect {
6
- filter: none;
7
- }
8
- `,`getStyles`)});export{r as diagram};
@@ -1 +0,0 @@
1
- { "$schema": "http://json-schema.org/draft-07/schema#", "type": "boolean", "enum": [false, true], "definitions": {} }
@@ -1 +0,0 @@
1
- export declare const pikkuUserAdminFunctions: import("#pikku/function").PikkuFunctionConfig<void, boolean, "rpc" | "session", import("#pikku/function").PikkuFunctionSessionless<void, boolean, "rpc" | "session", import("#pikku/function").WiredServices, unknown> | import("#pikku/function").PikkuFunction<void, boolean, "rpc" | "session", import("#pikku/function").WiredServices>, undefined, undefined>;
@@ -1,55 +0,0 @@
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 { serializeUserAdminFunctions } from './serialize-user-admin-functions.js';
6
- export const pikkuUserAdminFunctions = pikkuSessionlessFunc({
7
- func: async ({ logger, config, getInspectorState }) => {
8
- if (!config.scaffold?.userAdmin ||
9
- !config.userAdminFunctionsFile ||
10
- !config.userAdminSchemasFile) {
11
- logger.debug({
12
- message: 'Skipping user admin scaffold (set scaffold.userAdmin in pikku.config.json to enable).',
13
- type: 'skip',
14
- });
15
- return false;
16
- }
17
- const { definition } = (await getInspectorState()).auth;
18
- // Every one of these functions drives better-auth's internal adapter, so
19
- // without a better-auth instance the scaffold would generate RPCs that
20
- // throw on every call and scopes that grant nothing. Fail the codegen
21
- // instead of shipping that.
22
- if (!definition) {
23
- throw new Error(`"scaffold.userAdmin" is enabled but no pikkuBetterAuth(...) was found in the project.\n` +
24
- `User management works through better-auth's internal adapter, so there is nothing to manage.\n` +
25
- `Fix: set up Better Auth before scaffolding user management, or remove ` +
26
- `"scaffold.userAdmin" from pikku.config.json.`);
27
- }
28
- // Ban is the one capability with a schema requirement of its own, and it is
29
- // only one of the six — a warning rather than a failure, so an app that
30
- // never bans anyone is not forced to carry the columns.
31
- // The plugin ids here are the callee names read off the `plugins: [...]`
32
- // array, so both the current `pikkuBan()` and the deprecated `ban()` alias
33
- // have to count as wired.
34
- const bansUsers = definition.plugins.includes('pikkuBan') ||
35
- definition.plugins.includes('ban');
36
- if (!bansUsers) {
37
- logger.warn(`"scaffold.userAdmin" is enabled but better-auth is configured without the pikkuBan() plugin, ` +
38
- `so the banned/banReason/banExpires columns do not exist and setUserBanned will fail.\n` +
39
- `Fix: add pikkuBan() to the plugins array in ${definition.sourceFile}:\n` +
40
- ` import { pikkuBan } from '@pikku/better-auth'\n` +
41
- ` betterAuth({ plugins: [pikkuBan()] })`);
42
- }
43
- const leaf = (name) => getLeafImportPath(config.userAdminFunctionsFile, name, config);
44
- const { schemas, functions } = serializeUserAdminFunctions(leaf);
45
- await writeFileInDir(logger, config.userAdminSchemasFile, schemas);
46
- await writeFileInDir(logger, config.userAdminFunctionsFile, functions);
47
- return true;
48
- },
49
- middleware: [
50
- logCommandInfoAndTime({
51
- commandStart: 'Generating user management functions',
52
- commandEnd: 'Generated user management functions',
53
- }),
54
- ],
55
- });
@@ -1,25 +0,0 @@
1
- export interface UserAdminGenOutput {
2
- schemas: string;
3
- functions: string;
4
- }
5
- /**
6
- * Generate the user-management functions into the project scaffold: the
7
- * directory read plus the writes that administer it.
8
- *
9
- * Superseded by `@pikku/addon-admin`, which ships these same functions plus
10
- * roles, credentials and the audit trail, and which an app can wire without
11
- * installing the console. Kept for hosts still on the scaffold; the scope tree
12
- * below must stay byte-identical to the addon's, or an app with both fails
13
- * codegen on conflicting declarations.
14
- *
15
- * Each function is gated on its own `admin:users:*` scope, and works through
16
- * better-auth's internal adapter. Banning additionally needs the `pikkuBan()` plugin
17
- * from `@pikku/better-auth` for the columns it writes to exist.
18
- *
19
- * Emitted as two files. The schemas are zod, and the inspector reads a zod
20
- * schema by importing the module that declares it — which it cannot do for the
21
- * functions file, whose relative pikku-types import per-unit deploy codegen
22
- * rewrites. Keeping the schemas in a sibling module that imports nothing but
23
- * zod sidesteps that entirely.
24
- */
25
- export declare const serializeUserAdminFunctions: (leaf: (name: string) => string) => UserAdminGenOutput;
@@ -1,294 +0,0 @@
1
- /**
2
- * Generate the user-management functions into the project scaffold: the
3
- * directory read plus the writes that administer it.
4
- *
5
- * Superseded by `@pikku/addon-admin`, which ships these same functions plus
6
- * roles, credentials and the audit trail, and which an app can wire without
7
- * installing the console. Kept for hosts still on the scaffold; the scope tree
8
- * below must stay byte-identical to the addon's, or an app with both fails
9
- * codegen on conflicting declarations.
10
- *
11
- * Each function is gated on its own `admin:users:*` scope, and works through
12
- * better-auth's internal adapter. Banning additionally needs the `pikkuBan()` plugin
13
- * from `@pikku/better-auth` for the columns it writes to exist.
14
- *
15
- * Emitted as two files. The schemas are zod, and the inspector reads a zod
16
- * schema by importing the module that declares it — which it cannot do for the
17
- * functions file, whose relative pikku-types import per-unit deploy codegen
18
- * rewrites. Keeping the schemas in a sibling module that imports nothing but
19
- * zod sidesteps that entirely.
20
- */
21
- export const serializeUserAdminFunctions = (leaf) => {
22
- const schemas = `/**
23
- * Auto-generated user management schemas
24
- * Do not edit manually - regenerate with 'npx pikku'
25
- */
26
- import { z } from 'zod'
27
-
28
- /**
29
- * A user, as the directory sees one. Ban state is optional because those
30
- * columns belong to the \`pikkuBan()\` plugin: a host without it reports no ban state
31
- * at all, which a client can render as "unknown" rather than as a misleading
32
- * "not banned".
33
- */
34
- export const User = z.object({
35
- id: z.string(),
36
- email: z.string(),
37
- name: z.string().optional(),
38
- image: z.string().optional(),
39
- createdAt: z.string().optional(),
40
- banned: z.boolean().optional(),
41
- banReason: z.string().optional(),
42
- banExpires: z.string().optional(),
43
- })
44
-
45
- export const ListUsersInput = z.object({
46
- search: z.string().optional(),
47
- limit: z.number().int().positive().optional(),
48
- })
49
-
50
- export const ListUsersOutput = z.object({
51
- users: z.array(User),
52
- })
53
-
54
- export const CreateUserInput = z.object({
55
- email: z.string(),
56
- password: z.string(),
57
- name: z.string().optional(),
58
- })
59
-
60
- export const CreateUserOutput = z.object({
61
- userId: z.string(),
62
- })
63
-
64
- /** Every write targets one user by id. */
65
- export const UserRef = z.object({
66
- userId: z.string(),
67
- })
68
-
69
- export const SetUserBannedInput = z.object({
70
- userId: z.string(),
71
- banned: z.boolean(),
72
- reason: z.string().optional(),
73
- expiresInSeconds: z.number().int().positive().optional(),
74
- })
75
-
76
- export const SetUserPasswordInput = z.object({
77
- userId: z.string(),
78
- newPassword: z.string(),
79
- })
80
-
81
- export const Success = z.object({
82
- success: z.boolean(),
83
- })
84
- `;
85
- const functions = `/**
86
- * Auto-generated user management functions
87
- * Do not edit manually - regenerate with 'npx pikku'
88
- */
89
- import { pikkuFunc } from '${leaf('function')}'
90
- import { defineScope } from '${leaf('scopes')}'
91
- import {
92
- createAuthUser,
93
- deleteAuthUser,
94
- revokeAuthUserSessions,
95
- setAuthUserBanned,
96
- setAuthUserPassword,
97
- } from '@pikku/better-auth'
98
- import {
99
- CreateUserInput,
100
- CreateUserOutput,
101
- ListUsersInput,
102
- ListUsersOutput,
103
- SetUserBannedInput,
104
- SetUserPasswordInput,
105
- Success,
106
- UserRef,
107
- } from './user-admin.schemas.gen.js'
108
-
109
- // pikku requires every declaration of a shared scope root to be identical, so
110
- // this is the whole \`admin\` tree — not just the leaves gated below. It must stay
111
- // byte-identical to ADMIN_SCOPE_TREE in @pikku/better-auth and to the copy in
112
- // @pikku/addon-admin, or codegen fails with conflicting declarations.
113
- defineScope({
114
- admin: {
115
- displayName: 'Administration',
116
- description: 'Capabilities that act on the application as a whole',
117
- scopes: {
118
- impersonate: { description: 'Act as another user' },
119
- credentials: {
120
- description: 'Application-wide credentials',
121
- scopes: {
122
- link: { description: 'Bind a shared credential for every user' },
123
- read: { description: 'Read credential values and who holds them' },
124
- manage: { description: 'Set and delete credentials' },
125
- },
126
- },
127
- users: {
128
- description: 'The user directory',
129
- scopes: {
130
- list: { description: 'List and search users' },
131
- create: { description: 'Create users out of band' },
132
- ban: { description: 'Ban and unban users' },
133
- remove: { description: 'Delete users and all their data' },
134
- sessions: { description: "Revoke a user's sessions" },
135
- password: { description: "Set a user's password" },
136
- },
137
- },
138
- scopes: {
139
- description: 'Authorization management',
140
- scopes: {
141
- read: {
142
- description: 'View declared scopes, roles, and who holds them',
143
- },
144
- manage: {
145
- description:
146
- 'Create and delete roles, change their scopes, and grant roles to users',
147
- },
148
- },
149
- },
150
- audit: {
151
- description: 'The audit trail',
152
- scopes: {
153
- read: {
154
- description:
155
- 'Read the audit trail — every recorded action, and which user took it',
156
- },
157
- },
158
- },
159
- },
160
- },
161
- })
162
-
163
- /**
164
- * Synthetic principals — the platform credential owner, fabric service users
165
- * and agent actors — are not people, so they never belong in a directory a
166
- * human picks from.
167
- */
168
- const isPerson = (row: any) =>
169
- row.fabric !== true && row.actor !== true && row.id !== 'pikku-platform'
170
-
171
- export const pikkuAdminListUsers = pikkuFunc({
172
- tags: ['pikku'],
173
- title: 'List Users',
174
- description:
175
- 'Lists and searches the user directory, read through the auth adapter so it works on any database better-auth supports.',
176
- expose: true,
177
- scopes: ['admin:users:list'],
178
- input: ListUsersInput,
179
- output: ListUsersOutput,
180
- func: async ({ auth }, { search, limit }) => {
181
- const ctx = await (await auth()).$context
182
- const rows = (await ctx.adapter.findMany({
183
- model: 'user',
184
- limit: limit ?? 200,
185
- where: search
186
- ? [{ field: 'email', operator: 'contains', value: search }]
187
- : undefined,
188
- })) as any[]
189
-
190
- return {
191
- users: rows.filter(isPerson).map((row) => ({
192
- id: row.id,
193
- email: row.email,
194
- name: row.name ?? undefined,
195
- image: row.image ?? undefined,
196
- createdAt: row.createdAt
197
- ? new Date(row.createdAt).toISOString()
198
- : undefined,
199
- banned: typeof row.banned === 'boolean' ? row.banned : undefined,
200
- banReason: row.banReason ?? undefined,
201
- banExpires: row.banExpires
202
- ? new Date(row.banExpires).toISOString()
203
- : undefined,
204
- })),
205
- }
206
- },
207
- })
208
-
209
- export const pikkuAdminCreateUser = pikkuFunc({
210
- tags: ['pikku'],
211
- title: 'Create User',
212
- description:
213
- 'Creates a user directly, for provisioning an account out of band rather than through your sign-up flow. Enforces the configured password bounds and rejects a duplicate email.',
214
- expose: true,
215
- scopes: ['admin:users:create'],
216
- input: CreateUserInput,
217
- output: CreateUserOutput,
218
- func: async ({ auth }, { email, password, name }) => ({
219
- userId: await createAuthUser(auth, { email, password, name }),
220
- }),
221
- })
222
-
223
- export const pikkuAdminSetUserBanned = pikkuFunc({
224
- tags: ['pikku'],
225
- title: 'Ban or Unban User',
226
- description:
227
- 'Bans a user — revoking their sessions and blocking sign-in — or lifts an existing ban. An expiry lets the ban lapse on its own; without one it holds until it is lifted. Requires better-auth wired with the \`pikkuBan()\` plugin.',
228
- expose: true,
229
- scopes: ['admin:users:ban'],
230
- input: SetUserBannedInput,
231
- output: Success,
232
- func: async (
233
- { auth },
234
- { userId, banned, reason, expiresInSeconds },
235
- { session }
236
- ) => {
237
- if (banned && userId === session?.userId) {
238
- throw new Error('You cannot ban yourself')
239
- }
240
- await setAuthUserBanned(auth, { userId, banned, reason, expiresInSeconds })
241
- return { success: true }
242
- },
243
- })
244
-
245
- export const pikkuAdminRemoveUser = pikkuFunc({
246
- tags: ['pikku'],
247
- title: 'Remove User',
248
- description:
249
- 'Permanently deletes a user along with their sessions and linked accounts. Cannot be undone.',
250
- expose: true,
251
- scopes: ['admin:users:remove'],
252
- input: UserRef,
253
- output: Success,
254
- func: async ({ auth }, { userId }, { session }) => {
255
- if (userId === session?.userId) {
256
- throw new Error('You cannot delete yourself')
257
- }
258
- await deleteAuthUser(auth, userId)
259
- return { success: true }
260
- },
261
- })
262
-
263
- export const pikkuAdminRevokeUserSessions = pikkuFunc({
264
- tags: ['pikku'],
265
- title: 'Revoke User Sessions',
266
- description:
267
- 'Signs a user out of every device by deleting all of their sessions. They keep their account and can sign in again.',
268
- expose: true,
269
- scopes: ['admin:users:sessions'],
270
- input: UserRef,
271
- output: Success,
272
- func: async ({ auth }, { userId }) => {
273
- await revokeAuthUserSessions(auth, userId)
274
- return { success: true }
275
- },
276
- })
277
-
278
- export const pikkuAdminSetUserPassword = pikkuFunc({
279
- tags: ['pikku'],
280
- title: "Set User's Password",
281
- description:
282
- 'Sets a user password out of band, for when they cannot complete a reset themselves. Enforces the configured length bounds, and gives a user who only ever signed in socially a credential account.',
283
- expose: true,
284
- scopes: ['admin:users:password'],
285
- input: SetUserPasswordInput,
286
- output: Success,
287
- func: async ({ auth }, { userId, newPassword }) => {
288
- await setAuthUserPassword(auth, { userId, newPassword })
289
- return { success: true }
290
- },
291
- })
292
- `;
293
- return { schemas, functions };
294
- };