@pikku/addon-graph 0.12.0 → 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.
Files changed (229) hide show
  1. package/dist/.pikku/addon/pikku-addon-types.gen.d.ts +1 -1
  2. package/dist/.pikku/addon/pikku-addon-types.gen.js +1 -1
  3. package/dist/.pikku/addon/pikku-package.gen.js +1 -1
  4. package/dist/.pikku/agent/pikku-agent-map.gen.d.ts +1 -1
  5. package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
  6. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +1 -1
  7. package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
  8. package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
  9. package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
  10. package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
  11. package/dist/.pikku/function/pikku-function-types.gen.d.ts +43 -69
  12. package/dist/.pikku/function/pikku-function-types.gen.d.ts.map +1 -1
  13. package/dist/.pikku/function/pikku-function-types.gen.js +33 -40
  14. package/dist/.pikku/function/pikku-function-types.gen.js.map +1 -1
  15. package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
  16. package/dist/.pikku/function/pikku-functions-meta.gen.json +476 -449
  17. package/dist/.pikku/function/pikku-functions.gen.js +1 -1
  18. package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
  19. package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
  20. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
  21. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
  22. package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -1
  23. package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
  24. package/dist/.pikku/pikku-meta-service.gen.d.ts +1 -1
  25. package/dist/.pikku/pikku-meta-service.gen.js +1 -1
  26. package/dist/.pikku/pikku-services.gen.d.ts +3 -1
  27. package/dist/.pikku/pikku-services.gen.d.ts.map +1 -1
  28. package/dist/.pikku/pikku-services.gen.js +2 -0
  29. package/dist/.pikku/pikku-services.gen.js.map +1 -1
  30. package/dist/.pikku/pikku-types.gen.d.ts +1 -1
  31. package/dist/.pikku/pikku-types.gen.js +1 -1
  32. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
  33. package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
  34. package/dist/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +11 -3
  35. package/dist/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +12 -4
  36. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
  37. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +26 -26
  38. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
  39. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
  40. package/dist/.pikku/schemas/register.gen.js +3 -1
  41. package/dist/.pikku/schemas/register.gen.js.map +1 -1
  42. package/dist/.pikku/schemas/schemas/AggregateInput.schema.json +1 -1
  43. package/dist/.pikku/schemas/schemas/AggregateOutput.schema.json +1 -1
  44. package/dist/.pikku/schemas/schemas/ChunkInput.schema.json +1 -1
  45. package/dist/.pikku/schemas/schemas/ChunkOutput.schema.json +1 -1
  46. package/dist/.pikku/schemas/schemas/CoalesceInput.schema.json +1 -1
  47. package/dist/.pikku/schemas/schemas/CoalesceOutput.schema.json +1 -1
  48. package/dist/.pikku/schemas/schemas/CryptoInput.schema.json +1 -1
  49. package/dist/.pikku/schemas/schemas/CryptoOutput.schema.json +1 -1
  50. package/dist/.pikku/schemas/schemas/DateTimeInput.schema.json +1 -1
  51. package/dist/.pikku/schemas/schemas/DateTimeOutput.schema.json +1 -1
  52. package/dist/.pikku/schemas/schemas/EditFieldsInput.schema.json +1 -1
  53. package/dist/.pikku/schemas/schemas/EditFieldsOutput.schema.json +1 -1
  54. package/dist/.pikku/schemas/schemas/FindInput.schema.json +1 -1
  55. package/dist/.pikku/schemas/schemas/FindOutput.schema.json +1 -1
  56. package/dist/.pikku/schemas/schemas/GroupByInput.schema.json +1 -1
  57. package/dist/.pikku/schemas/schemas/GroupByOutput.schema.json +1 -1
  58. package/dist/.pikku/schemas/schemas/JwtDecodeInput.schema.json +1 -1
  59. package/dist/.pikku/schemas/schemas/JwtDecodeOutput.schema.json +1 -1
  60. package/dist/.pikku/schemas/schemas/JwtSignInput.schema.json +1 -1
  61. package/dist/.pikku/schemas/schemas/JwtSignOutput.schema.json +1 -1
  62. package/dist/.pikku/schemas/schemas/LimitInput.schema.json +1 -1
  63. package/dist/.pikku/schemas/schemas/LimitOutput.schema.json +1 -1
  64. package/dist/.pikku/schemas/schemas/MathInput.schema.json +1 -1
  65. package/dist/.pikku/schemas/schemas/MathOutput.schema.json +1 -1
  66. package/dist/.pikku/schemas/schemas/MergeInput.schema.json +1 -1
  67. package/dist/.pikku/schemas/schemas/MergeOutput.schema.json +1 -1
  68. package/dist/.pikku/schemas/schemas/OmitInput.schema.json +1 -1
  69. package/dist/.pikku/schemas/schemas/OmitOutput.schema.json +1 -1
  70. package/dist/.pikku/schemas/schemas/PickInput.schema.json +1 -1
  71. package/dist/.pikku/schemas/schemas/PickOutput.schema.json +1 -1
  72. package/dist/.pikku/schemas/schemas/RemoveDuplicatesInput.schema.json +1 -1
  73. package/dist/.pikku/schemas/schemas/RemoveDuplicatesOutput.schema.json +1 -1
  74. package/dist/.pikku/schemas/schemas/RenameKeysInput.schema.json +1 -1
  75. package/dist/.pikku/schemas/schemas/RenameKeysOutput.schema.json +1 -1
  76. package/dist/.pikku/schemas/schemas/ReverseInput.schema.json +1 -1
  77. package/dist/.pikku/schemas/schemas/ReverseOutput.schema.json +1 -1
  78. package/dist/.pikku/schemas/schemas/SleepInput.schema.json +1 -1
  79. package/dist/.pikku/schemas/schemas/SleepOutput.schema.json +1 -0
  80. package/dist/.pikku/schemas/schemas/SortInput.schema.json +1 -1
  81. package/dist/.pikku/schemas/schemas/SortOutput.schema.json +1 -1
  82. package/dist/.pikku/schemas/schemas/SplitOutInput.schema.json +1 -1
  83. package/dist/.pikku/schemas/schemas/SplitOutOutput.schema.json +1 -1
  84. package/dist/.pikku/schemas/schemas/StringTransformInput.schema.json +1 -1
  85. package/dist/.pikku/schemas/schemas/StringTransformOutput.schema.json +1 -1
  86. package/dist/.pikku/schemas/schemas/SummarizeInput.schema.json +1 -1
  87. package/dist/.pikku/schemas/schemas/SummarizeOutput.schema.json +1 -1
  88. package/dist/.pikku/schemas/schemas/TypeConvertInput.schema.json +1 -1
  89. package/dist/.pikku/schemas/schemas/TypeConvertOutput.schema.json +1 -1
  90. package/dist/.pikku/schemas/schemas/UniqueInput.schema.json +1 -1
  91. package/dist/.pikku/schemas/schemas/UniqueOutput.schema.json +1 -1
  92. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
  93. package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
  94. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
  95. package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
  96. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
  97. package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
  98. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
  99. package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
  100. package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
  101. package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
  102. package/dist/.pikku/workflow/pikku-workflow-map.gen.d.ts +1 -1
  103. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +1 -1
  104. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
  105. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
  106. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +1 -1
  107. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
  108. package/dist/src/functions/data/sleep.function.d.ts +1 -0
  109. package/dist/src/functions/data/sleep.function.d.ts.map +1 -1
  110. package/dist/src/functions/data/sleep.function.js +2 -1
  111. package/dist/src/functions/data/sleep.function.js.map +1 -1
  112. package/package.json +14 -15
  113. package/.pikku/addon/pikku-addon-types.gen.ts +0 -105
  114. package/.pikku/addon/pikku-package.gen.ts +0 -11
  115. package/.pikku/agent/pikku-agent-map.gen.d.ts +0 -4
  116. package/.pikku/agent/pikku-agent-types.gen.ts +0 -82
  117. package/.pikku/channel/pikku-channel-types.gen.ts +0 -177
  118. package/.pikku/cli/pikku-cli-types.gen.ts +0 -105
  119. package/.pikku/console/pikku-addon-meta.gen.json +0 -281
  120. package/.pikku/console/pikku-node-types.gen.ts +0 -8
  121. package/.pikku/function/pikku-function-types.gen.ts +0 -684
  122. package/.pikku/function/pikku-functions-meta-verbose.gen.json +0 -660
  123. package/.pikku/function/pikku-functions-meta.gen.json +0 -450
  124. package/.pikku/function/pikku-functions-meta.gen.ts +0 -7
  125. package/.pikku/function/pikku-functions.gen.ts +0 -56
  126. package/.pikku/http/pikku-http-types.gen.ts +0 -147
  127. package/.pikku/mcp/pikku-mcp-types.gen.ts +0 -183
  128. package/.pikku/pikku-bootstrap.gen.ts +0 -8
  129. package/.pikku/pikku-meta-service.gen.ts +0 -10
  130. package/.pikku/pikku-services.gen.ts +0 -39
  131. package/.pikku/pikku-types.gen.ts +0 -21
  132. package/.pikku/queue/pikku-queue-types.gen.ts +0 -27
  133. package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +0 -488
  134. package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +0 -513
  135. package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +0 -27
  136. package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +0 -6
  137. package/.pikku/scheduler/pikku-scheduler-types.gen.ts +0 -25
  138. package/.pikku/schemas/register.gen.ts +0 -199
  139. package/.pikku/schemas/schemas/AggregateInput.schema.json +0 -1
  140. package/.pikku/schemas/schemas/AggregateOutput.schema.json +0 -1
  141. package/.pikku/schemas/schemas/ChunkInput.schema.json +0 -1
  142. package/.pikku/schemas/schemas/ChunkOutput.schema.json +0 -1
  143. package/.pikku/schemas/schemas/CoalesceInput.schema.json +0 -1
  144. package/.pikku/schemas/schemas/CoalesceOutput.schema.json +0 -1
  145. package/.pikku/schemas/schemas/CryptoInput.schema.json +0 -1
  146. package/.pikku/schemas/schemas/CryptoOutput.schema.json +0 -1
  147. package/.pikku/schemas/schemas/DateTimeInput.schema.json +0 -1
  148. package/.pikku/schemas/schemas/DateTimeOutput.schema.json +0 -1
  149. package/.pikku/schemas/schemas/EditFieldsInput.schema.json +0 -1
  150. package/.pikku/schemas/schemas/EditFieldsOutput.schema.json +0 -1
  151. package/.pikku/schemas/schemas/FindInput.schema.json +0 -1
  152. package/.pikku/schemas/schemas/FindOutput.schema.json +0 -1
  153. package/.pikku/schemas/schemas/GroupByInput.schema.json +0 -1
  154. package/.pikku/schemas/schemas/GroupByOutput.schema.json +0 -1
  155. package/.pikku/schemas/schemas/JwtDecodeInput.schema.json +0 -1
  156. package/.pikku/schemas/schemas/JwtDecodeOutput.schema.json +0 -1
  157. package/.pikku/schemas/schemas/JwtSignInput.schema.json +0 -1
  158. package/.pikku/schemas/schemas/JwtSignOutput.schema.json +0 -1
  159. package/.pikku/schemas/schemas/LimitInput.schema.json +0 -1
  160. package/.pikku/schemas/schemas/LimitOutput.schema.json +0 -1
  161. package/.pikku/schemas/schemas/MathInput.schema.json +0 -1
  162. package/.pikku/schemas/schemas/MathOutput.schema.json +0 -1
  163. package/.pikku/schemas/schemas/MergeInput.schema.json +0 -1
  164. package/.pikku/schemas/schemas/MergeOutput.schema.json +0 -1
  165. package/.pikku/schemas/schemas/OmitInput.schema.json +0 -1
  166. package/.pikku/schemas/schemas/OmitOutput.schema.json +0 -1
  167. package/.pikku/schemas/schemas/PickInput.schema.json +0 -1
  168. package/.pikku/schemas/schemas/PickOutput.schema.json +0 -1
  169. package/.pikku/schemas/schemas/RemoveDuplicatesInput.schema.json +0 -1
  170. package/.pikku/schemas/schemas/RemoveDuplicatesOutput.schema.json +0 -1
  171. package/.pikku/schemas/schemas/RenameKeysInput.schema.json +0 -1
  172. package/.pikku/schemas/schemas/RenameKeysOutput.schema.json +0 -1
  173. package/.pikku/schemas/schemas/ReverseInput.schema.json +0 -1
  174. package/.pikku/schemas/schemas/ReverseOutput.schema.json +0 -1
  175. package/.pikku/schemas/schemas/SleepInput.schema.json +0 -1
  176. package/.pikku/schemas/schemas/SortInput.schema.json +0 -1
  177. package/.pikku/schemas/schemas/SortOutput.schema.json +0 -1
  178. package/.pikku/schemas/schemas/SplitOutInput.schema.json +0 -1
  179. package/.pikku/schemas/schemas/SplitOutOutput.schema.json +0 -1
  180. package/.pikku/schemas/schemas/StringTransformInput.schema.json +0 -1
  181. package/.pikku/schemas/schemas/StringTransformOutput.schema.json +0 -1
  182. package/.pikku/schemas/schemas/SummarizeInput.schema.json +0 -1
  183. package/.pikku/schemas/schemas/SummarizeOutput.schema.json +0 -1
  184. package/.pikku/schemas/schemas/TypeConvertInput.schema.json +0 -1
  185. package/.pikku/schemas/schemas/TypeConvertOutput.schema.json +0 -1
  186. package/.pikku/schemas/schemas/UniqueInput.schema.json +0 -1
  187. package/.pikku/schemas/schemas/UniqueOutput.schema.json +0 -1
  188. package/.pikku/secrets/pikku-secret-types.gen.ts +0 -5
  189. package/.pikku/secrets/pikku-secrets-meta.gen.json +0 -1
  190. package/.pikku/secrets/pikku-secrets.gen.ts +0 -21
  191. package/.pikku/trigger/pikku-trigger-types.gen.ts +0 -160
  192. package/.pikku/variables/pikku-variable-types.gen.ts +0 -5
  193. package/.pikku/variables/pikku-variables-meta.gen.json +0 -1
  194. package/.pikku/variables/pikku-variables.gen.ts +0 -21
  195. package/.pikku/workflow/pikku-workflow-map.gen.d.ts +0 -38
  196. package/.pikku/workflow/pikku-workflow-types.gen.ts +0 -167
  197. package/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +0 -9
  198. package/.pikku/workflow/pikku-workflow-wirings.gen.ts +0 -3
  199. package/dist/.pikku/addon/pikku-addon-types.gen.ts +0 -105
  200. package/dist/.pikku/addon/pikku-package.gen.ts +0 -11
  201. package/dist/.pikku/agent/pikku-agent-types.gen.ts +0 -82
  202. package/dist/.pikku/channel/pikku-channel-types.gen.ts +0 -177
  203. package/dist/.pikku/cli/pikku-cli-types.gen.ts +0 -105
  204. package/dist/.pikku/console/pikku-addon-meta.gen.json +0 -281
  205. package/dist/.pikku/console/pikku-node-types.gen.ts +0 -8
  206. package/dist/.pikku/function/pikku-function-types.gen.ts +0 -684
  207. package/dist/.pikku/function/pikku-functions-meta-verbose.gen.json +0 -660
  208. package/dist/.pikku/function/pikku-functions-meta.gen.ts +0 -7
  209. package/dist/.pikku/function/pikku-functions.gen.ts +0 -56
  210. package/dist/.pikku/http/pikku-http-types.gen.ts +0 -147
  211. package/dist/.pikku/mcp/pikku-mcp-types.gen.ts +0 -183
  212. package/dist/.pikku/pikku-bootstrap.gen.ts +0 -8
  213. package/dist/.pikku/pikku-meta-service.gen.ts +0 -10
  214. package/dist/.pikku/pikku-services.gen.ts +0 -39
  215. package/dist/.pikku/pikku-types.gen.ts +0 -21
  216. package/dist/.pikku/queue/pikku-queue-types.gen.ts +0 -27
  217. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +0 -6
  218. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.ts +0 -25
  219. package/dist/.pikku/schemas/register.gen.ts +0 -199
  220. package/dist/.pikku/secrets/pikku-secret-types.gen.ts +0 -5
  221. package/dist/.pikku/secrets/pikku-secrets-meta.gen.json +0 -1
  222. package/dist/.pikku/secrets/pikku-secrets.gen.ts +0 -21
  223. package/dist/.pikku/trigger/pikku-trigger-types.gen.ts +0 -160
  224. package/dist/.pikku/variables/pikku-variable-types.gen.ts +0 -5
  225. package/dist/.pikku/variables/pikku-variables-meta.gen.json +0 -1
  226. package/dist/.pikku/variables/pikku-variables.gen.ts +0 -21
  227. package/dist/.pikku/workflow/pikku-workflow-types.gen.ts +0 -167
  228. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +0 -9
  229. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.ts +0 -3
