@pikku/addon-graph 0.0.3 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.pikku/addon/pikku-addon-types.gen.ts +105 -0
- package/.pikku/addon/pikku-package.gen.ts +11 -0
- package/.pikku/agent/pikku-agent-map.gen.d.ts +4 -0
- package/.pikku/agent/pikku-agent-types.gen.ts +82 -0
- package/.pikku/channel/pikku-channel-types.gen.ts +177 -0
- package/.pikku/cli/pikku-cli-types.gen.ts +105 -0
- package/.pikku/console/pikku-addon-meta.gen.json +281 -0
- package/.pikku/console/pikku-node-types.gen.ts +8 -0
- package/.pikku/function/pikku-function-types.gen.ts +684 -0
- package/.pikku/function/pikku-functions-meta-verbose.gen.json +660 -0
- package/.pikku/function/pikku-functions-meta.gen.json +450 -0
- package/.pikku/function/pikku-functions-meta.gen.ts +7 -0
- package/.pikku/function/pikku-functions.gen.ts +56 -0
- package/.pikku/http/pikku-http-types.gen.ts +147 -0
- package/.pikku/mcp/pikku-mcp-types.gen.ts +183 -0
- package/.pikku/pikku-bootstrap.gen.ts +8 -0
- package/.pikku/pikku-meta-service.gen.ts +10 -0
- package/.pikku/pikku-services.gen.ts +39 -0
- package/.pikku/pikku-types.gen.ts +21 -0
- package/.pikku/queue/pikku-queue-types.gen.ts +27 -0
- package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +488 -0
- package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +513 -0
- package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +27 -0
- package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +6 -0
- package/.pikku/scheduler/pikku-scheduler-types.gen.ts +25 -0
- package/.pikku/schemas/register.gen.ts +199 -0
- package/.pikku/schemas/schemas/AggregateInput.schema.json +1 -0
- package/.pikku/schemas/schemas/AggregateOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/ChunkInput.schema.json +1 -0
- package/.pikku/schemas/schemas/ChunkOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/CoalesceInput.schema.json +1 -0
- package/.pikku/schemas/schemas/CoalesceOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/CryptoInput.schema.json +1 -0
- package/.pikku/schemas/schemas/CryptoOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/DateTimeInput.schema.json +1 -0
- package/.pikku/schemas/schemas/DateTimeOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/EditFieldsInput.schema.json +1 -0
- package/.pikku/schemas/schemas/EditFieldsOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/FindInput.schema.json +1 -0
- package/.pikku/schemas/schemas/FindOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/GroupByInput.schema.json +1 -0
- package/.pikku/schemas/schemas/GroupByOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/JwtDecodeInput.schema.json +1 -0
- package/.pikku/schemas/schemas/JwtDecodeOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/JwtSignInput.schema.json +1 -0
- package/.pikku/schemas/schemas/JwtSignOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/LimitInput.schema.json +1 -0
- package/.pikku/schemas/schemas/LimitOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/MathInput.schema.json +1 -0
- package/.pikku/schemas/schemas/MathOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/MergeInput.schema.json +1 -0
- package/.pikku/schemas/schemas/MergeOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/OmitInput.schema.json +1 -0
- package/.pikku/schemas/schemas/OmitOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/PickInput.schema.json +1 -0
- package/.pikku/schemas/schemas/PickOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/RemoveDuplicatesInput.schema.json +1 -0
- package/.pikku/schemas/schemas/RemoveDuplicatesOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/RenameKeysInput.schema.json +1 -0
- package/.pikku/schemas/schemas/RenameKeysOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/ReverseInput.schema.json +1 -0
- package/.pikku/schemas/schemas/ReverseOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/SleepInput.schema.json +1 -0
- package/.pikku/schemas/schemas/SortInput.schema.json +1 -0
- package/.pikku/schemas/schemas/SortOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/SplitOutInput.schema.json +1 -0
- package/.pikku/schemas/schemas/SplitOutOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/StringTransformInput.schema.json +1 -0
- package/.pikku/schemas/schemas/StringTransformOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/SummarizeInput.schema.json +1 -0
- package/.pikku/schemas/schemas/SummarizeOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/TypeConvertInput.schema.json +1 -0
- package/.pikku/schemas/schemas/TypeConvertOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/UniqueInput.schema.json +1 -0
- package/.pikku/schemas/schemas/UniqueOutput.schema.json +1 -0
- package/.pikku/secrets/pikku-secret-types.gen.ts +5 -0
- package/.pikku/secrets/pikku-secrets-meta.gen.json +1 -0
- package/.pikku/secrets/pikku-secrets.gen.ts +21 -0
- package/.pikku/trigger/pikku-trigger-types.gen.ts +160 -0
- package/.pikku/variables/pikku-variable-types.gen.ts +5 -0
- package/.pikku/variables/pikku-variables-meta.gen.json +1 -0
- package/.pikku/variables/pikku-variables.gen.ts +21 -0
- package/.pikku/workflow/pikku-workflow-map.gen.d.ts +38 -0
- package/.pikku/workflow/pikku-workflow-types.gen.ts +167 -0
- package/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +9 -0
- package/.pikku/workflow/pikku-workflow-wirings.gen.ts +3 -0
- package/dist/.pikku/addon/pikku-addon-types.gen.d.ts +3 -3
- package/dist/.pikku/addon/pikku-addon-types.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/pikku-addon-types.gen.js +6 -2
- package/dist/.pikku/addon/pikku-addon-types.gen.js.map +1 -1
- package/dist/.pikku/addon/pikku-addon-types.gen.ts +10 -5
- package/dist/.pikku/addon/pikku-package.gen.js +2 -1
- package/dist/.pikku/addon/pikku-package.gen.js.map +1 -1
- package/dist/.pikku/addon/pikku-package.gen.ts +3 -1
- package/dist/.pikku/agent/pikku-agent-map.gen.d.ts +2 -14
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
- package/dist/.pikku/agent/pikku-agent-types.gen.ts +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +112 -0
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts.map +1 -0
- package/dist/.pikku/channel/pikku-channel-types.gen.js +60 -0
- package/dist/.pikku/channel/pikku-channel-types.gen.js.map +1 -0
- package/dist/.pikku/channel/pikku-channel-types.gen.ts +177 -0
- package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +78 -0
- package/dist/.pikku/cli/pikku-cli-types.gen.d.ts.map +1 -0
- package/dist/.pikku/cli/pikku-cli-types.gen.js +61 -0
- package/dist/.pikku/cli/pikku-cli-types.gen.js.map +1 -0
- package/dist/.pikku/cli/pikku-cli-types.gen.ts +105 -0
- package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
- package/dist/.pikku/console/pikku-node-types.gen.ts +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +16 -19
- package/dist/.pikku/function/pikku-function-types.gen.d.ts.map +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.js +15 -19
- package/dist/.pikku/function/pikku-function-types.gen.js.map +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.ts +18 -20
- package/dist/.pikku/function/pikku-functions-meta-verbose.gen.json +50 -0
- package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.ts +1 -1
- package/dist/.pikku/function/pikku-functions.gen.js +2 -2
- package/dist/.pikku/function/pikku-functions.gen.js.map +1 -1
- package/dist/.pikku/function/pikku-functions.gen.ts +2 -2
- package/dist/.pikku/http/pikku-http-types.gen.d.ts +120 -0
- package/dist/.pikku/http/pikku-http-types.gen.d.ts.map +1 -0
- package/dist/.pikku/http/pikku-http-types.gen.js +72 -0
- package/dist/.pikku/http/pikku-http-types.gen.js.map +1 -0
- package/dist/.pikku/http/pikku-http-types.gen.ts +147 -0
- package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +131 -0
- package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts.map +1 -0
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js +38 -0
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js.map +1 -0
- package/dist/.pikku/mcp/pikku-mcp-types.gen.ts +183 -0
- package/dist/.pikku/pikku-bootstrap.gen.d.ts +4 -2
- package/dist/.pikku/pikku-bootstrap.gen.d.ts.map +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.js +2 -10
- package/dist/.pikku/pikku-bootstrap.gen.js.map +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.ts +2 -9
- package/dist/.pikku/pikku-meta-service.gen.d.ts +8 -0
- package/dist/.pikku/pikku-meta-service.gen.d.ts.map +1 -0
- package/dist/.pikku/pikku-meta-service.gen.js +10 -0
- package/dist/.pikku/pikku-meta-service.gen.js.map +1 -0
- package/dist/.pikku/pikku-meta-service.gen.ts +10 -0
- package/dist/.pikku/pikku-services.gen.d.ts +6 -3
- package/dist/.pikku/pikku-services.gen.d.ts.map +1 -1
- package/dist/.pikku/pikku-services.gen.js +5 -1
- package/dist/.pikku/pikku-services.gen.js.map +1 -1
- package/dist/.pikku/pikku-services.gen.ts +8 -3
- package/dist/.pikku/pikku-types.gen.d.ts +1 -1
- package/dist/.pikku/pikku-types.gen.js +1 -1
- package/dist/.pikku/pikku-types.gen.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +24 -0
- package/dist/.pikku/queue/pikku-queue-types.gen.d.ts.map +1 -0
- package/dist/.pikku/queue/pikku-queue-types.gen.js +17 -0
- package/dist/.pikku/queue/pikku-queue-types.gen.js.map +1 -0
- package/dist/.pikku/queue/pikku-queue-types.gen.ts +27 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +421 -57
- package/dist/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +421 -57
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.d.ts +2 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.d.ts.map +1 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +7 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js.map +1 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +27 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +6 -0
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +22 -0
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts.map +1 -0
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +17 -0
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js.map +1 -0
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.ts +25 -0
- package/dist/.pikku/schemas/register.gen.js +1 -1
- package/dist/.pikku/schemas/register.gen.ts +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.ts +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.ts +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.ts +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.ts +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-map.gen.d.ts +9 -5
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +3 -24
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts.map +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -14
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js.map +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.ts +5 -52
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.ts +1 -1
- package/dist/src/functions/data/jwt.function.d.ts.map +1 -1
- package/dist/src/functions/data/jwt.function.js +3 -2
- package/dist/src/functions/data/jwt.function.js.map +1 -1
- package/package.json +7 -9
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.d.ts +0 -2
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.d.ts.map +0 -1
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.js +0 -7
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.js.map +0 -1
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.json +0 -3
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.ts +0 -7
- package/dist/.pikku/agent/pikku-agent-wirings.gen.d.ts +0 -5
- package/dist/.pikku/agent/pikku-agent-wirings.gen.d.ts.map +0 -1
- package/dist/.pikku/agent/pikku-agent-wirings.gen.js +0 -5
- package/dist/.pikku/agent/pikku-agent-wirings.gen.js.map +0 -1
- package/dist/.pikku/agent/pikku-agent-wirings.gen.ts +0 -3
- package/dist/.pikku/schema-cache.json +0 -1
- package/dist/.pikku/schemas/pikku.cache.json +0 -1
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.19
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Core function, middleware, and permission types for all wirings
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import type { CorePikkuMiddleware, CorePermissionGroup, PikkuWire, PickRequired } from '@pikku/core'
|
|
9
|
+
import type { CorePikkuFunctionConfig, CorePikkuAuth, CorePikkuAuthConfig, CorePikkuPermission } from '@pikku/core/function'
|
|
10
|
+
import { pikkuAuth as pikkuAuthCore } from '@pikku/core/function'
|
|
11
|
+
import { addMiddleware as addMiddlewareCore, addPermission as addPermissionCore } from '@pikku/core/middleware'
|
|
9
12
|
import { pikkuState as __pikkuState, CreateWireServices } from '@pikku/core/internal'
|
|
10
|
-
import { pikkuAuth as pikkuAuthCore } from '@pikku/core'
|
|
11
13
|
import { PikkuError } from '@pikku/core/errors'
|
|
12
14
|
import type { NodeType } from '@pikku/core/node'
|
|
13
15
|
import type { StandardSchemaV1 } from '@standard-schema/spec'
|
|
@@ -512,27 +514,23 @@ export const pikkuVoidFunc = (
|
|
|
512
514
|
}
|
|
513
515
|
|
|
514
516
|
/**
|
|
515
|
-
*
|
|
516
|
-
*
|
|
517
|
-
* without type compatibility issues.
|
|
517
|
+
* References a registered function by name for use in any wiring.
|
|
518
|
+
* Works for both local and addon functions — resolves via RPC at runtime.
|
|
518
519
|
*
|
|
519
|
-
* @template Name - The
|
|
520
|
-
* @param rpcName - The name of the
|
|
521
|
-
* @returns A Pikku function that proxies calls
|
|
520
|
+
* @template Name - The function name (must be a key in FlattenedRPCMap)
|
|
521
|
+
* @param rpcName - The name of the function to reference
|
|
522
|
+
* @returns A Pikku function config that proxies calls via RPC
|
|
522
523
|
*
|
|
523
524
|
* @example
|
|
524
525
|
* ```typescript
|
|
525
|
-
* //
|
|
526
|
-
*
|
|
527
|
-
*
|
|
528
|
-
*
|
|
529
|
-
*
|
|
530
|
-
* func: addon('ext:hello'),
|
|
531
|
-
* tags: ['addon'],
|
|
532
|
-
* })
|
|
526
|
+
* // Use in agent tools
|
|
527
|
+
* tools: [ref('todos:listTodos'), ref('myLocalFunc')]
|
|
528
|
+
*
|
|
529
|
+
* // Use in HTTP wiring
|
|
530
|
+
* wireHTTP({ route: '/greet', method: 'post', func: ref('greet') })
|
|
533
531
|
* ```
|
|
534
532
|
*/
|
|
535
|
-
export const
|
|
533
|
+
export const ref = <Name extends keyof FlattenedRPCMap>(
|
|
536
534
|
rpcName: Name
|
|
537
535
|
): PikkuFunctionConfig<
|
|
538
536
|
FlattenedRPCMap[Name]['input'],
|
|
@@ -682,5 +680,5 @@ export const addPermission = <In = unknown>(tag: string, permissions: CorePermis
|
|
|
682
680
|
addPermissionCore(tag, permissions as any, '@pikku/addon-graph')
|
|
683
681
|
}
|
|
684
682
|
|
|
685
|
-
export { wireAddon } from '@pikku/core'
|
|
686
|
-
export type { WireAddonConfig } from '@pikku/core'
|
|
683
|
+
export { wireAddon } from '@pikku/core/rpc'
|
|
684
|
+
export type { WireAddonConfig } from '@pikku/core/rpc'
|
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
],
|
|
20
20
|
"description": "Combine a field from many items into a list in a single item",
|
|
21
21
|
"isDirectFunction": false,
|
|
22
|
+
"sourceFile": "/home/runner/work/pikku/pikku/packages/addon/pikku-graph/src/functions/array/aggregate.function.ts",
|
|
23
|
+
"exportedName": "aggregate",
|
|
22
24
|
"contractHash": "6646e357810ff732",
|
|
23
25
|
"inputHash": "7095d4db",
|
|
24
26
|
"outputHash": "e975f06d"
|
|
@@ -43,6 +45,8 @@
|
|
|
43
45
|
],
|
|
44
46
|
"description": "Split array into chunks of specified size",
|
|
45
47
|
"isDirectFunction": false,
|
|
48
|
+
"sourceFile": "/home/runner/work/pikku/pikku/packages/addon/pikku-graph/src/functions/array/chunk.function.ts",
|
|
49
|
+
"exportedName": "chunk",
|
|
46
50
|
"contractHash": "f3e025ccc0be3aa8",
|
|
47
51
|
"inputHash": "9e3887d0",
|
|
48
52
|
"outputHash": "09634b84"
|
|
@@ -67,6 +71,8 @@
|
|
|
67
71
|
],
|
|
68
72
|
"description": "Find the first item matching a field value",
|
|
69
73
|
"isDirectFunction": false,
|
|
74
|
+
"sourceFile": "/home/runner/work/pikku/pikku/packages/addon/pikku-graph/src/functions/array/find.function.ts",
|
|
75
|
+
"exportedName": "find",
|
|
70
76
|
"contractHash": "d916d83598f3942c",
|
|
71
77
|
"inputHash": "463866fb",
|
|
72
78
|
"outputHash": "c8cf3580"
|
|
@@ -91,6 +97,8 @@
|
|
|
91
97
|
],
|
|
92
98
|
"description": "Group items by a field value",
|
|
93
99
|
"isDirectFunction": false,
|
|
100
|
+
"sourceFile": "/home/runner/work/pikku/pikku/packages/addon/pikku-graph/src/functions/array/group-by.function.ts",
|
|
101
|
+
"exportedName": "groupBy",
|
|
94
102
|
"contractHash": "983fc1270a3ef585",
|
|
95
103
|
"inputHash": "a559ec54",
|
|
96
104
|
"outputHash": "cbd369f9"
|
|
@@ -115,6 +123,8 @@
|
|
|
115
123
|
],
|
|
116
124
|
"description": "Restrict the number of items",
|
|
117
125
|
"isDirectFunction": false,
|
|
126
|
+
"sourceFile": "/home/runner/work/pikku/pikku/packages/addon/pikku-graph/src/functions/array/limit.function.ts",
|
|
127
|
+
"exportedName": "limit",
|
|
118
128
|
"contractHash": "634a5e4e1e4618a6",
|
|
119
129
|
"inputHash": "dd5593d3",
|
|
120
130
|
"outputHash": "82f7aa38"
|
|
@@ -139,6 +149,8 @@
|
|
|
139
149
|
],
|
|
140
150
|
"description": "Delete items with matching field values",
|
|
141
151
|
"isDirectFunction": false,
|
|
152
|
+
"sourceFile": "/home/runner/work/pikku/pikku/packages/addon/pikku-graph/src/functions/array/remove-duplicates.function.ts",
|
|
153
|
+
"exportedName": "removeDuplicates",
|
|
142
154
|
"contractHash": "ece62358aebbd4f4",
|
|
143
155
|
"inputHash": "a7dec329",
|
|
144
156
|
"outputHash": "93cbcf6f"
|
|
@@ -163,6 +175,8 @@
|
|
|
163
175
|
],
|
|
164
176
|
"description": "Reverse the order of items in an array",
|
|
165
177
|
"isDirectFunction": false,
|
|
178
|
+
"sourceFile": "/home/runner/work/pikku/pikku/packages/addon/pikku-graph/src/functions/array/reverse.function.ts",
|
|
179
|
+
"exportedName": "reverse",
|
|
166
180
|
"contractHash": "9673137c6f655969",
|
|
167
181
|
"inputHash": "1b826e9b",
|
|
168
182
|
"outputHash": "c609276e"
|
|
@@ -187,6 +201,8 @@
|
|
|
187
201
|
],
|
|
188
202
|
"description": "Change items order",
|
|
189
203
|
"isDirectFunction": false,
|
|
204
|
+
"sourceFile": "/home/runner/work/pikku/pikku/packages/addon/pikku-graph/src/functions/array/sort.function.ts",
|
|
205
|
+
"exportedName": "sort",
|
|
190
206
|
"contractHash": "8eab9165a4055318",
|
|
191
207
|
"inputHash": "1bd5a514",
|
|
192
208
|
"outputHash": "d1904adf"
|
|
@@ -211,6 +227,8 @@
|
|
|
211
227
|
],
|
|
212
228
|
"description": "Turn a list inside item(s) into separate items",
|
|
213
229
|
"isDirectFunction": false,
|
|
230
|
+
"sourceFile": "/home/runner/work/pikku/pikku/packages/addon/pikku-graph/src/functions/array/split-out.function.ts",
|
|
231
|
+
"exportedName": "splitOut",
|
|
214
232
|
"contractHash": "a4c3f093e598a514",
|
|
215
233
|
"inputHash": "c8e65194",
|
|
216
234
|
"outputHash": "608db389"
|
|
@@ -235,6 +253,8 @@
|
|
|
235
253
|
],
|
|
236
254
|
"description": "Sum, count, max, etc. across items",
|
|
237
255
|
"isDirectFunction": false,
|
|
256
|
+
"sourceFile": "/home/runner/work/pikku/pikku/packages/addon/pikku-graph/src/functions/array/summarize.function.ts",
|
|
257
|
+
"exportedName": "summarize",
|
|
238
258
|
"contractHash": "ab78ac6eed8b2ce0",
|
|
239
259
|
"inputHash": "7d7d0173",
|
|
240
260
|
"outputHash": "b03990e8"
|
|
@@ -259,6 +279,8 @@
|
|
|
259
279
|
],
|
|
260
280
|
"description": "Get unique values from an array",
|
|
261
281
|
"isDirectFunction": false,
|
|
282
|
+
"sourceFile": "/home/runner/work/pikku/pikku/packages/addon/pikku-graph/src/functions/array/unique.function.ts",
|
|
283
|
+
"exportedName": "unique",
|
|
262
284
|
"contractHash": "af135d5702d2aca2",
|
|
263
285
|
"inputHash": "2a18be03",
|
|
264
286
|
"outputHash": "b24ac8e7"
|
|
@@ -283,6 +305,8 @@
|
|
|
283
305
|
],
|
|
284
306
|
"description": "Return the first non-null value",
|
|
285
307
|
"isDirectFunction": false,
|
|
308
|
+
"sourceFile": "/home/runner/work/pikku/pikku/packages/addon/pikku-graph/src/functions/data/coalesce.function.ts",
|
|
309
|
+
"exportedName": "coalesce",
|
|
286
310
|
"contractHash": "9aa1a02f90b8ed52",
|
|
287
311
|
"inputHash": "d1baf6ed",
|
|
288
312
|
"outputHash": "eef08a58"
|
|
@@ -307,6 +331,8 @@
|
|
|
307
331
|
],
|
|
308
332
|
"description": "Provide cryptographic utilities",
|
|
309
333
|
"isDirectFunction": false,
|
|
334
|
+
"sourceFile": "/home/runner/work/pikku/pikku/packages/addon/pikku-graph/src/functions/data/crypto.function.ts",
|
|
335
|
+
"exportedName": "crypto",
|
|
310
336
|
"contractHash": "9e2e5b2bc9df616e",
|
|
311
337
|
"inputHash": "60d6d839",
|
|
312
338
|
"outputHash": "38bec130"
|
|
@@ -331,6 +357,8 @@
|
|
|
331
357
|
],
|
|
332
358
|
"description": "Manipulate date and time values",
|
|
333
359
|
"isDirectFunction": false,
|
|
360
|
+
"sourceFile": "/home/runner/work/pikku/pikku/packages/addon/pikku-graph/src/functions/data/date-time.function.ts",
|
|
361
|
+
"exportedName": "dateTime",
|
|
334
362
|
"contractHash": "b297121a74826469",
|
|
335
363
|
"inputHash": "fbb83641",
|
|
336
364
|
"outputHash": "93b7219a"
|
|
@@ -357,6 +385,8 @@
|
|
|
357
385
|
],
|
|
358
386
|
"description": "Sign a payload into a JWT token",
|
|
359
387
|
"isDirectFunction": false,
|
|
388
|
+
"sourceFile": "/home/runner/work/pikku/pikku/packages/addon/pikku-graph/src/functions/data/jwt.function.ts",
|
|
389
|
+
"exportedName": "jwtSign",
|
|
360
390
|
"contractHash": "75f181ad1396ce9d",
|
|
361
391
|
"inputHash": "6c178a3f",
|
|
362
392
|
"outputHash": "5490ba45"
|
|
@@ -383,6 +413,8 @@
|
|
|
383
413
|
],
|
|
384
414
|
"description": "Decode a JWT token into its payload",
|
|
385
415
|
"isDirectFunction": false,
|
|
416
|
+
"sourceFile": "/home/runner/work/pikku/pikku/packages/addon/pikku-graph/src/functions/data/jwt.function.ts",
|
|
417
|
+
"exportedName": "jwtDecode",
|
|
386
418
|
"contractHash": "3fc7b49a6cdaf7f0",
|
|
387
419
|
"inputHash": "4401b17b",
|
|
388
420
|
"outputHash": "7752bc62"
|
|
@@ -407,6 +439,8 @@
|
|
|
407
439
|
],
|
|
408
440
|
"description": "Perform math operations",
|
|
409
441
|
"isDirectFunction": false,
|
|
442
|
+
"sourceFile": "/home/runner/work/pikku/pikku/packages/addon/pikku-graph/src/functions/data/math.function.ts",
|
|
443
|
+
"exportedName": "math",
|
|
410
444
|
"contractHash": "6777194d9fa978a2",
|
|
411
445
|
"inputHash": "91f5f92b",
|
|
412
446
|
"outputHash": "473f23f2"
|
|
@@ -435,6 +469,8 @@
|
|
|
435
469
|
"outputs": [],
|
|
436
470
|
"description": "Sleep for a specified duration before continuing",
|
|
437
471
|
"isDirectFunction": false,
|
|
472
|
+
"sourceFile": "/home/runner/work/pikku/pikku/packages/addon/pikku-graph/src/functions/data/sleep.function.ts",
|
|
473
|
+
"exportedName": "sleep",
|
|
438
474
|
"contractHash": "649686d11b09c275",
|
|
439
475
|
"inputHash": "9fd961b9",
|
|
440
476
|
"outputHash": "ec28f86f"
|
|
@@ -459,6 +495,8 @@
|
|
|
459
495
|
],
|
|
460
496
|
"description": "Transform strings (case, trim, split, replace, etc.)",
|
|
461
497
|
"isDirectFunction": false,
|
|
498
|
+
"sourceFile": "/home/runner/work/pikku/pikku/packages/addon/pikku-graph/src/functions/data/string-transform.function.ts",
|
|
499
|
+
"exportedName": "stringTransform",
|
|
462
500
|
"contractHash": "a4cd02c14224c4e6",
|
|
463
501
|
"inputHash": "38037e18",
|
|
464
502
|
"outputHash": "5bfa9735"
|
|
@@ -483,6 +521,8 @@
|
|
|
483
521
|
],
|
|
484
522
|
"description": "Convert between types (string, number, boolean, json, array)",
|
|
485
523
|
"isDirectFunction": false,
|
|
524
|
+
"sourceFile": "/home/runner/work/pikku/pikku/packages/addon/pikku-graph/src/functions/data/type-convert.function.ts",
|
|
525
|
+
"exportedName": "typeConvert",
|
|
486
526
|
"contractHash": "a3bfeff5301903cc",
|
|
487
527
|
"inputHash": "3d6e4ac1",
|
|
488
528
|
"outputHash": "da7680c1"
|
|
@@ -507,6 +547,8 @@
|
|
|
507
547
|
],
|
|
508
548
|
"description": "Modify, add, or remove item fields",
|
|
509
549
|
"isDirectFunction": false,
|
|
550
|
+
"sourceFile": "/home/runner/work/pikku/pikku/packages/addon/pikku-graph/src/functions/transform/edit-fields.function.ts",
|
|
551
|
+
"exportedName": "editFields",
|
|
510
552
|
"contractHash": "860bd8089f3abd16",
|
|
511
553
|
"inputHash": "9b45e130",
|
|
512
554
|
"outputHash": "bc79d970"
|
|
@@ -531,6 +573,8 @@
|
|
|
531
573
|
],
|
|
532
574
|
"description": "Merge multiple objects into one",
|
|
533
575
|
"isDirectFunction": false,
|
|
576
|
+
"sourceFile": "/home/runner/work/pikku/pikku/packages/addon/pikku-graph/src/functions/transform/merge.function.ts",
|
|
577
|
+
"exportedName": "merge",
|
|
534
578
|
"contractHash": "b07476afacdae525",
|
|
535
579
|
"inputHash": "1ad17e4d",
|
|
536
580
|
"outputHash": "0171e51c"
|
|
@@ -555,6 +599,8 @@
|
|
|
555
599
|
],
|
|
556
600
|
"description": "Remove specified fields from an object",
|
|
557
601
|
"isDirectFunction": false,
|
|
602
|
+
"sourceFile": "/home/runner/work/pikku/pikku/packages/addon/pikku-graph/src/functions/transform/omit.function.ts",
|
|
603
|
+
"exportedName": "omit",
|
|
558
604
|
"contractHash": "dec15e51c95ffb1a",
|
|
559
605
|
"inputHash": "8a6dda94",
|
|
560
606
|
"outputHash": "6a6fb8c6"
|
|
@@ -579,6 +625,8 @@
|
|
|
579
625
|
],
|
|
580
626
|
"description": "Keep only specified fields from an object",
|
|
581
627
|
"isDirectFunction": false,
|
|
628
|
+
"sourceFile": "/home/runner/work/pikku/pikku/packages/addon/pikku-graph/src/functions/transform/pick.function.ts",
|
|
629
|
+
"exportedName": "pick",
|
|
582
630
|
"contractHash": "eee51c32e58e1297",
|
|
583
631
|
"inputHash": "8be4abcf",
|
|
584
632
|
"outputHash": "94b236c1"
|
|
@@ -603,6 +651,8 @@
|
|
|
603
651
|
],
|
|
604
652
|
"description": "Update item field names",
|
|
605
653
|
"isDirectFunction": false,
|
|
654
|
+
"sourceFile": "/home/runner/work/pikku/pikku/packages/addon/pikku-graph/src/functions/transform/rename-keys.function.ts",
|
|
655
|
+
"exportedName": "renameKeys",
|
|
606
656
|
"contractHash": "8921f9a567b68dd7",
|
|
607
657
|
"inputHash": "0ff4890b",
|
|
608
658
|
"outputHash": "53ddf4c9"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.19
|
|
3
3
|
*/
|
|
4
4
|
/* Import and register functions used by RPCs */
|
|
5
|
-
import { addFunction } from '@pikku/core';
|
|
5
|
+
import { addFunction } from '@pikku/core/function';
|
|
6
6
|
import { aggregate } from '../../src/functions/array/aggregate.function.js';
|
|
7
7
|
import { chunk } from '../../src/functions/array/chunk.function.js';
|
|
8
8
|
import { coalesce } from '../../src/functions/data/coalesce.function.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pikku-functions.gen.js","sourceRoot":"","sources":["../../../.pikku/function/pikku-functions.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,gDAAgD;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"pikku-functions.gen.js","sourceRoot":"","sources":["../../../.pikku/function/pikku-functions.gen.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.19
|
|
3
3
|
*/
|
|
4
4
|
/* Import and register functions used by RPCs */
|
|
5
|
-
import { addFunction } from '@pikku/core'
|
|
5
|
+
import { addFunction } from '@pikku/core/function'
|
|
6
6
|
import { aggregate } from '../../src/functions/array/aggregate.function.js'
|
|
7
7
|
import { chunk } from '../../src/functions/array/chunk.function.js'
|
|
8
8
|
import { coalesce } from '../../src/functions/data/coalesce.function.js'
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.19
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* HTTP-specific type definitions for tree-shaking optimization
|
|
6
|
+
*/
|
|
7
|
+
import { AssertHTTPWiringParams } from '@pikku/core/http';
|
|
8
|
+
import type { PikkuFunction, PikkuFunctionSessionless, PikkuPermission, PikkuMiddleware, PikkuFunctionConfig } from '../function/pikku-function-types.gen.js';
|
|
9
|
+
import type { CoreHTTPFunctionWiring, HTTPMethod, HTTPRouteBaseConfig } from '@pikku/core/http';
|
|
10
|
+
/**
|
|
11
|
+
* Type definition for HTTP API wirings with type-safe path parameters.
|
|
12
|
+
* Supports both authenticated and unauthenticated functions.
|
|
13
|
+
*
|
|
14
|
+
* @template In - Input type for the HTTP wiring
|
|
15
|
+
* @template Out - Output type for the HTTP wiring
|
|
16
|
+
* @template Route - String literal type for the HTTP path (e.g., "/users/:id")
|
|
17
|
+
*/
|
|
18
|
+
type HTTPWiring<In, Out, Route extends string> = CoreHTTPFunctionWiring<In, Out, Route, PikkuFunction<In, Out, 'rpc' | 'session'>, PikkuFunctionSessionless<In, Out, 'rpc' | 'session'>, PikkuPermission<In>, PikkuMiddleware>;
|
|
19
|
+
/**
|
|
20
|
+
* Registers an HTTP wiring with the Pikku framework.
|
|
21
|
+
*
|
|
22
|
+
* @template In - Input type for the HTTP wiring
|
|
23
|
+
* @template Out - Output type for the HTTP wiring
|
|
24
|
+
* @template Route - String literal type for the HTTP path (e.g., "/users/:id")
|
|
25
|
+
* @param httpWiring - HTTP wiring definition with handler, method, and optional middleware
|
|
26
|
+
*/
|
|
27
|
+
export declare const wireHTTP: <In, Out, Route extends string>(httpWiring: HTTPWiring<In, Out, Route> & AssertHTTPWiringParams<In, Route>) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Registers HTTP middleware either globally or for a specific route pattern.
|
|
30
|
+
*
|
|
31
|
+
* When a string route pattern is provided along with middleware, the middleware
|
|
32
|
+
* is applied only to that route. Otherwise, if an array is provided, it is treated
|
|
33
|
+
* as global middleware (applied to all routes).
|
|
34
|
+
*
|
|
35
|
+
* @param routeOrMiddleware - Either a global middleware array or a route pattern string
|
|
36
|
+
* @param middleware - The middleware array to apply when a route pattern is specified
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```typescript
|
|
40
|
+
* // Add global HTTP middleware
|
|
41
|
+
* addHTTPMiddleware([authMiddleware, loggingMiddleware])
|
|
42
|
+
*
|
|
43
|
+
* // Add route-specific middleware
|
|
44
|
+
* addHTTPMiddleware('/api/admin/*', [adminAuthMiddleware])
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export declare const addHTTPMiddleware: (routeOrMiddleware: PikkuMiddleware[] | string, middleware?: PikkuMiddleware[]) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Registers HTTP permissions either globally or for a specific route pattern.
|
|
50
|
+
*
|
|
51
|
+
* When a string route pattern is provided along with permissions, the permissions
|
|
52
|
+
* are applied only to that route. Permissions can be passed as an array or as a
|
|
53
|
+
* permission group object.
|
|
54
|
+
*
|
|
55
|
+
* @param pattern - Route pattern string (e.g., '*' for all routes, '/api/*' for specific routes)
|
|
56
|
+
* @param permissions - The permissions to apply for the specified route pattern
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```typescript
|
|
60
|
+
* // Add global HTTP permissions
|
|
61
|
+
* addHTTPPermission('*', { global: globalPermission })
|
|
62
|
+
*
|
|
63
|
+
* // Add route-specific permissions
|
|
64
|
+
* addHTTPPermission('/api/admin/*', { admin: adminPermission })
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export declare const addHTTPPermission: <In = unknown>(pattern: string, permissions: Record<string, PikkuPermission<In>> | PikkuPermission<In>[]) => void;
|
|
68
|
+
/**
|
|
69
|
+
* Route configuration for wireHTTPRoutes with proper typing
|
|
70
|
+
*/
|
|
71
|
+
type HTTPRouteConfig = HTTPRouteBaseConfig & {
|
|
72
|
+
method: HTTPMethod;
|
|
73
|
+
route: string;
|
|
74
|
+
func: PikkuFunctionConfig<any, any, any, any, any, any>;
|
|
75
|
+
auth?: boolean;
|
|
76
|
+
permissions?: Record<string, PikkuPermission | PikkuPermission[]>;
|
|
77
|
+
middleware?: PikkuMiddleware[];
|
|
78
|
+
sse?: boolean;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Typed route map for wireHTTPRoutes
|
|
82
|
+
*/
|
|
83
|
+
type TypedHTTPRouteMap = {
|
|
84
|
+
[key: string]: HTTPRouteConfig | TypedHTTPRouteMap | TypedHTTPRouteContract;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Typed route contract for defineHTTPRoutes
|
|
88
|
+
*/
|
|
89
|
+
type TypedHTTPRouteContract<T extends TypedHTTPRouteMap = TypedHTTPRouteMap> = TypedHTTPRoutesGroupConfig & {
|
|
90
|
+
routes: T;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Group config with typed middleware/permissions
|
|
94
|
+
*/
|
|
95
|
+
type TypedHTTPRoutesGroupConfig = {
|
|
96
|
+
basePath?: string;
|
|
97
|
+
tags?: string[];
|
|
98
|
+
auth?: boolean;
|
|
99
|
+
middleware?: PikkuMiddleware[];
|
|
100
|
+
permissions?: Record<string, PikkuPermission | PikkuPermission[]>;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Full config for wireHTTPRoutes
|
|
104
|
+
*/
|
|
105
|
+
type TypedWireHTTPRoutesConfig = TypedHTTPRoutesGroupConfig & {
|
|
106
|
+
routes: TypedHTTPRouteMap | HTTPRouteConfig[];
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Type-safe helper for defining route contracts that can be composed.
|
|
110
|
+
*/
|
|
111
|
+
export declare function defineHTTPRoutes<T extends TypedHTTPRouteMap>(routes: T): TypedHTTPRouteContract<T>;
|
|
112
|
+
export declare function defineHTTPRoutes<T extends TypedHTTPRouteMap>(config: TypedHTTPRoutesGroupConfig & {
|
|
113
|
+
routes: T;
|
|
114
|
+
}): TypedHTTPRouteContract<T>;
|
|
115
|
+
/**
|
|
116
|
+
* Wires multiple HTTP routes from a nested map or array configuration.
|
|
117
|
+
*/
|
|
118
|
+
export declare const wireHTTPRoutes: (config: TypedWireHTTPRoutesConfig) => void;
|
|
119
|
+
export {};
|
|
120
|
+
//# sourceMappingURL=pikku-http-types.gen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pikku-http-types.gen.d.ts","sourceRoot":"","sources":["../../../.pikku/http/pikku-http-types.gen.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.19
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* HTTP-specific type definitions for tree-shaking optimization
|
|
6
|
+
*/
|
|
7
|
+
import { wireHTTP as wireHTTPCore, addHTTPMiddleware as addHTTPMiddlewareCore, addHTTPPermission as addHTTPPermissionCore, wireHTTPRoutes as wireHTTPRoutesCore, defineHTTPRoutes as defineHTTPRoutesCore } from '@pikku/core/http';
|
|
8
|
+
/**
|
|
9
|
+
* Registers an HTTP wiring with the Pikku framework.
|
|
10
|
+
*
|
|
11
|
+
* @template In - Input type for the HTTP wiring
|
|
12
|
+
* @template Out - Output type for the HTTP wiring
|
|
13
|
+
* @template Route - String literal type for the HTTP path (e.g., "/users/:id")
|
|
14
|
+
* @param httpWiring - HTTP wiring definition with handler, method, and optional middleware
|
|
15
|
+
*/
|
|
16
|
+
export const wireHTTP = (httpWiring) => {
|
|
17
|
+
wireHTTPCore(httpWiring);
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Registers HTTP middleware either globally or for a specific route pattern.
|
|
21
|
+
*
|
|
22
|
+
* When a string route pattern is provided along with middleware, the middleware
|
|
23
|
+
* is applied only to that route. Otherwise, if an array is provided, it is treated
|
|
24
|
+
* as global middleware (applied to all routes).
|
|
25
|
+
*
|
|
26
|
+
* @param routeOrMiddleware - Either a global middleware array or a route pattern string
|
|
27
|
+
* @param middleware - The middleware array to apply when a route pattern is specified
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* // Add global HTTP middleware
|
|
32
|
+
* addHTTPMiddleware([authMiddleware, loggingMiddleware])
|
|
33
|
+
*
|
|
34
|
+
* // Add route-specific middleware
|
|
35
|
+
* addHTTPMiddleware('/api/admin/*', [adminAuthMiddleware])
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export const addHTTPMiddleware = (routeOrMiddleware, middleware) => {
|
|
39
|
+
addHTTPMiddlewareCore(routeOrMiddleware, middleware);
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Registers HTTP permissions either globally or for a specific route pattern.
|
|
43
|
+
*
|
|
44
|
+
* When a string route pattern is provided along with permissions, the permissions
|
|
45
|
+
* are applied only to that route. Permissions can be passed as an array or as a
|
|
46
|
+
* permission group object.
|
|
47
|
+
*
|
|
48
|
+
* @param pattern - Route pattern string (e.g., '*' for all routes, '/api/*' for specific routes)
|
|
49
|
+
* @param permissions - The permissions to apply for the specified route pattern
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```typescript
|
|
53
|
+
* // Add global HTTP permissions
|
|
54
|
+
* addHTTPPermission('*', { global: globalPermission })
|
|
55
|
+
*
|
|
56
|
+
* // Add route-specific permissions
|
|
57
|
+
* addHTTPPermission('/api/admin/*', { admin: adminPermission })
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export const addHTTPPermission = (pattern, permissions) => {
|
|
61
|
+
addHTTPPermissionCore(pattern, permissions);
|
|
62
|
+
};
|
|
63
|
+
export function defineHTTPRoutes(configOrRoutes) {
|
|
64
|
+
return defineHTTPRoutesCore(configOrRoutes);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Wires multiple HTTP routes from a nested map or array configuration.
|
|
68
|
+
*/
|
|
69
|
+
export const wireHTTPRoutes = (config) => {
|
|
70
|
+
wireHTTPRoutesCore(config);
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=pikku-http-types.gen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pikku-http-types.gen.js","sourceRoot":"","sources":["../../../.pikku/http/pikku-http-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;AAEH,OAAO,EAA0B,QAAQ,IAAI,YAAY,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,cAAc,IAAI,kBAAkB,EAAE,gBAAgB,IAAI,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAc3P;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,UAA0E,EAC1E,EAAE;IACF,YAAY,CAAC,UAAiB,CAAC,CAAA;AACjC,CAAC,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,iBAA6C,EAC7C,UAA8B,EAC9B,EAAE;IACF,qBAAqB,CAAC,iBAAwB,EAAE,UAAiB,CAAC,CAAA;AACpE,CAAC,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,OAAe,EACf,WAAwE,EACxE,EAAE;IACF,qBAAqB,CAAC,OAAO,EAAE,WAAkB,CAAC,CAAA;AACpD,CAAC,CAAA;AAoDD,MAAM,UAAU,gBAAgB,CAA8B,cAAgE;IAC5H,OAAO,oBAAoB,CAAC,cAAqB,CAAyC,CAAA;AAC5F,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAiC,EAAQ,EAAE;IACxE,kBAAkB,CAAC,MAAa,CAAC,CAAA;AACnC,CAAC,CAAA"}
|