@pikku/cli 0.8.2 → 0.9.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.
Files changed (175) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/bin/pikku-all.ts +41 -32
  3. package/bin/pikku-fetch.ts +1 -1
  4. package/bin/pikku-openapi.ts +2 -2
  5. package/bin/pikku-queue-service.ts +2 -2
  6. package/bin/pikku-websocket.ts +1 -1
  7. package/cli.schema.json +30 -30
  8. package/dist/bin/pikku-all.js +32 -32
  9. package/dist/bin/pikku-fetch.js +1 -1
  10. package/dist/bin/pikku-openapi.js +2 -2
  11. package/dist/bin/pikku-queue-service.js +2 -2
  12. package/dist/bin/pikku-websocket.js +1 -1
  13. package/dist/bin/pikku.js +0 -0
  14. package/dist/src/events/channels/pikku-channels.js +3 -3
  15. package/dist/src/events/channels/pikku-command-channels.js +3 -3
  16. package/dist/src/events/channels/serialize-typed-channel-map.js +2 -2
  17. package/dist/src/events/channels/serialize-websocket-wrapper.js +15 -1
  18. package/dist/src/events/fetch/index.js +2 -2
  19. package/dist/src/events/http/openapi-spec-generator.d.ts +2 -2
  20. package/dist/src/events/http/pikku-command-http-map.js +4 -4
  21. package/dist/src/events/http/pikku-command-http-routes.js +3 -3
  22. package/dist/src/events/http/pikku-command-nextjs.d.ts +2 -0
  23. package/dist/src/events/http/pikku-command-nextjs.js +36 -0
  24. package/dist/src/events/http/pikku-http-routes.js +3 -3
  25. package/dist/src/events/http/serialize-typed-http-map.d.ts +2 -2
  26. package/dist/src/events/http/serialize-typed-http-map.js +11 -11
  27. package/dist/src/events/mcp/pikku-command-mcp.js +3 -3
  28. package/dist/src/events/queue/pikku-command-queue-service.js +6 -6
  29. package/dist/src/events/queue/pikku-command-queue.js +3 -3
  30. package/dist/src/events/queue/pikku-queue.js +3 -3
  31. package/dist/src/events/rpc/index.d.ts +2 -0
  32. package/dist/src/events/rpc/index.js +12 -0
  33. package/dist/src/events/rpc/pikku-command-rpc-client.js +6 -6
  34. package/dist/src/events/rpc/pikku-command-rpc.js +2 -2
  35. package/dist/src/events/rpc/pikku-rpc.js +2 -2
  36. package/dist/src/events/rpc/serialize-rpc-wrapper.js +40 -1
  37. package/dist/src/events/scheduler/pikku-command-scheduler.js +3 -3
  38. package/dist/src/inspector-glob.js +2 -2
  39. package/dist/src/pikku-cli-config.d.ts +17 -17
  40. package/dist/src/pikku-cli-config.js +31 -31
  41. package/dist/src/runtimes/nextjs/pikku-command-nextjs.js +3 -3
  42. package/dist/src/runtimes/nextjs/serialize-nextjs-backend-wrapper.js +29 -29
  43. package/dist/src/runtimes/nextjs/serialize-nextjs-http-wrapper.js +28 -28
  44. package/dist/src/schema-generator.d.ts +2 -2
  45. package/dist/src/schema-generator.js +2 -2
  46. package/dist/src/serialize-pikku-types.js +67 -67
  47. package/dist/src/utils.js +8 -0
  48. package/dist/src/wirings/channels/pikku-channels.d.ts +2 -0
  49. package/dist/src/wirings/channels/pikku-channels.js +9 -0
  50. package/dist/src/wirings/channels/pikku-command-channels-map.d.ts +2 -0
  51. package/dist/src/wirings/channels/pikku-command-channels-map.js +8 -0
  52. package/dist/src/wirings/channels/pikku-command-channels.d.ts +2 -0
  53. package/dist/src/wirings/channels/pikku-command-channels.js +9 -0
  54. package/dist/src/wirings/channels/pikku-command-websocket-typed.d.ts +2 -0
  55. package/dist/src/wirings/channels/pikku-command-websocket-typed.js +15 -0
  56. package/dist/src/wirings/channels/serialize-typed-channel-map.d.ts +4 -0
  57. package/dist/src/wirings/channels/serialize-typed-channel-map.js +111 -0
  58. package/dist/src/wirings/channels/serialize-websocket-wrapper.d.ts +1 -0
  59. package/dist/src/wirings/channels/serialize-websocket-wrapper.js +75 -0
  60. package/dist/src/wirings/fetch/index.d.ts +2 -0
  61. package/dist/src/wirings/fetch/index.js +12 -0
  62. package/dist/src/wirings/functions/pikku-command-function-types.d.ts +2 -0
  63. package/dist/src/wirings/functions/pikku-command-function-types.js +13 -0
  64. package/dist/src/wirings/functions/pikku-command-functions.d.ts +6 -0
  65. package/dist/src/wirings/functions/pikku-command-functions.js +35 -0
  66. package/dist/src/wirings/functions/pikku-command-services.d.ts +3 -0
  67. package/dist/src/wirings/functions/pikku-command-services.js +73 -0
  68. package/dist/src/wirings/functions/pikku-function-types.d.ts +2 -0
  69. package/dist/src/wirings/functions/pikku-function-types.js +13 -0
  70. package/dist/src/wirings/functions/pikku-functions.d.ts +6 -0
  71. package/dist/src/wirings/functions/pikku-functions.js +35 -0
  72. package/dist/src/wirings/http/openapi-spec-generator.d.ts +79 -0
  73. package/dist/src/wirings/http/openapi-spec-generator.js +145 -0
  74. package/dist/src/wirings/http/pikku-command-http-map.d.ts +2 -0
  75. package/dist/src/wirings/http/pikku-command-http-map.js +8 -0
  76. package/dist/src/wirings/http/pikku-command-http-routes.d.ts +2 -0
  77. package/dist/src/wirings/http/pikku-command-http-routes.js +9 -0
  78. package/dist/src/wirings/http/pikku-command-openapi.d.ts +2 -0
  79. package/dist/src/wirings/http/pikku-command-openapi.js +20 -0
  80. package/dist/src/wirings/http/pikku-http-routes.d.ts +2 -0
  81. package/dist/src/wirings/http/pikku-http-routes.js +9 -0
  82. package/dist/src/wirings/http/serialize-fetch-wrapper.d.ts +1 -0
  83. package/dist/src/wirings/http/serialize-fetch-wrapper.js +67 -0
  84. package/dist/src/wirings/http/serialize-typed-http-map.d.ts +4 -0
  85. package/dist/src/wirings/http/serialize-typed-http-map.js +100 -0
  86. package/dist/src/wirings/mcp/pikku-command-mcp-json.d.ts +2 -0
  87. package/dist/src/wirings/mcp/pikku-command-mcp-json.js +13 -0
  88. package/dist/src/wirings/mcp/pikku-command-mcp.d.ts +2 -0
  89. package/dist/src/wirings/mcp/pikku-command-mcp.js +54 -0
  90. package/dist/src/wirings/mcp/serialize-mcp-json.d.ts +5 -0
  91. package/dist/src/wirings/mcp/serialize-mcp-json.js +101 -0
  92. package/dist/src/wirings/queue/pikku-command-queue-map.d.ts +2 -0
  93. package/dist/src/wirings/queue/pikku-command-queue-map.js +8 -0
  94. package/dist/src/wirings/queue/pikku-command-queue-service.d.ts +2 -0
  95. package/dist/src/wirings/queue/pikku-command-queue-service.js +15 -0
  96. package/dist/src/wirings/queue/pikku-command-queue.d.ts +2 -0
  97. package/dist/src/wirings/queue/pikku-command-queue.js +10 -0
  98. package/dist/src/wirings/queue/pikku-queue-map.d.ts +2 -0
  99. package/dist/src/wirings/queue/pikku-queue-map.js +8 -0
  100. package/dist/src/wirings/queue/pikku-queue.d.ts +2 -0
  101. package/dist/src/wirings/queue/pikku-queue.js +10 -0
  102. package/dist/src/wirings/queue/serialize-queue-map.d.ts +4 -0
  103. package/dist/src/wirings/queue/serialize-queue-map.js +77 -0
  104. package/dist/src/wirings/queue/serialize-queue-meta.d.ts +2 -0
  105. package/dist/src/wirings/queue/serialize-queue-meta.js +6 -0
  106. package/dist/src/wirings/queue/serialize-queue-wrapper.d.ts +1 -0
  107. package/dist/src/wirings/queue/serialize-queue-wrapper.js +35 -0
  108. package/dist/src/wirings/rpc/pikku-command-rpc-client.d.ts +2 -0
  109. package/dist/src/wirings/rpc/pikku-command-rpc-client.js +15 -0
  110. package/dist/src/wirings/rpc/pikku-command-rpc-map.d.ts +2 -0
  111. package/dist/src/wirings/rpc/pikku-command-rpc-map.js +8 -0
  112. package/dist/src/wirings/rpc/pikku-command-rpc.d.ts +2 -0
  113. package/dist/src/wirings/rpc/pikku-command-rpc.js +6 -0
  114. package/dist/src/wirings/rpc/pikku-rpc.d.ts +2 -0
  115. package/dist/src/wirings/rpc/pikku-rpc.js +6 -0
  116. package/dist/src/wirings/rpc/serialize-rpc-wrapper.d.ts +1 -0
  117. package/dist/src/wirings/rpc/serialize-rpc-wrapper.js +68 -0
  118. package/dist/src/wirings/rpc/serialize-typed-rpc-map.d.ts +4 -0
  119. package/dist/src/wirings/rpc/serialize-typed-rpc-map.js +66 -0
  120. package/dist/src/wirings/scheduler/pikku-command-scheduler.d.ts +2 -0
  121. package/dist/src/wirings/scheduler/pikku-command-scheduler.js +10 -0
  122. package/dist/src/wirings/scheduler/serialize-scheduler-meta.d.ts +2 -0
  123. package/dist/src/wirings/scheduler/serialize-scheduler-meta.js +10 -0
  124. package/dist/tsconfig.tsbuildinfo +1 -1
  125. package/lcov.info +582 -0
  126. package/package.json +3 -3
  127. package/src/inspector-glob.ts +2 -2
  128. package/src/pikku-cli-config.ts +67 -52
  129. package/src/runtimes/nextjs/pikku-command-nextjs.ts +3 -3
  130. package/src/runtimes/nextjs/serialize-nextjs-backend-wrapper.ts +29 -29
  131. package/src/runtimes/nextjs/serialize-nextjs-http-wrapper.ts +28 -28
  132. package/src/schema-generator.ts +3 -3
  133. package/src/serialize-pikku-types.ts +67 -67
  134. package/src/utils.test.ts +38 -0
  135. package/src/utils.ts +9 -0
  136. package/src/{events → wirings}/channels/pikku-channels.ts +5 -4
  137. package/src/{events → wirings}/channels/pikku-command-channels.ts +5 -4
  138. package/src/{events → wirings}/channels/serialize-typed-channel-map.ts +3 -3
  139. package/src/{events → wirings}/channels/serialize-websocket-wrapper.ts +19 -5
  140. package/src/{events → wirings}/fetch/index.ts +2 -2
  141. package/src/{events → wirings}/http/openapi-spec-generator.ts +3 -3
  142. package/src/{events → wirings}/http/pikku-command-http-map.ts +5 -5
  143. package/src/{events → wirings}/http/pikku-command-http-routes.ts +5 -5
  144. package/src/{events → wirings}/http/pikku-http-routes.ts +5 -5
  145. package/src/wirings/http/serialize-fetch-wrapper.ts +67 -0
  146. package/src/{events → wirings}/http/serialize-typed-http-map.ts +17 -17
  147. package/src/{events → wirings}/mcp/pikku-command-mcp.ts +5 -5
  148. package/src/{events → wirings}/queue/pikku-command-queue-service.ts +9 -6
  149. package/src/{events → wirings}/queue/pikku-command-queue.ts +8 -5
  150. package/src/{events → wirings}/queue/pikku-queue.ts +8 -5
  151. package/src/{events → wirings}/rpc/pikku-command-rpc-client.ts +9 -6
  152. package/src/{events → wirings}/rpc/pikku-command-rpc.ts +2 -2
  153. package/src/{events → wirings}/rpc/pikku-rpc.ts +2 -2
  154. package/src/wirings/rpc/serialize-rpc-wrapper.ts +68 -0
  155. package/src/{events → wirings}/scheduler/pikku-command-scheduler.ts +8 -4
  156. package/src/events/http/serialize-fetch-wrapper.ts +0 -67
  157. package/src/events/rpc/serialize-rpc-wrapper.ts +0 -29
  158. /package/src/{events → wirings}/channels/pikku-command-channels-map.ts +0 -0
  159. /package/src/{events → wirings}/channels/pikku-command-websocket-typed.ts +0 -0
  160. /package/src/{events → wirings}/functions/pikku-command-function-types.ts +0 -0
  161. /package/src/{events → wirings}/functions/pikku-command-functions.ts +0 -0
  162. /package/src/{events → wirings}/functions/pikku-command-services.ts +0 -0
  163. /package/src/{events → wirings}/functions/pikku-function-types.ts +0 -0
  164. /package/src/{events → wirings}/functions/pikku-functions.ts +0 -0
  165. /package/src/{events → wirings}/http/pikku-command-openapi.ts +0 -0
  166. /package/src/{events → wirings}/mcp/pikku-command-mcp-json.ts +0 -0
  167. /package/src/{events → wirings}/mcp/serialize-mcp-json.ts +0 -0
  168. /package/src/{events → wirings}/queue/pikku-command-queue-map.ts +0 -0
  169. /package/src/{events → wirings}/queue/pikku-queue-map.ts +0 -0
  170. /package/src/{events → wirings}/queue/serialize-queue-map.ts +0 -0
  171. /package/src/{events → wirings}/queue/serialize-queue-meta.ts +0 -0
  172. /package/src/{events → wirings}/queue/serialize-queue-wrapper.ts +0 -0
  173. /package/src/{events → wirings}/rpc/pikku-command-rpc-map.ts +0 -0
  174. /package/src/{events → wirings}/rpc/serialize-typed-rpc-map.ts +0 -0
  175. /package/src/{events → wirings}/scheduler/serialize-scheduler-meta.ts +0 -0