@@ -1,177 +0,0 @@
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
-
8
- import { CoreChannel, CorePikkuChannelMiddleware, CorePikkuChannelMiddlewareFactory, wireChannel as wireChannelCore, defineChannelRoutes as defineChannelRoutesCore, addChannelMiddleware as addChannelMiddlewareCore } from '@pikku/core/channel'
9
- import { AssertHTTPWiringParams } from '@pikku/core/http'
10
- import type { PikkuFunctionConfig, PikkuFunctionSessionless, PikkuPermission, PikkuMiddleware, Services } from '../function/pikku-function-types.gen.js'
11
- import type { CorePermissionGroup } from '@pikku/core'
12
- import type { StandardSchemaV1 } from '@standard-schema/spec'
13
-
14
- /**
15
- * Helper type to infer the output type from a Standard Schema
16
- */
17
- type InferSchemaOutput<T> = T extends StandardSchemaV1<any, infer Output> ? Output : never
18
-
19
- /**
20
- * Type definition for WebSocket channels with typed data exchange.
21
- * Supports connection, disconnection, and message handling.
22
- * Accepts both session-based (PikkuFunction) and sessionless (PikkuFunctionSessionless) functions.
23
- *
24
- * @template ChannelData - Type of data exchanged through the channel
25
- * @template Channel - String literal type for the channel name
26
- */
27
- type ChannelWiring<ChannelData, Channel extends string> = CoreChannel<
28
- ChannelData,
29
- Channel,
30
- PikkuFunctionConfig<void, any, 'channel' | 'session' | 'rpc'>,
31
- PikkuFunctionConfig<void, void, 'channel' | 'session' | 'rpc'>,
32
- PikkuFunctionConfig<any, any, 'channel' | 'session' | 'rpc'>,
33
- PikkuPermission,
34
- PikkuMiddleware
35
- >
36
-
37
- /**
38
- * Creates a function that handles WebSocket channel connections.
39
- * Called when a client connects to a channel.
40
- *
41
- * @template Out - Output type for connection response
42
- * @param func - Function definition, either direct function or configuration object
43
- * @returns The normalized configuration object
44
- */
45
- export const pikkuChannelConnectionFunc = <Out = unknown>(
46
- func:
47
- | PikkuFunctionSessionless<void, Out, 'channel' | 'session' | 'rpc'>
48
- | PikkuFunctionConfig<void, Out, 'channel' | 'session' | 'rpc'>
49
- ) => {
50
- return typeof func === 'function' ? { func } : func
51
- }
52
-
53
- /**
54
- * Creates a function that handles WebSocket channel disconnections.
55
- * Called when a client disconnects from a channel.
56
- *
57
- * @param func - Function definition, either direct function or configuration object
58
- * @returns The normalized configuration object
59
- */
60
- export const pikkuChannelDisconnectionFunc = (
61
- func:
62
- | PikkuFunctionSessionless<void, void, 'channel'>
63
- | PikkuFunctionConfig<void, void, 'channel' | 'session' | 'rpc'>
64
- ) => {
65
- return typeof func === 'function' ? { func } : func
66
- }
67
-
68
- /**
69
- * Configuration object for channel functions with Zod schema validation.
70
- */
71
- type PikkuChannelFuncConfigWithSchema<
72
- InputSchema extends StandardSchemaV1,
73
- OutputSchema extends StandardSchemaV1 | undefined = undefined
74
- > = {
75
- name?: string
76
- tags?: string[]
77
- expose?: boolean
78
- remote?: boolean
79
- func: PikkuFunctionSessionless<
80
- InferSchemaOutput<InputSchema>,
81
- OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown,
82
- 'channel' | 'session' | 'rpc'
83
- >
84
- auth?: boolean
85
- permissions?: CorePermissionGroup<PikkuPermission<InferSchemaOutput<InputSchema>>>
86
- middleware?: PikkuMiddleware[]
87
- input: InputSchema
88
- output?: OutputSchema
89
- }
90
-
91
- /**
92
- * Creates a function that handles WebSocket channel messages.
93
- * Called when a message is received on a channel.
94
- *
95
- * Supports two patterns:
96
- * 1. Generic types: `pikkuChannelFunc<Input, Output>({ func: ... })`
97
- * 2. Zod schemas: `pikkuChannelFunc({ input: z.object(...), func: ... })`
98
- *
99
- * @template In - Input type for channel messages (inferred from schema if provided)
100
- * @template Out - Output type for channel responses (inferred from schema if provided)
101
- * @param func - Function definition, either direct function or configuration object
102
- * @returns The normalized configuration object
103
- *
104
- * @example
105
- * ```typescript
106
- * // Pattern 1: Using generic types
107
- * const handleMessage = pikkuChannelFunc<{text: string}, {received: boolean}>({
108
- * func: async (_services, { text }) => ({ received: true })
109
- * })
110
- *
111
- * // Pattern 2: Using Zod schemas
112
- * const messageInput = z.object({ text: z.string() })
113
- * const messageOutput = z.object({ received: z.boolean() })
114
- *
115
- * const handleMessage = pikkuChannelFunc({
116
- * input: messageInput,
117
- * output: messageOutput,
118
- * func: async (_services, { text }) => ({ received: true })
119
- * })
120
- * ```
121
- */
122
- export function pikkuChannelFunc<
123
- InputSchema extends StandardSchemaV1,
124
- OutputSchema extends StandardSchemaV1 | undefined = undefined
125
- >(
126
- config: PikkuChannelFuncConfigWithSchema<InputSchema, OutputSchema>
127
- ): PikkuFunctionConfig<InferSchemaOutput<InputSchema>, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, 'channel' | 'session' | 'rpc'>
128
- export function pikkuChannelFunc<In, Out = unknown>(
129
- func:
130
- | PikkuFunctionSessionless<In, Out, 'channel' | 'session' | 'rpc'>
131
- | PikkuFunctionConfig<In, Out, 'channel' | 'session' | 'rpc'>
132
- ): PikkuFunctionConfig<In, Out, 'channel' | 'session' | 'rpc'>
133
- export function pikkuChannelFunc(func: any) {
134
- return typeof func === 'function' ? { func } : func
135
- }
136
-
137
- /**
138
- * Registers a WebSocket channel with the Pikku framework.
139
- *
140
- * @template ChannelData - Type of data associated with the channel
141
- * @template Channel - String literal type for the channel name
142
- * @param channel - Channel definition with connection, disconnection, and message handlers
143
- */
144
- export const wireChannel = <ChannelData, Channel extends string>(
145
- channel: ChannelWiring<ChannelData, Channel> & AssertHTTPWiringParams<ChannelData, Channel>
146
- ) => {
147
- wireChannelCore(channel as any)
148
- }
149
-
150
- /**
151
- * Type-safe helper for defining channel message routes that can be composed.
152
- * Returns the routes record as-is for use with wireChannel's onMessageWiring.
153
- *
154
- * @template T - Record of channel route handlers
155
- * @param routes - The channel routes record
156
- * @returns The same routes record (identity function for type safety)
157
- */
158
- export function defineChannelRoutes<T extends Record<string, any>>(routes: T): T {
159
- return defineChannelRoutesCore(routes)
160
- }
161
-
162
- export type PikkuChannelMiddleware<RequiredServices extends Services = Services, Event = unknown> = CorePikkuChannelMiddleware<RequiredServices, Event>
163
-
164
- export const pikkuChannelMiddleware = <RequiredServices extends Services = Services, Event = unknown>(
165
- middleware: PikkuChannelMiddleware<RequiredServices, Event>
166
- ): PikkuChannelMiddleware<RequiredServices, Event> => {
167
- return middleware
168
- }
169
-
170
- export const pikkuChannelMiddlewareFactory = <In = any>(
171
- factory: CorePikkuChannelMiddlewareFactory<In>
172
- ): CorePikkuChannelMiddlewareFactory<In> => {
173
- return factory
174
- }
175
-
176
- export const addChannelMiddleware = (tag: string, middleware: PikkuChannelMiddleware[]) =>
177
- addChannelMiddlewareCore(tag, middleware, '@pikku/addon-graph')
@@ -1,105 +0,0 @@
1
- /**
2
- * This file was generated by @pikku/cli@0.12.19
3
- */
4
- /**
5
-
6
- * CLI-specific type definitions for tree-shaking optimization
7
- */
8
-
9
- import { CoreCLI, wireCLI as wireCLICore, CorePikkuCLIRender, CoreCLICommandConfig, defineCLICommands as defineCLICommandsCore } from '@pikku/core/cli'
10
- import type { PikkuFunctionConfig, PikkuMiddleware } from '../function/pikku-function-types.gen.js'
11
- import type { UserSession } from '../../types/application-types.d.js'
12
- import type { SingletonServices } from '../../types/application-types.d.js'
13
-
14
-
15
- type Session = UserSession
16
-
17
- /**
18
- * Type-safe CLI renderer definition that can access your application's services.
19
- * Use this to define custom renderers for CLI command output.
20
- *
21
- * @template Data - The output data type from the CLI command
22
- * @template RequiredServices - The services required for this renderer
23
- */
24
- type PikkuCLIRender<Data, RequiredServices extends SingletonServices = SingletonServices> = CorePikkuCLIRender<Data, RequiredServices, Session>
25
-
26
- /**
27
- * Creates a type-safe CLI renderer with access to your application's singleton services.
28
- * The renderer receives the full singleton services and output data to format and display results.
29
- *
30
- * @template Data - The output data type from the CLI command
31
- * @template RequiredServices - The minimum services required for type checking (defaults to SingletonServices)
32
- * @param render - Function that receives singleton services and data to render output
33
- * @returns A CLI renderer configuration
34
- *
35
- * @example
36
- * ```typescript
37
- * const myRenderer = pikkuCLIRender<MyData>(({ logger }, data) => {
38
- * logger.info(data.message)
39
- * })
40
- * ```
41
- */
42
- export const pikkuCLIRender = <Data, RequiredServices extends SingletonServices = SingletonServices>(
43
- render: (services: SingletonServices, data: Data) => void | Promise<void>
44
- ): PikkuCLIRender<Data, RequiredServices> => {
45
- return render as any
46
- }
47
-
48
- /**
49
- * CLI command configuration with project-specific types.
50
- * Uses CoreCLICommandConfig from @pikku/core with local middleware and render types.
51
- */
52
- type CLICommandConfig<Func extends PikkuFunctionConfig<In, Out, 'cli' | 'rpc' | 'session'>, In = any, Out = any, Params extends string = string> = CoreCLICommandConfig<Func, PikkuMiddleware, PikkuCLIRender<any>, Params>
53
-
54
- /**
55
- * Type definition for CLI applications with commands and global options.
56
- *
57
- * @template Commands - Type describing the command structure
58
- * @template GlobalOptions - Type for global CLI options
59
- */
60
- type CLIWiring<Commands extends Record<string, CoreCLICommandConfig<any, PikkuMiddleware, PikkuCLIRender<any>, any>>, GlobalOptions> = CoreCLI<Commands, GlobalOptions, PikkuMiddleware, PikkuCLIRender<any>>
61
-
62
- /**
63
- * Registers a CLI application with the Pikku framework.
64
- * Creates command-line interfaces with type-safe commands and options.
65
- *
66
- * @template Commands - Type describing the command structure
67
- * @template GlobalOptions - Type for global CLI options
68
- * @param cli - CLI definition with program name, commands, and global options
69
- */
70
- export const wireCLI = <Commands extends Record<string, CoreCLICommandConfig<any, PikkuMiddleware, PikkuCLIRender<any>, any>>, GlobalOptions>(
71
- cli: CLIWiring<Commands, GlobalOptions>
72
- ) => {
73
- wireCLICore(cli as any)
74
- }
75
-
76
- /**
77
- * Creates a CLI command definition with automatic option inference from the function's input type.
78
- * This allows TypeScript to automatically derive CLI options from the function signature.
79
- *
80
- * @template FuncConfig - The Pikku function config type
81
- * @template Params - The parameters string literal type
82
- * @param config - CLI command configuration
83
- * @returns CLI command configuration with inferred types
84
- */
85
- export const pikkuCLICommand = <
86
- FuncConfig extends PikkuFunctionConfig<any, any, 'cli' | 'rpc' | 'session'>,
87
- Params extends string
88
- >(
89
- config: CLICommandConfig<FuncConfig, any, any, Params>
90
- ): CoreCLICommandConfig<FuncConfig, PikkuMiddleware, PikkuCLIRender<any>, string> => {
91
- return config as any
92
- }
93
-
94
- /**
95
- * Type-safe helper for defining CLI commands that can be composed and spread into wireCLI.
96
- *
97
- * @template T - Record of CLI command configurations
98
- * @param commands - The CLI commands record
99
- * @returns The same commands record (identity function for type safety)
100
- */
101
- export const defineCLICommands = <T extends Record<string, CoreCLICommandConfig<any, PikkuMiddleware, PikkuCLIRender<any>, any>>>(
102
- commands: T
103
- ): T => {
104
- return defineCLICommandsCore(commands as any) as T
105
- }
@@ -1,281 +0,0 @@
1
- {
2
- "nodes": {
3
- "aggregate": {
4
- "name": "aggregate",
5
- "displayName": "Aggregate",
6
- "category": "Array",
7
- "type": "action",
8
- "rpc": "aggregate",
9
- "description": "Combine a field from many items into a list in a single item",
10
- "errorOutput": false,
11
- "inputSchemaName": "AggregateInput",
12
- "outputSchemaName": "AggregateOutput"
13
- },
14
- "chunk": {
15
- "name": "chunk",
16
- "displayName": "Chunk",
17
- "category": "Array",
18
- "type": "action",
19
- "rpc": "chunk",
20
- "description": "Split array into chunks of specified size",
21
- "errorOutput": false,
22
- "inputSchemaName": "ChunkInput",
23
- "outputSchemaName": "ChunkOutput"
24
- },
25
- "find": {
26
- "name": "find",
27
- "displayName": "Find",
28
- "category": "Array",
29
- "type": "action",
30
- "rpc": "find",
31
- "description": "Find the first item matching a field value",
32
- "errorOutput": false,
33
- "inputSchemaName": "FindInput",
34
- "outputSchemaName": "FindOutput"
35
- },
36
- "groupBy": {
37
- "name": "groupBy",
38
- "displayName": "Group By",
39
- "category": "Array",
40
- "type": "action",
41
- "rpc": "groupBy",
42
- "description": "Group items by a field value",
43
- "errorOutput": false,
44
- "inputSchemaName": "GroupByInput",
45
- "outputSchemaName": "GroupByOutput"
46
- },
47
- "limit": {
48
- "name": "limit",
49
- "displayName": "Limit",
50
- "category": "Array",
51
- "type": "action",
52
- "rpc": "limit",
53
- "description": "Restrict the number of items",
54
- "errorOutput": false,
55
- "inputSchemaName": "LimitInput",
56
- "outputSchemaName": "LimitOutput"
57
- },
58
- "removeDuplicates": {
59
- "name": "removeDuplicates",
60
- "displayName": "Remove Duplicates",
61
- "category": "Array",
62
- "type": "action",
63
- "rpc": "removeDuplicates",
64
- "description": "Delete items with matching field values",
65
- "errorOutput": false,
66
- "inputSchemaName": "RemoveDuplicatesInput",
67
- "outputSchemaName": "RemoveDuplicatesOutput"
68
- },
69
- "reverse": {
70
- "name": "reverse",
71
- "displayName": "Reverse",
72
- "category": "Array",
73
- "type": "action",
74
- "rpc": "reverse",
75
- "description": "Reverse the order of items in an array",
76
- "errorOutput": false,
77
- "inputSchemaName": "ReverseInput",
78
- "outputSchemaName": "ReverseOutput"
79
- },
80
- "sort": {
81
- "name": "sort",
82
- "displayName": "Sort",
83
- "category": "Array",
84
- "type": "action",
85
- "rpc": "sort",
86
- "description": "Change items order",
87
- "errorOutput": false,
88
- "inputSchemaName": "SortInput",
89
- "outputSchemaName": "SortOutput"
90
- },
91
- "splitOut": {
92
- "name": "splitOut",
93
- "displayName": "Split Out",
94
- "category": "Array",
95
- "type": "action",
96
- "rpc": "splitOut",
97
- "description": "Turn a list inside item(s) into separate items",
98
- "errorOutput": false,
99
- "inputSchemaName": "SplitOutInput",
100
- "outputSchemaName": "SplitOutOutput"
101
- },
102
- "summarize": {
103
- "name": "summarize",
104
- "displayName": "Summarize",
105
- "category": "Array",
106
- "type": "action",
107
- "rpc": "summarize",
108
- "description": "Sum, count, max, etc. across items",
109
- "errorOutput": false,
110
- "inputSchemaName": "SummarizeInput",
111
- "outputSchemaName": "SummarizeOutput"
112
- },
113
- "unique": {
114
- "name": "unique",
115
- "displayName": "Unique",
116
- "category": "Array",
117
- "type": "action",
118
- "rpc": "unique",
119
- "description": "Get unique values from an array",
120
- "errorOutput": false,
121
- "inputSchemaName": "UniqueInput",
122
- "outputSchemaName": "UniqueOutput"
123
- },
124
- "coalesce": {
125
- "name": "coalesce",
126
- "displayName": "Coalesce",
127
- "category": "Data",
128
- "type": "action",
129
- "rpc": "coalesce",
130
- "description": "Return the first non-null value",
131
- "errorOutput": false,
132
- "inputSchemaName": "CoalesceInput",
133
- "outputSchemaName": "CoalesceOutput"
134
- },
135
- "crypto": {
136
- "name": "crypto",
137
- "displayName": "Crypto",
138
- "category": "Data",
139
- "type": "action",
140
- "rpc": "crypto",
141
- "description": "Provide cryptographic utilities",
142
- "errorOutput": false,
143
- "inputSchemaName": "CryptoInput",
144
- "outputSchemaName": "CryptoOutput"
145
- },
146
- "dateTime": {
147
- "name": "dateTime",
148
- "displayName": "Date & Time",
149
- "category": "Data",
150
- "type": "action",
151
- "rpc": "dateTime",
152
- "description": "Manipulate date and time values",
153
- "errorOutput": false,
154
- "inputSchemaName": "DateTimeInput",
155
- "outputSchemaName": "DateTimeOutput"
156
- },
157
- "jwtSign": {
158
- "name": "jwtSign",
159
- "displayName": "JWT Sign",
160
- "category": "Data",
161
- "type": "action",
162
- "rpc": "jwtSign",
163
- "description": "Sign a payload into a JWT token",
164
- "errorOutput": false,
165
- "inputSchemaName": "JwtSignInput",
166
- "outputSchemaName": "JwtSignOutput"
167
- },
168
- "jwtDecode": {
169
- "name": "jwtDecode",
170
- "displayName": "JWT Decode",
171
- "category": "Data",
172
- "type": "action",
173
- "rpc": "jwtDecode",
174
- "description": "Decode a JWT token into its payload",
175
- "errorOutput": false,
176
- "inputSchemaName": "JwtDecodeInput",
177
- "outputSchemaName": "JwtDecodeOutput"
178
- },
179
- "math": {
180
- "name": "math",
181
- "displayName": "Math",
182
- "category": "Data",
183
- "type": "action",
184
- "rpc": "math",
185
- "description": "Perform math operations",
186
- "errorOutput": false,
187
- "inputSchemaName": "MathInput",
188
- "outputSchemaName": "MathOutput"
189
- },
190
- "sleep": {
191
- "name": "sleep",
192
- "displayName": "Sleep",
193
- "category": "Data",
194
- "type": "action",
195
- "rpc": "sleep",
196
- "description": "Sleep for a specified duration before continuing",
197
- "errorOutput": false,
198
- "inputSchemaName": "SleepInput",
199
- "outputSchemaName": null
200
- },
201
- "stringTransform": {
202
- "name": "stringTransform",
203
- "displayName": "String Transform",
204
- "category": "Data",
205
- "type": "action",
206
- "rpc": "stringTransform",
207
- "description": "Transform strings (case, trim, split, replace, etc.)",
208
- "errorOutput": false,
209
- "inputSchemaName": "StringTransformInput",
210
- "outputSchemaName": "StringTransformOutput"
211
- },
212
- "typeConvert": {
213
- "name": "typeConvert",
214
- "displayName": "Type Convert",
215
- "category": "Data",
216
- "type": "action",
217
- "rpc": "typeConvert",
218
- "description": "Convert between types (string, number, boolean, json, array)",
219
- "errorOutput": false,
220
- "inputSchemaName": "TypeConvertInput",
221
- "outputSchemaName": "TypeConvertOutput"
222
- },
223
- "editFields": {
224
- "name": "editFields",
225
- "displayName": "Edit Fields",
226
- "category": "Transform",
227
- "type": "action",
228
- "rpc": "editFields",
229
- "description": "Modify, add, or remove item fields",
230
- "errorOutput": false,
231
- "inputSchemaName": "EditFieldsInput",
232
- "outputSchemaName": "EditFieldsOutput"
233
- },
234
- "merge": {
235
- "name": "merge",
236
- "displayName": "Merge",
237
- "category": "Transform",
238
- "type": "action",
239
- "rpc": "merge",
240
- "description": "Merge multiple objects into one",
241
- "errorOutput": false,
242
- "inputSchemaName": "MergeInput",
243
- "outputSchemaName": "MergeOutput"
244
- },
245
- "omit": {
246
- "name": "omit",
247
- "displayName": "Omit",
248
- "category": "Transform",
249
- "type": "action",
250
- "rpc": "omit",
251
- "description": "Remove specified fields from an object",
252
- "errorOutput": false,
253
- "inputSchemaName": "OmitInput",
254
- "outputSchemaName": "OmitOutput"
255
- },
256
- "pick": {
257
- "name": "pick",
258
- "displayName": "Pick",
259
- "category": "Transform",
260
- "type": "action",
261
- "rpc": "pick",
262
- "description": "Keep only specified fields from an object",
263
- "errorOutput": false,
264
- "inputSchemaName": "PickInput",
265
- "outputSchemaName": "PickOutput"
266
- },
267
- "renameKeys": {
268
- "name": "renameKeys",
269
- "displayName": "Rename Keys",
270
- "category": "Transform",
271
- "type": "action",
272
- "rpc": "renameKeys",
273
- "description": "Update item field names",
274
- "errorOutput": false,
275
- "inputSchemaName": "RenameKeysInput",
276
- "outputSchemaName": "RenameKeysOutput"
277
- }
278
- },
279
- "secrets": {},
280
- "package": {}
281
- }
@@ -1,8 +0,0 @@
1
- /**
2
- * This file was generated by @pikku/cli@0.12.19
3
- */
4
- import type { FlattenedRPCMap } from '../rpc/pikku-rpc-wirings-map.internal.gen.js'
5
-
6
- export type NodeCategory = never
7
-
8
- export type NodeRPCName = keyof FlattenedRPCMap