@processlink/node-red-contrib-processlink 1.0.0 → 1.0.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/CHANGELOG.md ADDED
@@ -0,0 +1,39 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.0.2] - 2025-02-05
9
+
10
+ ### Changed
11
+
12
+ - Switch to Bearer token authentication (`Authorization: Bearer <apiKey>`)
13
+ - Update documentation to reference Process Link Portal → Developer → API Keys
14
+ - Add Process Link logo to README header
15
+
16
+ ## [1.0.0] - 2025-02-03
17
+
18
+ ### Added
19
+
20
+ - Initial release
21
+ - **files upload** node for uploading files to Process Link Files API
22
+ - **processlink-config** configuration node for credential management
23
+ - Support for dynamic filenames via `msg.filename`
24
+ - Status indicators for upload progress
25
+ - Comprehensive error handling with status codes
26
+ - Example flow included
27
+ - Process Link branding (logo and banner)
28
+
29
+ ### API
30
+
31
+ - Authentication uses Bearer token (`Authorization: Bearer <apiKey>`)
32
+ - Site identification via `x-site-id` header
33
+ - Get credentials from Process Link Portal → Developer → API Keys
34
+
35
+ ### Security
36
+
37
+ - API keys stored encrypted by Node-RED
38
+ - All API communication over HTTPS
39
+ - Keys never logged or exposed in flow exports
package/README.md CHANGED
@@ -1,14 +1,41 @@
1
- # @processlink/node-red-contrib-processlink
1
+ <p align="center">
2
+ <a href="https://processlink.com.au">
3
+ <img src="processlink-logo.png" alt="Process Link" width="80">
4
+ </a>
5
+ </p>
2
6
 
