Skip to content

fix(n8n): add missing entry point, fix auth header, add execution tests#1444

Merged
nicoloboschi merged 1 commit intomainfrom
fix/n8n-integration-followup
May 5, 2026
Merged

fix(n8n): add missing entry point, fix auth header, add execution tests#1444
nicoloboschi merged 1 commit intomainfrom
fix/n8n-integration-followup

Conversation

@nicoloboschi
Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #1364 addressing review findings:

  • Add index.ts entry pointpackage.json declares "main": "dist/index.js" but there was no source file to produce it. Build would fail on publish.
  • Fix credential auth header — Previously sent literal "undefined" as the Authorization header value for self-hosted instances without an API key. Now sends empty string which n8n drops.
  • Use SVG icon — Switch from file:hindsight.png to file:hindsight.svg for crisper rendering in the node panel.
  • Remove unsafe as IDataObject casts — Import and use the proper Budget type from the client SDK instead of casting options objects.
  • Add execution tests — New test/node-execute.test.ts mocks HindsightClient and verifies all three operations (retain, recall, reflect) are called with correct arguments, including edge cases (empty tags, missing bankId, continueOnFail error handling).

Test plan

  • All 22 tests pass (npm test)
  • Build succeeds (npm run build)
  • CI green on test-n8n-integration job

- Add index.ts entry point (package.json "main" points to dist/index.js)
- Fix credential auth header: use empty string instead of undefined to
  avoid sending literal "undefined" header for unauthenticated instances
- Use SVG icon instead of PNG for crisper rendering
- Remove unsafe `as IDataObject` casts on client call options, use
  proper Budget type import
- Add node-execute.test.ts with mocked HindsightClient verifying all
  three operations (retain, recall, reflect) are called correctly
@nicoloboschi nicoloboschi merged commit ad4c0e7 into main May 5, 2026
53 of 54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant