@loewencreville/n8n-nodes-ttn 1.0.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/LICENSE.md +19 -0
- package/README.md +273 -0
- package/dist/credentials/ttnApi.credentials.d.ts +10 -0
- package/dist/credentials/ttnApi.credentials.js +51 -0
- package/dist/credentials/ttnApi.credentials.js.map +1 -0
- package/dist/icons/ttnNodeIcon.dark.svg +7 -0
- package/dist/icons/ttnNodeIcon.svg +7 -0
- package/dist/nodes/ttn_node/ttn.node.d.ts +14 -0
- package/dist/nodes/ttn_node/ttn.node.js +892 -0
- package/dist/nodes/ttn_node/ttn.node.js.map +1 -0
- package/dist/nodes/ttn_node/ttn.node.json +29 -0
- package/dist/nodes/ttn_node/ttnDownlink.node.d.ts +13 -0
- package/dist/nodes/ttn_node/ttnDownlink.node.js +180 -0
- package/dist/nodes/ttn_node/ttnDownlink.node.js.map +1 -0
- package/dist/nodes/ttn_node/ttnDownlink.node.json +26 -0
- package/dist/nodes/ttn_node/ttnNodeIcon.dark.svg +7 -0
- package/dist/nodes/ttn_node/ttnNodeIcon.svg +7 -0
- package/dist/nodes/ttn_node/ttnShared.d.ts +66 -0
- package/dist/nodes/ttn_node/ttnShared.js +1225 -0
- package/dist/nodes/ttn_node/ttnShared.js.map +1 -0
- package/dist/nodes/ttn_node/ttnTrigger.node.d.ts +12 -0
- package/dist/nodes/ttn_node/ttnTrigger.node.js +89 -0
- package/dist/nodes/ttn_node/ttnTrigger.node.js.map +1 -0
- package/dist/nodes/ttn_node/ttnTrigger.node.json +30 -0
- package/dist/nodes/ttn_node/ttnUplinkTrigger.node.d.ts +12 -0
- package/dist/nodes/ttn_node/ttnUplinkTrigger.node.js +76 -0
- package/dist/nodes/ttn_node/ttnUplinkTrigger.node.js.map +1 -0
- package/dist/nodes/ttn_node/ttnUplinkTrigger.node.json +29 -0
- package/dist/nodes/ttn_node/ttnWebhookOutputMapper.d.ts +5 -0
- package/dist/nodes/ttn_node/ttnWebhookOutputMapper.js +485 -0
- package/dist/nodes/ttn_node/ttnWebhookOutputMapper.js.map +1 -0
- package/dist/nodes/ttn_node/ttnWebhookTrigger.shared.d.ts +10 -0
- package/dist/nodes/ttn_node/ttnWebhookTrigger.shared.js +257 -0
- package/dist/nodes/ttn_node/ttnWebhookTrigger.shared.js.map +1 -0
- package/dist/package.json +67 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +67 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright 2026 Loewen Creville
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
4
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
5
|
+
the Software without restriction, including without limitation the rights to
|
|
6
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
7
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
8
|
+
so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
# n8n-nodes-ttn
|
|
2
|
+
|
|
3
|
+
Community [n8n](https://n8n.io/) nodes for [The Things Stack](https://www.thethingsindustries.com/) (TTS) — also known as **The Things Network (TTN)** on the public cloud.
|
|
4
|
+
|
|
5
|
+
Connect your LoRaWAN applications to n8n workflows: receive real-time uplinks via webhooks, read stored messages, send downlinks, and monitor devices and gateways through the TTS API.
|
|
6
|
+
|
|
7
|
+
## Table of contents
|
|
8
|
+
|
|
9
|
+
- [Installation](#installation)
|
|
10
|
+
- [Credentials](#credentials)
|
|
11
|
+
- [Nodes](#nodes)
|
|
12
|
+
- [TTN (main node)](#ttn-main-node)
|
|
13
|
+
- [TTN Trigger (webhook)](#ttn-trigger-webhook)
|
|
14
|
+
- [Usage examples](#usage-examples)
|
|
15
|
+
- [Compatibility](#compatibility)
|
|
16
|
+
- [Development](#development)
|
|
17
|
+
- [Resources](#resources)
|
|
18
|
+
- [Version history](#version-history)
|
|
19
|
+
- [License](#license)
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
Follow the [n8n community nodes installation guide](https://docs.n8n.io/integrations/community-nodes/installation/).
|
|
24
|
+
|
|
25
|
+
**npm package:** `n8n-nodes-ttn`
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# In n8n: Settings → Community Nodes → Install → enter "n8n-nodes-ttn"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
For self-hosted n8n with a custom nodes folder (Docker volume, etc.):
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
git clone https://github.com/etoilary974-ship-it/TTN_Node.git
|
|
35
|
+
cd TTN_Node
|
|
36
|
+
npm install
|
|
37
|
+
npm run build
|
|
38
|
+
# Copy dist/ + package.json to your n8n custom nodes directory, then restart n8n.
|
|
39
|
+
# Or use: npm run deploy
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Credentials
|
|
43
|
+
|
|
44
|
+
### The Things Stack API (`ttnApi`)
|
|
45
|
+
|
|
46
|
+
| Field | Description |
|
|
47
|
+
|-------|-------------|
|
|
48
|
+
| **Server URL** | Base URL of your TTS deployment, **without** `/api`. Examples: `https://eu1.cloud.thethings.network`, `https://<tenant>.thethings.industries`, or your self-hosted URL. See [TTS deployments](https://www.thethingsindustries.com/docs/getting-started/cloud-hosted/). |
|
|
49
|
+
| **API key (Application Server)** | An **Application Server** API key (`NNSXS…` format). Sent as `Authorization: Bearer`. Must have rights for the applications, devices, and operations you use. |
|
|
50
|
+
|
|
51
|
+
**Create an API key** in the TTS console: *User settings → API keys*, or per application under *API keys*. See the official guides:
|
|
52
|
+
|
|
53
|
+
- [API authentication](https://www.thethingsindustries.com/docs/reference/api/authentication/)
|
|
54
|
+
- [API key rights](https://www.thethingsindustries.com/docs/reference/api/using-terraform-provider/#generate-api-key)
|
|
55
|
+
|
|
56
|
+
**Required rights by operation:**
|
|
57
|
+
|
|
58
|
+
| Operation | Typical API key rights |
|
|
59
|
+
|-----------|------------------------|
|
|
60
|
+
| List applications / devices | `applications:list`, `applications.devices:list` |
|
|
61
|
+
| Get device info / status | `applications.devices:get`, `applications.devices:read` |
|
|
62
|
+
| Send downlink | `applications.devices:downlink` |
|
|
63
|
+
| Storage (Get Last Uplink) | Application Server key with Storage access on the target application |
|
|
64
|
+
| List / status gateways | `gateways:list`, `gateways:read` (Gateway Server) |
|
|
65
|
+
|
|
66
|
+
The credential test calls `GET /api/v3/applications` to verify connectivity.
|
|
67
|
+
|
|
68
|
+
> **Storage vs webhooks:** [Storage](https://www.thethingsindustries.com/docs/integrations/storage/) reads historical uplinks from the TTS database. [Webhooks](https://www.thethingsindustries.com/docs/integrations/webhooks/) push events to n8n in real time. Enable Storage on your application in TTS if you use **Get Last Uplink**.
|
|
69
|
+
|
|
70
|
+
## Nodes
|
|
71
|
+
|
|
72
|
+
All TTN nodes share the same icon and appear grouped in the n8n node picker under **TTN**.
|
|
73
|
+
|
|
74
|
+
### TTN (main node)
|
|
75
|
+
|
|
76
|
+
Unified action node with three resources.
|
|
77
|
+
|
|
78
|
+
#### Data
|
|
79
|
+
|
|
80
|
+
| Operation | TTS API | Description |
|
|
81
|
+
|-----------|---------|-------------|
|
|
82
|
+
| **Get Last Uplink** | `GET …/packages/storage/uplink_message` | Reads the [Storage integration](https://www.thethingsindustries.com/docs/integrations/storage/) uplink stream (`Accept: text/event-stream`). One n8n item per uplink received. Requires Storage enabled on the application. |
|
|
83
|
+
| **List Devices** | `GET /api/v3/applications/{app}/devices` | Lists devices in an application. |
|
|
84
|
+
| **Get Device Info** | `GET /api/v3/applications/{app}/devices/{device}` | Full device registry object. |
|
|
85
|
+
| **Get Device Status** | Registry + `last_seen_at` | Online/offline status with configurable threshold. **Summary** returns `{ device_id, online, last_seen }`; **Detailed** includes timestamps and threshold settings. |
|
|
86
|
+
| **List Applications** | `GET /api/v3/applications` | Applications visible to the API key. |
|
|
87
|
+
|
|
88
|
+
**Get Last Uplink options:**
|
|
89
|
+
|
|
90
|
+
- **Storage scope** — single device or whole application.
|
|
91
|
+
- **`Last` window** — same duration format as the TTS console (`1h`, `24h`, `168h`, …). See [Storage API](https://www.thethingsindustries.com/docs/integrations/storage/).
|
|
92
|
+
- **Uplink output shape** — Decoded Payload + Meta, Decoded Payload only, or Full Storage record.
|
|
93
|
+
|
|
94
|
+
#### Devices
|
|
95
|
+
|
|
96
|
+
| Operation | TTS API | Description |
|
|
97
|
+
|-----------|---------|-------------|
|
|
98
|
+
| **Send Downlink** | `POST …/down/push` | Enqueues a downlink on the device queue. |
|
|
99
|
+
|
|
100
|
+
Downlink parameters match [The Things Stack downlink fields](https://www.thethingsindustries.com/docs/reference/api/application_server/#message-types):
|
|
101
|
+
|
|
102
|
+
- **FPort** (1–223)
|
|
103
|
+
- **Payload type** — Hex (`frm_payload`, base64-encoded by the node) or JSON (`decoded_payload`)
|
|
104
|
+
- **Priority** — `LOWEST` … `HIGHEST`
|
|
105
|
+
- **Confirmed downlink** — requires device ACK
|
|
106
|
+
|
|
107
|
+
#### Gateways
|
|
108
|
+
|
|
109
|
+
| Operation | TTS API | Description |
|
|
110
|
+
|-----------|---------|-------------|
|
|
111
|
+
| **List Gateways** | `GET /api/v3/gateways` (or per user / organization) | Scope: all gateways visible to the key, a specific user, or an organization. Optional antenna location. |
|
|
112
|
+
| **Get Gateway Status** | `GET /api/v3/gs/gateways/{id}/connection/stats` | Last activity, uptime, `since_last_uplink`, online/offline (configurable threshold). |
|
|
113
|
+
|
|
114
|
+
Dynamic dropdowns (applications, devices, gateways) support [n8n expressions](https://docs.n8n.io/code/expressions/) for dynamic IDs.
|
|
115
|
+
|
|
116
|
+
API errors from TTS are mapped to readable messages with gRPC codes and suggested actions.
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
### TTN Trigger (webhook)
|
|
121
|
+
|
|
122
|
+
Pick **TTN → Triggers → Webhook · Receive Events** in the node picker.
|
|
123
|
+
|
|
124
|
+
Receives real-time POST webhooks from TTS — the recommended way to react to uplinks and other events. HTTP method is fixed to **POST**.
|
|
125
|
+
|
|
126
|
+
#### TTS console setup
|
|
127
|
+
|
|
128
|
+
1. Open your application in [TTS Console](https://console.cloud.thethings.network/).
|
|
129
|
+
2. Go to **Integrations → Webhooks**.
|
|
130
|
+
3. Set **Base URL** to your n8n webhook URL (test or production).
|
|
131
|
+
4. Format: **JSON**. Method: **POST**.
|
|
132
|
+
5. Under **Enabled event types**, check the events you need (e.g. **Uplink message**).
|
|
133
|
+
|
|
134
|
+
Full guide: [TTS Webhooks integration](https://www.thethingsindustries.com/docs/integrations/webhooks/)
|
|
135
|
+
|
|
136
|
+
#### Node parameters
|
|
137
|
+
|
|
138
|
+
| Parameter | Description |
|
|
139
|
+
|-----------|-------------|
|
|
140
|
+
| **Webhook path** | Path suffix after the n8n base URL (default: `ttn-uplink`). Must match the path configured in TTS. |
|
|
141
|
+
| **Application (API)** | Optional filter: loads devices via API; webhook `application_id` must match when set. |
|
|
142
|
+
| **Allowed devices** | Optional: only matching `device_id` values start the workflow (others get HTTP 200, no run). |
|
|
143
|
+
| **Event type** | Uplink message, Normalized uplink, Join accept, Downlink ack/nack/sent/failed/queued, Location solved, Service data, or All. |
|
|
144
|
+
| **Output format** | For uplinks: Sensor Data, Sensor Values Only, Full Event. For other events: Event Summary or Full Event. |
|
|
145
|
+
| **When JSON does not match event type** | **Do not start workflow** (recommended) — avoids duplicate runs when TTS sends uplink + normalized payload to the same URL. |
|
|
146
|
+
|
|
147
|
+
Credentials are optional on the trigger (only needed for the application/device filter dropdowns).
|
|
148
|
+
|
|
149
|
+
> **Legacy nodes:** `TTN: Uplink Trigger (legacy)` and `TTN: Downlink (legacy)` remain installed for backward compatibility but are hidden from the picker. New workflows should use **TTN** and **TTN Trigger**.
|
|
150
|
+
|
|
151
|
+
## Usage examples
|
|
152
|
+
|
|
153
|
+
### Real-time sensor data (webhook)
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
TTN Trigger (Webhook · Receive Events)
|
|
157
|
+
→ Event type: Uplink message
|
|
158
|
+
→ Output format: Sensor Data
|
|
159
|
+
→ [your logic: Slack, database, etc.]
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Output shape (`Sensor Data`):
|
|
163
|
+
|
|
164
|
+
```json
|
|
165
|
+
{
|
|
166
|
+
"device_id": "my-sensor",
|
|
167
|
+
"application_id": "my-app",
|
|
168
|
+
"received_at": "2026-06-07T12:00:00.000Z",
|
|
169
|
+
"f_port": 1,
|
|
170
|
+
"data": { "temperature": 22.5, "humidity": 60 }
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Send a downlink command
|
|
175
|
+
|
|
176
|
+
```
|
|
177
|
+
TTN → Devices → Send Downlink
|
|
178
|
+
→ Application: my-app
|
|
179
|
+
→ Device: my-sensor
|
|
180
|
+
→ FPort: 10
|
|
181
|
+
→ Payload type: Hex
|
|
182
|
+
→ Payload: 0102FF
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
See [Scheduling downlinks](https://www.thethingsindustries.com/docs/reference/api/application_server/#downlinkmessage) in the TTS docs.
|
|
186
|
+
|
|
187
|
+
### Read recent uplinks from Storage
|
|
188
|
+
|
|
189
|
+
```
|
|
190
|
+
TTN → Data → Get Last Uplink
|
|
191
|
+
→ Storage scope: One Device
|
|
192
|
+
→ Last window: Last 12 Hours
|
|
193
|
+
→ Uplink output shape: Decoded Payload + Meta
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Requires [Storage integration](https://www.thethingsindustries.com/docs/integrations/storage/) enabled on the application.
|
|
197
|
+
|
|
198
|
+
### Monitor device connectivity
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
TTN → Data → Get Device Status
|
|
202
|
+
→ Status mode: Summary
|
|
203
|
+
→ Offline threshold: 24 hours
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### Check gateway health
|
|
207
|
+
|
|
208
|
+
```
|
|
209
|
+
TTN → Gateways → Get Gateway Status
|
|
210
|
+
→ Gateway IDs: [your-gateway]
|
|
211
|
+
→ Status mode: Detailed
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
## Compatibility
|
|
215
|
+
|
|
216
|
+
| Requirement | Version |
|
|
217
|
+
|-------------|---------|
|
|
218
|
+
| n8n | Community nodes supported (tested with recent self-hosted releases) |
|
|
219
|
+
| Node.js | ≥ 22 (development / CI) |
|
|
220
|
+
| The Things Stack | v3 API (`/api/v3/…`) — public TTN cloud, Cloud Hosted, and self-hosted |
|
|
221
|
+
|
|
222
|
+
No runtime npm dependencies — only `n8n-workflow` as a peer dependency.
|
|
223
|
+
|
|
224
|
+
## Development
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
npm install
|
|
228
|
+
npm run dev # Start n8n with hot reload
|
|
229
|
+
npm run lint # ESLint (n8n node rules)
|
|
230
|
+
npm run build # Compile to dist/
|
|
231
|
+
npm run deploy # Build + copy to custom n8n folder
|
|
232
|
+
npm run release # Version bump, changelog, tag, publish
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Requires Node.js 22+. See [n8n node development](https://docs.n8n.io/integrations/creating-nodes/).
|
|
236
|
+
|
|
237
|
+
## Resources
|
|
238
|
+
|
|
239
|
+
### n8n
|
|
240
|
+
|
|
241
|
+
- [Community nodes documentation](https://docs.n8n.io/integrations/community-nodes/)
|
|
242
|
+
- [Install community nodes](https://docs.n8n.io/integrations/community-nodes/installation/)
|
|
243
|
+
- [Building custom nodes](https://docs.n8n.io/integrations/creating-nodes/)
|
|
244
|
+
|
|
245
|
+
### The Things Stack / TTN
|
|
246
|
+
|
|
247
|
+
- [The Things Stack documentation](https://www.thethingsindustries.com/docs/)
|
|
248
|
+
- [TTS Console (public cloud)](https://console.cloud.thethings.network/)
|
|
249
|
+
- [API authentication](https://www.thethingsindustries.com/docs/reference/api/authentication/)
|
|
250
|
+
- [Webhooks integration](https://www.thethingsindustries.com/docs/integrations/webhooks/)
|
|
251
|
+
- [Storage integration](https://www.thethingsindustries.com/docs/integrations/storage/)
|
|
252
|
+
- [Application Server API (devices, downlinks)](https://www.thethingsindustries.com/docs/reference/api/application_server/)
|
|
253
|
+
- [Gateway Server API](https://www.thethingsindustries.com/docs/reference/api/gateway_server/)
|
|
254
|
+
- [LoRaWAN concepts](https://www.thethingsindustries.com/docs/concepts/lorawan/)
|
|
255
|
+
|
|
256
|
+
### This project
|
|
257
|
+
|
|
258
|
+
- [GitHub repository](https://github.com/etoilary974-ship-it/TTN_Node)
|
|
259
|
+
- [Changelog](CHANGELOG.md)
|
|
260
|
+
- [Report an issue](https://github.com/etoilary974-ship-it/TTN_Node/issues)
|
|
261
|
+
|
|
262
|
+
## Version history
|
|
263
|
+
|
|
264
|
+
See [CHANGELOG.md](CHANGELOG.md) for the full release history.
|
|
265
|
+
|
|
266
|
+
| Version | Highlights |
|
|
267
|
+
|---------|------------|
|
|
268
|
+
| **0.2.0** | Unified operation labels, downlink preview, webhook picker fix, `@n8n/node-cli`, ESLint, Node 22 |
|
|
269
|
+
| **0.1.0** | Initial release: TTN node, webhook trigger, credentials, CI/CD |
|
|
270
|
+
|
|
271
|
+
## License
|
|
272
|
+
|
|
273
|
+
[MIT](LICENSE.md) — Copyright Loewen Creville
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class TtnApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
properties: INodeProperties[];
|
|
7
|
+
authenticate: IAuthenticateGeneric;
|
|
8
|
+
test: ICredentialTestRequest;
|
|
9
|
+
}
|
|
10
|
+
export { TtnApi as ttnApi };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ttnApi = exports.TtnApi = void 0;
|
|
4
|
+
class TtnApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'ttnApi';
|
|
7
|
+
this.displayName = 'The Things Stack API';
|
|
8
|
+
this.documentationUrl = 'https://www.thethingsindustries.com/docs/reference/api/authentication/';
|
|
9
|
+
this.properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'Server URL',
|
|
12
|
+
name: 'serverUrl',
|
|
13
|
+
type: 'string',
|
|
14
|
+
placeholder: 'https://eu1.cloud.thethings.network',
|
|
15
|
+
description: 'Base URL of your The Things Stack deployment (public cloud, Cloud Hosted, or self-hosted), without an /api path.',
|
|
16
|
+
required: true,
|
|
17
|
+
default: '',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
displayName: 'API key (Application Server)',
|
|
21
|
+
name: 'apiKey',
|
|
22
|
+
type: 'string',
|
|
23
|
+
typeOptions: { password: true },
|
|
24
|
+
description: '**Application Server** key (NNSXS… format), `Authorization: Bearer` header: applications, devices, status, downlinks, and **Storage** (`GET …/packages/storage/uplink_message`) when your key has the right rights.',
|
|
25
|
+
required: true,
|
|
26
|
+
default: '',
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
this.authenticate = {
|
|
30
|
+
type: 'generic',
|
|
31
|
+
properties: {
|
|
32
|
+
headers: {
|
|
33
|
+
Authorization: '=Bearer {{ $credentials.apiKey }}',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
this.test = {
|
|
38
|
+
request: {
|
|
39
|
+
baseURL: '={{$credentials.serverUrl}}',
|
|
40
|
+
method: 'GET',
|
|
41
|
+
url: '/api/v3/applications',
|
|
42
|
+
headers: {
|
|
43
|
+
Accept: 'application/json',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.TtnApi = TtnApi;
|
|
50
|
+
exports.ttnApi = TtnApi;
|
|
51
|
+
//# sourceMappingURL=ttnApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ttnApi.credentials.js","sourceRoot":"","sources":["../../credentials/ttnApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,MAAM;IAAnB;QACC,SAAI,GAAG,QAAQ,CAAC;QAChB,gBAAW,GAAG,sBAAsB,CAAC;QACrC,qBAAgB,GACf,wEAAwE,CAAC;QAC1E,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,qCAAqC;gBAClD,WAAW,EACV,kHAAkH;gBACnH,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,EAAE;aACX;YACD;gBACC,WAAW,EAAE,8BAA8B;gBAC3C,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,WAAW,EACV,qNAAqN;gBACtN,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,EAAE;aACX;SACD,CAAC;QACF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,aAAa,EAAE,mCAAmC;iBAClD;aACD;SACD,CAAC;QACF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,6BAA6B;gBACtC,MAAM,EAAE,KAAK;gBACb,GAAG,EAAE,sBAAsB;gBAC3B,OAAO,EAAE;oBACR,MAAM,EAAE,kBAAkB;iBAC1B;aACD;SACD,CAAC;IACH,CAAC;CAAA;AA7CD,wBA6CC;AAGkB,wBAAM"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!-- TTN cloud mark, colors for dark UI -->
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512">
|
|
4
|
+
<g transform="translate(256,256) scale(0.785) translate(-638,-299.5)">
|
|
5
|
+
<path fill="#5CB8FF" d="M891,381.9c1.4,17.2-4,33.4-15,45.8c-11.8,13.2-29.4,20.4-49.2,20.4H398.2l0,0c-0.2,0-0.4,0-0.6,0h-0.2H397l0,0c-17.4-0.2-33.8-7-46-19.2c-13-12.8-20-30-20.2-48.2l0,0c0-33.8,23-61.2,54.4-66.4c4.2-28.2,28.8-51.2,59.2-56c1.8-11.2,7.2-22,15.8-30.8c12.4-12.8,29.2-20,46.4-20c22.2,0,41.6,12,52,30c12.2-43.6,52.2-75.6,99.6-75.6c51.8,0,95,38.4,102.2,88.4c26-19.4,60.6-17.6,86.6,6.8l-2.8-2.4c20.8,16.8,28,39.6,27,58.8c-0.6,11.4-4.4,21.4-11.2,29.6c6.6,2.2,12,6,17.2,11.2c7.2,7.2,12.2,16.2,13.6,26.2l0,0C890.8,380.9,890.8,381.3,891,381.9C891,381.3,891,381.5,891,381.9z M923.2,220.5c-15.2-20.6-37.8-35.8-62.6-42.2c-5.6-1.2-11.4,2.6-12.6,8c-2.2,5.6,1.4,12.8,7.4,14c25,6.6,46.6,24.2,58,47.4c9.4,19,11.8,41.4,6.6,62c-1.4,5.8,2.8,12,8.8,12.8c5.4,1.6,11.4-1.6,13.2-6.8C950.2,283.5,943.2,247.3,923.2,220.5z M851.8,217.3c-8.6-1.6-15.2,9-11.4,16.4c1.4,3.2,4.6,5.4,8,6.2c13,3.4,24.4,12.4,30.4,24.4c5.4,10.6,6.6,23,3.6,34.4c-1.6,5.8,2.6,12.2,8.6,13.2c5.4,1.6,11.8-1.6,13.4-7.2c5.6-20.4,1.4-43.2-11-60.2C883.4,230.9,868.4,220.5,851.8,217.3z"/>
|
|
6
|
+
</g>
|
|
7
|
+
</svg>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!-- TTN cloud mark only, square canvas for n8n node icon -->
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512">
|
|
4
|
+
<g transform="translate(256,256) scale(0.785) translate(-638,-299.5)">
|
|
5
|
+
<path fill="#0D83D0" d="M891,381.9c1.4,17.2-4,33.4-15,45.8c-11.8,13.2-29.4,20.4-49.2,20.4H398.2l0,0c-0.2,0-0.4,0-0.6,0h-0.2H397l0,0c-17.4-0.2-33.8-7-46-19.2c-13-12.8-20-30-20.2-48.2l0,0c0-33.8,23-61.2,54.4-66.4c4.2-28.2,28.8-51.2,59.2-56c1.8-11.2,7.2-22,15.8-30.8c12.4-12.8,29.2-20,46.4-20c22.2,0,41.6,12,52,30c12.2-43.6,52.2-75.6,99.6-75.6c51.8,0,95,38.4,102.2,88.4c26-19.4,60.6-17.6,86.6,6.8l-2.8-2.4c20.8,16.8,28,39.6,27,58.8c-0.6,11.4-4.4,21.4-11.2,29.6c6.6,2.2,12,6,17.2,11.2c7.2,7.2,12.2,16.2,13.6,26.2l0,0C890.8,380.9,890.8,381.3,891,381.9C891,381.3,891,381.5,891,381.9z M923.2,220.5c-15.2-20.6-37.8-35.8-62.6-42.2c-5.6-1.2-11.4,2.6-12.6,8c-2.2,5.6,1.4,12.8,7.4,14c25,6.6,46.6,24.2,58,47.4c9.4,19,11.8,41.4,6.6,62c-1.4,5.8,2.8,12,8.8,12.8c5.4,1.6,11.4-1.6,13.2-6.8C950.2,283.5,943.2,247.3,923.2,220.5z M851.8,217.3c-8.6-1.6-15.2,9-11.4,16.4c1.4,3.2,4.6,5.4,8,6.2c13,3.4,24.4,12.4,30.4,24.4c5.4,10.6,6.6,23,3.6,34.4c-1.6,5.8,2.6,12.2,8.6,13.2c5.4,1.6,11.8-1.6,13.4-7.2c5.6-20.4,1.4-43.2-11-60.2C883.4,230.9,868.4,220.5,851.8,217.3z"/>
|
|
6
|
+
</g>
|
|
7
|
+
</svg>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
import { ttnGetApplications, ttnGetDevices, ttnGetGateways } from './ttnShared.js';
|
|
3
|
+
export declare class Ttn implements INodeType {
|
|
4
|
+
description: INodeTypeDescription;
|
|
5
|
+
methods: {
|
|
6
|
+
loadOptions: {
|
|
7
|
+
getApplications: typeof ttnGetApplications;
|
|
8
|
+
getDevices: typeof ttnGetDevices;
|
|
9
|
+
getGateways: typeof ttnGetGateways;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
13
|
+
}
|
|
14
|
+
export { Ttn as ttn };
|