@pikku/cli 0.10.1 → 0.11.0
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 +4 -3
- package/.pikku/channel/pikku-channels-map.gen.d.ts +5 -2
- package/.pikku/channel/pikku-channels-meta.gen.ts +1 -1
- package/.pikku/channel/pikku-channels.gen.ts +1 -1
- package/.pikku/cli/pikku-cli-types.gen.ts +23 -1
- package/.pikku/cli/pikku-cli-wirings-meta.gen.ts +8 -116
- package/.pikku/cli/pikku-cli-wirings.gen.ts +2 -3
- package/.pikku/function/pikku-function-types.gen.ts +1 -1
- package/.pikku/function/pikku-functions-meta.gen.ts +265 -138
- package/.pikku/function/pikku-functions-meta.min.gen.ts +62 -32
- package/.pikku/function/pikku-functions.gen.ts +9 -1
- package/.pikku/http/pikku-http-types.gen.ts +1 -1
- package/.pikku/http/pikku-http-wirings-map.gen.d.ts +5 -2
- 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 +1 -1
- package/.pikku/mcp/pikku-mcp-wirings-meta.gen.ts +1 -1
- package/.pikku/mcp/pikku-mcp-wirings.gen.ts +1 -1
- package/.pikku/pikku-bootstrap.gen.ts +4 -1
- package/.pikku/pikku-services.gen.ts +21 -12
- package/.pikku/pikku-types.gen.ts +1 -1
- package/.pikku/pikku-websocket.gen.ts +15 -1
- package/.pikku/queue/pikku-queue-types.gen.ts +1 -1
- package/.pikku/queue/pikku-queue-workers-wirings-map.gen.d.ts +5 -2
- package/.pikku/queue/pikku-queue-workers-wirings-meta.gen.ts +7 -2
- package/.pikku/queue/pikku-queue-workers-wirings.gen.ts +1 -1
- package/.pikku/rpc/pikku-remote-rpc-workers.gen.ts +27 -0
- package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +13 -3
- package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +26 -10
- package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +15 -9
- package/.pikku/scheduler/pikku-scheduler-types.gen.ts +1 -1
- package/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.ts +1 -1
- package/.pikku/scheduler/pikku-schedulers-wirings.gen.ts +1 -1
- package/.pikku/schemas/register.gen.ts +17 -5
- package/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuChannelsOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuPublicRPCOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/PikkuRemoteRPCOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/PikkuSchemasOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuWorkflowOutput.schema.json +1 -0
- package/.pikku/workflow/pikku-workflow-map.gen.d.ts +62 -0
- package/.pikku/workflow/pikku-workflow-types.gen.ts +92 -0
- package/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +5 -0
- package/.pikku/workflow/pikku-workflow-wirings.gen.ts +4 -0
- package/CHANGELOG.md +57 -0
- package/bin/pikku.ts +30 -21
- package/cli.schema.json +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +4 -3
- 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-types.gen.d.ts +18 -1
- package/dist/.pikku/cli/pikku-cli-types.gen.js +20 -1
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +8 -116
- package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -2
- package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -2
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.js +265 -138
- package/dist/.pikku/function/pikku-functions-meta.min.gen.js +62 -32
- package/dist/.pikku/function/pikku-functions.gen.js +9 -1
- 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/mcp/pikku-mcp-wirings-meta.gen.js +1 -1
- 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 +4 -1
- package/dist/.pikku/pikku-bootstrap.gen.js +4 -1
- package/dist/.pikku/pikku-services.gen.d.ts +15 -6
- package/dist/.pikku/pikku-services.gen.js +14 -2
- 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 +15 -1
- package/dist/.pikku/pikku-websocket.gen.js +15 -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 +7 -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 +17 -0
- package/dist/.pikku/rpc/pikku-remote-rpc-workers.gen.js +22 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +15 -9
- 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 +1 -1
- 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 +9 -3
- 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/PikkuPublicRPCOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuRemoteInternalRPCInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuRemoteRPCOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuSchemasOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuWorkflowOutput.schema.json +1 -0
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +58 -0
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +28 -0
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +5 -0
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +4 -0
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +5 -0
- package/dist/bin/pikku.js +24 -19
- package/dist/src/cli.wiring.js +107 -99
- package/dist/src/functions/commands/all.js +51 -2
- package/dist/src/functions/commands/bootstrap.d.ts +1 -0
- package/dist/src/functions/commands/bootstrap.js +24 -0
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.js +46 -2
- package/dist/src/functions/wirings/channels/serialize-channel-types.js +3 -2
- package/dist/src/functions/wirings/channels/serialize-websocket-wrapper.js +14 -0
- package/dist/src/functions/wirings/cli/pikku-command-cli-entry.js +4 -4
- package/dist/src/functions/wirings/cli/serialize-channel-cli-client.js +20 -7
- package/dist/src/functions/wirings/cli/serialize-channel-cli.js +32 -7
- package/dist/src/functions/wirings/cli/serialize-cli-types.js +22 -0
- package/dist/src/functions/wirings/functions/pikku-command-services.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-services.js +54 -26
- package/dist/src/functions/wirings/functions/schemas.js +2 -2
- package/dist/src/functions/wirings/http/pikku-command-openapi.js +1 -1
- package/dist/src/functions/wirings/middleware/pikku-command-middleware.js +3 -10
- package/dist/src/functions/wirings/queue/pikku-queue.js +9 -1
- package/dist/src/functions/wirings/queue/serialize-queue-map.d.ts +2 -2
- package/dist/src/functions/wirings/queue/serialize-queue-meta.d.ts +2 -2
- package/dist/src/functions/wirings/rpc/pikku-command-public-rpc.d.ts +1 -0
- package/dist/src/functions/wirings/rpc/pikku-command-public-rpc.js +23 -0
- package/dist/src/functions/wirings/rpc/pikku-command-remote-rpc.d.ts +1 -0
- package/dist/src/functions/wirings/rpc/pikku-command-remote-rpc.js +23 -0
- package/dist/src/functions/wirings/rpc/serialize-public-rpc.d.ts +4 -0
- package/dist/src/functions/wirings/rpc/serialize-public-rpc.js +30 -0
- package/dist/src/functions/wirings/rpc/serialize-remote-rpc.d.ts +4 -0
- package/dist/src/functions/wirings/rpc/serialize-remote-rpc.js +30 -0
- package/dist/src/functions/wirings/rpc/serialize-rpc-wrapper.js +2 -2
- package/dist/src/functions/wirings/rpc/serialize-typed-rpc-map.js +27 -3
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-map.d.ts +1 -0
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-map.js +12 -0
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-types.d.ts +1 -0
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-types.js +11 -0
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.d.ts +1 -0
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.js +55 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-map.d.ts +4 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-map.js +79 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-meta.d.ts +2 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-meta.js +10 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-types.d.ts +4 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-types.js +95 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-workers.d.ts +4 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-workers.js +60 -0
- package/dist/src/middleware/log-command-info-and-time.d.ts +1 -1
- package/dist/src/middleware/log-command-info-and-time.js +8 -5
- package/dist/src/services/cli-logger-forwarder.service.js +1 -1
- package/dist/src/services/cli-logger.service.d.ts +7 -2
- package/dist/src/services/cli-logger.service.js +17 -5
- package/dist/src/services.js +77 -12
- package/dist/src/utils/command-summary.d.ts +44 -0
- package/dist/src/utils/command-summary.js +74 -0
- package/dist/src/utils/file-writer.js +2 -2
- package/dist/src/utils/pikku-cli-config.js +48 -0
- package/dist/src/utils/schema-generator.d.ts +2 -2
- package/dist/src/utils/schema-generator.js +31 -10
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -4
- package/pikku.config.json +5 -2
- package/src/cli.wiring.ts +106 -101
- package/src/functions/commands/all.ts +66 -2
- package/src/functions/commands/bootstrap.ts +28 -0
- package/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.ts +46 -2
- package/src/functions/wirings/channels/serialize-channel-types.ts +3 -2
- package/src/functions/wirings/channels/serialize-websocket-wrapper.ts +14 -0
- package/src/functions/wirings/cli/pikku-command-cli-entry.ts +4 -4
- package/src/functions/wirings/cli/serialize-channel-cli-client.ts +20 -7
- package/src/functions/wirings/cli/serialize-channel-cli.ts +40 -8
- package/src/functions/wirings/cli/serialize-cli-types.ts +22 -0
- package/src/functions/wirings/functions/pikku-command-services.ts +57 -28
- package/src/functions/wirings/functions/schemas.ts +4 -3
- package/src/functions/wirings/http/pikku-command-openapi.ts +2 -1
- package/src/functions/wirings/middleware/pikku-command-middleware.ts +11 -22
- package/src/functions/wirings/queue/pikku-queue.ts +10 -1
- package/src/functions/wirings/queue/serialize-queue-map.ts +3 -3
- package/src/functions/wirings/queue/serialize-queue-meta.ts +2 -2
- package/src/functions/wirings/rpc/pikku-command-public-rpc.ts +32 -0
- package/src/functions/wirings/rpc/pikku-command-remote-rpc.ts +35 -0
- package/src/functions/wirings/rpc/serialize-public-rpc.ts +30 -0
- package/src/functions/wirings/rpc/serialize-remote-rpc.ts +30 -0
- package/src/functions/wirings/rpc/serialize-rpc-wrapper.ts +2 -2
- package/src/functions/wirings/rpc/serialize-typed-rpc-map.ts +26 -3
- package/src/functions/wirings/workflow/pikku-command-workflow-map.ts +24 -0
- package/src/functions/wirings/workflow/pikku-command-workflow-types.ts +22 -0
- package/src/functions/wirings/workflow/pikku-command-workflow.ts +123 -0
- package/src/functions/wirings/workflow/serialize-workflow-map.ts +123 -0
- package/src/functions/wirings/workflow/serialize-workflow-meta.ts +16 -0
- package/src/functions/wirings/workflow/serialize-workflow-types.ts +95 -0
- package/src/functions/wirings/workflow/serialize-workflow-workers.ts +60 -0
- package/src/middleware/log-command-info-and-time.ts +8 -5
- package/src/services/cli-logger-forwarder.service.ts +1 -1
- package/src/services/cli-logger.service.ts +21 -6
- package/src/services.ts +86 -11
- package/src/utils/command-summary.ts +103 -0
- package/src/utils/file-writer.ts +2 -2
- package/src/utils/pikku-cli-config.ts +68 -0
- package/src/utils/schema-generator.ts +30 -11
- package/types/application-types.d.ts +5 -1
- package/types/config.d.ts +61 -6
- package/.pikku/cli/pikku-cli-channel.gen.ts +0 -34
- package/.pikku/cli/pikku-cli-client.gen.ts +0 -43
- package/.pikku/cli/pikku-cli.gen.ts +0 -41
- package/dist/.pikku/cli/pikku-cli-channel.gen.js +0 -33
- package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +0 -10
- package/dist/.pikku/cli/pikku-cli-client.gen.js +0 -34
- package/dist/.pikku/cli/pikku-cli.gen.d.ts +0 -10
- package/dist/.pikku/cli/pikku-cli.gen.js +0 -38
- /package/dist/.pikku/{cli/pikku-cli-channel.gen.d.ts → workflow/pikku-workflow-wirings-meta.gen.d.ts} +0 -0
|
@@ -1,41 +1,47 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.0
|
|
3
3
|
*/
|
|
4
4
|
import { pikkuState } from '@pikku/core'
|
|
5
5
|
pikkuState('rpc', 'meta', {
|
|
6
|
-
"pikkuSchemas": "pikkuSchemas",
|
|
7
|
-
"pikkuFetch": "pikkuFetch",
|
|
8
|
-
"pikkuWebSocketTyped": "pikkuWebSocketTyped",
|
|
9
|
-
"pikkuRPCClient": "pikkuRPCClient",
|
|
10
|
-
"pikkuQueueService": "pikkuQueueService",
|
|
11
|
-
"pikkuOpenAPI": "pikkuOpenAPI",
|
|
12
|
-
"pikkuNext": "pikkuNext",
|
|
13
6
|
"all": "all",
|
|
7
|
+
"bootstrap": "bootstrap",
|
|
14
8
|
"watch": "watch",
|
|
9
|
+
"pikkuNext": "pikkuNext",
|
|
15
10
|
"pikkuChannels": "pikkuChannels",
|
|
16
11
|
"pikkuChannelTypes": "pikkuChannelTypes",
|
|
17
12
|
"pikkuChannelsMap": "pikkuChannelsMap",
|
|
13
|
+
"pikkuWebSocketTyped": "pikkuWebSocketTyped",
|
|
18
14
|
"pikkuCLIEntry": "pikkuCLIEntry",
|
|
19
15
|
"pikkuCLITypes": "pikkuCLITypes",
|
|
20
16
|
"pikkuCLI": "pikkuCLI",
|
|
17
|
+
"pikkuFetch": "pikkuFetch",
|
|
21
18
|
"pikkuFunctionTypesSplit": "pikkuFunctionTypesSplit",
|
|
22
19
|
"pikkuFunctionTypes": "pikkuFunctionTypes",
|
|
23
20
|
"pikkuFunctions": "pikkuFunctions",
|
|
24
21
|
"pikkuServices": "pikkuServices",
|
|
22
|
+
"pikkuSchemas": "pikkuSchemas",
|
|
25
23
|
"pikkuHTTPMap": "pikkuHTTPMap",
|
|
26
24
|
"pikkuHTTP": "pikkuHTTP",
|
|
27
25
|
"pikkuHTTPTypes": "pikkuHTTPTypes",
|
|
26
|
+
"pikkuOpenAPI": "pikkuOpenAPI",
|
|
28
27
|
"pikkuMCPJSON": "pikkuMCPJSON",
|
|
29
28
|
"pikkuMCPTypes": "pikkuMCPTypes",
|
|
30
29
|
"pikkuMCP": "pikkuMCP",
|
|
31
30
|
"pikkuMiddleware": "pikkuMiddleware",
|
|
32
31
|
"pikkuPermissions": "pikkuPermissions",
|
|
33
32
|
"pikkuQueueMap": "pikkuQueueMap",
|
|
33
|
+
"pikkuQueueService": "pikkuQueueService",
|
|
34
34
|
"pikkuQueueTypes": "pikkuQueueTypes",
|
|
35
35
|
"pikkuQueue": "pikkuQueue",
|
|
36
|
+
"pikkuPublicRPC": "pikkuPublicRPC",
|
|
37
|
+
"pikkuRemoteRPC": "pikkuRemoteRPC",
|
|
38
|
+
"pikkuRPCClient": "pikkuRPCClient",
|
|
36
39
|
"pikkuRPCInternalMap": "pikkuRPCInternalMap",
|
|
37
40
|
"pikkuRPCExposedMap": "pikkuRPCExposedMap",
|
|
38
41
|
"pikkuRPC": "pikkuRPC",
|
|
39
42
|
"pikkuSchedulerTypes": "pikkuSchedulerTypes",
|
|
40
|
-
"pikkuScheduler": "pikkuScheduler"
|
|
43
|
+
"pikkuScheduler": "pikkuScheduler",
|
|
44
|
+
"pikkuWorkflowMap": "pikkuWorkflowMap",
|
|
45
|
+
"pikkuWorkflowTypes": "pikkuWorkflowTypes",
|
|
46
|
+
"pikkuWorkflow": "pikkuWorkflow"
|
|
41
47
|
})
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.0
|
|
3
3
|
*/
|
|
4
4
|
import { addSchema } from '@pikku/core/schema'
|
|
5
5
|
|
|
6
|
-
import * as PikkuSchemasOutput from './schemas/PikkuSchemasOutput.schema.json' with { type: 'json' }
|
|
7
|
-
addSchema('PikkuSchemasOutput', PikkuSchemasOutput)
|
|
8
|
-
|
|
9
|
-
|
|
10
6
|
import * as PikkuChannelsOutput from './schemas/PikkuChannelsOutput.schema.json' with { type: 'json' }
|
|
11
7
|
addSchema('PikkuChannelsOutput', PikkuChannelsOutput)
|
|
12
8
|
|
|
@@ -19,6 +15,10 @@ import * as PikkuFunctionsOutput from './schemas/PikkuFunctionsOutput.schema.jso
|
|
|
19
15
|
addSchema('PikkuFunctionsOutput', PikkuFunctionsOutput)
|
|
20
16
|
|
|
21
17
|
|
|
18
|
+
import * as PikkuSchemasOutput from './schemas/PikkuSchemasOutput.schema.json' with { type: 'json' }
|
|
19
|
+
addSchema('PikkuSchemasOutput', PikkuSchemasOutput)
|
|
20
|
+
|
|
21
|
+
|
|
22
22
|
import * as PikkuHTTPOutput from './schemas/PikkuHTTPOutput.schema.json' with { type: 'json' }
|
|
23
23
|
addSchema('PikkuHTTPOutput', PikkuHTTPOutput)
|
|
24
24
|
|
|
@@ -39,6 +39,14 @@ import * as PikkuQueueOutput from './schemas/PikkuQueueOutput.schema.json' with
|
|
|
39
39
|
addSchema('PikkuQueueOutput', PikkuQueueOutput)
|
|
40
40
|
|
|
41
41
|
|
|
42
|
+
import * as PikkuPublicRPCOutput from './schemas/PikkuPublicRPCOutput.schema.json' with { type: 'json' }
|
|
43
|
+
addSchema('PikkuPublicRPCOutput', PikkuPublicRPCOutput)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
import * as PikkuRemoteRPCOutput from './schemas/PikkuRemoteRPCOutput.schema.json' with { type: 'json' }
|
|
47
|
+
addSchema('PikkuRemoteRPCOutput', PikkuRemoteRPCOutput)
|
|
48
|
+
|
|
49
|
+
|
|
42
50
|
import * as PikkuRPCOutput from './schemas/PikkuRPCOutput.schema.json' with { type: 'json' }
|
|
43
51
|
addSchema('PikkuRPCOutput', PikkuRPCOutput)
|
|
44
52
|
|
|
@@ -47,5 +55,9 @@ import * as PikkuSchedulerOutput from './schemas/PikkuSchedulerOutput.schema.jso
|
|
|
47
55
|
addSchema('PikkuSchedulerOutput', PikkuSchedulerOutput)
|
|
48
56
|
|
|
49
57
|
|
|
58
|
+
import * as PikkuWorkflowOutput from './schemas/PikkuWorkflowOutput.schema.json' with { type: 'json' }
|
|
59
|
+
addSchema('PikkuWorkflowOutput', PikkuWorkflowOutput)
|
|
60
|
+
|
|
61
|
+
|
|
50
62
|
import * as PikkuCLIConfig from './schemas/PikkuCLIConfig.schema.json' with { type: 'json' }
|
|
51
63
|
addSchema('PikkuCLIConfig', PikkuCLIConfig)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","additionalProperties":false,"properties":{"outDir":{"type":"string"},"schemaDirectory":{"type":"string"},"typesDeclarationFile":{"type":"string"},"functionsFile":{"type":"string"},"functionsMetaFile":{"type":"string"},"functionsMetaMinFile":{"type":"string"},"functionTypesFile":{"type":"string"},"httpWiringsFile":{"type":"string"},"httpWiringMetaFile":{"type":"string"},"httpMapDeclarationFile":{"type":"string"},"httpTypesFile":{"type":"string"},"channelsWiringFile":{"type":"string"},"channelsWiringMetaFile":{"type":"string"},"channelsMapDeclarationFile":{"type":"string"},"channelsTypesFile":{"type":"string"},"rpcInternalWiringMetaFile":{"type":"string"},"rpcInternalMapDeclarationFile":{"type":"string"},"rpcMapDeclarationFile":{"type":"string"},"schedulersWiringFile":{"type":"string"},"schedulersWiringMetaFile":{"type":"string"},"schedulersTypesFile":{"type":"string"},"queueWorkersWiringFile":{"type":"string"},"queueWorkersWiringMetaFile":{"type":"string"},"queueMapDeclarationFile":{"type":"string"},"queueTypesFile":{"type":"string"},"mcpWiringsFile":{"type":"string"},"mcpWiringsMetaFile":{"type":"string"},"mcpTypesFile":{"type":"string"},"cliWiringsFile":{"type":"string"},"cliWiringMetaFile":{"type":"string"},"cliBootstrapFile":{"type":"string"},"cliTypesFile":{"type":"string"},"servicesFile":{"type":"string"},"middlewareFile":{"type":"string"},"middlewareGroupsMetaFile":{"type":"string"},"permissionsFile":{"type":"string"},"bootstrapFile":{"type":"string"},"$schema":{"type":"string"},"extends":{"type":"string"},"rootDir":{"type":"string"},"srcDirectories":{"type":"array","items":{"type":"string"}},"
|
|
1
|
+
{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","additionalProperties":false,"properties":{"outDir":{"type":"string"},"schemaDirectory":{"type":"string"},"typesDeclarationFile":{"type":"string"},"functionsFile":{"type":"string"},"functionsMetaFile":{"type":"string"},"functionsMetaMinFile":{"type":"string"},"functionTypesFile":{"type":"string"},"httpWiringsFile":{"type":"string"},"httpWiringMetaFile":{"type":"string"},"httpMapDeclarationFile":{"type":"string"},"httpTypesFile":{"type":"string"},"channelsWiringFile":{"type":"string"},"channelsWiringMetaFile":{"type":"string"},"channelsMapDeclarationFile":{"type":"string"},"channelsTypesFile":{"type":"string"},"rpcInternalWiringMetaFile":{"type":"string"},"rpcInternalMapDeclarationFile":{"type":"string"},"rpcMapDeclarationFile":{"type":"string"},"schedulersWiringFile":{"type":"string"},"schedulersWiringMetaFile":{"type":"string"},"schedulersTypesFile":{"type":"string"},"queueWorkersWiringFile":{"type":"string"},"queueWorkersWiringMetaFile":{"type":"string"},"queueMapDeclarationFile":{"type":"string"},"queueTypesFile":{"type":"string"},"workflowsWiringFile":{"type":"string"},"workflowsWiringMetaFile":{"type":"string"},"workflowsWorkersFile":{"type":"string"},"workflowMapDeclarationFile":{"type":"string"},"workflowTypesFile":{"type":"string"},"mcpWiringsFile":{"type":"string"},"mcpWiringsMetaFile":{"type":"string"},"mcpTypesFile":{"type":"string"},"cliWiringsFile":{"type":"string"},"cliWiringMetaFile":{"type":"string"},"cliBootstrapFile":{"type":"string"},"cliTypesFile":{"type":"string"},"servicesFile":{"type":"string"},"middlewareFile":{"type":"string"},"middlewareGroupsMetaFile":{"type":"string"},"permissionsFile":{"type":"string"},"bootstrapFile":{"type":"string"},"$schema":{"type":"string"},"extends":{"type":"string"},"rootDir":{"type":"string"},"srcDirectories":{"type":"array","items":{"type":"string"}},"ignoreFiles":{"type":"array","items":{"type":"string"}},"packageMappings":{"type":"object","additionalProperties":{"type":"string"}},"configFile":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"types":{"type":"array","items":{"type":"string"}},"userSessionType":{"type":"string"},"singletonServicesFactoryType":{"type":"string"},"sessionServicesFactoryType":{"type":"string"},"configDir":{"type":"string"},"tsconfig":{"type":"string"},"nextBackendFile":{"type":"string"},"nextHTTPFile":{"type":"string"},"fetchFile":{"type":"string"},"websocketFile":{"type":"string"},"rpcWiringsFile":{"type":"string"},"queueWiringsFile":{"type":"string"},"mcpJsonFile":{"type":"string"},"openAPI":{"type":"object","properties":{"outputFile":{"type":"string"},"additionalInfo":{"$ref":"#/definitions/OpenAPISpecInfo"}},"required":["outputFile","additionalInfo"],"additionalProperties":false},"schema":{"type":"object","properties":{"additionalProperties":{"type":"boolean"},"supportsImportAttributes":{"type":"boolean"}},"additionalProperties":false},"cli":{"type":"object","properties":{"entrypoints":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","const":"local"},"path":{"type":"string"}},"required":["type","path"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"channel"},"name":{"type":"string"},"route":{"type":"string"},"wirePath":{"type":"string"},"path":{"type":"string"}},"required":["type","wirePath"],"additionalProperties":false},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","const":"local"},"path":{"type":"string"}},"required":["type","path"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"channel"},"name":{"type":"string"},"route":{"type":"string"},"wirePath":{"type":"string"},"path":{"type":"string"}},"required":["type","wirePath"],"additionalProperties":false}]}}]}}},"additionalProperties":false},"workflows":{"anyOf":[{"type":"object","properties":{"singleQueue":{"type":"boolean","const":true},"path":{"type":"string"},"orchestratorQueue":{"type":"string"},"workerQueue":{"type":"string"}},"required":["singleQueue","path"],"additionalProperties":false},{"type":"object","properties":{"singleQueue":{"type":"boolean","const":false},"dir":{"type":"string"},"orchestratorQueuePrefix":{"type":"string"},"workerQueuePrefix":{"type":"string"}},"required":["singleQueue","dir"],"additionalProperties":false}]},"rpc":{"type":"object","properties":{"remoteRpcWorkersPath":{"type":"string"},"publicRpcPath":{"type":"string"}},"additionalProperties":false},"forceRequiredServices":{"type":"array","items":{"type":"string"}},"schemasFromTypes":{"type":"array","items":{"type":"string"}},"stateOutput":{"type":"string"},"stateInput":{"type":"string"},"filters":{"$ref":"#/definitions/InspectorFilters"}},"required":["bootstrapFile","channelsMapDeclarationFile","channelsTypesFile","channelsWiringFile","channelsWiringMetaFile","cliBootstrapFile","cliTypesFile","cliWiringMetaFile","cliWiringsFile","configDir","filters","functionTypesFile","functionsFile","functionsMetaFile","functionsMetaMinFile","httpMapDeclarationFile","httpTypesFile","httpWiringMetaFile","httpWiringsFile","mcpTypesFile","mcpWiringsFile","mcpWiringsMetaFile","middlewareFile","middlewareGroupsMetaFile","outDir","packageMappings","permissionsFile","queueMapDeclarationFile","queueTypesFile","queueWorkersWiringFile","queueWorkersWiringMetaFile","rootDir","rpcInternalMapDeclarationFile","rpcInternalWiringMetaFile","rpcMapDeclarationFile","schedulersTypesFile","schedulersWiringFile","schedulersWiringMetaFile","schemaDirectory","servicesFile","srcDirectories","tsconfig","typesDeclarationFile","workflowMapDeclarationFile","workflowTypesFile","workflowsWiringFile","workflowsWiringMetaFile","workflowsWorkersFile"],"definitions":{"OpenAPISpecInfo":{"type":"object","properties":{"info":{"type":"object","properties":{"title":{"type":"string"},"version":{"type":"string"},"description":{"type":"string"},"termsOfService":{"type":"string"},"contact":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"},"email":{"type":"string"}},"additionalProperties":false},"license":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"}},"required":["name"],"additionalProperties":false}},"required":["title","version","description"],"additionalProperties":false},"servers":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"description":{"type":"string"}},"required":["url"],"additionalProperties":false}},"tags":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"}},"required":["name"],"additionalProperties":false}},"externalDocs":{"type":"object","properties":{"description":{"type":"string"},"url":{"type":"string"}},"required":["url"],"additionalProperties":false},"securitySchemes":{"type":"object"},"security":{"type":"array","items":{"type":"object","additionalProperties":{"type":"array","items":{}}}}},"required":["info","servers"],"additionalProperties":false},"InspectorFilters":{"type":"object","properties":{"names":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"types":{"type":"array","items":{"type":"string"}},"directories":{"type":"array","items":{"type":"string"}},"httpRoutes":{"type":"array","items":{"type":"string"}},"httpMethods":{"type":"array","items":{"type":"string"}}},"additionalProperties":false}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"http://json-schema.org/draft-07/schema#","type":"boolean","enum":[false,true],"definitions":{}}
|
|
1
|
+
{"$schema":"http://json-schema.org/draft-07/schema#","type":"boolean","enum":[false,true],"description":"This provides the structure needed for typescript to be aware of RPCs and their return types","definitions":{}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"$schema":"http://json-schema.org/draft-07/schema#","type":"boolean","enum":[false,true],"definitions":{}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"$schema":"http://json-schema.org/draft-07/schema#","type":"boolean","enum":[false,true],"definitions":{}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"http://json-schema.org/draft-07/schema#","type":"boolean","enum":[false,true],"
|
|
1
|
+
{"$schema":"http://json-schema.org/draft-07/schema#","type":"boolean","enum":[false,true],"definitions":{}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"$schema":"http://json-schema.org/draft-07/schema#","type":"boolean","enum":[false,true],"definitions":{}}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.0
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* This provides the structure needed for TypeScript to be aware of workflows and their input/output types
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
// Custom types are those that are defined directly within generics
|
|
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
|
+
export type PikkuSchemasOutput = false | true
|
|
16
|
+
export type PikkuHTTPOutput = false | true
|
|
17
|
+
export type PikkuMCPOutput = false | true
|
|
18
|
+
export type PikkuMiddlewareOutput = false | true
|
|
19
|
+
export type PikkuPermissionsOutput = false | true
|
|
20
|
+
export type PikkuQueueOutput = false | true
|
|
21
|
+
export type PikkuPublicRPCOutput = false | true
|
|
22
|
+
export type PikkuRemoteRPCOutput = false | true
|
|
23
|
+
export type PikkuRPCOutput = false | true
|
|
24
|
+
export type PikkuSchedulerOutput = false | true
|
|
25
|
+
export type PikkuWorkflowOutput = false | true
|
|
26
|
+
|
|
27
|
+
interface WorkflowHandler<I, O> {
|
|
28
|
+
input: I;
|
|
29
|
+
output: O;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type WorkflowMap = {
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Type-safe workflow client API
|
|
38
|
+
*/
|
|
39
|
+
export type WorkflowClient<Name extends keyof WorkflowMap> = {
|
|
40
|
+
/**
|
|
41
|
+
* Start a new workflow run
|
|
42
|
+
*/
|
|
43
|
+
start: (input: WorkflowMap[Name]['input']) => Promise<{ runId: string }>;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Get a workflow run by ID
|
|
47
|
+
*/
|
|
48
|
+
getRun: <output extends keyof WorkflowMap[Name]>(runId: string) => Promise<WorkflowMap[Name][output]>;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Cancel a running workflow
|
|
52
|
+
*/
|
|
53
|
+
cancelRun: (runId: string) => Promise<boolean>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Map of all registered workflows with type-safe client APIs
|
|
58
|
+
*/
|
|
59
|
+
export type TypedWorkflowClients = {
|
|
60
|
+
[Name in keyof WorkflowMap]: WorkflowClient<Name>;
|
|
61
|
+
}
|
|
62
|
+
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.0
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Workflow-specific type definitions for tree-shaking optimization
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { CoreWorkflow, wireWorkflow as wireWorkflowCore, PikkuWorkflowInteraction, WorkflowStepOptions } from '@pikku/core/workflow'
|
|
9
|
+
import { CorePikkuFunctionConfig, CorePikkuFunctionSessionless } from '@pikku/core'
|
|
10
|
+
import type { PikkuPermission, PikkuMiddleware } from '../function/pikku-function-types.gen.js'
|
|
11
|
+
import type { UserSession, SingletonServices } from '../../types/application-types.d.js'
|
|
12
|
+
import type { TypedPikkuRPC, RPCMap } from '../rpc/pikku-rpc-wirings-map.internal.gen.d.js'
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Type definition for workflows that orchestrate multi-step processes.
|
|
16
|
+
* Workflows support both inline and remote execution modes with step caching.
|
|
17
|
+
*/
|
|
18
|
+
type WorkflowWiring = CoreWorkflow<
|
|
19
|
+
CorePikkuFunctionConfig<PikkuFunctionWorkflow<any, any>, PikkuPermission<any>, PikkuMiddleware>
|
|
20
|
+
>
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Typed workflow interaction with RPC awareness
|
|
24
|
+
* Provides type-safe workflow.do() for RPC steps
|
|
25
|
+
*/
|
|
26
|
+
export interface TypedWorkflow extends PikkuWorkflowInteraction {
|
|
27
|
+
/**
|
|
28
|
+
* Execute a workflow step with RPC invocation (typed based on available RPCs)
|
|
29
|
+
* @template K - RPC name from the RPC map
|
|
30
|
+
*/
|
|
31
|
+
do<K extends keyof RPCMap>(
|
|
32
|
+
stepName: string,
|
|
33
|
+
rpcName: K,
|
|
34
|
+
data: RPCMap[K]['input'],
|
|
35
|
+
options?: WorkflowStepOptions
|
|
36
|
+
): Promise<RPCMap[K]['output']>
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Execute a workflow step with inline function
|
|
40
|
+
* @template T - Return type of the inline function
|
|
41
|
+
*/
|
|
42
|
+
do<T>(
|
|
43
|
+
stepName: string,
|
|
44
|
+
fn: () => T | Promise<T>,
|
|
45
|
+
options?: WorkflowStepOptions
|
|
46
|
+
): Promise<T>
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Workflow function type with typed workflow service
|
|
51
|
+
* Includes the workflow interaction object with typed RPC methods
|
|
52
|
+
*/
|
|
53
|
+
export type PikkuFunctionWorkflow<
|
|
54
|
+
In = unknown,
|
|
55
|
+
Out = never
|
|
56
|
+
> = CorePikkuFunctionSessionless<
|
|
57
|
+
In,
|
|
58
|
+
Out,
|
|
59
|
+
null,
|
|
60
|
+
SingletonServices & {
|
|
61
|
+
rpc: TypedPikkuRPC
|
|
62
|
+
workflow: TypedWorkflow
|
|
63
|
+
},
|
|
64
|
+
UserSession
|
|
65
|
+
>
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Creates a workflow function with typed input and output.
|
|
69
|
+
* Workflow functions have access to the workflow interaction object for step execution.
|
|
70
|
+
*
|
|
71
|
+
* @template In - Input type for the workflow
|
|
72
|
+
* @template Out - Output type for the workflow
|
|
73
|
+
* @param func - Function definition, either direct function or configuration object
|
|
74
|
+
* @returns The normalized configuration object
|
|
75
|
+
*/
|
|
76
|
+
export const pikkuWorkflowFunc = <In, Out = unknown>(
|
|
77
|
+
func:
|
|
78
|
+
| PikkuFunctionWorkflow<In, Out>
|
|
79
|
+
| CorePikkuFunctionConfig<PikkuFunctionWorkflow<In, Out>, PikkuPermission<In>, PikkuMiddleware>
|
|
80
|
+
) => {
|
|
81
|
+
return typeof func === 'function' ? { func } : func
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Registers a workflow with the Pikku framework.
|
|
86
|
+
* Workflows can run in 'inline' (synchronous) or 'remote' (queue-based) execution modes.
|
|
87
|
+
*
|
|
88
|
+
* @param workflow - Workflow definition with name, execution mode, and handler function
|
|
89
|
+
*/
|
|
90
|
+
export const wireWorkflow = (workflow: WorkflowWiring) => {
|
|
91
|
+
wireWorkflowCore(workflow as any)
|
|
92
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,62 @@
|
|
|
1
|
+
## 0.11.0
|
|
2
|
+
|
|
3
|
+
### Minor Changes
|
|
4
|
+
|
|
5
|
+
- Add workflow code generation (types, maps, workers, metadata)
|
|
6
|
+
- Add public RPC and remote RPC code generation
|
|
7
|
+
|
|
8
|
+
|
|
1
9
|
# @pikku/cli
|
|
2
10
|
|
|
11
|
+
## 0.10.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 1967172: Update code generation to support channel middleware enhancements
|
|
16
|
+
|
|
17
|
+
**Code Generation Updates:**
|
|
18
|
+
|
|
19
|
+
- Update channel type serialization to include middleware support
|
|
20
|
+
- Improve WebSocket wrapper generation for middleware handling
|
|
21
|
+
- Update CLI channel client generation with better type support
|
|
22
|
+
- Enhance services and schema generation for channel configurations
|
|
23
|
+
|
|
24
|
+
**Inspector Updates:**
|
|
25
|
+
|
|
26
|
+
- Improve channel metadata extraction for middleware
|
|
27
|
+
- Better type analysis for channel lifecycle functions
|
|
28
|
+
- Enhanced post-processing for channel configurations
|
|
29
|
+
|
|
30
|
+
- 753481a: Add bootstrap command, performance optimizations, and CLI improvements
|
|
31
|
+
|
|
32
|
+
**New Features:**
|
|
33
|
+
|
|
34
|
+
- Add `pikku bootstrap` command for type-only generation (~13.5% faster than `pikku all`)
|
|
35
|
+
- Add configurable `ignoreFiles` option to pikku.config.json with sensible defaults (_.gen.ts, _.test.ts, \*.spec.ts)
|
|
36
|
+
- Export pikkuCLIRender helper from serialize-cli-types.ts with JSDoc documentation
|
|
37
|
+
|
|
38
|
+
**Performance Improvements:**
|
|
39
|
+
|
|
40
|
+
- Add aggressive TypeScript compiler options (skipDefaultLibCheck, types: []) - ~37% faster TypeScript setup
|
|
41
|
+
- Add detailed performance timing to inspector phases (--logLevel=debug)
|
|
42
|
+
- Optimize file inspection with ignore patterns - ~10-20% faster overall
|
|
43
|
+
|
|
44
|
+
**Enhancements:**
|
|
45
|
+
|
|
46
|
+
- Fix --logLevel flag to properly apply log level to logger
|
|
47
|
+
- Update middleware logging to use structured log format
|
|
48
|
+
- Improve CLI renderers to consistently use destructured logger service
|
|
49
|
+
- Fix middleware file generation when middleware groups exist
|
|
50
|
+
|
|
51
|
+
- 44d71a8: fix: fixing inspector ensuring pikkuConfig is set
|
|
52
|
+
- Updated dependencies [1967172]
|
|
53
|
+
- Updated dependencies [753481a]
|
|
54
|
+
- Updated dependencies [ea652dc]
|
|
55
|
+
- Updated dependencies [4349ec5]
|
|
56
|
+
- Updated dependencies [44d71a8]
|
|
57
|
+
- @pikku/inspector@0.10.2
|
|
58
|
+
- @pikku/core@0.10.2
|
|
59
|
+
|
|
3
60
|
## 0.10.1
|
|
4
61
|
|
|
5
62
|
### Patch Changes
|
package/bin/pikku.ts
CHANGED
|
@@ -3,30 +3,30 @@ import { Command } from 'commander'
|
|
|
3
3
|
import { createConfig, createSingletonServices } from '../src/services.js'
|
|
4
4
|
import { PikkuRPCService } from '@pikku/core/rpc'
|
|
5
5
|
import { LocalVariablesService } from '@pikku/core/services'
|
|
6
|
-
import { existsSync } from 'fs'
|
|
7
|
-
import { fileURLToPath } from 'url'
|
|
8
|
-
import { dirname, join } from 'path'
|
|
6
|
+
// import { existsSync } from 'fs'
|
|
7
|
+
// import { fileURLToPath } from 'url'
|
|
8
|
+
// import { dirname, join } from 'path'
|
|
9
9
|
|
|
10
|
-
const __filename = fileURLToPath(import.meta.url)
|
|
11
|
-
const __dirname = dirname(__filename)
|
|
10
|
+
// const __filename = fileURLToPath(import.meta.url)
|
|
11
|
+
// const __dirname = dirname(__filename)
|
|
12
12
|
|
|
13
13
|
// Check if Pikku CLI is available
|
|
14
|
-
const pikkuCliPath = join(__dirname, '../.pikku/cli/pikku-cli.gen.js')
|
|
14
|
+
// const pikkuCliPath = join(__dirname, '../.pikku/cli/pikku-cli.gen.js')
|
|
15
15
|
|
|
16
|
-
if (existsSync(pikkuCliPath)) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
16
|
+
// if (existsSync(pikkuCliPath)) {
|
|
17
|
+
// try {
|
|
18
|
+
// // Use the generated Pikku CLI
|
|
19
|
+
// const { PikkuCLI } = await import('../.pikku/cli/pikku-cli.gen.js')
|
|
20
|
+
// await PikkuCLI(process.argv.slice(2))
|
|
21
|
+
// process.exit(0)
|
|
22
|
+
// } catch (error) {
|
|
23
|
+
// // If import fails, fall back to Commander.js
|
|
24
|
+
// console.warn(
|
|
25
|
+
// 'Failed to load Pikku CLI, using fallback mode:',
|
|
26
|
+
// error.message
|
|
27
|
+
// )
|
|
28
|
+
// }
|
|
29
|
+
// }
|
|
30
30
|
|
|
31
31
|
// Fallback to Commander.js for initial setup
|
|
32
32
|
// Import bootstrap if it exists
|
|
@@ -84,7 +84,16 @@ const all = (program, name, description) => {
|
|
|
84
84
|
'--httpRoutes <routes...>',
|
|
85
85
|
'Filter HTTP routes by route patterns (comma-separated)'
|
|
86
86
|
)
|
|
87
|
-
.option('-s, --silent', 'Silent mode - only show errors')
|
|
87
|
+
.option('-s, --silent', 'Silent mode - only show critical errors')
|
|
88
|
+
.option(
|
|
89
|
+
'--info',
|
|
90
|
+
'Show info messages and above (info, warn, error, critical)'
|
|
91
|
+
)
|
|
92
|
+
.option('--verbose', 'Show all debug messages (most detailed)')
|
|
93
|
+
.option(
|
|
94
|
+
'--loglevel <level>',
|
|
95
|
+
'Set explicit log level (trace, debug, info, warn, error, critical)'
|
|
96
|
+
)
|
|
88
97
|
.option(
|
|
89
98
|
'--state-output <path>',
|
|
90
99
|
'Save inspector state to JSON file for reuse'
|
package/cli.schema.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","additionalProperties":false,"properties":{"outDir":{"type":"string"},"schemaDirectory":{"type":"string"},"typesDeclarationFile":{"type":"string"},"functionsFile":{"type":"string"},"functionsMetaFile":{"type":"string"},"functionsMetaMinFile":{"type":"string"},"functionTypesFile":{"type":"string"},"httpWiringsFile":{"type":"string"},"httpWiringMetaFile":{"type":"string"},"httpMapDeclarationFile":{"type":"string"},"httpTypesFile":{"type":"string"},"channelsWiringFile":{"type":"string"},"channelsWiringMetaFile":{"type":"string"},"channelsMapDeclarationFile":{"type":"string"},"channelsTypesFile":{"type":"string"},"rpcInternalWiringMetaFile":{"type":"string"},"rpcInternalMapDeclarationFile":{"type":"string"},"rpcMapDeclarationFile":{"type":"string"},"schedulersWiringFile":{"type":"string"},"schedulersWiringMetaFile":{"type":"string"},"schedulersTypesFile":{"type":"string"},"queueWorkersWiringFile":{"type":"string"},"queueWorkersWiringMetaFile":{"type":"string"},"queueMapDeclarationFile":{"type":"string"},"queueTypesFile":{"type":"string"},"mcpWiringsFile":{"type":"string"},"mcpWiringsMetaFile":{"type":"string"},"mcpTypesFile":{"type":"string"},"cliWiringsFile":{"type":"string"},"cliWiringMetaFile":{"type":"string"},"cliBootstrapFile":{"type":"string"},"cliTypesFile":{"type":"string"},"servicesFile":{"type":"string"},"middlewareFile":{"type":"string"},"middlewareGroupsMetaFile":{"type":"string"},"permissionsFile":{"type":"string"},"bootstrapFile":{"type":"string"},"$schema":{"type":"string"},"extends":{"type":"string"},"rootDir":{"type":"string"},"srcDirectories":{"type":"array","items":{"type":"string"}},"
|
|
1
|
+
{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","additionalProperties":false,"properties":{"outDir":{"type":"string"},"schemaDirectory":{"type":"string"},"typesDeclarationFile":{"type":"string"},"functionsFile":{"type":"string"},"functionsMetaFile":{"type":"string"},"functionsMetaMinFile":{"type":"string"},"functionTypesFile":{"type":"string"},"httpWiringsFile":{"type":"string"},"httpWiringMetaFile":{"type":"string"},"httpMapDeclarationFile":{"type":"string"},"httpTypesFile":{"type":"string"},"channelsWiringFile":{"type":"string"},"channelsWiringMetaFile":{"type":"string"},"channelsMapDeclarationFile":{"type":"string"},"channelsTypesFile":{"type":"string"},"rpcInternalWiringMetaFile":{"type":"string"},"rpcInternalMapDeclarationFile":{"type":"string"},"rpcMapDeclarationFile":{"type":"string"},"schedulersWiringFile":{"type":"string"},"schedulersWiringMetaFile":{"type":"string"},"schedulersTypesFile":{"type":"string"},"queueWorkersWiringFile":{"type":"string"},"queueWorkersWiringMetaFile":{"type":"string"},"queueMapDeclarationFile":{"type":"string"},"queueTypesFile":{"type":"string"},"workflowsWiringFile":{"type":"string"},"workflowsWiringMetaFile":{"type":"string"},"workflowsWorkersFile":{"type":"string"},"workflowMapDeclarationFile":{"type":"string"},"workflowTypesFile":{"type":"string"},"mcpWiringsFile":{"type":"string"},"mcpWiringsMetaFile":{"type":"string"},"mcpTypesFile":{"type":"string"},"cliWiringsFile":{"type":"string"},"cliWiringMetaFile":{"type":"string"},"cliBootstrapFile":{"type":"string"},"cliTypesFile":{"type":"string"},"servicesFile":{"type":"string"},"middlewareFile":{"type":"string"},"middlewareGroupsMetaFile":{"type":"string"},"permissionsFile":{"type":"string"},"bootstrapFile":{"type":"string"},"$schema":{"type":"string"},"extends":{"type":"string"},"rootDir":{"type":"string"},"srcDirectories":{"type":"array","items":{"type":"string"}},"ignoreFiles":{"type":"array","items":{"type":"string"}},"packageMappings":{"type":"object","additionalProperties":{"type":"string"}},"configFile":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"types":{"type":"array","items":{"type":"string"}},"userSessionType":{"type":"string"},"singletonServicesFactoryType":{"type":"string"},"sessionServicesFactoryType":{"type":"string"},"configDir":{"type":"string"},"tsconfig":{"type":"string"},"nextBackendFile":{"type":"string"},"nextHTTPFile":{"type":"string"},"fetchFile":{"type":"string"},"websocketFile":{"type":"string"},"rpcWiringsFile":{"type":"string"},"queueWiringsFile":{"type":"string"},"mcpJsonFile":{"type":"string"},"openAPI":{"type":"object","properties":{"outputFile":{"type":"string"},"additionalInfo":{"$ref":"#/definitions/OpenAPISpecInfo"}},"required":["outputFile","additionalInfo"],"additionalProperties":false},"schema":{"type":"object","properties":{"additionalProperties":{"type":"boolean"},"supportsImportAttributes":{"type":"boolean"}},"additionalProperties":false},"cli":{"type":"object","properties":{"entrypoints":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","const":"local"},"path":{"type":"string"}},"required":["type","path"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"channel"},"name":{"type":"string"},"route":{"type":"string"},"wirePath":{"type":"string"},"path":{"type":"string"}},"required":["type","wirePath"],"additionalProperties":false},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","const":"local"},"path":{"type":"string"}},"required":["type","path"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"channel"},"name":{"type":"string"},"route":{"type":"string"},"wirePath":{"type":"string"},"path":{"type":"string"}},"required":["type","wirePath"],"additionalProperties":false}]}}]}}},"additionalProperties":false},"workflows":{"anyOf":[{"type":"object","properties":{"singleQueue":{"type":"boolean","const":true},"path":{"type":"string"},"orchestratorQueue":{"type":"string"},"workerQueue":{"type":"string"}},"required":["singleQueue","path"],"additionalProperties":false},{"type":"object","properties":{"singleQueue":{"type":"boolean","const":false},"dir":{"type":"string"},"orchestratorQueuePrefix":{"type":"string"},"workerQueuePrefix":{"type":"string"}},"required":["singleQueue","dir"],"additionalProperties":false}]},"rpc":{"type":"object","properties":{"remoteRpcWorkersPath":{"type":"string"},"publicRpcPath":{"type":"string"}},"additionalProperties":false},"forceRequiredServices":{"type":"array","items":{"type":"string"}},"schemasFromTypes":{"type":"array","items":{"type":"string"}},"stateOutput":{"type":"string"},"stateInput":{"type":"string"},"filters":{"$ref":"#/definitions/InspectorFilters"}},"required":["bootstrapFile","channelsMapDeclarationFile","channelsTypesFile","channelsWiringFile","channelsWiringMetaFile","cliBootstrapFile","cliTypesFile","cliWiringMetaFile","cliWiringsFile","configDir","filters","functionTypesFile","functionsFile","functionsMetaFile","functionsMetaMinFile","httpMapDeclarationFile","httpTypesFile","httpWiringMetaFile","httpWiringsFile","mcpTypesFile","mcpWiringsFile","mcpWiringsMetaFile","middlewareFile","middlewareGroupsMetaFile","outDir","packageMappings","permissionsFile","queueMapDeclarationFile","queueTypesFile","queueWorkersWiringFile","queueWorkersWiringMetaFile","rootDir","rpcInternalMapDeclarationFile","rpcInternalWiringMetaFile","rpcMapDeclarationFile","schedulersTypesFile","schedulersWiringFile","schedulersWiringMetaFile","schemaDirectory","servicesFile","srcDirectories","tsconfig","typesDeclarationFile","workflowMapDeclarationFile","workflowTypesFile","workflowsWiringFile","workflowsWiringMetaFile","workflowsWorkersFile"],"definitions":{"OpenAPISpecInfo":{"type":"object","properties":{"info":{"type":"object","properties":{"title":{"type":"string"},"version":{"type":"string"},"description":{"type":"string"},"termsOfService":{"type":"string"},"contact":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"},"email":{"type":"string"}},"additionalProperties":false},"license":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"}},"required":["name"],"additionalProperties":false}},"required":["title","version","description"],"additionalProperties":false},"servers":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"description":{"type":"string"}},"required":["url"],"additionalProperties":false}},"tags":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"}},"required":["name"],"additionalProperties":false}},"externalDocs":{"type":"object","properties":{"description":{"type":"string"},"url":{"type":"string"}},"required":["url"],"additionalProperties":false},"securitySchemes":{"type":"object"},"security":{"type":"array","items":{"type":"object","additionalProperties":{"type":"array","items":{}}}}},"required":["info","servers"],"additionalProperties":false},"InspectorFilters":{"type":"object","properties":{"names":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"types":{"type":"array","items":{"type":"string"}},"directories":{"type":"array","items":{"type":"string"}},"httpRoutes":{"type":"array","items":{"type":"string"}},"httpMethods":{"type":"array","items":{"type":"string"}}},"additionalProperties":false}}}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.0
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
|
|
@@ -8,15 +8,16 @@
|
|
|
8
8
|
import { CoreChannel } from '@pikku/core/channel';
|
|
9
9
|
import { CorePikkuFunctionConfig } from '@pikku/core';
|
|
10
10
|
import { AssertHTTPWiringParams } from '@pikku/core/http';
|
|
11
|
-
import type { PikkuFunctionSessionless, PikkuPermission, PikkuMiddleware } from '../function/pikku-function-types.gen.js';
|
|
11
|
+
import type { PikkuFunction, PikkuFunctionSessionless, PikkuPermission, PikkuMiddleware } from '../function/pikku-function-types.gen.js';
|
|
12
12
|
/**
|
|
13
13
|
* Type definition for WebSocket channels with typed data exchange.
|
|
14
14
|
* Supports connection, disconnection, and message handling.
|
|
15
|
+
* Accepts both session-based (PikkuFunction) and sessionless (PikkuFunctionSessionless) functions.
|
|
15
16
|
*
|
|
16
17
|
* @template ChannelData - Type of data exchanged through the channel
|
|
17
18
|
* @template Channel - String literal type for the channel name
|
|
18
19
|
*/
|
|
19
|
-
type ChannelWiring<ChannelData, Channel extends string> = CoreChannel<ChannelData, Channel, CorePikkuFunctionConfig<PikkuFunctionSessionless<void, any, ChannelData>, PikkuPermission<void>, PikkuMiddleware>, CorePikkuFunctionConfig<PikkuFunctionSessionless<void, void, ChannelData>, PikkuPermission<void>, PikkuMiddleware>, CorePikkuFunctionConfig<PikkuFunctionSessionless<any, any, ChannelData>, PikkuPermission<any>, PikkuMiddleware>, PikkuPermission, PikkuMiddleware>;
|
|
20
|
+
type ChannelWiring<ChannelData, Channel extends string> = CoreChannel<ChannelData, Channel, CorePikkuFunctionConfig<PikkuFunctionSessionless<void, any, ChannelData>, PikkuPermission<void>, PikkuMiddleware>, CorePikkuFunctionConfig<PikkuFunctionSessionless<void, void, ChannelData>, PikkuPermission<void>, PikkuMiddleware>, CorePikkuFunctionConfig<PikkuFunctionSessionless<any, any, ChannelData> | PikkuFunction<any, any, ChannelData>, PikkuPermission<any>, PikkuMiddleware>, PikkuPermission, PikkuMiddleware>;
|
|
20
21
|
/**
|
|
21
22
|
* Creates a function that handles WebSocket channel connections.
|
|
22
23
|
* Called when a client connects to a channel.
|