@pikku/addon-cratedb 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/README.md +12 -0
  2. package/dist/.pikku/addon/pikku-addon-types.gen.d.ts +67 -0
  3. package/dist/.pikku/addon/pikku-addon-types.gen.d.ts.map +1 -0
  4. package/dist/.pikku/addon/pikku-addon-types.gen.js +78 -0
  5. package/dist/.pikku/addon/pikku-addon-types.gen.js.map +1 -0
  6. package/dist/.pikku/addon/pikku-addon-types.gen.ts +106 -0
  7. package/dist/.pikku/addon/pikku-package.gen.d.ts +2 -0
  8. package/dist/.pikku/addon/pikku-package.gen.d.ts.map +1 -0
  9. package/dist/.pikku/addon/pikku-package.gen.js +10 -0
  10. package/dist/.pikku/addon/pikku-package.gen.js.map +1 -0
  11. package/dist/.pikku/addon/pikku-package.gen.ts +11 -0
  12. package/dist/.pikku/agent/pikku-agent-map.gen.d.ts +4 -0
  13. package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +47 -0
  14. package/dist/.pikku/agent/pikku-agent-types.gen.d.ts.map +1 -0
  15. package/dist/.pikku/agent/pikku-agent-types.gen.js +18 -0
  16. package/dist/.pikku/agent/pikku-agent-types.gen.js.map +1 -0
  17. package/dist/.pikku/agent/pikku-agent-types.gen.ts +82 -0
  18. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +112 -0
  19. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts.map +1 -0
  20. package/dist/.pikku/channel/pikku-channel-types.gen.js +60 -0
  21. package/dist/.pikku/channel/pikku-channel-types.gen.js.map +1 -0
  22. package/dist/.pikku/channel/pikku-channel-types.gen.ts +177 -0
  23. package/dist/.pikku/console/pikku-node-types.gen.d.ts +7 -0
  24. package/dist/.pikku/console/pikku-node-types.gen.d.ts.map +1 -0
  25. package/dist/.pikku/console/pikku-node-types.gen.js +2 -0
  26. package/dist/.pikku/console/pikku-node-types.gen.js.map +1 -0
  27. package/dist/.pikku/console/pikku-node-types.gen.ts +8 -0
  28. package/dist/.pikku/credentials/pikku-credentials-meta.gen.json +10 -0
  29. package/dist/.pikku/credentials/pikku-credentials.gen.d.ts +15 -0
  30. package/dist/.pikku/credentials/pikku-credentials.gen.d.ts.map +1 -0
  31. package/dist/.pikku/credentials/pikku-credentials.gen.js +13 -0
  32. package/dist/.pikku/credentials/pikku-credentials.gen.js.map +1 -0
  33. package/dist/.pikku/credentials/pikku-credentials.gen.ts +23 -0
  34. package/dist/.pikku/function/pikku-function-types.gen.d.ts +490 -0
  35. package/dist/.pikku/function/pikku-function-types.gen.d.ts.map +1 -0
  36. package/dist/.pikku/function/pikku-function-types.gen.js +334 -0
  37. package/dist/.pikku/function/pikku-function-types.gen.js.map +1 -0
  38. package/dist/.pikku/function/pikku-function-types.gen.ts +754 -0
  39. package/dist/.pikku/function/pikku-functions-meta-verbose.gen.json +89 -0
  40. package/dist/.pikku/function/pikku-functions-meta.gen.d.ts +2 -0
  41. package/dist/.pikku/function/pikku-functions-meta.gen.d.ts.map +1 -0
  42. package/dist/.pikku/function/pikku-functions-meta.gen.js +7 -0
  43. package/dist/.pikku/function/pikku-functions-meta.gen.js.map +1 -0
  44. package/dist/.pikku/function/pikku-functions-meta.gen.json +59 -0
  45. package/dist/.pikku/function/pikku-functions-meta.gen.ts +7 -0
  46. package/dist/.pikku/function/pikku-functions.gen.d.ts +2 -0
  47. package/dist/.pikku/function/pikku-functions.gen.d.ts.map +1 -0
  48. package/dist/.pikku/function/pikku-functions.gen.js +12 -0
  49. package/dist/.pikku/function/pikku-functions.gen.js.map +1 -0
  50. package/dist/.pikku/function/pikku-functions.gen.ts +12 -0
  51. package/dist/.pikku/http/pikku-http-types.gen.d.ts +120 -0
  52. package/dist/.pikku/http/pikku-http-types.gen.d.ts.map +1 -0
  53. package/dist/.pikku/http/pikku-http-types.gen.js +72 -0
  54. package/dist/.pikku/http/pikku-http-types.gen.js.map +1 -0
  55. package/dist/.pikku/http/pikku-http-types.gen.ts +147 -0
  56. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +131 -0
  57. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts.map +1 -0
  58. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +38 -0
  59. package/dist/.pikku/mcp/pikku-mcp-types.gen.js.map +1 -0
  60. package/dist/.pikku/mcp/pikku-mcp-types.gen.ts +183 -0
  61. package/dist/.pikku/pikku-bootstrap.gen.d.ts +9 -0
  62. package/dist/.pikku/pikku-bootstrap.gen.d.ts.map +1 -0
  63. package/dist/.pikku/pikku-bootstrap.gen.js +9 -0
  64. package/dist/.pikku/pikku-bootstrap.gen.js.map +1 -0
  65. package/dist/.pikku/pikku-bootstrap.gen.ts +8 -0
  66. package/dist/.pikku/pikku-meta-service.gen.d.ts +8 -0
  67. package/dist/.pikku/pikku-meta-service.gen.d.ts.map +1 -0
  68. package/dist/.pikku/pikku-meta-service.gen.js +10 -0
  69. package/dist/.pikku/pikku-meta-service.gen.js.map +1 -0
  70. package/dist/.pikku/pikku-meta-service.gen.ts +10 -0
  71. package/dist/.pikku/pikku-services.gen.d.ts +35 -0
  72. package/dist/.pikku/pikku-services.gen.d.ts.map +1 -0
  73. package/dist/.pikku/pikku-services.gen.js +30 -0
  74. package/dist/.pikku/pikku-services.gen.js.map +1 -0
  75. package/dist/.pikku/pikku-services.gen.ts +42 -0
  76. package/dist/.pikku/pikku-types.gen.d.ts +12 -0
  77. package/dist/.pikku/pikku-types.gen.d.ts.map +1 -0
  78. package/dist/.pikku/pikku-types.gen.js +17 -0
  79. package/dist/.pikku/pikku-types.gen.js.map +1 -0
  80. package/dist/.pikku/pikku-types.gen.ts +21 -0
  81. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +24 -0
  82. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts.map +1 -0
  83. package/dist/.pikku/queue/pikku-queue-types.gen.js +17 -0
  84. package/dist/.pikku/queue/pikku-queue-types.gen.js.map +1 -0
  85. package/dist/.pikku/queue/pikku-queue-types.gen.ts +27 -0
  86. package/dist/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +133 -0
  87. package/dist/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +136 -0
  88. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.d.ts +2 -0
  89. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.d.ts.map +1 -0
  90. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +7 -0
  91. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js.map +1 -0
  92. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +5 -0
  93. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +6 -0
  94. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +22 -0
  95. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts.map +1 -0
  96. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +17 -0
  97. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js.map +1 -0
  98. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.ts +25 -0
  99. package/dist/.pikku/schemas/register.gen.d.ts +2 -0
  100. package/dist/.pikku/schemas/register.gen.d.ts.map +1 -0
  101. package/dist/.pikku/schemas/register.gen.js +21 -0
  102. package/dist/.pikku/schemas/register.gen.js.map +1 -0
  103. package/dist/.pikku/schemas/register.gen.ts +35 -0
  104. package/dist/.pikku/schemas/schemas/CredentialSchema_cratedb.schema.json +1 -0
  105. package/dist/.pikku/schemas/schemas/ExecuteQueryInput.schema.json +1 -0
  106. package/dist/.pikku/schemas/schemas/ExecuteQueryOutput.schema.json +1 -0
  107. package/dist/.pikku/schemas/schemas/InsertInput.schema.json +1 -0
  108. package/dist/.pikku/schemas/schemas/InsertOutput.schema.json +1 -0
  109. package/dist/.pikku/schemas/schemas/UpdateInput.schema.json +1 -0
  110. package/dist/.pikku/schemas/schemas/UpdateOutput.schema.json +1 -0
  111. package/dist/.pikku/schemas/schemas/VariableSchema_CRATEDB_BASE_URL.schema.json +1 -0
  112. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +6 -0
  113. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts.map +1 -0
  114. package/dist/.pikku/secrets/pikku-secret-types.gen.js +5 -0
  115. package/dist/.pikku/secrets/pikku-secret-types.gen.js.map +1 -0
  116. package/dist/.pikku/secrets/pikku-secret-types.gen.ts +5 -0
  117. package/dist/.pikku/secrets/pikku-secrets-meta.gen.json +1 -0
  118. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +12 -0
  119. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts.map +1 -0
  120. package/dist/.pikku/secrets/pikku-secrets.gen.js +11 -0
  121. package/dist/.pikku/secrets/pikku-secrets.gen.js.map +1 -0
  122. package/dist/.pikku/secrets/pikku-secrets.gen.ts +21 -0
  123. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +114 -0
  124. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts.map +1 -0
  125. package/dist/.pikku/trigger/pikku-trigger-types.gen.js +34 -0
  126. package/dist/.pikku/trigger/pikku-trigger-types.gen.js.map +1 -0
  127. package/dist/.pikku/trigger/pikku-trigger-types.gen.ts +160 -0
  128. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +6 -0
  129. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts.map +1 -0
  130. package/dist/.pikku/variables/pikku-variable-types.gen.js +5 -0
  131. package/dist/.pikku/variables/pikku-variable-types.gen.js.map +1 -0
  132. package/dist/.pikku/variables/pikku-variable-types.gen.ts +5 -0
  133. package/dist/.pikku/variables/pikku-variables-meta.gen.json +10 -0
  134. package/dist/.pikku/variables/pikku-variables.gen.d.ts +15 -0
  135. package/dist/.pikku/variables/pikku-variables.gen.d.ts.map +1 -0
  136. package/dist/.pikku/variables/pikku-variables.gen.js +13 -0
  137. package/dist/.pikku/variables/pikku-variables.gen.js.map +1 -0
  138. package/dist/.pikku/variables/pikku-variables.gen.ts +23 -0
  139. package/dist/.pikku/workflow/pikku-workflow-map.gen.d.ts +38 -0
  140. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +90 -0
  141. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts.map +1 -0
  142. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +18 -0
  143. package/dist/.pikku/workflow/pikku-workflow-types.gen.js.map +1 -0
  144. package/dist/.pikku/workflow/pikku-workflow-types.gen.ts +167 -0
  145. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.d.ts +2 -0
  146. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.d.ts.map +1 -0
  147. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +7 -0
  148. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js.map +1 -0
  149. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +9 -0
  150. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +5 -0
  151. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts.map +1 -0
  152. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +5 -0
  153. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js.map +1 -0
  154. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.ts +3 -0
  155. package/dist/src/cratedb-api.service.d.ts +10 -0
  156. package/dist/src/cratedb-api.service.d.ts.map +1 -0
  157. package/dist/src/cratedb-api.service.js +90 -0
  158. package/dist/src/cratedb-api.service.js.map +1 -0
  159. package/dist/src/cratedb.credential.d.ts +5 -0
  160. package/dist/src/cratedb.credential.d.ts.map +1 -0
  161. package/dist/src/cratedb.credential.js +13 -0
  162. package/dist/src/cratedb.credential.js.map +1 -0
  163. package/dist/src/cratedb.types.d.ts +7 -0
  164. package/dist/src/cratedb.types.d.ts.map +1 -0
  165. package/dist/src/cratedb.types.js +8 -0
  166. package/dist/src/cratedb.types.js.map +1 -0
  167. package/dist/src/cratedb.variable.d.ts +5 -0
  168. package/dist/src/cratedb.variable.d.ts.map +1 -0
  169. package/dist/src/cratedb.variable.js +11 -0
  170. package/dist/src/cratedb.variable.js.map +1 -0
  171. package/dist/src/functions/executeQuery.function.d.ts +29 -0
  172. package/dist/src/functions/executeQuery.function.d.ts.map +1 -0
  173. package/dist/src/functions/executeQuery.function.js +19 -0
  174. package/dist/src/functions/executeQuery.function.js.map +1 -0
  175. package/dist/src/functions/insert.function.d.ts +29 -0
  176. package/dist/src/functions/insert.function.d.ts.map +1 -0
  177. package/dist/src/functions/insert.function.js +19 -0
  178. package/dist/src/functions/insert.function.js.map +1 -0
  179. package/dist/src/functions/update.function.d.ts +33 -0
  180. package/dist/src/functions/update.function.d.ts.map +1 -0
  181. package/dist/src/functions/update.function.js +20 -0
  182. package/dist/src/functions/update.function.js.map +1 -0
  183. package/dist/src/index.d.ts +4 -0
  184. package/dist/src/index.d.ts.map +1 -0
  185. package/dist/src/index.js +4 -0
  186. package/dist/src/index.js.map +1 -0
  187. package/dist/src/services.d.ts +2 -0
  188. package/dist/src/services.d.ts.map +1 -0
  189. package/dist/src/services.js +14 -0
  190. package/dist/src/services.js.map +1 -0
  191. package/package.json +39 -0
