Skip to content

feat: export NexoCrypto from package index#1710

Closed
gourabsingha1 wants to merge 3 commits into
Adyen:mainfrom
gourabsingha1:feat/export-nexocrypto
Closed

feat: export NexoCrypto from package index#1710
gourabsingha1 wants to merge 3 commits into
Adyen:mainfrom
gourabsingha1:feat/export-nexocrypto

Conversation

@gourabsingha1

Copy link
Copy Markdown
Contributor

Description

This PR addresses issue #1447 by exporting the NexoCrypto class from the main library entry point (src/index.ts).

Previously, NexoCrypto was not exported from the main entry point, forcing developers to import it via deep internal paths like @adyen/api-library/lib/src/security/nexoCrypto. Since the library compiles to CommonJS, this deep path resolution under ESM-based runtimes returned the default wrapper object { default: [class NexoCrypto] } instead of the class constructor itself, causing runtime TypeError: NexoCrypto is not a constructor unless developers manually appended .default.

By exporting it as a named export from the main index file, both ESM and CommonJS developers can cleanly import NexoCrypto directly from the package root:
import { NexoCrypto } from '@adyen/api-library';

Approach

Added export { default as NexoCrypto } from "./security/nexoCrypto"; to src/index.ts.

Testing

  • Ran build successfully with npm run build.
  • Ran the entire test suite (npm test) and verified that all 532 tests pass.

@gourabsingha1 gourabsingha1 requested a review from a team as a code owner June 25, 2026 19:07

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request exports the NexoCrypto class from src/index.ts to support local terminal API security. The reviewer suggests also exporting InvalidSecurityKeyException alongside NexoCrypto to facilitate proper error handling and prevent deep imports for library consumers.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/index.ts Outdated
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