Skip to content

docs: document KeyEndorsementPolicy class for State-Based Endorsement (#307)#500

Merged
bestbeforetoday merged 4 commits into
hyperledger:mainfrom
JhaSourav07:issue-307-fix
Jun 2, 2026
Merged

docs: document KeyEndorsementPolicy class for State-Based Endorsement (#307)#500
bestbeforetoday merged 4 commits into
hyperledger:mainfrom
JhaSourav07:issue-307-fix

Conversation

@JhaSourav07
Copy link
Copy Markdown
Contributor

@JhaSourav07 JhaSourav07 commented Mar 11, 2026

Description

This PR Closes ** #307** by adding documentation for the KeyEndorsementPolicy class to the official Node.js reference documentation.
The KeyEndorsementPolicy class is essential for implementing State-Based Endorsement (SBE) but was previously missing from the generated API docs.

This update ensures the class and its methods are properly documented and visible in the generated documentation, improving discoverability and developer usability.


Changes

Documentation Configuration

  • Updated docs/_jsdoc.json to include libraries/fabric-shim/lib/utils/statebased.js in the source scanning path so the class is included during documentation generation.

JSDoc Enhancements

  • Added comprehensive JSDoc comments for the KeyEndorsementPolicy class and its methods:

    • addOrgs
    • delOrgs
    • listOrgs
    • getPolicy

TypeScript Definitions

  • Added the KeyEndorsementPolicy class to libraries/fabric-shim/types/index.d.ts.

Library Export

  • Verified that KeyEndorsementPolicy is correctly exported in libraries/fabric-shim/index.js so it can be used by consumers.

Verification

  • Documentation: Successfully generated local docs using npm run build inside the docs folder. The KeyEndorsementPolicy class now appears in the sidebar with full method documentation.
  • Linting: Ran npm run lint inside libraries/fabric-shim with 0 errors.
  • Build: Successfully executed rush rebuild for the entire monorepo.

Checklist

  • I have added the Signed-off-by line to my commit message (DCO).
  • My changes follow the project's coding style and linting rules.
  • I have verified that the documentation generates correctly.
  • I have updated the TypeScript definitions to match the new documentation.

Screenshots

image
image
image

Closes #307

@JhaSourav07 JhaSourav07 requested a review from a team as a code owner March 11, 2026 18:49
Comment thread libraries/fabric-shim/lib/cmds/startCommand.js Outdated
Signed-off-by: Sourav <souravkjha2007@gmail.com>
Copy link
Copy Markdown
Member

@bestbeforetoday bestbeforetoday left a comment

Choose a reason for hiding this comment

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

Thank you for contributing this enhancement. See inline comments for issues that need to be resolved.

Comment thread libraries/fabric-shim/lib/utils/statebased.js Outdated
Comment thread libraries/fabric-shim/lib/utils/statebased.js
Comment thread libraries/fabric-shim/lib/utils/statebased.js
@JhaSourav07
Copy link
Copy Markdown
Contributor Author

Thank you for contributing this enhancement. See inline comments for issues that need to be resolved.

I think i resolved the issues, please let me know if there is anything else

Copy link
Copy Markdown
Member

@bestbeforetoday bestbeforetoday left a comment

Choose a reason for hiding this comment

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

Sorry, just one more change needed that I should have spotted on the first pass. Otherwise looks good to me now.

Comment thread libraries/fabric-shim/index.js Outdated
…aincode module

Signed-off-by: Sourav Jha <souravkjha2007@gmail.com>
@JhaSourav07
Copy link
Copy Markdown
Contributor Author

Sorry, just one more change needed that I should have spotted on the first pass. Otherwise looks good to me now.

No issues

Copy link
Copy Markdown
Member

@bestbeforetoday bestbeforetoday left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution.

@bestbeforetoday bestbeforetoday enabled auto-merge (squash) June 2, 2026 10:23
@bestbeforetoday bestbeforetoday merged commit 9882629 into hyperledger:main Jun 2, 2026
8 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.

KeyEndorsementPolicy class useful for working with State Based Endorsement is not documented in the node reference docs

2 participants