@processlink/node-red-contrib-processlink 1.1.0 → 1.1.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/README.md +108 -54
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,6 +28,7 @@ Connect your Node-RED flows to the [Process Link](https://processlink.com.au) pl
|
|
|
28
28
|
| Node | Description |
|
|
29
29
|
|------|-------------|
|
|
30
30
|
| **files upload** | Upload files to Process Link Files API |
|
|
31
|
+
| **system info** | Output system diagnostics (hostname, memory, disk, uptime, etc.) |
|
|
31
32
|
|
|
32
33
|
*More nodes coming soon: mail, downtime logging, notes*
|
|
33
34
|
|
|
@@ -70,9 +71,12 @@ Then restart Node-RED.
|
|
|
70
71
|
### 3. Connect Your Flow
|
|
71
72
|
|
|
72
73
|
```
|
|
73
|
-
[File In] → [files upload] → [Debug]
|
|
74
|
+
[File In] → [files upload] ─┬─ Output 1 (success) → [Debug]
|
|
75
|
+
└─ Output 2 (error) → [Debug]
|
|
74
76
|
```
|
|
75
77
|
|
|
78
|
+
---
|
|
79
|
+
|
|
76
80
|
## Node Reference
|
|
77
81
|
|
|
78
82
|
### Files Upload
|
|
@@ -85,6 +89,7 @@ Uploads files to the Process Link Files API.
|
|
|
85
89
|
|----------|-------------|
|
|
86
90
|
| Config | Your Process Link credentials (Site ID + API Key) |
|
|
87
91
|
| Filename | Default filename (optional, can be set via `msg.filename`) |
|
|
92
|
+
| Prefix with timestamp | Adds `YYYY-MM-DD_HH-MM-SS_` prefix to filename |
|
|
88
93
|
| Timeout | Request timeout in milliseconds (default: 30000) |
|
|
89
94
|
|
|
90
95
|
#### Inputs
|
|
@@ -96,11 +101,12 @@ Uploads files to the Process Link Files API.
|
|
|
96
101
|
|
|
97
102
|
#### Outputs
|
|
98
103
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
|
102
|
-
|
|
103
|
-
|
|
|
104
|
+
This node has **two outputs**:
|
|
105
|
+
|
|
106
|
+
| Output | When | Properties |
|
|
107
|
+
|--------|------|------------|
|
|
108
|
+
| **1 - Success** | HTTP 201 | `msg.payload.ok`, `msg.payload.file_id`, `msg.file_id`, `msg.statusCode` |
|
|
109
|
+
| **2 - Error** | API error, network error, timeout | `msg.payload.error`, `msg.statusCode` |
|
|
104
110
|
|
|
105
111
|
#### Status Indicators
|
|
106
112
|
|
|
@@ -110,9 +116,82 @@ Uploads files to the Process Link Files API.
|
|
|
110
116
|
| 🟢 Green | Upload successful |
|
|
111
117
|
| 🔴 Red | Error occurred |
|
|
112
118
|
|
|
113
|
-
|
|
119
|
+
#### Status Codes
|
|
120
|
+
|
|
121
|
+
| Code | Meaning |
|
|
122
|
+
|------|---------|
|
|
123
|
+
| 201 | Success |
|
|
124
|
+
| 400 | Bad request |
|
|
125
|
+
| 401 | Invalid API key |
|
|
126
|
+
| 403 | API access not enabled |
|
|
127
|
+
| 404 | Site not found |
|
|
128
|
+
| 429 | Rate limit exceeded (max 30/min) |
|
|
129
|
+
| 507 | Storage limit exceeded |
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
### System Info
|
|
134
|
+
|
|
135
|
+
Outputs system information for diagnostics and monitoring.
|
|
136
|
+
|
|
137
|
+
#### Configuration
|
|
138
|
+
|
|
139
|
+
| Property | Description |
|
|
140
|
+
|----------|-------------|
|
|
141
|
+
| Send on deploy | When checked (default), outputs system info when the flow is deployed |
|
|
142
|
+
|
|
143
|
+
#### Triggers
|
|
144
|
+
|
|
145
|
+
- **On deploy** (if enabled) - Automatically sends when flow starts
|
|
146
|
+
- **On input** - Any incoming message triggers a fresh reading
|
|
147
|
+
|
|
148
|
+
#### Output
|
|
149
|
+
|
|
150
|
+
`msg.payload` contains:
|
|
151
|
+
|
|
152
|
+
| Property | Description |
|
|
153
|
+
|----------|-------------|
|
|
154
|
+
| `timestamp` | ISO 8601 UTC timestamp |
|
|
155
|
+
| `localTime` | Device local time string |
|
|
156
|
+
| `timezone` | Timezone name (e.g., "Australia/Sydney") |
|
|
157
|
+
| `hostname` | Device hostname |
|
|
158
|
+
| `platform` | "win32", "linux", or "darwin" |
|
|
159
|
+
| `os` | OS name and version |
|
|
160
|
+
| `arch` | CPU architecture |
|
|
161
|
+
| `user` | User running Node-RED |
|
|
162
|
+
| `workingDirectory` | Node-RED working directory |
|
|
163
|
+
| `uptime` | System uptime (`raw`, `breakdown`, `formatted`) |
|
|
164
|
+
| `cpu` | Model, cores, architecture |
|
|
165
|
+
| `memory` | Total, free, used (bytes + formatted), usedPercent |
|
|
166
|
+
| `disk` | Total, free, used (bytes + formatted), usedPercent |
|
|
167
|
+
| `network` | primaryIP, mac, interfaces |
|
|
168
|
+
| `nodeRed` | version, uptime |
|
|
169
|
+
| `nodejs` | version |
|
|
170
|
+
| `processMemory` | rss, heapTotal, heapUsed |
|
|
171
|
+
|
|
172
|
+
#### Uptime/Memory Structure
|
|
173
|
+
|
|
174
|
+
```json
|
|
175
|
+
{
|
|
176
|
+
"uptime": {
|
|
177
|
+
"raw": 432000,
|
|
178
|
+
"breakdown": { "days": 5, "hours": 0, "minutes": 0, "seconds": 0 },
|
|
179
|
+
"formatted": "5d 0h 0m 0s"
|
|
180
|
+
},
|
|
181
|
+
"memory": {
|
|
182
|
+
"total": { "bytes": 17179869184, "formatted": "16.00 GB" },
|
|
183
|
+
"free": { "bytes": 8589934592, "formatted": "8.00 GB" },
|
|
184
|
+
"used": { "bytes": 8589934592, "formatted": "8.00 GB" },
|
|
185
|
+
"usedPercent": 50
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## Example Flow
|
|
114
193
|
|
|
115
|
-
Copy the JSON below and import
|
|
194
|
+
Copy the JSON below and import into Node-RED: **Menu → Import → Clipboard**
|
|
116
195
|
|
|
117
196
|
```json
|
|
118
197
|
[
|
|
@@ -158,21 +237,36 @@ Copy the JSON below and import it into Node-RED: **Menu → Import → Clipboard
|
|
|
158
237
|
"apiUrl": "https://files.processlink.com.au/api/upload",
|
|
159
238
|
"x": 470,
|
|
160
239
|
"y": 100,
|
|
161
|
-
"wires": [["pl-debug"]]
|
|
240
|
+
"wires": [["pl-debug-success"], ["pl-debug-error"]]
|
|
162
241
|
},
|
|
163
242
|
{
|
|
164
|
-
"id": "pl-debug",
|
|
243
|
+
"id": "pl-debug-success",
|
|
165
244
|
"type": "debug",
|
|
166
245
|
"z": "",
|
|
167
|
-
"name": "
|
|
246
|
+
"name": "Success",
|
|
168
247
|
"active": true,
|
|
169
248
|
"tosidebar": true,
|
|
170
249
|
"console": false,
|
|
171
250
|
"tostatus": false,
|
|
172
251
|
"complete": "true",
|
|
173
252
|
"targetType": "full",
|
|
174
|
-
"x":
|
|
175
|
-
"y":
|
|
253
|
+
"x": 680,
|
|
254
|
+
"y": 80,
|
|
255
|
+
"wires": []
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"id": "pl-debug-error",
|
|
259
|
+
"type": "debug",
|
|
260
|
+
"z": "",
|
|
261
|
+
"name": "Error",
|
|
262
|
+
"active": true,
|
|
263
|
+
"tosidebar": true,
|
|
264
|
+
"console": false,
|
|
265
|
+
"tostatus": false,
|
|
266
|
+
"complete": "true",
|
|
267
|
+
"targetType": "full",
|
|
268
|
+
"x": 670,
|
|
269
|
+
"y": 120,
|
|
176
270
|
"wires": []
|
|
177
271
|
}
|
|
178
272
|
]
|
|
@@ -184,43 +278,7 @@ Copy the JSON below and import it into Node-RED: **Menu → Import → Clipboard
|
|
|
184
278
|
3. Click **Deploy**
|
|
185
279
|
4. Click the inject button to upload
|
|
186
280
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
Use a Function node to set the filename dynamically:
|
|
190
|
-
|
|
191
|
-
```javascript
|
|
192
|
-
msg.filename = "report-" + new Date().toISOString().split('T')[0] + ".csv";
|
|
193
|
-
return msg;
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
### Upload with Error Handling
|
|
197
|
-
|
|
198
|
-
```
|
|
199
|
-
[File In] → [files upload] → [Switch] → [Debug (success)]
|
|
200
|
-
↘ [Debug (error)]
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
Use a Switch node to route based on `msg.statusCode`:
|
|
204
|
-
- Route 1: `msg.statusCode == 201` (success)
|
|
205
|
-
- Route 2: Otherwise (error)
|
|
206
|
-
|
|
207
|
-
## Error Handling
|
|
208
|
-
|
|
209
|
-
| Status Code | Meaning | Solution |
|
|
210
|
-
|-------------|---------|----------|
|
|
211
|
-
| 201 | Success | File uploaded successfully |
|
|
212
|
-
| 400 | Bad Request | Check that payload is a valid file buffer |
|
|
213
|
-
| 401 | Unauthorized | Verify your API key is correct |
|
|
214
|
-
| 403 | Forbidden | Enable API access in site settings |
|
|
215
|
-
| 404 | Not Found | Verify your Site ID is correct |
|
|
216
|
-
| 429 | Rate Limited | Max 30 uploads/minute per site |
|
|
217
|
-
| 507 | Storage Full | Contact administrator to increase storage |
|
|
218
|
-
|
|
219
|
-
## Rate Limits
|
|
220
|
-
|
|
221
|
-
- **30 uploads per minute** per site
|
|
222
|
-
- Exceeding the limit returns a 429 status code
|
|
223
|
-
- Implement retry logic in your flow for high-volume uploads
|
|
281
|
+
---
|
|
224
282
|
|
|
225
283
|
## Security
|
|
226
284
|
|
|
@@ -240,10 +298,6 @@ Use a Switch node to route based on `msg.statusCode`:
|
|
|
240
298
|
- 📧 **Email**: support@processlink.com.au
|
|
241
299
|
- 🌐 **Website**: [processlink.com.au](https://processlink.com.au)
|
|
242
300
|
|
|
243
|
-
## Contributing
|
|
244
|
-
|
|
245
|
-
Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) before submitting a pull request.
|
|
246
|
-
|
|
247
301
|
## License
|
|
248
302
|
|
|
249
303
|
[MIT](LICENSE)
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.1.
|
|
6
|
+
"version": "1.1.1",
|
|
7
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",
|