@memberjunction/esignature-dropboxsign 0.0.1 → 5.40.1
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/DropboxSignSignatureProvider.d.ts +57 -0
- package/dist/DropboxSignSignatureProvider.d.ts.map +1 -0
- package/dist/DropboxSignSignatureProvider.js +323 -0
- package/dist/DropboxSignSignatureProvider.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/package.json +24 -7
- package/README.md +0 -45
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { BaseSignatureProvider, CreateEnvelopeRequest, EnvelopeResult, EnvelopeStatus, EnvelopeStatusResult, NormalizedSignatureEvent, OperationResult, SignatureOperation, SignatureProviderConfig, SignedDocumentResult, WebhookVerificationResult } from '@memberjunction/esignature';
|
|
2
|
+
/**
|
|
3
|
+
* Maps a Dropbox Sign signature-request / signature state onto our normalized lifecycle.
|
|
4
|
+
*
|
|
5
|
+
* Dropbox Sign exposes status via booleans on the request (`is_complete`, `is_declined`) and a
|
|
6
|
+
* per-signature `status_code` (`awaiting_signature`, `signed`, `declined`, `on_hold`, `error`).
|
|
7
|
+
*/
|
|
8
|
+
export declare function mapDropboxSignStatus(statusCode: string): EnvelopeStatus;
|
|
9
|
+
/**
|
|
10
|
+
* Dropbox Sign (formerly HelloSign) driver for the MemberJunction eSignature primitive — v3 REST
|
|
11
|
+
* integration with API-key (HTTP Basic) authentication. Resolved by the engine through
|
|
12
|
+
* `MJGlobal.ClassFactory` by the key `'DropboxSign'`.
|
|
13
|
+
*
|
|
14
|
+
* Credentials are injected by the engine via {@link initialize} (resolved + decrypted from the
|
|
15
|
+
* Credential Engine); this provider does not read environment variables.
|
|
16
|
+
*/
|
|
17
|
+
export declare class DropboxSignSignatureProvider extends BaseSignatureProvider {
|
|
18
|
+
protected readonly providerKey = "DropboxSign";
|
|
19
|
+
private config;
|
|
20
|
+
initialize(config: SignatureProviderConfig): Promise<void>;
|
|
21
|
+
get IsConfigured(): boolean;
|
|
22
|
+
getSupportedOperations(): SignatureOperation[];
|
|
23
|
+
CreateEnvelope(req: CreateEnvelopeRequest): Promise<EnvelopeResult>;
|
|
24
|
+
GetEnvelopeStatus(externalEnvelopeId: string): Promise<EnvelopeStatusResult>;
|
|
25
|
+
DownloadSignedDocument(externalEnvelopeId: string): Promise<SignedDocumentResult>;
|
|
26
|
+
VoidEnvelope(externalEnvelopeId: string, _reason: string): Promise<OperationResult>;
|
|
27
|
+
/**
|
|
28
|
+
* Normalize a Dropbox Sign event callback. The payload is `{ event: { event_type, event_time,
|
|
29
|
+
* event_hash }, signature_request: { signature_request_id, ... } }`. We map the request state
|
|
30
|
+
* (not the event name) so the normalized status reflects the current envelope state.
|
|
31
|
+
*/
|
|
32
|
+
ParseWebhookEvent(payload: unknown, _headers: Record<string, string>): NormalizedSignatureEvent | null;
|
|
33
|
+
/**
|
|
34
|
+
* Verify a Dropbox Sign callback. Dropbox Sign computes `event_hash = HMAC-SHA256(event_time +
|
|
35
|
+
* event_type, apiKey)` and includes it in the payload's `event` object. We recompute and compare
|
|
36
|
+
* in constant time. Fails closed when no key/material is available.
|
|
37
|
+
*/
|
|
38
|
+
VerifyWebhookSignature(_rawBody: Buffer | undefined, _headers: Record<string, string>, payload?: unknown): WebhookVerificationResult;
|
|
39
|
+
private buildSendForm;
|
|
40
|
+
/** Derive a normalized status from the request booleans + first signature's status code. */
|
|
41
|
+
private deriveRequestStatus;
|
|
42
|
+
private mapRecipients;
|
|
43
|
+
private authHeaders;
|
|
44
|
+
private errorText;
|
|
45
|
+
private errorMessage;
|
|
46
|
+
private notConfiguredMessage;
|
|
47
|
+
/** Dropbox Sign event_time is unix seconds (string). Convert to ISO; fall back to now. */
|
|
48
|
+
private eventTimeToIso;
|
|
49
|
+
/** Constant-time hex comparison; false on length mismatch. `Uint8Array.from` strips the
|
|
50
|
+
* Buffer→ArrayBufferLike narrowing TS 5.9's node:crypto typings reject. */
|
|
51
|
+
private safeEqualHex;
|
|
52
|
+
private asRecord;
|
|
53
|
+
private readField;
|
|
54
|
+
private readString;
|
|
55
|
+
private readBoolean;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=DropboxSignSignatureProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropboxSignSignatureProvider.d.ts","sourceRoot":"","sources":["../src/DropboxSignSignatureProvider.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,qBAAqB,EACrB,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,wBAAwB,EACxB,eAAe,EAEf,kBAAkB,EAClB,uBAAuB,EACvB,oBAAoB,EACpB,yBAAyB,EAC5B,MAAM,4BAA4B,CAAC;AAiBpC;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,CAevE;AAKD;;;;;;;GAOG;AACH,qBACa,4BAA6B,SAAQ,qBAAqB;IACnE,SAAS,CAAC,QAAQ,CAAC,WAAW,iBAAiB;IAE/C,OAAO,CAAC,MAAM,CAAkC;IAEnC,UAAU,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;IAcvE,IAAW,YAAY,IAAI,OAAO,CAEjC;IAEM,sBAAsB,IAAI,kBAAkB,EAAE;IAaxC,cAAc,CAAC,GAAG,EAAE,qBAAqB,GAAG,OAAO,CAAC,cAAc,CAAC;IAqCnE,iBAAiB,CAAC,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IA2B5E,sBAAsB,CAAC,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAuBjF,YAAY,CAAC,kBAAkB,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAsBhG;;;;OAIG;IACI,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,wBAAwB,GAAG,IAAI;IAiB7G;;;;OAIG;IACI,sBAAsB,CACzB,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAChC,OAAO,CAAC,EAAE,OAAO,GAClB,yBAAyB;IAqB5B,OAAO,CAAC,aAAa;IA0BrB,4FAA4F;IAC5F,OAAO,CAAC,mBAAmB;IAc3B,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,WAAW;YAML,SAAS;IAKvB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,oBAAoB;IAI5B,0FAA0F;IAC1F,OAAO,CAAC,cAAc;IAQtB;gFAC4E;IAC5E,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,SAAS;IAKjB,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,WAAW;CAItB"}
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { createHmac, timingSafeEqual } from 'node:crypto';
|
|
8
|
+
import { RegisterClass } from '@memberjunction/global';
|
|
9
|
+
import { BaseSignatureProvider, } from '@memberjunction/esignature';
|
|
10
|
+
/**
|
|
11
|
+
* Maps a Dropbox Sign signature-request / signature state onto our normalized lifecycle.
|
|
12
|
+
*
|
|
13
|
+
* Dropbox Sign exposes status via booleans on the request (`is_complete`, `is_declined`) and a
|
|
14
|
+
* per-signature `status_code` (`awaiting_signature`, `signed`, `declined`, `on_hold`, `error`).
|
|
15
|
+
*/
|
|
16
|
+
export function mapDropboxSignStatus(statusCode) {
|
|
17
|
+
switch ((statusCode || '').toLowerCase()) {
|
|
18
|
+
case 'awaiting_signature':
|
|
19
|
+
return 'Sent';
|
|
20
|
+
case 'on_hold':
|
|
21
|
+
return 'Delivered';
|
|
22
|
+
case 'signed':
|
|
23
|
+
return 'Signed';
|
|
24
|
+
case 'declined':
|
|
25
|
+
return 'Declined';
|
|
26
|
+
case 'error':
|
|
27
|
+
return 'Unknown';
|
|
28
|
+
default:
|
|
29
|
+
return 'Unknown';
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/** Header carrying the event payload's HMAC when Dropbox Sign is configured to sign callbacks. */
|
|
33
|
+
const DROPBOX_SIGN_EVENT_HASH_FIELD = 'event_hash';
|
|
34
|
+
/**
|
|
35
|
+
* Dropbox Sign (formerly HelloSign) driver for the MemberJunction eSignature primitive — v3 REST
|
|
36
|
+
* integration with API-key (HTTP Basic) authentication. Resolved by the engine through
|
|
37
|
+
* `MJGlobal.ClassFactory` by the key `'DropboxSign'`.
|
|
38
|
+
*
|
|
39
|
+
* Credentials are injected by the engine via {@link initialize} (resolved + decrypted from the
|
|
40
|
+
* Credential Engine); this provider does not read environment variables.
|
|
41
|
+
*/
|
|
42
|
+
let DropboxSignSignatureProvider = class DropboxSignSignatureProvider extends BaseSignatureProvider {
|
|
43
|
+
constructor() {
|
|
44
|
+
super(...arguments);
|
|
45
|
+
this.providerKey = 'DropboxSign';
|
|
46
|
+
this.config = null;
|
|
47
|
+
}
|
|
48
|
+
async initialize(config) {
|
|
49
|
+
const apiKey = this.readString(config, 'apiKey');
|
|
50
|
+
if (!apiKey) {
|
|
51
|
+
this.config = null;
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
this.config = {
|
|
55
|
+
apiKey,
|
|
56
|
+
restBase: this.readString(config, 'restBase') || 'https://api.hellosign.com/v3',
|
|
57
|
+
testMode: this.readBoolean(config, 'testMode'),
|
|
58
|
+
connectHmacKey: this.readString(config, 'connectHmacKey'),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
get IsConfigured() {
|
|
62
|
+
return this.config !== null;
|
|
63
|
+
}
|
|
64
|
+
getSupportedOperations() {
|
|
65
|
+
return [
|
|
66
|
+
'CreateEnvelope',
|
|
67
|
+
'GetEnvelopeStatus',
|
|
68
|
+
'DownloadSignedDocument',
|
|
69
|
+
'VoidEnvelope',
|
|
70
|
+
'ParseWebhookEvent',
|
|
71
|
+
'VerifyWebhookSignature',
|
|
72
|
+
];
|
|
73
|
+
}
|
|
74
|
+
// ---- Core operations -------------------------------------------------------------------------
|
|
75
|
+
async CreateEnvelope(req) {
|
|
76
|
+
const config = this.config;
|
|
77
|
+
if (!config) {
|
|
78
|
+
return { Success: false, ErrorMessage: this.notConfiguredMessage() };
|
|
79
|
+
}
|
|
80
|
+
if (!req.documents?.length) {
|
|
81
|
+
return { Success: false, ErrorMessage: 'No documents were provided to sign.' };
|
|
82
|
+
}
|
|
83
|
+
if (!req.recipients?.length) {
|
|
84
|
+
return { Success: false, ErrorMessage: 'No recipients were provided.' };
|
|
85
|
+
}
|
|
86
|
+
try {
|
|
87
|
+
const form = this.buildSendForm(req, config);
|
|
88
|
+
const resp = await fetch(`${config.restBase}/signature_request/send`, {
|
|
89
|
+
method: 'POST',
|
|
90
|
+
headers: this.authHeaders(config),
|
|
91
|
+
body: form,
|
|
92
|
+
});
|
|
93
|
+
if (!resp.ok) {
|
|
94
|
+
return { Success: false, ErrorMessage: await this.errorText('signature request send', resp) };
|
|
95
|
+
}
|
|
96
|
+
const json = (await resp.json());
|
|
97
|
+
const request = json.signature_request;
|
|
98
|
+
if (!request?.signature_request_id) {
|
|
99
|
+
return { Success: false, ErrorMessage: 'Dropbox Sign did not return a signature_request_id.' };
|
|
100
|
+
}
|
|
101
|
+
return {
|
|
102
|
+
Success: true,
|
|
103
|
+
externalEnvelopeId: request.signature_request_id,
|
|
104
|
+
status: this.deriveRequestStatus(request, req.sendImmediately),
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
catch (e) {
|
|
108
|
+
return { Success: false, ErrorMessage: this.errorMessage(e) };
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
async GetEnvelopeStatus(externalEnvelopeId) {
|
|
112
|
+
const config = this.config;
|
|
113
|
+
if (!config) {
|
|
114
|
+
return { Success: false, status: 'Unknown', ErrorMessage: this.notConfiguredMessage() };
|
|
115
|
+
}
|
|
116
|
+
try {
|
|
117
|
+
const resp = await fetch(`${config.restBase}/signature_request/${encodeURIComponent(externalEnvelopeId)}`, {
|
|
118
|
+
headers: this.authHeaders(config),
|
|
119
|
+
});
|
|
120
|
+
if (!resp.ok) {
|
|
121
|
+
return { Success: false, status: 'Unknown', ErrorMessage: await this.errorText('status check', resp) };
|
|
122
|
+
}
|
|
123
|
+
const json = (await resp.json());
|
|
124
|
+
const request = json.signature_request;
|
|
125
|
+
if (!request) {
|
|
126
|
+
return { Success: false, status: 'Unknown', ErrorMessage: 'Dropbox Sign returned no signature_request.' };
|
|
127
|
+
}
|
|
128
|
+
return {
|
|
129
|
+
Success: true,
|
|
130
|
+
status: this.deriveRequestStatus(request),
|
|
131
|
+
recipients: this.mapRecipients(request),
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
catch (e) {
|
|
135
|
+
return { Success: false, status: 'Unknown', ErrorMessage: this.errorMessage(e) };
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
async DownloadSignedDocument(externalEnvelopeId) {
|
|
139
|
+
const config = this.config;
|
|
140
|
+
if (!config) {
|
|
141
|
+
return { Success: false, ErrorMessage: this.notConfiguredMessage() };
|
|
142
|
+
}
|
|
143
|
+
try {
|
|
144
|
+
const resp = await fetch(`${config.restBase}/signature_request/files/${encodeURIComponent(externalEnvelopeId)}?file_type=pdf`, { headers: this.authHeaders(config) });
|
|
145
|
+
if (!resp.ok) {
|
|
146
|
+
return { Success: false, ErrorMessage: await this.errorText('document download', resp) };
|
|
147
|
+
}
|
|
148
|
+
const bytes = Buffer.from(await resp.arrayBuffer());
|
|
149
|
+
return {
|
|
150
|
+
Success: true,
|
|
151
|
+
document: { bytes, filename: `${externalEnvelopeId}.pdf`, contentType: 'application/pdf' },
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
catch (e) {
|
|
155
|
+
return { Success: false, ErrorMessage: this.errorMessage(e) };
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
async VoidEnvelope(externalEnvelopeId, _reason) {
|
|
159
|
+
const config = this.config;
|
|
160
|
+
if (!config) {
|
|
161
|
+
return { Success: false, ErrorMessage: this.notConfiguredMessage() };
|
|
162
|
+
}
|
|
163
|
+
try {
|
|
164
|
+
// Dropbox Sign cancels an in-flight request (no reason field on the API).
|
|
165
|
+
const resp = await fetch(`${config.restBase}/signature_request/cancel/${encodeURIComponent(externalEnvelopeId)}`, {
|
|
166
|
+
method: 'POST',
|
|
167
|
+
headers: this.authHeaders(config),
|
|
168
|
+
});
|
|
169
|
+
if (!resp.ok) {
|
|
170
|
+
return { Success: false, ErrorMessage: await this.errorText('cancel', resp) };
|
|
171
|
+
}
|
|
172
|
+
return { Success: true };
|
|
173
|
+
}
|
|
174
|
+
catch (e) {
|
|
175
|
+
return { Success: false, ErrorMessage: this.errorMessage(e) };
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
// ---- Inbound webhook -------------------------------------------------------------------------
|
|
179
|
+
/**
|
|
180
|
+
* Normalize a Dropbox Sign event callback. The payload is `{ event: { event_type, event_time,
|
|
181
|
+
* event_hash }, signature_request: { signature_request_id, ... } }`. We map the request state
|
|
182
|
+
* (not the event name) so the normalized status reflects the current envelope state.
|
|
183
|
+
*/
|
|
184
|
+
ParseWebhookEvent(payload, _headers) {
|
|
185
|
+
const root = this.asRecord(payload);
|
|
186
|
+
const request = this.asRecord(root?.signature_request);
|
|
187
|
+
const envelopeId = this.readField(request, 'signature_request_id');
|
|
188
|
+
if (!envelopeId) {
|
|
189
|
+
return null;
|
|
190
|
+
}
|
|
191
|
+
const event = this.asRecord(root?.event);
|
|
192
|
+
const occurredAt = this.eventTimeToIso(this.readField(event, 'event_time'));
|
|
193
|
+
return {
|
|
194
|
+
externalEnvelopeId: envelopeId,
|
|
195
|
+
status: this.deriveRequestStatus(request),
|
|
196
|
+
occurredAt,
|
|
197
|
+
raw: payload,
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Verify a Dropbox Sign callback. Dropbox Sign computes `event_hash = HMAC-SHA256(event_time +
|
|
202
|
+
* event_type, apiKey)` and includes it in the payload's `event` object. We recompute and compare
|
|
203
|
+
* in constant time. Fails closed when no key/material is available.
|
|
204
|
+
*/
|
|
205
|
+
VerifyWebhookSignature(_rawBody, _headers, payload) {
|
|
206
|
+
// Dropbox Sign signs callbacks with the account API key by default; an explicit connectHmacKey
|
|
207
|
+
// overrides it. Since the apiKey is always present on a configured driver, verification is
|
|
208
|
+
// effectively always enforced for Dropbox Sign.
|
|
209
|
+
const secret = this.config?.connectHmacKey || this.config?.apiKey;
|
|
210
|
+
if (!secret) {
|
|
211
|
+
return 'NotConfigured';
|
|
212
|
+
}
|
|
213
|
+
const event = this.asRecord(this.asRecord(payload)?.event);
|
|
214
|
+
const provided = this.readField(event, DROPBOX_SIGN_EVENT_HASH_FIELD);
|
|
215
|
+
const eventTime = this.readField(event, 'event_time');
|
|
216
|
+
const eventType = this.readField(event, 'event_type');
|
|
217
|
+
if (!provided || !eventTime || !eventType) {
|
|
218
|
+
return 'Failed';
|
|
219
|
+
}
|
|
220
|
+
const expected = createHmac('sha256', secret).update(`${eventTime}${eventType}`, 'utf8').digest('hex');
|
|
221
|
+
return this.safeEqualHex(provided, expected) ? 'Verified' : 'Failed';
|
|
222
|
+
}
|
|
223
|
+
// ---- Request construction --------------------------------------------------------------------
|
|
224
|
+
buildSendForm(req, config) {
|
|
225
|
+
const form = new FormData();
|
|
226
|
+
form.append('title', req.title || 'Please sign this document');
|
|
227
|
+
form.append('subject', req.title || 'Please sign this document');
|
|
228
|
+
if (req.message) {
|
|
229
|
+
form.append('message', req.message);
|
|
230
|
+
}
|
|
231
|
+
form.append('test_mode', config.testMode ? '1' : '0');
|
|
232
|
+
req.documents.forEach((doc, i) => {
|
|
233
|
+
const blob = new Blob([new Uint8Array(doc.bytes)], { type: doc.contentType || 'application/pdf' });
|
|
234
|
+
form.append(`file[${i}]`, blob, doc.filename);
|
|
235
|
+
});
|
|
236
|
+
req.recipients.forEach((r, i) => {
|
|
237
|
+
form.append(`signers[${i}][email_address]`, r.email);
|
|
238
|
+
form.append(`signers[${i}][name]`, r.name || r.email);
|
|
239
|
+
form.append(`signers[${i}][order]`, String(r.routingOrder ?? i + 1));
|
|
240
|
+
});
|
|
241
|
+
Object.entries(req.metadata ?? {}).forEach(([key, value]) => {
|
|
242
|
+
form.append(`metadata[${key}]`, value);
|
|
243
|
+
});
|
|
244
|
+
return form;
|
|
245
|
+
}
|
|
246
|
+
/** Derive a normalized status from the request booleans + first signature's status code. */
|
|
247
|
+
deriveRequestStatus(request, sendImmediately) {
|
|
248
|
+
if (!request) {
|
|
249
|
+
return sendImmediately === false ? 'Draft' : 'Sent';
|
|
250
|
+
}
|
|
251
|
+
if (request.is_complete) {
|
|
252
|
+
return 'Completed';
|
|
253
|
+
}
|
|
254
|
+
if (request.is_declined) {
|
|
255
|
+
return 'Declined';
|
|
256
|
+
}
|
|
257
|
+
const sigStatus = request.signatures?.[0]?.status_code;
|
|
258
|
+
return sigStatus ? mapDropboxSignStatus(sigStatus) : 'Sent';
|
|
259
|
+
}
|
|
260
|
+
mapRecipients(request) {
|
|
261
|
+
if (!request.signatures?.length) {
|
|
262
|
+
return undefined;
|
|
263
|
+
}
|
|
264
|
+
return request.signatures.map((s) => ({
|
|
265
|
+
email: s.signer_email_address,
|
|
266
|
+
name: s.signer_name,
|
|
267
|
+
status: mapDropboxSignStatus(s.status_code || ''),
|
|
268
|
+
externalRecipientId: s.signature_id,
|
|
269
|
+
signedAt: s.signed_at ? this.eventTimeToIso(String(s.signed_at)) : undefined,
|
|
270
|
+
}));
|
|
271
|
+
}
|
|
272
|
+
// ---- HTTP + small helpers --------------------------------------------------------------------
|
|
273
|
+
authHeaders(config) {
|
|
274
|
+
// HTTP Basic with the API key as the username and an empty password.
|
|
275
|
+
const token = Buffer.from(`${config.apiKey}:`).toString('base64');
|
|
276
|
+
return { Authorization: `Basic ${token}` };
|
|
277
|
+
}
|
|
278
|
+
async errorText(operation, resp) {
|
|
279
|
+
const text = await resp.text().catch(() => '');
|
|
280
|
+
return `Dropbox Sign ${operation} failed (${resp.status}): ${text}`;
|
|
281
|
+
}
|
|
282
|
+
errorMessage(e) {
|
|
283
|
+
return e instanceof Error ? e.message : String(e);
|
|
284
|
+
}
|
|
285
|
+
notConfiguredMessage() {
|
|
286
|
+
return 'Dropbox Sign is not configured. Provide an apiKey via the Credential Engine.';
|
|
287
|
+
}
|
|
288
|
+
/** Dropbox Sign event_time is unix seconds (string). Convert to ISO; fall back to now. */
|
|
289
|
+
eventTimeToIso(eventTime) {
|
|
290
|
+
const seconds = Number(eventTime);
|
|
291
|
+
if (!eventTime || Number.isNaN(seconds)) {
|
|
292
|
+
return new Date().toISOString();
|
|
293
|
+
}
|
|
294
|
+
return new Date(seconds * 1000).toISOString();
|
|
295
|
+
}
|
|
296
|
+
/** Constant-time hex comparison; false on length mismatch. `Uint8Array.from` strips the
|
|
297
|
+
* Buffer→ArrayBufferLike narrowing TS 5.9's node:crypto typings reject. */
|
|
298
|
+
safeEqualHex(a, b) {
|
|
299
|
+
const bufA = Buffer.from(a, 'hex');
|
|
300
|
+
const bufB = Buffer.from(b, 'hex');
|
|
301
|
+
return bufA.length === bufB.length && timingSafeEqual(Uint8Array.from(bufA), Uint8Array.from(bufB));
|
|
302
|
+
}
|
|
303
|
+
asRecord(value) {
|
|
304
|
+
return value && typeof value === 'object' ? value : undefined;
|
|
305
|
+
}
|
|
306
|
+
readField(obj, key) {
|
|
307
|
+
const v = obj?.[key];
|
|
308
|
+
return typeof v === 'string' && v.length > 0 ? v : undefined;
|
|
309
|
+
}
|
|
310
|
+
readString(config, key) {
|
|
311
|
+
const value = config[key];
|
|
312
|
+
return typeof value === 'string' ? value : undefined;
|
|
313
|
+
}
|
|
314
|
+
readBoolean(config, key) {
|
|
315
|
+
const value = config[key];
|
|
316
|
+
return value === true || value === 'true' || value === 1 || value === '1';
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
DropboxSignSignatureProvider = __decorate([
|
|
320
|
+
RegisterClass(BaseSignatureProvider, 'DropboxSign')
|
|
321
|
+
], DropboxSignSignatureProvider);
|
|
322
|
+
export { DropboxSignSignatureProvider };
|
|
323
|
+
//# sourceMappingURL=DropboxSignSignatureProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropboxSignSignatureProvider.js","sourceRoot":"","sources":["../src/DropboxSignSignatureProvider.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EACH,qBAAqB,GAYxB,MAAM,4BAA4B,CAAC;AAiBpC;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,UAAkB;IACnD,QAAQ,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;QACvC,KAAK,oBAAoB;YACrB,OAAO,MAAM,CAAC;QAClB,KAAK,SAAS;YACV,OAAO,WAAW,CAAC;QACvB,KAAK,QAAQ;YACT,OAAO,QAAQ,CAAC;QACpB,KAAK,UAAU;YACX,OAAO,UAAU,CAAC;QACtB,KAAK,OA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CAAC;QAC1B,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,CAAC,IAAI,KAAK,KAAK,GAAG,CAAC;IAC9E,CAAC;CACJ,CAAA;AAnTY,4BAA4B;IADxC,aAAa,CAAC,qBAAqB,EAAE,aAAa,CAAC;GACvC,4BAA4B,CAmTxC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,gCAAgC,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// PUBLIC API SURFACE AREA
|
|
2
|
+
// Side-effect: importing this barrel registers the Dropbox Sign driver with MJGlobal.ClassFactory
|
|
3
|
+
// via the @RegisterClass decorator on DropboxSignSignatureProvider.
|
|
4
|
+
export * from './DropboxSignSignatureProvider.js';
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,kGAAkG;AAClG,oEAAoE;AACpE,cAAc,gCAAgC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/esignature-dropboxsign",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
"version": "5.40.1",
|
|
4
|
+
"description": "Dropbox Sign (formerly HelloSign) driver for the MemberJunction eSignature primitive. Registers a BaseSignatureProvider implementation via @RegisterClass(BaseSignatureProvider, 'DropboxSign') using the Dropbox Sign v3 REST API and API-key authentication.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"/dist"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "tsc && tsc-alias -f",
|
|
13
|
+
"watch": "tsc -w",
|
|
14
|
+
"test": "vitest run",
|
|
15
|
+
"test:watch": "vitest",
|
|
16
|
+
"test:coverage": "vitest run --coverage"
|
|
17
|
+
},
|
|
18
|
+
"license": "ISC",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/MemberJunction/MJ"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@memberjunction/esignature": "5.40.1",
|
|
25
|
+
"@memberjunction/global": "5.40.1"
|
|
26
|
+
}
|
|
10
27
|
}
|
package/README.md
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
# @memberjunction/esignature-dropboxsign
|
|
2
|
-
|
|
3
|
-
## ⚠️ IMPORTANT NOTICE ⚠️
|
|
4
|
-
|
|
5
|
-
**This package is created solely for the purpose of setting up OIDC (OpenID Connect) trusted publishing with npm.**
|
|
6
|
-
|
|
7
|
-
This is **NOT** a functional package and contains **NO** code or functionality beyond the OIDC setup configuration.
|
|
8
|
-
|
|
9
|
-
## Purpose
|
|
10
|
-
|
|
11
|
-
This package exists to:
|
|
12
|
-
1. Configure OIDC trusted publishing for the package name `@memberjunction/esignature-dropboxsign`
|
|
13
|
-
2. Enable secure, token-less publishing from CI/CD workflows
|
|
14
|
-
3. Establish provenance for packages published under this name
|
|
15
|
-
|
|
16
|
-
## What is OIDC Trusted Publishing?
|
|
17
|
-
|
|
18
|
-
OIDC trusted publishing allows package maintainers to publish packages directly from their CI/CD workflows without needing to manage npm access tokens. Instead, it uses OpenID Connect to establish trust between the CI/CD provider (like GitHub Actions) and npm.
|
|
19
|
-
|
|
20
|
-
## Setup Instructions
|
|
21
|
-
|
|
22
|
-
To properly configure OIDC trusted publishing for this package:
|
|
23
|
-
|
|
24
|
-
1. Go to [npmjs.com](https://www.npmjs.com/) and navigate to your package settings
|
|
25
|
-
2. Configure the trusted publisher (e.g., GitHub Actions)
|
|
26
|
-
3. Specify the repository and workflow that should be allowed to publish
|
|
27
|
-
4. Use the configured workflow to publish your actual package
|
|
28
|
-
|
|
29
|
-
## DO NOT USE THIS PACKAGE
|
|
30
|
-
|
|
31
|
-
This package is a placeholder for OIDC configuration only. It:
|
|
32
|
-
- Contains no executable code
|
|
33
|
-
- Provides no functionality
|
|
34
|
-
- Should not be installed as a dependency
|
|
35
|
-
- Exists only for administrative purposes
|
|
36
|
-
|
|
37
|
-
## More Information
|
|
38
|
-
|
|
39
|
-
For more details about npm's trusted publishing feature, see:
|
|
40
|
-
- [npm Trusted Publishing Documentation](https://docs.npmjs.com/generating-provenance-statements)
|
|
41
|
-
- [GitHub Actions OIDC Documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect)
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
**Maintained for OIDC setup purposes only**
|