3
- Node-RED nodes for Process Link platform integration.
7
+ <p align="center">
8
+ <a href="https://processlink.com.au">
9
+ <img src="processlink-banner.png" alt="Process Link" height="50">
10
+ </a>
11
+ </p>
12
+
13
+ <h3 align="center">Node-RED Integration</h3>
14
+
15
+ <p align="center">
16
+ <em>Connect your Node-RED flows to the Process Link platform</em>
17
+ </p>
18
+
19
+ <p align="center">
20
+ <a href="https://www.npmjs.com/package/@processlink/node-red-contrib-processlink"><img src="https://img.shields.io/npm/v/@processlink/node-red-contrib-processlink.svg" alt="npm version"></a>
21
+ <a href="https://www.npmjs.com/package/@processlink/node-red-contrib-processlink"><img src="https://img.shields.io/npm/dm/@processlink/node-red-contrib-processlink.svg" alt="npm downloads"></a>
22
+ <a href="https://nodered.org"><img src="https://img.shields.io/badge/Node--RED-%3E%3D2.0.0-red.svg" alt="Node-RED"></a>
23
+ <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT"></a>
24
+ </p>
25
+
26
+ ---
27
+
28
+ ## Overview
29
+
30
+ Connect your Node-RED flows to the [Process Link](https://processlink.com.au) platform. Upload files, send notifications, and integrate with industrial automation systems.
4
31
 
5
32
  ## Available Nodes
6
33
 
7
- | Node | Category | Description |
8
- |------|----------|-------------|
9
- | **files upload** | Process Link | Upload files to Process Link Files API |
34
+ | Node | Description |
35
+ |------|-------------|
36
+ | **files upload** | Upload files to Process Link Files API |
10
37
 
11
- *More nodes coming soon: mail, downtime, notes*
38
+ *More nodes coming soon: mail, downtime logging, notes*
12
39
 
13
40
  ## Installation
14
41
 
@@ -30,20 +57,27 @@ Then restart Node-RED.
30
57
 
31
58
  ## Quick Start
32
59
 
33
- 1. **Get your credentials** from your Process Link app:
34
- - Go to **Settings → API Keys**
35
- - Click **Generate API Key**
36
- - Copy the **Site ID** and **API Key**
60
+ ### 1. Get Your Credentials
37
61
 
38
- 2. **Add a node** to your flow:
39
- - Find nodes in the palette under "Process Link"
40
- - Drag one into your flow
62
+ 1. Log in to the [Process Link Portal](https://portal.processlink.com.au)
63
+ 2. Go to **Developer API Keys**
64
+ 3. Click **Generate API Key**
65
+ 4. Copy your **Site ID** and **API Key**
41
66
 
42
- 3. **Configure credentials**:
43
- - Double-click the node
44
- - Click the pencil icon next to "Config"
45
- - Enter your **Site ID** and **API Key**
46
- - Click **Add**, then **Done**
67
+ ### 2. Add and Configure a Node
68
+
69
+ 1. Find the **files upload** node in the palette under "Process Link"
70
+ 2. Drag it into your flow
71
+ 3. Double-click to configure
72
+ 4. Click the pencil icon next to "Config"
73
+ 5. Enter your **Site ID** and **API Key**
74
+ 6. Click **Add**, then **Done**
75
+
76
+ ### 3. Connect Your Flow
77
+
78
+ ```
79
+ [File In] → [files upload] → [Debug]
80
+ ```
47
81
 
48
82
  ## Node Reference
49
83
 
@@ -51,12 +85,20 @@ Then restart Node-RED.
51
85
 
52
86
  Uploads files to the Process Link Files API.
53
87
 
88
+ #### Configuration
89
+
90
+ | Property | Description |
91
+ |----------|-------------|
92
+ | Config | Your Process Link credentials (Site ID + API Key) |
93
+ | Filename | Default filename (optional, can be set via `msg.filename`) |
94
+ | Timeout | Request timeout in milliseconds (default: 30000) |
95
+
54
96
  #### Inputs
55
97
 
56
98
  | Property | Type | Description |
57
99
  |----------|------|-------------|
58
100
  | `msg.payload` | Buffer \| string | The file content to upload |
59
- | `msg.filename` | string | (Optional) Filename to use |
101
+ | `msg.filename` | string | *(Optional)* Filename to use |
60
102
 
61
103
  #### Outputs
62
104
 
@@ -68,13 +110,15 @@ Uploads files to the Process Link Files API.
68
110
 
69
111
  #### Status Indicators
70
112
 
71
- - Yellow: Uploading in progress
72
- - Green: Upload successful
73
- - Red: Error occurred
113
+ | Color | Meaning |
114
+ |-------|---------|
115
+ | 🟡 Yellow | Uploading in progress |
116
+ | 🟢 Green | Upload successful |
117
+ | 🔴 Red | Error occurred |
74
118
 
75
- ## Example Flow
119
+ ## Examples
76
120
 
77
- Upload a file from disk:
121
+ ### Basic File Upload
78
122
 
79
123
  ```
80
124
  [File In] → [files upload] → [Debug]
@@ -82,45 +126,68 @@ Upload a file from disk:
82
126
 
83
127
  1. Configure a **File In** node to read your file
84
128
  2. Connect it to the **files upload** node
85
- 3. Add a **Debug** node to see the result
86
- 4. Configure the upload node with your Site ID and API Key
129
+ 3. Add a **Debug** node to see the response
87
130
 
88
131
  ### Dynamic Filename
89
132
 
90
- Set the filename dynamically in a Function node:
133
+ Use a Function node to set the filename dynamically:
91
134
 
92
135
  ```javascript
93
136
  msg.filename = "report-" + new Date().toISOString().split('T')[0] + ".csv";
94
137
  return msg;
95
138
  ```
96
139
 
140
+ ### Upload with Error Handling
141
+
142
+ ```
143
+ [File In] → [files upload] → [Switch] → [Debug (success)]
144
+ ↘ [Debug (error)]
145
+ ```
146
+
147
+ Use a Switch node to route based on `msg.statusCode`:
148
+ - Route 1: `msg.statusCode == 201` (success)
149
+ - Route 2: Otherwise (error)
150
+
97
151
  ## Error Handling
98
152
 
99
153
  | Status Code | Meaning | Solution |
100
154
  |-------------|---------|----------|
101
155
  | 201 | Success | File uploaded successfully |
102
156
  | 400 | Bad Request | Check that payload is a valid file buffer |
103
- | 401 | Unauthorized | Check your API key is correct |
157
+ | 401 | Unauthorized | Verify your API key is correct |
104
158
  | 403 | Forbidden | Enable API access in site settings |
105
- | 404 | Not Found | Check your Site ID is correct |
106
- | 429 | Rate Limited | Slow down - max 30 uploads/minute per site |
107
- | 507 | Storage Full | Contact your administrator to increase storage |
159
+ | 404 | Not Found | Verify your Site ID is correct |
160
+ | 429 | Rate Limited | Max 30 uploads/minute per site |
161
+ | 507 | Storage Full | Contact administrator to increase storage |
108
162
 
109
163
  ## Rate Limits
110
164
 
111
- The API allows **30 uploads per minute** per site. If you exceed this limit, you'll receive a 429 status code. The node will still output the message so you can implement retry logic in your flow.
165
+ - **30 uploads per minute** per site
166
+ - Exceeding the limit returns a 429 status code
167
+ - Implement retry logic in your flow for high-volume uploads
112
168
 
113
169
  ## Security
114
170
 
115
- - API keys are stored encrypted by Node-RED
116
- - All communication uses HTTPS
117
- - Keys are never logged or exposed in flow exports
171
+ - API keys are stored encrypted by Node-RED
172
+ - All communication uses HTTPS
173
+ - Keys are never logged or exposed in flow exports
174
+
175
+ ## Requirements
176
+
177
+ - Node-RED >= 2.0.0
178
+ - Node.js >= 14.0.0
118
179
 
119
180
  ## Support
120
181
 
121
- - **Issues**: [GitHub Issues](https://github.com/process-link/node-red-contrib-processlink/issues)
122
- - **Email**: support@processlink.com.au
182
+ - 📖 **Documentation**: [GitHub Wiki](https://github.com/process-link/node-red-contrib-processlink/wiki)
183
+ - 🐛 **Issues**: [GitHub Issues](https://github.com/process-link/node-red-contrib-processlink/issues)
184
+ - 📧 **Email**: support@processlink.com.au
185
+ - 🌐 **Website**: [processlink.com.au](https://processlink.com.au)
186
+
187
+ ## Contributing
188
+
189
+ Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) before submitting a pull request.
123
190
 
124
191
  ## License
125
192
 
126
- MIT
193
+ [MIT](LICENSE) © [Process Link](https://processlink.com.au)
@@ -132,7 +132,7 @@
132
132
  "type": "comment",
133
133
  "z": "pl-example-flow",
134
134
  "name": "Instructions: Configure the 'Upload to Process Link' node with your Site ID and API Key",
135
- "info": "1. Double-click the orange 'Upload to Process Link' node\n2. Click the pencil icon next to 'Config'\n3. Enter your Site ID and API Key from the Process Link Files app\n4. Update the 'Read File' node with the path to your file\n5. Click the inject button to upload",
135
+ "info": "1. Double-click the orange 'Upload to Process Link' node\n2. Click the pencil icon next to 'Config'\n3. Enter your Site ID and API Key from the Process Link Portal (Developer → API Keys)\n4. Update the 'Read File' node with the path to your file\n5. Click the inject button to upload",
136
136
  "x": 330,
137
137
  "y": 40,
138
138
  "wires": []
Binary file
@@ -33,11 +33,11 @@
33
33
  </div>
34
34
  <div class="form-tips">
35
35
  <p>
36
- Get your Site ID and API Key from
37
- <a href="https://processlink.com.au" target="_blank">Process Link</a>.
36
+ Get your Site ID and API Key from the
37
+ <a href="https://portal.processlink.com.au" target="_blank">Process Link Portal</a>.
38
38
  </p>
39
39
  <p>
40
- Go to <strong>Settings → API Keys</strong> in your app to generate a new key.
40
+ Go to <strong>Developer → API Keys</strong> to generate a new key.
41
41
  </p>
42
42
  </div>
43
43
  </script>
@@ -53,7 +53,7 @@
53
53
  <dd>The UUID of your site from Process Link. Found in your site settings.</dd>
54
54
  <dt>API Key <span class="property-type">string</span></dt>
55
55
  <dd>
56
- The API key for authentication. Generate one from Settings → API Keys in your Process Link app.
56
+ The API key for authentication. Generate one from Developer → API Keys in the Process Link Portal.
57
57
  </dd>
58
58
  </dl>
59
59
 
@@ -11,7 +11,7 @@
11
11
  },
12
12
  inputs: 1,
13
13
  outputs: 1,
14
- icon: "processlink.svg",
14
+ icon: "processlink.png",
15
15
  paletteLabel: "files upload",
16
16
  label: function () {
17
17
  return this.name || "files upload";
@@ -100,8 +100,8 @@ and msg.filename. Connect directly to this node to upload.</pre>
100
100
  <h3>References</h3>
101
101
  <ul>
102
102
  <li>
103
- <a href="https://files.processlink.com.au" target="_blank">Process Link Files</a> - Manage
104
- your files and API keys
103
+ <a href="https://portal.processlink.com.au" target="_blank">Process Link Portal</a> - Manage
104
+ your sites and API keys
105
105
  </li>
106
106
  <li>
107
107
  <a href="https://github.com/process-link/node-red-contrib-processlink" target="_blank"
@@ -82,7 +82,7 @@ module.exports = function (RED) {
82
82
  "Content-Type": `multipart/form-data; boundary=${boundary}`,
83
83
  "Content-Length": body.length,
84
84
  "x-site-id": siteId,
85
- "x-api-key": apiKey,
85
+ "Authorization": `Bearer ${apiKey}`,
86
86
  },
87
87
  };
88
88
 
package/package.json CHANGED
@@ -3,8 +3,8 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.0.0",
7
- "description": "Node-RED nodes for Process Link platform integration",
6
+ "version": "1.0.2",
7
+ "description": "Node-RED nodes for Process Link platform integration - upload files, send notifications, and connect to industrial automation systems",
8
8
  "keywords": [
9
9
  "node-red",
10
10
  "processlink",
@@ -14,7 +14,10 @@
14
14
  "api",
15
15
  "industrial",
16
16
  "iot",
17
- "automation"
17
+ "automation",
18
+ "manufacturing",
19
+ "scada",
20
+ "plc"
18
21
  ],
19
22
  "node-red": {
20
23
  "version": ">=2.0.0",
@@ -26,7 +29,12 @@
26
29
  "scripts": {
27
30
  "test": "echo \"No tests yet\" && exit 0"
28
31
  },
29
- "author": "Process Link <support@processlink.com.au>",
32
+ "author": {
33
+ "name": "Process Link",
34
+ "email": "support@processlink.com.au",
35
+ "url": "https://processlink.com.au"
36
+ },
37
+ "contributors": [],
30
38
  "license": "MIT",
31
39
  "repository": {
32
40
  "type": "git",
@@ -35,7 +43,11 @@
35
43
  "bugs": {
36
44
  "url": "https://github.com/process-link/node-red-contrib-processlink/issues"
37
45
  },
38
- "homepage": "https://github.com/process-link/node-red-contrib-processlink#readme",
46
+ "homepage": "https://processlink.com.au",
47
+ "funding": {
48
+ "type": "individual",
49
+ "url": "https://processlink.com.au"
50
+ },
39
51
  "engines": {
40
52
  "node": ">=14.0.0"
41
53
  }
Binary file
Binary file