@pikku/addon-graph 0.0.3 → 0.12.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/addon/pikku-addon-types.gen.ts +105 -0
- package/.pikku/addon/pikku-package.gen.ts +11 -0
- package/.pikku/agent/pikku-agent-map.gen.d.ts +4 -0
- package/.pikku/agent/pikku-agent-types.gen.ts +82 -0
- package/.pikku/channel/pikku-channel-types.gen.ts +177 -0
- package/.pikku/cli/pikku-cli-types.gen.ts +105 -0
- package/.pikku/console/pikku-addon-meta.gen.json +281 -0
- package/.pikku/console/pikku-node-types.gen.ts +8 -0
- package/.pikku/function/pikku-function-types.gen.ts +684 -0
- package/.pikku/function/pikku-functions-meta-verbose.gen.json +660 -0
- package/.pikku/function/pikku-functions-meta.gen.json +450 -0
- package/.pikku/function/pikku-functions-meta.gen.ts +7 -0
- package/.pikku/function/pikku-functions.gen.ts +56 -0
- package/.pikku/http/pikku-http-types.gen.ts +147 -0
- package/.pikku/mcp/pikku-mcp-types.gen.ts +183 -0
- package/.pikku/pikku-bootstrap.gen.ts +8 -0
- package/.pikku/pikku-meta-service.gen.ts +10 -0
- package/.pikku/pikku-services.gen.ts +39 -0
- package/.pikku/pikku-types.gen.ts +21 -0
- package/.pikku/queue/pikku-queue-types.gen.ts +27 -0
- package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +488 -0
- package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +513 -0
- package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +27 -0
- package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +6 -0
- package/.pikku/scheduler/pikku-scheduler-types.gen.ts +25 -0
- package/.pikku/schemas/register.gen.ts +199 -0
- package/.pikku/schemas/schemas/AggregateInput.schema.json +1 -0
- package/.pikku/schemas/schemas/AggregateOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/ChunkInput.schema.json +1 -0
- package/.pikku/schemas/schemas/ChunkOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/CoalesceInput.schema.json +1 -0
- package/.pikku/schemas/schemas/CoalesceOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/CryptoInput.schema.json +1 -0
- package/.pikku/schemas/schemas/CryptoOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/DateTimeInput.schema.json +1 -0
- package/.pikku/schemas/schemas/DateTimeOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/EditFieldsInput.schema.json +1 -0
- package/.pikku/schemas/schemas/EditFieldsOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/FindInput.schema.json +1 -0
- package/.pikku/schemas/schemas/FindOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/GroupByInput.schema.json +1 -0
- package/.pikku/schemas/schemas/GroupByOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/JwtDecodeInput.schema.json +1 -0
- package/.pikku/schemas/schemas/JwtDecodeOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/JwtSignInput.schema.json +1 -0
- package/.pikku/schemas/schemas/JwtSignOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/LimitInput.schema.json +1 -0
- package/.pikku/schemas/schemas/LimitOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/MathInput.schema.json +1 -0
- package/.pikku/schemas/schemas/MathOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/MergeInput.schema.json +1 -0
- package/.pikku/schemas/schemas/MergeOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/OmitInput.schema.json +1 -0
- package/.pikku/schemas/schemas/OmitOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/PickInput.schema.json +1 -0
- package/.pikku/schemas/schemas/PickOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/RemoveDuplicatesInput.schema.json +1 -0
- package/.pikku/schemas/schemas/RemoveDuplicatesOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/RenameKeysInput.schema.json +1 -0
- package/.pikku/schemas/schemas/RenameKeysOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/ReverseInput.schema.json +1 -0
- package/.pikku/schemas/schemas/ReverseOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/SleepInput.schema.json +1 -0
- package/.pikku/schemas/schemas/SortInput.schema.json +1 -0
- package/.pikku/schemas/schemas/SortOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/SplitOutInput.schema.json +1 -0
- package/.pikku/schemas/schemas/SplitOutOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/StringTransformInput.schema.json +1 -0
- package/.pikku/schemas/schemas/StringTransformOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/SummarizeInput.schema.json +1 -0
- package/.pikku/schemas/schemas/SummarizeOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/TypeConvertInput.schema.json +1 -0
- package/.pikku/schemas/schemas/TypeConvertOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/UniqueInput.schema.json +1 -0
- package/.pikku/schemas/schemas/UniqueOutput.schema.json +1 -0
- package/.pikku/secrets/pikku-secret-types.gen.ts +5 -0
- package/.pikku/secrets/pikku-secrets-meta.gen.json +1 -0
- package/.pikku/secrets/pikku-secrets.gen.ts +21 -0
- package/.pikku/trigger/pikku-trigger-types.gen.ts +160 -0
- package/.pikku/variables/pikku-variable-types.gen.ts +5 -0
- package/.pikku/variables/pikku-variables-meta.gen.json +1 -0
- package/.pikku/variables/pikku-variables.gen.ts +21 -0
- package/.pikku/workflow/pikku-workflow-map.gen.d.ts +38 -0
- package/.pikku/workflow/pikku-workflow-types.gen.ts +167 -0
- package/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +9 -0
- package/.pikku/workflow/pikku-workflow-wirings.gen.ts +3 -0
- package/dist/.pikku/addon/pikku-addon-types.gen.d.ts +3 -3
- package/dist/.pikku/addon/pikku-addon-types.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/pikku-addon-types.gen.js +6 -2
- package/dist/.pikku/addon/pikku-addon-types.gen.js.map +1 -1
- package/dist/.pikku/addon/pikku-addon-types.gen.ts +10 -5
- package/dist/.pikku/addon/pikku-package.gen.js +2 -1
- package/dist/.pikku/addon/pikku-package.gen.js.map +1 -1
- package/dist/.pikku/addon/pikku-package.gen.ts +3 -1
- package/dist/.pikku/agent/pikku-agent-map.gen.d.ts +2 -14
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
- package/dist/.pikku/agent/pikku-agent-types.gen.ts +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +112 -0
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts.map +1 -0
- package/dist/.pikku/channel/pikku-channel-types.gen.js +60 -0
- package/dist/.pikku/channel/pikku-channel-types.gen.js.map +1 -0
- package/dist/.pikku/channel/pikku-channel-types.gen.ts +177 -0
- package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +78 -0
- package/dist/.pikku/cli/pikku-cli-types.gen.d.ts.map +1 -0
- package/dist/.pikku/cli/pikku-cli-types.gen.js +61 -0
- package/dist/.pikku/cli/pikku-cli-types.gen.js.map +1 -0
- package/dist/.pikku/cli/pikku-cli-types.gen.ts +105 -0
- package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
- package/dist/.pikku/console/pikku-node-types.gen.ts +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +16 -19
- package/dist/.pikku/function/pikku-function-types.gen.d.ts.map +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.js +15 -19
- package/dist/.pikku/function/pikku-function-types.gen.js.map +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.ts +18 -20
- package/dist/.pikku/function/pikku-functions-meta-verbose.gen.json +50 -0
- package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.ts +1 -1
- package/dist/.pikku/function/pikku-functions.gen.js +2 -2
- package/dist/.pikku/function/pikku-functions.gen.js.map +1 -1
- package/dist/.pikku/function/pikku-functions.gen.ts +2 -2
- package/dist/.pikku/http/pikku-http-types.gen.d.ts +120 -0
- package/dist/.pikku/http/pikku-http-types.gen.d.ts.map +1 -0
- package/dist/.pikku/http/pikku-http-types.gen.js +72 -0
- package/dist/.pikku/http/pikku-http-types.gen.js.map +1 -0
- package/dist/.pikku/http/pikku-http-types.gen.ts +147 -0
- package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +131 -0
- package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts.map +1 -0
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js +38 -0
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js.map +1 -0
- package/dist/.pikku/mcp/pikku-mcp-types.gen.ts +183 -0
- package/dist/.pikku/pikku-bootstrap.gen.d.ts +4 -2
- package/dist/.pikku/pikku-bootstrap.gen.d.ts.map +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.js +2 -10
- package/dist/.pikku/pikku-bootstrap.gen.js.map +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.ts +2 -9
- package/dist/.pikku/pikku-meta-service.gen.d.ts +8 -0
- package/dist/.pikku/pikku-meta-service.gen.d.ts.map +1 -0
- package/dist/.pikku/pikku-meta-service.gen.js +10 -0
- package/dist/.pikku/pikku-meta-service.gen.js.map +1 -0
- package/dist/.pikku/pikku-meta-service.gen.ts +10 -0
- package/dist/.pikku/pikku-services.gen.d.ts +6 -3
- package/dist/.pikku/pikku-services.gen.d.ts.map +1 -1
- package/dist/.pikku/pikku-services.gen.js +5 -1
- package/dist/.pikku/pikku-services.gen.js.map +1 -1
- package/dist/.pikku/pikku-services.gen.ts +8 -3
- package/dist/.pikku/pikku-types.gen.d.ts +1 -1
- package/dist/.pikku/pikku-types.gen.js +1 -1
- package/dist/.pikku/pikku-types.gen.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +24 -0
- package/dist/.pikku/queue/pikku-queue-types.gen.d.ts.map +1 -0
- package/dist/.pikku/queue/pikku-queue-types.gen.js +17 -0
- package/dist/.pikku/queue/pikku-queue-types.gen.js.map +1 -0
- package/dist/.pikku/queue/pikku-queue-types.gen.ts +27 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +421 -57
- package/dist/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +421 -57
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.d.ts +2 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.d.ts.map +1 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +7 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js.map +1 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +27 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +6 -0
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +22 -0
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts.map +1 -0
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +17 -0
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js.map +1 -0
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.ts +25 -0
- package/dist/.pikku/schemas/register.gen.js +1 -1
- package/dist/.pikku/schemas/register.gen.ts +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.ts +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.ts +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.ts +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.ts +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-map.gen.d.ts +9 -5
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +3 -24
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts.map +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -14
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js.map +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.ts +5 -52
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.ts +1 -1
- package/dist/src/functions/data/jwt.function.d.ts.map +1 -1
- package/dist/src/functions/data/jwt.function.js +3 -2
- package/dist/src/functions/data/jwt.function.js.map +1 -1
- package/package.json +7 -9
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.d.ts +0 -2
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.d.ts.map +0 -1
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.js +0 -7
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.js.map +0 -1
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.json +0 -3
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.ts +0 -7
- package/dist/.pikku/agent/pikku-agent-wirings.gen.d.ts +0 -5
- package/dist/.pikku/agent/pikku-agent-wirings.gen.d.ts.map +0 -1
- package/dist/.pikku/agent/pikku-agent-wirings.gen.js +0 -5
- package/dist/.pikku/agent/pikku-agent-wirings.gen.js.map +0 -1
- package/dist/.pikku/agent/pikku-agent-wirings.gen.ts +0 -3
- package/dist/.pikku/schema-cache.json +0 -1
- package/dist/.pikku/schemas/pikku.cache.json +0 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.19
|
|
3
|
+
*/
|
|
4
|
+
import { TypedVariablesService as CoreTypedVariablesService, type VariableMeta } from '@pikku/core/services'
|
|
5
|
+
import type { VariablesService } from '@pikku/core/services'
|
|
6
|
+
|
|
7
|
+
export interface VariablesMap {
|
|
8
|
+
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type VariableId = keyof VariablesMap
|
|
12
|
+
|
|
13
|
+
const VARIABLES_META: Record<string, VariableMeta> = {
|
|
14
|
+
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export class TypedVariablesService extends CoreTypedVariablesService<VariablesMap> {
|
|
18
|
+
constructor(variables: VariablesService) {
|
|
19
|
+
super(variables, VARIABLES_META)
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.19
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Workflow type map with input/output types for each workflow
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
interface WorkflowHandler<I, O> {
|
|
13
|
+
input: I;
|
|
14
|
+
output: O;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface GraphNodeHandler<I> {
|
|
18
|
+
input: I;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type WorkflowMap = {
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type GraphsMap = {
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type FlattenedWorkflowMap = WorkflowMap
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
export type WorkflowClient<Name extends keyof FlattenedWorkflowMap> = {
|
|
31
|
+
start: (input: FlattenedWorkflowMap[Name]['input']) => Promise<{ runId: string }>;
|
|
32
|
+
getRun: <output extends keyof FlattenedWorkflowMap[Name]>(runId: string) => Promise<FlattenedWorkflowMap[Name][output]>;
|
|
33
|
+
cancelRun: (runId: string) => Promise<boolean>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type TypedWorkflowClients = {
|
|
37
|
+
[Name in keyof FlattenedWorkflowMap]: WorkflowClient<Name>;
|
|
38
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.19
|
|
3
|
+
*/
|
|
4
|
+
import { WorkflowCancelledException } from '@pikku/core/workflow'
|
|
5
|
+
import { template } from '@pikku/core/workflow'
|
|
6
|
+
import {
|
|
7
|
+
pikkuWorkflowGraph as corePikkuWorkflowGraph,
|
|
8
|
+
type PikkuWorkflowGraphConfig,
|
|
9
|
+
type PikkuWorkflowGraphResult,
|
|
10
|
+
} from '@pikku/core/workflow'
|
|
11
|
+
import type { PikkuWorkflowWire, WorkflowStepOptions } from '@pikku/core/workflow'
|
|
12
|
+
|
|
13
|
+
export { WorkflowCancelledException }
|
|
14
|
+
import type { PikkuFunctionSessionless, PikkuFunctionConfig } from '../function/pikku-function-types.gen.js'
|
|
15
|
+
import type { FlattenedRPCMap } from '../rpc/pikku-rpc-wirings-map.internal.gen.d.js'
|
|
16
|
+
import type { FlattenedWorkflowMap } from './pikku-workflow-map.gen.d.js'
|
|
17
|
+
|
|
18
|
+
export { template }
|
|
19
|
+
|
|
20
|
+
export interface TypedWorkflow extends PikkuWorkflowWire {
|
|
21
|
+
do<K extends keyof FlattenedRPCMap>(
|
|
22
|
+
stepName: string,
|
|
23
|
+
rpcName: K,
|
|
24
|
+
data: FlattenedRPCMap[K]['input'],
|
|
25
|
+
options?: WorkflowStepOptions
|
|
26
|
+
): Promise<FlattenedRPCMap[K]['output']>
|
|
27
|
+
|
|
28
|
+
do<K extends keyof FlattenedWorkflowMap>(
|
|
29
|
+
stepName: string,
|
|
30
|
+
workflowName: K,
|
|
31
|
+
data: FlattenedWorkflowMap[K]['input'],
|
|
32
|
+
options?: WorkflowStepOptions
|
|
33
|
+
): Promise<FlattenedWorkflowMap[K]['output']>
|
|
34
|
+
|
|
35
|
+
do<T>(
|
|
36
|
+
stepName: string,
|
|
37
|
+
fn: () => T | Promise<T>,
|
|
38
|
+
options?: WorkflowStepOptions
|
|
39
|
+
): Promise<T>
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
import type { StandardSchemaV1 } from '@standard-schema/spec'
|
|
43
|
+
import type { InferSchemaOutput, PikkuPermission, PikkuMiddleware, NodeConfig, PikkuApprovalDescription } from '../function/pikku-function-types.gen.js'
|
|
44
|
+
import { PikkuError } from '@pikku/core/errors'
|
|
45
|
+
import type { CorePermissionGroup } from '@pikku/core'
|
|
46
|
+
|
|
47
|
+
export type PikkuFunctionWorkflow<
|
|
48
|
+
In = unknown,
|
|
49
|
+
Out = never
|
|
50
|
+
> = PikkuFunctionSessionless<In, Out, 'workflow'>
|
|
51
|
+
|
|
52
|
+
export type PikkuWorkflowConfigWithSchema<
|
|
53
|
+
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
54
|
+
OutputSchema extends StandardSchemaV1 | undefined = undefined
|
|
55
|
+
> = {
|
|
56
|
+
title?: string
|
|
57
|
+
description?: string
|
|
58
|
+
tags?: string[]
|
|
59
|
+
expose?: boolean
|
|
60
|
+
internal?: boolean
|
|
61
|
+
override?: string
|
|
62
|
+
version?: number
|
|
63
|
+
remote?: boolean
|
|
64
|
+
mcp?: boolean
|
|
65
|
+
readonly?: boolean
|
|
66
|
+
approvalRequired?: boolean
|
|
67
|
+
approvalDescription?: InputSchema extends StandardSchemaV1 ? PikkuApprovalDescription<InferSchemaOutput<InputSchema>> : never
|
|
68
|
+
func: PikkuFunctionWorkflow<
|
|
69
|
+
InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown,
|
|
70
|
+
OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown
|
|
71
|
+
>
|
|
72
|
+
auth?: boolean
|
|
73
|
+
permissions?: InputSchema extends StandardSchemaV1 ? CorePermissionGroup<PikkuPermission<InferSchemaOutput<InputSchema>>> : undefined
|
|
74
|
+
middleware?: PikkuMiddleware[]
|
|
75
|
+
input?: InputSchema
|
|
76
|
+
output?: OutputSchema
|
|
77
|
+
node?: NodeConfig
|
|
78
|
+
errors?: Array<typeof PikkuError>
|
|
79
|
+
inline?: boolean
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export function pikkuWorkflowFunc<
|
|
83
|
+
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
84
|
+
OutputSchema extends StandardSchemaV1 | undefined = undefined
|
|
85
|
+
>(
|
|
86
|
+
config: PikkuWorkflowConfigWithSchema<InputSchema, OutputSchema>
|
|
87
|
+
): PikkuFunctionConfig<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, 'workflow', PikkuFunctionWorkflow<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown>, InputSchema, OutputSchema>
|
|
88
|
+
export function pikkuWorkflowFunc<In, Out = unknown>(
|
|
89
|
+
func:
|
|
90
|
+
| PikkuFunctionWorkflow<In, Out>
|
|
91
|
+
| PikkuFunctionConfig<In, Out, 'workflow', PikkuFunctionWorkflow<In, Out>>
|
|
92
|
+
): PikkuFunctionConfig<In, Out, 'workflow'>
|
|
93
|
+
export function pikkuWorkflowFunc(func: any) {
|
|
94
|
+
return typeof func === 'function' ? { func } : func
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function pikkuWorkflowComplexFunc<
|
|
98
|
+
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
99
|
+
OutputSchema extends StandardSchemaV1 | undefined = undefined
|
|
100
|
+
>(
|
|
101
|
+
config: PikkuWorkflowConfigWithSchema<InputSchema, OutputSchema>
|
|
102
|
+
): PikkuFunctionConfig<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, 'workflow', PikkuFunctionWorkflow<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown>, InputSchema, OutputSchema>
|
|
103
|
+
export function pikkuWorkflowComplexFunc<In, Out = unknown>(
|
|
104
|
+
func:
|
|
105
|
+
| PikkuFunctionWorkflow<In, Out>
|
|
106
|
+
| PikkuFunctionConfig<In, Out, 'workflow', PikkuFunctionWorkflow<In, Out>>
|
|
107
|
+
): PikkuFunctionConfig<In, Out, 'workflow'>
|
|
108
|
+
export function pikkuWorkflowComplexFunc(func: any) {
|
|
109
|
+
return typeof func === 'function' ? { func } : func
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
type TypedRef<T> = { $ref: string; path?: string } & { __phantomType?: T }
|
|
113
|
+
|
|
114
|
+
type TemplateString = {
|
|
115
|
+
$template: {
|
|
116
|
+
parts: string[]
|
|
117
|
+
expressions: Array<{ $ref: string; path?: string }>
|
|
118
|
+
}
|
|
119
|
+
} & { __brand: 'TemplateString' }
|
|
120
|
+
|
|
121
|
+
type InputWithRefs<T> = {
|
|
122
|
+
[K in keyof T]?: T[K] | TypedRef<T[K]> | TypedRef<unknown> | TemplateString
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
type NodeInputType<FuncMap extends Record<string, string>, K extends keyof FuncMap> =
|
|
126
|
+
FuncMap[K] extends keyof FlattenedRPCMap
|
|
127
|
+
? InputWithRefs<FlattenedRPCMap[FuncMap[K]]['input']>
|
|
128
|
+
: Record<string, unknown>
|
|
129
|
+
|
|
130
|
+
type NodeOutputKeys<FuncMap extends Record<string, string>, N extends string> =
|
|
131
|
+
N extends keyof FuncMap
|
|
132
|
+
? FuncMap[N] extends keyof FlattenedRPCMap
|
|
133
|
+
? keyof FlattenedRPCMap[FuncMap[N]]['output'] & string
|
|
134
|
+
: string
|
|
135
|
+
: string
|
|
136
|
+
|
|
137
|
+
type RefFunction<FuncMap extends Record<string, string>> = {
|
|
138
|
+
<N extends Extract<keyof FuncMap, string>>(
|
|
139
|
+
nodeId: N,
|
|
140
|
+
path: NodeOutputKeys<FuncMap, N>
|
|
141
|
+
): TypedRef<unknown>
|
|
142
|
+
(nodeId: 'trigger' | '$item', path?: string): TypedRef<unknown>
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
type TemplateFunction = (templateStr: string, refs: TypedRef<unknown>[]) => TemplateString
|
|
146
|
+
|
|
147
|
+
type GraphNodeConfigMap<FuncMap extends Record<string, string>> = {
|
|
148
|
+
[K in Extract<keyof FuncMap, string>]?: {
|
|
149
|
+
next?: NextConfig<Extract<keyof FuncMap, string>>
|
|
150
|
+
input?:
|
|
151
|
+
| NodeInputType<FuncMap, K>
|
|
152
|
+
| (() => NodeInputType<FuncMap, K>)
|
|
153
|
+
| ((ref: RefFunction<FuncMap>, template: TemplateFunction) => NodeInputType<FuncMap, K>)
|
|
154
|
+
onError?: Extract<keyof FuncMap, string> | Extract<keyof FuncMap, string>[]
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
type NextConfig<NodeIds extends string> = NodeIds | NodeIds[] | { if: string; then: NodeIds; else?: NodeIds }
|
|
159
|
+
|
|
160
|
+
export function pikkuWorkflowGraph<
|
|
161
|
+
const FuncMap extends Record<string, keyof FlattenedRPCMap & string>
|
|
162
|
+
>(
|
|
163
|
+
config: PikkuWorkflowGraphConfig<FuncMap, GraphNodeConfigMap<FuncMap>>
|
|
164
|
+
): PikkuWorkflowGraphResult {
|
|
165
|
+
return corePikkuWorkflowGraph(config as any)
|
|
166
|
+
}
|
|
167
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.19
|
|
3
|
+
*/
|
|
4
|
+
import { pikkuState } from '@pikku/core/internal'
|
|
5
|
+
import type { SerializedWorkflowGraphs } from '@pikku/inspector/workflow-graph'
|
|
6
|
+
|
|
7
|
+
const workflowsMeta: SerializedWorkflowGraphs = {}
|
|
8
|
+
|
|
9
|
+
pikkuState('@pikku/addon-graph', 'workflows', 'meta', workflowsMeta)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.19
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Addon package types for pikkuAddonConfig and pikkuAddonServices
|
|
6
6
|
*/
|
|
7
|
-
import type { CreateConfig } from '@pikku/core';
|
|
7
|
+
import type { CreateConfig, PikkuWire } from '@pikku/core';
|
|
8
8
|
import type { SingletonServices } from '../../types/application-types.d.js';
|
|
9
9
|
import type { Config } from '../../types/application-types.d.js';
|
|
10
10
|
import type { RequiredSingletonServices } from '../pikku-services.gen.js';
|
|
@@ -61,5 +61,5 @@ export declare const pikkuAddonServices: <T extends Record<string, any>, Existin
|
|
|
61
61
|
* })
|
|
62
62
|
* ```
|
|
63
63
|
*/
|
|
64
|
-
export declare const pikkuAddonWireServices: (func: (services:
|
|
64
|
+
export declare const pikkuAddonWireServices: <ExistingServices extends Omit<Partial<SingletonServices>, "variables" | "secrets"> & AddonBaseServices>(func: (services: ExistingServices, wire: PikkuWire) => Promise<Record<string, any>>) => any;
|
|
65
65
|
//# sourceMappingURL=pikku-addon-types.gen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pikku-addon-types.gen.d.ts","sourceRoot":"","sources":["../../../.pikku/addon/pikku-addon-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"pikku-addon-types.gen.d.ts","sourceRoot":"","sources":["../../../.pikku/addon/pikku-addon-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AAC3E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAA;AAChE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAA;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAA;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAA;AAM3E;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAA;IACnC,SAAS,EAAE,qBAAqB,CAAA;IAChC,OAAO,EAAE,kBAAkB,CAAA;CAC5B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,gBAAgB,SAAS,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC,GAAG,iBAAiB,EACrI,MAAM,CAAC,QAAQ,EAAE,gBAAgB,KAAK,OAAO,CAAC,MAAM,CAAC,KACpD,YAAY,CAAC,MAAM,CAKrB,CAAA;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,gBAAgB,SAAS,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC,GAAG,iBAAiB,EACtK,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,KAAK,OAAO,CAAC,CAAC,CAAC,MAElD,QAAQ,MAAM,EAAE,mBAAmB,OAAO,CAAC,iBAAiB,CAAC,KAAG,OAAO,CAAC,yBAAyB,CAchH,CAAA;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,sBAAsB,GAAI,gBAAgB,SAAS,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC,GAAG,iBAAiB,EAC3I,MAAM,CAAC,QAAQ,EAAE,gBAAgB,EAAE,IAAI,EAAE,SAAS,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,KAM7E,GACP,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.19
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Addon package types for pikkuAddonConfig and pikkuAddonServices
|
|
@@ -69,6 +69,10 @@ export const pikkuAddonServices = (func) => {
|
|
|
69
69
|
* ```
|
|
70
70
|
*/
|
|
71
71
|
export const pikkuAddonWireServices = (func) => {
|
|
72
|
-
return
|
|
72
|
+
return ((services, wire) => {
|
|
73
|
+
const typedVariables = new TypedVariablesService(services.variables);
|
|
74
|
+
const typedSecrets = new TypedSecretService(services.secrets);
|
|
75
|
+
return func({ ...services, variables: typedVariables, secrets: typedSecrets }, wire);
|
|
76
|
+
});
|
|
73
77
|
};
|
|
74
78
|
//# sourceMappingURL=pikku-addon-types.gen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pikku-addon-types.gen.js","sourceRoot":"","sources":["../../../.pikku/addon/pikku-addon-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;AAMH,OAAO,EAAE,kBAAkB,EAAE,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EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,OAAO,EAAE,YAAY,EAAsB,CAAC,CAAA;QACxI,OAAO;YACL,MAAM;YACN,MAAM;YACN,MAAM;YACN,SAAS,EAAE,cAAc;YACzB,OAAO,EAAE,YAAY;YACrB,GAAG,MAAM;SAC8B,CAAA;IAC3C,CAAC,CAAA;AACH,CAAC,CAAA;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,IAAmF,EACnF,EAAE;IACF,OAAO,CAAC,CAAC,QAAa,EAAE,IAAe,EAAE,EAAE;QACzC,MAAM,cAAc,GAAG,IAAI,qBAAqB,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;QACpE,MAAM,YAAY,GAAG,IAAI,kBAAkB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;QAC7D,OAAO,IAAI,CAAC,EAAE,GAAG,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,OAAO,EAAE,YAAY,EAAsB,EAAE,IAAI,CAAC,CAAA;IAC1G,CAAC,CAAQ,CAAA;AACX,CAAC,CAAA"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.19
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Addon package types for pikkuAddonConfig and pikkuAddonServices
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import type { CreateConfig } from '@pikku/core'
|
|
8
|
+
import type { CreateConfig, PikkuWire } from '@pikku/core'
|
|
9
9
|
import type { SingletonServices } from '../../types/application-types.d.js'
|
|
10
10
|
import type { Config } from '../../types/application-types.d.js'
|
|
11
11
|
import type { RequiredSingletonServices } from '../pikku-services.gen.js'
|
|
@@ -15,6 +15,7 @@ import { TypedVariablesService } from '../variables/pikku-variables.gen.js'
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
+
|
|
18
19
|
/**
|
|
19
20
|
* Base services provided to addon package service factories.
|
|
20
21
|
* These are always available from the parent application.
|
|
@@ -93,8 +94,12 @@ export const pikkuAddonServices = <T extends Record<string, any>, ExistingServic
|
|
|
93
94
|
* })
|
|
94
95
|
* ```
|
|
95
96
|
*/
|
|
96
|
-
export const pikkuAddonWireServices = (
|
|
97
|
-
func: (services:
|
|
97
|
+
export const pikkuAddonWireServices = <ExistingServices extends Omit<Partial<SingletonServices>, 'variables' | 'secrets'> & AddonBaseServices>(
|
|
98
|
+
func: (services: ExistingServices, wire: PikkuWire) => Promise<Record<string, any>>
|
|
98
99
|
) => {
|
|
99
|
-
return
|
|
100
|
+
return ((services: any, wire: PikkuWire) => {
|
|
101
|
+
const typedVariables = new TypedVariablesService(services.variables)
|
|
102
|
+
const typedSecrets = new TypedSecretService(services.secrets)
|
|
103
|
+
return func({ ...services, variables: typedVariables, secrets: typedSecrets } as ExistingServices, wire)
|
|
104
|
+
}) as any
|
|
100
105
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.19
|
|
3
3
|
*/
|
|
4
4
|
import { pikkuState } from '@pikku/core/internal';
|
|
5
5
|
import { createSingletonServices as createSingletonServices } from '../../src/services.js';
|
|
6
6
|
pikkuState('@pikku/addon-graph', 'package', 'factories', {
|
|
7
7
|
createSingletonServices,
|
|
8
8
|
});
|
|
9
|
+
pikkuState('@pikku/addon-graph', 'package', 'requiredParentServices', ["jwt"]);
|
|
9
10
|
//# sourceMappingURL=pikku-package.gen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pikku-package.gen.js","sourceRoot":"","sources":["../../../.pikku/addon/pikku-package.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,uBAAuB,IAAI,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAE1F,UAAU,CAAC,oBAAoB,EAAE,SAAS,EAAE,WAAW,EAAE;IACvD,uBAAuB;CACxB,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"pikku-package.gen.js","sourceRoot":"","sources":["../../../.pikku/addon/pikku-package.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,uBAAuB,IAAI,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAE1F,UAAU,CAAC,oBAAoB,EAAE,SAAS,EAAE,WAAW,EAAE;IACvD,uBAAuB;CACxB,CAAC,CAAA;AAEF,UAAU,CAAC,oBAAoB,EAAE,SAAS,EAAE,wBAAwB,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.19
|
|
3
3
|
*/
|
|
4
4
|
import { pikkuState } from '@pikku/core/internal'
|
|
5
5
|
import { createSingletonServices as createSingletonServices } from '../../src/services.js'
|
|
@@ -7,3 +7,5 @@ import { createSingletonServices as createSingletonServices } from '../../src/se
|
|
|
7
7
|
pikkuState('@pikku/addon-graph', 'package', 'factories', {
|
|
8
8
|
createSingletonServices,
|
|
9
9
|
})
|
|
10
|
+
|
|
11
|
+
pikkuState('@pikku/addon-graph', 'package', 'requiredParentServices', ["jwt"])
|
|
@@ -1,16 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.19
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
|
-
* Agent type map with output types for each agent
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
interface AgentHandler<O> {
|
|
12
|
-
output: O;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export type AgentMap = {
|
|
16
|
-
};
|
|
4
|
+
export type AgentMap = {}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.19
|
|
3
3
|
*/
|
|
4
4
|
import { CoreAIAgent, PikkuAIMiddlewareHooks } from '@pikku/core/ai-agent';
|
|
5
5
|
import type { PikkuPermission, PikkuMiddleware, Services, PikkuFunctionConfig } from '../function/pikku-function-types.gen.js';
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.19
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Channel-specific type definitions for tree-shaking optimization
|
|
6
|
+
*/
|
|
7
|
+
import { CoreChannel, CorePikkuChannelMiddleware, CorePikkuChannelMiddlewareFactory } from '@pikku/core/channel';
|
|
8
|
+
import { AssertHTTPWiringParams } from '@pikku/core/http';
|
|
9
|
+
import type { PikkuFunctionConfig, PikkuFunctionSessionless, PikkuPermission, PikkuMiddleware, Services } from '../function/pikku-function-types.gen.js';
|
|
10
|
+
import type { CorePermissionGroup } from '@pikku/core';
|
|
11
|
+
import type { StandardSchemaV1 } from '@standard-schema/spec';
|
|
12
|
+
/**
|
|
13
|
+
* Helper type to infer the output type from a Standard Schema
|
|
14
|
+
*/
|
|
15
|
+
type InferSchemaOutput<T> = T extends StandardSchemaV1<any, infer Output> ? Output : never;
|
|
16
|
+
/**
|
|
17
|
+
* Type definition for WebSocket channels with typed data exchange.
|
|
18
|
+
* Supports connection, disconnection, and message handling.
|
|
19
|
+
* Accepts both session-based (PikkuFunction) and sessionless (PikkuFunctionSessionless) functions.
|
|
20
|
+
*
|
|
21
|
+
* @template ChannelData - Type of data exchanged through the channel
|
|
22
|
+
* @template Channel - String literal type for the channel name
|
|
23
|
+
*/
|
|
24
|
+
type ChannelWiring<ChannelData, Channel extends string> = CoreChannel<ChannelData, Channel, PikkuFunctionConfig<void, any, 'channel' | 'session' | 'rpc'>, PikkuFunctionConfig<void, void, 'channel' | 'session' | 'rpc'>, PikkuFunctionConfig<any, any, 'channel' | 'session' | 'rpc'>, PikkuPermission, PikkuMiddleware>;
|
|
25
|
+
/**
|
|
26
|
+
* Creates a function that handles WebSocket channel connections.
|
|
27
|
+
* Called when a client connects to a channel.
|
|
28
|
+
*
|
|
29
|
+
* @template Out - Output type for connection response
|
|
30
|
+
* @param func - Function definition, either direct function or configuration object
|
|
31
|
+
* @returns The normalized configuration object
|
|
32
|
+
*/
|
|
33
|
+
export declare const pikkuChannelConnectionFunc: <Out = unknown>(func: PikkuFunctionSessionless<void, Out, "channel" | "session" | "rpc"> | PikkuFunctionConfig<void, Out, "channel" | "session" | "rpc">) => PikkuFunctionConfig<void, Out, "channel" | "rpc" | "session">;
|
|
34
|
+
/**
|
|
35
|
+
* Creates a function that handles WebSocket channel disconnections.
|
|
36
|
+
* Called when a client disconnects from a channel.
|
|
37
|
+
*
|
|
38
|
+
* @param func - Function definition, either direct function or configuration object
|
|
39
|
+
* @returns The normalized configuration object
|
|
40
|
+
*/
|
|
41
|
+
export declare const pikkuChannelDisconnectionFunc: (func: PikkuFunctionSessionless<void, void, "channel"> | PikkuFunctionConfig<void, void, "channel" | "session" | "rpc">) => PikkuFunctionConfig<void, void, "channel" | "rpc" | "session">;
|
|
42
|
+
/**
|
|
43
|
+
* Configuration object for channel functions with Zod schema validation.
|
|
44
|
+
*/
|
|
45
|
+
type PikkuChannelFuncConfigWithSchema<InputSchema extends StandardSchemaV1, OutputSchema extends StandardSchemaV1 | undefined = undefined> = {
|
|
46
|
+
name?: string;
|
|
47
|
+
tags?: string[];
|
|
48
|
+
expose?: boolean;
|
|
49
|
+
remote?: boolean;
|
|
50
|
+
func: PikkuFunctionSessionless<InferSchemaOutput<InputSchema>, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, 'channel' | 'session' | 'rpc'>;
|
|
51
|
+
auth?: boolean;
|
|
52
|
+
permissions?: CorePermissionGroup<PikkuPermission<InferSchemaOutput<InputSchema>>>;
|
|
53
|
+
middleware?: PikkuMiddleware[];
|
|
54
|
+
input: InputSchema;
|
|
55
|
+
output?: OutputSchema;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Creates a function that handles WebSocket channel messages.
|
|
59
|
+
* Called when a message is received on a channel.
|
|
60
|
+
*
|
|
61
|
+
* Supports two patterns:
|
|
62
|
+
* 1. Generic types: `pikkuChannelFunc<Input, Output>({ func: ... })`
|
|
63
|
+
* 2. Zod schemas: `pikkuChannelFunc({ input: z.object(...), func: ... })`
|
|
64
|
+
*
|
|
65
|
+
* @template In - Input type for channel messages (inferred from schema if provided)
|
|
66
|
+
* @template Out - Output type for channel responses (inferred from schema if provided)
|
|
67
|
+
* @param func - Function definition, either direct function or configuration object
|
|
68
|
+
* @returns The normalized configuration object
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```typescript
|
|
72
|
+
* // Pattern 1: Using generic types
|
|
73
|
+
* const handleMessage = pikkuChannelFunc<{text: string}, {received: boolean}>({
|
|
74
|
+
* func: async (_services, { text }) => ({ received: true })
|
|
75
|
+
* })
|
|
76
|
+
*
|
|
77
|
+
* // Pattern 2: Using Zod schemas
|
|
78
|
+
* const messageInput = z.object({ text: z.string() })
|
|
79
|
+
* const messageOutput = z.object({ received: z.boolean() })
|
|
80
|
+
*
|
|
81
|
+
* const handleMessage = pikkuChannelFunc({
|
|
82
|
+
* input: messageInput,
|
|
83
|
+
* output: messageOutput,
|
|
84
|
+
* func: async (_services, { text }) => ({ received: true })
|
|
85
|
+
* })
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
export declare function pikkuChannelFunc<InputSchema extends StandardSchemaV1, OutputSchema extends StandardSchemaV1 | undefined = undefined>(config: PikkuChannelFuncConfigWithSchema<InputSchema, OutputSchema>): PikkuFunctionConfig<InferSchemaOutput<InputSchema>, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, 'channel' | 'session' | 'rpc'>;
|
|
89
|
+
export declare function pikkuChannelFunc<In, Out = unknown>(func: PikkuFunctionSessionless<In, Out, 'channel' | 'session' | 'rpc'> | PikkuFunctionConfig<In, Out, 'channel' | 'session' | 'rpc'>): PikkuFunctionConfig<In, Out, 'channel' | 'session' | 'rpc'>;
|
|
90
|
+
/**
|
|
91
|
+
* Registers a WebSocket channel with the Pikku framework.
|
|
92
|
+
*
|
|
93
|
+
* @template ChannelData - Type of data associated with the channel
|
|
94
|
+
* @template Channel - String literal type for the channel name
|
|
95
|
+
* @param channel - Channel definition with connection, disconnection, and message handlers
|
|
96
|
+
*/
|
|
97
|
+
export declare const wireChannel: <ChannelData, Channel extends string>(channel: ChannelWiring<ChannelData, Channel> & AssertHTTPWiringParams<ChannelData, Channel>) => void;
|
|
98
|
+
/**
|
|
99
|
+
* Type-safe helper for defining channel message routes that can be composed.
|
|
100
|
+
* Returns the routes record as-is for use with wireChannel's onMessageWiring.
|
|
101
|
+
*
|
|
102
|
+
* @template T - Record of channel route handlers
|
|
103
|
+
* @param routes - The channel routes record
|
|
104
|
+
* @returns The same routes record (identity function for type safety)
|
|
105
|
+
*/
|
|
106
|
+
export declare function defineChannelRoutes<T extends Record<string, any>>(routes: T): T;
|
|
107
|
+
export type PikkuChannelMiddleware<RequiredServices extends Services = Services, Event = unknown> = CorePikkuChannelMiddleware<RequiredServices, Event>;
|
|
108
|
+
export declare const pikkuChannelMiddleware: <RequiredServices extends Services = Services, Event = unknown>(middleware: PikkuChannelMiddleware<RequiredServices, Event>) => PikkuChannelMiddleware<RequiredServices, Event>;
|
|
109
|
+
export declare const pikkuChannelMiddlewareFactory: <In = any>(factory: CorePikkuChannelMiddlewareFactory<In>) => CorePikkuChannelMiddlewareFactory<In>;
|
|
110
|
+
export declare const addChannelMiddleware: (tag: string, middleware: PikkuChannelMiddleware[]) => CorePikkuChannelMiddleware[];
|
|
111
|
+
export {};
|
|
112
|
+
//# sourceMappingURL=pikku-channel-types.gen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pikku-channel-types.gen.d.ts","sourceRoot":"","sources":["../../../.pikku/channel/pikku-channel-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,0BAA0B,EAAE,iCAAiC,EAAoI,MAAM,qBAAqB,CAAA;AAClP,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,eAAe,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAA;AACxJ,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE7D;;GAEG;AACH,KAAK,iBAAiB,CAAC,CAAC,IAAI,CAAC,SAAS,gBAAgB,CAAC,GAAG,EAAE,MAAM,MAAM,CAAC,GAAG,MAAM,GAAG,KAAK,CAAA;AAE1F;;;;;;;GAOG;AACH,KAAK,aAAa,CAAC,WAAW,EAAE,OAAO,SAAS,MAAM,IAAI,WAAW,CACnE,WAAW,EACX,OAAO,EACP,mBAAmB,CAAC,IAAI,EAAE,GAAG,EAAE,SAAS,GAAG,SAAS,GAAG,KAAK,CAAC,EAC7D,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,KAAK,CAAC,EAC9D,mBAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,SAAS,GAAG,SAAS,GAAG,KAAK,CAAC,EAC5D,eAAe,EACf,eAAe,CAChB,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,GAAI,GAAG,GAAG,OAAO,EACtD,MACI,wBAAw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EACpD,SAAS,iCAAiC,CAAC,EAAE,CAAC,KAC7C,iCAAiC,CAAC,EAAE,CAEtC,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,KAAK,MAAM,EAAE,YAAY,sBAAsB,EAAE,iCACrB,CAAA"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.19
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Channel-specific type definitions for tree-shaking optimization
|
|
6
|
+
*/
|
|
7
|
+
import { wireChannel as wireChannelCore, defineChannelRoutes as defineChannelRoutesCore, addChannelMiddleware as addChannelMiddlewareCore } from '@pikku/core/channel';
|
|
8
|
+
/**
|
|
9
|
+
* Creates a function that handles WebSocket channel connections.
|
|
10
|
+
* Called when a client connects to a channel.
|
|
11
|
+
*
|
|
12
|
+
* @template Out - Output type for connection response
|
|
13
|
+
* @param func - Function definition, either direct function or configuration object
|
|
14
|
+
* @returns The normalized configuration object
|
|
15
|
+
*/
|
|
16
|
+
export const pikkuChannelConnectionFunc = (func) => {
|
|
17
|
+
return typeof func === 'function' ? { func } : func;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Creates a function that handles WebSocket channel disconnections.
|
|
21
|
+
* Called when a client disconnects from a channel.
|
|
22
|
+
*
|
|
23
|
+
* @param func - Function definition, either direct function or configuration object
|
|
24
|
+
* @returns The normalized configuration object
|
|
25
|
+
*/
|
|
26
|
+
export const pikkuChannelDisconnectionFunc = (func) => {
|
|
27
|
+
return typeof func === 'function' ? { func } : func;
|
|
28
|
+
};
|
|
29
|
+
export function pikkuChannelFunc(func) {
|
|
30
|
+
return typeof func === 'function' ? { func } : func;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Registers a WebSocket channel with the Pikku framework.
|
|
34
|
+
*
|
|
35
|
+
* @template ChannelData - Type of data associated with the channel
|
|
36
|
+
* @template Channel - String literal type for the channel name
|
|
37
|
+
* @param channel - Channel definition with connection, disconnection, and message handlers
|
|
38
|
+
*/
|
|
39
|
+
export const wireChannel = (channel) => {
|
|
40
|
+
wireChannelCore(channel);
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Type-safe helper for defining channel message routes that can be composed.
|
|
44
|
+
* Returns the routes record as-is for use with wireChannel's onMessageWiring.
|
|
45
|
+
*
|
|
46
|
+
* @template T - Record of channel route handlers
|
|
47
|
+
* @param routes - The channel routes record
|
|
48
|
+
* @returns The same routes record (identity function for type safety)
|
|
49
|
+
*/
|
|
50
|
+
export function defineChannelRoutes(routes) {
|
|
51
|
+
return defineChannelRoutesCore(routes);
|
|
52
|
+
}
|
|
53
|
+
export const pikkuChannelMiddleware = (middleware) => {
|
|
54
|
+
return middleware;
|
|
55
|
+
};
|
|
56
|
+
export const pikkuChannelMiddlewareFactory = (factory) => {
|
|
57
|
+
return factory;
|
|
58
|
+
};
|
|
59
|
+
export const addChannelMiddleware = (tag, middleware) => addChannelMiddlewareCore(tag, middleware, '@pikku/addon-graph');
|
|
60
|
+
//# sourceMappingURL=pikku-channel-types.gen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pikku-channel-types.gen.js","sourceRoot":"","sources":["../../../.pikku/channel/pikku-channel-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;AAEH,OAAO,EAA8E,WAAW,IAAI,eAAe,EAAE,mBAAmB,IAAI,uBAAuB,EAAE,oBAAoB,IAAI,wBAAwB,EAAE,MAAM,qBAAqB,CAAA;AA6BlP;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CACxC,IAEiE,EACjE,EAAE;IACF,OAAO,OAAO,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;AACrD,CAAC,CAAA;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAC3C,IAEkE,E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