@pikku/cli 0.11.2 → 0.11.3
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/.pikku/channel/pikku-channel-types.gen.ts +63 -6
- package/.pikku/channel/pikku-channels-map.gen.d.ts +4 -4
- package/.pikku/channel/pikku-channels-meta.gen.ts +4 -2
- package/.pikku/channel/pikku-channels.gen.ts +1 -1
- package/.pikku/cli/pikku-cli-channel.ts +1 -1
- package/.pikku/cli/pikku-cli-client.gen.ts +1 -1
- package/.pikku/cli/pikku-cli-types.gen.ts +1 -1
- package/.pikku/cli/pikku-cli-wirings-meta.gen.json +2 -1
- package/.pikku/cli/pikku-cli-wirings-meta.gen.ts +2 -2
- package/.pikku/cli/pikku-cli-wirings.gen.ts +1 -1
- package/.pikku/cli/pikku-cli.gen.ts +1 -1
- package/.pikku/forge/pikku-forge-types.gen.ts +83 -0
- package/.pikku/function/pikku-function-types.gen.ts +181 -35
- package/.pikku/function/pikku-functions-meta-verbose.gen.json +1030 -0
- package/.pikku/function/pikku-functions-meta.gen.json +88 -420
- package/.pikku/function/pikku-functions-meta.gen.ts +2 -2
- package/.pikku/http/pikku-http-types.gen.ts +19 -3
- package/.pikku/http/pikku-http-wirings-map.gen.d.ts +4 -4
- package/.pikku/http/pikku-http-wirings-meta.gen.json +9 -0
- package/.pikku/http/pikku-http-wirings-meta.gen.ts +4 -10
- package/.pikku/http/pikku-http-wirings.gen.ts +1 -1
- package/.pikku/mcp/pikku-mcp-types.gen.ts +69 -17
- package/.pikku/mcp/pikku-mcp-wirings-meta.gen.ts +4 -4
- package/.pikku/mcp/pikku-mcp-wirings.gen.ts +1 -1
- package/.pikku/pikku-bootstrap.gen.ts +7 -9
- package/.pikku/pikku-services.gen.ts +3 -2
- package/.pikku/pikku-types.gen.ts +4 -1
- package/.pikku/pikku-websocket.gen.ts +1 -1
- package/.pikku/queue/pikku-queue-types.gen.ts +1 -1
- package/.pikku/queue/pikku-queue-workers-wirings-map.gen.d.ts +4 -4
- package/.pikku/queue/pikku-queue-workers-wirings-meta.gen.ts +2 -2
- package/.pikku/queue/pikku-queue-workers-wirings.gen.ts +1 -1
- package/.pikku/rpc/pikku-remote-rpc-workers.gen.ts +4 -1
- package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +12 -7
- package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +15 -9
- package/.pikku/scheduler/pikku-scheduler-types.gen.ts +1 -1
- package/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.ts +2 -2
- package/.pikku/scheduler/pikku-schedulers-wirings.gen.ts +1 -1
- package/.pikku/schemas/register.gen.ts +9 -1
- package/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuCLIOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuChannelsOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuForgeNodesOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/PikkuFunctionsOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuHTTPOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuMCPOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuMiddlewareOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuPackageOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/PikkuPermissionsOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuPublicRPCOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuQueueOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuRPCOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuRemoteRPCOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuSchedulerOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuSchemasOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuWorkflowOutput.schema.json +1 -1
- package/.pikku/services/config.gen.json +11 -6
- package/.pikku/services/getInspectorState.gen.json +2 -2
- package/.pikku/services/jwt.gen.json +2 -2
- package/.pikku/services/logger.gen.json +2 -2
- package/.pikku/services/queueService.gen.json +2 -2
- package/.pikku/services/schedulerService.gen.json +2 -2
- package/.pikku/services/schema.gen.json +2 -2
- package/.pikku/services/secrets.gen.json +13 -0
- package/.pikku/services/variables.gen.json +2 -2
- package/.pikku/services/workflowService.gen.json +6 -6
- package/.pikku/workflow/pikku-workflow-map.gen.d.ts +2 -36
- package/.pikku/workflow/pikku-workflow-types.gen.ts +297 -45
- package/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +5 -4
- package/.pikku/workflow/pikku-workflow-wirings.gen.ts +1 -6
- package/CHANGELOG.md +23 -1
- package/cli.schema.json +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +47 -5
- package/dist/.pikku/channel/pikku-channel-types.gen.js +3 -13
- package/dist/.pikku/channel/pikku-channels-meta.gen.js +3 -2
- package/dist/.pikku/channel/pikku-channels.gen.d.ts +1 -1
- package/dist/.pikku/channel/pikku-channels.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-channel.js +1 -1
- package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-client.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-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 +2 -2
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +2 -1
- 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/forge/pikku-forge-types.gen.d.ts +72 -0
- package/dist/.pikku/forge/pikku-forge-types.gen.js +55 -0
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +123 -31
- package/dist/.pikku/function/pikku-function-types.gen.js +37 -51
- package/dist/.pikku/function/pikku-functions-meta.gen.js +2 -2
- package/dist/.pikku/function/pikku-functions-meta.gen.json +88 -420
- package/dist/.pikku/http/pikku-http-types.gen.d.ts +18 -3
- package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
- package/dist/.pikku/http/pikku-http-wirings-meta.gen.js +3 -10
- package/dist/.pikku/http/pikku-http-wirings-meta.gen.json +9 -0
- 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 +54 -14
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js +7 -31
- package/dist/.pikku/mcp/pikku-mcp-wirings-meta.gen.js +4 -4
- package/dist/.pikku/mcp/pikku-mcp-wirings.gen.d.ts +1 -1
- package/dist/.pikku/mcp/pikku-mcp-wirings.gen.js +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.d.ts +7 -9
- package/dist/.pikku/pikku-bootstrap.gen.js +7 -9
- package/dist/.pikku/pikku-services.gen.d.ts +3 -2
- package/dist/.pikku/pikku-services.gen.js +1 -0
- package/dist/.pikku/pikku-types.gen.d.ts +2 -1
- package/dist/.pikku/pikku-types.gen.js +3 -1
- package/dist/.pikku/pikku-websocket.gen.d.ts +1 -1
- package/dist/.pikku/pikku-websocket.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.js +2 -2
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
- package/dist/.pikku/rpc/pikku-remote-rpc-workers.gen.d.ts +4 -1
- package/dist/.pikku/rpc/pikku-remote-rpc-workers.gen.js +4 -1
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
- package/dist/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.js +2 -2
- package/dist/.pikku/scheduler/pikku-schedulers-wirings.gen.d.ts +1 -1
- package/dist/.pikku/scheduler/pikku-schedulers-wirings.gen.js +1 -1
- package/dist/.pikku/schemas/register.gen.js +5 -1
- package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuCLIOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuChannelsOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuForgeNodesOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuFunctionsOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuHTTPOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuMCPOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuMiddlewareOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuPackageOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuPermissionsOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuPublicRPCOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuQueueOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuRPCOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuRemoteRPCOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuSchedulerOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuSchemasOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuWorkflowOutput.schema.json +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +207 -37
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +104 -28
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +3 -3
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +2 -6
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +2 -6
- package/dist/src/functions/commands/all.js +117 -79
- package/dist/src/functions/commands/bootstrap.js +2 -9
- package/dist/src/functions/runtimes/nextjs/pikku-command-nextjs.js +0 -1
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.js +49 -35
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.js +49 -35
- package/dist/src/functions/wirings/channels/pikku-channels.js +1 -1
- package/dist/src/functions/wirings/channels/pikku-command-channels.js +18 -2
- package/dist/src/functions/wirings/channels/serialize-channel-types.js +62 -5
- package/dist/src/functions/wirings/channels/serialize-typed-channel-map.js +1 -2
- package/dist/src/functions/wirings/cli/pikku-command-cli.js +10 -2
- package/dist/src/functions/wirings/forge/pikku-command-forge-nodes.d.ts +1 -0
- package/dist/src/functions/wirings/forge/pikku-command-forge-nodes.js +90 -0
- package/dist/src/functions/wirings/forge/pikku-command-forge-types.d.ts +1 -0
- package/dist/src/functions/wirings/forge/pikku-command-forge-types.js +26 -0
- package/dist/src/functions/wirings/forge/serialize-forge-types.d.ts +4 -0
- package/dist/src/functions/wirings/forge/serialize-forge-types.js +90 -0
- package/dist/src/functions/wirings/functions/pikku-command-function-types-split.js +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-function-types.js +7 -2
- package/dist/src/functions/wirings/functions/pikku-command-functions.js +33 -18
- package/dist/src/functions/wirings/functions/pikku-command-services.js +1 -1
- package/dist/src/functions/wirings/functions/pikku-function-types.js +2 -2
- package/dist/src/functions/wirings/functions/schemas.d.ts +1 -1
- package/dist/src/functions/wirings/functions/schemas.js +5 -4
- package/dist/src/functions/wirings/functions/serialize-function-imports.d.ts +3 -1
- package/dist/src/functions/wirings/functions/serialize-function-imports.js +7 -3
- package/dist/src/functions/wirings/functions/serialize-function-types.d.ts +1 -1
- package/dist/src/functions/wirings/functions/serialize-function-types.js +181 -34
- package/dist/src/functions/wirings/functions/serialize-pikku-types-hub.d.ts +1 -1
- package/dist/src/functions/wirings/functions/serialize-pikku-types-hub.js +19 -21
- package/dist/src/functions/wirings/http/openapi-spec-generator.js +1 -1
- package/dist/src/functions/wirings/http/pikku-command-http-routes.js +18 -2
- package/dist/src/functions/wirings/http/pikku-command-openapi.js +2 -2
- package/dist/src/functions/wirings/http/pikku-http-routes.js +1 -1
- package/dist/src/functions/wirings/http/serialize-http-types.js +18 -2
- package/dist/src/functions/wirings/http/serialize-typed-http-map.js +33 -8
- package/dist/src/functions/wirings/mcp/pikku-command-mcp.js +15 -6
- package/dist/src/functions/wirings/mcp/serialize-mcp-json.js +3 -2
- package/dist/src/functions/wirings/mcp/serialize-mcp-types.js +68 -16
- package/dist/src/functions/wirings/middleware/pikku-command-middleware.js +5 -2
- package/dist/src/functions/wirings/package/pikku-command-package.d.ts +1 -0
- package/dist/src/functions/wirings/package/pikku-command-package.js +58 -0
- package/dist/src/functions/wirings/package/serialize-package.d.ts +5 -0
- package/dist/src/functions/wirings/package/serialize-package.js +32 -0
- package/dist/src/functions/wirings/queue/pikku-command-queue.js +10 -2
- package/dist/src/functions/wirings/queue/pikku-queue.js +1 -9
- package/dist/src/functions/wirings/queue/serialize-queue-map.js +20 -3
- package/dist/src/functions/wirings/queue/serialize-queue-meta.js +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc-map.js +4 -4
- package/dist/src/functions/wirings/rpc/pikku-command-rpc.js +1 -1
- package/dist/src/functions/wirings/rpc/serialize-remote-rpc.js +3 -0
- package/dist/src/functions/wirings/rpc/serialize-rpc-wrapper.js +1 -1
- package/dist/src/functions/wirings/rpc/serialize-typed-rpc-map.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/serialize-typed-rpc-map.js +54 -8
- package/dist/src/functions/wirings/scheduler/pikku-command-scheduler.js +10 -1
- package/dist/src/functions/wirings/scheduler/serialize-scheduler-meta.js +1 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.js +56 -18
- package/dist/src/functions/wirings/workflow/serialize-workflow-map.d.ts +3 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-map.js +30 -32
- package/dist/src/functions/wirings/workflow/serialize-workflow-meta.d.ts +1 -3
- package/dist/src/functions/wirings/workflow/serialize-workflow-meta.js +43 -18
- package/dist/src/functions/wirings/workflow/serialize-workflow-registration.d.ts +7 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-registration.js +53 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-types.d.ts +3 -1
- package/dist/src/functions/wirings/workflow/serialize-workflow-types.js +299 -45
- package/dist/src/functions/wirings/workflow/serialize-workflow-workers.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/serialize-workflow-workers.js +14 -27
- package/dist/src/services.js +4 -1
- package/dist/src/utils/command-summary.d.ts +2 -0
- package/dist/src/utils/command-summary.js +2 -0
- package/dist/src/utils/custom-types-generator.js +13 -15
- package/dist/src/utils/generate-bootstrap-file.js +1 -1
- package/dist/src/utils/pikku-cli-config.js +37 -9
- package/dist/src/utils/schema-generator.d.ts +4 -3
- package/dist/src/utils/schema-generator.js +135 -15
- package/dist/src/utils/strip-verbose-meta.d.ts +43 -0
- package/dist/src/utils/strip-verbose-meta.js +210 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -4
- package/src/functions/commands/all.ts +144 -97
- package/src/functions/commands/bootstrap.ts +2 -10
- package/src/functions/runtimes/nextjs/pikku-command-nextjs.ts +0 -1
- package/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.ts +49 -35
- package/src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.ts +49 -35
- package/src/functions/wirings/channels/pikku-channels.ts +1 -1
- package/src/functions/wirings/channels/pikku-command-channels.ts +46 -3
- package/src/functions/wirings/channels/serialize-channel-types.ts +62 -5
- package/src/functions/wirings/channels/serialize-typed-channel-map.ts +3 -2
- package/src/functions/wirings/cli/pikku-command-cli.ts +21 -2
- package/src/functions/wirings/forge/pikku-command-forge-nodes.ts +135 -0
- package/src/functions/wirings/forge/pikku-command-forge-types.ts +38 -0
- package/src/functions/wirings/forge/serialize-forge-types.ts +94 -0
- package/src/functions/wirings/functions/pikku-command-function-types-split.ts +3 -2
- package/src/functions/wirings/functions/pikku-command-function-types.ts +17 -10
- package/src/functions/wirings/functions/pikku-command-functions.ts +47 -37
- package/src/functions/wirings/functions/pikku-command-services.ts +1 -1
- package/src/functions/wirings/functions/pikku-function-types.ts +3 -1
- package/src/functions/wirings/functions/schemas.ts +14 -4
- package/src/functions/wirings/functions/serialize-function-imports.ts +12 -3
- package/src/functions/wirings/functions/serialize-function-types.ts +182 -34
- package/src/functions/wirings/functions/serialize-pikku-types-hub.ts +27 -26
- package/src/functions/wirings/http/openapi-spec-generator.ts +1 -1
- package/src/functions/wirings/http/pikku-command-http-routes.ts +46 -2
- package/src/functions/wirings/http/pikku-command-openapi.ts +3 -2
- package/src/functions/wirings/http/pikku-http-routes.ts +1 -1
- package/src/functions/wirings/http/serialize-http-types.ts +18 -2
- package/src/functions/wirings/http/serialize-typed-http-map.ts +32 -8
- package/src/functions/wirings/mcp/pikku-command-mcp.ts +32 -10
- package/src/functions/wirings/mcp/serialize-mcp-json.ts +8 -6
- package/src/functions/wirings/mcp/serialize-mcp-types.ts +68 -16
- package/src/functions/wirings/middleware/pikku-command-middleware.ts +6 -2
- package/src/functions/wirings/package/pikku-command-package.ts +81 -0
- package/src/functions/wirings/package/serialize-package.ts +69 -0
- package/src/functions/wirings/queue/pikku-command-queue.ts +22 -2
- package/src/functions/wirings/queue/pikku-queue.ts +1 -10
- package/src/functions/wirings/queue/serialize-queue-map.ts +18 -3
- package/src/functions/wirings/queue/serialize-queue-meta.ts +1 -1
- package/src/functions/wirings/rpc/pikku-command-rpc-map.ts +7 -4
- package/src/functions/wirings/rpc/pikku-command-rpc.ts +1 -1
- package/src/functions/wirings/rpc/serialize-remote-rpc.ts +3 -0
- package/src/functions/wirings/rpc/serialize-rpc-wrapper.ts +1 -1
- package/src/functions/wirings/rpc/serialize-typed-rpc-map.ts +74 -8
- package/src/functions/wirings/scheduler/pikku-command-scheduler.ts +22 -1
- package/src/functions/wirings/scheduler/serialize-scheduler-meta.ts +1 -1
- package/src/functions/wirings/workflow/pikku-command-workflow.ts +104 -37
- package/src/functions/wirings/workflow/serialize-workflow-map.ts +38 -40
- package/src/functions/wirings/workflow/serialize-workflow-meta.ts +66 -26
- package/src/functions/wirings/workflow/serialize-workflow-registration.ts +83 -0
- package/src/functions/wirings/workflow/serialize-workflow-types.ts +299 -45
- package/src/functions/wirings/workflow/serialize-workflow-workers.ts +14 -27
- package/src/services.ts +8 -1
- package/src/utils/command-summary.ts +4 -0
- package/src/utils/custom-types-generator.ts +15 -15
- package/src/utils/generate-bootstrap-file.ts +1 -1
- package/src/utils/pikku-cli-config.ts +51 -18
- package/src/utils/schema-generator.ts +185 -22
- package/src/utils/strip-verbose-meta.ts +254 -0
- package/types/config.d.ts +37 -3
- package/.pikku/function/pikku-functions-meta.min.gen.json +0 -212
- package/.pikku/function/pikku-functions-meta.min.gen.ts +0 -6
- package/dist/.pikku/function/pikku-functions-meta.min.gen.d.ts +0 -1
- package/dist/.pikku/function/pikku-functions-meta.min.gen.js +0 -6
- package/dist/.pikku/function/pikku-functions-meta.min.gen.json +0 -212
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-map.d.ts +0 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-map.js +0 -12
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-types.d.ts +0 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-types.js +0 -13
- package/dist/src/functions/wirings/workflow/serialize-workflow-wirings.d.ts +0 -8
- package/dist/src/functions/wirings/workflow/serialize-workflow-wirings.js +0 -30
- package/src/functions/wirings/workflow/pikku-command-workflow-map.ts +0 -24
- package/src/functions/wirings/workflow/pikku-command-workflow-types.ts +0 -29
- package/src/functions/wirings/workflow/serialize-workflow-wirings.ts +0 -47
- /package/.pikku/{workflow/pikku-workflow-wirings-meta.gen.json → channel/pikku-channels-meta.gen.json} +0 -0
- /package/dist/.pikku/{workflow/pikku-workflow-wirings-meta.gen.json → channel/pikku-channels-meta.gen.json} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.11.
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.3
|
|
3
3
|
*/
|
|
4
4
|
import { pikkuState } from '@pikku/core';
|
|
5
5
|
import metaData from './pikku-cli-wirings-meta.gen.json' with { type: 'json' };
|
|
6
|
-
pikkuState('cli', 'meta', metaData);
|
|
6
|
+
pikkuState(null, 'cli', 'meta', metaData);
|
|
@@ -135,12 +135,13 @@
|
|
|
135
135
|
"jwt",
|
|
136
136
|
"config",
|
|
137
137
|
"variables",
|
|
138
|
+
"secrets",
|
|
138
139
|
"workflowService",
|
|
139
140
|
"queueService",
|
|
140
141
|
"schedulerService"
|
|
141
142
|
]
|
|
142
143
|
},
|
|
143
|
-
"filePath": "src/services.ts"
|
|
144
|
+
"filePath": "/home/runner/work/pikku/pikku/packages/cli/src/services.ts"
|
|
144
145
|
}
|
|
145
146
|
}
|
|
146
147
|
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.3
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Forge-specific type definitions for typed wireForgeNode and wireForgeCredential
|
|
6
|
+
*/
|
|
7
|
+
import type { CoreForgeNode, CoreForgeCredential } from '@pikku/core/forge-node';
|
|
8
|
+
import type { FlattenedRPCMap } from '../rpc/pikku-rpc-wirings-map.internal.gen.js';
|
|
9
|
+
/**
|
|
10
|
+
* Valid category values for forge nodes.
|
|
11
|
+
* No categories configured - wireForgeNode cannot be used until forge.node.categories is defined in pikku.config.json.
|
|
12
|
+
*/
|
|
13
|
+
export type ForgeCategory = never;
|
|
14
|
+
/**
|
|
15
|
+
* Valid RPC names that can be used with forge nodes.
|
|
16
|
+
* These are derived from the FlattenedRPCMap which includes both local and external package RPCs.
|
|
17
|
+
*/
|
|
18
|
+
export type ForgeRPCName = keyof FlattenedRPCMap;
|
|
19
|
+
/**
|
|
20
|
+
* Typed forge node configuration.
|
|
21
|
+
* Validates that category and rpc are valid values.
|
|
22
|
+
*/
|
|
23
|
+
export type TypedForgeNode = Omit<CoreForgeNode, 'category' | 'rpc'> & {
|
|
24
|
+
/** Grouping category (validated against forge.node.categories in config) */
|
|
25
|
+
category: ForgeCategory;
|
|
26
|
+
/** RPC name to call when node executes (must be a valid RPC name) */
|
|
27
|
+
rpc: ForgeRPCName;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Registers a Forge node with validated category and RPC.
|
|
31
|
+
*
|
|
32
|
+
* @param config - Forge node configuration with typed category and rpc
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```typescript
|
|
36
|
+
* wireForgeNode({
|
|
37
|
+
* name: 'send-email',
|
|
38
|
+
* displayName: 'Send Email',
|
|
39
|
+
* category: 'Communication', // Must be in forge.node.categories
|
|
40
|
+
* type: 'action',
|
|
41
|
+
* rpc: 'sendEmail', // Must be a valid RPC name
|
|
42
|
+
* description: 'Sends an email to a recipient'
|
|
43
|
+
* })
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare const wireForgeNode: (config: TypedForgeNode) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Registers a Forge credential definition.
|
|
49
|
+
* Credentials define secrets/API keys required by the package.
|
|
50
|
+
*
|
|
51
|
+
* @template T - Zod schema type for the credential structure
|
|
52
|
+
* @param config - Forge credential configuration
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```typescript
|
|
56
|
+
* import { z } from 'zod'
|
|
57
|
+
*
|
|
58
|
+
* const apiCredentials = z.object({
|
|
59
|
+
* apiKey: z.string().describe('API key for authentication'),
|
|
60
|
+
* apiSecret: z.string().describe('API secret')
|
|
61
|
+
* })
|
|
62
|
+
*
|
|
63
|
+
* wireForgeCredential({
|
|
64
|
+
* name: 'example-api',
|
|
65
|
+
* displayName: 'Example API Credentials',
|
|
66
|
+
* description: 'Credentials for the example external API',
|
|
67
|
+
* secretId: 'EXAMPLE_API_CREDENTIALS',
|
|
68
|
+
* schema: apiCredentials
|
|
69
|
+
* })
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
export declare const wireForgeCredential: <T>(config: CoreForgeCredential<T>) => void;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.3
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Forge-specific type definitions for typed wireForgeNode and wireForgeCredential
|
|
6
|
+
*/
|
|
7
|
+
import { wireForgeNode as wireForgeNodeCore, wireForgeCredential as wireForgeCredentialCore } from '@pikku/core/forge-node';
|
|
8
|
+
/**
|
|
9
|
+
* Registers a Forge node with validated category and RPC.
|
|
10
|
+
*
|
|
11
|
+
* @param config - Forge node configuration with typed category and rpc
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* wireForgeNode({
|
|
16
|
+
* name: 'send-email',
|
|
17
|
+
* displayName: 'Send Email',
|
|
18
|
+
* category: 'Communication', // Must be in forge.node.categories
|
|
19
|
+
* type: 'action',
|
|
20
|
+
* rpc: 'sendEmail', // Must be a valid RPC name
|
|
21
|
+
* description: 'Sends an email to a recipient'
|
|
22
|
+
* })
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export const wireForgeNode = (config) => {
|
|
26
|
+
wireForgeNodeCore(config);
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Registers a Forge credential definition.
|
|
30
|
+
* Credentials define secrets/API keys required by the package.
|
|
31
|
+
*
|
|
32
|
+
* @template T - Zod schema type for the credential structure
|
|
33
|
+
* @param config - Forge credential configuration
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```typescript
|
|
37
|
+
* import { z } from 'zod'
|
|
38
|
+
*
|
|
39
|
+
* const apiCredentials = z.object({
|
|
40
|
+
* apiKey: z.string().describe('API key for authentication'),
|
|
41
|
+
* apiSecret: z.string().describe('API secret')
|
|
42
|
+
* })
|
|
43
|
+
*
|
|
44
|
+
* wireForgeCredential({
|
|
45
|
+
* name: 'example-api',
|
|
46
|
+
* displayName: 'Example API Credentials',
|
|
47
|
+
* description: 'Credentials for the example external API',
|
|
48
|
+
* secretId: 'EXAMPLE_API_CREDENTIALS',
|
|
49
|
+
* schema: apiCredentials
|
|
50
|
+
* })
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export const wireForgeCredential = (config) => {
|
|
54
|
+
wireForgeCredentialCore(config);
|
|
55
|
+
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.11.
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.3
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Core function, middleware, and permission types for all wirings
|
|
6
6
|
*/
|
|
7
|
-
import { CorePikkuFunctionConfig, CorePikkuPermission, CorePikkuMiddleware, CorePermissionGroup, PikkuWire, PickRequired } from '@pikku/core';
|
|
7
|
+
import { CorePikkuFunctionConfig, CorePikkuPermission, CorePikkuMiddleware, CorePermissionGroup, PikkuWire, PickRequired, ZodLike, CreateWireServices } from '@pikku/core';
|
|
8
8
|
import { CorePikkuFunction, CorePikkuFunctionSessionless } from '@pikku/core/function';
|
|
9
9
|
import type { UserSession } from '../../types/application-types.d.js';
|
|
10
10
|
import type { SingletonServices } from '../../types/application-types.d.js';
|
|
11
11
|
import type { Services } from '../../types/application-types.d.js';
|
|
12
12
|
import type { Config } from '../../types/application-types.d.js';
|
|
13
|
-
import type { TypedPikkuRPC } from '../rpc/pikku-rpc-wirings-map.internal.gen.d.js';
|
|
13
|
+
import type { TypedPikkuRPC, FlattenedRPCMap } from '../rpc/pikku-rpc-wirings-map.internal.gen.d.js';
|
|
14
14
|
import type { RequiredSingletonServices, RequiredWireServices } from '../pikku-services.gen.js';
|
|
15
15
|
type Session = UserSession;
|
|
16
16
|
/**
|
|
@@ -154,6 +154,10 @@ export type PikkuFunctionSessionless<In = unknown, Out = never, RequiredWires ex
|
|
|
154
154
|
* @template RequiredServices - Services required by this function
|
|
155
155
|
*/
|
|
156
156
|
export type PikkuFunction<In = unknown, Out = never, RequiredWires extends keyof PikkuWire = 'session', RequiredServices extends Services = Services> = CorePikkuFunction<In, Out, RequiredServices, PickRequired<PikkuWire<In, Out, true, Session, TypedPikkuRPC, null, any>, RequiredWires>>;
|
|
157
|
+
/**
|
|
158
|
+
* Helper type to infer the output type from a Zod schema
|
|
159
|
+
*/
|
|
160
|
+
export type InferZodOutput<T> = T extends ZodLike<infer U> ? U : never;
|
|
157
161
|
/**
|
|
158
162
|
* Configuration object for Pikku functions with optional middleware, permissions, tags, and documentation.
|
|
159
163
|
* This type wraps CorePikkuFunctionConfig with the user's custom types.
|
|
@@ -162,51 +166,117 @@ export type PikkuFunction<In = unknown, Out = never, RequiredWires extends keyof
|
|
|
162
166
|
* @template Out - The output type
|
|
163
167
|
* @template PikkuFunc - The function type (can be narrowed to PikkuFunction or PikkuFunctionSessionless)
|
|
164
168
|
*/
|
|
165
|
-
export type PikkuFunctionConfig<In = unknown, Out = unknown, RequiredWires extends keyof PikkuWire = never, PikkuFunc extends PikkuFunction<In, Out, RequiredWires> | PikkuFunctionSessionless<In, Out, RequiredWires> = PikkuFunction<In, Out, RequiredWires> | PikkuFunctionSessionless<In, Out, RequiredWires
|
|
169
|
+
export type PikkuFunctionConfig<In = unknown, Out = unknown, RequiredWires extends keyof PikkuWire = never, PikkuFunc extends PikkuFunction<In, Out, RequiredWires> | PikkuFunctionSessionless<In, Out, RequiredWires> = PikkuFunction<In, Out, RequiredWires> | PikkuFunctionSessionless<In, Out, RequiredWires>, InputSchema extends ZodLike | undefined = undefined, OutputSchema extends ZodLike | undefined = undefined> = CorePikkuFunctionConfig<PikkuFunc, PikkuPermission<In>, PikkuMiddleware, InputSchema, OutputSchema>;
|
|
170
|
+
/**
|
|
171
|
+
* Configuration object for Pikku functions with Zod schema validation.
|
|
172
|
+
* Use this when you want to define input/output schemas using Zod.
|
|
173
|
+
* Types are automatically inferred from the schemas.
|
|
174
|
+
*/
|
|
175
|
+
export type PikkuFunctionConfigWithSchema<InputSchema extends ZodLike, OutputSchema extends ZodLike | undefined = undefined, RequiredWires extends keyof PikkuWire = never> = {
|
|
176
|
+
name?: string;
|
|
177
|
+
tags?: string[];
|
|
178
|
+
expose?: boolean;
|
|
179
|
+
internal?: boolean;
|
|
180
|
+
func: PikkuFunction<InferZodOutput<InputSchema>, OutputSchema extends ZodLike ? InferZodOutput<OutputSchema> : unknown, RequiredWires> | PikkuFunctionSessionless<InferZodOutput<InputSchema>, OutputSchema extends ZodLike ? InferZodOutput<OutputSchema> : unknown, RequiredWires>;
|
|
181
|
+
auth?: boolean;
|
|
182
|
+
permissions?: CorePermissionGroup<PikkuPermission<InferZodOutput<InputSchema>>>;
|
|
183
|
+
middleware?: PikkuMiddleware[];
|
|
184
|
+
input: InputSchema;
|
|
185
|
+
output?: OutputSchema;
|
|
186
|
+
};
|
|
166
187
|
/**
|
|
167
188
|
* Creates a Pikku function that can be either session-aware or sessionless.
|
|
168
189
|
* This is the main function wrapper for creating API endpoints.
|
|
169
190
|
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
191
|
+
* Supports two patterns:
|
|
192
|
+
* 1. Generic types: `pikkuFunc<Input, Output>({ func: ... })`
|
|
193
|
+
* 2. Zod schemas: `pikkuFunc({ input: z.object(...), output: z.object(...), func: ... })`
|
|
194
|
+
*
|
|
195
|
+
* @template In - Input type for the function (inferred from schema if provided)
|
|
196
|
+
* @template Out - Output type for the function (inferred from schema if provided)
|
|
172
197
|
* @param func - Function definition, either direct function or configuration object
|
|
173
198
|
* @returns The normalized configuration object
|
|
174
199
|
*
|
|
175
200
|
* @example
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
* logger.info('Creating user', input.name)
|
|
201
|
+
* ```typescript
|
|
202
|
+
* // Pattern 1: Using generic types
|
|
203
|
+
* const createUser = pikkuFunc<{name: string, email: string}, {id: number}>({
|
|
204
|
+
* func: async ({db}, input) => {
|
|
181
205
|
* const user = await db.users.create(input)
|
|
182
|
-
* return {id: user.id
|
|
183
|
-
* }
|
|
184
|
-
* auth: true
|
|
206
|
+
* return { id: user.id }
|
|
207
|
+
* }
|
|
185
208
|
* })
|
|
186
|
-
*
|
|
209
|
+
*
|
|
210
|
+
* // Pattern 2: Using Zod schemas (types inferred automatically)
|
|
211
|
+
* const createUserInput = z.object({ name: z.string(), email: z.string() })
|
|
212
|
+
* const createUserOutput = z.object({ id: z.number() })
|
|
213
|
+
*
|
|
214
|
+
* const createUser = pikkuFunc({
|
|
215
|
+
* input: createUserInput,
|
|
216
|
+
* output: createUserOutput,
|
|
217
|
+
* func: async ({db}, input) => {
|
|
218
|
+
* // input is typed as { name: string, email: string }
|
|
219
|
+
* const user = await db.users.create(input)
|
|
220
|
+
* return { id: user.id } // must match output schema
|
|
221
|
+
* }
|
|
222
|
+
* })
|
|
223
|
+
* ```
|
|
187
224
|
*/
|
|
188
|
-
export declare
|
|
225
|
+
export declare function pikkuFunc<InputSchema extends ZodLike, OutputSchema extends ZodLike | undefined = undefined>(config: PikkuFunctionConfigWithSchema<InputSchema, OutputSchema, 'session' | 'rpc'>): PikkuFunctionConfig<InferZodOutput<InputSchema>, OutputSchema extends ZodLike ? InferZodOutput<OutputSchema> : unknown, 'session' | 'rpc'>;
|
|
226
|
+
export declare function pikkuFunc<In, Out = unknown>(func: PikkuFunction<In, Out, 'session' | 'rpc'> | PikkuFunctionConfig<In, Out, 'session' | 'rpc'>): PikkuFunctionConfig<In, Out, 'session' | 'rpc'>;
|
|
227
|
+
/**
|
|
228
|
+
* Configuration object for sessionless Pikku functions with Zod schema validation.
|
|
229
|
+
*/
|
|
230
|
+
export type PikkuFunctionSessionlessConfigWithSchema<InputSchema extends ZodLike, OutputSchema extends ZodLike | undefined = undefined, RequiredWires extends keyof PikkuWire = never> = {
|
|
231
|
+
name?: string;
|
|
232
|
+
description?: string;
|
|
233
|
+
tags?: string[];
|
|
234
|
+
expose?: boolean;
|
|
235
|
+
internal?: boolean;
|
|
236
|
+
func: PikkuFunctionSessionless<InferZodOutput<InputSchema>, OutputSchema extends ZodLike ? InferZodOutput<OutputSchema> : unknown, RequiredWires>;
|
|
237
|
+
auth?: boolean;
|
|
238
|
+
permissions?: CorePermissionGroup<PikkuPermission<InferZodOutput<InputSchema>>>;
|
|
239
|
+
middleware?: PikkuMiddleware[];
|
|
240
|
+
input: InputSchema;
|
|
241
|
+
output?: OutputSchema;
|
|
242
|
+
};
|
|
189
243
|
/**
|
|
190
244
|
* Creates a sessionless Pikku function that doesn't require user authentication.
|
|
191
245
|
* Use this for public endpoints, webhooks, or background tasks.
|
|
192
246
|
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
247
|
+
* Supports two patterns:
|
|
248
|
+
* 1. Generic types: `pikkuSessionlessFunc<Input, Output>({ func: ... })`
|
|
249
|
+
* 2. Zod schemas: `pikkuSessionlessFunc({ input: z.object(...), func: ... })`
|
|
250
|
+
*
|
|
251
|
+
* @template In - Input type for the function (inferred from schema if provided)
|
|
252
|
+
* @template Out - Output type for the function (inferred from schema if provided)
|
|
195
253
|
* @param func - Function definition, either direct function or configuration object
|
|
196
254
|
* @returns The normalized configuration object
|
|
197
255
|
*
|
|
198
256
|
* @example
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
* return {status: 'healthy'
|
|
204
|
-
* }
|
|
205
|
-
*
|
|
257
|
+
* ```typescript
|
|
258
|
+
* // Pattern 1: Using generic types
|
|
259
|
+
* const healthCheck = pikkuSessionlessFunc<void, {status: string}>({
|
|
260
|
+
* func: async ({logger}) => {
|
|
261
|
+
* return { status: 'healthy' }
|
|
262
|
+
* }
|
|
263
|
+
* })
|
|
264
|
+
*
|
|
265
|
+
* // Pattern 2: Using Zod schemas
|
|
266
|
+
* const greetInput = z.object({ name: z.string() })
|
|
267
|
+
* const greetOutput = z.object({ message: z.string() })
|
|
268
|
+
*
|
|
269
|
+
* const greet = pikkuSessionlessFunc({
|
|
270
|
+
* input: greetInput,
|
|
271
|
+
* output: greetOutput,
|
|
272
|
+
* func: async (_services, { name }) => {
|
|
273
|
+
* return { message: `Hello, ${name}!` }
|
|
274
|
+
* }
|
|
206
275
|
* })
|
|
207
|
-
*
|
|
276
|
+
* ```
|
|
208
277
|
*/
|
|
209
|
-
export declare
|
|
278
|
+
export declare function pikkuSessionlessFunc<InputSchema extends ZodLike, OutputSchema extends ZodLike | undefined = undefined>(config: PikkuFunctionSessionlessConfigWithSchema<InputSchema, OutputSchema, 'session' | 'rpc'>): PikkuFunctionConfig<InferZodOutput<InputSchema>, OutputSchema extends ZodLike ? InferZodOutput<OutputSchema> : unknown, 'session' | 'rpc'>;
|
|
279
|
+
export declare function pikkuSessionlessFunc<In, Out = unknown>(func: PikkuFunctionSessionless<In, Out, 'session' | 'rpc'> | PikkuFunctionConfig<In, Out, 'session' | 'rpc'>): PikkuFunctionConfig<In, Out, 'session' | 'rpc'>;
|
|
210
280
|
/**
|
|
211
281
|
* Creates a function that takes no input and returns no output.
|
|
212
282
|
* Useful for health checks, triggers, or cleanup operations.
|
|
@@ -215,15 +285,37 @@ export declare const pikkuSessionlessFunc: <In, Out = unknown>(func: PikkuFuncti
|
|
|
215
285
|
* @returns The normalized configuration object
|
|
216
286
|
*
|
|
217
287
|
* @example
|
|
218
|
-
*
|
|
288
|
+
* ```typescript
|
|
219
289
|
* const cleanupTempFiles = pikkuVoidFunc(async ({fileSystem, logger}) => {
|
|
220
290
|
* logger.info('Starting cleanup of temporary files')
|
|
221
291
|
* await fileSystem.deleteDirectory('/tmp/uploads')
|
|
222
292
|
* logger.info('Cleanup completed')
|
|
223
293
|
* })
|
|
224
|
-
*
|
|
294
|
+
* ```
|
|
295
|
+
*/
|
|
296
|
+
export declare const pikkuVoidFunc: (func: PikkuFunctionSessionless<void, void, "session" | "rpc"> | PikkuFunctionConfig<void, void, "session" | "rpc">) => PikkuFunctionConfig<void, void, "rpc" | "session", PikkuFunctionSessionless<void, void, "rpc" | "session", Services> | PikkuFunction<void, void, "rpc" | "session", Services>, undefined, undefined>;
|
|
297
|
+
/**
|
|
298
|
+
* Creates a wrapper function for external package functions that are exposed via RPC.
|
|
299
|
+
* This allows you to wire external functions to any wiring type (HTTP, queue, etc.)
|
|
300
|
+
* without type compatibility issues.
|
|
301
|
+
*
|
|
302
|
+
* @template Name - The RPC method name (must be a key in FlattenedRPCMap)
|
|
303
|
+
* @param rpcName - The name of the RPC method to invoke
|
|
304
|
+
* @returns A Pikku function that proxies calls to the external RPC method
|
|
305
|
+
*
|
|
306
|
+
* @example
|
|
307
|
+
* ```typescript
|
|
308
|
+
* // Wire an external function via HTTP
|
|
309
|
+
* wireHTTP({
|
|
310
|
+
* auth: false,
|
|
311
|
+
* method: 'get',
|
|
312
|
+
* route: '/external/hello',
|
|
313
|
+
* func: external('ext:hello'),
|
|
314
|
+
* tags: ['external'],
|
|
315
|
+
* })
|
|
316
|
+
* ```
|
|
225
317
|
*/
|
|
226
|
-
export declare const
|
|
318
|
+
export declare const external: <Name extends keyof FlattenedRPCMap>(rpcName: Name) => PikkuFunctionConfig<FlattenedRPCMap[Name]["input"], FlattenedRPCMap[Name]["output"], "session" | "rpc">;
|
|
227
319
|
/**
|
|
228
320
|
* Creates a Pikku config factory.
|
|
229
321
|
* Use this to define your application's configuration factory.
|
|
@@ -278,7 +370,7 @@ export declare const pikkuServices: (func: (config: Config, existingServices?: P
|
|
|
278
370
|
* })
|
|
279
371
|
* ```
|
|
280
372
|
*/
|
|
281
|
-
export declare const pikkuWireServices: (func: (services: SingletonServices, wire: any) => Promise<RequiredWireServices>) =>
|
|
373
|
+
export declare const pikkuWireServices: (func: (services: SingletonServices, wire: any) => Promise<RequiredWireServices>) => CreateWireServices;
|
|
282
374
|
/**
|
|
283
375
|
* Adds global middleware for a specific tag.
|
|
284
376
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.11.
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.3
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Core function, middleware, and permission types for all wirings
|
|
@@ -99,54 +99,12 @@ export const pikkuMiddlewareFactory = (factory) => {
|
|
|
99
99
|
export const pikkuPermissionFactory = (factory) => {
|
|
100
100
|
return factory;
|
|
101
101
|
};
|
|
102
|
-
|
|
103
|
-
* Creates a Pikku function that can be either session-aware or sessionless.
|
|
104
|
-
* This is the main function wrapper for creating API endpoints.
|
|
105
|
-
*
|
|
106
|
-
* @template In - Input type for the function
|
|
107
|
-
* @template Out - Output type for the function
|
|
108
|
-
* @param func - Function definition, either direct function or configuration object
|
|
109
|
-
* @returns The normalized configuration object
|
|
110
|
-
*
|
|
111
|
-
* @example
|
|
112
|
-
* \`\`\`typescript
|
|
113
|
-
* const createUser = pikkuFunc<{name: string, email: string}, {id: number, message: string}>({
|
|
114
|
-
* func: async ({db, logger}, input, wire) => {
|
|
115
|
-
* const session = await wire.session.get()
|
|
116
|
-
* logger.info('Creating user', input.name)
|
|
117
|
-
* const user = await db.users.create(input)
|
|
118
|
-
* return {id: user.id, message: \`User \${input.name} created successfully\`}
|
|
119
|
-
* },
|
|
120
|
-
* auth: true
|
|
121
|
-
* })
|
|
122
|
-
* \`\`\`
|
|
123
|
-
*/
|
|
124
|
-
export const pikkuFunc = (func) => {
|
|
102
|
+
export function pikkuFunc(func) {
|
|
125
103
|
return typeof func === 'function' ? { func } : func;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
* Creates a sessionless Pikku function that doesn't require user authentication.
|
|
129
|
-
* Use this for public endpoints, webhooks, or background tasks.
|
|
130
|
-
*
|
|
131
|
-
* @template In - Input type for the function
|
|
132
|
-
* @template Out - Output type for the function
|
|
133
|
-
* @param func - Function definition, either direct function or configuration object
|
|
134
|
-
* @returns The normalized configuration object
|
|
135
|
-
*
|
|
136
|
-
* @example
|
|
137
|
-
* \`\`\`typescript
|
|
138
|
-
* const healthCheck = pikkuSessionlessFunc<void, {status: string, timestamp: string}>({
|
|
139
|
-
* func: async ({logger}, input) => {
|
|
140
|
-
* logger.info('Health check requested')
|
|
141
|
-
* return {status: 'healthy', timestamp: new Date().toISOString()}
|
|
142
|
-
* },
|
|
143
|
-
* name: 'healthCheck'
|
|
144
|
-
* })
|
|
145
|
-
* \`\`\`
|
|
146
|
-
*/
|
|
147
|
-
export const pikkuSessionlessFunc = (func) => {
|
|
104
|
+
}
|
|
105
|
+
export function pikkuSessionlessFunc(func) {
|
|
148
106
|
return typeof func === 'function' ? { func } : func;
|
|
149
|
-
}
|
|
107
|
+
}
|
|
150
108
|
/**
|
|
151
109
|
* Creates a function that takes no input and returns no output.
|
|
152
110
|
* Useful for health checks, triggers, or cleanup operations.
|
|
@@ -155,17 +113,45 @@ export const pikkuSessionlessFunc = (func) => {
|
|
|
155
113
|
* @returns The normalized configuration object
|
|
156
114
|
*
|
|
157
115
|
* @example
|
|
158
|
-
*
|
|
116
|
+
* ```typescript
|
|
159
117
|
* const cleanupTempFiles = pikkuVoidFunc(async ({fileSystem, logger}) => {
|
|
160
118
|
* logger.info('Starting cleanup of temporary files')
|
|
161
119
|
* await fileSystem.deleteDirectory('/tmp/uploads')
|
|
162
120
|
* logger.info('Cleanup completed')
|
|
163
121
|
* })
|
|
164
|
-
*
|
|
122
|
+
* ```
|
|
165
123
|
*/
|
|
166
124
|
export const pikkuVoidFunc = (func) => {
|
|
167
125
|
return typeof func === 'function' ? { func } : func;
|
|
168
126
|
};
|
|
127
|
+
/**
|
|
128
|
+
* Creates a wrapper function for external package functions that are exposed via RPC.
|
|
129
|
+
* This allows you to wire external functions to any wiring type (HTTP, queue, etc.)
|
|
130
|
+
* without type compatibility issues.
|
|
131
|
+
*
|
|
132
|
+
* @template Name - The RPC method name (must be a key in FlattenedRPCMap)
|
|
133
|
+
* @param rpcName - The name of the RPC method to invoke
|
|
134
|
+
* @returns A Pikku function that proxies calls to the external RPC method
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* ```typescript
|
|
138
|
+
* // Wire an external function via HTTP
|
|
139
|
+
* wireHTTP({
|
|
140
|
+
* auth: false,
|
|
141
|
+
* method: 'get',
|
|
142
|
+
* route: '/external/hello',
|
|
143
|
+
* func: external('ext:hello'),
|
|
144
|
+
* tags: ['external'],
|
|
145
|
+
* })
|
|
146
|
+
* ```
|
|
147
|
+
*/
|
|
148
|
+
export const external = (rpcName) => {
|
|
149
|
+
return {
|
|
150
|
+
func: (async (_services, data, { rpc }) => {
|
|
151
|
+
return rpc.invoke(rpcName, data);
|
|
152
|
+
})
|
|
153
|
+
};
|
|
154
|
+
};
|
|
169
155
|
/**
|
|
170
156
|
* Creates a Pikku config factory.
|
|
171
157
|
* Use this to define your application's configuration factory.
|
|
@@ -245,7 +231,7 @@ export const pikkuWireServices = (func) => func;
|
|
|
245
231
|
* ```
|
|
246
232
|
*/
|
|
247
233
|
export const addMiddleware = (tag, middleware) => {
|
|
248
|
-
addMiddlewareCore(tag, middleware);
|
|
234
|
+
addMiddlewareCore(tag, middleware, null);
|
|
249
235
|
};
|
|
250
236
|
/**
|
|
251
237
|
* Adds global permissions for a specific tag.
|
|
@@ -271,5 +257,5 @@ export const addMiddleware = (tag, middleware) => {
|
|
|
271
257
|
* ```
|
|
272
258
|
*/
|
|
273
259
|
export const addPermission = (tag, permissions) => {
|
|
274
|
-
addPermissionCore(tag, permissions);
|
|
260
|
+
addPermissionCore(tag, permissions, null);
|
|
275
261
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.11.
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.3
|
|
3
3
|
*/
|
|
4
4
|
import { pikkuState } from '@pikku/core';
|
|
5
5
|
import metaData from './pikku-functions-meta.gen.json' with { type: 'json' };
|
|
6
|
-
pikkuState('function', 'meta', metaData);
|
|
6
|
+
pikkuState(null, 'function', 'meta', metaData);
|