@memberjunction/esignature-pandadoc 5.40.0 → 5.40.2

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.
Files changed (2) hide show
  1. package/README.md +113 -0
  2. package/package.json +3 -3
package/README.md ADDED
@@ -0,0 +1,113 @@
1
+ [← Back to eSignature Overview](../../README.md) · [Core Primitive](../../Base/README.md)
2
+
3
+ # @memberjunction/esignature-pandadoc
4
+
5
+ The **PandaDoc** driver for the MemberJunction eSignature subsystem. It implements the [`BaseSignatureProvider`](../../Base/README.md#the-provider-contract-basesignatureprovider) contract against the PandaDoc public REST API `v1`, using simple API-key authentication.
6
+
7
+ ```bash
8
+ npm install @memberjunction/esignature-pandadoc
9
+ ```
10
+
11
+ > You don't call this package directly. You configure a PandaDoc **Signature Account** and use the [`SignatureEngine`](../../Base/README.md#the-engines) (or the [no-code Actions](../../Base/README.md#using-the-actions-no-code)). The engine resolves and drives this provider for you.
12
+
13
+ ---
14
+
15
+ ## At a glance
16
+
17
+ | | |
18
+ |---|---|
19
+ | **Driver key** | `PandaDoc` |
20
+ | **Registration** | `@RegisterClass(BaseSignatureProvider, 'PandaDoc')` |
21
+ | **Authentication** | API key (`Authorization: API-Key …`) |
22
+ | **API** | PandaDoc public REST API `v1` |
23
+ | **Webhooks** | HMAC-verified |
24
+
25
+ ### Supported operations
26
+
27
+ | Operation | Supported |
28
+ |---|:---:|
29
+ | Create envelope | ✅ |
30
+ | Get status | ✅ |
31
+ | Download signed | ✅ |
32
+ | Void | ✅ |
33
+ | Parse webhook event | ✅ |
34
+ | Verify webhook signature | ✅ |
35
+ | Templates | — |
36
+ | Embedded signing | — |
37
+
38
+ ---
39
+
40
+ ## A note on document readiness
41
+
42
+ PandaDoc processes an uploaded document asynchronously — a freshly created document isn't immediately in a sendable `draft` state. The driver handles this for you: after creating a document it **polls** until the document reaches `draft`, then sends it. The poll interval is tunable via `readinessIntervalMs` (default `1500` ms).
43
+
44
+ ```mermaid
45
+ flowchart LR
46
+ Create["Create document"] --> Poll{"draft yet?"}
47
+ Poll -->|no| Wait["wait readinessIntervalMs"]
48
+ Wait --> Poll
49
+ Poll -->|yes| Send["Send for signature"]
50
+
51
+ style Send fill:#2d8659,stroke:#1a5c3a,color:#fff
52
+ ```
53
+
54
+ ---
55
+
56
+ ## Configuration
57
+
58
+ These values live in the account's **Credential** (encrypted via the [Credential Engine](../../../Credentials)) — never in code or environment variables.
59
+
60
+ | Key | Required | Default | Description |
61
+ |---|:---:|---|---|
62
+ | `apiKey` | ✅ | — | PandaDoc API key, sent as `Authorization: API-Key <key>`. |
63
+ | `restBase` | — | `https://api.pandadoc.com/public/v1` | REST API base. |
64
+ | `connectHmacKey` | — | — | HMAC secret for verifying inbound webhooks. **Set this in production.** |
65
+ | `readinessIntervalMs` | — | `1500` | Poll interval (ms) while waiting for an uploaded document to reach `draft`. |
66
+
67
+ ### One-time setup
68
+
69
+ 1. In PandaDoc, generate an **API key** (Settings → API).
70
+ 2. In MemberJunction:
71
+ - The **PandaDoc** Signature Provider row is already seeded.
72
+ - Create a **Credential** holding `apiKey`.
73
+ - Create a **Signature Account** pointing at that credential.
74
+ 3. (Production) Configure a PandaDoc webhook pointing at `POST {your-server}/esignature/webhook/PandaDoc`, and store its HMAC secret as `connectHmacKey`.
75
+
76
+ ---
77
+
78
+ ## Status mapping
79
+
80
+ PandaDoc's native document statuses map onto MemberJunction's [normalized lifecycle](../../Base/README.md#status):
81
+
82
+ | PandaDoc status | MJ `EnvelopeStatus` |
83
+ |---|---|
84
+ | `document.uploaded`, `document.draft` | `Draft` |
85
+ | `document.sent`, `document.waiting_approval`, `document.approved`, `document.waiting_pay` | `Sent` |
86
+ | `document.viewed` | `Delivered` |
87
+ | `document.completed`, `document.paid` | `Completed` |
88
+ | `document.declined` | `Declined` |
89
+ | `document.voided`, `document.cancelled` | `Voided` |
90
+
91
+ ---
92
+
93
+ ## Webhooks
94
+
95
+ PandaDoc pushes events to `POST /esignature/webhook/PandaDoc`. The driver verifies the HMAC signature (from the `signature` query parameter or `x-pandadoc-signature` header) over the raw request body using your `connectHmacKey`. See the [webhook flow](../../Base/README.md#inbound-webhooks).
96
+
97
+ ---
98
+
99
+ ## Testing
100
+
101
+ ```bash
102
+ cd packages/eSignature/Providers/PandaDoc && npm run test
103
+ ```
104
+
105
+ ---
106
+
107
+ ## Related
108
+
109
+ | | |
110
+ |---|---|
111
+ | [eSignature overview](../../README.md) | The whole subsystem. |
112
+ | [Core primitive](../../Base/README.md) | The contract, engine, and data model this driver plugs into. |
113
+ | [DocuSign driver](../DocuSign/README.md) · [Dropbox Sign driver](../DropboxSign/README.md) | Sibling providers. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/esignature-pandadoc",
3
- "version": "5.40.0",
3
+ "version": "5.40.2",
4
4
  "description": "PandaDoc driver for the MemberJunction eSignature primitive. Registers a BaseSignatureProvider implementation via @RegisterClass(BaseSignatureProvider, 'PandaDoc') using the PandaDoc public v1 REST API and API-key authentication.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -21,7 +21,7 @@
21
21
  "url": "https://github.com/MemberJunction/MJ"
22
22
  },
23
23
  "dependencies": {
24
- "@memberjunction/esignature": "5.40.0",
25
- "@memberjunction/global": "5.40.0"
24
+ "@memberjunction/esignature": "5.40.2",
25
+ "@memberjunction/global": "5.40.2"
26
26
  }
27
27
  }