From 288ce7c7afcfc66f9524288053d29adabca91320 Mon Sep 17 00:00:00 2001 From: Daniel Hensby Date: Thu, 23 Nov 2023 11:53:47 +0000 Subject: [PATCH] :bug: export Signer and SignPdfError from utils Consumers of the library may want to implement their own Signer or even catch and make assertions of errors. Exposing the classes from utils through this library means that consumers don't have to manually require the sub-package themselves, which helps avoid dependency resolution issues that can sometimes happen in npm when root projects and dependencies have slightly mis-matched version requirements. --- packages/signpdf/dist/signpdf.d.ts | 2 ++ packages/signpdf/dist/signpdf.d.ts.map | 2 +- packages/signpdf/dist/signpdf.js | 15 ++++++++++++++- packages/signpdf/src/signpdf.js | 2 ++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/signpdf/dist/signpdf.d.ts b/packages/signpdf/dist/signpdf.d.ts index d5827b87..2234706c 100644 --- a/packages/signpdf/dist/signpdf.d.ts +++ b/packages/signpdf/dist/signpdf.d.ts @@ -21,4 +21,6 @@ export type SignerOptions = { asn1StrictParsing?: boolean; }; import { Signer } from '@signpdf/utils'; +import { SignPdfError } from '@signpdf/utils'; +export { Signer, SignPdfError }; //# sourceMappingURL=signpdf.d.ts.map \ No newline at end of file diff --git a/packages/signpdf/dist/signpdf.d.ts.map b/packages/signpdf/dist/signpdf.d.ts.map index 9c8dcd22..8c20d709 100644 --- a/packages/signpdf/dist/signpdf.d.ts.map +++ b/packages/signpdf/dist/signpdf.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"signpdf.d.ts","sourceRoot":"","sources":["../src/signpdf.js"],"names":[],"mappings":"AAQA;;;;GAIG;AAEH;IAEQ,mCAA0D;IAC1D,sBAAyB;IAG7B;;;;;OAKG;IACH,gBALW,MAAM,UACN,MAAM,GAEJ,QAAQ,MAAM,CAAC,CAwF3B;CACJ;;;;iBAvGS,MAAM;wBACN,OAAO;;uBALV,gBAAgB"} \ No newline at end of file +{"version":3,"file":"signpdf.d.ts","sourceRoot":"","sources":["../src/signpdf.js"],"names":[],"mappings":"AAUA;;;;GAIG;AAEH;IAEQ,mCAA0D;IAC1D,sBAAyB;IAG7B;;;;;OAKG;IACH,gBALW,MAAM,UACN,MAAM,GAEJ,QAAQ,MAAM,CAAC,CAwF3B;CACJ;;;;iBAvGS,MAAM;wBACN,OAAO;;uBAPV,gBAAgB;6BAAhB,gBAAgB"} \ No newline at end of file diff --git a/packages/signpdf/dist/signpdf.js b/packages/signpdf/dist/signpdf.js index 371c2fd8..2b22b7a1 100644 --- a/packages/signpdf/dist/signpdf.js +++ b/packages/signpdf/dist/signpdf.js @@ -3,7 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = exports.SignPdf = void 0; +exports.SignPdf = void 0; +Object.defineProperty(exports, "SignPdfError", { + enumerable: true, + get: function () { + return _utils.SignPdfError; + } +}); +Object.defineProperty(exports, "Signer", { + enumerable: true, + get: function () { + return _utils.Signer; + } +}); +exports.default = void 0; var _utils = require("@signpdf/utils"); /** * @typedef {object} SignerOptions diff --git a/packages/signpdf/src/signpdf.js b/packages/signpdf/src/signpdf.js index edc034ae..994ccabb 100644 --- a/packages/signpdf/src/signpdf.js +++ b/packages/signpdf/src/signpdf.js @@ -6,6 +6,8 @@ import { Signer, } from '@signpdf/utils'; +export {Signer, SignPdfError}; + /** * @typedef {object} SignerOptions * @prop {string} [passphrase]