@pikku/addon-meta-conversions 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.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 +84 -0
- package/.pikku/channel/pikku-channel-types.gen.ts +177 -0
- package/.pikku/console/pikku-addon-meta.gen.json +36 -0
- package/.pikku/console/pikku-node-types.gen.ts +8 -0
- package/.pikku/function/pikku-function-types.gen.ts +797 -0
- package/.pikku/function/pikku-functions-meta-verbose.gen.json +33 -0
- package/.pikku/function/pikku-functions-meta.gen.json +27 -0
- package/.pikku/function/pikku-functions-meta.gen.ts +7 -0
- package/.pikku/function/pikku-functions.gen.ts +8 -0
- package/.pikku/http/pikku-http-types.gen.ts +119 -0
- package/.pikku/mcp/pikku-mcp-types.gen.ts +183 -0
- package/.pikku/pikku-bootstrap-scenarios.gen.ts +9 -0
- package/.pikku/pikku-bootstrap.gen.ts +8 -0
- package/.pikku/pikku-meta-service.gen.ts +10 -0
- package/.pikku/pikku-services.gen.ts +50 -0
- package/.pikku/pikku-types.gen.ts +24 -0
- package/.pikku/queue/pikku-queue-types.gen.ts +27 -0
- package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +135 -0
- package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +136 -0
- package/.pikku/rpc/pikku-rpc-wirings-map.remote.gen.d.ts +135 -0
- package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +3 -0
- package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +6 -0
- package/.pikku/scenarios/features.gen.json +1 -0
- package/.pikku/scenarios/pikku-scenario-functions-meta.gen.json +1 -0
- package/.pikku/scenarios/pikku-scenario-functions-meta.gen.ts +12 -0
- package/.pikku/scenarios/pikku-scenario-functions.gen.ts +4 -0
- package/.pikku/scenarios/pikku-scenario-wirings-meta.gen.ts +15 -0
- package/.pikku/scenarios/pikku-scenario-wirings.gen.ts +4 -0
- package/.pikku/scenarios/schemas/register.gen.ts +4 -0
- package/.pikku/scheduler/pikku-scheduler-types.gen.ts +25 -0
- package/.pikku/schemas/register.gen.ts +15 -0
- package/.pikku/schemas/schemas/EventSendInput.schema.json +1 -0
- package/.pikku/schemas/schemas/EventSendOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/SecretSchema_metaConversions.schema.json +1 -0
- package/.pikku/scopes/pikku-personas-meta.gen.json +1 -0
- package/.pikku/scopes/pikku-personas.gen.ts +52 -0
- package/.pikku/scopes/pikku-roles-meta.gen.json +1 -0
- package/.pikku/scopes/pikku-roles.gen.ts +41 -0
- package/.pikku/scopes/pikku-scope-types.gen.ts +7 -0
- package/.pikku/scopes/pikku-scopes-meta.gen.json +1 -0
- package/.pikku/scopes/pikku-scopes.gen.ts +58 -0
- package/.pikku/secrets/pikku-secret-types.gen.ts +5 -0
- package/.pikku/secrets/pikku-secrets-meta.gen.json +10 -0
- package/.pikku/secrets/pikku-secrets.gen.ts +36 -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 +34 -0
- package/.pikku/workflow/personas.gen.json +1 -0
- package/.pikku/workflow/pikku-personas.gen.ts +38 -0
- package/.pikku/workflow/pikku-scenario-step-map.gen.d.ts +18 -0
- package/.pikku/workflow/pikku-workflow-map.gen.d.ts +38 -0
- package/.pikku/workflow/pikku-workflow-types.gen.ts +591 -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 +4 -4
- package/dist/.pikku/addon/pikku-addon-types.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/pikku-addon-types.gen.js +7 -3
- package/dist/.pikku/addon/pikku-addon-types.gen.js.map +1 -1
- package/dist/.pikku/addon/pikku-addon-types.gen.ts +11 -6
- 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 +8 -6
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts.map +1 -1
- package/dist/.pikku/agent/pikku-agent-types.gen.js.map +1 -1
- package/dist/.pikku/agent/pikku-agent-types.gen.ts +15 -7
- 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/console/pikku-addon-meta.gen.json +4 -1
- 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 +133 -133
- package/dist/.pikku/function/pikku-function-types.gen.d.ts.map +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.js +98 -61
- package/dist/.pikku/function/pikku-function-types.gen.js.map +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.ts +268 -157
- package/dist/.pikku/function/pikku-functions-meta-verbose.gen.json +5 -0
- package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.json +8 -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 +98 -0
- package/dist/.pikku/http/pikku-http-types.gen.d.ts.map +1 -0
- package/dist/.pikku/http/pikku-http-types.gen.js +50 -0
- package/dist/.pikku/http/pikku-http-types.gen.js.map +1 -0
- package/dist/.pikku/http/pikku-http-types.gen.ts +119 -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-scenarios.gen.d.ts +10 -0
- package/dist/.pikku/pikku-bootstrap-scenarios.gen.d.ts.map +1 -0
- package/dist/.pikku/pikku-bootstrap-scenarios.gen.js +10 -0
- package/dist/.pikku/pikku-bootstrap-scenarios.gen.js.map +1 -0
- package/dist/.pikku/pikku-bootstrap-scenarios.gen.ts +9 -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 +15 -2
- package/dist/.pikku/pikku-services.gen.d.ts.map +1 -1
- package/dist/.pikku/pikku-services.gen.js +14 -0
- package/dist/.pikku/pikku-services.gen.js.map +1 -1
- package/dist/.pikku/pikku-services.gen.ts +17 -2
- package/dist/.pikku/pikku-types.gen.d.ts +2 -1
- package/dist/.pikku/pikku-types.gen.d.ts.map +1 -1
- package/dist/.pikku/pikku-types.gen.js +3 -1
- package/dist/.pikku/pikku-types.gen.js.map +1 -1
- package/dist/.pikku/pikku-types.gen.ts +4 -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 +28 -8
- package/dist/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +28 -8
- package/dist/.pikku/rpc/pikku-rpc-wirings-map.remote.gen.d.ts +135 -0
- 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 +3 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +6 -0
- package/dist/.pikku/scenarios/features.gen.json +1 -0
- package/dist/.pikku/scenarios/pikku-scenario-functions-meta.gen.d.ts +2 -0
- package/dist/.pikku/scenarios/pikku-scenario-functions-meta.gen.d.ts.map +1 -0
- package/dist/.pikku/scenarios/pikku-scenario-functions-meta.gen.js +11 -0
- package/dist/.pikku/scenarios/pikku-scenario-functions-meta.gen.js.map +1 -0
- package/dist/.pikku/scenarios/pikku-scenario-functions-meta.gen.json +1 -0
- package/dist/.pikku/scenarios/pikku-scenario-functions-meta.gen.ts +12 -0
- package/dist/.pikku/scenarios/pikku-scenario-functions.gen.d.ts +5 -0
- package/dist/.pikku/scenarios/pikku-scenario-functions.gen.d.ts.map +1 -0
- package/dist/.pikku/scenarios/pikku-scenario-functions.gen.js +2 -0
- package/dist/.pikku/scenarios/pikku-scenario-functions.gen.js.map +1 -0
- package/dist/.pikku/scenarios/pikku-scenario-functions.gen.ts +4 -0
- package/dist/.pikku/scenarios/pikku-scenario-wirings-meta.gen.d.ts +2 -0
- package/dist/.pikku/scenarios/pikku-scenario-wirings-meta.gen.d.ts.map +1 -0
- package/dist/.pikku/scenarios/pikku-scenario-wirings-meta.gen.js +11 -0
- package/dist/.pikku/scenarios/pikku-scenario-wirings-meta.gen.js.map +1 -0
- package/dist/.pikku/scenarios/pikku-scenario-wirings-meta.gen.ts +15 -0
- package/dist/.pikku/scenarios/pikku-scenario-wirings.gen.d.ts +5 -0
- package/dist/.pikku/scenarios/pikku-scenario-wirings.gen.d.ts.map +1 -0
- package/dist/.pikku/scenarios/pikku-scenario-wirings.gen.js +2 -0
- package/dist/.pikku/scenarios/pikku-scenario-wirings.gen.js.map +1 -0
- package/dist/.pikku/scenarios/pikku-scenario-wirings.gen.ts +4 -0
- package/dist/.pikku/scenarios/schemas/register.gen.d.ts +5 -0
- package/dist/.pikku/scenarios/schemas/register.gen.d.ts.map +1 -0
- package/dist/.pikku/scenarios/schemas/register.gen.js +5 -0
- package/dist/.pikku/scenarios/schemas/register.gen.js.map +1 -0
- package/dist/.pikku/scenarios/schemas/register.gen.ts +4 -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/scopes/pikku-personas-meta.gen.json +1 -0
- package/dist/.pikku/scopes/pikku-personas.gen.d.ts +37 -0
- package/dist/.pikku/scopes/pikku-personas.gen.d.ts.map +1 -0
- package/dist/.pikku/scopes/pikku-personas.gen.js +18 -0
- package/dist/.pikku/scopes/pikku-personas.gen.js.map +1 -0
- package/dist/.pikku/scopes/pikku-personas.gen.ts +52 -0
- package/dist/.pikku/scopes/pikku-roles-meta.gen.json +1 -0
- package/dist/.pikku/scopes/pikku-roles.gen.d.ts +31 -0
- package/dist/.pikku/scopes/pikku-roles.gen.d.ts.map +1 -0
- package/dist/.pikku/scopes/pikku-roles.gen.js +19 -0
- package/dist/.pikku/scopes/pikku-roles.gen.js.map +1 -0
- package/dist/.pikku/scopes/pikku-roles.gen.ts +41 -0
- package/dist/.pikku/scopes/pikku-scope-types.gen.d.ts +8 -0
- package/dist/.pikku/scopes/pikku-scope-types.gen.d.ts.map +1 -0
- package/dist/.pikku/scopes/pikku-scope-types.gen.js +6 -0
- package/dist/.pikku/scopes/pikku-scope-types.gen.js.map +1 -0
- package/dist/.pikku/scopes/pikku-scope-types.gen.ts +7 -0
- package/dist/.pikku/scopes/pikku-scopes-meta.gen.json +1 -0
- package/dist/.pikku/scopes/pikku-scopes.gen.d.ts +36 -0
- package/dist/.pikku/scopes/pikku-scopes.gen.d.ts.map +1 -0
- package/dist/.pikku/scopes/pikku-scopes.gen.js +28 -0
- package/dist/.pikku/scopes/pikku-scopes.gen.js.map +1 -0
- package/dist/.pikku/scopes/pikku-scopes.gen.ts +58 -0
- package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +2 -2
- package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts.map +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.js +2 -2
- package/dist/.pikku/secrets/pikku-secret-types.gen.js.map +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.ts +2 -2
- package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +11 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.d.ts.map +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.js +12 -2
- package/dist/.pikku/secrets/pikku-secrets.gen.js.map +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.ts +15 -2
- 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 +2 -2
- package/dist/.pikku/variables/pikku-variable-types.gen.d.ts.map +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.js +2 -2
- package/dist/.pikku/variables/pikku-variable-types.gen.js.map +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.ts +2 -2
- package/dist/.pikku/variables/pikku-variables.gen.d.ts +11 -1
- package/dist/.pikku/variables/pikku-variables.gen.d.ts.map +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.js +13 -3
- package/dist/.pikku/variables/pikku-variables.gen.js.map +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.ts +16 -3
- package/dist/.pikku/workflow/personas.gen.json +1 -0
- package/dist/.pikku/workflow/pikku-personas.gen.d.ts +16 -0
- package/dist/.pikku/workflow/pikku-personas.gen.d.ts.map +1 -0
- package/dist/.pikku/workflow/pikku-personas.gen.js +18 -0
- package/dist/.pikku/workflow/pikku-personas.gen.js.map +1 -0
- package/dist/.pikku/workflow/pikku-personas.gen.ts +38 -0
- package/dist/.pikku/workflow/pikku-scenario-step-map.gen.d.ts +18 -0
- package/dist/.pikku/workflow/pikku-workflow-map.gen.d.ts +9 -5
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +289 -31
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts.map +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +66 -18
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js.map +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.ts +494 -61
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js.map +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +3 -3
- 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/events/send.function.d.ts +2 -2
- package/dist/src/functions/events/send.function.d.ts.map +1 -1
- package/dist/src/meta-conversions.secret.js +2 -2
- package/dist/src/meta-conversions.secret.js.map +1 -1
- package/dist/src/services.d.ts.map +1 -1
- package/dist/src/services.js +1 -1
- package/dist/src/services.js.map +1 -1
- package/package.json +7 -6
- 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
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.96
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Core function, middleware, and permission types for all wirings
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
7
|
+
import { pikkuAuth as pikkuAuthCore } from '@pikku/core/function';
|
|
8
|
+
import { addTagMiddleware as addTagMiddlewareCore, addGlobalMiddleware as addGlobalMiddlewareCore, addGlobalPermission as addGlobalPermissionCore, } from '@pikku/core/middleware';
|
|
8
9
|
import { pikkuState as __pikkuState } from '@pikku/core/internal';
|
|
9
|
-
import { pikkuAuth as pikkuAuthCore } from '@pikku/core';
|
|
10
10
|
/**
|
|
11
11
|
* Factory function for creating permissions with tree-shaking support.
|
|
12
12
|
* Supports both direct function and configuration object syntax.
|
|
@@ -143,6 +143,9 @@ export const pikkuApprovalDescription = (fn) => {
|
|
|
143
143
|
export function pikkuFunc(func) {
|
|
144
144
|
return typeof func === 'function' ? { func } : func;
|
|
145
145
|
}
|
|
146
|
+
export const pikkuListFunc = (config) => {
|
|
147
|
+
return pikkuFunc(config);
|
|
148
|
+
};
|
|
146
149
|
export function pikkuSessionlessFunc(func) {
|
|
147
150
|
return typeof func === 'function' ? { func } : func;
|
|
148
151
|
}
|
|
@@ -166,33 +169,55 @@ export const pikkuVoidFunc = (func) => {
|
|
|
166
169
|
return typeof func === 'function' ? { func } : func;
|
|
167
170
|
};
|
|
168
171
|
/**
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
* without type compatibility issues.
|
|
172
|
+
* References a registered function by name for use in any wiring.
|
|
173
|
+
* Works for both local and addon functions — resolves via RPC at runtime.
|
|
172
174
|
*
|
|
173
|
-
* @template Name - The
|
|
174
|
-
* @param rpcName - The name of the
|
|
175
|
-
* @returns A Pikku function that proxies calls
|
|
175
|
+
* @template Name - The function name (must be a key in FlattenedRPCMap)
|
|
176
|
+
* @param rpcName - The name of the function to reference
|
|
177
|
+
* @returns A Pikku function config that proxies calls via RPC
|
|
176
178
|
*
|
|
177
179
|
* @example
|
|
178
180
|
* ```typescript
|
|
179
|
-
* //
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
* func: addon('ext:hello'),
|
|
185
|
-
* tags: ['addon'],
|
|
186
|
-
* })
|
|
181
|
+
* // Use in agent tools
|
|
182
|
+
* tools: [ref('todos:listTodos'), ref('myLocalFunc')]
|
|
183
|
+
*
|
|
184
|
+
* // Use in HTTP wiring
|
|
185
|
+
* wireHTTP({ route: '/greet', method: 'post', func: ref('greet') })
|
|
187
186
|
* ```
|
|
188
187
|
*/
|
|
189
|
-
export const
|
|
188
|
+
export const ref = (rpcName) => {
|
|
190
189
|
return {
|
|
191
190
|
func: async (_services, data, { rpc }) => {
|
|
192
191
|
return rpc.invoke(rpcName, data);
|
|
193
192
|
}
|
|
194
193
|
};
|
|
195
194
|
};
|
|
195
|
+
/**
|
|
196
|
+
* Declares a capability the connected client answers, reachable from any
|
|
197
|
+
* `wireChannel` function as `channel.remote(name, input)`.
|
|
198
|
+
*
|
|
199
|
+
* There is no `func`: this side owns the contract, the client owns the body.
|
|
200
|
+
* The `description` is what a person is shown when asked to approve the call,
|
|
201
|
+
* so write it for them rather than for the caller.
|
|
202
|
+
*
|
|
203
|
+
* @example
|
|
204
|
+
* ```typescript
|
|
205
|
+
* export const localCheckoutOutput = z.object({ sha: z.string(), branch: z.string() })
|
|
206
|
+
*
|
|
207
|
+
* export const localCheckout = pikkuRemoteChannelFunc({
|
|
208
|
+
* description: 'Read the current commit and branch of your working tree',
|
|
209
|
+
* output: localCheckoutOutput,
|
|
210
|
+
* })
|
|
211
|
+
* ```
|
|
212
|
+
*/
|
|
213
|
+
export function pikkuRemoteChannelFunc(config) {
|
|
214
|
+
return {
|
|
215
|
+
...config,
|
|
216
|
+
func: async (_services, _data, _wire) => {
|
|
217
|
+
throw new Error(`${config.title ?? 'This'} is a remote channel capability and has no local implementation — reach it with channel.remote() on the channel whose client exposes it.`);
|
|
218
|
+
},
|
|
219
|
+
};
|
|
220
|
+
}
|
|
196
221
|
/**
|
|
197
222
|
* Creates a Pikku config factory.
|
|
198
223
|
* Use this to define your application's configuration factory.
|
|
@@ -231,9 +256,24 @@ export const pikkuConfig = (func) => func;
|
|
|
231
256
|
*/
|
|
232
257
|
export const pikkuServices = (func) => {
|
|
233
258
|
return async (config, existingServices = {}) => {
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
|
|
259
|
+
const createdServices = await func(config, existingServices);
|
|
260
|
+
const services = { ...existingServices, ...createdServices };
|
|
261
|
+
const authFactory = __pikkuState(null, 'package', 'authFactory');
|
|
262
|
+
if (authFactory) {
|
|
263
|
+
let authInstance;
|
|
264
|
+
services.auth = () => {
|
|
265
|
+
authInstance ??= Promise.resolve()
|
|
266
|
+
.then(() => authFactory(services))
|
|
267
|
+
.catch((error) => {
|
|
268
|
+
authInstance = undefined;
|
|
269
|
+
throw error;
|
|
270
|
+
});
|
|
271
|
+
return authInstance;
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
const resolved = services;
|
|
275
|
+
__pikkuState(null, 'package', 'singletonServices', resolved);
|
|
276
|
+
return resolved;
|
|
237
277
|
};
|
|
238
278
|
};
|
|
239
279
|
/**
|
|
@@ -259,56 +299,53 @@ export const pikkuWireServices = (func) => {
|
|
|
259
299
|
return func;
|
|
260
300
|
};
|
|
261
301
|
/**
|
|
262
|
-
*
|
|
263
|
-
*
|
|
264
|
-
* This function allows you to register middleware that will be applied to
|
|
265
|
-
* any wiring (HTTP, Channel, Queue, Scheduler, MCP) that includes the matching tag.
|
|
266
|
-
*
|
|
267
|
-
* @param tag - The tag that the middleware should apply to.
|
|
268
|
-
* @param middleware - The middleware array to apply for the specified tag.
|
|
269
|
-
*
|
|
270
|
-
* @throws Error if middleware for the tag already exists.
|
|
302
|
+
* Tag-scoped middleware. Applies to any wiring that carries the matching tag.
|
|
271
303
|
*
|
|
272
304
|
* @example
|
|
273
|
-
*
|
|
274
|
-
* // Add admin middleware for admin endpoints
|
|
275
|
-
* addMiddleware('admin', [adminMiddleware])
|
|
276
|
-
*
|
|
277
|
-
* // Add authentication middleware for auth endpoints
|
|
278
|
-
* addMiddleware('auth', [authMiddleware])
|
|
279
|
-
*
|
|
280
|
-
* // Add logging middleware for all API endpoints
|
|
281
|
-
* addMiddleware('api', [loggingMiddleware])
|
|
282
|
-
* ```
|
|
305
|
+
* addTagMiddleware('admin', [adminMiddleware])
|
|
283
306
|
*/
|
|
284
|
-
export const
|
|
285
|
-
|
|
307
|
+
export const addTagMiddleware = (tag, middleware) => {
|
|
308
|
+
addTagMiddlewareCore(tag, middleware, '@pikku/addon-meta-conversions');
|
|
286
309
|
};
|
|
287
310
|
/**
|
|
288
|
-
*
|
|
289
|
-
*
|
|
290
|
-
* This function allows you to register permissions that will be applied to
|
|
291
|
-
* any wiring (HTTP, Channel, Queue, Scheduler, MCP) that includes the matching tag.
|
|
311
|
+
* Wire-agnostic global middleware. Runs at the top of every wiring's
|
|
312
|
+
* middleware chain — before wire-, tag-, and function-level entries.
|
|
292
313
|
*
|
|
293
|
-
*
|
|
294
|
-
* @param permissions - The permissions array or object to apply for the specified tag.
|
|
295
|
-
*
|
|
296
|
-
* @throws Error if permissions for the tag already exist.
|
|
314
|
+
* Resolution order: global -> wire -> tag -> function.
|
|
297
315
|
*
|
|
298
316
|
* @example
|
|
299
|
-
*
|
|
300
|
-
|
|
301
|
-
|
|
317
|
+
* addGlobalMiddleware([telemetryMiddleware])
|
|
318
|
+
*/
|
|
319
|
+
export const addGlobalMiddleware = (middleware) => {
|
|
320
|
+
addGlobalMiddlewareCore(middleware, '@pikku/addon-meta-conversions');
|
|
321
|
+
};
|
|
322
|
+
/**
|
|
323
|
+
* Wire-agnostic global permissions. Runs at the top of every wiring's
|
|
324
|
+
* permission resolution — before wire-, tag-, and function-level entries.
|
|
302
325
|
*
|
|
303
|
-
*
|
|
304
|
-
* addPermission('auth', [authPermission])
|
|
326
|
+
* Resolution order: global -> wire -> tag -> function.
|
|
305
327
|
*
|
|
306
|
-
*
|
|
307
|
-
*
|
|
308
|
-
|
|
328
|
+
* @example
|
|
329
|
+
* addGlobalPermission([signedInUser])
|
|
330
|
+
*/
|
|
331
|
+
export const addGlobalPermission = (permissions) => {
|
|
332
|
+
addGlobalPermissionCore(permissions, '@pikku/addon-meta-conversions');
|
|
333
|
+
};
|
|
334
|
+
export { wireAddon, wireRemoteAddon } from '@pikku/core/rpc';
|
|
335
|
+
/**
|
|
336
|
+
* Addon contract references. Generated from each wired addon's published
|
|
337
|
+
* contract metadata — no addon source is imported. Functions are proxied via
|
|
338
|
+
* ref() (RPC) exactly like ref('namespace:fn').
|
|
309
339
|
*/
|
|
310
|
-
|
|
311
|
-
|
|
340
|
+
const __addonHttp = {};
|
|
341
|
+
const __addonChannel = {};
|
|
342
|
+
const __addonCli = {};
|
|
343
|
+
export const refHTTP = (name, options) => {
|
|
344
|
+
const contract = __addonHttp[name];
|
|
345
|
+
return (options?.basePath !== undefined
|
|
346
|
+
? { ...contract, basePath: options.basePath }
|
|
347
|
+
: contract);
|
|
312
348
|
};
|
|
313
|
-
export
|
|
349
|
+
export const refChannel = (name) => __addonChannel[name];
|
|
350
|
+
export const refCLI = (name) => __addonCli[name];
|
|
314
351
|
//# sourceMappingURL=pikku-function-types.gen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pikku-function-types.gen.js","sourceRoot":"","sources":["../../../.pikku/function/pikku-function-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;
|
|
1
|
+
{"version":3,"file":"pikku-function-types.gen.js","sourceRoot":"","sources":["../../../.pikku/function/pikku-function-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;AAIH,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,EACL,gBAAgB,IAAI,oBAAoB,EACxC,mBAAmB,IAAI,uBAAuB,EAC9C,mBAAmB,IAAI,uBAAuB,GAC/C,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,UAAU,IAAI,YAAY,EAAsB,MAAM,s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