@pikku/addon-graph 0.0.3 → 0.12.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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-package.gen.js +2 -1
- package/dist/.pikku/addon/pikku-package.gen.js.map +1 -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/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/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/console/pikku-node-types.gen.d.ts +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +57 -86
- package/dist/.pikku/function/pikku-function-types.gen.d.ts.map +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.js +46 -57
- package/dist/.pikku/function/pikku-function-types.gen.js.map +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.json +476 -449
- package/dist/.pikku/function/pikku-functions.gen.js +2 -2
- package/dist/.pikku/function/pikku-functions.gen.js.map +1 -1
- 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/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/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-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-services.gen.d.ts +8 -3
- package/dist/.pikku/pikku-services.gen.d.ts.map +1 -1
- package/dist/.pikku/pikku-services.gen.js +7 -1
- package/dist/.pikku/pikku-services.gen.js.map +1 -1
- package/dist/.pikku/pikku-types.gen.d.ts +1 -1
- package/dist/.pikku/pikku-types.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +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/rpc/pikku-rpc-wirings-map.gen.d.ts +429 -57
- package/dist/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +430 -58
- 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/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/schemas/register.gen.js +3 -1
- package/dist/.pikku/schemas/register.gen.js.map +1 -1
- package/dist/.pikku/schemas/schemas/AggregateInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/AggregateOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/ChunkInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/ChunkOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/CoalesceInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/CoalesceOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/CryptoInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/CryptoOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/DateTimeInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/DateTimeOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/EditFieldsInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/EditFieldsOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/FindInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/FindOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/GroupByInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/GroupByOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/JwtDecodeInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/JwtDecodeOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/JwtSignInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/JwtSignOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/LimitInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/LimitOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/MathInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/MathOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/MergeInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/MergeOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/OmitInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/OmitOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PickInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PickOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/RemoveDuplicatesInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/RemoveDuplicatesOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/RenameKeysInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/RenameKeysOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/ReverseInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/ReverseOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/SleepInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/SleepOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/SortInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/SortOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/SplitOutInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/SplitOutOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/StringTransformInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/StringTransformOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/SummarizeInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/SummarizeOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/TypeConvertInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/TypeConvertOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/UniqueInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/UniqueOutput.schema.json +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
- package/dist/.pikku/workflow/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-wirings-meta.gen.js +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/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/dist/src/functions/data/sleep.function.d.ts +1 -0
- package/dist/src/functions/data/sleep.function.d.ts.map +1 -1
- package/dist/src/functions/data/sleep.function.js +2 -1
- package/dist/src/functions/data/sleep.function.js.map +1 -1
- package/package.json +6 -9
- package/dist/.pikku/addon/pikku-addon-types.gen.ts +0 -100
- package/dist/.pikku/addon/pikku-package.gen.ts +0 -9
- package/dist/.pikku/agent/pikku-agent-types.gen.ts +0 -82
- 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/console/pikku-addon-meta.gen.json +0 -281
- package/dist/.pikku/console/pikku-node-types.gen.ts +0 -8
- package/dist/.pikku/function/pikku-function-types.gen.ts +0 -686
- package/dist/.pikku/function/pikku-functions-meta-verbose.gen.json +0 -610
- package/dist/.pikku/function/pikku-functions-meta.gen.ts +0 -7
- package/dist/.pikku/function/pikku-functions.gen.ts +0 -56
- package/dist/.pikku/pikku-bootstrap.gen.ts +0 -15
- package/dist/.pikku/pikku-services.gen.ts +0 -34
- package/dist/.pikku/pikku-types.gen.ts +0 -21
- package/dist/.pikku/schema-cache.json +0 -1
- package/dist/.pikku/schemas/pikku.cache.json +0 -1
- package/dist/.pikku/schemas/register.gen.ts +0 -199
- package/dist/.pikku/secrets/pikku-secret-types.gen.ts +0 -5
- package/dist/.pikku/secrets/pikku-secrets-meta.gen.json +0 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.ts +0 -21
- package/dist/.pikku/trigger/pikku-trigger-types.gen.ts +0 -160
- package/dist/.pikku/variables/pikku-variable-types.gen.ts +0 -5
- package/dist/.pikku/variables/pikku-variables-meta.gen.json +0 -1
- package/dist/.pikku/variables/pikku-variables.gen.ts +0 -21
- package/dist/.pikku/workflow/pikku-workflow-types.gen.ts +0 -214
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +0 -9
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.ts +0 -3
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.8
|
|
3
|
-
*/
|
|
4
|
-
import { WorkflowCancelledException } from '@pikku/core/workflow'
|
|
5
|
-
import {
|
|
6
|
-
workflow as coreWorkflow,
|
|
7
|
-
workflowStart as coreWorkflowStart,
|
|
8
|
-
workflowStatus as coreWorkflowStatus,
|
|
9
|
-
graphStart as coreGraphStart,
|
|
10
|
-
} from '@pikku/core/workflow'
|
|
11
|
-
import { template } from '@pikku/core/workflow'
|
|
12
|
-
import {
|
|
13
|
-
pikkuWorkflowGraph as corePikkuWorkflowGraph,
|
|
14
|
-
type PikkuWorkflowGraphConfig,
|
|
15
|
-
type PikkuWorkflowGraphResult,
|
|
16
|
-
} from '@pikku/core/workflow'
|
|
17
|
-
import type { PikkuWorkflowWire, WorkflowStepOptions } from '@pikku/core/workflow'
|
|
18
|
-
|
|
19
|
-
export { WorkflowCancelledException }
|
|
20
|
-
import type { PikkuFunctionSessionless, PikkuFunctionConfig } from '../function/pikku-function-types.gen.js'
|
|
21
|
-
import type { FlattenedRPCMap } from '../rpc/pikku-rpc-wirings-map.internal.gen.d.js'
|
|
22
|
-
import type { WorkflowMap, GraphsMap } from './pikku-workflow-map.gen.d.js'
|
|
23
|
-
|
|
24
|
-
export { template }
|
|
25
|
-
|
|
26
|
-
export interface TypedWorkflow extends PikkuWorkflowWire {
|
|
27
|
-
do<K extends keyof FlattenedRPCMap>(
|
|
28
|
-
stepName: string,
|
|
29
|
-
rpcName: K,
|
|
30
|
-
data: FlattenedRPCMap[K]['input'],
|
|
31
|
-
options?: WorkflowStepOptions
|
|
32
|
-
): Promise<FlattenedRPCMap[K]['output']>
|
|
33
|
-
|
|
34
|
-
do<K extends keyof WorkflowMap>(
|
|
35
|
-
stepName: string,
|
|
36
|
-
workflowName: K,
|
|
37
|
-
data: WorkflowMap[K]['input'],
|
|
38
|
-
options?: WorkflowStepOptions
|
|
39
|
-
): Promise<WorkflowMap[K]['output']>
|
|
40
|
-
|
|
41
|
-
do<T>(
|
|
42
|
-
stepName: string,
|
|
43
|
-
fn: () => T | Promise<T>,
|
|
44
|
-
options?: WorkflowStepOptions
|
|
45
|
-
): Promise<T>
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
import type { StandardSchemaV1 } from '@standard-schema/spec'
|
|
49
|
-
import type { InferSchemaOutput, PikkuPermission, PikkuMiddleware, NodeConfig, PikkuApprovalDescription } from '../function/pikku-function-types.gen.js'
|
|
50
|
-
import { PikkuError } from '@pikku/core/errors'
|
|
51
|
-
import type { CorePermissionGroup } from '@pikku/core'
|
|
52
|
-
|
|
53
|
-
export type PikkuFunctionWorkflow<
|
|
54
|
-
In = unknown,
|
|
55
|
-
Out = never
|
|
56
|
-
> = PikkuFunctionSessionless<In, Out, 'workflow'>
|
|
57
|
-
|
|
58
|
-
export type PikkuWorkflowConfigWithSchema<
|
|
59
|
-
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
60
|
-
OutputSchema extends StandardSchemaV1 | undefined = undefined
|
|
61
|
-
> = {
|
|
62
|
-
title?: string
|
|
63
|
-
description?: string
|
|
64
|
-
tags?: string[]
|
|
65
|
-
expose?: boolean
|
|
66
|
-
internal?: boolean
|
|
67
|
-
override?: string
|
|
68
|
-
version?: number
|
|
69
|
-
remote?: boolean
|
|
70
|
-
mcp?: boolean
|
|
71
|
-
readonly?: boolean
|
|
72
|
-
approvalRequired?: boolean
|
|
73
|
-
approvalDescription?: InputSchema extends StandardSchemaV1 ? PikkuApprovalDescription<InferSchemaOutput<InputSchema>> : never
|
|
74
|
-
func: PikkuFunctionWorkflow<
|
|
75
|
-
InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown,
|
|
76
|
-
OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown
|
|
77
|
-
>
|
|
78
|
-
auth?: boolean
|
|
79
|
-
permissions?: InputSchema extends StandardSchemaV1 ? CorePermissionGroup<PikkuPermission<InferSchemaOutput<InputSchema>>> : undefined
|
|
80
|
-
middleware?: PikkuMiddleware[]
|
|
81
|
-
input?: InputSchema
|
|
82
|
-
output?: OutputSchema
|
|
83
|
-
node?: NodeConfig
|
|
84
|
-
errors?: Array<typeof PikkuError>
|
|
85
|
-
inline?: boolean
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export function pikkuWorkflowFunc<
|
|
89
|
-
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
90
|
-
OutputSchema extends StandardSchemaV1 | undefined = undefined
|
|
91
|
-
>(
|
|
92
|
-
config: PikkuWorkflowConfigWithSchema<InputSchema, OutputSchema>
|
|
93
|
-
): 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>
|
|
94
|
-
export function pikkuWorkflowFunc<In, Out = unknown>(
|
|
95
|
-
func:
|
|
96
|
-
| PikkuFunctionWorkflow<In, Out>
|
|
97
|
-
| PikkuFunctionConfig<In, Out, 'workflow', PikkuFunctionWorkflow<In, Out>>
|
|
98
|
-
): PikkuFunctionConfig<In, Out, 'workflow'>
|
|
99
|
-
export function pikkuWorkflowFunc(func: any) {
|
|
100
|
-
return typeof func === 'function' ? { func } : func
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export function pikkuWorkflowComplexFunc<
|
|
104
|
-
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
105
|
-
OutputSchema extends StandardSchemaV1 | undefined = undefined
|
|
106
|
-
>(
|
|
107
|
-
config: PikkuWorkflowConfigWithSchema<InputSchema, OutputSchema>
|
|
108
|
-
): 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>
|
|
109
|
-
export function pikkuWorkflowComplexFunc<In, Out = unknown>(
|
|
110
|
-
func:
|
|
111
|
-
| PikkuFunctionWorkflow<In, Out>
|
|
112
|
-
| PikkuFunctionConfig<In, Out, 'workflow', PikkuFunctionWorkflow<In, Out>>
|
|
113
|
-
): PikkuFunctionConfig<In, Out, 'workflow'>
|
|
114
|
-
export function pikkuWorkflowComplexFunc(func: any) {
|
|
115
|
-
return typeof func === 'function' ? { func } : func
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
type TypedRef<T> = { $ref: string; path?: string } & { __phantomType?: T }
|
|
119
|
-
|
|
120
|
-
type TemplateString = {
|
|
121
|
-
$template: {
|
|
122
|
-
parts: string[]
|
|
123
|
-
expressions: Array<{ $ref: string; path?: string }>
|
|
124
|
-
}
|
|
125
|
-
} & { __brand: 'TemplateString' }
|
|
126
|
-
|
|
127
|
-
type InputWithRefs<T> = {
|
|
128
|
-
[K in keyof T]?: T[K] | TypedRef<T[K]> | TypedRef<unknown> | TemplateString
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
type NodeInputType<FuncMap extends Record<string, string>, K extends keyof FuncMap> =
|
|
132
|
-
FuncMap[K] extends keyof FlattenedRPCMap
|
|
133
|
-
? InputWithRefs<FlattenedRPCMap[FuncMap[K]]['input']>
|
|
134
|
-
: Record<string, unknown>
|
|
135
|
-
|
|
136
|
-
type NodeOutputKeys<FuncMap extends Record<string, string>, N extends string> =
|
|
137
|
-
N extends keyof FuncMap
|
|
138
|
-
? FuncMap[N] extends keyof FlattenedRPCMap
|
|
139
|
-
? keyof FlattenedRPCMap[FuncMap[N]]['output'] & string
|
|
140
|
-
: string
|
|
141
|
-
: string
|
|
142
|
-
|
|
143
|
-
type RefFunction<FuncMap extends Record<string, string>> = {
|
|
144
|
-
<N extends Extract<keyof FuncMap, string>>(
|
|
145
|
-
nodeId: N,
|
|
146
|
-
path: NodeOutputKeys<FuncMap, N>
|
|
147
|
-
): TypedRef<unknown>
|
|
148
|
-
(nodeId: 'trigger' | '$item', path?: string): TypedRef<unknown>
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
type TemplateFunction = (templateStr: string, refs: TypedRef<unknown>[]) => TemplateString
|
|
152
|
-
|
|
153
|
-
type GraphNodeConfigMap<FuncMap extends Record<string, string>> = {
|
|
154
|
-
[K in Extract<keyof FuncMap, string>]?: {
|
|
155
|
-
next?: NextConfig<Extract<keyof FuncMap, string>>
|
|
156
|
-
input?:
|
|
157
|
-
| NodeInputType<FuncMap, K>
|
|
158
|
-
| (() => NodeInputType<FuncMap, K>)
|
|
159
|
-
| ((ref: RefFunction<FuncMap>, template: TemplateFunction) => NodeInputType<FuncMap, K>)
|
|
160
|
-
onError?: Extract<keyof FuncMap, string> | Extract<keyof FuncMap, string>[]
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
type NextConfig<NodeIds extends string> = NodeIds | NodeIds[] | { if: string; then: NodeIds; else?: NodeIds }
|
|
165
|
-
|
|
166
|
-
export function pikkuWorkflowGraph<
|
|
167
|
-
const FuncMap extends Record<string, keyof FlattenedRPCMap & string>
|
|
168
|
-
>(
|
|
169
|
-
config: PikkuWorkflowGraphConfig<FuncMap, GraphNodeConfigMap<FuncMap>>
|
|
170
|
-
): PikkuWorkflowGraphResult {
|
|
171
|
-
return corePikkuWorkflowGraph(config as any)
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
export const workflow = <Name extends keyof WorkflowMap>(
|
|
175
|
-
workflowName: Name,
|
|
176
|
-
options?: { pollIntervalMs?: number }
|
|
177
|
-
) => {
|
|
178
|
-
return coreWorkflow<WorkflowMap>(workflowName as string & keyof WorkflowMap, options) as PikkuFunctionConfig<
|
|
179
|
-
WorkflowMap[Name]['input'],
|
|
180
|
-
WorkflowMap[Name]['output'],
|
|
181
|
-
'session' | 'rpc'
|
|
182
|
-
>
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
export const workflowStart = <Name extends keyof WorkflowMap>(
|
|
186
|
-
workflowName: Name
|
|
187
|
-
) => {
|
|
188
|
-
return coreWorkflowStart<WorkflowMap>(workflowName as string & keyof WorkflowMap) as PikkuFunctionConfig<
|
|
189
|
-
WorkflowMap[Name]['input'],
|
|
190
|
-
{ runId: string },
|
|
191
|
-
'session' | 'rpc'
|
|
192
|
-
>
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
export const workflowStatus = <Name extends keyof WorkflowMap>(
|
|
196
|
-
_workflowName: Name
|
|
197
|
-
) => {
|
|
198
|
-
return coreWorkflowStatus<WorkflowMap>(_workflowName as string & keyof WorkflowMap) as PikkuFunctionConfig<
|
|
199
|
-
{ runId: string },
|
|
200
|
-
{ id: string; status: 'running' | 'completed' | 'failed' | 'cancelled'; output?: WorkflowMap[Name]['output']; error?: { message?: string } },
|
|
201
|
-
'session' | 'rpc'
|
|
202
|
-
>
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
export const graphStart = <Name extends keyof GraphsMap, Node extends string & keyof GraphsMap[Name]>(
|
|
206
|
-
graphName: Name,
|
|
207
|
-
startNode: Node
|
|
208
|
-
) => {
|
|
209
|
-
return coreGraphStart<GraphsMap>(graphName as string & keyof GraphsMap, startNode as string) as PikkuFunctionConfig<
|
|
210
|
-
GraphsMap[Name][Node] extends { input: infer I } ? I : never,
|
|
211
|
-
{ runId: string },
|
|
212
|
-
'session' | 'rpc'
|
|
213
|
-
>
|
|
214
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.8
|
|
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)
|