@pikku/cli 0.11.0 → 0.11.2
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 +11 -12
- package/.pikku/channel/pikku-channels-map.gen.d.ts +9 -9
- package/.pikku/channel/pikku-channels-meta.gen.ts +1 -1
- package/.pikku/channel/pikku-channels.gen.ts +1 -1
- package/.pikku/cli/pikku-cli-channel.ts +92 -0
- package/.pikku/cli/pikku-cli-client.gen.ts +54 -0
- package/.pikku/cli/pikku-cli-types.gen.ts +3 -3
- package/.pikku/cli/pikku-cli-wirings-meta.gen.json +146 -0
- package/.pikku/cli/pikku-cli-wirings-meta.gen.ts +4 -34
- package/.pikku/cli/pikku-cli-wirings.gen.ts +2 -1
- package/.pikku/cli/pikku-cli.gen.ts +41 -0
- package/.pikku/function/pikku-function-types.gen.ts +49 -63
- package/.pikku/function/pikku-functions-meta.gen.json +988 -0
- package/.pikku/function/pikku-functions-meta.gen.ts +4 -970
- package/.pikku/function/pikku-functions-meta.min.gen.json +212 -0
- package/.pikku/function/pikku-functions-meta.min.gen.ts +4 -209
- package/.pikku/http/pikku-http-types.gen.ts +2 -2
- package/.pikku/http/pikku-http-wirings-map.gen.d.ts +9 -9
- package/.pikku/http/pikku-http-wirings-meta.gen.ts +1 -1
- package/.pikku/http/pikku-http-wirings.gen.ts +1 -1
- package/.pikku/mcp/pikku-mcp-types.gen.ts +13 -13
- package/.pikku/mcp/pikku-mcp-wirings-meta.gen.json +5 -0
- package/.pikku/mcp/pikku-mcp-wirings-meta.gen.ts +6 -4
- package/.pikku/mcp/pikku-mcp-wirings.gen.ts +1 -1
- package/.pikku/pikku-bootstrap.gen.ts +1 -4
- package/.pikku/pikku-services.gen.ts +6 -8
- package/.pikku/pikku-types.gen.ts +1 -1
- package/.pikku/pikku-websocket.gen.ts +1 -1
- package/.pikku/queue/pikku-queue-types.gen.ts +2 -2
- package/.pikku/queue/pikku-queue-workers-wirings-map.gen.d.ts +9 -9
- package/.pikku/queue/pikku-queue-workers-wirings-meta.gen.json +1 -0
- package/.pikku/queue/pikku-queue-workers-wirings-meta.gen.ts +5 -7
- package/.pikku/queue/pikku-queue-workers-wirings.gen.ts +1 -1
- package/.pikku/rpc/pikku-remote-rpc-workers.gen.ts +2 -2
- package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +9 -9
- package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +41 -40
- package/.pikku/scheduler/pikku-scheduler-types.gen.ts +2 -2
- package/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.json +1 -0
- package/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.ts +5 -2
- package/.pikku/scheduler/pikku-schedulers-wirings.gen.ts +1 -1
- package/.pikku/schemas/register.gen.ts +27 -27
- package/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuChannelsOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuSchemasOutput.schema.json +1 -1
- package/.pikku/services/config.gen.json +99 -0
- package/.pikku/services/getInspectorState.gen.json +10 -0
- package/.pikku/services/jwt.gen.json +13 -0
- package/.pikku/services/logger.gen.json +25 -0
- package/.pikku/services/queueService.gen.json +14 -0
- package/.pikku/services/schedulerService.gen.json +17 -0
- package/.pikku/services/schema.gen.json +14 -0
- package/.pikku/services/variables.gen.json +13 -0
- package/.pikku/services/workflowService.gen.json +31 -0
- package/.pikku/workflow/pikku-workflow-map.gen.d.ts +9 -9
- package/.pikku/workflow/pikku-workflow-types.gen.ts +36 -31
- package/.pikku/workflow/pikku-workflow-wirings-meta.gen.json +1 -0
- package/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +5 -2
- package/.pikku/workflow/pikku-workflow-wirings.gen.ts +6 -2
- package/CHANGELOG.md +27 -1
- package/bin/pikku.ts +6 -32
- package/build.sh +53 -31
- package/cli.schema.json +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +6 -7
- package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
- package/dist/.pikku/channel/pikku-channels-meta.gen.js +1 -1
- 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 +91 -0
- package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +10 -0
- package/dist/.pikku/cli/pikku-cli-client.gen.js +44 -0
- package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +3 -3
- package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +3 -34
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +146 -0
- package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +2 -1
- package/dist/.pikku/cli/pikku-cli-wirings.gen.js +2 -1
- package/dist/.pikku/cli/pikku-cli.gen.d.ts +10 -0
- package/dist/.pikku/cli/pikku-cli.gen.js +38 -0
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +29 -79
- package/dist/.pikku/function/pikku-function-types.gen.js +19 -15
- package/dist/.pikku/function/pikku-functions-meta.gen.js +3 -969
- package/dist/.pikku/function/pikku-functions-meta.gen.json +988 -0
- package/dist/.pikku/function/pikku-functions-meta.min.gen.js +3 -208
- package/dist/.pikku/function/pikku-functions-meta.min.gen.json +212 -0
- package/dist/.pikku/http/pikku-http-types.gen.d.ts +2 -2
- 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 +13 -13
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
- package/dist/.pikku/mcp/pikku-mcp-wirings-meta.gen.js +5 -4
- package/dist/.pikku/mcp/pikku-mcp-wirings-meta.gen.json +5 -0
- 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 +1 -4
- package/dist/.pikku/pikku-bootstrap.gen.js +1 -4
- package/dist/.pikku/pikku-services.gen.d.ts +5 -8
- package/dist/.pikku/pikku-services.gen.js +3 -6
- package/dist/.pikku/pikku-types.gen.d.ts +1 -1
- package/dist/.pikku/pikku-types.gen.js +1 -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 +2 -2
- package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +3 -7
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.json +1 -0
- 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 +6 -9
- package/dist/.pikku/rpc/pikku-remote-rpc-workers.gen.js +2 -2
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +2 -2
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
- package/dist/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.js +3 -2
- package/dist/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.json +1 -0
- 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 +17 -17
- package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuChannelsOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuSchemasOutput.schema.json +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +29 -25
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +22 -8
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +3 -2
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.json +1 -0
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +6 -2
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +6 -3
- package/dist/bin/pikku.js +5 -28
- package/dist/src/cli.wiring.js +108 -106
- package/dist/src/functions/commands/all.js +82 -42
- package/dist/src/functions/commands/bootstrap.js +22 -10
- package/dist/src/functions/commands/watch.js +6 -3
- package/dist/src/functions/runtimes/nextjs/pikku-command-nextjs.js +12 -7
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.d.ts +1 -1
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.js +42 -4
- 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 +40 -2
- package/dist/src/functions/wirings/channels/pikku-channels.js +9 -2
- package/dist/src/functions/wirings/channels/serialize-channel-types.js +10 -11
- package/dist/src/functions/wirings/cli/pikku-command-cli-entry.js +4 -4
- package/dist/src/functions/wirings/cli/pikku-command-cli-types.js +1 -1
- package/dist/src/functions/wirings/cli/pikku-command-cli.js +9 -3
- package/dist/src/functions/wirings/cli/serialize-channel-cli.js +1 -1
- package/dist/src/functions/wirings/cli/serialize-cli-types.js +2 -2
- package/dist/src/functions/wirings/cli/serialize-local-cli-bootstrap.d.ts +1 -1
- package/dist/src/functions/wirings/cli/serialize-local-cli-bootstrap.js +4 -4
- package/dist/src/functions/wirings/functions/pikku-command-function-types-split.js +4 -4
- package/dist/src/functions/wirings/functions/pikku-command-functions.js +15 -5
- package/dist/src/functions/wirings/functions/pikku-command-services.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-services.js +23 -23
- package/dist/src/functions/wirings/functions/schemas.js +1 -1
- package/dist/src/functions/wirings/functions/serialize-function-types.d.ts +1 -1
- package/dist/src/functions/wirings/functions/serialize-function-types.js +50 -64
- package/dist/src/functions/wirings/http/openapi-spec-generator.js +4 -4
- package/dist/src/functions/wirings/http/pikku-http-routes.js +9 -2
- package/dist/src/functions/wirings/http/serialize-http-types.js +1 -1
- package/dist/src/functions/wirings/mcp/pikku-command-mcp.js +18 -4
- package/dist/src/functions/wirings/mcp/serialize-mcp-types.js +12 -12
- package/dist/src/functions/wirings/middleware/pikku-command-middleware.js +26 -2
- package/dist/src/functions/wirings/middleware/serialize-middleware-groups-meta.d.ts +5 -2
- package/dist/src/functions/wirings/middleware/serialize-middleware-groups-meta.js +5 -13
- package/dist/src/functions/wirings/queue/pikku-command-queue.js +9 -3
- package/dist/src/functions/wirings/queue/pikku-queue.js +9 -3
- package/dist/src/functions/wirings/queue/serialize-queue-meta.d.ts +2 -1
- package/dist/src/functions/wirings/queue/serialize-queue-meta.js +10 -1
- package/dist/src/functions/wirings/queue/serialize-queue-types.js +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc.js +9 -2
- package/dist/src/functions/wirings/rpc/serialize-public-rpc.js +11 -4
- package/dist/src/functions/wirings/rpc/serialize-remote-rpc.js +1 -1
- package/dist/src/functions/wirings/rpc/serialize-rpc-wrapper.js +3 -3
- package/dist/src/functions/wirings/scheduler/pikku-command-scheduler.js +6 -3
- package/dist/src/functions/wirings/scheduler/serialize-scheduler-meta.d.ts +2 -1
- package/dist/src/functions/wirings/scheduler/serialize-scheduler-meta.js +11 -1
- package/dist/src/functions/wirings/scheduler/serialize-scheduler-types.js +1 -1
- package/dist/src/functions/wirings/services/pikku-command-service-metadata.d.ts +1 -0
- package/dist/src/functions/wirings/services/pikku-command-service-metadata.js +22 -0
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-types.js +3 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.js +12 -8
- package/dist/src/functions/wirings/workflow/serialize-workflow-meta.d.ts +2 -1
- package/dist/src/functions/wirings/workflow/serialize-workflow-meta.js +11 -1
- package/dist/src/functions/wirings/workflow/serialize-workflow-types.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/serialize-workflow-types.js +36 -31
- package/dist/src/functions/wirings/workflow/serialize-workflow-wirings.d.ts +8 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-wirings.js +30 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-workers.js +2 -2
- package/dist/src/middleware/log-command-info-and-time.d.ts +2 -2
- package/dist/src/middleware/log-command-info-and-time.js +1 -4
- package/dist/src/services/cli-logger-forwarder.service.d.ts +3 -0
- package/dist/src/services/cli-logger-forwarder.service.js +9 -2
- package/dist/src/services.d.ts +2 -7
- package/dist/src/services.js +14 -12
- package/dist/src/utils/check-required-types.d.ts +2 -2
- package/dist/src/utils/check-required-types.js +2 -3
- package/dist/src/utils/pikku-cli-config.js +35 -2
- package/dist/src/utils/pikku-files-and-methods.d.ts +2 -2
- package/dist/src/utils/pikku-files-and-methods.js +4 -4
- package/dist/src/utils/schema-generator.d.ts +1 -1
- package/dist/src/utils/schema-generator.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -8
- package/src/cli.wiring.ts +110 -105
- package/src/functions/commands/all.ts +94 -45
- package/src/functions/commands/bootstrap.ts +25 -10
- package/src/functions/commands/watch.ts +6 -3
- package/src/functions/runtimes/nextjs/pikku-command-nextjs.ts +26 -5
- package/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.ts +43 -4
- package/src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.ts +40 -1
- package/src/functions/wirings/channels/pikku-channels.ts +27 -3
- package/src/functions/wirings/channels/serialize-channel-types.ts +10 -11
- package/src/functions/wirings/cli/pikku-command-cli-entry.ts +4 -4
- package/src/functions/wirings/cli/pikku-command-cli-types.ts +1 -1
- package/src/functions/wirings/cli/pikku-command-cli.ts +26 -3
- package/src/functions/wirings/cli/serialize-channel-cli.ts +1 -1
- package/src/functions/wirings/cli/serialize-cli-types.ts +2 -2
- package/src/functions/wirings/cli/serialize-local-cli-bootstrap.ts +5 -5
- package/src/functions/wirings/functions/pikku-command-function-types-split.ts +6 -6
- package/src/functions/wirings/functions/pikku-command-functions.ts +39 -4
- package/src/functions/wirings/functions/pikku-command-services.ts +25 -25
- package/src/functions/wirings/functions/schemas.ts +2 -2
- package/src/functions/wirings/functions/serialize-function-types.ts +51 -65
- package/src/functions/wirings/http/openapi-spec-generator.ts +14 -5
- package/src/functions/wirings/http/pikku-http-routes.ts +28 -2
- package/src/functions/wirings/http/serialize-http-types.ts +1 -1
- package/src/functions/wirings/mcp/pikku-command-mcp.ts +30 -4
- package/src/functions/wirings/mcp/serialize-mcp-types.ts +12 -12
- package/src/functions/wirings/middleware/pikku-command-middleware.ts +35 -2
- package/src/functions/wirings/middleware/serialize-middleware-groups-meta.ts +4 -19
- package/src/functions/wirings/permissions/pikku-command-permissions.ts +2 -2
- package/src/functions/wirings/queue/pikku-command-queue.ts +27 -2
- package/src/functions/wirings/queue/pikku-queue.ts +27 -2
- package/src/functions/wirings/queue/serialize-queue-meta.ts +15 -1
- package/src/functions/wirings/queue/serialize-queue-types.ts +1 -1
- package/src/functions/wirings/rpc/pikku-command-rpc.ts +25 -2
- package/src/functions/wirings/rpc/serialize-public-rpc.ts +11 -4
- package/src/functions/wirings/rpc/serialize-remote-rpc.ts +1 -1
- package/src/functions/wirings/rpc/serialize-rpc-wrapper.ts +3 -3
- package/src/functions/wirings/scheduler/pikku-command-scheduler.ts +30 -4
- package/src/functions/wirings/scheduler/serialize-scheduler-meta.ts +20 -1
- package/src/functions/wirings/scheduler/serialize-scheduler-types.ts +1 -1
- package/src/functions/wirings/services/pikku-command-service-metadata.ts +25 -0
- package/src/functions/wirings/workflow/pikku-command-workflow-types.ts +8 -1
- package/src/functions/wirings/workflow/pikku-command-workflow.ts +36 -8
- package/src/functions/wirings/workflow/serialize-workflow-meta.ts +18 -1
- package/src/functions/wirings/workflow/serialize-workflow-types.ts +39 -31
- package/src/functions/wirings/workflow/serialize-workflow-wirings.ts +47 -0
- package/src/functions/wirings/workflow/serialize-workflow-workers.ts +2 -2
- package/src/middleware/log-command-info-and-time.ts +3 -6
- package/src/services/cli-logger-forwarder.service.ts +11 -2
- package/src/services.ts +15 -15
- package/src/utils/check-required-types.ts +4 -7
- package/src/utils/pikku-cli-config.ts +69 -2
- package/src/utils/pikku-files-and-methods.ts +10 -13
- package/src/utils/schema-generator.ts +2 -2
- package/types/application-types.d.ts +1 -1
- package/types/config.d.ts +12 -1
- package/.pikku/function/pikku-functions.gen.ts +0 -84
- package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +0 -47
- package/dist/.pikku/function/pikku-functions.gen.js +0 -83
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.d.ts +0 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +0 -47
- package/dist/.pikku/schemas/schemas/PikkuRemoteInternalRPCInput.schema.json +0 -1
- /package/dist/.pikku/{function/pikku-functions.gen.d.ts → cli/pikku-cli-channel.d.ts} +0 -0
|
@@ -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.2
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
|
|
@@ -7,9 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { CoreChannel, wireChannel as wireChannelCore } from '@pikku/core/channel'
|
|
10
|
-
import { CorePikkuFunctionConfig } from '@pikku/core'
|
|
11
10
|
import { AssertHTTPWiringParams } from '@pikku/core/http'
|
|
12
|
-
import type {
|
|
11
|
+
import type { PikkuFunctionConfig, PikkuFunctionSessionless, PikkuPermission, PikkuMiddleware } from '../function/pikku-function-types.gen.js'
|
|
13
12
|
|
|
14
13
|
/**
|
|
15
14
|
* Type definition for WebSocket channels with typed data exchange.
|
|
@@ -22,9 +21,9 @@ import type { PikkuFunction, PikkuFunctionSessionless, PikkuPermission, PikkuMid
|
|
|
22
21
|
type ChannelWiring<ChannelData, Channel extends string> = CoreChannel<
|
|
23
22
|
ChannelData,
|
|
24
23
|
Channel,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
PikkuFunctionConfig<void, any, 'channel' | 'session' | 'rpc'>,
|
|
25
|
+
PikkuFunctionConfig<void, void, 'channel' | 'session' | 'rpc'>,
|
|
26
|
+
PikkuFunctionConfig<any, any, 'channel' | 'session' | 'rpc'>,
|
|
28
27
|
PikkuPermission,
|
|
29
28
|
PikkuMiddleware
|
|
30
29
|
>
|
|
@@ -39,8 +38,8 @@ type ChannelWiring<ChannelData, Channel extends string> = CoreChannel<
|
|
|
39
38
|
*/
|
|
40
39
|
export const pikkuChannelConnectionFunc = <Out = unknown>(
|
|
41
40
|
func:
|
|
42
|
-
| PikkuFunctionSessionless<void, Out,
|
|
43
|
-
|
|
|
41
|
+
| PikkuFunctionSessionless<void, Out, 'channel' | 'session' | 'rpc'>
|
|
42
|
+
| PikkuFunctionConfig<void, Out, 'channel' | 'session' | 'rpc'>
|
|
44
43
|
) => {
|
|
45
44
|
return typeof func === 'function' ? { func } : func
|
|
46
45
|
}
|
|
@@ -54,8 +53,8 @@ export const pikkuChannelConnectionFunc = <Out = unknown>(
|
|
|
54
53
|
*/
|
|
55
54
|
export const pikkuChannelDisconnectionFunc = (
|
|
56
55
|
func:
|
|
57
|
-
| PikkuFunctionSessionless<void, void,
|
|
58
|
-
|
|
|
56
|
+
| PikkuFunctionSessionless<void, void, 'channel'>
|
|
57
|
+
| PikkuFunctionConfig<void, void, 'channel' | 'session' | 'rpc'>
|
|
59
58
|
) => {
|
|
60
59
|
return typeof func === 'function' ? { func } : func
|
|
61
60
|
}
|
|
@@ -72,8 +71,8 @@ export const pikkuChannelDisconnectionFunc = (
|
|
|
72
71
|
*/
|
|
73
72
|
export const pikkuChannelFunc = <In, Out = unknown>(
|
|
74
73
|
func:
|
|
75
|
-
| PikkuFunctionSessionless<In, Out,
|
|
76
|
-
|
|
|
74
|
+
| PikkuFunctionSessionless<In, Out, 'channel' | 'session' | 'rpc'>
|
|
75
|
+
| PikkuFunctionConfig<In, Out, 'channel' | 'session' | 'rpc'>
|
|
77
76
|
) => {
|
|
78
77
|
return typeof func === 'function' ? { func } : func
|
|
79
78
|
}
|
|
@@ -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.2
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* This provides the structure needed for TypeScript to be aware of channels
|
|
@@ -9,20 +9,20 @@
|
|
|
9
9
|
|
|
10
10
|
// Custom types are those that are defined directly within generics
|
|
11
11
|
// or are broken into simpler types
|
|
12
|
-
export type PikkuChannelsOutput = false | true
|
|
13
|
-
export type PikkuCLIOutput = false | true
|
|
14
|
-
export type PikkuFunctionsOutput = false | true
|
|
15
12
|
export type PikkuSchemasOutput = false | true
|
|
16
|
-
export type
|
|
17
|
-
export type PikkuMCPOutput = false | true
|
|
13
|
+
export type PikkuFunctionsOutput = false | true
|
|
18
14
|
export type PikkuMiddlewareOutput = false | true
|
|
19
15
|
export type PikkuPermissionsOutput = false | true
|
|
20
|
-
export type PikkuQueueOutput = false | true
|
|
21
|
-
export type PikkuPublicRPCOutput = false | true
|
|
22
|
-
export type PikkuRemoteRPCOutput = false | true
|
|
23
16
|
export type PikkuRPCOutput = false | true
|
|
17
|
+
export type PikkuPublicRPCOutput = false | true
|
|
18
|
+
export type PikkuHTTPOutput = false | true
|
|
24
19
|
export type PikkuSchedulerOutput = false | true
|
|
25
20
|
export type PikkuWorkflowOutput = false | true
|
|
21
|
+
export type PikkuRemoteRPCOutput = false | true
|
|
22
|
+
export type PikkuQueueOutput = false | true
|
|
23
|
+
export type PikkuChannelsOutput = false | true
|
|
24
|
+
export type PikkuMCPOutput = false | true
|
|
25
|
+
export type PikkuCLIOutput = false | true
|
|
26
26
|
|
|
27
27
|
interface ChannelHandler<I, O> {
|
|
28
28
|
input: I;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.2
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* WebSocket channel backend for 'pikku' CLI commands
|
|
6
|
+
*/
|
|
7
|
+
import { wireChannel } from '../channel/pikku-channel-types.gen.js'
|
|
8
|
+
import { pikkuMiddleware } from '../function/pikku-function-types.gen.js'
|
|
9
|
+
import { all } from '../../src/functions/commands/all.js'
|
|
10
|
+
import { bootstrap } from '../../src/functions/commands/bootstrap.js'
|
|
11
|
+
import { watch } from '../../src/functions/commands/watch.js'
|
|
12
|
+
import { pikkuSchemas } from '../../src/functions/wirings/functions/schemas.js'
|
|
13
|
+
import { pikkuFetch } from '../../src/functions/wirings/fetch/index.js'
|
|
14
|
+
import { pikkuWebSocketTyped } from '../../src/functions/wirings/channels/pikku-command-websocket-typed.js'
|
|
15
|
+
import { pikkuRPCClient } from '../../src/functions/wirings/rpc/pikku-command-rpc-client.js'
|
|
16
|
+
import { pikkuQueueService } from '../../src/functions/wirings/queue/pikku-command-queue-service.js'
|
|
17
|
+
import { pikkuOpenAPI } from '../../src/functions/wirings/http/pikku-command-openapi.js'
|
|
18
|
+
import { pikkuNext } from '../../src/functions/runtimes/nextjs/pikku-command-nextjs.js'
|
|
19
|
+
|
|
20
|
+
// Middleware to close the channel after CLI command completes
|
|
21
|
+
const cliCloseOnComplete = pikkuMiddleware(async (_services, { channel }, next) => {
|
|
22
|
+
const closeChannel = () => {
|
|
23
|
+
setTimeout(async () => {
|
|
24
|
+
try {
|
|
25
|
+
// This gives time for the response to be sent before closing
|
|
26
|
+
await channel?.close()
|
|
27
|
+
} catch (err) {
|
|
28
|
+
// Ignore errors on close
|
|
29
|
+
}
|
|
30
|
+
}, 200)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
try {
|
|
34
|
+
const result = await next()
|
|
35
|
+
closeChannel()
|
|
36
|
+
return result
|
|
37
|
+
} catch (error) {
|
|
38
|
+
closeChannel()
|
|
39
|
+
throw error
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
wireChannel({
|
|
44
|
+
name: 'pikku-cli',
|
|
45
|
+
route: '/cli/pikku',
|
|
46
|
+
auth: false,
|
|
47
|
+
onMessageWiring: {
|
|
48
|
+
command: {
|
|
49
|
+
'all': {
|
|
50
|
+
func: all,
|
|
51
|
+
middleware: [cliCloseOnComplete],
|
|
52
|
+
},
|
|
53
|
+
'bootstrap': {
|
|
54
|
+
func: bootstrap,
|
|
55
|
+
middleware: [cliCloseOnComplete],
|
|
56
|
+
},
|
|
57
|
+
'watch': {
|
|
58
|
+
func: watch,
|
|
59
|
+
middleware: [cliCloseOnComplete],
|
|
60
|
+
},
|
|
61
|
+
'schemas': {
|
|
62
|
+
func: pikkuSchemas,
|
|
63
|
+
middleware: [cliCloseOnComplete],
|
|
64
|
+
},
|
|
65
|
+
'fetch': {
|
|
66
|
+
func: pikkuFetch,
|
|
67
|
+
middleware: [cliCloseOnComplete],
|
|
68
|
+
},
|
|
69
|
+
'websocket': {
|
|
70
|
+
func: pikkuWebSocketTyped,
|
|
71
|
+
middleware: [cliCloseOnComplete],
|
|
72
|
+
},
|
|
73
|
+
'rpc': {
|
|
74
|
+
func: pikkuRPCClient,
|
|
75
|
+
middleware: [cliCloseOnComplete],
|
|
76
|
+
},
|
|
77
|
+
'queue-service': {
|
|
78
|
+
func: pikkuQueueService,
|
|
79
|
+
middleware: [cliCloseOnComplete],
|
|
80
|
+
},
|
|
81
|
+
'openapi': {
|
|
82
|
+
func: pikkuOpenAPI,
|
|
83
|
+
middleware: [cliCloseOnComplete],
|
|
84
|
+
},
|
|
85
|
+
'nextjs': {
|
|
86
|
+
func: pikkuNext,
|
|
87
|
+
middleware: [cliCloseOnComplete],
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
tags: ['cli', 'pikku']
|
|
92
|
+
})
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.2
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { executeCLIViaChannel } from '@pikku/core/cli/channel'
|
|
6
|
+
import { CorePikkuWebsocket } from '@pikku/websocket'
|
|
7
|
+
import '../pikku-bootstrap.gen.js'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Pikku CLI Client (via WebSocket Channel)
|
|
11
|
+
* Executes CLI commands over a WebSocket connection
|
|
12
|
+
*/
|
|
13
|
+
export async function PikkuCLIClient(
|
|
14
|
+
ws: WebSocket,
|
|
15
|
+
args?: string[]
|
|
16
|
+
): Promise<void> {
|
|
17
|
+
// Create Pikku WebSocket wrapper
|
|
18
|
+
const pikkuWS = new CorePikkuWebsocket(ws)
|
|
19
|
+
|
|
20
|
+
// Register renderers for CLI commands
|
|
21
|
+
const renderers = {}
|
|
22
|
+
|
|
23
|
+
await executeCLIViaChannel({
|
|
24
|
+
programName: 'pikku',
|
|
25
|
+
pikkuWS,
|
|
26
|
+
args,
|
|
27
|
+
renderers,
|
|
28
|
+
})
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Export as default for easy importing
|
|
32
|
+
export default PikkuCLIClient
|
|
33
|
+
|
|
34
|
+
// For direct execution (if this file is run directly)
|
|
35
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
36
|
+
const url = process.env.PIKKU_WS_URL || 'ws://localhost:4002/cli/pikku'
|
|
37
|
+
|
|
38
|
+
// Create WebSocket instance
|
|
39
|
+
let WebSocketImpl: any
|
|
40
|
+
if (typeof WebSocket !== 'undefined') {
|
|
41
|
+
WebSocketImpl = WebSocket
|
|
42
|
+
} else {
|
|
43
|
+
// Node.js environment - dynamically import 'ws'
|
|
44
|
+
const wsModule = await import('ws')
|
|
45
|
+
WebSocketImpl = wsModule.default
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const ws = new WebSocketImpl(url) as WebSocket
|
|
49
|
+
PikkuCLIClient(ws, process.argv.slice(2)).catch(error => {
|
|
50
|
+
console.error('Fatal channel CLI error:', error)
|
|
51
|
+
// TODO: We get an error code even when it exists cleanly, investigate
|
|
52
|
+
// process.exit(1)
|
|
53
|
+
})
|
|
54
|
+
}
|
|
@@ -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.2
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
|
|
@@ -49,7 +49,7 @@ export const pikkuCLIRender = <Data, RequiredServices extends SingletonServices
|
|
|
49
49
|
* CLI command configuration with project-specific types.
|
|
50
50
|
* Uses CoreCLICommandConfig from @pikku/core with local middleware and render types.
|
|
51
51
|
*/
|
|
52
|
-
type CLICommandConfig<Func extends PikkuFunctionConfig<In, Out>, In = any, Out = any, Params extends string = string> = CoreCLICommandConfig<Func, PikkuMiddleware, PikkuCLIRender<any>, Params>
|
|
52
|
+
type CLICommandConfig<Func extends PikkuFunctionConfig<In, Out, 'cli' | 'rpc' | 'session'>, In = any, Out = any, Params extends string = string> = CoreCLICommandConfig<Func, PikkuMiddleware, PikkuCLIRender<any>, Params>
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
55
|
* Type definition for CLI applications with commands and global options.
|
|
@@ -83,7 +83,7 @@ export const wireCLI = <Commands extends Record<string, CoreCLICommandConfig<any
|
|
|
83
83
|
* @returns CLI command configuration with inferred types
|
|
84
84
|
*/
|
|
85
85
|
export const pikkuCLICommand = <
|
|
86
|
-
FuncConfig extends PikkuFunctionConfig<any, any>,
|
|
86
|
+
FuncConfig extends PikkuFunctionConfig<any, any, 'cli' | 'rpc' | 'session'>,
|
|
87
87
|
Params extends string
|
|
88
88
|
>(
|
|
89
89
|
config: CLICommandConfig<FuncConfig, any, any, Params>
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
{
|
|
2
|
+
"programs": {
|
|
3
|
+
"pikku": {
|
|
4
|
+
"program": "pikku",
|
|
5
|
+
"commands": {
|
|
6
|
+
"all": {
|
|
7
|
+
"pikkuFuncName": "all",
|
|
8
|
+
"positionals": [],
|
|
9
|
+
"options": {
|
|
10
|
+
"tags": {
|
|
11
|
+
"description": "Filter functions by tags (comma-separated)",
|
|
12
|
+
"short": "t"
|
|
13
|
+
},
|
|
14
|
+
"types": {
|
|
15
|
+
"description": "Filter functions by types (comma-separated)"
|
|
16
|
+
},
|
|
17
|
+
"directories": {
|
|
18
|
+
"description": "Filter functions by directories (comma-separated)",
|
|
19
|
+
"short": "d"
|
|
20
|
+
},
|
|
21
|
+
"httpMethods": {
|
|
22
|
+
"description": "Filter HTTP routes by methods (comma-separated)"
|
|
23
|
+
},
|
|
24
|
+
"httpRoutes": {
|
|
25
|
+
"description": "Filter HTTP routes by route patterns (comma-separated)"
|
|
26
|
+
},
|
|
27
|
+
"names": {
|
|
28
|
+
"description": "Filter functions by name patterns (supports wildcards)",
|
|
29
|
+
"short": "n"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"description": "Generate all Pikku files (types, schemas, wirings, etc.)",
|
|
33
|
+
"isDefault": true
|
|
34
|
+
},
|
|
35
|
+
"bootstrap": {
|
|
36
|
+
"pikkuFuncName": "bootstrap",
|
|
37
|
+
"positionals": [],
|
|
38
|
+
"options": {},
|
|
39
|
+
"description": "Generate only type files (setup phase only)"
|
|
40
|
+
},
|
|
41
|
+
"watch": {
|
|
42
|
+
"pikkuFuncName": "watch",
|
|
43
|
+
"positionals": [],
|
|
44
|
+
"options": {},
|
|
45
|
+
"description": "Watch for file changes and regenerate automatically"
|
|
46
|
+
},
|
|
47
|
+
"schemas": {
|
|
48
|
+
"pikkuFuncName": "pikkuSchemas",
|
|
49
|
+
"positionals": [],
|
|
50
|
+
"options": {},
|
|
51
|
+
"description": "Generate JSON schemas for function input/output types"
|
|
52
|
+
},
|
|
53
|
+
"fetch": {
|
|
54
|
+
"pikkuFuncName": "pikkuFetch",
|
|
55
|
+
"positionals": [],
|
|
56
|
+
"options": {},
|
|
57
|
+
"description": "Generate type-safe HTTP fetch client"
|
|
58
|
+
},
|
|
59
|
+
"websocket": {
|
|
60
|
+
"pikkuFuncName": "pikkuWebSocketTyped",
|
|
61
|
+
"positionals": [],
|
|
62
|
+
"options": {},
|
|
63
|
+
"description": "Generate type-safe WebSocket client"
|
|
64
|
+
},
|
|
65
|
+
"rpc": {
|
|
66
|
+
"pikkuFuncName": "pikkuRPCClient",
|
|
67
|
+
"positionals": [],
|
|
68
|
+
"options": {},
|
|
69
|
+
"description": "Generate RPC client wrappers"
|
|
70
|
+
},
|
|
71
|
+
"queue-service": {
|
|
72
|
+
"pikkuFuncName": "pikkuQueueService",
|
|
73
|
+
"positionals": [],
|
|
74
|
+
"options": {},
|
|
75
|
+
"description": "Generate queue service wrapper"
|
|
76
|
+
},
|
|
77
|
+
"openapi": {
|
|
78
|
+
"pikkuFuncName": "pikkuOpenAPI",
|
|
79
|
+
"positionals": [],
|
|
80
|
+
"options": {},
|
|
81
|
+
"description": "Generate OpenAPI specification from HTTP routes"
|
|
82
|
+
},
|
|
83
|
+
"nextjs": {
|
|
84
|
+
"pikkuFuncName": "pikkuNext",
|
|
85
|
+
"positionals": [],
|
|
86
|
+
"options": {},
|
|
87
|
+
"description": "Generate Next.js backend and HTTP wrappers"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"options": {
|
|
91
|
+
"config": {
|
|
92
|
+
"description": "Path to pikku.config.json file",
|
|
93
|
+
"short": "c"
|
|
94
|
+
},
|
|
95
|
+
"logLevel": {
|
|
96
|
+
"description": "Set log level",
|
|
97
|
+
"short": "l",
|
|
98
|
+
"choices": [
|
|
99
|
+
"trace",
|
|
100
|
+
"debug",
|
|
101
|
+
"info",
|
|
102
|
+
"warn",
|
|
103
|
+
"error",
|
|
104
|
+
"critical"
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
"userSessionType": {
|
|
108
|
+
"description": "Specify which UserSession type to use (when multiple exist)"
|
|
109
|
+
},
|
|
110
|
+
"singletonServicesFactoryType": {
|
|
111
|
+
"description": "Specify which singleton services factory to use"
|
|
112
|
+
},
|
|
113
|
+
"wireServicesFactoryType": {
|
|
114
|
+
"description": "Specify which wire services factory to use"
|
|
115
|
+
},
|
|
116
|
+
"stateOutput": {
|
|
117
|
+
"description": "Save inspector state to JSON file for reuse"
|
|
118
|
+
},
|
|
119
|
+
"stateInput": {
|
|
120
|
+
"description": "Load inspector state from JSON file (skips inspection)"
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"renderers": {
|
|
126
|
+
"defaultCLIRenderer": {
|
|
127
|
+
"name": "defaultCLIRenderer",
|
|
128
|
+
"exportedName": "defaultCLIRenderer",
|
|
129
|
+
"services": {
|
|
130
|
+
"optimized": true,
|
|
131
|
+
"services": [
|
|
132
|
+
"logger",
|
|
133
|
+
"getInspectorState",
|
|
134
|
+
"schema",
|
|
135
|
+
"jwt",
|
|
136
|
+
"config",
|
|
137
|
+
"variables",
|
|
138
|
+
"workflowService",
|
|
139
|
+
"queueService",
|
|
140
|
+
"schedulerService"
|
|
141
|
+
]
|
|
142
|
+
},
|
|
143
|
+
"filePath": "src/services.ts"
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
@@ -1,37 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.11.
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.2
|
|
3
3
|
*/
|
|
4
4
|
import { pikkuState } from '@pikku/core'
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"defaultCLIRenderer": {
|
|
9
|
-
"name": "defaultCLIRenderer",
|
|
10
|
-
"exportedName": "defaultCLIRenderer",
|
|
11
|
-
"services": {
|
|
12
|
-
"optimized": true,
|
|
13
|
-
"services": [
|
|
14
|
-
"logger",
|
|
15
|
-
"getInspectorState",
|
|
16
|
-
"schema",
|
|
17
|
-
"jwt",
|
|
18
|
-
"config",
|
|
19
|
-
"variables",
|
|
20
|
-
"workflowService",
|
|
21
|
-
"queueService",
|
|
22
|
-
"schedulerService"
|
|
23
|
-
]
|
|
24
|
-
},
|
|
25
|
-
"filePath": "src/services.ts"
|
|
26
|
-
},
|
|
27
|
-
"clientCLIRenderer": {
|
|
28
|
-
"name": "clientCLIRenderer",
|
|
29
|
-
"exportedName": "clientCLIRenderer",
|
|
30
|
-
"services": {
|
|
31
|
-
"optimized": true,
|
|
32
|
-
"services": []
|
|
33
|
-
},
|
|
34
|
-
"filePath": "src/services.ts"
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
})
|
|
5
|
+
import { CLIMeta } from '@pikku/core/cli'
|
|
6
|
+
import metaData from './pikku-cli-wirings-meta.gen.json' with { type: 'json' }
|
|
7
|
+
pikkuState('cli', 'meta', metaData as CLIMeta)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.2
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { executeCLI, CLIError } from '@pikku/core/cli'
|
|
6
|
+
import { createConfig as createConfig } from '../../src/services.js'
|
|
7
|
+
import { createSingletonServices as createSingletonServices } from '../../src/services.js'
|
|
8
|
+
import { createWireServices as createWireServices } from '../../src/services.js'
|
|
9
|
+
import '../pikku-bootstrap.gen.js'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Pikku CLI function
|
|
13
|
+
* Handles command line arguments and executes the appropriate function
|
|
14
|
+
*/
|
|
15
|
+
export async function PikkuCLI(args: string[]): Promise<void> {
|
|
16
|
+
try {
|
|
17
|
+
await executeCLI({
|
|
18
|
+
programName: 'pikku',
|
|
19
|
+
args: args || process.argv.slice(2),
|
|
20
|
+
createConfig,
|
|
21
|
+
createSingletonServices,
|
|
22
|
+
createWireServices,
|
|
23
|
+
})
|
|
24
|
+
} catch (error) {
|
|
25
|
+
if (error instanceof CLIError) {
|
|
26
|
+
process.exit(error.exitCode)
|
|
27
|
+
}
|
|
28
|
+
throw error
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Export as default for easy importing
|
|
33
|
+
export default PikkuCLI
|
|
34
|
+
|
|
35
|
+
// For direct execution (if this file is run directly)
|
|
36
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
37
|
+
PikkuCLI(process.argv.slice(2)).catch(error => {
|
|
38
|
+
console.error('Fatal error:', error.message)
|
|
39
|
+
process.exit(1)
|
|
40
|
+
})
|
|
41
|
+
}
|