@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,337 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates the client-side `realtime.gen.ts`.
|
|
3
|
+
*
|
|
4
|
+
* `PikkuRealtime` mirrors the `PikkuRPC` pattern: it wraps the project's
|
|
5
|
+
* generated `PikkuFetch` (so server URL + auth come from one place) and
|
|
6
|
+
* exposes:
|
|
7
|
+
*
|
|
8
|
+
* - `subscribe(topic, handler)` / `unsubscribe(topic)` — typed pub/sub
|
|
9
|
+
* over the websocket at `/events`. Multi-topic per connection.
|
|
10
|
+
* - `subscribeToTopic(topic, handler)` — same shape but via SSE
|
|
11
|
+
* (one EventSource per topic, auto-cleanup on close).
|
|
12
|
+
* - `subscribeToSSE(path, handler)` — generic SSE subscribe for any
|
|
13
|
+
* `sse: true` route (workflow streams, agent streams, etc.).
|
|
14
|
+
* - `connectToChannel(channelRoute, protocols?)` — open a raw WebSocket
|
|
15
|
+
* for any wireChannel route, ready to wrap in
|
|
16
|
+
* `PikkuWebSocket<'channel-name'>` for typed subscribe/send.
|
|
17
|
+
*
|
|
18
|
+
* Topic types come from `EventHubTopics` if the user supplies an import
|
|
19
|
+
* via `clientFiles.realtimeEventHubTopicsImport`. Otherwise topics fall
|
|
20
|
+
* back to `Record<string, unknown>`.
|
|
21
|
+
*/
|
|
22
|
+
export const serializeRealtimeClient = (topicsImport, fetchImportPath) => {
|
|
23
|
+
const topicsTypeImport = topicsImport
|
|
24
|
+
? buildImportLine(topicsImport)
|
|
25
|
+
: `// No EventHubTopics import configured. Set clientFiles.realtimeEventHubTopicsImport
|
|
26
|
+
// in pikku.config.json (e.g. \"../types/eventhub-topics.js#EventHubTopics\")
|
|
27
|
+
// to get fully-typed subscribe/unsubscribe.
|
|
28
|
+
type EventHubTopics = Record<string, unknown>`;
|
|
29
|
+
return `/**
|
|
30
|
+
* Generated by @pikku/cli — do not edit.
|
|
31
|
+
* Regenerate with \`pikku all\` (or \`pikku realtime\`).
|
|
32
|
+
*/
|
|
33
|
+
import { CorePikkuFetch } from '@pikku/fetch'
|
|
34
|
+
import { PikkuFetch } from '${fetchImportPath}'
|
|
35
|
+
${topicsTypeImport}
|
|
36
|
+
|
|
37
|
+
type Handler<T> = (data: T) => void
|
|
38
|
+
|
|
39
|
+
interface RealtimeOptions {
|
|
40
|
+
/** Auto-reconnect with backoff (default: true) */
|
|
41
|
+
reconnect?: boolean
|
|
42
|
+
/** Initial reconnect delay in ms (default: 500) */
|
|
43
|
+
reconnectDelayMs?: number
|
|
44
|
+
/** Cap on reconnect delay (default: 10_000) */
|
|
45
|
+
reconnectMaxDelayMs?: number
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Realtime client. Mirrors the PikkuRPC pattern: wraps a PikkuFetch so
|
|
50
|
+
* the server URL + auth are configured once and shared across transports.
|
|
51
|
+
*
|
|
52
|
+
* \`\`\`ts
|
|
53
|
+
* const pikku = createPikku(PikkuFetch, PikkuRPC, { serverUrl: 'http://localhost:3000' })
|
|
54
|
+
* const realtime = new PikkuRealtime()
|
|
55
|
+
* realtime.setPikkuFetch(pikku.fetch)
|
|
56
|
+
*
|
|
57
|
+
* const off = realtime.subscribe('todo-created', ({ todo }) => { ... })
|
|
58
|
+
* // later: off(); realtime.close()
|
|
59
|
+
* \`\`\`
|
|
60
|
+
*/
|
|
61
|
+
export class PikkuRealtime {
|
|
62
|
+
/** The underlying HTTP client used to derive server URL + auth */
|
|
63
|
+
pikkuFetch = new PikkuFetch()
|
|
64
|
+
|
|
65
|
+
private ws: WebSocket | null = null
|
|
66
|
+
private readonly handlers = new Map<string, Set<Handler<any>>>()
|
|
67
|
+
private readonly options: Required<RealtimeOptions>
|
|
68
|
+
private reconnectAttempt = 0
|
|
69
|
+
private closed = false
|
|
70
|
+
private connectScheduled = false
|
|
71
|
+
|
|
72
|
+
constructor(options: RealtimeOptions = {}) {
|
|
73
|
+
this.options = {
|
|
74
|
+
reconnect: options.reconnect ?? true,
|
|
75
|
+
reconnectDelayMs: options.reconnectDelayMs ?? 500,
|
|
76
|
+
reconnectMaxDelayMs: options.reconnectMaxDelayMs ?? 10_000,
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Use a shared PikkuFetch instance (typically from \`createPikku(...)\`).
|
|
82
|
+
* The realtime client picks up its server URL + auth from this fetch,
|
|
83
|
+
* so you only configure connection details in one place.
|
|
84
|
+
*/
|
|
85
|
+
setPikkuFetch(pikkuFetch: PikkuFetch): void {
|
|
86
|
+
this.pikkuFetch = pikkuFetch
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** Sets the base server URL on the underlying PikkuFetch. */
|
|
90
|
+
setServerUrl(serverUrl: string): void {
|
|
91
|
+
this.pikkuFetch.setServerUrl(serverUrl)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** Sets the JWT for auth on transports that send headers (SSE). */
|
|
95
|
+
setAuthorizationJWT(jwt: string | null): void {
|
|
96
|
+
this.pikkuFetch.setAuthorizationJWT(jwt)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** Sets the API key for auth on transports that send headers (SSE). */
|
|
100
|
+
setAPIKey(apiKey: string | null): void {
|
|
101
|
+
this.pikkuFetch.setAPIKey(apiKey)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Subscribe to a typed event topic over the websocket. Returns an
|
|
106
|
+
* \`unsubscribe\` function. Auto-reconnects re-send subscriptions.
|
|
107
|
+
*/
|
|
108
|
+
subscribe<K extends keyof EventHubTopics & string>(
|
|
109
|
+
topic: K,
|
|
110
|
+
handler: Handler<EventHubTopics[K]>
|
|
111
|
+
): () => void {
|
|
112
|
+
const set = this.handlers.get(topic) ?? new Set<Handler<any>>()
|
|
113
|
+
if (set.size === 0) {
|
|
114
|
+
this.send({ action: 'subscribe', topic })
|
|
115
|
+
}
|
|
116
|
+
set.add(handler)
|
|
117
|
+
this.handlers.set(topic, set)
|
|
118
|
+
this.ensureConnected()
|
|
119
|
+
return () => this.unsubscribe(topic, handler)
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
unsubscribe<K extends keyof EventHubTopics & string>(
|
|
123
|
+
topic: K,
|
|
124
|
+
handler?: Handler<EventHubTopics[K]>
|
|
125
|
+
): void {
|
|
126
|
+
const set = this.handlers.get(topic)
|
|
127
|
+
if (!set) return
|
|
128
|
+
if (handler) set.delete(handler)
|
|
129
|
+
else set.clear()
|
|
130
|
+
if (set.size === 0) {
|
|
131
|
+
this.handlers.delete(topic)
|
|
132
|
+
this.send({ action: 'unsubscribe', topic })
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* SSE alternative for a single topic stream. One EventSource per topic;
|
|
138
|
+
* close the returned object to unsubscribe (the server cleans up
|
|
139
|
+
* automatically on disconnect).
|
|
140
|
+
*/
|
|
141
|
+
subscribeToTopic<K extends keyof EventHubTopics & string>(
|
|
142
|
+
topic: K,
|
|
143
|
+
handler: Handler<EventHubTopics[K]>
|
|
144
|
+
): { close: () => void } {
|
|
145
|
+
return this.subscribeToSSE<EventHubTopics[K]>(
|
|
146
|
+
\`/events/\${encodeURIComponent(topic)}\`,
|
|
147
|
+
handler
|
|
148
|
+
)
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Generic SSE subscribe. Use for any \`sse: true\` HTTP route in your
|
|
153
|
+
* project. Caller supplies the path (with any params/query) — the base
|
|
154
|
+
* URL comes from the wrapped PikkuFetch.
|
|
155
|
+
*
|
|
156
|
+
* \`\`\`ts
|
|
157
|
+
* const sub = realtime.subscribeToSSE<{ progress: number }>(
|
|
158
|
+
* \`/workflow-run/\${runId}/stream\`,
|
|
159
|
+
* (e) => setProgress(e.progress)
|
|
160
|
+
* )
|
|
161
|
+
* \`\`\`
|
|
162
|
+
*/
|
|
163
|
+
subscribeToSSE<T = unknown>(
|
|
164
|
+
path: string,
|
|
165
|
+
handler: Handler<T>,
|
|
166
|
+
onError?: (err: unknown) => void
|
|
167
|
+
): { close: () => void } {
|
|
168
|
+
const controller = new AbortController()
|
|
169
|
+
const closed = { value: false }
|
|
170
|
+
|
|
171
|
+
const run = async () => {
|
|
172
|
+
try {
|
|
173
|
+
const response = await (this.pikkuFetch as CorePikkuFetch).fetch(
|
|
174
|
+
path,
|
|
175
|
+
'GET',
|
|
176
|
+
null,
|
|
177
|
+
{
|
|
178
|
+
headers: { Accept: 'text/event-stream' },
|
|
179
|
+
signal: controller.signal,
|
|
180
|
+
}
|
|
181
|
+
)
|
|
182
|
+
if (!response.ok || !response.body) {
|
|
183
|
+
throw new Error(\`SSE request failed: \${response.status}\`)
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const reader = response.body
|
|
187
|
+
.pipeThrough(new TextDecoderStream())
|
|
188
|
+
.getReader()
|
|
189
|
+
let buffer = ''
|
|
190
|
+
|
|
191
|
+
while (!closed.value) {
|
|
192
|
+
const { done, value } = await reader.read()
|
|
193
|
+
if (done) break
|
|
194
|
+
buffer += value
|
|
195
|
+
|
|
196
|
+
let sep: number
|
|
197
|
+
while ((sep = buffer.indexOf('\\n\\n')) !== -1) {
|
|
198
|
+
const raw = buffer.slice(0, sep)
|
|
199
|
+
buffer = buffer.slice(sep + 2)
|
|
200
|
+
|
|
201
|
+
const dataLines = raw
|
|
202
|
+
.split('\\n')
|
|
203
|
+
.filter((l) => l.startsWith('data:'))
|
|
204
|
+
.map((l) => l.slice(5).trimStart())
|
|
205
|
+
if (dataLines.length === 0) continue
|
|
206
|
+
const data = dataLines.join('\\n')
|
|
207
|
+
|
|
208
|
+
try {
|
|
209
|
+
handler(JSON.parse(data) as T)
|
|
210
|
+
} catch {
|
|
211
|
+
// Ignore malformed events
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
} catch (err) {
|
|
216
|
+
if (closed.value) return
|
|
217
|
+
if (onError) onError(err)
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
void run()
|
|
222
|
+
|
|
223
|
+
return {
|
|
224
|
+
close: () => {
|
|
225
|
+
closed.value = true
|
|
226
|
+
controller.abort()
|
|
227
|
+
},
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Open a raw WebSocket against one of the project's wireChannel routes.
|
|
233
|
+
* Wrap the returned socket in \`PikkuWebSocket<'channel-name'>\` from the
|
|
234
|
+
* generated websocket client for typed subscribe/send.
|
|
235
|
+
*/
|
|
236
|
+
connectToChannel(
|
|
237
|
+
channelPath: string,
|
|
238
|
+
protocols?: string | string[]
|
|
239
|
+
): WebSocket {
|
|
240
|
+
return new WebSocket(this.resolveWsUrl(channelPath), protocols)
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/** Disconnect the events websocket and clear all subscriptions. */
|
|
244
|
+
close(): void {
|
|
245
|
+
this.closed = true
|
|
246
|
+
this.handlers.clear()
|
|
247
|
+
this.ws?.close()
|
|
248
|
+
this.ws = null
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
private ensureConnected() {
|
|
252
|
+
if (this.ws || this.connectScheduled || this.closed) return
|
|
253
|
+
this.connect()
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
private connect() {
|
|
257
|
+
if (this.closed) return
|
|
258
|
+
this.connectScheduled = false
|
|
259
|
+
const url = this.resolveWsUrl('/events')
|
|
260
|
+
this.ws = new WebSocket(url)
|
|
261
|
+
this.ws.onopen = () => {
|
|
262
|
+
this.reconnectAttempt = 0
|
|
263
|
+
for (const topic of this.handlers.keys()) {
|
|
264
|
+
this.send({ action: 'subscribe', topic })
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
this.ws.onmessage = (e: MessageEvent) => {
|
|
268
|
+
let payload: unknown
|
|
269
|
+
try {
|
|
270
|
+
payload =
|
|
271
|
+
typeof e.data === 'string' ? JSON.parse(e.data) : (e.data as unknown)
|
|
272
|
+
} catch {
|
|
273
|
+
return
|
|
274
|
+
}
|
|
275
|
+
if (
|
|
276
|
+
payload &&
|
|
277
|
+
typeof payload === 'object' &&
|
|
278
|
+
'topic' in (payload as any) &&
|
|
279
|
+
typeof (payload as any).topic === 'string'
|
|
280
|
+
) {
|
|
281
|
+
const { topic, data } = payload as { topic: string; data: unknown }
|
|
282
|
+
const set = this.handlers.get(topic)
|
|
283
|
+
if (set) for (const h of set) h(data)
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
this.ws.onclose = () => {
|
|
287
|
+
this.ws = null
|
|
288
|
+
if (this.closed || !this.options.reconnect) return
|
|
289
|
+
const delay = Math.min(
|
|
290
|
+
this.options.reconnectDelayMs * 2 ** this.reconnectAttempt,
|
|
291
|
+
this.options.reconnectMaxDelayMs
|
|
292
|
+
)
|
|
293
|
+
this.reconnectAttempt += 1
|
|
294
|
+
this.connectScheduled = true
|
|
295
|
+
setTimeout(() => this.connect(), delay)
|
|
296
|
+
}
|
|
297
|
+
this.ws.onerror = () => {
|
|
298
|
+
this.ws?.close()
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
private send(message: { action: 'subscribe' | 'unsubscribe'; topic: string }) {
|
|
303
|
+
if (this.ws && this.ws.readyState === WebSocket.OPEN) {
|
|
304
|
+
this.ws.send(JSON.stringify(message))
|
|
305
|
+
}
|
|
306
|
+
// If not open, onopen replays current handler keys.
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
private resolveHttpUrl(path: string): string {
|
|
310
|
+
const base = this.pikkuFetch.getServerUrl()
|
|
311
|
+
if (!base) {
|
|
312
|
+
throw new Error(
|
|
313
|
+
'PikkuRealtime: no server URL — call setServerUrl(...) or setPikkuFetch(...) first.'
|
|
314
|
+
)
|
|
315
|
+
}
|
|
316
|
+
return \`\${base}\${path.startsWith('/') ? path : \`/\${path}\`}\`
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
private resolveWsUrl(path: string): string {
|
|
320
|
+
const httpUrl = this.resolveHttpUrl(path)
|
|
321
|
+
return httpUrl.replace(/^http/i, 'ws')
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
`;
|
|
325
|
+
};
|
|
326
|
+
function buildImportLine(spec) {
|
|
327
|
+
const hashIdx = spec.lastIndexOf('#');
|
|
328
|
+
if (hashIdx === -1) {
|
|
329
|
+
return `import type { EventHubTopics } from '${spec}'`;
|
|
330
|
+
}
|
|
331
|
+
const path = spec.slice(0, hashIdx);
|
|
332
|
+
const typeName = spec.slice(hashIdx + 1);
|
|
333
|
+
if (typeName === 'EventHubTopics') {
|
|
334
|
+
return `import type { EventHubTopics } from '${path}'`;
|
|
335
|
+
}
|
|
336
|
+
return `import type { ${typeName} as EventHubTopics } from '${path}'`;
|
|
337
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const pikkuPublicRPC: import("#pikku").PikkuFunctionConfig<void, boolean, "
|
|
1
|
+
export declare const pikkuPublicRPC: import("#pikku").PikkuFunctionConfig<void, boolean, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, boolean, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunction<void, boolean, "rpc" | "session", import("#pikku").Services>, undefined, undefined>;
|
|
@@ -4,7 +4,11 @@ import { writeFileInDir } from '../../../utils/file-writer.js';
|
|
|
4
4
|
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
|
|
5
5
|
import { serializePublicRPC } from './serialize-public-rpc.js';
|
|
6
6
|
export const pikkuPublicRPC = pikkuSessionlessFunc({
|
|
7
|
-
func: async ({ logger, config }) => {
|
|
7
|
+
func: async ({ logger, config, variables }) => {
|
|
8
|
+
const deployCodegenFlag = await variables.get('PIKKU_DEPLOY_CODEGEN');
|
|
9
|
+
if (deployCodegenFlag === '1') {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
8
12
|
if (config.scaffold?.rpc) {
|
|
9
13
|
const pathToPikkuTypes = getFileImportRelativePath(config.publicRpcFile, config.typesDeclarationFile, config.packageMappings);
|
|
10
14
|
await writeFileInDir(logger, config.publicRpcFile, serializePublicRPC(pathToPikkuTypes, config.scaffold.rpc === 'auth', config.globalHTTPPrefix || ''));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const pikkuReactQuery: import("#pikku").PikkuFunctionConfig<void, void, "
|
|
1
|
+
export declare const pikkuReactQuery: import("#pikku").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunction<void, void, "rpc" | "session", import("#pikku").Services>, undefined, undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const pikkuRemoteRPC: import("#pikku").PikkuFunctionConfig<void, boolean, "
|
|
1
|
+
export declare const pikkuRemoteRPC: import("#pikku").PikkuFunctionConfig<void, boolean, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, boolean, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunction<void, boolean, "rpc" | "session", import("#pikku").Services>, undefined, undefined>;
|
|
@@ -4,7 +4,11 @@ import { writeFileInDir } from '../../../utils/file-writer.js';
|
|
|
4
4
|
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
|
|
5
5
|
import { serializeRemoteRPC } from './serialize-remote-rpc.js';
|
|
6
6
|
export const pikkuRemoteRPC = pikkuSessionlessFunc({
|
|
7
|
-
func: async ({ logger, config }) => {
|
|
7
|
+
func: async ({ logger, config, variables }) => {
|
|
8
|
+
const deployCodegenFlag = await variables.get('PIKKU_DEPLOY_CODEGEN');
|
|
9
|
+
if (deployCodegenFlag === '1') {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
8
12
|
if (config.remoteRpcWorkersFile) {
|
|
9
13
|
const pathToPikkuTypes = getFileImportRelativePath(config.remoteRpcWorkersFile, config.typesDeclarationFile, config.packageMappings);
|
|
10
14
|
await writeFileInDir(logger, config.remoteRpcWorkersFile, serializeRemoteRPC(pathToPikkuTypes));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const pikkuRPCClient: import("#pikku").PikkuFunctionConfig<void, void, "
|
|
1
|
+
export declare const pikkuRPCClient: import("#pikku").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunction<void, void, "rpc" | "session", import("#pikku").Services>, undefined, undefined>;
|
|
@@ -16,7 +16,9 @@ export const pikkuRPCClient = pikkuSessionlessFunc({
|
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
18
|
const rpcMapDeclarationPath = getFileImportRelativePath(rpcWiringsFile, rpcMapDeclarationFile, packageMappings);
|
|
19
|
-
const content = [
|
|
19
|
+
const content = [
|
|
20
|
+
serializeRPCWrapper(rpcMapDeclarationPath, config.globalHTTPPrefix || ''),
|
|
21
|
+
];
|
|
20
22
|
await writeFileInDir(logger, rpcWiringsFile, content.join('\n'));
|
|
21
23
|
},
|
|
22
24
|
middleware: [
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const pikkuRPCInternalMap: import("#pikku").PikkuFunctionConfig<void, void, "
|
|
2
|
-
export declare const pikkuRPCExposedMap: import("#pikku").PikkuFunctionConfig<void, void, "
|
|
1
|
+
export declare const pikkuRPCInternalMap: import("#pikku").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunction<void, void, "rpc" | "session", import("#pikku").Services>, undefined, undefined>;
|
|
2
|
+
export declare const pikkuRPCExposedMap: import("#pikku").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunction<void, void, "rpc" | "session", import("#pikku").Services>, undefined, undefined>;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export declare
|
|
1
|
+
export declare function filterInternalRPCMeta(internalMeta: Record<string, string>, functionsMeta: Record<string, unknown>): Record<string, string>;
|
|
2
|
+
export declare const pikkuRPC: import("#pikku").PikkuFunctionConfig<void, boolean, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, boolean, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunction<void, boolean, "rpc" | "session", import("#pikku").Services>, undefined, undefined>;
|
|
@@ -2,17 +2,23 @@ import { pikkuSessionlessFunc } from '#pikku';
|
|
|
2
2
|
import { writeFileInDir } from '../../../utils/file-writer.js';
|
|
3
3
|
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
|
|
4
4
|
import { getFileImportRelativePath } from '../../../utils/file-import-path.js';
|
|
5
|
+
export function filterInternalRPCMeta(internalMeta, functionsMeta) {
|
|
6
|
+
const filteredInternalMeta = {};
|
|
7
|
+
for (const [key, value] of Object.entries(internalMeta)) {
|
|
8
|
+
if (key in functionsMeta || value in functionsMeta) {
|
|
9
|
+
filteredInternalMeta[key] = value;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return filteredInternalMeta;
|
|
13
|
+
}
|
|
5
14
|
export const pikkuRPC = pikkuSessionlessFunc({
|
|
6
15
|
func: async ({ logger, config, getInspectorState }) => {
|
|
7
16
|
const { rpc, functions } = await getInspectorState();
|
|
8
17
|
const { rpcInternalWiringMetaFile, rpcInternalWiringMetaJsonFile, packageMappings, schema, } = config;
|
|
9
|
-
//
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
filteredInternalMeta[key] = value;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
18
|
+
// Keep direct function ids and unversioned aliases whose target function
|
|
19
|
+
// survived filtering. Without the second check, aliases like `listCards`
|
|
20
|
+
// get dropped even though `listCards@v2` still exists.
|
|
21
|
+
const filteredInternalMeta = filterInternalRPCMeta(rpc.internalMeta, functions.meta);
|
|
16
22
|
if (Object.keys(filteredInternalMeta).length > 0) {
|
|
17
23
|
await writeFileInDir(logger, rpcInternalWiringMetaJsonFile, JSON.stringify(filteredInternalMeta, null, 2));
|
|
18
24
|
const jsonImportPath = getFileImportRelativePath(rpcInternalWiringMetaFile, rpcInternalWiringMetaJsonFile, packageMappings);
|
|
@@ -98,7 +98,7 @@ export const usePikkuInfiniteQuery = <Name extends PaginatedKeys>(
|
|
|
98
98
|
const rpc = usePikkuRPC<{ invoke: RPCInvoke }>()
|
|
99
99
|
return useInfiniteQuery({
|
|
100
100
|
queryKey: [name, data] as const,
|
|
101
|
-
queryFn: ({ pageParam }: { pageParam: string | undefined }) => rpc.invoke(name, { ...data, nextCursor: pageParam } as FlattenedRPCMap[Name]['input']),
|
|
101
|
+
queryFn: ({ pageParam }: { pageParam: string | undefined }) => rpc.invoke(name, { ...data, nextCursor: pageParam } as unknown as FlattenedRPCMap[Name]['input']),
|
|
102
102
|
initialPageParam: undefined as string | undefined,
|
|
103
103
|
getNextPageParam: (lastPage: FlattenedRPCMap[Name]['output']) => (lastPage as { nextCursor?: string }).nextCursor ?? undefined,
|
|
104
104
|
...options,
|
|
@@ -6,19 +6,25 @@ export const serializeRemoteRPC = (pathToPikkuTypes) => {
|
|
|
6
6
|
* Auto-generated remote internal RPC queue worker and HTTP endpoint
|
|
7
7
|
* Do not edit manually - regenerate with 'npx pikku'
|
|
8
8
|
*/
|
|
9
|
-
import { pikkuSessionlessFunc, wireHTTP } from '${pathToPikkuTypes}'
|
|
9
|
+
import { pikkuSessionlessFunc, wireHTTP, wireQueueWorker } from '${pathToPikkuTypes}'
|
|
10
10
|
import { pikkuRemoteAuthMiddleware } from '@pikku/core/middleware'
|
|
11
11
|
|
|
12
12
|
export const remoteRPCHandler = pikkuSessionlessFunc<
|
|
13
13
|
{ rpcName: string, data?: unknown },
|
|
14
14
|
unknown
|
|
15
15
|
>({
|
|
16
|
+
tags: ['pikku'],
|
|
16
17
|
func: async (_services, { rpcName, data }, { rpc }) => {
|
|
17
18
|
return await (rpc.invoke as any)(rpcName, data)
|
|
18
19
|
},
|
|
19
20
|
remote: true,
|
|
20
21
|
})
|
|
21
22
|
|
|
23
|
+
wireQueueWorker({
|
|
24
|
+
name: 'pikku-remote-internal-rpc',
|
|
25
|
+
func: remoteRPCHandler,
|
|
26
|
+
})
|
|
27
|
+
|
|
22
28
|
wireHTTP({
|
|
23
29
|
route: '/remote/rpc/:rpcName',
|
|
24
30
|
method: 'post',
|
|
@@ -41,13 +41,13 @@ ${addonImports}
|
|
|
41
41
|
${mergedRPCMap}
|
|
42
42
|
|
|
43
43
|
export type RPCInvoke = <Name extends keyof FlattenedRPCMap>(
|
|
44
|
-
...args: FlattenedRPCMap[Name]['input'] extends
|
|
44
|
+
...args: IsVoidishInput<FlattenedRPCMap[Name]['input']> extends true
|
|
45
45
|
? [name: Name]
|
|
46
46
|
: [name: Name, data: FlattenedRPCMap[Name]['input']]
|
|
47
47
|
) => Promise<FlattenedRPCMap[Name]['output']>
|
|
48
48
|
|
|
49
49
|
export type RPCRemote = <Name extends keyof FlattenedRPCMap>(
|
|
50
|
-
...args: FlattenedRPCMap[Name]['input'] extends
|
|
50
|
+
...args: IsVoidishInput<FlattenedRPCMap[Name]['input']> extends true
|
|
51
51
|
? [name: Name]
|
|
52
52
|
: [name: Name, data: FlattenedRPCMap[Name]['input']]
|
|
53
53
|
) => Promise<FlattenedRPCMap[Name]['output']>
|
|
@@ -117,6 +117,13 @@ function generateMergedRPCMap(wireAddonDeclarations) {
|
|
|
117
117
|
return `
|
|
118
118
|
// No addon packages, use RPCMap directly
|
|
119
119
|
export type FlattenedRPCMap = RPCMap
|
|
120
|
+
|
|
121
|
+
type IsAny<T> = 0 extends (1 & T) ? true : false
|
|
122
|
+
type IsVoidishInput<T> = IsAny<T> extends true
|
|
123
|
+
? false
|
|
124
|
+
: [T] extends [void | null | undefined]
|
|
125
|
+
? true
|
|
126
|
+
: false
|
|
120
127
|
`;
|
|
121
128
|
}
|
|
122
129
|
// TypeScript utility to flatten namespaced RPC maps
|
|
@@ -131,6 +138,13 @@ export type FlattenedRPCMap =
|
|
|
131
138
|
RPCMap${Array.from(wireAddonDeclarations.keys())
|
|
132
139
|
.map((namespace) => ` & PrefixKeys<${toPascalCase(namespace)}RPCMap, '${namespace}'>`)
|
|
133
140
|
.join('')}
|
|
141
|
+
|
|
142
|
+
type IsAny<T> = 0 extends (1 & T) ? true : false
|
|
143
|
+
type IsVoidishInput<T> = IsAny<T> extends true
|
|
144
|
+
? false
|
|
145
|
+
: [T] extends [void | null | undefined]
|
|
146
|
+
? true
|
|
147
|
+
: false
|
|
134
148
|
`;
|
|
135
149
|
return utilityTypes;
|
|
136
150
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const pikkuSchedulerTypes: import("#pikku").PikkuFunctionConfig<void, void, "
|
|
1
|
+
export declare const pikkuSchedulerTypes: import("#pikku").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunction<void, void, "rpc" | "session", import("#pikku").Services>, undefined, undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const pikkuScheduler: import("#pikku").PikkuFunctionConfig<void, boolean | undefined, "
|
|
1
|
+
export declare const pikkuScheduler: import("#pikku").PikkuFunctionConfig<void, boolean | undefined, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, boolean | undefined, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunction<void, boolean | undefined, "rpc" | "session", import("#pikku").Services>, undefined, undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const pikkuSecrets: import("#pikku").PikkuFunctionConfig<void, void, "
|
|
1
|
+
export declare const pikkuSecrets: import("#pikku").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunction<void, void, "rpc" | "session", import("#pikku").Services>, undefined, undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const pikkuTriggerTypes: import("#pikku").PikkuFunctionConfig<void, void, "
|
|
1
|
+
export declare const pikkuTriggerTypes: import("#pikku").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunction<void, void, "rpc" | "session", import("#pikku").Services>, undefined, undefined>;
|
|
@@ -6,7 +6,7 @@ import { serializeTriggerTypes } from './serialize-trigger-types.js';
|
|
|
6
6
|
export const pikkuTriggerTypes = pikkuSessionlessFunc({
|
|
7
7
|
func: async ({ logger, config, getInspectorState }) => {
|
|
8
8
|
const { triggersTypesFile, packageMappings } = config;
|
|
9
|
-
const visitState = await getInspectorState();
|
|
9
|
+
const visitState = await getInspectorState(false, true);
|
|
10
10
|
const { singletonServicesType } = visitState.filesAndMethods;
|
|
11
11
|
if (!singletonServicesType) {
|
|
12
12
|
throw new Error('SingletonServices type not found');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const pikkuTrigger: import("#pikku").PikkuFunctionConfig<void, boolean | undefined, "
|
|
1
|
+
export declare const pikkuTrigger: import("#pikku").PikkuFunctionConfig<void, boolean | undefined, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, boolean | undefined, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunction<void, boolean | undefined, "rpc" | "session", import("#pikku").Services>, undefined, undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const pikkuVariables: import("#pikku").PikkuFunctionConfig<void, void, "
|
|
1
|
+
export declare const pikkuVariables: import("#pikku").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunction<void, void, "rpc" | "session", import("#pikku").Services>, undefined, undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const pikkuWorkflowRoutes: import("#pikku").PikkuFunctionConfig<void, boolean, "
|
|
1
|
+
export declare const pikkuWorkflowRoutes: import("#pikku").PikkuFunctionConfig<void, boolean, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, boolean, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunction<void, boolean, "rpc" | "session", import("#pikku").Services>, undefined, undefined>;
|
|
@@ -5,7 +5,7 @@ import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-
|
|
|
5
5
|
import { serializeWorkflowRoutes } from './serialize-workflow-routes.js';
|
|
6
6
|
export const pikkuWorkflowRoutes = pikkuSessionlessFunc({
|
|
7
7
|
func: async ({ logger, config }) => {
|
|
8
|
-
if (config.workflowRoutesFile) {
|
|
8
|
+
if (config.scaffold?.workflow && config.workflowRoutesFile) {
|
|
9
9
|
const pathToPikkuTypes = getFileImportRelativePath(config.workflowRoutesFile, config.typesDeclarationFile, config.packageMappings);
|
|
10
10
|
await writeFileInDir(logger, config.workflowRoutesFile, serializeWorkflowRoutes(pathToPikkuTypes, config.scaffold?.workflow === 'auth'));
|
|
11
11
|
return true;
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
type WorkflowCommandInput = {
|
|
2
|
+
bootstrap?: boolean;
|
|
3
|
+
};
|
|
4
|
+
export declare const pikkuWorkflow: import("#pikku").PikkuFunctionConfig<WorkflowCommandInput, boolean | undefined, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<WorkflowCommandInput, boolean | undefined, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunction<WorkflowCommandInput, boolean | undefined, "rpc" | "session", import("#pikku").Services>, undefined, undefined>;
|
|
5
|
+
export {};
|