Skip to content

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

Open
JhaSourav07 wants to merge 1 commit intohyperledger:mainfrom
JhaSourav07:issue-307-fix
Open

docs: document KeyEndorsementPolicy class for State-Based Endorsement (#307)#500
JhaSourav07 wants to merge 1 commit intohyperledger:mainfrom
JhaSourav07:issue-307-fix

Conversation

@JhaSourav07
Copy link
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

Signed-off-by: Sourav <souravkjha2007@gmail.com>
@JhaSourav07 JhaSourav07 requested a review from a team as a code owner March 11, 2026 18:49
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

1 participant