n8n-nodes-elearning-magic 0.1.0 → 0.1.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.
package/README.md
CHANGED
|
@@ -1,68 +1,22 @@
|
|
|
1
1
|
# n8n-nodes-elearning-magic
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
- Webhook trigger dedicated to eLearning Magic course events
|
|
7
|
-
- HMAC validation of inbound payloads using your signing secret
|
|
8
|
-
- Optional `X-EM-Node-Id` enforcement so each connection can stay isolated
|
|
9
|
-
- Emits body, query, headers, and optional raw body for debugging
|
|
10
|
-
- Customizable HTTP response body/status for Storyline debugging
|
|
11
|
-
|
|
12
|
-
## Installation
|
|
13
|
-
From your n8n root (typically `~/.n8n`):
|
|
3
|
+
Webhook trigger for n8n that accepts signed payloads from the eLearning Magic platform.
|
|
14
4
|
|
|
5
|
+
## Install
|
|
6
|
+
From your n8n directory (Community Nodes enabled):
|
|
15
7
|
```bash
|
|
16
8
|
npm install n8n-nodes-elearning-magic
|
|
17
9
|
```
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
-
|
|
31
|
-
- Headers:
|
|
32
|
-
- `X-EM-Signature`: HMAC-SHA256 of the raw request body using the configured signing secret.
|
|
33
|
-
- `X-EM-Node-Id` (optional): Must match the configured Node ID when enforcement is enabled.
|
|
34
|
-
- Body: JSON payload forwarded by the eLearning Magic app, e.g.:
|
|
35
|
-
|
|
36
|
-
```json
|
|
37
|
-
{
|
|
38
|
-
"connectionId": "abc-123",
|
|
39
|
-
"projectId": "storyline-project-id",
|
|
40
|
-
"wrapperVersion": "1.0.17",
|
|
41
|
-
"meta": {
|
|
42
|
-
"learnerId": "jane.doe",
|
|
43
|
-
"learnerName": "Jane Doe",
|
|
44
|
-
"launchDomain": "lms.example.com",
|
|
45
|
-
"attemptId": "attempt-001",
|
|
46
|
-
"receivedAt": "2025-01-01T12:34:56Z"
|
|
47
|
-
},
|
|
48
|
-
"fields": {
|
|
49
|
-
"score": 92,
|
|
50
|
-
"lessonStatus": "complete",
|
|
51
|
-
"learnerEmail": "jane@example.com"
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
The node relays the full body; you can route on any property inside your workflow.
|
|
57
|
-
|
|
58
|
-
## Response customization
|
|
59
|
-
- **Response Code**: HTTP status returned to the caller (default `200`).
|
|
60
|
-
- **Response Body**: JSON string or plain text returned to the caller (default `{"received":true}`).
|
|
61
|
-
|
|
62
|
-
## Development
|
|
63
|
-
```bash
|
|
64
|
-
npm install
|
|
65
|
-
npm run build
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
Publish to npm with `npm publish` once you are happy with the build output in `dist/`.
|
|
10
|
+
Restart n8n after install.
|
|
11
|
+
|
|
12
|
+
## Configure
|
|
13
|
+
1) Add the **eLearning Magic** trigger node.
|
|
14
|
+
2) Set a unique **Webhook Path**. After you save/activate, the node shows copyable Test/Production URLs (like the n8n Webhook node).
|
|
15
|
+
3) Create an **eLearning Magic Signing Secret** credential with your secret.
|
|
16
|
+
4) (Optional) Set a **Node ID** and enable **Enforce Node ID Match**.
|
|
17
|
+
5) Copy the webhook URL from the node and paste it into the eLearning Magic app when creating a connection (use the same secret and Node ID).
|
|
18
|
+
6) Activate the workflow. Incoming events appear with request body, headers, query, and meta flags for signature/Node ID checks.
|
|
19
|
+
|
|
20
|
+
## Headers expected
|
|
21
|
+
- `X-EM-Signature`: HMAC-SHA256 of the raw body using your signing secret.
|
|
22
|
+
- `X-EM-Node-Id` (optional): Must match when enforcement is enabled.
|
|
@@ -19,14 +19,14 @@ const safeCompare = (a, b) => {
|
|
|
19
19
|
class ElearningMagicTrigger {
|
|
20
20
|
constructor() {
|
|
21
21
|
this.description = {
|
|
22
|
-
displayName: 'eLearning Magic
|
|
22
|
+
displayName: 'eLearning Magic',
|
|
23
23
|
name: 'elearningMagicTrigger',
|
|
24
24
|
icon: 'fa:magic',
|
|
25
25
|
group: ['trigger'],
|
|
26
26
|
version: 1,
|
|
27
27
|
description: 'Receive SCORM wrapper payloads from eLearning Magic via a signed webhook',
|
|
28
28
|
defaults: {
|
|
29
|
-
name: 'eLearning Magic
|
|
29
|
+
name: 'eLearning Magic',
|
|
30
30
|
},
|
|
31
31
|
subtitle: '={{$parameter["path"]}}',
|
|
32
32
|
inputs: [],
|
|
@@ -43,6 +43,7 @@ class ElearningMagicTrigger {
|
|
|
43
43
|
httpMethod: 'POST',
|
|
44
44
|
responseMode: 'onReceived',
|
|
45
45
|
path: '={{$parameter["path"]}}',
|
|
46
|
+
isFullPath: true,
|
|
46
47
|
restartWebhook: true,
|
|
47
48
|
},
|
|
48
49
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-elearning-magic",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "n8n community node for receiving signed payloads from the eLearning Magic SCORM wrapper",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"n8n-community-node",
|
|
@@ -49,14 +49,10 @@
|
|
|
49
49
|
"n8n": {
|
|
50
50
|
"n8nNodesApiVersion": 1,
|
|
51
51
|
"nodes": [
|
|
52
|
-
|
|
53
|
-
"type": "dist/nodes/ElearningMagic/ElearningMagicTrigger.node.js"
|
|
54
|
-
}
|
|
52
|
+
"dist/nodes/ElearningMagic/ElearningMagicTrigger.node.js"
|
|
55
53
|
],
|
|
56
54
|
"credentials": [
|
|
57
|
-
|
|
58
|
-
"type": "dist/credentials/ElearningMagicApi.credentials.js"
|
|
59
|
-
}
|
|
55
|
+
"dist/credentials/ElearningMagicApi.credentials.js"
|
|
60
56
|
]
|
|
61
57
|
}
|
|
62
58
|
}
|