@@ -0,0 +1,60 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.54
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-cratedb');
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,EAClE,EAAE;IACF,OAAO,OAAO,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;AACrD,CAAC,CAAA;AAmED,MAAM,UAAU,gBAAgB,CAAC,IAAS;IACxC,OAAO,OAAO,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;AACrD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,OAA2F,EAC3F,EAAE;IACF,eAAe,CAAC,OAAc,CAAC,CAAA;AACjC,CAAC,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAAgC,MAAS;IAC1E,OAAO,uBAAuB,CAAC,MAAM,CAAC,CAAA;AACxC,CAAC;AAID,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,UAA2D,EACV,EAAE;IACnD,OAAO,UAAU,CAAA;AACnB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAC3C,OAA8C,EACP,EAAE;IACzC,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,GAAW,EAAE,UAAoC,EAAE,EAAE,CACxF,wBAAwB,CAAC,GAAG,EAAE,UAAU,EAAE,sBAAsB,CAAC,CAAA"}
@@ -0,0 +1,177 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.54
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-cratedb')
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.54
3
+ */
4
+ import type { FlattenedRPCMap } from '../rpc/pikku-rpc-wirings-map.internal.gen.js';
5
+ export type NodeCategory = never;
6
+ export type NodeRPCName = keyof FlattenedRPCMap;
7
+ //# sourceMappingURL=pikku-node-types.gen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pikku-node-types.gen.d.ts","sourceRoot":"","sources":["../../../.pikku/console/pikku-node-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAA;AAEnF,MAAM,MAAM,YAAY,GAAG,KAAK,CAAA;AAEhC,MAAM,MAAM,WAAW,GAAG,MAAM,eAAe,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=pikku-node-types.gen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pikku-node-types.gen.js","sourceRoot":"","sources":["../../../.pikku/console/pikku-node-types.gen.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.54
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
@@ -0,0 +1,10 @@
1
+ {
2
+ "cratedb": {
3
+ "name": "cratedb",
4
+ "displayName": "CrateDB",
5
+ "description": "Add and update data in CrateDB",
6
+ "type": "wire",
7
+ "schema": "CredentialSchema_cratedb",
8
+ "sourceFile": "/home/runner/work/addons/addons/packages/database/cratedb/src/cratedb.credential.ts"
9
+ }
10
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.54
3
+ */
4
+ import { TypedCredentialService as CoreTypedCredentialService } from '@pikku/core/services';
5
+ import type { CredentialService } from '@pikku/core/services';
6
+ import type { z } from 'zod';
7
+ import { cratedbCredentialSchema } from '../../src/cratedb.credential.js';
8
+ export interface CredentialsMap {
9
+ 'cratedb': z.infer<typeof cratedbCredentialSchema>;
10
+ }
11
+ export type CredentialName = keyof CredentialsMap;
12
+ export declare class TypedCredentialService extends CoreTypedCredentialService<CredentialsMap> {
13
+ constructor(credentials: CredentialService);
14
+ }
15
+ //# sourceMappingURL=pikku-credentials.gen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pikku-credentials.gen.d.ts","sourceRoot":"","sources":["../../../.pikku/credentials/pikku-credentials.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,sBAAsB,IAAI,0BAA0B,EAA2B,MAAM,sBAAsB,CAAA;AACpH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAC5B,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAA;AAEzE,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;CACnD;AAED,MAAM,MAAM,cAAc,GAAG,MAAM,cAAc,CAAA;AAMjD,qBAAa,sBAAuB,SAAQ,0BAA0B,CAAC,cAAc,CAAC;gBACxE,WAAW,EAAE,iBAAiB;CAG3C"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.54
3
+ */
4
+ import { TypedCredentialService as CoreTypedCredentialService } from '@pikku/core/services';
5
+ const CREDENTIALS_META = {
6
+ 'cratedb': { name: 'cratedb', displayName: 'CrateDB', type: 'wire' }
7
+ };
8
+ export class TypedCredentialService extends CoreTypedCredentialService {
9
+ constructor(credentials) {
10
+ super(credentials, CREDENTIALS_META);
11
+ }
12
+ }
13
+ //# sourceMappingURL=pikku-credentials.gen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pikku-credentials.gen.js","sourceRoot":"","sources":["../../../.pikku/credentials/pikku-credentials.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,sBAAsB,IAAI,0BAA0B,EAA2B,MAAM,sBAAsB,CAAA;AAWpH,MAAM,gBAAgB,GAAuC;IAC3D,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE;CACrE,CAAA;AAED,MAAM,OAAO,sBAAuB,SAAQ,0BAA0C;IACpF,YAAY,WAA8B;QACxC,KAAK,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAA;IACtC,CAAC;CACF"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.54
3
+ */
4
+ import { TypedCredentialService as CoreTypedCredentialService, type CredentialMetaInfo } from '@pikku/core/services'
5
+ import type { CredentialService } from '@pikku/core/services'
6
+ import type { z } from 'zod'
7
+ import { cratedbCredentialSchema } from '../../src/cratedb.credential.js'
8
+
9
+ export interface CredentialsMap {
10
+ 'cratedb': z.infer<typeof cratedbCredentialSchema>
11
+ }
12
+
13
+ export type CredentialName = keyof CredentialsMap
14
+
15
+ const CREDENTIALS_META: Record<string, CredentialMetaInfo> = {
16
+ 'cratedb': { name: 'cratedb', displayName: 'CrateDB', type: 'wire' }
17
+ }
18
+
19
+ export class TypedCredentialService extends CoreTypedCredentialService<CredentialsMap> {
20
+ constructor(credentials: CredentialService) {
21
+ super(credentials, CREDENTIALS_META)
22
+ }
23
+ }