Open-Attestation / open-attestation

Meta framework for providing digital provenance and integrity to documents.
https://openattestation.com
Apache License 2.0
54 stars 18 forks source link

Chore: tidy v4 exports #278

Closed phanshiyu closed 5 months ago

phanshiyu commented 5 months ago

What

  1. Untangle v4 modules as much as possible from the mess of dependencies resulting from utils
  2. Refactor to bring v4 specific stuff into v4
  3. Fix dependency error caused by v2's get data by abstracting it out of utils and throwing it into v2 as a file of its own
  4. Clean up the interface of V4 and export them tgt in index, and also granularly via package.json's exports
  5. Clean up multi version functions and only include v4 in verify and obfuscate and validateSchema.

Users whose project support package.json exports should be able to import v4 in a granular fashion:

import { v4 } from "@govtechsg/open-attestation";
import v4 from "@govtechsg/open-attestation/4.0";

// granular
import { wrapDocument, wrapDocumentErrors, wrapDocuments } from "@govtechsg/open-attestation/4.0/wrap";
import { signDocument, signDocumentErrors } from "@govtechsg/open-attestation/4.0/sign";
import { verify } from "@govtechsg/open-attestation/4.0/verify";
import { obfuscate, obfuscateErrors } from "@govtechsg/open-attestation/4.0/obfuscate";
import { diagnose, isDocument, isSignedWrappedDocument, isWrappedDocument } from "@govtechsg/open-attestation/4.0/utils";

see src/4.0/exports to see the exported interface

github-actions[bot] commented 5 months ago

:tada: This PR is included in version 6.10.0-alpha.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: