@probo/n8n-nodes-probo 0.198.0 → 0.200.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/README.md +138 -0
- package/dist/credentials/ProboApi.credentials.js +1 -1
- package/dist/credentials/ProboApi.credentials.js.map +1 -1
- package/dist/nodes/Probo/Probo.node.js +0 -6
- package/dist/nodes/Probo/Probo.node.js.map +1 -1
- package/dist/nodes/Probo/Probo.node.json +2 -2
- package/dist/nodes/Probo/actions/document/getSignature.operation.js +3 -0
- package/dist/nodes/Probo/actions/document/getSignature.operation.js.map +1 -1
- package/dist/nodes/Probo/actions/webhook/create.operation.js +2 -14
- package/dist/nodes/Probo/actions/webhook/create.operation.js.map +1 -1
- package/dist/nodes/Probo/actions/webhook/events.d.ts +2 -0
- package/dist/nodes/Probo/actions/webhook/events.js +33 -0
- package/dist/nodes/Probo/actions/webhook/events.js.map +1 -0
- package/dist/nodes/Probo/actions/webhook/update.operation.js +2 -14
- package/dist/nodes/Probo/actions/webhook/update.operation.js.map +1 -1
- package/dist/nodes/ProboTrigger/ProboTrigger.node.d.ts +12 -0
- package/dist/nodes/ProboTrigger/ProboTrigger.node.js +265 -0
- package/dist/nodes/ProboTrigger/ProboTrigger.node.js.map +1 -0
- package/dist/nodes/ProboTrigger/ProboTrigger.node.json +19 -0
- package/dist/package.json +3 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -2
package/README.md
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# @probo/n8n-nodes-probo
|
|
2
|
+
|
|
3
|
+
n8n community node package for the [Probo](https://www.probo.com) compliance platform. Automate compliance workflows — manage controls, documents, risks, vendors, cookie banners, and more — over the Probo GraphQL API.
|
|
4
|
+
|
|
5
|
+
This package provides two nodes:
|
|
6
|
+
|
|
7
|
+
| Node | Type | Description |
|
|
8
|
+
|------|------|-------------|
|
|
9
|
+
| **Probo** | Action | Read and write Probo resources (tasks, documents, controls, organizations, and 30+ other resources) |
|
|
10
|
+
| **Probo Trigger** | Trigger | Start a workflow when Probo webhook events occur (document published, user created, obligation updated, and more) |
|
|
11
|
+
|
|
12
|
+
## Requirements
|
|
13
|
+
|
|
14
|
+
- A self-hosted n8n instance with [community nodes enabled](https://docs.n8n.io/hosting/configuration/configuration-examples/community-nodes/)
|
|
15
|
+
- A Probo account with an API key
|
|
16
|
+
- n8n 1.0+ (uses the community node package format)
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
Install the package from npm on your self-hosted n8n instance. Only users with the **Owner** or **Admin** role can install community nodes.
|
|
21
|
+
|
|
22
|
+
### GUI installation (recommended)
|
|
23
|
+
|
|
24
|
+
1. In n8n, go to **Settings → Community Nodes**.
|
|
25
|
+
2. Click **Install**.
|
|
26
|
+
3. Enter the npm package name:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
@probo/n8n-nodes-probo
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
To pin a specific version, append it (for example `@probo/n8n-nodes-probo@0.199.0`).
|
|
33
|
+
|
|
34
|
+
4. Accept the community node risk notice and click **Install**.
|
|
35
|
+
5. Restart n8n if the new nodes do not appear in the node palette immediately.
|
|
36
|
+
|
|
37
|
+
See the [n8n GUI installation guide](https://docs.n8n.io/integrations/community-nodes/installation-and-management/gui-installation/) for details.
|
|
38
|
+
|
|
39
|
+
### Manual installation
|
|
40
|
+
|
|
41
|
+
If you run n8n in Docker or queue mode, you can install the package manually:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
mkdir -p ~/.n8n/nodes
|
|
45
|
+
cd ~/.n8n/nodes
|
|
46
|
+
npm install @probo/n8n-nodes-probo
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Restart n8n after installation. See the [manual installation guide](https://docs.n8n.io/integrations/community-nodes/installation/manual-install/) for upgrade and downgrade steps.
|
|
50
|
+
|
|
51
|
+
## Credentials
|
|
52
|
+
|
|
53
|
+
All Probo nodes use the **Probo API** credential type. The node sends your API key as a `Bearer` token on every request.
|
|
54
|
+
|
|
55
|
+
### Configure credentials in n8n
|
|
56
|
+
|
|
57
|
+
1. Add a **Probo** or **Probo Trigger** node to a workflow.
|
|
58
|
+
2. Open the **Credential** dropdown and select **Create New Credential**.
|
|
59
|
+
3. Fill in the fields:
|
|
60
|
+
|
|
61
|
+
| Field | Default | Description |
|
|
62
|
+
|-------|---------|-------------|
|
|
63
|
+
| **Probo Server** | `https://us.probo.com` | Base URL of your Probo instance. Use `https://eu.probo.com` for the EU region, or your own URL when self-hosting. |
|
|
64
|
+
| **API Key** | — | A Probo API key with access to the organizations you automate against. |
|
|
65
|
+
|
|
66
|
+
4. Click **Test** to verify connectivity. n8n calls the Probo GraphQL API and checks that the key is valid.
|
|
67
|
+
5. Click **Save**. The credential is shared across all Probo nodes in your instance.
|
|
68
|
+
|
|
69
|
+
### Get an API key
|
|
70
|
+
|
|
71
|
+
1. Sign in to the Probo console.
|
|
72
|
+
2. Go to **Settings → API Keys**.
|
|
73
|
+
3. Click **Create API Key**.
|
|
74
|
+
4. Copy the key immediately — it is shown only once.
|
|
75
|
+
|
|
76
|
+
For self-hosted Probo, set **Probo Server** to your instance URL (for example `https://probo.example.com`). The node talks to `/api/console/v1/graphql` on that host.
|
|
77
|
+
|
|
78
|
+
More detail: [Probo n8n authentication docs](https://www.probo.com/docs/api/n8n/authentication).
|
|
79
|
+
|
|
80
|
+
## Workflow example: notify Slack when a document is published
|
|
81
|
+
|
|
82
|
+
This workflow listens for Probo document events and posts a message to Slack.
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
Probo Trigger → Slack
|
|
86
|
+
(document (post message
|
|
87
|
+
published) with document name)
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Steps
|
|
91
|
+
|
|
92
|
+
1. **Create credentials** as described above and save them as `Probo API`.
|
|
93
|
+
|
|
94
|
+
2. **Add a Probo Trigger node**
|
|
95
|
+
- **Credential:** Probo API
|
|
96
|
+
- **Organization ID:** your Probo organization GID (for example `gid://probo/Organization/…`)
|
|
97
|
+
- **Events:** `Document Version Published`
|
|
98
|
+
- **Verify Signature:** enabled (recommended)
|
|
99
|
+
|
|
100
|
+
3. **Add a Slack node** (or any notification node) connected to the trigger output.
|
|
101
|
+
- Map fields from the webhook payload, for example:
|
|
102
|
+
- **Text:** `A document was published: {{ $json.data.documentVersion.document.name }}`
|
|
103
|
+
|
|
104
|
+
4. **Activate the workflow.** n8n registers a webhook subscription in Probo. When a document version is published, Probo delivers the event and the Slack message is sent.
|
|
105
|
+
|
|
106
|
+
### Alternative: list open tasks on a schedule
|
|
107
|
+
|
|
108
|
+
Use the **Probo** action node without a trigger:
|
|
109
|
+
|
|
110
|
+
1. Add a **Schedule Trigger** node (for example, every weekday at 9:00).
|
|
111
|
+
2. Add a **Probo** node:
|
|
112
|
+
- **Resource:** Task
|
|
113
|
+
- **Operation:** Get Many
|
|
114
|
+
- **Organization ID:** your organization GID
|
|
115
|
+
- **Return All:** enabled (or set a **Limit**)
|
|
116
|
+
3. Add a downstream node (Slack, email, or spreadsheet) to process `$json` task records.
|
|
117
|
+
|
|
118
|
+
This pattern works well for daily compliance standups or overdue-task digests.
|
|
119
|
+
|
|
120
|
+
## Resources
|
|
121
|
+
|
|
122
|
+
The **Probo** node exposes operations across the platform, including:
|
|
123
|
+
|
|
124
|
+
Access Review, Asset, Audit, Audit Log, Control, Cookie Banner, Cookie Category, Cookie Consent Record, Data, Document, DPIA, Evidence, Finding, Framework, Measure, Obligation, Organization, Processing Activity, Risk, Task, Third Party, Trust Center, User, Vendor, and more.
|
|
125
|
+
|
|
126
|
+
Use the **Execute** resource to run custom GraphQL queries or mutations when a dedicated operation is not available.
|
|
127
|
+
|
|
128
|
+
## Links
|
|
129
|
+
|
|
130
|
+
- [Probo documentation](https://www.probo.com/docs)
|
|
131
|
+
- [Probo n8n authentication](https://www.probo.com/docs/api/n8n/authentication)
|
|
132
|
+
- [Package on npm](https://www.npmjs.com/package/@probo/n8n-nodes-probo)
|
|
133
|
+
- [Source code](https://github.com/getprobo/probo/tree/main/packages/n8n-node)
|
|
134
|
+
- [Report an issue](https://github.com/getprobo/probo/issues)
|
|
135
|
+
|
|
136
|
+
## License
|
|
137
|
+
|
|
138
|
+
MIT
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProboApi.credentials.js","sourceRoot":"","sources":["../../credentials/ProboApi.credentials.ts"],"names":[],"mappings":";;;AAsBA,MAAa,QAAQ;IAArB;QACC,SAAI,GAAG,UAAU,CAAC;QAElB,gBAAW,GAAG,WAAW,CAAC;QAE1B,SAAI,GAAS,EAAE,KAAK,EAAE,+BAA+B,EAAE,IAAI,EAAE,yBAAyB,EAAE,CAAC;QAEzF,qBAAgB,GAAG,4BAA4B,CAAC;QAEhD,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,cAAc;gBAC3B,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ProboApi.credentials.js","sourceRoot":"","sources":["../../credentials/ProboApi.credentials.ts"],"names":[],"mappings":";;;AAsBA,MAAa,QAAQ;IAArB;QACC,SAAI,GAAG,UAAU,CAAC;QAElB,gBAAW,GAAG,WAAW,CAAC;QAE1B,SAAI,GAAS,EAAE,KAAK,EAAE,+BAA+B,EAAE,IAAI,EAAE,yBAAyB,EAAE,CAAC;QAEzF,qBAAgB,GAAG,4BAA4B,CAAC;QAEhD,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,cAAc;gBAC3B,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,sBAAsB;gBAC/B,WAAW,EAAE,2BAA2B;aACxC;YACD;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;aACX;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,aAAa,EAAE,kCAAkC;iBACjD;aACD;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,2BAA2B;gBACpC,GAAG,EAAE,yBAAyB;gBAC9B,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE;oBACR,cAAc,EAAE,kBAAkB;iBAClC;gBACD,IAAI,EAAE;oBACL,KAAK,EAAE,yBAAyB;iBAChC;aACD;SACD,CAAC;IACH,CAAC;CAAA;AAhDD,4BAgDC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Probo.node.js","sourceRoot":"","sources":["../../../nodes/Probo/Probo.node.ts"],"names":[],"mappings":";;;AAcA,+CAOsB;AACtB,uCAImB;AAEnB,MAAa,KAAK;IAAlB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,OAAO;YACpB,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,EAAE,KAAK,EAAE,kCAAkC,EAAE,IAAI,EAAE,4BAA4B,EAAE;YACvF,KAAK,EAAE,CAAC,OAAO,CAAC;YAChB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,2DAA2D;YACrE,WAAW,EAAE,iCAAiC;YAC9C,QAAQ,EAAE;gBACT,IAAI,EAAE,OAAO;aACb;YACD,YAAY,EAAE,IAAI;YAClB,MAAM,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YAClC,OAAO,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YACnC,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,UAAU;oBAChB,QAAQ,EAAE,IAAI;oBACd,cAAc,EAAE;wBACf,IAAI,EAAE;4BACL,cAAc,EAAE,CAAC,QAAQ,CAAC;yBAC1B;qBACD;iBACD;aACD;YACD,
|
|
1
|
+
{"version":3,"file":"Probo.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f,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;wBACvE,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;qBACvB,CAAC,CAAC;oBACH,SAAS;gBACV,CAAC;gBACD,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAc,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC;YAChF,CAAC;QACF,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CAKD;AAnPD,sBAmPC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"node": "n8n-nodes-probo",
|
|
2
|
+
"node": "@probo/n8n-nodes-probo.probo",
|
|
3
3
|
"nodeVersion": "1.0",
|
|
4
4
|
"codexVersion": "1.0",
|
|
5
|
-
"categories": ["Development", "
|
|
5
|
+
"categories": ["Development", "Utility"],
|
|
6
6
|
"resources": {
|
|
7
7
|
"credentialDocumentation": [
|
|
8
8
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSignature.operation.js","sourceRoot":"","sources":["../../../../../nodes/Probo/actions/document/getSignature.operation.ts"],"names":[],"mappings":";;;AAkCA,
|
|
1
|
+
{"version":3,"file":"getSignature.operation.js","sourceRoot":"","sources":["../../../../../nodes/Probo/actions/document/getSignature.operation.ts"],"names":[],"mappings":";;;AAkCA,0BAmCC;AAtDD,6DAAyD;AAE5C,QAAA,WAAW,GAAsB;IAC7C;QACC,WAAW,EAAE,cAAc;QAC3B,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,QAAQ;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,UAAU,CAAC;gBACtB,SAAS,EAAE,CAAC,cAAc,CAAC;aAC3B;SACD;QACD,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,0CAA0C;QACvD,QAAQ,EAAE,IAAI;KACd;CACD,CAAC;AAEK,KAAK,UAAU,OAAO,CAE5B,SAAiB;IAEjB,MAAM,WAAW,GAAG,IAAI,CAAC,gBAAgB,CAAC,aAAa,EAAE,SAAS,CAAW,CAAC;IAE9E,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;EAqBb,CAAC;IAEF,MAAM,YAAY,GAAG,MAAM,kCAAe,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;IAE9E,OAAO;QACN,IAAI,EAAE,YAAY;QAClB,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;KAC/B,CAAC;AACH,CAAC"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.description = void 0;
|
|
4
4
|
exports.execute = execute;
|
|
5
5
|
const GenericFunctions_1 = require("../../GenericFunctions");
|
|
6
|
+
const events_1 = require("./events");
|
|
6
7
|
exports.description = [
|
|
7
8
|
{
|
|
8
9
|
displayName: 'Organization ID',
|
|
@@ -42,20 +43,7 @@ exports.description = [
|
|
|
42
43
|
operation: ['create'],
|
|
43
44
|
},
|
|
44
45
|
},
|
|
45
|
-
options:
|
|
46
|
-
{ name: 'Meeting Created', value: 'MEETING_CREATED' },
|
|
47
|
-
{ name: 'Meeting Deleted', value: 'MEETING_DELETED' },
|
|
48
|
-
{ name: 'Meeting Updated', value: 'MEETING_UPDATED' },
|
|
49
|
-
{ name: 'Obligation Created', value: 'OBLIGATION_CREATED' },
|
|
50
|
-
{ name: 'Obligation Deleted', value: 'OBLIGATION_DELETED' },
|
|
51
|
-
{ name: 'Obligation Updated', value: 'OBLIGATION_UPDATED' },
|
|
52
|
-
{ name: 'Third Party Created', value: 'THIRD_PARTY_CREATED' },
|
|
53
|
-
{ name: 'Third Party Deleted', value: 'THIRD_PARTY_DELETED' },
|
|
54
|
-
{ name: 'Third Party Updated', value: 'THIRD_PARTY_UPDATED' },
|
|
55
|
-
{ name: 'User Created', value: 'USER_CREATED' },
|
|
56
|
-
{ name: 'User Deleted', value: 'USER_DELETED' },
|
|
57
|
-
{ name: 'User Updated', value: 'USER_UPDATED' },
|
|
58
|
-
],
|
|
46
|
+
options: events_1.WEBHOOK_EVENT_OPTIONS,
|
|
59
47
|
default: [],
|
|
60
48
|
description: 'The event types to subscribe to',
|
|
61
49
|
required: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.operation.js","sourceRoot":"","sources":["../../../../../nodes/Probo/actions/webhook/create.operation.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"create.operation.js","sourceRoot":"","sources":["../../../../../nodes/Probo/actions/webhook/create.operation.ts"],"names":[],"mappings":";;;AAgEA,0BAqCC;AAtFD,6DAAyD;AACzD,qCAAiD;AAEpC,QAAA,WAAW,GAAsB;IAC7C;QACC,WAAW,EAAE,iBAAiB;QAC9B,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,QAAQ;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,SAAS,CAAC;gBACrB,SAAS,EAAE,CAAC,QAAQ,CAAC;aACrB;SACD;QACD,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,4BAA4B;QACzC,QAAQ,EAAE,IAAI;KACd;IACD;QACC,WAAW,EAAE,cAAc;QAC3B,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,QAAQ;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,SAAS,CAAC;gBACrB,SAAS,EAAE,CAAC,QAAQ,CAAC;aACrB;SACD;QACD,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,qDAAqD;QAClE,QAAQ,EAAE,IAAI;KACd;IACD;QACC,WAAW,EAAE,iBAAiB;QAC9B,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,cAAc;QACpB,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,SAAS,CAAC;gBACrB,SAAS,EAAE,CAAC,QAAQ,CAAC;aACrB;SACD;QACD,OAAO,EAAE,8BAAqB;QAC9B,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,iCAAiC;QAC9C,QAAQ,EAAE,IAAI;KACd;CACD,CAAC;AAEK,KAAK,UAAU,OAAO,CAE5B,SAAiB;IAEjB,MAAM,cAAc,GAAG,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,SAAS,CAAW,CAAC;IACpF,MAAM,WAAW,GAAG,IAAI,CAAC,gBAAgB,CAAC,aAAa,EAAE,SAAS,CAAW,CAAC;IAC9E,MAAM,cAAc,GAAG,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,SAAS,CAAa,CAAC;IAEtF,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;EAeb,CAAC;IAEF,MAAM,YAAY,GAAG,MAAM,kCAAe,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE;QAC5D,KAAK,EAAE;YACN,cAAc;YACd,WAAW;YACX,cAAc;SACd;KACD,CAAC,CAAC;IAEH,OAAO;QACN,IAAI,EAAE,YAAY;QAClB,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;KAC/B,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WEBHOOK_EVENT_OPTIONS = void 0;
|
|
4
|
+
exports.WEBHOOK_EVENT_OPTIONS = [
|
|
5
|
+
{ name: 'Document Archived', value: 'DOCUMENT_ARCHIVED' },
|
|
6
|
+
{ name: 'Document Created', value: 'DOCUMENT_CREATED' },
|
|
7
|
+
{ name: 'Document Deleted', value: 'DOCUMENT_DELETED' },
|
|
8
|
+
{ name: 'Document Unarchived', value: 'DOCUMENT_UNARCHIVED' },
|
|
9
|
+
{ name: 'Document Updated', value: 'DOCUMENT_UPDATED' },
|
|
10
|
+
{ name: 'Document Version Approval Quorum Approved', value: 'DOCUMENT_VERSION_APPROVAL_QUORUM_APPROVED' },
|
|
11
|
+
{ name: 'Document Version Approval Quorum Rejected', value: 'DOCUMENT_VERSION_APPROVAL_QUORUM_REJECTED' },
|
|
12
|
+
{ name: 'Document Version Approval Quorum Requested', value: 'DOCUMENT_VERSION_APPROVAL_QUORUM_REQUESTED' },
|
|
13
|
+
{ name: 'Document Version Approval Quorum Updated', value: 'DOCUMENT_VERSION_APPROVAL_QUORUM_UPDATED' },
|
|
14
|
+
{ name: 'Document Version Approval Quorum Voided', value: 'DOCUMENT_VERSION_APPROVAL_QUORUM_VOIDED' },
|
|
15
|
+
{ name: 'Document Version Created', value: 'DOCUMENT_VERSION_CREATED' },
|
|
16
|
+
{ name: 'Document Version Deleted', value: 'DOCUMENT_VERSION_DELETED' },
|
|
17
|
+
{ name: 'Document Version Published', value: 'DOCUMENT_VERSION_PUBLISHED' },
|
|
18
|
+
{ name: 'Document Version Rejected', value: 'DOCUMENT_VERSION_REJECTED' },
|
|
19
|
+
{ name: 'Document Version Signature Cancelled', value: 'DOCUMENT_VERSION_SIGNATURE_CANCELLED' },
|
|
20
|
+
{ name: 'Document Version Signature Requested', value: 'DOCUMENT_VERSION_SIGNATURE_REQUESTED' },
|
|
21
|
+
{ name: 'Document Version Signature Signed', value: 'DOCUMENT_VERSION_SIGNATURE_SIGNED' },
|
|
22
|
+
{ name: 'Document Version Updated', value: 'DOCUMENT_VERSION_UPDATED' },
|
|
23
|
+
{ name: 'Obligation Created', value: 'OBLIGATION_CREATED' },
|
|
24
|
+
{ name: 'Obligation Deleted', value: 'OBLIGATION_DELETED' },
|
|
25
|
+
{ name: 'Obligation Updated', value: 'OBLIGATION_UPDATED' },
|
|
26
|
+
{ name: 'Third Party Created', value: 'THIRD_PARTY_CREATED' },
|
|
27
|
+
{ name: 'Third Party Deleted', value: 'THIRD_PARTY_DELETED' },
|
|
28
|
+
{ name: 'Third Party Updated', value: 'THIRD_PARTY_UPDATED' },
|
|
29
|
+
{ name: 'User Created', value: 'USER_CREATED' },
|
|
30
|
+
{ name: 'User Deleted', value: 'USER_DELETED' },
|
|
31
|
+
{ name: 'User Updated', value: 'USER_UPDATED' },
|
|
32
|
+
];
|
|
33
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../../../../nodes/Probo/actions/webhook/events.ts"],"names":[],"mappings":";;;AAgBa,QAAA,qBAAqB,GAA2B;IAC5D,EAAE,IAAI,EAAE,mBAAmB,EAAE,KAAK,EAAE,mBAAmB,EAAE;IACzD,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,kBAAkB,EAAE;IACvD,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,kBAAkB,EAAE;IACvD,EAAE,IAAI,EAAE,qBAAqB,EAAE,KAAK,EAAE,qBAAqB,EAAE;IAC7D,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,kBAAkB,EAAE;IACvD,EAAE,IAAI,EAAE,2CAA2C,EAAE,KAAK,EAAE,2CAA2C,EAAE;IACzG,EAAE,IAAI,EAAE,2CAA2C,EAAE,KAAK,EAAE,2CAA2C,EAAE;IACzG,EAAE,IAAI,EAAE,4CAA4C,EAAE,KAAK,EAAE,4CAA4C,EAAE;IAC3G,EAAE,IAAI,EAAE,0CAA0C,EAAE,KAAK,EAAE,0CAA0C,EAAE;IACvG,EAAE,IAAI,EAAE,yCAAyC,EAAE,KAAK,EAAE,yCAAyC,EAAE;IACrG,EAAE,IAAI,EAAE,0BAA0B,EAAE,KAAK,EAAE,0BAA0B,EAAE;IACvE,EAAE,IAAI,EAAE,0BAA0B,EAAE,KAAK,EAAE,0BAA0B,EAAE;IACvE,EAAE,IAAI,EAAE,4BAA4B,EAAE,KAAK,EAAE,4BAA4B,EAAE;IAC3E,EAAE,IAAI,EAAE,2BAA2B,EAAE,KAAK,EAAE,2BAA2B,EAAE;IACzE,EAAE,IAAI,EAAE,sCAAsC,EAAE,KAAK,EAAE,sCAAsC,EAAE;IAC/F,EAAE,IAAI,EAAE,sCAAsC,EAAE,KAAK,EAAE,sCAAsC,EAAE;IAC/F,EAAE,IAAI,EAAE,mCAAmC,EAAE,KAAK,EAAE,mCAAmC,EAAE;IACzF,EAAE,IAAI,EAAE,0BAA0B,EAAE,KAAK,EAAE,0BAA0B,EAAE;IACvE,EAAE,IAAI,EAAE,oBAAoB,EAAE,KAAK,EAAE,oBAAoB,EAAE;IAC3D,EAAE,IAAI,EAAE,oBAAoB,EAAE,KAAK,EAAE,oBAAoB,EAAE;IAC3D,EAAE,IAAI,EAAE,oBAAoB,EAAE,KAAK,EAAE,oBAAoB,EAAE;IAC3D,EAAE,IAAI,EAAE,qBAAqB,EAAE,KAAK,EAAE,qBAAqB,EAAE;IAC7D,EAAE,IAAI,EAAE,qBAAqB,EAAE,KAAK,EAAE,qBAAqB,EAAE;IAC7D,EAAE,IAAI,EAAE,qBAAqB,EAAE,KAAK,EAAE,qBAAqB,EAAE;IAC7D,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE;IAC/C,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE;IAC/C,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE;CAC/C,CAAC"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.description = void 0;
|
|
4
4
|
exports.execute = execute;
|
|
5
5
|
const GenericFunctions_1 = require("../../GenericFunctions");
|
|
6
|
+
const events_1 = require("./events");
|
|
6
7
|
exports.description = [
|
|
7
8
|
{
|
|
8
9
|
displayName: 'Webhook Subscription ID',
|
|
@@ -41,20 +42,7 @@ exports.description = [
|
|
|
41
42
|
operation: ['update'],
|
|
42
43
|
},
|
|
43
44
|
},
|
|
44
|
-
options:
|
|
45
|
-
{ name: 'Meeting Created', value: 'MEETING_CREATED' },
|
|
46
|
-
{ name: 'Meeting Deleted', value: 'MEETING_DELETED' },
|
|
47
|
-
{ name: 'Meeting Updated', value: 'MEETING_UPDATED' },
|
|
48
|
-
{ name: 'Obligation Created', value: 'OBLIGATION_CREATED' },
|
|
49
|
-
{ name: 'Obligation Deleted', value: 'OBLIGATION_DELETED' },
|
|
50
|
-
{ name: 'Obligation Updated', value: 'OBLIGATION_UPDATED' },
|
|
51
|
-
{ name: 'Third Party Created', value: 'THIRD_PARTY_CREATED' },
|
|
52
|
-
{ name: 'Third Party Deleted', value: 'THIRD_PARTY_DELETED' },
|
|
53
|
-
{ name: 'Third Party Updated', value: 'THIRD_PARTY_UPDATED' },
|
|
54
|
-
{ name: 'User Created', value: 'USER_CREATED' },
|
|
55
|
-
{ name: 'User Deleted', value: 'USER_DELETED' },
|
|
56
|
-
{ name: 'User Updated', value: 'USER_UPDATED' },
|
|
57
|
-
],
|
|
45
|
+
options: events_1.WEBHOOK_EVENT_OPTIONS,
|
|
58
46
|
default: [],
|
|
59
47
|
description: 'The event types to subscribe to (replaces existing selection)',
|
|
60
48
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.operation.js","sourceRoot":"","sources":["../../../../../nodes/Probo/actions/webhook/update.operation.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"update.operation.js","sourceRoot":"","sources":["../../../../../nodes/Probo/actions/webhook/update.operation.ts"],"names":[],"mappings":";;;AA8DA,0BAgCC;AA/ED,6DAAyD;AACzD,qCAAiD;AAEpC,QAAA,WAAW,GAAsB;IAC7C;QACC,WAAW,EAAE,yBAAyB;QACtC,IAAI,EAAE,uBAAuB;QAC7B,IAAI,EAAE,QAAQ;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,SAAS,CAAC;gBACrB,SAAS,EAA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,MAAM,kCAAe,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IAExE,OAAO;QACN,IAAI,EAAE,YAAY;QAClB,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;KAC/B,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type IHookFunctions, type INodeType, type INodeTypeDescription, type IWebhookFunctions, type IWebhookResponseData } from 'n8n-workflow';
|
|
2
|
+
export declare class ProboTrigger implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
webhookMethods: {
|
|
5
|
+
default: {
|
|
6
|
+
checkExists(this: IHookFunctions): Promise<boolean>;
|
|
7
|
+
create(this: IHookFunctions): Promise<boolean>;
|
|
8
|
+
delete(this: IHookFunctions): Promise<boolean>;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
webhook(this: IWebhookFunctions): Promise<IWebhookResponseData>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProboTrigger = void 0;
|
|
4
|
+
const crypto_1 = require("crypto");
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
const GenericFunctions_1 = require("../Probo/GenericFunctions");
|
|
7
|
+
const events_1 = require("../Probo/actions/webhook/events");
|
|
8
|
+
function extractNode(response) {
|
|
9
|
+
const data = response === null || response === void 0 ? void 0 : response.data;
|
|
10
|
+
return data === null || data === void 0 ? void 0 : data.node;
|
|
11
|
+
}
|
|
12
|
+
function sameEventSet(a, b) {
|
|
13
|
+
if (a.length !== b.length) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
const set = new Set(a);
|
|
17
|
+
return b.every((value) => set.has(value));
|
|
18
|
+
}
|
|
19
|
+
async function deleteSubscription(subscriptionId) {
|
|
20
|
+
const query = `
|
|
21
|
+
mutation DeleteWebhookSubscription($input: DeleteWebhookSubscriptionInput!) {
|
|
22
|
+
deleteWebhookSubscription(input: $input) {
|
|
23
|
+
deletedWebhookSubscriptionId
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
27
|
+
try {
|
|
28
|
+
await GenericFunctions_1.proboApiRequest.call(this, query, {
|
|
29
|
+
input: { webhookSubscriptionId: subscriptionId },
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
class ProboTrigger {
|
|
38
|
+
constructor() {
|
|
39
|
+
this.description = {
|
|
40
|
+
displayName: 'Probo Trigger',
|
|
41
|
+
name: 'proboTrigger',
|
|
42
|
+
icon: { light: 'file:../../icons/probo-light.svg', dark: 'file:../../icons/probo.svg' },
|
|
43
|
+
group: ['trigger'],
|
|
44
|
+
version: 1,
|
|
45
|
+
subtitle: '={{$parameter["events"].join(", ")}}',
|
|
46
|
+
description: 'Starts a workflow when Probo events occur',
|
|
47
|
+
usableAsTool: true,
|
|
48
|
+
defaults: {
|
|
49
|
+
name: 'Probo Trigger',
|
|
50
|
+
},
|
|
51
|
+
inputs: [],
|
|
52
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
53
|
+
credentials: [
|
|
54
|
+
{
|
|
55
|
+
name: 'proboApi',
|
|
56
|
+
required: true,
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
webhooks: [
|
|
60
|
+
{
|
|
61
|
+
name: 'default',
|
|
62
|
+
httpMethod: 'POST',
|
|
63
|
+
responseMode: 'onReceived',
|
|
64
|
+
path: 'webhook',
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
properties: [
|
|
68
|
+
{
|
|
69
|
+
displayName: 'Organization ID',
|
|
70
|
+
name: 'organizationId',
|
|
71
|
+
type: 'string',
|
|
72
|
+
default: '',
|
|
73
|
+
required: true,
|
|
74
|
+
description: 'The ID of the organization to receive events from',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
displayName: 'Events',
|
|
78
|
+
name: 'events',
|
|
79
|
+
type: 'multiOptions',
|
|
80
|
+
options: events_1.WEBHOOK_EVENT_OPTIONS,
|
|
81
|
+
default: [],
|
|
82
|
+
required: true,
|
|
83
|
+
description: 'The event types that trigger this workflow',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
displayName: 'Verify Signature',
|
|
87
|
+
name: 'verifySignature',
|
|
88
|
+
type: 'boolean',
|
|
89
|
+
default: true,
|
|
90
|
+
description: 'Whether to reject deliveries whose HMAC-SHA256 signature does not match the subscription signing secret',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
displayName: 'Timestamp Tolerance (Seconds)',
|
|
94
|
+
name: 'toleranceSeconds',
|
|
95
|
+
type: 'number',
|
|
96
|
+
default: 300,
|
|
97
|
+
typeOptions: {
|
|
98
|
+
minValue: 0,
|
|
99
|
+
},
|
|
100
|
+
displayOptions: {
|
|
101
|
+
show: {
|
|
102
|
+
verifySignature: [true],
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
description: 'Reject deliveries whose signed timestamp is older or further in the future than this many seconds, preventing replay of captured deliveries. Set to 0 to disable the freshness check.',
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
};
|
|
109
|
+
this.webhookMethods = {
|
|
110
|
+
default: {
|
|
111
|
+
async checkExists() {
|
|
112
|
+
var _a;
|
|
113
|
+
const webhookData = this.getWorkflowStaticData('node');
|
|
114
|
+
const subscriptionId = webhookData.subscriptionId;
|
|
115
|
+
if (subscriptionId === undefined) {
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
const query = `
|
|
119
|
+
query CheckWebhookSubscription($id: ID!) {
|
|
120
|
+
node(id: $id) {
|
|
121
|
+
... on WebhookSubscription {
|
|
122
|
+
id
|
|
123
|
+
endpointUrl
|
|
124
|
+
selectedEvents
|
|
125
|
+
organization {
|
|
126
|
+
id
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
`;
|
|
132
|
+
const response = await GenericFunctions_1.proboApiRequest.call(this, query, { id: subscriptionId });
|
|
133
|
+
const node = extractNode(response);
|
|
134
|
+
if ((node === null || node === void 0 ? void 0 : node.id) === undefined) {
|
|
135
|
+
delete webhookData.subscriptionId;
|
|
136
|
+
delete webhookData.signingSecret;
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
const webhookUrl = this.getNodeWebhookUrl('default');
|
|
140
|
+
const organizationId = this.getNodeParameter('organizationId');
|
|
141
|
+
const events = this.getNodeParameter('events');
|
|
142
|
+
const organization = node.organization;
|
|
143
|
+
const remoteEvents = (_a = node.selectedEvents) !== null && _a !== void 0 ? _a : [];
|
|
144
|
+
const urlMatches = webhookUrl === undefined || node.endpointUrl === webhookUrl;
|
|
145
|
+
const organizationMatches = (organization === null || organization === void 0 ? void 0 : organization.id) === organizationId;
|
|
146
|
+
const eventsMatch = sameEventSet(remoteEvents, events);
|
|
147
|
+
if (urlMatches && organizationMatches && eventsMatch) {
|
|
148
|
+
return true;
|
|
149
|
+
}
|
|
150
|
+
if (!(await deleteSubscription.call(this, subscriptionId))) {
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
153
|
+
delete webhookData.subscriptionId;
|
|
154
|
+
delete webhookData.signingSecret;
|
|
155
|
+
return false;
|
|
156
|
+
},
|
|
157
|
+
async create() {
|
|
158
|
+
const webhookUrl = this.getNodeWebhookUrl('default');
|
|
159
|
+
const organizationId = this.getNodeParameter('organizationId');
|
|
160
|
+
const events = this.getNodeParameter('events');
|
|
161
|
+
if (webhookUrl === undefined) {
|
|
162
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), {
|
|
163
|
+
message: 'Cannot create Probo webhook subscription: no webhook URL available',
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
const query = `
|
|
167
|
+
mutation CreateWebhookSubscription($input: CreateWebhookSubscriptionInput!) {
|
|
168
|
+
createWebhookSubscription(input: $input) {
|
|
169
|
+
webhookSubscriptionEdge {
|
|
170
|
+
node {
|
|
171
|
+
id
|
|
172
|
+
signingSecret
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
`;
|
|
178
|
+
const response = await GenericFunctions_1.proboApiRequest.call(this, query, {
|
|
179
|
+
input: {
|
|
180
|
+
organizationId,
|
|
181
|
+
endpointUrl: webhookUrl,
|
|
182
|
+
selectedEvents: events,
|
|
183
|
+
},
|
|
184
|
+
});
|
|
185
|
+
const data = response === null || response === void 0 ? void 0 : response.data;
|
|
186
|
+
const payload = data === null || data === void 0 ? void 0 : data.createWebhookSubscription;
|
|
187
|
+
const edge = payload === null || payload === void 0 ? void 0 : payload.webhookSubscriptionEdge;
|
|
188
|
+
const node = edge === null || edge === void 0 ? void 0 : edge.node;
|
|
189
|
+
if ((node === null || node === void 0 ? void 0 : node.id) === undefined) {
|
|
190
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), {
|
|
191
|
+
message: 'Cannot create Probo webhook subscription: unexpected API response',
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
const webhookData = this.getWorkflowStaticData('node');
|
|
195
|
+
webhookData.subscriptionId = node.id;
|
|
196
|
+
webhookData.signingSecret = node.signingSecret;
|
|
197
|
+
return true;
|
|
198
|
+
},
|
|
199
|
+
async delete() {
|
|
200
|
+
const webhookData = this.getWorkflowStaticData('node');
|
|
201
|
+
const subscriptionId = webhookData.subscriptionId;
|
|
202
|
+
if (subscriptionId === undefined) {
|
|
203
|
+
return true;
|
|
204
|
+
}
|
|
205
|
+
if (!(await deleteSubscription.call(this, subscriptionId))) {
|
|
206
|
+
return false;
|
|
207
|
+
}
|
|
208
|
+
delete webhookData.subscriptionId;
|
|
209
|
+
delete webhookData.signingSecret;
|
|
210
|
+
return true;
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
async webhook() {
|
|
216
|
+
const verifySignature = this.getNodeParameter('verifySignature', true);
|
|
217
|
+
const headers = this.getHeaderData();
|
|
218
|
+
const body = this.getBodyData();
|
|
219
|
+
if (verifySignature) {
|
|
220
|
+
const webhookData = this.getWorkflowStaticData('node');
|
|
221
|
+
const signingSecret = webhookData.signingSecret;
|
|
222
|
+
const signature = headers['x-probo-webhook-signature'];
|
|
223
|
+
const timestamp = headers['x-probo-webhook-timestamp'];
|
|
224
|
+
const rejected = this.getResponseObject();
|
|
225
|
+
if (signingSecret === undefined || signature === undefined || timestamp === undefined) {
|
|
226
|
+
rejected.status(403).json({ message: 'Missing Probo webhook signature' });
|
|
227
|
+
return { noWebhookResponse: true };
|
|
228
|
+
}
|
|
229
|
+
const request = this.getRequestObject();
|
|
230
|
+
const rawBody = request.rawBody;
|
|
231
|
+
if (rawBody === undefined) {
|
|
232
|
+
rejected
|
|
233
|
+
.status(403)
|
|
234
|
+
.json({ message: 'Probo webhook raw body unavailable for signature verification' });
|
|
235
|
+
return { noWebhookResponse: true };
|
|
236
|
+
}
|
|
237
|
+
const hmac = (0, crypto_1.createHmac)('sha256', signingSecret);
|
|
238
|
+
hmac.update(`${timestamp}:`);
|
|
239
|
+
hmac.update(rawBody);
|
|
240
|
+
const expected = hmac.digest('hex');
|
|
241
|
+
const expectedBuffer = Buffer.from(expected, 'hex');
|
|
242
|
+
const receivedBuffer = Buffer.from(signature, 'hex');
|
|
243
|
+
if (expectedBuffer.length !== receivedBuffer.length ||
|
|
244
|
+
!(0, crypto_1.timingSafeEqual)(expectedBuffer, receivedBuffer)) {
|
|
245
|
+
rejected.status(403).json({ message: 'Invalid Probo webhook signature' });
|
|
246
|
+
return { noWebhookResponse: true };
|
|
247
|
+
}
|
|
248
|
+
const toleranceSeconds = this.getNodeParameter('toleranceSeconds', 300);
|
|
249
|
+
if (toleranceSeconds > 0) {
|
|
250
|
+
const timestampSeconds = Number(timestamp);
|
|
251
|
+
const nowSeconds = Date.now() / 1000;
|
|
252
|
+
if (!Number.isFinite(timestampSeconds) ||
|
|
253
|
+
Math.abs(nowSeconds - timestampSeconds) > toleranceSeconds) {
|
|
254
|
+
rejected.status(403).json({ message: 'Stale Probo webhook timestamp' });
|
|
255
|
+
return { noWebhookResponse: true };
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
return {
|
|
260
|
+
workflowData: [this.helpers.returnJsonArray(body)],
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
exports.ProboTrigger = ProboTrigger;
|
|
265
|
+
//# sourceMappingURL=ProboTrigger.node.js.map
|