@pikku/inspector 0.12.13 → 0.12.16
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/CHANGELOG.md +48 -0
- package/dist/add/add-ai-agent.js +1 -1
- package/dist/add/add-auth.d.ts +2 -0
- package/dist/add/add-auth.js +34 -0
- package/dist/add/add-channel.js +25 -7
- package/dist/add/add-functions.js +28 -13
- package/dist/add/add-gateway.js +1 -1
- package/dist/add/add-http-route.js +23 -1
- package/dist/add/add-mcp-prompt.js +1 -1
- package/dist/add/add-mcp-resource.js +1 -1
- package/dist/add/add-queue-worker.js +1 -1
- package/dist/add/add-schedule.js +1 -1
- package/dist/add/add-trigger.js +1 -1
- package/dist/add/add-workflow.js +1 -1
- package/dist/inspector.js +4 -0
- package/dist/types.d.ts +4 -0
- package/dist/utils/check-pii-output.d.ts +13 -8
- package/dist/utils/check-pii-output.js +22 -12
- package/dist/utils/ensure-function-metadata.js +1 -1
- package/dist/utils/extract-node-value.d.ts +1 -1
- package/dist/utils/extract-node-value.js +10 -1
- package/dist/utils/get-property-value.d.ts +1 -1
- package/dist/utils/get-property-value.js +35 -9
- package/dist/utils/serialize-inspector-state.d.ts +4 -0
- package/dist/utils/serialize-inspector-state.js +8 -0
- package/dist/utils/workflow/dsl/extract-dsl-workflow.js +20 -9
- package/dist/visit.js +2 -0
- package/package.json +2 -2
- package/src/add/add-ai-agent.ts +1 -1
- package/src/add/add-auth.test.ts +175 -0
- package/src/add/add-auth.ts +49 -0
- package/src/add/add-channel.ts +37 -7
- package/src/add/add-functions.ts +44 -13
- package/src/add/add-gateway.ts +1 -1
- package/src/add/add-http-route.ts +26 -1
- package/src/add/add-mcp-prompt.ts +1 -1
- package/src/add/add-mcp-resource.ts +1 -1
- package/src/add/add-queue-worker.ts +1 -1
- package/src/add/add-schedule.ts +1 -1
- package/src/add/add-trigger.ts +1 -1
- package/src/add/add-workflow.test.ts +152 -0
- package/src/add/add-workflow.ts +2 -1
- package/src/add/pii-check.test.ts +79 -32
- package/src/inspector.ts +4 -0
- package/src/types.ts +4 -0
- package/src/utils/check-pii-output.ts +41 -19
- package/src/utils/ensure-function-metadata.ts +3 -1
- package/src/utils/extract-node-value.test.ts +12 -10
- package/src/utils/extract-node-value.ts +15 -1
- package/src/utils/get-property-value.ts +33 -13
- package/src/utils/serialize-inspector-state.ts +12 -0
- package/src/utils/workflow/dsl/extract-dsl-workflow.ts +22 -9
- package/src/visit.ts +2 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -436,21 +436,34 @@ function extractExpressionStatement(
|
|
|
436
436
|
outputVar = expr.left.text
|
|
437
437
|
|
|
438
438
|
// Check if this is an assignment to a context variable (set step)
|
|
439
|
+
// But if the RHS is a workflow.do() call, fall through to RPC extraction —
|
|
440
|
+
// reassigning a pre-declared variable with a workflow step is valid and common.
|
|
439
441
|
if (context.contextVars.has(outputVar)) {
|
|
440
|
-
const
|
|
441
|
-
|
|
442
|
+
const rhs = expr.right
|
|
443
|
+
const rhsCall =
|
|
444
|
+
ts.isAwaitExpression(rhs) && ts.isCallExpression(rhs.expression)
|
|
445
|
+
? rhs.expression
|
|
446
|
+
: null
|
|
447
|
+
const isWorkflowCall = rhsCall
|
|
448
|
+
? isWorkflowDoCall(rhsCall, context.checker)
|
|
449
|
+
: false
|
|
450
|
+
|
|
451
|
+
if (!isWorkflowCall) {
|
|
452
|
+
const literalValue = extractLiteralValue(expr.right)
|
|
453
|
+
if (literalValue !== undefined) {
|
|
454
|
+
return {
|
|
455
|
+
type: 'set',
|
|
456
|
+
variable: outputVar,
|
|
457
|
+
value: literalValue,
|
|
458
|
+
} as SetStepMeta
|
|
459
|
+
}
|
|
460
|
+
// Non-literal assignment to context var - use expression as string
|
|
442
461
|
return {
|
|
443
462
|
type: 'set',
|
|
444
463
|
variable: outputVar,
|
|
445
|
-
value:
|
|
464
|
+
value: getSourceText(expr.right),
|
|
446
465
|
} as SetStepMeta
|
|
447
466
|
}
|
|
448
|
-
// Non-literal assignment to context var - use expression as string
|
|
449
|
-
return {
|
|
450
|
-
type: 'set',
|
|
451
|
-
variable: outputVar,
|
|
452
|
-
value: getSourceText(expr.right),
|
|
453
|
-
} as SetStepMeta
|
|
454
467
|
}
|
|
455
468
|
}
|
|
456
469
|
// Use right side as the expression to extract from
|
package/src/visit.ts
CHANGED
|
@@ -22,6 +22,7 @@ import { addWireAddon } from './add/add-wire-addon.js'
|
|
|
22
22
|
import { addMiddleware } from './add/add-middleware.js'
|
|
23
23
|
import { addPermission } from './add/add-permission.js'
|
|
24
24
|
import { addCLI, addCLIRenderers } from './add/add-cli.js'
|
|
25
|
+
import { addAuth } from './add/add-auth.js'
|
|
25
26
|
import { addSecret } from './add/add-secret.js'
|
|
26
27
|
import { addCredential } from './add/add-credential.js'
|
|
27
28
|
import { addVariable } from './add/add-variable.js'
|
|
@@ -106,6 +107,7 @@ export const visitRoutes = (
|
|
|
106
107
|
options: InspectorOptions
|
|
107
108
|
) => {
|
|
108
109
|
addFunctions(logger, node, checker, state, options)
|
|
110
|
+
addAuth(logger, node, checker, state, options)
|
|
109
111
|
addSecret(logger, node, checker, state, options)
|
|
110
112
|
addCredential(logger, node, checker, state, options)
|
|
111
113
|
addVariable(logger, node, checker, state, options)
|