@pikku/addon-console 0.12.23 → 0.12.25
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/dist/.pikku/addon/pikku-addon-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/pikku-addon-types.gen.js +1 -1
- package/dist/.pikku/addon/pikku-package.gen.js +2 -2
- package/dist/.pikku/addon/pikku-package.gen.js.map +1 -1
- package/dist/.pikku/agent/pikku-agent-map.gen.d.ts +1 -1
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
- package/dist/.pikku/auth/auth.types.d.ts +1 -1
- package/dist/.pikku/auth/auth.types.js +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
- package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.json +107 -12
- package/dist/.pikku/function/pikku-functions.gen.js +9 -1
- package/dist/.pikku/function/pikku-functions.gen.js.map +1 -1
- package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
- package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
- package/dist/.pikku/pikku-meta-service.gen.d.ts +1 -1
- package/dist/.pikku/pikku-meta-service.gen.js +1 -1
- package/dist/.pikku/pikku-services.gen.d.ts +4 -3
- package/dist/.pikku/pikku-services.gen.d.ts.map +1 -1
- package/dist/.pikku/pikku-services.gen.js +2 -1
- package/dist/.pikku/pikku-services.gen.js.map +1 -1
- package/dist/.pikku/pikku-types.gen.d.ts +1 -1
- package/dist/.pikku/pikku-types.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +11 -2
- package/dist/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +11 -2
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +4 -0
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
- package/dist/.pikku/schemas/register.gen.js +9 -1
- package/dist/.pikku/schemas/register.gen.js.map +1 -1
- package/dist/.pikku/schemas/schemas/AddonPackageInfo.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/AllMeta.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/GetAddonMetaOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/GetFunctionsMetaOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/GetStubCallsInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/GetStubCallsOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/GetWorkflowMetaByIdOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/ResetLiveCoverageOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/ResetStubsOutput.schema.json +1 -0
- 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-secrets.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.js +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/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-variables.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-map.gen.d.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +4 -4
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +2 -2
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +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/src/functions/get-stub-calls.function.d.ts +13 -0
- package/dist/src/functions/get-stub-calls.function.d.ts.map +1 -0
- package/dist/src/functions/get-stub-calls.function.js +11 -0
- package/dist/src/functions/get-stub-calls.function.js.map +1 -0
- package/dist/src/functions/get-workflow-meta-by-id.function.d.ts +3 -3
- package/dist/src/functions/reset-live-coverage.function.d.ts +8 -0
- package/dist/src/functions/reset-live-coverage.function.d.ts.map +1 -0
- package/dist/src/functions/reset-live-coverage.function.js +13 -0
- package/dist/src/functions/reset-live-coverage.function.js.map +1 -0
- package/dist/src/functions/reset-stubs.function.d.ts +8 -0
- package/dist/src/functions/reset-stubs.function.d.ts.map +1 -0
- package/dist/src/functions/reset-stubs.function.js +12 -0
- package/dist/src/functions/reset-stubs.function.js.map +1 -0
- package/dist/src/functions/take-live-coverage.function.d.ts +3 -0
- package/dist/src/functions/take-live-coverage.function.d.ts.map +1 -0
- package/dist/src/functions/take-live-coverage.function.js +27 -0
- package/dist/src/functions/take-live-coverage.function.js.map +1 -0
- package/dist/src/lib/precise-coverage-map.d.ts +30 -0
- package/dist/src/lib/precise-coverage-map.d.ts.map +1 -0
- package/dist/src/lib/precise-coverage-map.js +177 -0
- package/dist/src/lib/precise-coverage-map.js.map +1 -0
- package/dist/src/lib/precise-coverage-map.test.d.ts +2 -0
- package/dist/src/lib/precise-coverage-map.test.d.ts.map +1 -0
- package/dist/src/lib/precise-coverage-map.test.js +153 -0
- package/dist/src/lib/precise-coverage-map.test.js.map +1 -0
- package/dist/src/services/wiring.service.d.ts +1 -1
- package/dist/src/services/wiring.service.js +3 -3
- package/dist/src/services/wiring.service.test.js +1 -1
- package/dist/src/services.d.ts.map +1 -1
- package/dist/src/services.js +2 -1
- package/dist/src/services.js.map +1 -1
- package/package.json +5 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "name": { "type": "string" }, "steps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" } }, "context": { "$ref": "#/definitions/WorkflowContext" }, "dsl": { "type": "boolean" }, "expose": { "type": "boolean" }, "userFlow": { "type": "boolean" }, "actors": { "type": "array", "items": { "type": "string" } }, "pikkuFuncId": { "type": "string" }, "packageName": { "type": "string" }, "title": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "summary": { "type": "string" }, "description": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } } }, "required": ["name", "pikkuFuncId", "steps"], "definitions": { "WorkflowStepMeta": { "anyOf": [{ "$ref": "#/definitions/RpcStepMeta" }, { "$ref": "#/definitions/BranchStepMeta" }, { "$ref": "#/definitions/ParallelGroupStepMeta" }, { "$ref": "#/definitions/FanoutStepMeta" }, { "$ref": "#/definitions/ReturnStepMeta" }, { "$ref": "#/definitions/InlineStepMeta" }, { "$ref": "#/definitions/SleepStepMeta" }, { "$ref": "#/definitions/CancelStepMeta" }, { "$ref": "#/definitions/SuspendStepMeta" }, { "$ref": "#/definitions/SwitchStepMeta" }, { "$ref": "#/definitions/FilterStepMeta" }, { "$ref": "#/definitions/ArrayPredicateStepMeta" }, { "$ref": "#/definitions/SetStepMeta" }], "description": "Workflow step metadata (extracted by inspector)" }, "RpcStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "rpc", "description": "RPC form - generates queue worker" }, "stepName": { "type": "string", "description": "Cache key (stepName from workflow.do)" }, "rpcName": { "type": "string", "description": "RPC to invoke" }, "outputVar": { "type": "string", "description": "Output variable name (if assigned)" }, "inputs": { "anyOf": [{ "type": "object", "additionalProperties": { "$ref": "#/definitions/InputSource" } }, { "type": "string", "const": "passthrough" }], "description": "Input source mappings, or 'passthrough' when entire data is passed" }, "options": { "$ref": "#/definitions/WorkflowStepOptions", "description": "Step options" }, "actor": { "type": "string", "description": "User-flow actor name this step runs as ({ actor: actors.x })" }, "expectEventually": { "type": "boolean", "description": "True for workflow.expectEventually polling steps" } }, "required": ["type", "stepName", "rpcName"], "additionalProperties": false, "description": "RPC step metadata (base form)" }, "InputSource": { "anyOf": [{ "type": "object", "properties": { "from": { "type": "string", "const": "input" }, "path": { "type": "string" } }, "required": ["from", "path"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "outputVar" }, "name": { "type": "string" }, "path": { "type": "string" } }, "required": ["from", "name"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "item" }, "path": { "type": "string" } }, "required": ["from", "path"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "literal" }, "value": {} }, "required": ["from", "value"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "template" }, "parts": { "type": "array", "items": { "type": "string" } }, "expressions": { "type": "array", "items": { "$ref": "#/definitions/InputSource" } } }, "required": ["from", "parts", "expressions"], "additionalProperties": false }], "description": "Input source for step arguments in DSL workflows" }, "WorkflowStepOptions": { "type": "object", "properties": { "description": { "type": "string", "description": "Display name for logs/UI (optional, doesn't affect execution)" }, "retries": { "type": "number", "description": "Number of retry attempts for failed steps (only applies to local execution)" }, "retryDelay": { "type": ["string", "number"], "description": "Delay between retry attempts (e.g., '1s', '2s', '2min')" }, "actor": { "$ref": "#/definitions/UserFlowActor", "description": "Run this step as an actor (user flows). The RPC is sent through the actor's authenticated client over the REAL transport — never dispatched internally — so auth middleware and permissions are exercised end-to-end. The step is recorded durably like any RPC step." } }, "additionalProperties": false, "description": "Workflow step options" }, "UserFlowActor": { "type": "object", "properties": { "name": { "type": "string", "description": "Stable actor name (the key in pikku.config.json's actor registry)." }, "email": { "type": "string", "description": "The actor's user email — flows use it for invites/lookups." } }, "required": ["name", "email"], "additionalProperties": false, "description": "A user-flow actor: a synthetic user (a normal user row flagged `actor`) that workflow steps can run as. Passed to `workflow.do(step, rpc, data, { actor })` — the step then goes through the actor's authenticated client over the REAL transport (auth middleware, permissions, serialization all exercised), never through internal dispatch. Login is lazy: the first `invoke` signs the actor in and the session is cached for the actor's lifetime." }, "BranchStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "branch" }, "branches": { "type": "array", "items": { "$ref": "#/definitions/BranchCase" }, "description": "Branches in order: first is \"if\", rest are \"else if\"" }, "elseSteps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" }, "description": "Else branch steps (when no conditions match)" } }, "required": ["type", "branches"], "additionalProperties": false, "description": "Branch step metadata (if/else-if/else control flow)" }, "BranchCase": { "type": "object", "properties": { "condition": { "$ref": "#/definitions/Condition", "description": "Condition for this branch" }, "steps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" }, "description": "Steps to execute when condition is true" } }, "required": ["condition", "steps"], "additionalProperties": false, "description": "A single branch in an if/else-if chain" }, "Condition": { "anyOf": [{ "$ref": "#/definitions/SimpleCondition" }, { "type": "object", "properties": { "type": { "type": "string", "const": "and" }, "conditions": { "type": "array", "items": { "$ref": "#/definitions/Condition" } } }, "required": ["type", "conditions"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "or" }, "conditions": { "type": "array", "items": { "$ref": "#/definitions/Condition" } } }, "required": ["type", "conditions"], "additionalProperties": false }], "description": "Nested condition structure supporting AND/OR operations" }, "SimpleCondition": { "type": "object", "properties": { "type": { "type": "string", "const": "simple" }, "expression": { "type": "string" } }, "required": ["type", "expression"], "additionalProperties": false, "description": "Simple condition expression (leaf node)" }, "ParallelGroupStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "parallel" }, "children": { "type": "array", "items": { "$ref": "#/definitions/RpcStepMeta" }, "description": "Child steps to execute in parallel" } }, "required": ["type", "children"], "additionalProperties": false, "description": "Parallel group step metadata (Promise.all with multiple steps)" }, "FanoutStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "fanout" }, "stepName": { "type": "string", "description": "Step name for this fanout" }, "sourceVar": { "type": "string", "description": "Source array variable name" }, "itemVar": { "type": "string", "description": "Iterator variable name" }, "mode": { "type": "string", "enum": ["parallel", "sequential"], "description": "Execution mode" }, "child": { "$ref": "#/definitions/RpcStepMeta", "description": "Child step to execute per iteration" }, "timeBetween": { "type": "string", "description": "Time between iterations (sequential mode only)" } }, "required": ["type", "stepName", "sourceVar", "itemVar", "mode", "child"], "additionalProperties": false, "description": "Fanout step metadata (parallel or sequential iteration)" }, "ReturnStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "return" }, "outputs": { "type": "object", "additionalProperties": { "$ref": "#/definitions/OutputBinding" }, "description": "Output bindings" } }, "required": ["type", "outputs"], "additionalProperties": false, "description": "Return step metadata (workflow output)" }, "OutputBinding": { "anyOf": [{ "type": "object", "properties": { "from": { "type": "string", "const": "outputVar" }, "name": { "type": "string" }, "path": { "type": "string" } }, "required": ["from", "name"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "stateVar" }, "name": { "type": "string" }, "path": { "type": "string" } }, "required": ["from", "name"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "input" }, "path": { "type": "string" } }, "required": ["from", "path"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "literal" }, "value": {} }, "required": ["from", "value"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "expression" }, "expression": { "type": "string" } }, "required": ["from", "expression"], "additionalProperties": false }], "description": "Output binding for return statements in DSL workflows" }, "InlineStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "inline", "description": "Inline form - local execution" }, "stepName": { "type": "string", "description": "Cache key (stepName from workflow.do)" }, "description": { "type": "string", "description": "Display name" }, "options": { "$ref": "#/definitions/WorkflowStepOptions", "description": "Step options" } }, "required": ["type", "stepName"], "additionalProperties": false, "description": "Inline step metadata (legacy support)" }, "SleepStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "sleep", "description": "Sleep step" }, "stepName": { "type": "string", "description": "Cache key (stepName from workflow.sleep)" }, "duration": { "type": ["string", "number"], "description": "Sleep duration" } }, "required": ["type", "stepName", "duration"], "additionalProperties": false, "description": "Sleep step metadata" }, "CancelStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "cancel", "description": "Cancel step" }, "reason": { "type": "string", "description": "Optional cancellation reason" } }, "required": ["type"], "additionalProperties": false, "description": "Cancel step metadata" }, "SuspendStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "suspend" }, "reason": { "type": "string", "description": "Reason string passed to workflow.suspend() — becomes the durable step key" } }, "required": ["type", "reason"], "additionalProperties": false, "description": "Suspend step metadata (workflow.suspend())" }, "SwitchStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "switch" }, "expression": { "type": "string", "description": "Expression being switched on" }, "cases": { "type": "array", "items": { "$ref": "#/definitions/SwitchCaseMeta" }, "description": "Case branches" }, "defaultSteps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" }, "description": "Default case steps (optional)" } }, "required": ["type", "expression", "cases"], "additionalProperties": false, "description": "Switch step metadata (switch/case control flow)" }, "SwitchCaseMeta": { "type": "object", "properties": { "value": { "type": ["string", "number", "boolean", "null"], "description": "Case value (literal) or expression" }, "expression": { "type": "string", "description": "Case expression (for complex cases)" }, "steps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" }, "description": "Steps to execute for this case" } }, "required": ["steps"], "additionalProperties": false, "description": "Switch case metadata" }, "FilterStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "filter" }, "sourceVar": { "type": "string", "description": "Source array variable name" }, "itemVar": { "type": "string", "description": "Iterator variable name" }, "condition": { "$ref": "#/definitions/Condition", "description": "Filter condition" }, "outputVar": { "type": "string", "description": "Output variable name (if assigned)" } }, "required": ["type", "sourceVar", "itemVar", "condition"], "additionalProperties": false, "description": "Filter step metadata (array.filter)" }, "ArrayPredicateStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "arrayPredicate" }, "mode": { "type": "string", "enum": ["some", "every"], "description": "Predicate mode" }, "sourceVar": { "type": "string", "description": "Source array variable name" }, "itemVar": { "type": "string", "description": "Iterator variable name" }, "condition": { "$ref": "#/definitions/Condition", "description": "Predicate condition" }, "outputVar": { "type": "string", "description": "Output variable name (if assigned)" } }, "required": ["type", "mode", "sourceVar", "itemVar", "condition"], "additionalProperties": false, "description": "Array predicate step metadata (array.some, array.every)" }, "SetStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "set", "description": "Set step" }, "variable": { "type": "string", "description": "Variable name to set (must be in context)" }, "value": { "description": "Value to assign (literal or expression)" } }, "required": ["type", "variable", "value"], "additionalProperties": false, "description": "Set step metadata (context variable assignment)" }, "WorkflowContext": { "type": "object", "additionalProperties": { "$ref": "#/definitions/ContextVariable" }, "description": "Workflow context - state variables with defaults and types" }, "ContextVariable": { "type": "object", "properties": { "type": { "type": "string", "enum": ["string", "number", "boolean", "object", "array"], "description": "Variable type" }, "default": { "description": "Default value" }, "description": { "type": "string", "description": "Description for UI/docs" } }, "required": ["type"], "additionalProperties": false, "description": "Context variable definition (serialized from Zod schema or type inference)" }, "MiddlewareMetadata": { "anyOf": [{ "type": "object", "properties": { "type": { "type": "string", "const": "http" }, "route": { "type": "string" } }, "required": ["type", "route"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tag" }, "tag": { "type": "string" } }, "required": ["type", "tag"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wire" }, "name": { "type": "string" }, "inline": { "type": "boolean" } }, "required": ["type", "name"], "additionalProperties": false }], "description": "Metadata for middleware at any level\n- type: 'http' = HTTP route middleware group (references httpGroup in pikkuState)\n- type: 'tag' = Tag-based middleware group (references tagGroup in pikkuState)\n- type: 'wire' = Wire-level individual middleware" }, "PermissionMetadata": { "anyOf": [{ "type": "object", "properties": { "type": { "type": "string", "const": "http" }, "route": { "type": "string" } }, "required": ["type", "route"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tag" }, "tag": { "type": "string" } }, "required": ["type", "tag"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wire" }, "name": { "type": "string" }, "inline": { "type": "boolean" } }, "required": ["type", "name"], "additionalProperties": false }], "description": "Metadata for permissions at any level\n- type: 'http' = HTTP route permission group (references httpGroup in pikkuState)\n- type: 'tag' = Tag-based permission group (references tagGroup in pikkuState)\n- type: 'wire' = Wire-level individual permission" } } }
|
|
1
|
+
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "name": { "type": "string" }, "steps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" } }, "context": { "$ref": "#/definitions/WorkflowContext" }, "dsl": { "type": "boolean" }, "expose": { "type": "boolean" }, "scenario": { "type": "boolean" }, "actors": { "type": "array", "items": { "type": "string" } }, "pikkuFuncId": { "type": "string" }, "packageName": { "type": "string" }, "title": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "summary": { "type": "string" }, "description": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } } }, "required": ["name", "pikkuFuncId", "steps"], "definitions": { "WorkflowStepMeta": { "anyOf": [{ "$ref": "#/definitions/RpcStepMeta" }, { "$ref": "#/definitions/BranchStepMeta" }, { "$ref": "#/definitions/ParallelGroupStepMeta" }, { "$ref": "#/definitions/FanoutStepMeta" }, { "$ref": "#/definitions/ReturnStepMeta" }, { "$ref": "#/definitions/InlineStepMeta" }, { "$ref": "#/definitions/SleepStepMeta" }, { "$ref": "#/definitions/CancelStepMeta" }, { "$ref": "#/definitions/SuspendStepMeta" }, { "$ref": "#/definitions/SwitchStepMeta" }, { "$ref": "#/definitions/FilterStepMeta" }, { "$ref": "#/definitions/ArrayPredicateStepMeta" }, { "$ref": "#/definitions/SetStepMeta" }], "description": "Workflow step metadata (extracted by inspector)" }, "RpcStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "rpc", "description": "RPC form - generates queue worker" }, "stepName": { "type": "string", "description": "Cache key (stepName from workflow.do)" }, "rpcName": { "type": "string", "description": "RPC to invoke" }, "outputVar": { "type": "string", "description": "Output variable name (if assigned)" }, "inputs": { "anyOf": [{ "type": "object", "additionalProperties": { "$ref": "#/definitions/InputSource" } }, { "type": "string", "const": "passthrough" }], "description": "Input source mappings, or 'passthrough' when entire data is passed" }, "options": { "$ref": "#/definitions/WorkflowStepOptions", "description": "Step options" }, "actor": { "type": "string", "description": "Scenario actor name this step runs as ({ actor: actors.x })" }, "expectEventually": { "type": "boolean", "description": "True for workflow.expectEventually polling steps" } }, "required": ["type", "stepName", "rpcName"], "additionalProperties": false, "description": "RPC step metadata (base form)" }, "InputSource": { "anyOf": [{ "type": "object", "properties": { "from": { "type": "string", "const": "input" }, "path": { "type": "string" } }, "required": ["from", "path"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "outputVar" }, "name": { "type": "string" }, "path": { "type": "string" } }, "required": ["from", "name"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "item" }, "path": { "type": "string" } }, "required": ["from", "path"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "literal" }, "value": {} }, "required": ["from", "value"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "template" }, "parts": { "type": "array", "items": { "type": "string" } }, "expressions": { "type": "array", "items": { "$ref": "#/definitions/InputSource" } } }, "required": ["from", "parts", "expressions"], "additionalProperties": false }], "description": "Input source for step arguments in DSL workflows" }, "WorkflowStepOptions": { "type": "object", "properties": { "description": { "type": "string", "description": "Display name for logs/UI (optional, doesn't affect execution)" }, "retries": { "type": "number", "description": "Number of retry attempts for failed steps (only applies to local execution)" }, "retryDelay": { "type": ["string", "number"], "description": "Delay between retry attempts (e.g., '1s', '2s', '2min')" }, "actor": { "$ref": "#/definitions/ScenarioActor", "description": "Run this step as an actor (scenarios). The RPC is sent through the actor's authenticated client over the REAL transport — never dispatched internally — so auth middleware and permissions are exercised end-to-end. The step is recorded durably like any RPC step." } }, "additionalProperties": false, "description": "Workflow step options" }, "ScenarioActor": { "type": "object", "properties": { "name": { "type": "string", "description": "Stable actor name (the key in pikku.config.json's actor registry)." }, "email": { "type": "string", "description": "The actor's user email — flows use it for invites/lookups." } }, "required": ["name", "email"], "additionalProperties": false, "description": "A synthetic user (a user row flagged `actor`) that workflow steps run as over the real transport" }, "BranchStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "branch" }, "branches": { "type": "array", "items": { "$ref": "#/definitions/BranchCase" }, "description": "Branches in order: first is \"if\", rest are \"else if\"" }, "elseSteps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" }, "description": "Else branch steps (when no conditions match)" } }, "required": ["type", "branches"], "additionalProperties": false, "description": "Branch step metadata (if/else-if/else control flow)" }, "BranchCase": { "type": "object", "properties": { "condition": { "$ref": "#/definitions/Condition", "description": "Condition for this branch" }, "steps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" }, "description": "Steps to execute when condition is true" } }, "required": ["condition", "steps"], "additionalProperties": false, "description": "A single branch in an if/else-if chain" }, "Condition": { "anyOf": [{ "$ref": "#/definitions/SimpleCondition" }, { "type": "object", "properties": { "type": { "type": "string", "const": "and" }, "conditions": { "type": "array", "items": { "$ref": "#/definitions/Condition" } } }, "required": ["type", "conditions"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "or" }, "conditions": { "type": "array", "items": { "$ref": "#/definitions/Condition" } } }, "required": ["type", "conditions"], "additionalProperties": false }], "description": "Nested condition structure supporting AND/OR operations" }, "SimpleCondition": { "type": "object", "properties": { "type": { "type": "string", "const": "simple" }, "expression": { "type": "string" } }, "required": ["type", "expression"], "additionalProperties": false, "description": "Simple condition expression (leaf node)" }, "ParallelGroupStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "parallel" }, "children": { "type": "array", "items": { "$ref": "#/definitions/RpcStepMeta" }, "description": "Child steps to execute in parallel" } }, "required": ["type", "children"], "additionalProperties": false, "description": "Parallel group step metadata (Promise.all with multiple steps)" }, "FanoutStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "fanout" }, "stepName": { "type": "string", "description": "Step name for this fanout" }, "sourceVar": { "type": "string", "description": "Source array variable name" }, "itemVar": { "type": "string", "description": "Iterator variable name" }, "mode": { "type": "string", "enum": ["parallel", "sequential"], "description": "Execution mode" }, "child": { "$ref": "#/definitions/RpcStepMeta", "description": "Child step to execute per iteration" }, "timeBetween": { "type": "string", "description": "Time between iterations (sequential mode only)" } }, "required": ["type", "stepName", "sourceVar", "itemVar", "mode", "child"], "additionalProperties": false, "description": "Fanout step metadata (parallel or sequential iteration)" }, "ReturnStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "return" }, "outputs": { "type": "object", "additionalProperties": { "$ref": "#/definitions/OutputBinding" }, "description": "Output bindings" } }, "required": ["type", "outputs"], "additionalProperties": false, "description": "Return step metadata (workflow output)" }, "OutputBinding": { "anyOf": [{ "type": "object", "properties": { "from": { "type": "string", "const": "outputVar" }, "name": { "type": "string" }, "path": { "type": "string" } }, "required": ["from", "name"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "stateVar" }, "name": { "type": "string" }, "path": { "type": "string" } }, "required": ["from", "name"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "input" }, "path": { "type": "string" } }, "required": ["from", "path"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "literal" }, "value": {} }, "required": ["from", "value"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "expression" }, "expression": { "type": "string" } }, "required": ["from", "expression"], "additionalProperties": false }], "description": "Output binding for return statements in DSL workflows" }, "InlineStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "inline", "description": "Inline form - local execution" }, "stepName": { "type": "string", "description": "Cache key (stepName from workflow.do)" }, "description": { "type": "string", "description": "Display name" }, "options": { "$ref": "#/definitions/WorkflowStepOptions", "description": "Step options" } }, "required": ["type", "stepName"], "additionalProperties": false, "description": "Inline step metadata (legacy support)" }, "SleepStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "sleep", "description": "Sleep step" }, "stepName": { "type": "string", "description": "Cache key (stepName from workflow.sleep)" }, "duration": { "type": ["string", "number"], "description": "Sleep duration" } }, "required": ["type", "stepName", "duration"], "additionalProperties": false, "description": "Sleep step metadata" }, "CancelStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "cancel", "description": "Cancel step" }, "reason": { "type": "string", "description": "Optional cancellation reason" } }, "required": ["type"], "additionalProperties": false, "description": "Cancel step metadata" }, "SuspendStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "suspend" }, "reason": { "type": "string", "description": "Reason string passed to workflow.suspend() — becomes the durable step key" } }, "required": ["type", "reason"], "additionalProperties": false, "description": "Suspend step metadata (workflow.suspend())" }, "SwitchStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "switch" }, "expression": { "type": "string", "description": "Expression being switched on" }, "cases": { "type": "array", "items": { "$ref": "#/definitions/SwitchCaseMeta" }, "description": "Case branches" }, "defaultSteps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" }, "description": "Default case steps (optional)" } }, "required": ["type", "expression", "cases"], "additionalProperties": false, "description": "Switch step metadata (switch/case control flow)" }, "SwitchCaseMeta": { "type": "object", "properties": { "value": { "type": ["string", "number", "boolean", "null"], "description": "Case value (literal) or expression" }, "expression": { "type": "string", "description": "Case expression (for complex cases)" }, "steps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" }, "description": "Steps to execute for this case" } }, "required": ["steps"], "additionalProperties": false, "description": "Switch case metadata" }, "FilterStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "filter" }, "sourceVar": { "type": "string", "description": "Source array variable name" }, "itemVar": { "type": "string", "description": "Iterator variable name" }, "condition": { "$ref": "#/definitions/Condition", "description": "Filter condition" }, "outputVar": { "type": "string", "description": "Output variable name (if assigned)" } }, "required": ["type", "sourceVar", "itemVar", "condition"], "additionalProperties": false, "description": "Filter step metadata (array.filter)" }, "ArrayPredicateStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "arrayPredicate" }, "mode": { "type": "string", "enum": ["some", "every"], "description": "Predicate mode" }, "sourceVar": { "type": "string", "description": "Source array variable name" }, "itemVar": { "type": "string", "description": "Iterator variable name" }, "condition": { "$ref": "#/definitions/Condition", "description": "Predicate condition" }, "outputVar": { "type": "string", "description": "Output variable name (if assigned)" } }, "required": ["type", "mode", "sourceVar", "itemVar", "condition"], "additionalProperties": false, "description": "Array predicate step metadata (array.some, array.every)" }, "SetStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "set", "description": "Set step" }, "variable": { "type": "string", "description": "Variable name to set (must be in context)" }, "value": { "description": "Value to assign (literal or expression)" } }, "required": ["type", "variable", "value"], "additionalProperties": false, "description": "Set step metadata (context variable assignment)" }, "WorkflowContext": { "type": "object", "additionalProperties": { "$ref": "#/definitions/ContextVariable" }, "description": "Workflow context - state variables with defaults and types" }, "ContextVariable": { "type": "object", "properties": { "type": { "type": "string", "enum": ["string", "number", "boolean", "object", "array"], "description": "Variable type" }, "default": { "description": "Default value" }, "description": { "type": "string", "description": "Description for UI/docs" } }, "required": ["type"], "additionalProperties": false, "description": "Context variable definition (serialized from Zod schema or type inference)" }, "MiddlewareMetadata": { "anyOf": [{ "type": "object", "properties": { "type": { "type": "string", "const": "http" }, "route": { "type": "string" } }, "required": ["type", "route"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tag" }, "tag": { "type": "string" } }, "required": ["type", "tag"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wire" }, "name": { "type": "string" }, "inline": { "type": "boolean" } }, "required": ["type", "name"], "additionalProperties": false }], "description": "Metadata for middleware at any level\n- type: 'http' = HTTP route middleware group (references httpGroup in pikkuState)\n- type: 'tag' = Tag-based middleware group (references tagGroup in pikkuState)\n- type: 'wire' = Wire-level individual middleware" }, "PermissionMetadata": { "anyOf": [{ "type": "object", "properties": { "type": { "type": "string", "const": "http" }, "route": { "type": "string" } }, "required": ["type", "route"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tag" }, "tag": { "type": "string" } }, "required": ["type", "tag"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wire" }, "name": { "type": "string" }, "inline": { "type": "boolean" } }, "required": ["type", "name"], "additionalProperties": false }], "description": "Metadata for permissions at any level\n- type: 'http' = HTTP route permission group (references httpGroup in pikkuState)\n- type: 'tag' = Tag-based permission group (references tagGroup in pikkuState)\n- type: 'wire' = Wire-level individual permission" } } }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "enabled": { "type": "boolean" } }, "required": ["enabled"], "additionalProperties": false, "definitions": {} }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "enabled": { "type": "boolean" } }, "required": ["enabled"], "additionalProperties": false, "definitions": {} }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.70
|
|
3
3
|
*/
|
|
4
4
|
export { wireVariable } from '@pikku/core/variable';
|
|
5
5
|
export type { CoreVariable, VariableDefinitionMeta, VariableDefinitionsMeta } from '@pikku/core/variable';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.70
|
|
3
3
|
*/
|
|
4
4
|
import { WorkflowCancelledException } from '@pikku/core/workflow';
|
|
5
5
|
import { template } from '@pikku/core/workflow';
|
|
@@ -48,13 +48,13 @@ export declare function pikkuWorkflowFunc<In, Out = unknown>(func: PikkuFunction
|
|
|
48
48
|
export declare function pikkuWorkflowComplexFunc<InputSchema extends StandardSchemaV1 | undefined = undefined, OutputSchema extends StandardSchemaV1 | undefined = undefined>(config: PikkuWorkflowConfigWithSchema<InputSchema, OutputSchema>): PikkuFunctionConfig<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, 'workflow', PikkuFunctionWorkflow<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown>, InputSchema, OutputSchema>;
|
|
49
49
|
export declare function pikkuWorkflowComplexFunc<In, Out = unknown>(func: PikkuFunctionWorkflow<In, Out> | PikkuFunctionConfig<In, Out, 'workflow', PikkuFunctionWorkflow<In, Out>>): PikkuFunctionConfig<In, Out, 'workflow'>;
|
|
50
50
|
/**
|
|
51
|
-
* A
|
|
51
|
+
* A scenario: a complex workflow that drives the app the way users do.
|
|
52
52
|
* Steps run as actors over the REAL transport — `workflow.do(step, rpc,
|
|
53
53
|
* data, { actor: actors.yasser })` — so flows double as e2e tests and
|
|
54
54
|
* staged/production health checks (no state reset; scope what you create).
|
|
55
55
|
*/
|
|
56
|
-
export declare function
|
|
57
|
-
export declare function
|
|
56
|
+
export declare function pikkuScenario<InputSchema extends StandardSchemaV1 | undefined = undefined, OutputSchema extends StandardSchemaV1 | undefined = undefined>(config: PikkuWorkflowConfigWithSchema<InputSchema, OutputSchema>): PikkuFunctionConfig<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, 'workflow', PikkuFunctionWorkflow<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown>, InputSchema, OutputSchema>;
|
|
57
|
+
export declare function pikkuScenario<In, Out = unknown>(func: PikkuFunctionWorkflow<In, Out> | PikkuFunctionConfig<In, Out, 'workflow', PikkuFunctionWorkflow<In, Out>>): PikkuFunctionConfig<In, Out, 'workflow'>;
|
|
58
58
|
type TypedRef<T> = {
|
|
59
59
|
$ref: string;
|
|
60
60
|
path?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.70
|
|
3
3
|
*/
|
|
4
4
|
import { WorkflowCancelledException } from '@pikku/core/workflow';
|
|
5
5
|
import { template } from '@pikku/core/workflow';
|
|
@@ -12,7 +12,7 @@ export function pikkuWorkflowFunc(func) {
|
|
|
12
12
|
export function pikkuWorkflowComplexFunc(func) {
|
|
13
13
|
return typeof func === 'function' ? { func } : func;
|
|
14
14
|
}
|
|
15
|
-
export function
|
|
15
|
+
export function pikkuScenario(func) {
|
|
16
16
|
return typeof func === 'function' ? { func } : func;
|
|
17
17
|
}
|
|
18
18
|
export function pikkuWorkflowGraph(config) {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface StubCallEntry {
|
|
2
|
+
service: string;
|
|
3
|
+
method: string;
|
|
4
|
+
args: unknown[];
|
|
5
|
+
}
|
|
6
|
+
export declare const getStubCalls: import("#pikku").PikkuFunctionConfig<{
|
|
7
|
+
service?: string;
|
|
8
|
+
}, StubCallEntry[], "rpc" | "session", import("#pikku").PikkuFunction<{
|
|
9
|
+
service?: string;
|
|
10
|
+
}, StubCallEntry[], "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunctionSessionless<{
|
|
11
|
+
service?: string;
|
|
12
|
+
}, StubCallEntry[], "rpc" | "session", import("#pikku").Services>, undefined, undefined>;
|
|
13
|
+
//# sourceMappingURL=get-stub-calls.function.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-stub-calls.function.d.ts","sourceRoot":"","sources":["../../../src/functions/get-stub-calls.function.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,OAAO,EAAE,CAAA;CAChB;AAED,eAAO,MAAM,YAAY;cAAyB,MAAM;;cAAN,MAAM;;cAAN,MAAM;wFAQtD,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { pikkuFunc } from '#pikku';
|
|
2
|
+
import { getStubTracker } from '@pikku/core/services';
|
|
3
|
+
export const getStubCalls = pikkuFunc({
|
|
4
|
+
title: 'Get Stub Calls',
|
|
5
|
+
description: 'Returns calls recorded against stubbed/spied services (via the stub()/spy() core utils). Empty unless the server records service calls (pikku dev --test).',
|
|
6
|
+
expose: true,
|
|
7
|
+
func: async (_services, data) => {
|
|
8
|
+
return getStubTracker().getCalls(data?.service ?? undefined);
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=get-stub-calls.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-stub-calls.function.js","sourceRoot":"","sources":["../../../src/functions/get-stub-calls.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAQrD,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAwC;IAC3E,KAAK,EAAE,gBAAgB;IACvB,WAAW,EACT,4JAA4J;IAC9J,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE;QAC9B,OAAO,cAAc,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,IAAI,SAAS,CAAC,CAAA;IAC9D,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -6,7 +6,7 @@ export declare const getWorkflowMetaById: import("#pikku").PikkuFunctionConfig<{
|
|
|
6
6
|
context?: import("@pikku/core/workflow").WorkflowContext;
|
|
7
7
|
dsl?: boolean;
|
|
8
8
|
expose?: boolean;
|
|
9
|
-
|
|
9
|
+
scenario?: boolean;
|
|
10
10
|
actors?: string[];
|
|
11
11
|
}) | null, "rpc" | "session", import("#pikku").PikkuFunction<{
|
|
12
12
|
workflowId: string;
|
|
@@ -16,7 +16,7 @@ export declare const getWorkflowMetaById: import("#pikku").PikkuFunctionConfig<{
|
|
|
16
16
|
context?: import("@pikku/core/workflow").WorkflowContext;
|
|
17
17
|
dsl?: boolean;
|
|
18
18
|
expose?: boolean;
|
|
19
|
-
|
|
19
|
+
scenario?: boolean;
|
|
20
20
|
actors?: string[];
|
|
21
21
|
}) | null, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunctionSessionless<{
|
|
22
22
|
workflowId: string;
|
|
@@ -26,7 +26,7 @@ export declare const getWorkflowMetaById: import("#pikku").PikkuFunctionConfig<{
|
|
|
26
26
|
context?: import("@pikku/core/workflow").WorkflowContext;
|
|
27
27
|
dsl?: boolean;
|
|
28
28
|
expose?: boolean;
|
|
29
|
-
|
|
29
|
+
scenario?: boolean;
|
|
30
30
|
actors?: string[];
|
|
31
31
|
}) | null, "rpc" | "session", import("#pikku").Services>, undefined, undefined>;
|
|
32
32
|
//# sourceMappingURL=get-workflow-meta-by-id.function.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const resetLiveCoverage: import("#pikku").PikkuFunctionConfig<null, {
|
|
2
|
+
enabled: boolean;
|
|
3
|
+
}, "rpc" | "session", import("#pikku").PikkuFunction<null, {
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
}, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunctionSessionless<null, {
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
}, "rpc" | "session", import("#pikku").Services>, undefined, undefined>;
|
|
8
|
+
//# sourceMappingURL=reset-live-coverage.function.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reset-live-coverage.function.d.ts","sourceRoot":"","sources":["../../../src/functions/reset-live-coverage.function.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB;aAA8B,OAAO;;aAAP,OAAO;;aAAP,OAAO;uEAUjE,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { pikkuFunc } from '#pikku';
|
|
2
|
+
export const resetLiveCoverage = pikkuFunc({
|
|
3
|
+
title: 'Reset Live Coverage',
|
|
4
|
+
description: 'Clears V8 precise-coverage call counts so the next takeLiveCoverage snapshot is attributable to a single scenario run. Reports enabled: false when the server was not started with coverage enabled.',
|
|
5
|
+
expose: true,
|
|
6
|
+
func: async ({ coverageService }) => {
|
|
7
|
+
if (!coverageService)
|
|
8
|
+
return { enabled: false };
|
|
9
|
+
await coverageService.reset();
|
|
10
|
+
return { enabled: true };
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=reset-live-coverage.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reset-live-coverage.function.js","sourceRoot":"","sources":["../../../src/functions/reset-live-coverage.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAElC,MAAM,CAAC,MAAM,iBAAiB,GAAG,SAAS,CAA6B;IACrE,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EACT,sMAAsM;IACxM,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,KAAK,EAAE,EAAE,eAAe,EAAE,EAAE,EAAE;QAClC,IAAI,CAAC,eAAe;YAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAA;QAC/C,MAAM,eAAe,CAAC,KAAK,EAAE,CAAA;QAC7B,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;IAC1B,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const resetStubs: import("#pikku").PikkuFunctionConfig<null, {
|
|
2
|
+
enabled: boolean;
|
|
3
|
+
}, "rpc" | "session", import("#pikku").PikkuFunction<null, {
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
}, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunctionSessionless<null, {
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
}, "rpc" | "session", import("#pikku").Services>, undefined, undefined>;
|
|
8
|
+
//# sourceMappingURL=reset-stubs.function.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reset-stubs.function.d.ts","sourceRoot":"","sources":["../../../src/functions/reset-stubs.function.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU;aAA8B,OAAO;;aAAP,OAAO;;aAAP,OAAO;uEAS1D,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { pikkuFunc } from '#pikku';
|
|
2
|
+
import { getStubTracker, isTestRun } from '@pikku/core/services';
|
|
3
|
+
export const resetStubs = pikkuFunc({
|
|
4
|
+
title: 'Reset Stubs',
|
|
5
|
+
description: 'Clears recorded stub calls so the next getStubCalls result is attributable to a single scenario run. Reports enabled: false when the server was not started in test mode.',
|
|
6
|
+
expose: true,
|
|
7
|
+
func: async () => {
|
|
8
|
+
getStubTracker().reset();
|
|
9
|
+
return { enabled: isTestRun() };
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=reset-stubs.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reset-stubs.function.js","sourceRoot":"","sources":["../../../src/functions/reset-stubs.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAClC,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAEhE,MAAM,CAAC,MAAM,UAAU,GAAG,SAAS,CAA6B;IAC9D,KAAK,EAAE,aAAa;IACpB,WAAW,EACT,2KAA2K;IAC7K,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,KAAK,IAAI,EAAE;QACf,cAAc,EAAE,CAAC,KAAK,EAAE,CAAA;QACxB,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,CAAA;IACjC,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { FunctionCoverageReport } from './get-function-coverage.function.js';
|
|
2
|
+
export declare const takeLiveCoverage: import("#pikku").PikkuFunctionConfig<null, FunctionCoverageReport | null, "rpc" | "session", import("#pikku").PikkuFunction<null, FunctionCoverageReport | null, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunctionSessionless<null, FunctionCoverageReport | null, "rpc" | "session", import("#pikku").Services>, undefined, undefined>;
|
|
3
|
+
//# sourceMappingURL=take-live-coverage.function.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"take-live-coverage.function.d.ts","sourceRoot":"","sources":["../../../src/functions/take-live-coverage.function.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAA;AAOjF,eAAO,MAAM,gBAAgB,sWAiC3B,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { pikkuFunc } from '#pikku';
|
|
2
|
+
import { mapPreciseCoverage, mapLineHitsToReport, } from '../lib/precise-coverage-map.js';
|
|
3
|
+
export const takeLiveCoverage = pikkuFunc({
|
|
4
|
+
title: 'Take Live Coverage',
|
|
5
|
+
description: 'Snapshots the live coverage collected since the server started (or since the last resetLiveCoverage) — V8 precise coverage on Node, istanbul instrumentation on Bun — and maps it onto function body spans. Returns null unless the server was started with coverage enabled (pikku dev --coverage).',
|
|
6
|
+
expose: true,
|
|
7
|
+
func: async ({ coverageService, metaService }) => {
|
|
8
|
+
if (!coverageService || !metaService?.basePath)
|
|
9
|
+
return null;
|
|
10
|
+
const { readFile } = await import('node:fs/promises');
|
|
11
|
+
const { join } = await import('node:path');
|
|
12
|
+
let functionsMeta;
|
|
13
|
+
try {
|
|
14
|
+
const content = await readFile(join(metaService.basePath, 'function', 'pikku-functions-meta-verbose.gen.json'), 'utf-8');
|
|
15
|
+
functionsMeta = JSON.parse(content);
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
const snapshot = await coverageService.takeCoverage();
|
|
21
|
+
if (snapshot.kind === 'line-hits') {
|
|
22
|
+
return mapLineHitsToReport(snapshot.lineHits, functionsMeta);
|
|
23
|
+
}
|
|
24
|
+
return mapPreciseCoverage(snapshot.scripts, snapshot.getScriptSource, functionsMeta);
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=take-live-coverage.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"take-live-coverage.function.js","sourceRoot":"","sources":["../../../src/functions/take-live-coverage.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAElC,OAAO,EACL,kBAAkB,EAClB,mBAAmB,GAEpB,MAAM,gCAAgC,CAAA;AAEvC,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAS,CAAsC;IAC7E,KAAK,EAAE,oBAAoB;IAC3B,WAAW,EACT,sSAAsS;IACxS,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,KAAK,EAAE,EAAE,eAAe,EAAE,WAAW,EAAE,EAAE,EAAE;QAC/C,IAAI,CAAC,eAAe,IAAI,CAAC,WAAW,EAAE,QAAQ;YAAE,OAAO,IAAI,CAAA;QAC3D,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,CAAA;QACrD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,CAAA;QAC1C,IAAI,aAAmD,CAAA;QACvD,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,QAAQ,CAC5B,IAAI,CACF,WAAW,CAAC,QAAQ,EACpB,UAAU,EACV,uCAAuC,CACxC,EACD,OAAO,CACR,CAAA;YACD,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QACrC,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAA;QACb,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,eAAe,CAAC,YAAY,EAAE,CAAA;QACrD,IAAI,QAAQ,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;YAClC,OAAO,mBAAmB,CAAC,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAA;QAC9D,CAAC;QACD,OAAO,kBAAkB,CACvB,QAAQ,CAAC,OAAO,EAChB,QAAQ,CAAC,eAAe,EACxB,aAAa,CACd,CAAA;IACH,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { FunctionCoverageReport } from '../functions/get-function-coverage.function.js';
|
|
2
|
+
interface CoverageRange {
|
|
3
|
+
startOffset: number;
|
|
4
|
+
endOffset: number;
|
|
5
|
+
count: number;
|
|
6
|
+
}
|
|
7
|
+
interface FunctionCoverage {
|
|
8
|
+
functionName: string;
|
|
9
|
+
isBlockCoverage: boolean;
|
|
10
|
+
ranges: CoverageRange[];
|
|
11
|
+
}
|
|
12
|
+
export interface ScriptCoverageInput {
|
|
13
|
+
scriptId: string;
|
|
14
|
+
url: string;
|
|
15
|
+
functions: FunctionCoverage[];
|
|
16
|
+
}
|
|
17
|
+
export interface CoverageFunctionMeta {
|
|
18
|
+
name: string;
|
|
19
|
+
sourceFile: string;
|
|
20
|
+
bodySourceFile?: string;
|
|
21
|
+
exportedName?: string;
|
|
22
|
+
expose?: boolean;
|
|
23
|
+
description?: string | null;
|
|
24
|
+
bodyStart?: number;
|
|
25
|
+
bodyEnd?: number;
|
|
26
|
+
}
|
|
27
|
+
export declare function mapPreciseCoverage(scripts: ScriptCoverageInput[], getScriptSource: (scriptId: string) => Promise<string>, functionsMeta: Record<string, CoverageFunctionMeta>): Promise<FunctionCoverageReport>;
|
|
28
|
+
export declare function mapLineHitsToReport(lineHits: Map<string, Map<number, number>>, functionsMeta: Record<string, CoverageFunctionMeta>): FunctionCoverageReport;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=precise-coverage-map.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"precise-coverage-map.d.ts","sourceRoot":"","sources":["../../../src/lib/precise-coverage-map.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAEV,sBAAsB,EACvB,MAAM,gDAAgD,CAAA;AAEvD,UAAU,aAAa;IACrB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,UAAU,gBAAgB;IACxB,YAAY,EAAE,MAAM,CAAA;IACpB,eAAe,EAAE,OAAO,CAAA;IACxB,MAAM,EAAE,aAAa,EAAE,CAAA;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAA;IAChB,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,EAAE,gBAAgB,EAAE,CAAA;CAC9B;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAiHD,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,mBAAmB,EAAE,EAC9B,eAAe,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,EACtD,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAClD,OAAO,CAAC,sBAAsB,CAAC,CAMjC;AAED,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAC1C,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAClD,sBAAsB,CA4DxB"}
|