@memberjunction/esignature 0.0.1 → 5.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BaseSignatureProvider.d.ts +77 -0
- package/dist/BaseSignatureProvider.d.ts.map +1 -0
- package/dist/BaseSignatureProvider.js +71 -0
- package/dist/BaseSignatureProvider.js.map +1 -0
- package/dist/SignatureEngineBase.d.ts +33 -0
- package/dist/SignatureEngineBase.d.ts.map +1 -0
- package/dist/SignatureEngineBase.js +78 -0
- package/dist/SignatureEngineBase.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/server/SignatureEngine.d.ts +137 -0
- package/dist/server/SignatureEngine.d.ts.map +1 -0
- package/dist/server/SignatureEngine.js +464 -0
- package/dist/server/SignatureEngine.js.map +1 -0
- package/dist/server/artifacts.d.ts +44 -0
- package/dist/server/artifacts.d.ts.map +1 -0
- package/dist/server/artifacts.js +107 -0
- package/dist/server/artifacts.js.map +1 -0
- package/dist/server/index.d.ts +4 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +9 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/util.d.ts +26 -0
- package/dist/server/util.d.ts.map +1 -0
- package/dist/server/util.js +94 -0
- package/dist/server/util.js.map +1 -0
- package/dist/types.d.ts +166 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +9 -0
- package/dist/types.js.map +1 -0
- package/package.json +44 -7
- package/README.md +0 -45
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { CreateEnvelopeRequest, EmbeddedSigningRequest, EnvelopeResult, EnvelopeStatusResult, NormalizedSignatureEvent, OperationResult, SignatureOperation, SignatureProviderConfig, SignedDocumentResult, SigningUrlResult, TemplateEnvelopeRequest, WebhookVerificationResult } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Abstract base for all eSignature providers. Concrete drivers (DocuSign, Adobe Sign, …) live in
|
|
4
|
+
* their own packages and register via `@RegisterClass(BaseSignatureProvider, '<DriverKey>')`, where
|
|
5
|
+
* `<DriverKey>` matches `MJ: Signature Providers.ServerDriverKey`. The engine resolves a driver with
|
|
6
|
+
* `MJGlobal.Instance.ClassFactory.CreateInstance(BaseSignatureProvider, driverKey)` — never `new`.
|
|
7
|
+
*
|
|
8
|
+
* Design contract:
|
|
9
|
+
* - **Core operations are `abstract`** — every driver must implement them.
|
|
10
|
+
* - **Optional operations are non-abstract** with a "not supported" default, advertised via
|
|
11
|
+
* {@link getSupportedOperations}. This mirrors the Communication provider idiom.
|
|
12
|
+
* - The provider is **stateless w.r.t. credentials**: the engine resolves and decrypts credentials,
|
|
13
|
+
* then hands them to {@link initialize}. Token refreshes are persisted via the engine-supplied
|
|
14
|
+
* `onTokenRefresh` callback on {@link SignatureProviderConfig}.
|
|
15
|
+
*/
|
|
16
|
+
export declare abstract class BaseSignatureProvider {
|
|
17
|
+
/**
|
|
18
|
+
* Driver key for this provider. MUST equal the `@RegisterClass` key and
|
|
19
|
+
* `MJ: Signature Providers.ServerDriverKey`.
|
|
20
|
+
*/
|
|
21
|
+
protected abstract readonly providerKey: string;
|
|
22
|
+
/** One-time per-instance initialization with the merged + decrypted config from the engine. */
|
|
23
|
+
abstract initialize(config: SignatureProviderConfig): Promise<void>;
|
|
24
|
+
/** True once {@link initialize} has supplied all credentials this provider requires. */
|
|
25
|
+
abstract get IsConfigured(): boolean;
|
|
26
|
+
/** Create (and, per `sendImmediately`, send) a signature envelope. */
|
|
27
|
+
abstract CreateEnvelope(req: CreateEnvelopeRequest): Promise<EnvelopeResult>;
|
|
28
|
+
/** Fetch the current status of a previously created envelope. */
|
|
29
|
+
abstract GetEnvelopeStatus(externalEnvelopeId: string): Promise<EnvelopeStatusResult>;
|
|
30
|
+
/** Download the executed/signed document for a completed envelope. */
|
|
31
|
+
abstract DownloadSignedDocument(externalEnvelopeId: string): Promise<SignedDocumentResult>;
|
|
32
|
+
/** Void/cancel an in-flight envelope with a reason. */
|
|
33
|
+
abstract VoidEnvelope(externalEnvelopeId: string, reason: string): Promise<OperationResult>;
|
|
34
|
+
/** Create an embedded (in-app) signing URL. Not all providers support this. */
|
|
35
|
+
CreateEmbeddedSigningUrl(_req: EmbeddedSigningRequest): Promise<SigningUrlResult>;
|
|
36
|
+
/** Create an envelope from a provider-hosted template. Not all providers support this. */
|
|
37
|
+
ApplyTemplate(_req: TemplateEnvelopeRequest): Promise<EnvelopeResult>;
|
|
38
|
+
/** Re-send the signing notification to outstanding recipients. Not all providers support this. */
|
|
39
|
+
ResendNotification(_externalEnvelopeId: string): Promise<OperationResult>;
|
|
40
|
+
/** The operations this driver actually supports. */
|
|
41
|
+
abstract getSupportedOperations(): SignatureOperation[];
|
|
42
|
+
/** Convenience predicate over {@link getSupportedOperations}. */
|
|
43
|
+
supportsOperation(op: SignatureOperation): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Normalize a provider webhook payload onto our vocabulary. This is the *parse* step only — it
|
|
46
|
+
* needs no secret, so the engine can call it on a bare driver to discover which envelope an
|
|
47
|
+
* event refers to. Returns `null` for payloads this driver doesn't handle. Default: not handled.
|
|
48
|
+
*
|
|
49
|
+
* Authenticity is checked separately by {@link VerifyWebhookSignature}, which runs on a
|
|
50
|
+
* credential-initialized driver.
|
|
51
|
+
*/
|
|
52
|
+
ParseWebhookEvent(_payload: unknown, _headers: Record<string, string>): NormalizedSignatureEvent | null;
|
|
53
|
+
/**
|
|
54
|
+
* Verify the authenticity of an inbound webhook (HMAC / signature). The eSignature webhook
|
|
55
|
+
* endpoint is unauthenticated and mutates signature-request status, so the engine consults this
|
|
56
|
+
* before applying any event under a **verify-if-configured** policy:
|
|
57
|
+
* - `Verified` → a secret is configured and the signature matched → engine accepts.
|
|
58
|
+
* - `Failed` → a secret is configured but the signature was missing/invalid → **reject.**
|
|
59
|
+
* - `NotConfigured` → no secret configured → engine accepts (logged), so the endpoint works
|
|
60
|
+
* during setup and tightens to strict automatically once a key is set.
|
|
61
|
+
*
|
|
62
|
+
* Default is `NotConfigured`: a driver that doesn't implement verification has no secret to
|
|
63
|
+
* check. Implementations read their shared secret from `this.config` (e.g.
|
|
64
|
+
* {@link SignatureProviderConfig.connectHmacKey}) — sourced from the account's encrypted
|
|
65
|
+
* credential, never an environment variable.
|
|
66
|
+
*
|
|
67
|
+
* Providers verify in whichever way their API prescribes:
|
|
68
|
+
* - over the EXACT raw bytes (DocuSign Connect HMAC) — use `rawBody`;
|
|
69
|
+
* - over fields inside the parsed payload (Dropbox Sign `event_hash`) — use `payload`.
|
|
70
|
+
*
|
|
71
|
+
* @param _rawBody The exact bytes received, for byte-accurate HMAC. Undefined if unavailable.
|
|
72
|
+
* @param _headers Inbound headers (may carry the provider signature header).
|
|
73
|
+
* @param _payload The parsed payload, for providers that sign payload fields rather than bytes.
|
|
74
|
+
*/
|
|
75
|
+
VerifyWebhookSignature(_rawBody: Buffer | undefined, _headers: Record<string, string>, _payload?: unknown): WebhookVerificationResult;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=BaseSignatureProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseSignatureProvider.d.ts","sourceRoot":"","sources":["../src/BaseSignatureProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,qBAAqB,EACrB,sBAAsB,EACtB,cAAc,EACd,oBAAoB,EACpB,wBAAwB,EACxB,eAAe,EACf,kBAAkB,EAClB,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,EAChB,uBAAuB,EACvB,yBAAyB,EAC5B,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;GAaG;AACH,8BAAsB,qBAAqB;IACvC;;;OAGG;IACH,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAEhD,+FAA+F;aAC/E,UAAU,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,I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rete drivers (DocuSign, Adobe Sign, …) live in
|
|
3
|
+
* their own packages and register via `@RegisterClass(BaseSignatureProvider, '<DriverKey>')`, where
|
|
4
|
+
* `<DriverKey>` matches `MJ: Signature Providers.ServerDriverKey`. The engine resolves a driver with
|
|
5
|
+
* `MJGlobal.Instance.ClassFactory.CreateInstance(BaseSignatureProvider, driverKey)` — never `new`.
|
|
6
|
+
*
|
|
7
|
+
* Design contract:
|
|
8
|
+
* - **Core operations are `abstract`** — every driver must implement them.
|
|
9
|
+
* - **Optional operations are non-abstract** with a "not supported" default, advertised via
|
|
10
|
+
* {@link getSupportedOperations}. This mirrors the Communication provider idiom.
|
|
11
|
+
* - The provider is **stateless w.r.t. credentials**: the engine resolves and decrypts credentials,
|
|
12
|
+
* then hands them to {@link initialize}. Token refreshes are persisted via the engine-supplied
|
|
13
|
+
* `onTokenRefresh` callback on {@link SignatureProviderConfig}.
|
|
14
|
+
*/
|
|
15
|
+
export class BaseSignatureProvider {
|
|
16
|
+
// ---- Optional operations (default: "not supported") ------------------------------------------
|
|
17
|
+
/** Create an embedded (in-app) signing URL. Not all providers support this. */
|
|
18
|
+
async CreateEmbeddedSigningUrl(_req) {
|
|
19
|
+
return { Success: false, ErrorMessage: `${this.providerKey} does not support embedded signing.` };
|
|
20
|
+
}
|
|
21
|
+
/** Create an envelope from a provider-hosted template. Not all providers support this. */
|
|
22
|
+
async ApplyTemplate(_req) {
|
|
23
|
+
return { Success: false, ErrorMessage: `${this.providerKey} does not support templates.` };
|
|
24
|
+
}
|
|
25
|
+
/** Re-send the signing notification to outstanding recipients. Not all providers support this. */
|
|
26
|
+
async ResendNotification(_externalEnvelopeId) {
|
|
27
|
+
return { Success: false, ErrorMessage: `${this.providerKey} does not support resend.` };
|
|
28
|
+
}
|
|
29
|
+
/** Convenience predicate over {@link getSupportedOperations}. */
|
|
30
|
+
supportsOperation(op) {
|
|
31
|
+
return this.getSupportedOperations().includes(op);
|
|
32
|
+
}
|
|
33
|
+
// ---- Inbound webhook (Connect / event callbacks) --------------------------------------------
|
|
34
|
+
/**
|
|
35
|
+
* Normalize a provider webhook payload onto our vocabulary. This is the *parse* step only — it
|
|
36
|
+
* needs no secret, so the engine can call it on a bare driver to discover which envelope an
|
|
37
|
+
* event refers to. Returns `null` for payloads this driver doesn't handle. Default: not handled.
|
|
38
|
+
*
|
|
39
|
+
* Authenticity is checked separately by {@link VerifyWebhookSignature}, which runs on a
|
|
40
|
+
* credential-initialized driver.
|
|
41
|
+
*/
|
|
42
|
+
ParseWebhookEvent(_payload, _headers) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Verify the authenticity of an inbound webhook (HMAC / signature). The eSignature webhook
|
|
47
|
+
* endpoint is unauthenticated and mutates signature-request status, so the engine consults this
|
|
48
|
+
* before applying any event under a **verify-if-configured** policy:
|
|
49
|
+
* - `Verified` → a secret is configured and the signature matched → engine accepts.
|
|
50
|
+
* - `Failed` → a secret is configured but the signature was missing/invalid → **reject.**
|
|
51
|
+
* - `NotConfigured` → no secret configured → engine accepts (logged), so the endpoint works
|
|
52
|
+
* during setup and tightens to strict automatically once a key is set.
|
|
53
|
+
*
|
|
54
|
+
* Default is `NotConfigured`: a driver that doesn't implement verification has no secret to
|
|
55
|
+
* check. Implementations read their shared secret from `this.config` (e.g.
|
|
56
|
+
* {@link SignatureProviderConfig.connectHmacKey}) — sourced from the account's encrypted
|
|
57
|
+
* credential, never an environment variable.
|
|
58
|
+
*
|
|
59
|
+
* Providers verify in whichever way their API prescribes:
|
|
60
|
+
* - over the EXACT raw bytes (DocuSign Connect HMAC) — use `rawBody`;
|
|
61
|
+
* - over fields inside the parsed payload (Dropbox Sign `event_hash`) — use `payload`.
|
|
62
|
+
*
|
|
63
|
+
* @param _rawBody The exact bytes received, for byte-accurate HMAC. Undefined if unavailable.
|
|
64
|
+
* @param _headers Inbound headers (may carry the provider signature header).
|
|
65
|
+
* @param _payload The parsed payload, for providers that sign payload fields rather than bytes.
|
|
66
|
+
*/
|
|
67
|
+
VerifyWebhookSignature(_rawBody, _headers, _payload) {
|
|
68
|
+
return 'NotConfigured';
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=BaseSignatureProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseSignatureProvider.js","sourceRoot":"","sources":["../src/BaseSignatureProvider.ts"],"names":[],"mappings":"AAeA;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAgB,qBAAqB;IA2BvC,iGAAiG;IAEjG,+EAA+E;IACxE,KAAK,CAAC,wBAAwB,CAAC,IAA4B;QAC9D,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,WAAW,qCAAqC,EAAE,CAAC;IACtG,CAAC;IAED,0FAA0F;IACnF,KAAK,CAAC,aAAa,CAAC,IAA6B;QACpD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,WAAW,8BAA8B,EAAE,CAAC;IAC/F,CAAC;IAED,kGAAkG;IAC3F,KAAK,CAAC,kBAAkB,CAAC,mBAA2B;QACvD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,WAAW,2BAA2B,EAAE,CAAC;IAC5F,CAAC;IAOD,iEAAiE;IAC1D,iBAAiB,CAAC,EAAsB;QAC3C,OAAO,IAAI,CAAC,sBAAsB,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,gGAAgG;IAEhG;;;;;;;OAOG;IACI,iBAAiB,CACpB,QAAiB,EACjB,QAAgC;QAEhC,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACI,sBAAsB,CACzB,QAA4B,EAC5B,QAAgC,EAChC,QAAkB;QAElB,OAAO,eAAe,CAAC;IAC3B,CAAC;CACJ"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { BaseEngine, IMetadataProvider, UserInfo } from '@memberjunction/core';
|
|
2
|
+
import { MJSignatureAccountEntity, MJSignatureProviderEntity } from '@memberjunction/core-entities';
|
|
3
|
+
/** A signature account paired with its resolved provider entity. */
|
|
4
|
+
export interface SignatureAccountWithProvider {
|
|
5
|
+
account: MJSignatureAccountEntity;
|
|
6
|
+
provider: MJSignatureProviderEntity;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Metadata cache for the eSignature subsystem — providers + accounts. Extends {@link BaseEngine}
|
|
10
|
+
* so saves/deletes/remote-invalidations on those entities keep the cache fresh automatically.
|
|
11
|
+
*
|
|
12
|
+
* This is the metadata-only layer (safe for any context that has the entities). The server-side
|
|
13
|
+
* {@link SignatureEngine} wraps this and adds driver resolution, credential decryption, and the
|
|
14
|
+
* envelope lifecycle operations. Mirrors the FileStorageEngineBase / FileStorageEngine split.
|
|
15
|
+
*/
|
|
16
|
+
export declare class SignatureEngineBase extends BaseEngine<SignatureEngineBase> {
|
|
17
|
+
static get Instance(): SignatureEngineBase;
|
|
18
|
+
private _accounts;
|
|
19
|
+
private _providers;
|
|
20
|
+
/** Load signature accounts + providers into the cache (idempotent unless forceRefresh). */
|
|
21
|
+
Config(forceRefresh?: boolean, contextUser?: UserInfo, provider?: IMetadataProvider): Promise<void>;
|
|
22
|
+
get Accounts(): MJSignatureAccountEntity[];
|
|
23
|
+
get Providers(): MJSignatureProviderEntity[];
|
|
24
|
+
/** Accounts joined to their provider entity; accounts whose provider is missing are dropped. */
|
|
25
|
+
get AccountsWithProviders(): SignatureAccountWithProvider[];
|
|
26
|
+
GetAccountById(accountId: string): MJSignatureAccountEntity | undefined;
|
|
27
|
+
GetProviderById(providerId: string): MJSignatureProviderEntity | undefined;
|
|
28
|
+
GetAccountByName(name: string): MJSignatureAccountEntity | undefined;
|
|
29
|
+
GetProviderByDriverKey(driverKey: string): MJSignatureProviderEntity | undefined;
|
|
30
|
+
/** Resolve an account with its provider; null if either is missing. */
|
|
31
|
+
GetAccountWithProvider(accountId: string): SignatureAccountWithProvider | null;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=SignatureEngineBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SignatureEngineBase.d.ts","sourceRoot":"","sources":["../src/SignatureEngineBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA4B,iBAAiB,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEzG,OAAO,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAEpG,oEAAoE;AACpE,MAAM,WAAW,4BAA4B;IACzC,OAAO,EAAE,wBAAwB,CAAC;IAClC,QAAQ,EAAE,yBAAyB,CAAC;CACvC;AAED;;;;;;;GAOG;AACH,qBAAa,mBAAoB,SAAQ,UAAU,CAAC,mBAAmB,CAAC;IACpE,WAAkB,QAAQ,IAAI,mBAAmB,CAEhD;IAED,OAAO,CAAC,SAAS,CAAkC;IACnD,OAAO,CAAC,UAAU,CAAmC;IAErD,2FAA2F;IAC9E,MAAM,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAoBhH,IAAW,QAAQ,IAAI,wBAAwB,EAAE,CAEhD;IAED,IAAW,SAAS,IAAI,yBAAyB,EAAE,CAElD;IAED,gGAAgG;IAChG,IAAW,qBAAqB,IAAI,4BAA4B,EAAE,CAQjE;IAIM,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,wBAAwB,GAAG,SAAS;IAIvE,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,yBAAyB,GAAG,SAAS;IAI1E,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,wBAAwB,GAAG,SAAS;IAIpE,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,yBAAyB,GAAG,SAAS;IAKvF,uEAAuE;IAChE,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,4BAA4B,GAAG,IAAI;CAQxF"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { BaseEngine } from '@memberjunction/core';
|
|
2
|
+
import { UUIDsEqual } from '@memberjunction/global';
|
|
3
|
+
/**
|
|
4
|
+
* Metadata cache for the eSignature subsystem — providers + accounts. Extends {@link BaseEngine}
|
|
5
|
+
* so saves/deletes/remote-invalidations on those entities keep the cache fresh automatically.
|
|
6
|
+
*
|
|
7
|
+
* This is the metadata-only layer (safe for any context that has the entities). The server-side
|
|
8
|
+
* {@link SignatureEngine} wraps this and adds driver resolution, credential decryption, and the
|
|
9
|
+
* envelope lifecycle operations. Mirrors the FileStorageEngineBase / FileStorageEngine split.
|
|
10
|
+
*/
|
|
11
|
+
export class SignatureEngineBase extends BaseEngine {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this._accounts = [];
|
|
15
|
+
this._providers = [];
|
|
16
|
+
}
|
|
17
|
+
static get Instance() {
|
|
18
|
+
return super.getInstance();
|
|
19
|
+
}
|
|
20
|
+
/** Load signature accounts + providers into the cache (idempotent unless forceRefresh). */
|
|
21
|
+
async Config(forceRefresh, contextUser, provider) {
|
|
22
|
+
const configs = [
|
|
23
|
+
{
|
|
24
|
+
Type: 'entity',
|
|
25
|
+
EntityName: 'MJ: Signature Accounts',
|
|
26
|
+
PropertyName: '_accounts',
|
|
27
|
+
CacheLocal: true,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
Type: 'entity',
|
|
31
|
+
EntityName: 'MJ: Signature Providers',
|
|
32
|
+
PropertyName: '_providers',
|
|
33
|
+
CacheLocal: true,
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
await this.Load(configs, provider, forceRefresh, contextUser);
|
|
37
|
+
}
|
|
38
|
+
// ---- Cached-data getters ----------------------------------------------------------------------
|
|
39
|
+
get Accounts() {
|
|
40
|
+
return this._accounts || [];
|
|
41
|
+
}
|
|
42
|
+
get Providers() {
|
|
43
|
+
return this._providers || [];
|
|
44
|
+
}
|
|
45
|
+
/** Accounts joined to their provider entity; accounts whose provider is missing are dropped. */
|
|
46
|
+
get AccountsWithProviders() {
|
|
47
|
+
const providerMap = new Map();
|
|
48
|
+
this.Providers.forEach((p) => providerMap.set(p.ID, p));
|
|
49
|
+
return this.Accounts.map((account) => {
|
|
50
|
+
const provider = providerMap.get(account.SignatureProviderID);
|
|
51
|
+
return provider ? { account, provider } : null;
|
|
52
|
+
}).filter((item) => item !== null);
|
|
53
|
+
}
|
|
54
|
+
// ---- Lookups ----------------------------------------------------------------------------------
|
|
55
|
+
GetAccountById(accountId) {
|
|
56
|
+
return this.Accounts.find((a) => UUIDsEqual(a.ID, accountId));
|
|
57
|
+
}
|
|
58
|
+
GetProviderById(providerId) {
|
|
59
|
+
return this.Providers.find((p) => UUIDsEqual(p.ID, providerId));
|
|
60
|
+
}
|
|
61
|
+
GetAccountByName(name) {
|
|
62
|
+
return this.Accounts.find((a) => a.Name?.trim().toLowerCase() === name.trim().toLowerCase());
|
|
63
|
+
}
|
|
64
|
+
GetProviderByDriverKey(driverKey) {
|
|
65
|
+
const key = driverKey.trim().toLowerCase();
|
|
66
|
+
return this.Providers.find((p) => p.ServerDriverKey?.trim().toLowerCase() === key);
|
|
67
|
+
}
|
|
68
|
+
/** Resolve an account with its provider; null if either is missing. */
|
|
69
|
+
GetAccountWithProvider(accountId) {
|
|
70
|
+
const account = this.GetAccountById(accountId);
|
|
71
|
+
if (!account) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
const provider = this.GetProviderById(account.SignatureProviderID);
|
|
75
|
+
return provider ? { account, provider } : null;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=SignatureEngineBase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SignatureEngineBase.js","sour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AAuE;IAChE,sBAAsB,CAAC,SAAiB;QAC3C,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;QAC/C,IAAI,CAAC,OAAO,EAAE,CAAC;YACX,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,MAAM,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;QACnE,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACnD,CAAC;CACJ"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// PUBLIC API SURFACE AREA.
|
|
2
|
+
// Provider contract (types + BaseSignatureProvider) plus the metadata-cache engine
|
|
3
|
+
// (SignatureEngineBase). These depend only on @memberjunction/core + core-entities, both of which
|
|
4
|
+
// are client-safe, so this entry stays importable from the browser. SignatureEngineBase mirrors
|
|
5
|
+
// FileStorageEngineBase: a BaseEngine that caches the Providers + Accounts metadata.
|
|
6
|
+
//
|
|
7
|
+
// The credential-decrypting, DB-writing server engine (SignatureEngine) and its driver-init helper
|
|
8
|
+
// are intentionally NOT exported here — import them from '@memberjunction/esignature/server' so
|
|
9
|
+
// client bundles stay free of the server-only @memberjunction/credentials dependency.
|
|
10
|
+
export * from './types.js';
|
|
11
|
+
export * from './BaseSignatureProvider.js';
|
|
12
|
+
export * from './SignatureEngineBase.js';
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,mFAAmF;AACnF,kGAAkG;AAClG,gGAAgG;AAChG,qFAAqF;AACrF,EAAE;AACF,mGAAmG;AACnG,gGAAgG;AAChG,sFAAsF;AACtF,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { IMetadataProvider, UserInfo } from '@memberjunction/core';
|
|
2
|
+
import { BaseSingleton } from '@memberjunction/global';
|
|
3
|
+
import { BaseSignatureProvider } from '../BaseSignatureProvider.js';
|
|
4
|
+
import { EnvelopeStatus, NormalizedSignatureEvent, OperationResult, SignatureDocumentInput, SignatureRecipientInput } from '../types.js';
|
|
5
|
+
import { SignatureEngineBase } from '../SignatureEngineBase.js';
|
|
6
|
+
/** Input for {@link SignatureEngine.SendForSignature}. */
|
|
7
|
+
export interface SendForSignatureOptions {
|
|
8
|
+
/** Account (provider instance) to send through. */
|
|
9
|
+
signatureAccountId: string;
|
|
10
|
+
/** Envelope title / email subject. */
|
|
11
|
+
title: string;
|
|
12
|
+
message?: string;
|
|
13
|
+
/** Documents to sign. The caller resolves bytes (e.g. from an Artifact Version). */
|
|
14
|
+
documents: SignatureDocumentInput[];
|
|
15
|
+
/** Signers. */
|
|
16
|
+
recipients: SignatureRecipientInput[];
|
|
17
|
+
/** Optional Artifact reference recorded against the (first) document for provenance. */
|
|
18
|
+
artifactId?: string;
|
|
19
|
+
artifactVersionId?: string;
|
|
20
|
+
/** Polymorphic originating record (entity half). */
|
|
21
|
+
entityId?: string;
|
|
22
|
+
/** Polymorphic originating record (record half). */
|
|
23
|
+
recordId?: string;
|
|
24
|
+
/** true → send immediately; false → create as draft. Defaults to true. */
|
|
25
|
+
sendImmediately?: boolean;
|
|
26
|
+
/** Provider custom fields. */
|
|
27
|
+
metadata?: Record<string, string>;
|
|
28
|
+
contextUser: UserInfo;
|
|
29
|
+
provider?: IMetadataProvider;
|
|
30
|
+
}
|
|
31
|
+
/** Result of {@link SignatureEngine.SendForSignature}. */
|
|
32
|
+
export interface SendForSignatureResult {
|
|
33
|
+
Success: boolean;
|
|
34
|
+
signatureRequestId?: string;
|
|
35
|
+
externalEnvelopeId?: string;
|
|
36
|
+
status?: EnvelopeStatus;
|
|
37
|
+
ErrorMessage?: string;
|
|
38
|
+
}
|
|
39
|
+
/** Result of {@link SignatureEngine.RefreshStatus}. */
|
|
40
|
+
export interface RefreshStatusResult {
|
|
41
|
+
Success: boolean;
|
|
42
|
+
status?: EnvelopeStatus;
|
|
43
|
+
ErrorMessage?: string;
|
|
44
|
+
}
|
|
45
|
+
/** Result of {@link SignatureEngine.DownloadSigned}. */
|
|
46
|
+
export interface DownloadSignedResult {
|
|
47
|
+
Success: boolean;
|
|
48
|
+
document?: {
|
|
49
|
+
bytes: Buffer;
|
|
50
|
+
filename: string;
|
|
51
|
+
contentType: string;
|
|
52
|
+
};
|
|
53
|
+
ErrorMessage?: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Server-side eSignature engine. Resolves providers via the ClassFactory, decrypts credentials via
|
|
57
|
+
* the Credential Engine, persists the envelope lifecycle across the six `MJ: Signature*` entities,
|
|
58
|
+
* and normalizes inbound webhooks. Wraps {@link SignatureEngineBase} (the metadata cache) using the
|
|
59
|
+
* same containment pattern as FileStorageEngine.
|
|
60
|
+
*
|
|
61
|
+
* Multi-provider rule (CLAUDE.md): every method accepts `contextUser` and an optional
|
|
62
|
+
* `IMetadataProvider`; the global `Metadata.Provider` is used only as an explicit fallback.
|
|
63
|
+
*/
|
|
64
|
+
export declare class SignatureEngine extends BaseSingleton<SignatureEngine> {
|
|
65
|
+
private _loaded;
|
|
66
|
+
private _loading;
|
|
67
|
+
private _loadingPromise;
|
|
68
|
+
private _contextUser;
|
|
69
|
+
/** Initialized drivers keyed by account ID. */
|
|
70
|
+
private _driverCache;
|
|
71
|
+
static get Instance(): SignatureEngine;
|
|
72
|
+
protected get Base(): SignatureEngineBase;
|
|
73
|
+
get Loaded(): boolean;
|
|
74
|
+
get Accounts(): import("@memberjunction/core-entities").MJSignatureAccountEntity[];
|
|
75
|
+
get Providers(): import("@memberjunction/core-entities").MJSignatureProviderEntity[];
|
|
76
|
+
/** Load metadata + pre-initialize active drivers. Idempotent unless forceRefresh. */
|
|
77
|
+
Config(forceRefresh?: boolean, contextUser?: UserInfo, provider?: IMetadataProvider): Promise<void>;
|
|
78
|
+
private innerLoad;
|
|
79
|
+
/** (Re)initialize drivers for all active accounts. Failures are logged, not thrown. */
|
|
80
|
+
RefreshDriverCache(): Promise<void>;
|
|
81
|
+
/** Resolve (and cache) an initialized driver for an account. */
|
|
82
|
+
GetDriver(accountId: string, contextUser: UserInfo): Promise<BaseSignatureProvider>;
|
|
83
|
+
/**
|
|
84
|
+
* Create the lifecycle records, send the envelope through the provider, and persist the outcome.
|
|
85
|
+
*/
|
|
86
|
+
SendForSignature(options: SendForSignatureOptions): Promise<SendForSignatureResult>;
|
|
87
|
+
/** Poll the provider for current status and persist it (plus recipient statuses). */
|
|
88
|
+
RefreshStatus(requestId: string, contextUser: UserInfo, provider?: IMetadataProvider): Promise<RefreshStatusResult>;
|
|
89
|
+
/** Download the executed document for a completed envelope. */
|
|
90
|
+
DownloadSigned(requestId: string, contextUser: UserInfo, provider?: IMetadataProvider): Promise<DownloadSignedResult>;
|
|
91
|
+
/** Void/cancel an in-flight envelope. */
|
|
92
|
+
Void(requestId: string, reason: string, contextUser: UserInfo, provider?: IMetadataProvider): Promise<OperationResult>;
|
|
93
|
+
/**
|
|
94
|
+
* Normalize an inbound provider webhook and apply the status — fail-closed on authenticity.
|
|
95
|
+
*
|
|
96
|
+
* Flow (no env vars; HMAC secret lives in the account credential):
|
|
97
|
+
* 1. Parse the payload on a bare driver (parsing needs no secret) to discover the envelope.
|
|
98
|
+
* 2. Find the owning MJ: Signature Request, hence its account.
|
|
99
|
+
* 3. Resolve the account's *credential-initialized* driver and require
|
|
100
|
+
* {@link BaseSignatureProvider.VerifyWebhookSignature} to pass over the raw bytes.
|
|
101
|
+
* 4. Only then apply the status.
|
|
102
|
+
*
|
|
103
|
+
* @param rawBody The exact request bytes, required for byte-accurate HMAC verification.
|
|
104
|
+
*/
|
|
105
|
+
RecordWebhookEvent(driverKey: string, payload: unknown, headers: Record<string, string>, contextUser: UserInfo, rawBody?: Buffer, provider?: IMetadataProvider): Promise<{
|
|
106
|
+
Success: boolean;
|
|
107
|
+
event?: NormalizedSignatureEvent;
|
|
108
|
+
ErrorMessage?: string;
|
|
109
|
+
}>;
|
|
110
|
+
/**
|
|
111
|
+
* Resolve the documents to send. Caller-supplied `documents` win; if none are given and an
|
|
112
|
+
* `artifactVersionId` is provided, load that version's bytes from the Artifacts subsystem.
|
|
113
|
+
* (`artifactId` without a version is recorded as provenance only — we don't guess a version.)
|
|
114
|
+
*/
|
|
115
|
+
private resolveDocuments;
|
|
116
|
+
private createRequestRecord;
|
|
117
|
+
private persistDocuments;
|
|
118
|
+
private persistRecipients;
|
|
119
|
+
private persistSentRequest;
|
|
120
|
+
/**
|
|
121
|
+
* Record the executed document: write the bytes back into the Artifacts subsystem (new Artifact
|
|
122
|
+
* + Version) and add a `Role='Signed'` document row linked to that version. If no File Storage
|
|
123
|
+
* Account is configured, fall back to recording the row without an artifact link (the caller
|
|
124
|
+
* still receives the bytes) — a successful download is never lost over missing storage setup.
|
|
125
|
+
*/
|
|
126
|
+
private recordSignedDocument;
|
|
127
|
+
/** Apply a normalized status to a request, stamping CompletedAt on terminal completion. */
|
|
128
|
+
private applyStatus;
|
|
129
|
+
private logOperation;
|
|
130
|
+
private loadRequest;
|
|
131
|
+
private findRequestByEnvelopeId;
|
|
132
|
+
private resolveDriverByKey;
|
|
133
|
+
/** Coerce a normalized status (which may be 'Unknown') into a DB-persistable status. */
|
|
134
|
+
private persistableStatus;
|
|
135
|
+
private saveOrThrow;
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=SignatureEngine.d.ts.map
|
|
@@ -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