@@ -1,8 +1,8 @@
1
1
  import { join, dirname, resolve, isAbsolute } from 'path'
2
2
  import { readdir, readFile } from 'fs/promises'
3
- import { OpenAPISpecInfo } from './events/http/openapi-spec-generator.js'
3
+ import { OpenAPISpecInfo } from './wirings/http/openapi-spec-generator.js'
4
4
  import { InspectorFilters } from '@pikku/inspector'
5
- import { PikkuEventTypes } from '@pikku/core'
5
+ import { PikkuWiringTypes } from '@pikku/core'
6
6
 
7
7
  export interface PikkuCLICoreOutputFiles {
8
8
  // Base directory
@@ -16,39 +16,39 @@ export interface PikkuCLICoreOutputFiles {
16
16
  functionsFile: string
17
17
  functionsMetaFile: string
18
18
 
19
- // HTTP routes
20
- httpRoutesFile: string
21
- httpRoutesMetaFile: string
22
- httpRoutesMapDeclarationFile: string
19
+ // HTTP
20
+ httpWiringsFile: string
21
+ httpWiringMetaFile: string
22
+ httpMapDeclarationFile: string
23
23
 
24
24
  // Channels
25
- channelsFile: string
26
- channelsMetaFile: string
25
+ channelsWiringFile: string
26
+ channelsWiringMetaFile: string
27
27
  channelsMapDeclarationFile: string
28
28
 
29
29
  // RPC
30
- rpcMetaFile: string
30
+ rpcWiringMetaFile: string
31
31
  rpcMapDeclarationFile: string
32
32
 
33
33
  // Schedulers
34
- schedulersFile: string
35
- schedulersMetaFile: string
34
+ schedulersWiringFile: string
35
+ schedulersWiringMetaFile: string
36
36
 
37
37
  // Queue processors
38
- queueWorkersFile: string
39
- queueWorkersMetaFile: string
38
+ queueWorkersWiringFile: string
39
+ queueWorkersWiringMetaFile: string
40
40
  queueMapDeclarationFile: string
41
41
 
42
42
  // MCP
43
- mcpEndpointsFile: string
44
- mcpEndpointsMetaFile: string
43
+ mcpWiringsFile: string
44
+ mcpWiringsMetaFile: string
45
45
 
46
46
  // Services
47
47
  servicesFile: string
48
48
 
49
49
  // Application bootstrap
50
50
  bootstrapFile: string
51
- bootstrapFiles: Record<PikkuEventTypes, string>
51
+ bootstrapFiles: Record<PikkuWiringTypes, string>
52
52
  }
53
53
 
54
54
  export type PikkuCLIConfig = {
@@ -68,8 +68,8 @@ export type PikkuCLIConfig = {
68
68
  nextHTTPFile?: string
69
69
  fetchFile?: string
70
70
  websocketFile?: string
71
- rpcFile?: string
72
- queueFile?: string
71
+ rpcWiringsFile?: string
72
+ queueWiringsFile?: string
73
73
  mcpJsonFile?: string
74
74
 
75
75
  openAPI?: {
@@ -87,8 +87,8 @@ const CONFIG_DIR_FILES = [
87
87
  'nextHTTPFile',
88
88
  'fetchFile',
89
89
  'websocketFile',
90
- 'rpcFile',
91
- 'queueFile',
90
+ 'rpcWiringsFile',
91
+ 'queueWiringsFile',
92
92
  'mcpJsonFile',
93
93
  ]
94
94
 
@@ -192,28 +192,31 @@ const _getPikkuCLIConfig = async (
192
192
  }
193
193
 
194
194
  // HTTP
195
- if (!result.httpRoutesFile) {
196
- result.httpRoutesFile = join(httpDir, 'pikku-http-routes.gen.ts')
195
+ if (!result.httpWiringsFile) {
196
+ result.httpWiringsFile = join(httpDir, 'pikku-http-wirings.gen.ts')
197
197
  }
198
- if (!result.httpRoutesMetaFile) {
199
- result.httpRoutesMetaFile = join(
198
+ if (!result.httpWiringMetaFile) {
199
+ result.httpWiringMetaFile = join(
200
200
  httpDir,
201
- 'pikku-http-routes-meta.gen.ts'
201
+ 'pikku-http-wirings-meta.gen.ts'
202
202
  )
203
203
  }
204
- if (!result.httpRoutesMapDeclarationFile) {
205
- result.httpRoutesMapDeclarationFile = join(
204
+ if (!result.httpMapDeclarationFile) {
205
+ result.httpMapDeclarationFile = join(
206
206
  httpDir,
207
- 'pikku-http-routes-map.gen.d.ts'
207
+ 'pikku-http-wirings-map.gen.d.ts'
208
208
  )
209
209
  }
210
210
 
211
211
  // Channels/WebSocket
212
- if (!result.channelsFile) {
213
- result.channelsFile = join(channelDir, 'pikku-channels.gen.ts')
212
+ if (!result.channelsWiringFile) {
213
+ result.channelsWiringFile = join(channelDir, 'pikku-channels.gen.ts')
214
214
  }
215
- if (!result.channelsMetaFile) {
216
- result.channelsMetaFile = join(channelDir, 'pikku-channels-meta.gen.ts')
215
+ if (!result.channelsWiringMetaFile) {
216
+ result.channelsWiringMetaFile = join(
217
+ channelDir,
218
+ 'pikku-channels-meta.gen.ts'
219
+ )
217
220
  }
218
221
  if (!result.channelsMapDeclarationFile) {
219
222
  result.channelsMapDeclarationFile = join(
@@ -223,38 +226,47 @@ const _getPikkuCLIConfig = async (
223
226
  }
224
227
 
225
228
  // RPC
226
- if (!result.rpcMetaFile) {
227
- result.rpcMetaFile = join(rpcDir, 'pikku-rpc-meta.gen.ts')
229
+ if (!result.rpcWiringMetaFile) {
230
+ result.rpcWiringMetaFile = join(rpcDir, 'pikku-rpc-wirings-meta.gen.ts')
228
231
  }
229
232
  if (!result.rpcMapDeclarationFile) {
230
- result.rpcMapDeclarationFile = join(rpcDir, 'pikku-rpc-map.gen.ts')
233
+ result.rpcMapDeclarationFile = join(
234
+ rpcDir,
235
+ 'pikku-rpc-wirings-map.gen.d.ts'
236
+ )
231
237
  }
232
238
 
233
239
  // Scheduler
234
- if (!result.schedulersFile) {
235
- result.schedulersFile = join(schedulerDir, 'pikku-scheduler.gen.ts')
240
+ if (!result.schedulersWiringFile) {
241
+ result.schedulersWiringFile = join(
242
+ schedulerDir,
243
+ 'pikku-schedulers-wirings.gen.ts'
244
+ )
236
245
  }
237
- if (!result.schedulersMetaFile) {
238
- result.schedulersMetaFile = join(
246
+ if (!result.schedulersWiringMetaFile) {
247
+ result.schedulersWiringMetaFile = join(
239
248
  schedulerDir,
240
- 'pikku-scheduler-meta.gen.ts'
249
+ 'pikku-schedulers-wirings-meta.gen.ts'
241
250
  )
242
251
  }
243
252
 
244
253
  // Queue
245
- if (!result.queueWorkersFile) {
246
- result.queueWorkersFile = join(queueDir, 'pikku-queue-workers.gen.ts')
254
+ if (!result.queueWorkersWiringFile) {
255
+ result.queueWorkersWiringFile = join(
256
+ queueDir,
257
+ 'pikku-queue-workers-wirings.gen.ts'
258
+ )
247
259
  }
248
- if (!result.queueWorkersMetaFile) {
249
- result.queueWorkersMetaFile = join(
260
+ if (!result.queueWorkersWiringMetaFile) {
261
+ result.queueWorkersWiringMetaFile = join(
250
262
  queueDir,
251
- 'pikku-queue-workers-meta.gen.ts'
263
+ 'pikku-queue-workers-wirings-meta.gen.ts'
252
264
  )
253
265
  }
254
266
  if (!result.queueMapDeclarationFile) {
255
267
  result.queueMapDeclarationFile = join(
256
268
  queueDir,
257
- 'pikku-queue-map.gen.ts'
269
+ 'pikku-queue-workers-wirings-map.gen.d.ts'
258
270
  )
259
271
  }
260
272
 
@@ -269,18 +281,21 @@ const _getPikkuCLIConfig = async (
269
281
  }
270
282
 
271
283
  // MCP
272
- if (!result.mcpEndpointsMetaFile) {
273
- result.mcpEndpointsMetaFile = join(mcpDir, 'mcp-endpoints-meta.gen.ts')
284
+ if (!result.mcpWiringsMetaFile) {
285
+ result.mcpWiringsMetaFile = join(
286
+ mcpDir,
287
+ 'pikku-mcp-wirings-meta.gen.ts'
288
+ )
274
289
  }
275
- if (!result.mcpEndpointsFile) {
276
- result.mcpEndpointsFile = join(mcpDir, 'mcp-endpoints.gen.ts')
290
+ if (!result.mcpWiringsFile) {
291
+ result.mcpWiringsFile = join(mcpDir, 'pikku-mcp-wirings.gen.ts')
277
292
  }
278
293
  if (!result.mcpJsonFile) {
279
- result.mcpJsonFile = join(mcpDir, 'mcp.gen.json')
294
+ result.mcpJsonFile = join(mcpDir, 'pikku-mcp.gen.json')
280
295
  }
281
296
 
282
297
  result.bootstrapFiles = result.bootstrapFiles || {}
283
- for (const key of Object.keys(PikkuEventTypes)) {
298
+ for (const key of Object.keys(PikkuWiringTypes)) {
284
299
  const eventDir = join(result.outDir, key.toLowerCase())
285
300
  result.bootstrapFiles[key] = join(
286
301
  eventDir,
@@ -13,7 +13,7 @@ export const pikkuNext: PikkuCommand = async (
13
13
  {
14
14
  nextBackendFile,
15
15
  nextHTTPFile,
16
- httpRoutesMapDeclarationFile,
16
+ httpMapDeclarationFile,
17
17
  packageMappings,
18
18
  fetchFile,
19
19
  bootstrapFiles,
@@ -72,7 +72,7 @@ export const pikkuNext: PikkuCommand = async (
72
72
 
73
73
  const routesMapDeclarationPath = getFileImportRelativePath(
74
74
  nextBackendFile,
75
- httpRoutesMapDeclarationFile,
75
+ httpMapDeclarationFile,
76
76
  packageMappings
77
77
  )
78
78
 
@@ -89,7 +89,7 @@ export const pikkuNext: PikkuCommand = async (
89
89
  if (nextHTTPFile && fetchFile) {
90
90
  const routesMapDeclarationPath = getFileImportRelativePath(
91
91
  nextHTTPFile,
92
- httpRoutesMapDeclarationFile,
92
+ httpMapDeclarationFile,
93
93
  packageMappings
94
94
  )
95
95
 
@@ -12,7 +12,7 @@ export const serializeNextJsBackendWrapper = (
12
12
  * It ensures type safety for route handling methods when integrating with the @pikku/core framework.
13
13
  */
14
14
  import { PikkuNextJS } from '@pikku/next'
15
- import type { RoutesMap, RouteHandlerOf, RoutesWithMethod } from '${routesMapPath}'
15
+ import type { HTTPWiringsMap, HTTPWiringHandlerOf, HTTPWiringsWithMethod } from '${routesMapPath}'
16
16
 
17
17
  ${configImport}
18
18
  ${singleServicesFactoryImport}
@@ -40,7 +40,7 @@ export const pikku = (_options?: any) => {
40
40
  * Makes a dynamic action request for a specified route and method.
41
41
  * Dynamic requests may access headers and cookies and are therefore unsuitable for precompile stages.
42
42
  *
43
- * @template Route - The route key from the RoutesMap.
43
+ * @template Route - The route key from the HTTPWiringsMap.
44
44
  * @template Method - The method key from the specified route.
45
45
  * @param route - The route identifier.
46
46
  * @param method - The HTTP method to be used for the request.
@@ -48,13 +48,13 @@ export const pikku = (_options?: any) => {
48
48
  * @returns A promise that resolves to the output of the route handler.
49
49
  */
50
50
  const dynamicActionRequest = async <
51
- Route extends keyof RoutesMap,
52
- Method extends keyof RoutesMap[Route]
51
+ Route extends keyof HTTPWiringsMap,
52
+ Method extends keyof HTTPWiringsMap[Route]
53
53
  >(
54
54
  route: Route,
55
55
  method: Method,
56
- data: RouteHandlerOf<Route, Method>['input'] = null
57
- ): Promise<RouteHandlerOf<Route, Method>['output']> => {
56
+ data: HTTPWiringHandlerOf<Route, Method>['input'] = null
57
+ ): Promise<HTTPWiringHandlerOf<Route, Method>['output']> => {
58
58
  return _pikku!.actionRequest(route, method, data as any)
59
59
  }
60
60
 
@@ -62,7 +62,7 @@ export const pikku = (_options?: any) => {
62
62
  * Makes a static action request for a specified route and method.
63
63
  * Static requests do not depend on headers or cookies and are suitable for precompile stages.
64
64
  *
65
- * @template Route - The route key from the RoutesMap.
65
+ * @template Route - The route key from the HTTPWiringsMap.
66
66
  * @template Method - The method key from the specified route.
67
67
  * @param route - The route identifier.
68
68
  * @param method - The HTTP method to be used for the request.
@@ -70,13 +70,13 @@ export const pikku = (_options?: any) => {
70
70
  * @returns A promise that resolves to the output of the route handler.
71
71
  */
72
72
  const staticActionRequest = async <
73
- Route extends keyof RoutesMap,
74
- Method extends keyof RoutesMap[Route]
73
+ Route extends keyof HTTPWiringsMap,
74
+ Method extends keyof HTTPWiringsMap[Route]
75
75
  >(
76
76
  route: Route,
77
77
  method: Method,
78
- data: RouteHandlerOf<Route, Method>['input'] = null
79
- ): Promise<RouteHandlerOf<Route, Method>['output']> => {
78
+ data: HTTPWiringHandlerOf<Route, Method>['input'] = null
79
+ ): Promise<HTTPWiringHandlerOf<Route, Method>['output']> => {
80
80
  return _pikku!.staticActionRequest(route, method, data as any)
81
81
  }
82
82
 
@@ -88,10 +88,10 @@ export const pikku = (_options?: any) => {
88
88
  * @param data - The input data for the POST request, defaults to null.
89
89
  * @returns A promise that resolves to the output of the POST handler.
90
90
  */
91
- const dynamicPost = <Route extends RoutesWithMethod<'POST'>>(
91
+ const dynamicPost = <Route extends HTTPWiringsWithMethod<'POST'>>(
92
92
  route: Route,
93
- data: RouteHandlerOf<Route, 'POST'>['input'] = null
94
- ): Promise<RouteHandlerOf<Route, 'POST'>['output']> => {
93
+ data: HTTPWiringHandlerOf<Route, 'POST'>['input'] = null
94
+ ): Promise<HTTPWiringHandlerOf<Route, 'POST'>['output']> => {
95
95
  return dynamicActionRequest(route, 'POST', data)
96
96
  }
97
97
 
@@ -103,10 +103,10 @@ export const pikku = (_options?: any) => {
103
103
  * @param data - The input data for the GET request, defaults to null.
104
104
  * @returns A promise that resolves to the output of the GET handler.
105
105
  */
106
- const dynamicGet = <Route extends RoutesWithMethod<'GET'>>(
106
+ const dynamicGet = <Route extends HTTPWiringsWithMethod<'GET'>>(
107
107
  route: Route,
108
- data: RouteHandlerOf<Route, 'GET'>['input'] = null
109
- ): Promise<RouteHandlerOf<Route, 'GET'>['output']> => {
108
+ data: HTTPWiringHandlerOf<Route, 'GET'>['input'] = null
109
+ ): Promise<HTTPWiringHandlerOf<Route, 'GET'>['output']> => {
110
110
  return dynamicActionRequest(route, 'GET', data)
111
111
  }
112
112
 
@@ -118,10 +118,10 @@ export const pikku = (_options?: any) => {
118
118
  * @param data - The input data for the PATCH request, defaults to null.
119
119
  * @returns A promise that resolves to the output of the PATCH handler.
120
120
  */
121
- const dynamicPatch = <Route extends RoutesWithMethod<'PATCH'>>(
121
+ const dynamicPatch = <Route extends HTTPWiringsWithMethod<'PATCH'>>(
122
122
  route: Route,
123
- data: RouteHandlerOf<Route, 'PATCH'>['input'] = null
124
- ): Promise<RouteHandlerOf<Route, 'PATCH'>['output']> => {
123
+ data: HTTPWiringHandlerOf<Route, 'PATCH'>['input'] = null
124
+ ): Promise<HTTPWiringHandlerOf<Route, 'PATCH'>['output']> => {
125
125
  return dynamicActionRequest(route, 'PATCH', data)
126
126
  }
127
127
 
@@ -133,10 +133,10 @@ export const pikku = (_options?: any) => {
133
133
  * @param data - The input data for the DELETE request, defaults to null.
134
134
  * @returns A promise that resolves to the output of the DELETE handler.
135
135
  */
136
- const dynamicDel = <Route extends RoutesWithMethod<'DELETE'>>(
136
+ const dynamicDel = <Route extends HTTPWiringsWithMethod<'DELETE'>>(
137
137
  route: Route,
138
- data: RouteHandlerOf<Route, 'DELETE'>['input'] = null
139
- ): Promise<RouteHandlerOf<Route, 'DELETE'>['output']> => {
138
+ data: HTTPWiringHandlerOf<Route, 'DELETE'>['input'] = null
139
+ ): Promise<HTTPWiringHandlerOf<Route, 'DELETE'>['output']> => {
140
140
  return dynamicActionRequest(route, 'DELETE', data)
141
141
  }
142
142
 
@@ -150,10 +150,10 @@ export const pikku = (_options?: any) => {
150
150
  * @param data - The input data for the POST request, defaults to null.
151
151
  * @returns A promise that resolves to the output of the POST handler.
152
152
  */
153
- const staticPost = <Route extends RoutesWithMethod<'POST'>>(
153
+ const staticPost = <Route extends HTTPWiringsWithMethod<'POST'>>(
154
154
  route: Route,
155
- data: RouteHandlerOf<Route, 'POST'>['input'] = null
156
- ): Promise<RouteHandlerOf<Route, 'POST'>['output']> => {
155
+ data: HTTPWiringHandlerOf<Route, 'POST'>['input'] = null
156
+ ): Promise<HTTPWiringHandlerOf<Route, 'POST'>['output']> => {
157
157
  return staticActionRequest(route, 'POST', data)
158
158
  }
159
159
 
@@ -165,10 +165,10 @@ export const pikku = (_options?: any) => {
165
165
  * @param data - The input data for the GET request, defaults to null.
166
166
  * @returns A promise that resolves to the output of the GET handler.
167
167
  */
168
- const staticGet = <Route extends RoutesWithMethod<'GET'>>(
168
+ const staticGet = <Route extends HTTPWiringsWithMethod<'GET'>>(
169
169
  route: Route,
170
- data: RouteHandlerOf<Route, 'GET'>['input'] = null
171
- ): Promise<RouteHandlerOf<Route, 'GET'>['output']> => {
170
+ data: HTTPWiringHandlerOf<Route, 'GET'>['input'] = null
171
+ ): Promise<HTTPWiringHandlerOf<Route, 'GET'>['output']> => {
172
172
  return staticActionRequest(route, 'GET', data)
173
173
  }
174
174
 
@@ -9,7 +9,7 @@ export const serializeNextJsHTTPWrapper = (
9
9
  * It ensures type safety for route handling methods when integrating with the @pikku/core framework.
10
10
  */
11
11
  import { CorePikkuFetchOptions } from '@pikku/fetch'
12
- import type { RoutesMap, RouteHandlerOf, RoutesWithMethod } from '${routesMapPath}'
12
+ import type { HTTPWiringsMap, HTTPWiringHandlerOf, HTTPWiringsWithMethod } from '${routesMapPath}'
13
13
  import { PikkuFetch } from '${pikkuFetchImport}'
14
14
 
15
15
  let _pikku: PikkuFetch | undefined
@@ -25,13 +25,13 @@ export const pikku = (options?: CorePikkuFetchOptions) => {
25
25
  }
26
26
 
27
27
  const dynamicActionRequest = async <
28
- Route extends keyof RoutesMap,
29
- Method extends keyof RoutesMap[Route]
28
+ Route extends keyof HTTPWiringsMap,
29
+ Method extends keyof HTTPWiringsMap[Route]
30
30
  >(
31
31
  route: Route,
32
32
  method: Method,
33
- data: RouteHandlerOf<Route, Method>['input'] = null
34
- ): Promise<RouteHandlerOf<Route, Method>['output']> => {
33
+ data: HTTPWiringHandlerOf<Route, Method>['input'] = null
34
+ ): Promise<HTTPWiringHandlerOf<Route, Method>['output']> => {
35
35
  return (_pikku! as any)[(method as string).toLowerCase()](route, data as any)
36
36
  }
37
37
 
@@ -39,7 +39,7 @@ export const pikku = (options?: CorePikkuFetchOptions) => {
39
39
  * Makes a static action request for a specified route and method.
40
40
  * Static requests do not depend on headers or cookies and are suitable for precompile stages.
41
41
  *
42
- * @template Route - The route key from the RoutesMap.
42
+ * @template Route - The route key from the HTTPWiringsMap.
43
43
  * @template Method - The method key from the specified route.
44
44
  * @param route - The route identifier.
45
45
  * @param method - The HTTP method to be used for the request.
@@ -47,13 +47,13 @@ export const pikku = (options?: CorePikkuFetchOptions) => {
47
47
  * @returns A promise that resolves to the output of the route handler.
48
48
  */
49
49
  const staticActionRequest = async <
50
- Route extends keyof RoutesMap,
51
- Method extends keyof RoutesMap[Route]
50
+ Route extends keyof HTTPWiringsMap,
51
+ Method extends keyof HTTPWiringsMap[Route]
52
52
  >(
53
53
  route: Route,
54
54
  method: Method,
55
- data: RouteHandlerOf<Route, Method>['input'] = null
56
- ): Promise<RouteHandlerOf<Route, Method>['output']> => {
55
+ data: HTTPWiringHandlerOf<Route, Method>['input'] = null
56
+ ): Promise<HTTPWiringHandlerOf<Route, Method>['output']> => {
57
57
  return (_pikku! as any)[(method as string).toLowerCase()](route, data as any)
58
58
  }
59
59
 
@@ -65,10 +65,10 @@ export const pikku = (options?: CorePikkuFetchOptions) => {
65
65
  * @param data - The input data for the POST request, defaults to null.
66
66
  * @returns A promise that resolves to the output of the POST handler.
67
67
  */
68
- const dynamicPost = <Route extends RoutesWithMethod<'POST'>>(
68
+ const dynamicPost = <Route extends HTTPWiringsWithMethod<'POST'>>(
69
69
  route: Route,
70
- data: RouteHandlerOf<Route, 'POST'>['input'] = null
71
- ): Promise<RouteHandlerOf<Route, 'POST'>['output']> => {
70
+ data: HTTPWiringHandlerOf<Route, 'POST'>['input'] = null
71
+ ): Promise<HTTPWiringHandlerOf<Route, 'POST'>['output']> => {
72
72
  return dynamicActionRequest(route, 'POST', data)
73
73
  }
74
74
 
@@ -80,10 +80,10 @@ export const pikku = (options?: CorePikkuFetchOptions) => {
80
80
  * @param data - The input data for the GET request, defaults to null.
81
81
  * @returns A promise that resolves to the output of the GET handler.
82
82
  */
83
- const dynamicGet = <Route extends RoutesWithMethod<'GET'>>(
83
+ const dynamicGet = <Route extends HTTPWiringsWithMethod<'GET'>>(
84
84
  route: Route,
85
- data: RouteHandlerOf<Route, 'GET'>['input'] = null
86
- ): Promise<RouteHandlerOf<Route, 'GET'>['output']> => {
85
+ data: HTTPWiringHandlerOf<Route, 'GET'>['input'] = null
86
+ ): Promise<HTTPWiringHandlerOf<Route, 'GET'>['output']> => {
87
87
  return dynamicActionRequest(route, 'GET', data)
88
88
  }
89
89
 
@@ -95,10 +95,10 @@ export const pikku = (options?: CorePikkuFetchOptions) => {
95
95
  * @param data - The input data for the PATCH request, defaults to null.
96
96
  * @returns A promise that resolves to the output of the PATCH handler.
97
97
  */
98
- const dynamicPatch = <Route extends RoutesWithMethod<'PATCH'>>(
98
+ const dynamicPatch = <Route extends HTTPWiringsWithMethod<'PATCH'>>(
99
99
  route: Route,
100
- data: RouteHandlerOf<Route, 'PATCH'>['input'] = null
101
- ): Promise<RouteHandlerOf<Route, 'PATCH'>['output']> => {
100
+ data: HTTPWiringHandlerOf<Route, 'PATCH'>['input'] = null
101
+ ): Promise<HTTPWiringHandlerOf<Route, 'PATCH'>['output']> => {
102
102
  return dynamicActionRequest(route, 'PATCH', data)
103
103
  }
104
104
 
@@ -110,10 +110,10 @@ export const pikku = (options?: CorePikkuFetchOptions) => {
110
110
  * @param data - The input data for the DELETE request, defaults to null.
111
111
  * @returns A promise that resolves to the output of the DELETE handler.
112
112
  */
113
- const dynamicDel = <Route extends RoutesWithMethod<'DELETE'>>(
113
+ const dynamicDel = <Route extends HTTPWiringsWithMethod<'DELETE'>>(
114
114
  route: Route,
115
- data: RouteHandlerOf<Route, 'DELETE'>['input'] = null
116
- ): Promise<RouteHandlerOf<Route, 'DELETE'>['output']> => {
115
+ data: HTTPWiringHandlerOf<Route, 'DELETE'>['input'] = null
116
+ ): Promise<HTTPWiringHandlerOf<Route, 'DELETE'>['output']> => {
117
117
  return dynamicActionRequest(route, 'DELETE', data)
118
118
  }
119
119
 
@@ -127,10 +127,10 @@ export const pikku = (options?: CorePikkuFetchOptions) => {
127
127
  * @param data - The input data for the POST request, defaults to null.
128
128
  * @returns A promise that resolves to the output of the POST handler.
129
129
  */
130
- const staticPost = <Route extends RoutesWithMethod<'POST'>>(
130
+ const staticPost = <Route extends HTTPWiringsWithMethod<'POST'>>(
131
131
  route: Route,
132
- data: RouteHandlerOf<Route, 'POST'>['input'] = null
133
- ): Promise<RouteHandlerOf<Route, 'POST'>['output']> => {
132
+ data: HTTPWiringHandlerOf<Route, 'POST'>['input'] = null
133
+ ): Promise<HTTPWiringHandlerOf<Route, 'POST'>['output']> => {
134
134
  return staticActionRequest(route, 'POST', data)
135
135
  }
136
136
 
@@ -142,10 +142,10 @@ export const pikku = (options?: CorePikkuFetchOptions) => {
142
142
  * @param data - The input data for the GET request, defaults to null.
143
143
  * @returns A promise that resolves to the output of the GET handler.
144
144
  */
145
- const staticGet = <Route extends RoutesWithMethod<'GET'>>(
145
+ const staticGet = <Route extends HTTPWiringsWithMethod<'GET'>>(
146
146
  route: Route,
147
- data: RouteHandlerOf<Route, 'GET'>['input'] = null
148
- ): Promise<RouteHandlerOf<Route, 'GET'>['output']> => {
147
+ data: HTTPWiringHandlerOf<Route, 'GET'>['input'] = null
148
+ ): Promise<HTTPWiringHandlerOf<Route, 'GET'>['output']> => {
149
149
  return staticActionRequest(route, 'GET', data)
150
150
  }
151
151
 
@@ -2,7 +2,7 @@ import { createGenerator, RootlessError } from 'ts-json-schema-generator'
2
2
  import { CLILogger, writeFileInDir } from './utils.js'
3
3
  import { mkdir, writeFile } from 'fs/promises'
4
4
  import { FunctionsMeta, JSONValue } from '@pikku/core'
5
- import { HTTPRoutesMeta } from '@pikku/core/http'
5
+ import { HTTPWiringsMeta } from '@pikku/core/http'
6
6
  import { TypesMap } from '@pikku/inspector'
7
7
 
8
8
  export async function generateSchemas(
@@ -10,7 +10,7 @@ export async function generateSchemas(
10
10
  tsconfig: string,
11
11
  typesMap: TypesMap,
12
12
  functionMeta: FunctionsMeta,
13
- httpRoutesMeta: HTTPRoutesMeta
13
+ httpWiringsMeta: HTTPWiringsMeta
14
14
  ): Promise<Record<string, JSONValue>> {
15
15
  const schemasSet = new Set(typesMap.customTypes.keys())
16
16
  for (const { inputs, outputs } of Object.values(functionMeta)) {
@@ -22,7 +22,7 @@ export async function generateSchemas(
22
22
  }
23
23
  }
24
24
  }
25
- for (const { inputTypes } of httpRoutesMeta) {
25
+ for (const { inputTypes } of httpWiringsMeta) {
26
26
  if (inputTypes?.body) {
27
27
  schemasSet.add(inputTypes.body)
28
28
  }