@memberjunction/esignature 5.42.0 → 5.44.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/types.d.ts +71 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +6 -6
package/dist/types.d.ts
CHANGED
|
@@ -43,6 +43,70 @@ export interface SignatureProviderConfig {
|
|
|
43
43
|
/** Provider-specific config + decrypted credential values (integrationKey, privateKey, …). */
|
|
44
44
|
[key: string]: unknown;
|
|
45
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* The kind of field to place for a signer. This is the portable subset every MJ-supported provider
|
|
48
|
+
* (DocuSign, Dropbox Sign, PandaDoc) can render; each driver maps it onto its own vocabulary.
|
|
49
|
+
* Richer per-provider types (checkbox groups, dropdowns, attachments, …) are intentionally omitted
|
|
50
|
+
* until a real use case needs them — add here and to each driver's map together.
|
|
51
|
+
*/
|
|
52
|
+
export type SignatureFieldType = 'signature' | 'initials' | 'dateSigned' | 'text' | 'checkbox';
|
|
53
|
+
/** Unit an anchor offset is expressed in. Maps to DocuSign `anchorUnits`; ignored by providers that
|
|
54
|
+
* don't support offset units (they treat the offset as their native unit). */
|
|
55
|
+
export type SignatureAnchorUnits = 'pixels' | 'mms' | 'cms' | 'inches';
|
|
56
|
+
/**
|
|
57
|
+
* Where to place a single field for a signer on the document — the answer to "put the Sign Here box
|
|
58
|
+
* HERE, not at a hardcoded corner."
|
|
59
|
+
*
|
|
60
|
+
* Two placement strategies, checked in this order:
|
|
61
|
+
* 1. **Anchor string** (`anchor`) — place the field wherever a marker string (e.g. `"Signature:"`
|
|
62
|
+
* or a hidden tag like `"\\s1\\"`) appears in the document text. This is the portable, layout-
|
|
63
|
+
* resilient primitive supported by every provider (DocuSign anchor tabbing, Dropbox Sign /
|
|
64
|
+
* PandaDoc text tags). **Preferred** whenever the caller controls the document's content.
|
|
65
|
+
* 2. **Normalized coordinates** (`page` + `xPercent` + `yPercent`) — an absolute fallback for when
|
|
66
|
+
* the document has no usable marker. Coordinates are **percentages of the page** (0–100), NOT
|
|
67
|
+
* raw pixels, so they're page-size independent; each driver converts to its native unit/origin.
|
|
68
|
+
*
|
|
69
|
+
* If a field supplies **neither** an anchor nor coordinates, the driver places **no tab** for it and
|
|
70
|
+
* lets the provider apply its own default. A recipient with an empty/absent `fields` array therefore
|
|
71
|
+
* produces no forced placement at all (the provider decides) — which is the correct behavior when
|
|
72
|
+
* the caller hasn't said where signing should happen.
|
|
73
|
+
*/
|
|
74
|
+
export interface SignatureFieldPlacement {
|
|
75
|
+
/** What to place. Defaults to `'signature'` when omitted. */
|
|
76
|
+
type?: SignatureFieldType;
|
|
77
|
+
/** Whether the signer must complete this field. Defaults to `true`. */
|
|
78
|
+
required?: boolean;
|
|
79
|
+
/** Marker text in the document to anchor this field to (e.g. `"Signature:"`). */
|
|
80
|
+
anchor?: string;
|
|
81
|
+
/** Horizontal offset from the anchor, in {@link anchorUnits}. */
|
|
82
|
+
anchorXOffset?: number;
|
|
83
|
+
/** Vertical offset from the anchor, in {@link anchorUnits}. */
|
|
84
|
+
anchorYOffset?: number;
|
|
85
|
+
/** Unit for the anchor offsets. Defaults to `'pixels'`. */
|
|
86
|
+
anchorUnits?: SignatureAnchorUnits;
|
|
87
|
+
/** When true, don't error if the anchor string isn't found — just skip this field. Defaults to true. */
|
|
88
|
+
anchorIgnoreIfNotPresent?: boolean;
|
|
89
|
+
/** 1-based page number to place the field on. Drivers adjust for 0-based APIs. */
|
|
90
|
+
page?: number;
|
|
91
|
+
/** X position as a percentage (0–100) of the page width. */
|
|
92
|
+
xPercent?: number;
|
|
93
|
+
/** Y position as a percentage (0–100) of the page height, measured from the top. */
|
|
94
|
+
yPercent?: number;
|
|
95
|
+
/**
|
|
96
|
+
* The target page's true width/height **in PDF points** (1/72"), when known. A drag-and-drop
|
|
97
|
+
* placer that renders the actual document knows each page's real size, so it should pass these —
|
|
98
|
+
* they let each provider convert the {@link xPercent}/{@link yPercent} against the ACTUAL page
|
|
99
|
+
* rather than assuming US-Letter. Omit them only when the page size is genuinely unknown, in
|
|
100
|
+
* which case drivers fall back to a US-Letter assumption (correct for Letter docs, off for A4 /
|
|
101
|
+
* legal / landscape). Percentages stay page-size-independent; these just make the back-conversion
|
|
102
|
+
* exact for non-Letter pages.
|
|
103
|
+
*/
|
|
104
|
+
pageWidthPt?: number;
|
|
105
|
+
pageHeightPt?: number;
|
|
106
|
+
/** Which document (1-based index into the envelope's documents) this field targets. Defaults to
|
|
107
|
+
* all documents when omitted (a signature is typically wanted on every document). */
|
|
108
|
+
documentIndex?: number;
|
|
109
|
+
}
|
|
46
110
|
/** A signer to be added to an envelope. */
|
|
47
111
|
export interface SignatureRecipientInput {
|
|
48
112
|
email: string;
|
|
@@ -51,6 +115,13 @@ export interface SignatureRecipientInput {
|
|
|
51
115
|
routingOrder?: number;
|
|
52
116
|
/** Template role name, when using {@link BaseSignatureProvider.ApplyTemplate}. */
|
|
53
117
|
role?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Fields to place for this signer (signature, date, initials, …) and WHERE to place them. When
|
|
120
|
+
* omitted or empty, the driver emits no explicit placement and the provider applies its own
|
|
121
|
+
* default — see {@link SignatureFieldPlacement}. Prefer anchor-string placement; fall back to
|
|
122
|
+
* normalized coordinates only when the document has no usable marker.
|
|
123
|
+
*/
|
|
124
|
+
fields?: SignatureFieldPlacement[];
|
|
54
125
|
}
|
|
55
126
|
/** A document to include in an envelope. */
|
|
56
127
|
export interface SignatureDocumentInput {
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GACxB,gBAAgB,GAChB,mBAAmB,GACnB,wBAAwB,GACxB,cAAc,GACd,0BAA0B,GAC1B,eAAe,GACf,oBAAoB,GACpB,mBAAmB,GACnB,wBAAwB,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,qDAAqD;IACrD,UAAU,EAAE,uBAAuB,EAAE,CAAC;IACtC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,yBAAyB,GAAG,UAAU,GAAG,QAAQ,GAAG,eAAe,CAAC;AAEhF;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACrC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,MAAM,EAAE,cAAc,CAAC;IACvB,wCAAwC;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,GAAG,EAAE,OAAO,CAAC;CAChB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/esignature",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.44.0",
|
|
4
4
|
"description": "MemberJunction eSignature primitive — pluggable provider contract and normalized types for sending documents for electronic signature (DocuSign, Adobe Sign, …). The optional server engine is exposed via the '@memberjunction/esignature/server' subpath.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"url": "https://github.com/MemberJunction/MJ"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@memberjunction/global": "5.
|
|
42
|
-
"@memberjunction/core": "5.
|
|
43
|
-
"@memberjunction/core-entities": "5.
|
|
44
|
-
"@memberjunction/credentials": "5.
|
|
45
|
-
"@memberjunction/storage": "5.
|
|
41
|
+
"@memberjunction/global": "5.44.0",
|
|
42
|
+
"@memberjunction/core": "5.44.0",
|
|
43
|
+
"@memberjunction/core-entities": "5.44.0",
|
|
44
|
+
"@memberjunction/credentials": "5.44.0",
|
|
45
|
+
"@memberjunction/storage": "5.44.0"
|
|
46
46
|
}
|
|
47
47
|
}
|