@pikku/cli 0.12.20 → 0.12.22
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/cli.schema.json +1 -1
- package/console-app/assets/index-C52h1B_L.css +1 -0
- package/console-app/assets/index-CAk106ji.js +232 -0
- package/console-app/index.html +3 -6
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +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/pikku-cli-channel.d.ts +6 -6
- package/dist/.pikku/cli/pikku-cli-channel.js +280 -1
- package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
- 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 +792 -8
- 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/console/pikku-node-types.gen.d.ts +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +44 -70
- package/dist/.pikku/function/pikku-function-types.gen.js +33 -40
- package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.json +1439 -316
- package/dist/.pikku/function/pikku-functions.gen.js +21 -9
- 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/http/pikku-http-wirings-meta.gen.js +1 -1
- package/dist/.pikku/http/pikku-http-wirings.gen.d.ts +1 -1
- package/dist/.pikku/http/pikku-http-wirings.gen.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/pikku-bootstrap.gen.d.ts +3 -1
- package/dist/.pikku/pikku-bootstrap.gen.js +3 -1
- package/dist/.pikku/pikku-meta-service.gen.d.ts +1 -1
- package/dist/.pikku/pikku-meta-service.gen.js +1 -1
- package/dist/.pikku/pikku-services.gen.d.ts +2 -1
- package/dist/.pikku/pikku-services.gen.js +1 -0
- package/dist/.pikku/pikku-types.gen.d.ts +1 -1
- package/dist/.pikku/pikku-types.gen.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.d.ts +1 -0
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +6 -0
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.json +250 -0
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +4 -0
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +5 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +66 -10
- 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 +157 -11
- package/dist/.pikku/schemas/schemas/BinaryInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/DbMigrateInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/DbResetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/DbSeedInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDbSchemaInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDbSchemaOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployApplyInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployApplyOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployListOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployPlanInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployPlanOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployUnitsInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployUnitsOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDomainsAddInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDomainsAddOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDomainsListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDomainsListOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDomainsRemoveInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDomainsRemoveOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricErrorsInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricErrorsOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricInitInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricInitOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLLMKeyInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLLMKeyOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLinkInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLinkOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLoginInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLoginOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLogsInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLogsOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricMetricsInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricMetricsOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricRollbackInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricRollbackOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricSecretsListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricSecretsListOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricSecretsSetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricSecretsSetOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricStatusInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricStatusOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricTraceInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricTraceOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricValidateInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricValidateOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuCommandChannelsOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuCommandHTTPOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuCommandQueueOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuEventsScaffoldOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaClientsInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaContextInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaFunctionsGetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaFunctionsListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaMiddlewareGetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaMiddlewareListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaPermissionsGetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaPermissionsListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaSchemasGetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaSchemasListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresChannelInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresHttpInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresQueueInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresSchedulerInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresTriggerInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresTypeInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWorkflowsGetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWorkflowsListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuSkillsInstallInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuSkillsListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuTestsCoverageInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuTestsInitInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/WorkflowRunStatus.schema.json +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/trigger/pikku-trigger-types.gen.d.ts +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.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/meta/allWorkflow.gen.json +237 -629
- 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 +23 -0
- package/dist/bin/pikku.js +28 -1
- package/dist/src/cli.wiring.js +286 -10
- package/dist/src/deploy/analyzer/analyzer.d.ts +16 -1
- package/dist/src/deploy/analyzer/analyzer.js +83 -43
- package/dist/src/deploy/analyzer/manifest.d.ts +10 -0
- package/dist/src/deploy/build-pipeline.d.ts +2 -0
- package/dist/src/deploy/build-pipeline.js +123 -19
- package/dist/src/deploy/bundler/bundler.d.ts +3 -1
- package/dist/src/deploy/bundler/bundler.js +40 -9
- package/dist/src/deploy/bundler/dep-extractor.d.ts +5 -2
- package/dist/src/deploy/bundler/dep-extractor.js +103 -23
- package/dist/src/deploy/bundler/types.d.ts +5 -1
- package/dist/src/deploy/codegen/per-unit-codegen.d.ts +11 -1
- package/dist/src/deploy/codegen/per-unit-codegen.js +49 -6
- package/dist/src/deploy/plan/planner.js +25 -3
- package/dist/src/deploy/plan/provider.d.ts +2 -0
- package/dist/src/deploy/provider-adapter.d.ts +34 -0
- package/dist/src/deploy/server-entry.d.ts +16 -0
- package/dist/src/deploy/server-entry.js +81 -0
- package/dist/src/fabric/fabric-commands.d.ts +522 -0
- package/dist/src/fabric/fabric-commands.js +299 -0
- package/dist/src/fabric/functions/db-schema.function.d.ts +35 -0
- package/dist/src/fabric/functions/db-schema.function.js +37 -0
- package/dist/src/fabric/functions/deploy-list.function.d.ts +41 -0
- package/dist/src/fabric/functions/deploy-list.function.js +43 -0
- package/dist/src/fabric/functions/deploy-units.function.d.ts +35 -0
- package/dist/src/fabric/functions/deploy-units.function.js +41 -0
- package/dist/src/fabric/functions/deploy.function.d.ts +105 -0
- package/dist/src/fabric/functions/deploy.function.js +122 -0
- package/dist/src/fabric/functions/domains-add.function.d.ts +35 -0
- package/dist/src/fabric/functions/domains-add.function.js +46 -0
- package/dist/src/fabric/functions/domains-list.function.d.ts +20 -0
- package/dist/src/fabric/functions/domains-list.function.js +50 -0
- package/dist/src/fabric/functions/domains-remove.function.d.ts +24 -0
- package/dist/src/fabric/functions/domains-remove.function.js +44 -0
- package/dist/src/fabric/functions/errors.function.d.ts +44 -0
- package/dist/src/fabric/functions/errors.function.js +50 -0
- package/dist/src/fabric/functions/init.function.d.ts +51 -0
- package/dist/src/fabric/functions/init.function.js +54 -0
- package/dist/src/fabric/functions/link.function.d.ts +28 -0
- package/dist/src/fabric/functions/link.function.js +77 -0
- package/dist/src/fabric/functions/llm-key.function.d.ts +46 -0
- package/dist/src/fabric/functions/llm-key.function.js +76 -0
- package/dist/src/fabric/functions/login.function.d.ts +42 -0
- package/dist/src/fabric/functions/login.function.js +68 -0
- package/dist/src/fabric/functions/logs.function.d.ts +40 -0
- package/dist/src/fabric/functions/logs.function.js +84 -0
- package/dist/src/fabric/functions/metrics.function.d.ts +32 -0
- package/dist/src/fabric/functions/metrics.function.js +49 -0
- package/dist/src/fabric/functions/rollback.function.d.ts +76 -0
- package/dist/src/fabric/functions/rollback.function.js +69 -0
- package/dist/src/fabric/functions/secrets-list.function.d.ts +24 -0
- package/dist/src/fabric/functions/secrets-list.function.js +37 -0
- package/dist/src/fabric/functions/secrets-set.function.d.ts +32 -0
- package/dist/src/fabric/functions/secrets-set.function.js +36 -0
- package/dist/src/fabric/functions/status.function.d.ts +34 -0
- package/dist/src/fabric/functions/status.function.js +43 -0
- package/dist/src/fabric/functions/trace.function.d.ts +28 -0
- package/dist/src/fabric/functions/trace.function.js +45 -0
- package/dist/src/fabric/functions/validate.function.d.ts +50 -0
- package/dist/src/fabric/functions/validate.function.js +363 -0
- package/dist/src/fabric/lib/config.d.ts +64 -0
- package/dist/src/fabric/lib/config.js +62 -0
- package/dist/src/fabric/lib/console-url.d.ts +5 -0
- package/dist/src/fabric/lib/console-url.js +13 -0
- package/dist/src/fabric/lib/git.d.ts +53 -0
- package/dist/src/fabric/lib/git.js +151 -0
- package/dist/src/fabric/lib/http.d.ts +4 -0
- package/dist/src/fabric/lib/http.js +12 -0
- package/dist/src/fabric/lib/not-implemented.d.ts +5 -0
- package/dist/src/fabric/lib/not-implemented.js +8 -0
- package/dist/src/fabric/lib/output.d.ts +23 -0
- package/dist/src/fabric/lib/output.js +39 -0
- package/dist/src/fabric/lib/prompt.d.ts +12 -0
- package/dist/src/fabric/lib/prompt.js +32 -0
- package/dist/src/fabric/lib/stage.d.ts +7 -0
- package/dist/src/fabric/lib/stage.js +14 -0
- package/dist/src/fabric/sdk/pikku-fetch.gen.d.ts +14 -0
- package/dist/src/fabric/sdk/pikku-fetch.gen.js +30 -0
- package/dist/src/fabric/sdk/pikku-rpc.gen.d.ts +105 -0
- package/dist/src/fabric/sdk/pikku-rpc.gen.js +126 -0
- package/dist/src/functions/commands/all.d.ts +1 -1
- package/dist/src/functions/commands/binary.d.ts +7 -0
- package/dist/src/functions/commands/binary.js +40 -0
- package/dist/src/functions/commands/bootstrap.d.ts +1 -1
- package/dist/src/functions/commands/bootstrap.js +7 -4
- package/dist/src/functions/commands/console.d.ts +3 -3
- package/dist/src/functions/commands/db-migrate.d.ts +1 -0
- package/dist/src/functions/commands/db-migrate.js +35 -0
- package/dist/src/functions/commands/db-reset.d.ts +1 -0
- package/dist/src/functions/commands/db-reset.js +36 -0
- package/dist/src/functions/commands/db-seed.d.ts +1 -0
- package/dist/src/functions/commands/db-seed.js +27 -0
- package/dist/src/functions/commands/db-shared.d.ts +32 -0
- package/dist/src/functions/commands/db-shared.js +26 -0
- package/dist/src/functions/commands/deploy-apply.d.ts +3 -3
- package/dist/src/functions/commands/deploy-apply.js +6 -4
- 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 +7 -1
- package/dist/src/functions/commands/dev.d.ts +3 -3
- package/dist/src/functions/commands/dev.js +142 -86
- package/dist/src/functions/commands/enable.d.ts +5 -4
- package/dist/src/functions/commands/enable.js +4 -0
- package/dist/src/functions/commands/info.d.ts +4 -4
- package/dist/src/functions/commands/load-user-project.d.ts +11 -0
- package/dist/src/functions/commands/load-user-project.js +40 -0
- package/dist/src/functions/commands/meta.d.ts +82 -0
- package/dist/src/functions/commands/meta.js +454 -0
- 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/pikku-command-bootstrap.d.ts +1 -1
- package/dist/src/functions/commands/pikku-command-bootstrap.js +15 -1
- package/dist/src/functions/commands/pikku-command-summary.d.ts +1 -1
- package/dist/src/functions/commands/pikku-command-summary.js +7 -1
- package/dist/src/functions/commands/skills.d.ts +26 -0
- package/dist/src/functions/commands/skills.js +184 -0
- package/dist/src/functions/commands/tests-coverage.d.ts +7 -0
- package/dist/src/functions/commands/tests-coverage.js +231 -0
- package/dist/src/functions/commands/tests-init.d.ts +7 -0
- package/dist/src/functions/commands/tests-init.js +225 -0
- 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/versions-update.js +4 -2
- package/dist/src/functions/commands/watch.d.ts +3 -3
- package/dist/src/functions/commands/watch.js +1 -1
- package/dist/src/functions/db/local-db.d.ts +48 -0
- package/dist/src/functions/db/local-db.js +106 -0
- package/dist/src/functions/db/seed.d.ts +11 -0
- package/dist/src/functions/db/seed.js +22 -0
- package/dist/src/functions/db/sql-migrator.d.ts +26 -0
- package/dist/src/functions/db/sql-migrator.js +104 -0
- package/dist/src/functions/db/sqlite-codegen.d.ts +45 -0
- package/dist/src/functions/db/sqlite-codegen.js +294 -0
- package/dist/src/functions/db/zod-codegen.d.ts +10 -0
- package/dist/src/functions/db/zod-codegen.js +109 -0
- 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/nextjs/pikku-command-nextjs.js +21 -2
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-backend-worker-rpc-wrapper.d.ts +1 -0
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-backend-worker-rpc-wrapper.js +163 -0
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.d.ts +1 -1
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.js +5 -2
- package/dist/src/functions/runtimes/tanstack-start/pikku-command-tanstack-start.d.ts +1 -0
- package/dist/src/functions/runtimes/tanstack-start/pikku-command-tanstack-start.js +32 -0
- package/dist/src/functions/runtimes/tanstack-start/serialize-tanstack-start-shim.d.ts +11 -0
- package/dist/src/functions/runtimes/tanstack-start/serialize-tanstack-start-shim.js +36 -0
- package/dist/src/functions/runtimes/websocket/pikku-command-websocket-typed.d.ts +1 -1
- package/dist/src/functions/wirings/ai-agent/pikku-command-ai-agent-types.d.ts +1 -1
- package/dist/src/functions/wirings/ai-agent/pikku-command-ai-agent.d.ts +1 -1
- package/dist/src/functions/wirings/ai-agent/pikku-command-ai-agent.js +1 -10
- package/dist/src/functions/wirings/ai-agent/pikku-command-public-agent.d.ts +1 -1
- package/dist/src/functions/wirings/ai-agent/serialize-public-agent.js +76 -1
- package/dist/src/functions/wirings/channels/pikku-channels.d.ts +1 -1
- 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/channels/pikku-command-channels.js +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-entry.js +5 -2
- package/dist/src/functions/wirings/cli/pikku-command-cli-types.d.ts +5 -1
- package/dist/src/functions/wirings/cli/pikku-command-cli-types.js +8 -2
- package/dist/src/functions/wirings/cli/pikku-command-cli.d.ts +1 -1
- package/dist/src/functions/wirings/cli/serialize-channel-cli-client.js +27 -9
- package/dist/src/functions/wirings/cli/serialize-channel-cli.d.ts +5 -1
- package/dist/src/functions/wirings/cli/serialize-channel-cli.js +13 -3
- package/dist/src/functions/wirings/console/pikku-command-console-functions.d.ts +1 -1
- package/dist/src/functions/wirings/console/pikku-command-console-functions.js +5 -1
- package/dist/src/functions/wirings/console/pikku-command-node-types.d.ts +1 -1
- package/dist/src/functions/wirings/console/pikku-command-nodes-meta.d.ts +1 -1
- package/dist/src/functions/wirings/console/serialize-console-functions.js +5 -0
- package/dist/src/functions/wirings/credentials/pikku-command-credentials.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-addon-types.d.ts +5 -1
- package/dist/src/functions/wirings/functions/pikku-command-addon-types.js +7 -2
- package/dist/src/functions/wirings/functions/pikku-command-function-types-split.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-function-types-split.js +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-function-types.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-functions.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-services.d.ts +1 -1
- package/dist/src/functions/wirings/functions/schemas.d.ts +1 -1
- package/dist/src/functions/wirings/functions/serialize-function-types.js +105 -80
- package/dist/src/functions/wirings/gateway/pikku-command-gateway.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-routes.js +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/http/pikku-http-routes.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 +2 -2
- package/dist/src/functions/wirings/package/pikku-command-package.d.ts +1 -1
- package/dist/src/functions/wirings/permissions/pikku-command-permissions.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue-map.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue-map.js +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue-service.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue-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-command-queue.js +1 -1
- package/dist/src/functions/wirings/queue/pikku-queue-map.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-queue.d.ts +1 -1
- package/dist/src/functions/wirings/realtime/pikku-command-events-scaffold.d.ts +1 -0
- package/dist/src/functions/wirings/realtime/pikku-command-events-scaffold.js +26 -0
- package/dist/src/functions/wirings/realtime/pikku-command-realtime.d.ts +1 -0
- package/dist/src/functions/wirings/realtime/pikku-command-realtime.js +35 -0
- package/dist/src/functions/wirings/realtime/serialize-events-scaffold.d.ts +23 -0
- package/dist/src/functions/wirings/realtime/serialize-events-scaffold.js +98 -0
- package/dist/src/functions/wirings/realtime/serialize-realtime-client.d.ts +22 -0
- package/dist/src/functions/wirings/realtime/serialize-realtime-client.js +337 -0
- package/dist/src/functions/wirings/rpc/pikku-command-public-rpc.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-public-rpc.js +5 -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-remote-rpc.js +5 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc-client.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc-client.js +3 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc-map.d.ts +2 -2
- package/dist/src/functions/wirings/rpc/pikku-command-rpc.d.ts +2 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc.js +13 -7
- package/dist/src/functions/wirings/rpc/serialize-public-rpc.js +1 -0
- package/dist/src/functions/wirings/rpc/serialize-react-query-hooks.js +1 -1
- package/dist/src/functions/wirings/rpc/serialize-remote-rpc.js +7 -1
- package/dist/src/functions/wirings/rpc/serialize-typed-rpc-map.js +16 -2
- 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/secrets/pikku-command-secrets.d.ts +1 -1
- package/dist/src/functions/wirings/triggers/pikku-command-trigger-types.d.ts +1 -1
- package/dist/src/functions/wirings/triggers/pikku-command-trigger-types.js +1 -1
- 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/workflow/pikku-command-workflow-routes.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-routes.js +1 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.d.ts +5 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.js +18 -4
- package/dist/src/functions/wirings/workflow/serialize-workflow-bootstrap-map.d.ts +3 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-bootstrap-map.js +40 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-routes.js +56 -2
- package/dist/src/functions/workflows/all.workflow.js +45 -12
- package/dist/src/scaffold/rpc-remote.gen.d.ts +3 -3
- package/dist/src/scaffold/rpc-remote.gen.js +7 -2
- package/dist/src/scaffold/workflow-routes.gen.d.ts +18 -18
- package/dist/src/scaffold/workflow-routes.gen.js +33 -1
- package/dist/src/services/cli-logger.service.d.ts +22 -3
- package/dist/src/services/cli-logger.service.js +107 -41
- package/dist/src/services.js +32 -67
- package/dist/src/utils/generate-bootstrap-file.js +3 -0
- package/dist/src/utils/parse-cli-filters.d.ts +18 -0
- package/dist/src/utils/parse-cli-filters.js +99 -0
- package/dist/src/utils/pikku-cli-config.js +29 -9
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -4
- package/skills/pikku-addon/SKILL.md +330 -0
- package/skills/pikku-ai-agent/SKILL.md +227 -0
- package/skills/pikku-ai-vercel/SKILL.md +78 -0
- package/skills/pikku-ai-voice/SKILL.md +85 -0
- package/skills/pikku-auth-js/SKILL.md +106 -0
- package/skills/pikku-aws/SKILL.md +107 -0
- package/skills/pikku-backblaze/SKILL.md +70 -0
- package/skills/pikku-cli/SKILL.md +281 -0
- package/skills/pikku-concepts/SKILL.md +281 -0
- package/skills/pikku-concepts/references/concept-mapping.md +528 -0
- package/skills/pikku-config/SKILL.md +208 -0
- package/skills/pikku-cron/SKILL.md +211 -0
- package/skills/pikku-deploy-azure/SKILL.md +69 -0
- package/skills/pikku-deploy-cloudflare/SKILL.md +80 -0
- package/skills/pikku-deploy-express/SKILL.md +83 -0
- package/skills/pikku-deploy-fastify/SKILL.md +70 -0
- package/skills/pikku-deploy-lambda/SKILL.md +107 -0
- package/skills/pikku-deploy-nextjs/SKILL.md +76 -0
- package/skills/pikku-deploy-uws/SKILL.md +85 -0
- package/skills/pikku-fabric/SKILL.md +245 -0
- package/skills/pikku-feature/SKILL.md +258 -0
- package/skills/pikku-gateway-slack/SKILL.md +112 -0
- package/skills/pikku-http/SKILL.md +317 -0
- package/skills/pikku-i18n/SKILL.md +208 -0
- package/skills/pikku-info/SKILL.md +95 -0
- package/skills/pikku-jose/SKILL.md +102 -0
- package/skills/pikku-kysely/SKILL.md +145 -0
- package/skills/pikku-mcp/SKILL.md +237 -0
- package/skills/pikku-mongodb/SKILL.md +102 -0
- package/skills/pikku-n8n-addon-map/SKILL.md +178 -0
- package/skills/pikku-n8n-code-translate/SKILL.md +166 -0
- package/skills/pikku-pino/SKILL.md +77 -0
- package/skills/pikku-queue/SKILL.md +237 -0
- package/skills/pikku-react/SKILL.md +183 -0
- package/skills/pikku-react-query/SKILL.md +205 -0
- package/skills/pikku-realtime/SKILL.md +285 -0
- package/skills/pikku-redis/SKILL.md +87 -0
- package/skills/pikku-rpc/SKILL.md +168 -0
- package/skills/pikku-rtl/SKILL.md +205 -0
- package/skills/pikku-schedule/SKILL.md +54 -0
- package/skills/pikku-schema-ajv/SKILL.md +60 -0
- package/skills/pikku-schema-cfworker/SKILL.md +60 -0
- package/skills/pikku-security/SKILL.md +243 -0
- package/skills/pikku-services/SKILL.md +247 -0
- package/skills/pikku-template-clone/SKILL.md +39 -0
- package/skills/pikku-testing/SKILL.md +428 -0
- package/skills/pikku-trigger/SKILL.md +177 -0
- package/skills/pikku-versioning/SKILL.md +169 -0
- package/skills/pikku-websocket/SKILL.md +239 -0
- package/skills/pikku-workflow/SKILL.md +283 -0
- package/skills/pikku-workflows-client/SKILL.md +150 -0
- package/skills/pikku-ws/SKILL.md +45 -0
- package/console-app/assets/index-BpY2pSuA.css +0 -10
- package/console-app/assets/index-DXLy-_D4.js +0 -717
- package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +0 -10
- package/dist/.pikku/cli/pikku-cli-client.gen.js +0 -44
- /package/dist/.pikku/schemas/schemas/{PikkuChannelsOutput.schema.json → PikkuCLIEntryOutput.schema.json} +0 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const FabricLLMKeyInput: z.ZodObject<{
|
|
3
|
+
shell: z.ZodOptional<z.ZodBoolean>;
|
|
4
|
+
env: z.ZodOptional<z.ZodBoolean>;
|
|
5
|
+
json: z.ZodOptional<z.ZodBoolean>;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export declare const FabricLLMKeyOutput: z.ZodObject<{
|
|
8
|
+
proxyUrl: z.ZodString;
|
|
9
|
+
apiKey: z.ZodString;
|
|
10
|
+
format: z.ZodEnum<{
|
|
11
|
+
text: "text";
|
|
12
|
+
json: "json";
|
|
13
|
+
shell: "shell";
|
|
14
|
+
env: "env";
|
|
15
|
+
}>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export declare const FabricLLMKey: import("../../../.pikku/pikku-types.gen.js").PikkuFunctionConfig<{
|
|
18
|
+
shell?: boolean | undefined;
|
|
19
|
+
env?: boolean | undefined;
|
|
20
|
+
json?: boolean | undefined;
|
|
21
|
+
}, {
|
|
22
|
+
proxyUrl: string;
|
|
23
|
+
apiKey: string;
|
|
24
|
+
format: "text" | "json" | "shell" | "env";
|
|
25
|
+
}, "rpc" | "session", import("../../../.pikku/pikku-types.gen.js").PikkuFunctionSessionless<{
|
|
26
|
+
shell?: boolean | undefined;
|
|
27
|
+
env?: boolean | undefined;
|
|
28
|
+
json?: boolean | undefined;
|
|
29
|
+
}, {
|
|
30
|
+
proxyUrl: string;
|
|
31
|
+
apiKey: string;
|
|
32
|
+
format: "text" | "json" | "shell" | "env";
|
|
33
|
+
}, "rpc" | "session", import("../../../types/application-types.js").Services> | import("../../../.pikku/pikku-types.gen.js").PikkuFunction<{
|
|
34
|
+
shell?: boolean | undefined;
|
|
35
|
+
env?: boolean | undefined;
|
|
36
|
+
json?: boolean | undefined;
|
|
37
|
+
}, {
|
|
38
|
+
proxyUrl: string;
|
|
39
|
+
apiKey: string;
|
|
40
|
+
format: "text" | "json" | "shell" | "env";
|
|
41
|
+
}, "rpc" | "session", import("../../../types/application-types.js").Services>, undefined, undefined>;
|
|
42
|
+
export declare const renderLLMKey: (_services: unknown, data: {
|
|
43
|
+
proxyUrl: string;
|
|
44
|
+
apiKey: string;
|
|
45
|
+
format: "text" | "env" | "shell" | "json";
|
|
46
|
+
}) => void;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BadRequestError, UnauthorizedError } from '@pikku/core/errors';
|
|
3
|
+
import { pikkuSessionlessFunc } from '../../../.pikku/pikku-types.gen.js';
|
|
4
|
+
import { resolveApiContext } from '../lib/config.js';
|
|
5
|
+
import { getFabricRPC } from '../lib/http.js';
|
|
6
|
+
export const FabricLLMKeyInput = z.object({
|
|
7
|
+
shell: z.boolean().optional(),
|
|
8
|
+
env: z.boolean().optional(),
|
|
9
|
+
json: z.boolean().optional(),
|
|
10
|
+
});
|
|
11
|
+
export const FabricLLMKeyOutput = z.object({
|
|
12
|
+
proxyUrl: z.string(),
|
|
13
|
+
apiKey: z.string(),
|
|
14
|
+
format: z.enum(['text', 'env', 'shell', 'json']),
|
|
15
|
+
});
|
|
16
|
+
function shellEscape(value) {
|
|
17
|
+
return `'${value.replace(/'/g, `'\\''`)}'`;
|
|
18
|
+
}
|
|
19
|
+
export const FabricLLMKey = pikkuSessionlessFunc({
|
|
20
|
+
description: 'Mint or reuse the current user Fabric AI gateway key.',
|
|
21
|
+
input: FabricLLMKeyInput,
|
|
22
|
+
output: FabricLLMKeyOutput,
|
|
23
|
+
func: async (_services, { shell, env, json }) => {
|
|
24
|
+
const selectedFormats = [shell, env, json].filter(Boolean).length;
|
|
25
|
+
if (selectedFormats > 1) {
|
|
26
|
+
throw new BadRequestError('Choose only one of `--shell`, `--env`, or `--json`.');
|
|
27
|
+
}
|
|
28
|
+
const ctx = await resolveApiContext();
|
|
29
|
+
if (!ctx.token) {
|
|
30
|
+
throw new UnauthorizedError('Not logged in. Run `pikku fabric login` first.');
|
|
31
|
+
}
|
|
32
|
+
const rpc = getFabricRPC({ apiUrl: ctx.apiUrl, token: ctx.token });
|
|
33
|
+
const result = (await rpc.invoke('getDeveloperLiteLLMKey', {}));
|
|
34
|
+
const format = shell
|
|
35
|
+
? 'shell'
|
|
36
|
+
: env
|
|
37
|
+
? 'env'
|
|
38
|
+
: json
|
|
39
|
+
? 'json'
|
|
40
|
+
: 'text';
|
|
41
|
+
return {
|
|
42
|
+
proxyUrl: result.proxyUrl,
|
|
43
|
+
apiKey: result.apiKey,
|
|
44
|
+
format,
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
export const renderLLMKey = (_services, data) => {
|
|
49
|
+
if (data.format === 'json') {
|
|
50
|
+
console.log(JSON.stringify({
|
|
51
|
+
proxyUrl: data.proxyUrl,
|
|
52
|
+
apiKey: data.apiKey,
|
|
53
|
+
openaiBaseUrl: data.proxyUrl,
|
|
54
|
+
openaiApiKey: data.apiKey,
|
|
55
|
+
litellmProxyUrl: data.proxyUrl,
|
|
56
|
+
litellmApiKey: data.apiKey,
|
|
57
|
+
}, null, 2));
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const envLines = [
|
|
61
|
+
`OPENAI_BASE_URL=${data.proxyUrl}`,
|
|
62
|
+
`OPENAI_API_KEY=${data.apiKey}`,
|
|
63
|
+
`LITELLM_PROXY_URL=${data.proxyUrl}`,
|
|
64
|
+
`LITELLM_API_KEY=${data.apiKey}`,
|
|
65
|
+
];
|
|
66
|
+
if (data.format === 'shell') {
|
|
67
|
+
console.log(envLines
|
|
68
|
+
.map((line) => {
|
|
69
|
+
const [key, ...rest] = line.split('=');
|
|
70
|
+
return `export ${key}=${shellEscape(rest.join('='))}`;
|
|
71
|
+
})
|
|
72
|
+
.join('\n'));
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
console.log(envLines.join('\n'));
|
|
76
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const FabricLoginInput: z.ZodObject<{
|
|
3
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
4
|
+
token: z.ZodOptional<z.ZodString>;
|
|
5
|
+
apiUrl: z.ZodOptional<z.ZodString>;
|
|
6
|
+
consoleUrl: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export declare const FabricLoginOutput: z.ZodObject<{
|
|
9
|
+
ok: z.ZodBoolean;
|
|
10
|
+
apiUrl: z.ZodString;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
/**
|
|
13
|
+
* Device-authorization-style CLI login. Server mints a short code, user types
|
|
14
|
+
* it on the console's /cli-auth page (logging in via Auth.js if not already
|
|
15
|
+
* signed in). CLI polls until the row flips to 'confirmed' and grabs the
|
|
16
|
+
* one-shot bearer.
|
|
17
|
+
*/
|
|
18
|
+
export declare const FabricLogin: import("../../../.pikku/pikku-types.gen.js").PikkuFunctionConfig<{
|
|
19
|
+
apiKey?: string | undefined;
|
|
20
|
+
token?: string | undefined;
|
|
21
|
+
apiUrl?: string | undefined;
|
|
22
|
+
consoleUrl?: string | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
ok: boolean;
|
|
25
|
+
apiUrl: string;
|
|
26
|
+
}, "rpc" | "session", import("../../../.pikku/pikku-types.gen.js").PikkuFunctionSessionless<{
|
|
27
|
+
apiKey?: string | undefined;
|
|
28
|
+
token?: string | undefined;
|
|
29
|
+
apiUrl?: string | undefined;
|
|
30
|
+
consoleUrl?: string | undefined;
|
|
31
|
+
}, {
|
|
32
|
+
ok: boolean;
|
|
33
|
+
apiUrl: string;
|
|
34
|
+
}, "rpc" | "session", import("../../../types/application-types.js").Services> | import("../../../.pikku/pikku-types.gen.js").PikkuFunction<{
|
|
35
|
+
apiKey?: string | undefined;
|
|
36
|
+
token?: string | undefined;
|
|
37
|
+
apiUrl?: string | undefined;
|
|
38
|
+
consoleUrl?: string | undefined;
|
|
39
|
+
}, {
|
|
40
|
+
ok: boolean;
|
|
41
|
+
apiUrl: string;
|
|
42
|
+
}, "rpc" | "session", import("../../../types/application-types.js").Services>, undefined, undefined>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { pikkuSessionlessFunc } from '../../../.pikku/pikku-types.gen.js';
|
|
3
|
+
import { readAuthFile, writeAuthFile, resolveApiContext, } from '../lib/config.js';
|
|
4
|
+
import { getFabricRPC } from '../lib/http.js';
|
|
5
|
+
import { deriveConsoleUrl } from '../lib/console-url.js';
|
|
6
|
+
export const FabricLoginInput = z.object({
|
|
7
|
+
apiKey: z.string().optional(),
|
|
8
|
+
token: z.string().optional(),
|
|
9
|
+
apiUrl: z.string().optional(),
|
|
10
|
+
consoleUrl: z.string().optional(),
|
|
11
|
+
});
|
|
12
|
+
export const FabricLoginOutput = z.object({
|
|
13
|
+
ok: z.boolean(),
|
|
14
|
+
apiUrl: z.string(),
|
|
15
|
+
});
|
|
16
|
+
const POLL_INTERVAL_MS = 2000;
|
|
17
|
+
const POLL_TIMEOUT_MS = 5 * 60 * 1000;
|
|
18
|
+
/**
|
|
19
|
+
* Device-authorization-style CLI login. Server mints a short code, user types
|
|
20
|
+
* it on the console's /cli-auth page (logging in via Auth.js if not already
|
|
21
|
+
* signed in). CLI polls until the row flips to 'confirmed' and grabs the
|
|
22
|
+
* one-shot bearer.
|
|
23
|
+
*/
|
|
24
|
+
export const FabricLogin = pikkuSessionlessFunc({
|
|
25
|
+
description: 'Authenticate the CLI against fabric-api via a one-time code.',
|
|
26
|
+
input: FabricLoginInput,
|
|
27
|
+
output: FabricLoginOutput,
|
|
28
|
+
func: async (_services, { apiKey, token, apiUrl: apiUrlOverride, consoleUrl: consoleUrlOverride }) => {
|
|
29
|
+
const ctx = await resolveApiContext({ apiUrlOverride });
|
|
30
|
+
const apiUrl = ctx.apiUrl;
|
|
31
|
+
// Static-token fast paths — useful for CI and "I already have a token".
|
|
32
|
+
const explicit = apiKey ?? token;
|
|
33
|
+
if (explicit) {
|
|
34
|
+
const auth = await readAuthFile();
|
|
35
|
+
auth.tokens[apiUrl] = explicit;
|
|
36
|
+
await writeAuthFile(auth);
|
|
37
|
+
console.log(`[fabric] saved token for ${apiUrl}`);
|
|
38
|
+
return { ok: true, apiUrl };
|
|
39
|
+
}
|
|
40
|
+
const consoleUrl = (consoleUrlOverride ?? deriveConsoleUrl(apiUrl)).replace(/\/$/, '');
|
|
41
|
+
const rpc = getFabricRPC({ apiUrl, token: null });
|
|
42
|
+
const { code, expiresAt } = await rpc.invoke('requestCliAuth');
|
|
43
|
+
console.log('');
|
|
44
|
+
console.log(' Enter this code at:');
|
|
45
|
+
console.log(` ${consoleUrl}/cli-auth`);
|
|
46
|
+
console.log('');
|
|
47
|
+
console.log(` Code: ${code}`);
|
|
48
|
+
console.log(` (expires ${new Date(expiresAt).toLocaleTimeString()})`);
|
|
49
|
+
console.log('');
|
|
50
|
+
console.log(' Waiting for confirmation…');
|
|
51
|
+
const deadline = Date.now() + POLL_TIMEOUT_MS;
|
|
52
|
+
while (Date.now() < deadline) {
|
|
53
|
+
await new Promise((r) => setTimeout(r, POLL_INTERVAL_MS));
|
|
54
|
+
const result = await rpc.invoke('pollCliAuth', { code });
|
|
55
|
+
if (result.status === 'expired') {
|
|
56
|
+
throw new Error('Code expired before confirmation. Run `pikku fabric login` again.');
|
|
57
|
+
}
|
|
58
|
+
if (result.status === 'confirmed' && result.token) {
|
|
59
|
+
const auth = await readAuthFile();
|
|
60
|
+
auth.tokens[apiUrl] = result.token;
|
|
61
|
+
await writeAuthFile(auth);
|
|
62
|
+
console.log(`[fabric] logged in; token saved for ${apiUrl}`);
|
|
63
|
+
return { ok: true, apiUrl };
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
throw new Error('Login timed out.');
|
|
67
|
+
},
|
|
68
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const FabricLogsInput: z.ZodObject<{
|
|
3
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
4
|
+
deployment: z.ZodOptional<z.ZodString>;
|
|
5
|
+
level: z.ZodOptional<z.ZodString>;
|
|
6
|
+
since: z.ZodOptional<z.ZodString>;
|
|
7
|
+
follow: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
+
json: z.ZodOptional<z.ZodBoolean>;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export declare const FabricLogsOutput: z.ZodObject<{
|
|
11
|
+
count: z.ZodNumber;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
export declare const FabricLogs: import("../../../.pikku/pikku-types.gen.js").PikkuFunctionConfig<{
|
|
14
|
+
branch?: string | undefined;
|
|
15
|
+
deployment?: string | undefined;
|
|
16
|
+
level?: string | undefined;
|
|
17
|
+
since?: string | undefined;
|
|
18
|
+
follow?: boolean | undefined;
|
|
19
|
+
json?: boolean | undefined;
|
|
20
|
+
}, {
|
|
21
|
+
count: number;
|
|
22
|
+
}, "rpc" | "session", import("../../../.pikku/pikku-types.gen.js").PikkuFunctionSessionless<{
|
|
23
|
+
branch?: string | undefined;
|
|
24
|
+
deployment?: string | undefined;
|
|
25
|
+
level?: string | undefined;
|
|
26
|
+
since?: string | undefined;
|
|
27
|
+
follow?: boolean | undefined;
|
|
28
|
+
json?: boolean | undefined;
|
|
29
|
+
}, {
|
|
30
|
+
count: number;
|
|
31
|
+
}, "rpc" | "session", import("../../../types/application-types.js").Services> | import("../../../.pikku/pikku-types.gen.js").PikkuFunction<{
|
|
32
|
+
branch?: string | undefined;
|
|
33
|
+
deployment?: string | undefined;
|
|
34
|
+
level?: string | undefined;
|
|
35
|
+
since?: string | undefined;
|
|
36
|
+
follow?: boolean | undefined;
|
|
37
|
+
json?: boolean | undefined;
|
|
38
|
+
}, {
|
|
39
|
+
count: number;
|
|
40
|
+
}, "rpc" | "session", import("../../../types/application-types.js").Services>, undefined, undefined>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { pikkuSessionlessFunc } from '../../../.pikku/pikku-types.gen.js';
|
|
3
|
+
import { resolveApiContext } from '../lib/config.js';
|
|
4
|
+
import { getFabricRPC } from '../lib/http.js';
|
|
5
|
+
export const FabricLogsInput = z.object({
|
|
6
|
+
branch: z.string().optional(),
|
|
7
|
+
deployment: z.string().optional(),
|
|
8
|
+
level: z.string().optional(),
|
|
9
|
+
since: z.string().optional(),
|
|
10
|
+
follow: z.boolean().optional(),
|
|
11
|
+
json: z.boolean().optional(),
|
|
12
|
+
});
|
|
13
|
+
export const FabricLogsOutput = z.object({ count: z.number() });
|
|
14
|
+
function formatLog(log) {
|
|
15
|
+
return `${log.timestamp} ${log.level.toUpperCase().padEnd(5)} ${log.functionName} — ${log.message}`;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Stable identity for an entry across polls. OpenObserve doesn't expose a
|
|
19
|
+
* monotonic id we can dedup on, so we hash the few fields that should be
|
|
20
|
+
* unique together (timestamp + traceId + message). Keeps memory bounded —
|
|
21
|
+
* the `seen` set is pruned to the last cursorWindow entries between polls.
|
|
22
|
+
*/
|
|
23
|
+
function logKey(log) {
|
|
24
|
+
return `${log.timestamp}|${log.traceId ?? ''}|${log.functionName}|${log.message}`;
|
|
25
|
+
}
|
|
26
|
+
export const FabricLogs = pikkuSessionlessFunc({
|
|
27
|
+
description: 'Stream or fetch logs for a stage / deployment via fabric-api.',
|
|
28
|
+
input: FabricLogsInput,
|
|
29
|
+
output: FabricLogsOutput,
|
|
30
|
+
func: async (_services, { branch, level, json, follow }) => {
|
|
31
|
+
const ctx = await resolveApiContext();
|
|
32
|
+
if (!ctx.token)
|
|
33
|
+
throw new Error('Not logged in. Run `pikku fabric login` first.');
|
|
34
|
+
if (!ctx.projectId)
|
|
35
|
+
throw new Error('No fabric project linked. Run `pikku fabric link` first.');
|
|
36
|
+
if (!branch)
|
|
37
|
+
throw new Error('Specify --branch <branch-name>.');
|
|
38
|
+
const seen = new Set();
|
|
39
|
+
const cursorWindow = 5_000;
|
|
40
|
+
const rpc = getFabricRPC({ apiUrl: ctx.apiUrl, token: ctx.token });
|
|
41
|
+
const projectId = ctx.projectId;
|
|
42
|
+
const fetchAndPrintNew = async () => {
|
|
43
|
+
const res = await rpc.invoke('getFabricLogsByStageKind', {
|
|
44
|
+
projectId,
|
|
45
|
+
branch,
|
|
46
|
+
level: level ?? undefined,
|
|
47
|
+
});
|
|
48
|
+
let printed = 0;
|
|
49
|
+
for (const log of res.logs) {
|
|
50
|
+
const k = logKey(log);
|
|
51
|
+
if (seen.has(k))
|
|
52
|
+
continue;
|
|
53
|
+
seen.add(k);
|
|
54
|
+
if (json) {
|
|
55
|
+
console.log(JSON.stringify(log));
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
console.log(formatLog(log));
|
|
59
|
+
}
|
|
60
|
+
printed += 1;
|
|
61
|
+
}
|
|
62
|
+
// Bound memory — keep the most recent cursorWindow keys.
|
|
63
|
+
if (seen.size > cursorWindow) {
|
|
64
|
+
const trimmed = Array.from(seen).slice(seen.size - cursorWindow);
|
|
65
|
+
seen.clear();
|
|
66
|
+
for (const k of trimmed)
|
|
67
|
+
seen.add(k);
|
|
68
|
+
}
|
|
69
|
+
return printed;
|
|
70
|
+
};
|
|
71
|
+
let count = await fetchAndPrintNew();
|
|
72
|
+
if (follow) {
|
|
73
|
+
// Server-side SSE for logs is a planned upgrade — OpenObserve doesn't
|
|
74
|
+
// push natively without extra plumbing. For now we poll at 2s and
|
|
75
|
+
// dedup against entries already printed, which gives `tail -f`-ish
|
|
76
|
+
// behaviour without re-printing the full window each tick.
|
|
77
|
+
while (true) {
|
|
78
|
+
await new Promise((r) => setTimeout(r, 2000));
|
|
79
|
+
count += await fetchAndPrintNew();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return { count };
|
|
83
|
+
},
|
|
84
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const FabricMetricsInput: z.ZodObject<{
|
|
3
|
+
branch: z.ZodString;
|
|
4
|
+
hours: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
function: z.ZodOptional<z.ZodString>;
|
|
6
|
+
json: z.ZodOptional<z.ZodBoolean>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export declare const FabricMetricsOutput: z.ZodObject<{
|
|
9
|
+
count: z.ZodNumber;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export declare const FabricMetrics: import("../../../.pikku/pikku-types.gen.js").PikkuFunctionConfig<{
|
|
12
|
+
branch: string;
|
|
13
|
+
hours?: number | undefined;
|
|
14
|
+
function?: string | undefined;
|
|
15
|
+
json?: boolean | undefined;
|
|
16
|
+
}, {
|
|
17
|
+
count: number;
|
|
18
|
+
}, "rpc" | "session", import("../../../.pikku/pikku-types.gen.js").PikkuFunctionSessionless<{
|
|
19
|
+
branch: string;
|
|
20
|
+
hours?: number | undefined;
|
|
21
|
+
function?: string | undefined;
|
|
22
|
+
json?: boolean | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
count: number;
|
|
25
|
+
}, "rpc" | "session", import("../../../types/application-types.js").Services> | import("../../../.pikku/pikku-types.gen.js").PikkuFunction<{
|
|
26
|
+
branch: string;
|
|
27
|
+
hours?: number | undefined;
|
|
28
|
+
function?: string | undefined;
|
|
29
|
+
json?: boolean | undefined;
|
|
30
|
+
}, {
|
|
31
|
+
count: number;
|
|
32
|
+
}, "rpc" | "session", import("../../../types/application-types.js").Services>, undefined, undefined>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { pikkuSessionlessFunc } from '../../../.pikku/pikku-types.gen.js';
|
|
3
|
+
import { resolveApiContext } from '../lib/config.js';
|
|
4
|
+
import { getFabricRPC } from '../lib/http.js';
|
|
5
|
+
export const FabricMetricsInput = z.object({
|
|
6
|
+
branch: z.string(),
|
|
7
|
+
hours: z.number().optional(),
|
|
8
|
+
function: z.string().optional(),
|
|
9
|
+
json: z.boolean().optional(),
|
|
10
|
+
});
|
|
11
|
+
export const FabricMetricsOutput = z.object({ count: z.number() });
|
|
12
|
+
function formatRow(row) {
|
|
13
|
+
const errRate = row.requests > 0 ? ((row.errors / row.requests) * 100).toFixed(1) : '0.0';
|
|
14
|
+
return `${row.timestamp} reqs=${String(row.requests).padStart(5)} err=${String(row.errors).padStart(4)} (${errRate}%) avg=${row.avgDuration.toFixed(0)}ms min=${row.minDuration.toFixed(0)}ms max=${row.maxDuration.toFixed(0)}ms`;
|
|
15
|
+
}
|
|
16
|
+
export const FabricMetrics = pikkuSessionlessFunc({
|
|
17
|
+
description: 'Fetch aggregated request metrics for a stage via fabric-api.',
|
|
18
|
+
input: FabricMetricsInput,
|
|
19
|
+
output: FabricMetricsOutput,
|
|
20
|
+
func: async (_services, { branch, hours, function: functionName, json }) => {
|
|
21
|
+
const ctx = await resolveApiContext();
|
|
22
|
+
if (!ctx.token)
|
|
23
|
+
throw new Error('Not logged in. Run `pikku fabric login` first.');
|
|
24
|
+
if (!ctx.projectId)
|
|
25
|
+
throw new Error('No fabric project linked. Run `pikku fabric link` first.');
|
|
26
|
+
const rpc = getFabricRPC({ apiUrl: ctx.apiUrl, token: ctx.token });
|
|
27
|
+
const res = await rpc.invoke('getProjectMetricsByStageKind', {
|
|
28
|
+
projectId: ctx.projectId,
|
|
29
|
+
branch,
|
|
30
|
+
hours,
|
|
31
|
+
functionName,
|
|
32
|
+
});
|
|
33
|
+
if (json) {
|
|
34
|
+
const wireTypes = Object.fromEntries((res.wireTypes ?? []).map((r) => [
|
|
35
|
+
r.wireType,
|
|
36
|
+
r.requests,
|
|
37
|
+
]));
|
|
38
|
+
console.log(JSON.stringify({ branch, metrics: res.metrics, wireTypes }, null, 2));
|
|
39
|
+
}
|
|
40
|
+
else if (res.metrics.length === 0) {
|
|
41
|
+
console.log(`[fabric] no metrics for ${branch} in the last ${hours ?? 24}h`);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
for (const row of res.metrics)
|
|
45
|
+
console.log(formatRow(row));
|
|
46
|
+
}
|
|
47
|
+
return { count: res.metrics.length };
|
|
48
|
+
},
|
|
49
|
+
});
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const FabricRollbackInput: z.ZodObject<{
|
|
3
|
+
branch: z.ZodString;
|
|
4
|
+
target: z.ZodOptional<z.ZodString>;
|
|
5
|
+
list: z.ZodOptional<z.ZodBoolean>;
|
|
6
|
+
dryRun: z.ZodOptional<z.ZodBoolean>;
|
|
7
|
+
yes: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export declare const FabricRollbackOutput: z.ZodObject<{
|
|
10
|
+
deploymentId: z.ZodOptional<z.ZodString>;
|
|
11
|
+
rolledBackToDeploymentId: z.ZodOptional<z.ZodString>;
|
|
12
|
+
candidates: z.ZodArray<z.ZodObject<{
|
|
13
|
+
deploymentId: z.ZodString;
|
|
14
|
+
gitSha: z.ZodNullable<z.ZodString>;
|
|
15
|
+
artifactHash: z.ZodNullable<z.ZodString>;
|
|
16
|
+
deployedAt: z.ZodNullable<z.ZodString>;
|
|
17
|
+
versionMajor: z.ZodNumber;
|
|
18
|
+
versionMinor: z.ZodNumber;
|
|
19
|
+
versionPatch: z.ZodNumber;
|
|
20
|
+
}, z.core.$strip>>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export declare const FabricRollback: import("../../../.pikku/pikku-types.gen.js").PikkuFunctionConfig<{
|
|
23
|
+
branch: string;
|
|
24
|
+
target?: string | undefined;
|
|
25
|
+
list?: boolean | undefined;
|
|
26
|
+
dryRun?: boolean | undefined;
|
|
27
|
+
yes?: boolean | undefined;
|
|
28
|
+
}, {
|
|
29
|
+
candidates: {
|
|
30
|
+
deploymentId: string;
|
|
31
|
+
gitSha: string | null;
|
|
32
|
+
artifactHash: string | null;
|
|
33
|
+
deployedAt: string | null;
|
|
34
|
+
versionMajor: number;
|
|
35
|
+
versionMinor: number;
|
|
36
|
+
versionPatch: number;
|
|
37
|
+
}[];
|
|
38
|
+
deploymentId?: string | undefined;
|
|
39
|
+
rolledBackToDeploymentId?: string | undefined;
|
|
40
|
+
}, "rpc" | "session", import("../../../.pikku/pikku-types.gen.js").PikkuFunctionSessionless<{
|
|
41
|
+
branch: string;
|
|
42
|
+
target?: string | undefined;
|
|
43
|
+
list?: boolean | undefined;
|
|
44
|
+
dryRun?: boolean | undefined;
|
|
45
|
+
yes?: boolean | undefined;
|
|
46
|
+
}, {
|
|
47
|
+
candidates: {
|
|
48
|
+
deploymentId: string;
|
|
49
|
+
gitSha: string | null;
|
|
50
|
+
artifactHash: string | null;
|
|
51
|
+
deployedAt: string | null;
|
|
52
|
+
versionMajor: number;
|
|
53
|
+
versionMinor: number;
|
|
54
|
+
versionPatch: number;
|
|
55
|
+
}[];
|
|
56
|
+
deploymentId?: string | undefined;
|
|
57
|
+
rolledBackToDeploymentId?: string | undefined;
|
|
58
|
+
}, "rpc" | "session", import("../../../types/application-types.js").Services> | import("../../../.pikku/pikku-types.gen.js").PikkuFunction<{
|
|
59
|
+
branch: string;
|
|
60
|
+
target?: string | undefined;
|
|
61
|
+
list?: boolean | undefined;
|
|
62
|
+
dryRun?: boolean | undefined;
|
|
63
|
+
yes?: boolean | undefined;
|
|
64
|
+
}, {
|
|
65
|
+
candidates: {
|
|
66
|
+
deploymentId: string;
|
|
67
|
+
gitSha: string | null;
|
|
68
|
+
artifactHash: string | null;
|
|
69
|
+
deployedAt: string | null;
|
|
70
|
+
versionMajor: number;
|
|
71
|
+
versionMinor: number;
|
|
72
|
+
versionPatch: number;
|
|
73
|
+
}[];
|
|
74
|
+
deploymentId?: string | undefined;
|
|
75
|
+
rolledBackToDeploymentId?: string | undefined;
|
|
76
|
+
}, "rpc" | "session", import("../../../types/application-types.js").Services>, undefined, undefined>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { pikkuSessionlessFunc } from '../../../.pikku/pikku-types.gen.js';
|
|
3
|
+
import { resolveApiContext } from '../lib/config.js';
|
|
4
|
+
import { getFabricRPC } from '../lib/http.js';
|
|
5
|
+
export const FabricRollbackInput = z.object({
|
|
6
|
+
branch: z.string(),
|
|
7
|
+
target: z.string().optional(),
|
|
8
|
+
list: z.boolean().optional(),
|
|
9
|
+
dryRun: z.boolean().optional(),
|
|
10
|
+
yes: z.boolean().optional(),
|
|
11
|
+
});
|
|
12
|
+
export const FabricRollbackOutput = z.object({
|
|
13
|
+
deploymentId: z.string().optional(),
|
|
14
|
+
rolledBackToDeploymentId: z.string().optional(),
|
|
15
|
+
candidates: z.array(z.object({
|
|
16
|
+
deploymentId: z.string(),
|
|
17
|
+
gitSha: z.string().nullable(),
|
|
18
|
+
artifactHash: z.string().nullable(),
|
|
19
|
+
deployedAt: z.string().nullable(),
|
|
20
|
+
versionMajor: z.number(),
|
|
21
|
+
versionMinor: z.number(),
|
|
22
|
+
versionPatch: z.number(),
|
|
23
|
+
})),
|
|
24
|
+
});
|
|
25
|
+
export const FabricRollback = pikkuSessionlessFunc({
|
|
26
|
+
description: 'Roll live production back to a previous deployment artifact, gated by schema-snapshot compatibility.',
|
|
27
|
+
input: FabricRollbackInput,
|
|
28
|
+
output: FabricRollbackOutput,
|
|
29
|
+
func: async (_services, { target, list, dryRun }) => {
|
|
30
|
+
const ctx = await resolveApiContext();
|
|
31
|
+
if (!ctx.token)
|
|
32
|
+
throw new Error('Not logged in. Run `pikku fabric login` first.');
|
|
33
|
+
if (!ctx.projectId)
|
|
34
|
+
throw new Error('No fabric project linked. Run `pikku fabric link` first.');
|
|
35
|
+
const rpc = getFabricRPC({ apiUrl: ctx.apiUrl, token: ctx.token });
|
|
36
|
+
// --list (or no target) → just show candidates.
|
|
37
|
+
if (list || !target) {
|
|
38
|
+
const result = await rpc.invoke('rollbackDeployment', {
|
|
39
|
+
projectId: ctx.projectId,
|
|
40
|
+
});
|
|
41
|
+
if (result.candidates.length === 0) {
|
|
42
|
+
console.log('[fabric] no rollback candidates available');
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
console.log('[fabric] rollback candidates (newest first):');
|
|
46
|
+
for (const c of result.candidates) {
|
|
47
|
+
const v = `v${c.versionMajor}.${c.versionMinor}.${c.versionPatch}`;
|
|
48
|
+
const sha = c.gitSha ? c.gitSha.slice(0, 8) : '—';
|
|
49
|
+
console.log(` ${c.deploymentId} ${v} sha=${sha} ${c.deployedAt ?? '—'}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return { candidates: result.candidates };
|
|
53
|
+
}
|
|
54
|
+
if (dryRun) {
|
|
55
|
+
console.log(`[fabric] dry-run: would roll back live → ${target}`);
|
|
56
|
+
return { candidates: [] };
|
|
57
|
+
}
|
|
58
|
+
const result = await rpc.invoke('rollbackDeployment', {
|
|
59
|
+
projectId: ctx.projectId,
|
|
60
|
+
target,
|
|
61
|
+
});
|
|
62
|
+
console.log(`[fabric] rollback queued: new live=${result.deploymentId} (artifact from ${result.rolledBackToDeploymentId})`);
|
|
63
|
+
return {
|
|
64
|
+
deploymentId: result.deploymentId,
|
|
65
|
+
rolledBackToDeploymentId: result.rolledBackToDeploymentId,
|
|
66
|
+
candidates: result.candidates,
|
|
67
|
+
};
|
|
68
|
+
},
|
|
69
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const FabricSecretsListInput: z.ZodObject<{
|
|
3
|
+
branch: z.ZodString;
|
|
4
|
+
json: z.ZodOptional<z.ZodBoolean>;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export declare const FabricSecretsListOutput: z.ZodObject<{
|
|
7
|
+
names: z.ZodArray<z.ZodString>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export declare const FabricSecretsList: import("../../../.pikku/pikku-types.gen.js").PikkuFunctionConfig<{
|
|
10
|
+
branch: string;
|
|
11
|
+
json?: boolean | undefined;
|
|
12
|
+
}, {
|
|
13
|
+
names: string[];
|
|
14
|
+
}, "rpc" | "session", import("../../../.pikku/pikku-types.gen.js").PikkuFunctionSessionless<{
|
|
15
|
+
branch: string;
|
|
16
|
+
json?: boolean | undefined;
|
|
17
|
+
}, {
|
|
18
|
+
names: string[];
|
|
19
|
+
}, "rpc" | "session", import("../../../types/application-types.js").Services> | import("../../../.pikku/pikku-types.gen.js").PikkuFunction<{
|
|
20
|
+
branch: string;
|
|
21
|
+
json?: boolean | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
names: string[];
|
|
24
|
+
}, "rpc" | "session", import("../../../types/application-types.js").Services>, undefined, undefined>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { pikkuSessionlessFunc } from '../../../.pikku/pikku-types.gen.js';
|
|
3
|
+
import { resolveApiContext } from '../lib/config.js';
|
|
4
|
+
import { getFabricRPC } from '../lib/http.js';
|
|
5
|
+
export const FabricSecretsListInput = z.object({
|
|
6
|
+
branch: z.string(),
|
|
7
|
+
json: z.boolean().optional(),
|
|
8
|
+
});
|
|
9
|
+
export const FabricSecretsListOutput = z.object({ names: z.array(z.string()) });
|
|
10
|
+
export const FabricSecretsList = pikkuSessionlessFunc({
|
|
11
|
+
description: 'List secret names visible to a stage (values never leave the server).',
|
|
12
|
+
input: FabricSecretsListInput,
|
|
13
|
+
output: FabricSecretsListOutput,
|
|
14
|
+
func: async (_services, { branch, json }) => {
|
|
15
|
+
const ctx = await resolveApiContext();
|
|
16
|
+
if (!ctx.token)
|
|
17
|
+
throw new Error('Not logged in. Run `pikku fabric login` first.');
|
|
18
|
+
if (!ctx.projectId)
|
|
19
|
+
throw new Error('No fabric project linked. Run `pikku fabric link` first.');
|
|
20
|
+
const rpc = getFabricRPC({ apiUrl: ctx.apiUrl, token: ctx.token });
|
|
21
|
+
const result = await rpc.invoke('listStageSecrets', {
|
|
22
|
+
projectId: ctx.projectId,
|
|
23
|
+
branch,
|
|
24
|
+
});
|
|
25
|
+
if (json) {
|
|
26
|
+
console.log(JSON.stringify({ branch, names: result.names }, null, 2));
|
|
27
|
+
}
|
|
28
|
+
else if (result.names.length === 0) {
|
|
29
|
+
console.log(`[fabric] no secrets set on ${branch}`);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
for (const name of result.names)
|
|
33
|
+
console.log(name);
|
|
34
|
+
}
|
|
35
|
+
return result;
|
|
36
|
+
},
|
|
37
|
+
});
|