n8n-nodes-unifi-access 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/README.md +76 -0
- package/dist/credentials/UnifiAccessApi.credentials.d.ts +10 -0
- package/dist/credentials/UnifiAccessApi.credentials.js +57 -0
- package/dist/credentials/UnifiAccessApi.credentials.js.map +1 -0
- package/dist/nodes/UnifiAccess/AccessPolicyDescription.d.ts +3 -0
- package/dist/nodes/UnifiAccess/AccessPolicyDescription.js +48 -0
- package/dist/nodes/UnifiAccess/AccessPolicyDescription.js.map +1 -0
- package/dist/nodes/UnifiAccess/CredentialDescription.d.ts +3 -0
- package/dist/nodes/UnifiAccess/CredentialDescription.js +152 -0
- package/dist/nodes/UnifiAccess/CredentialDescription.js.map +1 -0
- package/dist/nodes/UnifiAccess/DeviceDescription.d.ts +3 -0
- package/dist/nodes/UnifiAccess/DeviceDescription.js +27 -0
- package/dist/nodes/UnifiAccess/DeviceDescription.js.map +1 -0
- package/dist/nodes/UnifiAccess/EventOptions.d.ts +2 -0
- package/dist/nodes/UnifiAccess/EventOptions.js +61 -0
- package/dist/nodes/UnifiAccess/EventOptions.js.map +1 -0
- package/dist/nodes/UnifiAccess/GenericFunctions.d.ts +2 -0
- package/dist/nodes/UnifiAccess/GenericFunctions.js +64 -0
- package/dist/nodes/UnifiAccess/GenericFunctions.js.map +1 -0
- package/dist/nodes/UnifiAccess/NotificationDescription.d.ts +3 -0
- package/dist/nodes/UnifiAccess/NotificationDescription.js +104 -0
- package/dist/nodes/UnifiAccess/NotificationDescription.js.map +1 -0
- package/dist/nodes/UnifiAccess/UnifiAccess.node.d.ts +11 -0
- package/dist/nodes/UnifiAccess/UnifiAccess.node.js +373 -0
- package/dist/nodes/UnifiAccess/UnifiAccess.node.js.map +1 -0
- package/dist/nodes/UnifiAccess/UnifiAccess.node.json +18 -0
- package/dist/nodes/UnifiAccess/UnifiAccessTrigger.node.d.ts +12 -0
- package/dist/nodes/UnifiAccess/UnifiAccessTrigger.node.js +100 -0
- package/dist/nodes/UnifiAccess/UnifiAccessTrigger.node.js.map +1 -0
- package/dist/nodes/UnifiAccess/UnifiAccessTrigger.node.json +18 -0
- package/dist/nodes/UnifiAccess/UserDescription.d.ts +3 -0
- package/dist/nodes/UnifiAccess/UserDescription.js +414 -0
- package/dist/nodes/UnifiAccess/UserDescription.js.map +1 -0
- package/dist/nodes/UnifiAccess/unifiAccess.dark.svg +42 -0
- package/dist/nodes/UnifiAccess/unifiAccess.svg +42 -0
- package/dist/package.json +55 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +55 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IExecuteFunctions, ILoadOptionsFunctions, INodeExecutionData, INodePropertyOptions, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class UnifiAccess implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
methods: {
|
|
5
|
+
loadOptions: {
|
|
6
|
+
getAccessPolicies(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
7
|
+
getDevices(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UnifiAccess = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const GenericFunctions_1 = require("./GenericFunctions");
|
|
6
|
+
const UserDescription_1 = require("./UserDescription");
|
|
7
|
+
const AccessPolicyDescription_1 = require("./AccessPolicyDescription");
|
|
8
|
+
const CredentialDescription_1 = require("./CredentialDescription");
|
|
9
|
+
const DeviceDescription_1 = require("./DeviceDescription");
|
|
10
|
+
const NotificationDescription_1 = require("./NotificationDescription");
|
|
11
|
+
class UnifiAccess {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.description = {
|
|
14
|
+
displayName: 'UniFi Access',
|
|
15
|
+
name: 'unifiAccess',
|
|
16
|
+
icon: { light: 'file:unifiAccess.svg', dark: 'file:unifiAccess.dark.svg' },
|
|
17
|
+
group: ['output'],
|
|
18
|
+
version: 1,
|
|
19
|
+
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
20
|
+
description: 'Interact with the UniFi Access API',
|
|
21
|
+
defaults: {
|
|
22
|
+
name: 'UniFi Access',
|
|
23
|
+
},
|
|
24
|
+
usableAsTool: true,
|
|
25
|
+
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
26
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
27
|
+
credentials: [{ name: 'unifiAccessApi', required: true }],
|
|
28
|
+
properties: [
|
|
29
|
+
{
|
|
30
|
+
displayName: 'Resource',
|
|
31
|
+
name: 'resource',
|
|
32
|
+
type: 'options',
|
|
33
|
+
noDataExpression: true,
|
|
34
|
+
options: [
|
|
35
|
+
{
|
|
36
|
+
name: 'Access Policy',
|
|
37
|
+
value: 'accessPolicy',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'Credential',
|
|
41
|
+
value: 'credential',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'Device',
|
|
45
|
+
value: 'device',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'Notification',
|
|
49
|
+
value: 'notification',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'User',
|
|
53
|
+
value: 'user',
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
default: 'user',
|
|
57
|
+
},
|
|
58
|
+
...UserDescription_1.userOperations,
|
|
59
|
+
...UserDescription_1.userFields,
|
|
60
|
+
...AccessPolicyDescription_1.accessPolicyOperations,
|
|
61
|
+
...AccessPolicyDescription_1.accessPolicyFields,
|
|
62
|
+
...CredentialDescription_1.credentialOperations,
|
|
63
|
+
...CredentialDescription_1.credentialFields,
|
|
64
|
+
...DeviceDescription_1.deviceOperations,
|
|
65
|
+
...DeviceDescription_1.deviceFields,
|
|
66
|
+
...NotificationDescription_1.notificationOperations,
|
|
67
|
+
...NotificationDescription_1.notificationFields,
|
|
68
|
+
]
|
|
69
|
+
};
|
|
70
|
+
this.methods = {
|
|
71
|
+
loadOptions: {
|
|
72
|
+
async getAccessPolicies() {
|
|
73
|
+
const returnData = [];
|
|
74
|
+
const accessPolicies = await GenericFunctions_1.unifiAccessApiRequest.call(this, 'GET', 'access_policies', {});
|
|
75
|
+
for (const accessPolicy of accessPolicies) {
|
|
76
|
+
const accessPolicyName = accessPolicy.name;
|
|
77
|
+
const accessPolicyId = accessPolicy.id;
|
|
78
|
+
returnData.push({
|
|
79
|
+
name: accessPolicyName,
|
|
80
|
+
value: accessPolicyId,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
return returnData;
|
|
84
|
+
},
|
|
85
|
+
async getDevices() {
|
|
86
|
+
const returnData = [];
|
|
87
|
+
const grouped = await GenericFunctions_1.unifiAccessApiRequest.call(this, 'GET', 'devices', {});
|
|
88
|
+
const flat = grouped.flat();
|
|
89
|
+
const byId = new Map();
|
|
90
|
+
for (const d of flat) {
|
|
91
|
+
const id = d.id;
|
|
92
|
+
if (id)
|
|
93
|
+
byId.set(id, d);
|
|
94
|
+
}
|
|
95
|
+
const devices = [...byId.values()];
|
|
96
|
+
for (const device of devices) {
|
|
97
|
+
const deviceName = (device.alias || device.name);
|
|
98
|
+
const deviceId = device.id;
|
|
99
|
+
returnData.push({
|
|
100
|
+
name: deviceName,
|
|
101
|
+
value: deviceId,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
return returnData;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
async execute() {
|
|
110
|
+
var _a, _b;
|
|
111
|
+
const items = this.getInputData();
|
|
112
|
+
const returnData = [];
|
|
113
|
+
const length = items.length;
|
|
114
|
+
let responseData;
|
|
115
|
+
const qs = {};
|
|
116
|
+
const body = {};
|
|
117
|
+
const resource = this.getNodeParameter('resource', 0);
|
|
118
|
+
const operation = this.getNodeParameter('operation', 0);
|
|
119
|
+
for (let i = 0; i < length; i++) {
|
|
120
|
+
try {
|
|
121
|
+
if (resource === 'user') {
|
|
122
|
+
if (operation === 'create') {
|
|
123
|
+
const firstName = this.getNodeParameter('firstName', i);
|
|
124
|
+
const lastName = this.getNodeParameter('lastName', i);
|
|
125
|
+
const email = this.getNodeParameter('email', i);
|
|
126
|
+
const employeeNumber = this.getNodeParameter('employeeNumber', i);
|
|
127
|
+
const onboardTime = this.getNodeParameter('onboardTime', i);
|
|
128
|
+
body['first_name'] = firstName;
|
|
129
|
+
body['last_name'] = lastName;
|
|
130
|
+
if (email) {
|
|
131
|
+
body['user_email'] = email;
|
|
132
|
+
}
|
|
133
|
+
if (employeeNumber) {
|
|
134
|
+
body['employee_number'] = employeeNumber;
|
|
135
|
+
}
|
|
136
|
+
if (onboardTime) {
|
|
137
|
+
body['onboard_time'] = Math.floor(new Date(onboardTime).getTime() / 1000);
|
|
138
|
+
}
|
|
139
|
+
responseData = await GenericFunctions_1.unifiAccessApiRequest.call(this, 'POST', 'users', body, {});
|
|
140
|
+
}
|
|
141
|
+
if (operation === 'update') {
|
|
142
|
+
const userId = this.getNodeParameter('userId', i);
|
|
143
|
+
const firstName = this.getNodeParameter('firstNameOpt', i);
|
|
144
|
+
const lastName = this.getNodeParameter('lastNameOpt', i);
|
|
145
|
+
const email = this.getNodeParameter('email', i);
|
|
146
|
+
const employeeNumber = this.getNodeParameter('employeeNumber', i);
|
|
147
|
+
const onboardTime = this.getNodeParameter('onboardTime', i);
|
|
148
|
+
const status = this.getNodeParameter('status', i);
|
|
149
|
+
if (firstName) {
|
|
150
|
+
body['first_name'] = firstName;
|
|
151
|
+
}
|
|
152
|
+
if (lastName) {
|
|
153
|
+
body['last_name'] = lastName;
|
|
154
|
+
}
|
|
155
|
+
if (email) {
|
|
156
|
+
body['user_email'] = email;
|
|
157
|
+
}
|
|
158
|
+
if (employeeNumber) {
|
|
159
|
+
body['employee_number'] = employeeNumber;
|
|
160
|
+
}
|
|
161
|
+
if (onboardTime) {
|
|
162
|
+
body['onboard_time'] = Math.floor(new Date(onboardTime).getTime() / 1000);
|
|
163
|
+
}
|
|
164
|
+
if (status) {
|
|
165
|
+
body['status'] = status;
|
|
166
|
+
}
|
|
167
|
+
responseData = await GenericFunctions_1.unifiAccessApiRequest.call(this, 'PUT', `users/${userId}`, body, {});
|
|
168
|
+
}
|
|
169
|
+
if (operation === 'get') {
|
|
170
|
+
const userId = this.getNodeParameter('userId', i);
|
|
171
|
+
const { expandAccessPolicies, } = this.getNodeParameter('optionsGet', i, {});
|
|
172
|
+
if (expandAccessPolicies) {
|
|
173
|
+
qs["expand[]"] = "access_policy";
|
|
174
|
+
}
|
|
175
|
+
responseData = await GenericFunctions_1.unifiAccessApiRequest.call(this, 'GET', `users/${userId}`, {}, qs);
|
|
176
|
+
}
|
|
177
|
+
if (operation === 'getAll') {
|
|
178
|
+
const { expandAccessPolicies, limit, } = this.getNodeParameter('optionsGetAll', i, {});
|
|
179
|
+
if (expandAccessPolicies) {
|
|
180
|
+
qs["expand[]"] = "access_policy";
|
|
181
|
+
}
|
|
182
|
+
if (limit) {
|
|
183
|
+
qs["page_num"] = 1;
|
|
184
|
+
qs["page_size"] = limit;
|
|
185
|
+
}
|
|
186
|
+
responseData = await GenericFunctions_1.unifiAccessApiRequest.call(this, 'GET', 'users', {}, qs);
|
|
187
|
+
}
|
|
188
|
+
if (operation === 'assignAccessPolicy') {
|
|
189
|
+
const userId = this.getNodeParameter('userId', i);
|
|
190
|
+
const accessPolicyIds = this.getNodeParameter('accessPolicyIds', i, {});
|
|
191
|
+
const overwrite = this.getNodeParameter('overwrite', i);
|
|
192
|
+
if (overwrite) {
|
|
193
|
+
body['access_policy_ids'] = accessPolicyIds;
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
const qs = {};
|
|
197
|
+
qs['expand[]'] = 'access_policy';
|
|
198
|
+
responseData = await GenericFunctions_1.unifiAccessApiRequest.call(this, 'GET', `users/${userId}`, {}, qs);
|
|
199
|
+
if (responseData.length == 1) {
|
|
200
|
+
body['access_policy_ids'] = [...new Set(accessPolicyIds.concat(responseData[0].access_policy_ids))];
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
responseData = await GenericFunctions_1.unifiAccessApiRequest.call(this, 'PUT', `users/${userId}/access_policies`, body, qs);
|
|
204
|
+
}
|
|
205
|
+
if (operation === 'assignNfc') {
|
|
206
|
+
const userId = this.getNodeParameter('userId', i);
|
|
207
|
+
const token = this.getNodeParameter('token', i);
|
|
208
|
+
const forceAdd = this.getNodeParameter('forceAdd', i);
|
|
209
|
+
body['token'] = token;
|
|
210
|
+
if (forceAdd) {
|
|
211
|
+
body['force_add'] = true;
|
|
212
|
+
}
|
|
213
|
+
responseData = await GenericFunctions_1.unifiAccessApiRequest.call(this, 'PUT', `users/${userId}/nfc_cards`, body, {});
|
|
214
|
+
}
|
|
215
|
+
if (operation === 'assignNfc') {
|
|
216
|
+
const userId = this.getNodeParameter('userId', i);
|
|
217
|
+
const token = this.getNodeParameter('token', i);
|
|
218
|
+
body['token'] = token;
|
|
219
|
+
responseData = await GenericFunctions_1.unifiAccessApiRequest.call(this, 'PUT', `users/${userId}/nfc_cards/delete`, body, {});
|
|
220
|
+
}
|
|
221
|
+
if (operation === 'setPin') {
|
|
222
|
+
const userId = this.getNodeParameter('userId', i);
|
|
223
|
+
const pin = this.getNodeParameter('pin', i);
|
|
224
|
+
if (!/^\d+$/.test(pin)) {
|
|
225
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'PIN must contain digits only (0–9).', { itemIndex: i });
|
|
226
|
+
}
|
|
227
|
+
body["pin_code"] = pin.toString();
|
|
228
|
+
responseData = await GenericFunctions_1.unifiAccessApiRequest.call(this, 'PUT', `users/${userId}/pin_codes`, body, {});
|
|
229
|
+
}
|
|
230
|
+
if (operation === 'clearPin') {
|
|
231
|
+
const userId = this.getNodeParameter('userId', i);
|
|
232
|
+
responseData = await GenericFunctions_1.unifiAccessApiRequest.call(this, 'DELETE', `users/${userId}/pin_codes`, {}, {});
|
|
233
|
+
}
|
|
234
|
+
if (operation === 'delete') {
|
|
235
|
+
const userId = this.getNodeParameter('userId', i);
|
|
236
|
+
responseData = await GenericFunctions_1.unifiAccessApiRequest.call(this, 'DELETE', `users/${userId}`, {}, {});
|
|
237
|
+
}
|
|
238
|
+
if (operation === 'sendInvitations') {
|
|
239
|
+
const raw = this.getNodeParameter('invitations', i, {});
|
|
240
|
+
const body = ((_a = raw.invitation) !== null && _a !== void 0 ? _a : []).map((inv) => {
|
|
241
|
+
const item = {
|
|
242
|
+
user_id: inv.userId,
|
|
243
|
+
};
|
|
244
|
+
if (inv.email) {
|
|
245
|
+
item.email = inv.email;
|
|
246
|
+
}
|
|
247
|
+
return item;
|
|
248
|
+
});
|
|
249
|
+
responseData = await GenericFunctions_1.unifiAccessApiRequest.call(this, 'POST', 'users/identity/invitations', body, {});
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
if (resource === 'credential') {
|
|
253
|
+
if (operation === 'generatePin') {
|
|
254
|
+
responseData = await GenericFunctions_1.unifiAccessApiRequest.call(this, 'POST', 'credentials/pin_codes', {}, {}, { 'resultName': 'pin' });
|
|
255
|
+
}
|
|
256
|
+
if (operation === 'enrollNfc') {
|
|
257
|
+
const deviceId = this.getNodeParameter('deviceId', i);
|
|
258
|
+
const resetNfc = this.getNodeParameter('resetNfc', i);
|
|
259
|
+
const options = this.getNodeParameter('optionsEnrollNfc', i);
|
|
260
|
+
const maxWaitTime = (_b = options.maxWaitTime) !== null && _b !== void 0 ? _b : 15;
|
|
261
|
+
body["device_id"] = deviceId;
|
|
262
|
+
if (resetNfc) {
|
|
263
|
+
body["reset_ua_card"] = true;
|
|
264
|
+
}
|
|
265
|
+
const sessionResponse = await GenericFunctions_1.unifiAccessApiRequest.call(this, 'POST', 'credentials/nfc_cards/sessions', body, {});
|
|
266
|
+
let result = [];
|
|
267
|
+
let delay = 0;
|
|
268
|
+
while (delay < maxWaitTime &&
|
|
269
|
+
(result.length == 0 ||
|
|
270
|
+
result[0].code == "CODE_CREDS_NFC_READ_POLL_TOKEN_EMPTY")) {
|
|
271
|
+
await (0, n8n_workflow_1.sleep)(1000);
|
|
272
|
+
delay += 1;
|
|
273
|
+
result = await GenericFunctions_1.unifiAccessApiRequest.call(this, 'GET', `credentials/nfc_cards/sessions/${sessionResponse[0].session_id}`, {}, {}, { returnRaw: true });
|
|
274
|
+
}
|
|
275
|
+
await GenericFunctions_1.unifiAccessApiRequest.call(this, 'DELETE', `credentials/nfc_cards/sessions/${sessionResponse[0].session_id}`);
|
|
276
|
+
if (result && result[0].code != "CODE_CREDS_NFC_READ_POLL_TOKEN_EMPTY") {
|
|
277
|
+
responseData = result[0].data;
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
const errorOptions = {
|
|
281
|
+
message: result[0].code,
|
|
282
|
+
description: result[0].msg,
|
|
283
|
+
};
|
|
284
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), { 'message': result[0].code }, errorOptions);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
if (operation === 'getNfc') {
|
|
288
|
+
const nfcToken = this.getNodeParameter('nfcToken', i);
|
|
289
|
+
responseData = await GenericFunctions_1.unifiAccessApiRequest.call(this, 'GET', `credentials/nfc_cards/tokens/${nfcToken}`, {}, {});
|
|
290
|
+
}
|
|
291
|
+
if (operation === 'getAllNfcs') {
|
|
292
|
+
const { limit, } = this.getNodeParameter('optionsGetAllNfcs', i, {});
|
|
293
|
+
if (limit) {
|
|
294
|
+
qs["page_num"] = 1;
|
|
295
|
+
qs["page_size"] = limit;
|
|
296
|
+
}
|
|
297
|
+
responseData = await GenericFunctions_1.unifiAccessApiRequest.call(this, 'GET', 'credentials/nfc_cards/tokens', {}, qs);
|
|
298
|
+
}
|
|
299
|
+
if (operation === 'deleteNfc') {
|
|
300
|
+
const nfcToken = this.getNodeParameter('nfcToken', i);
|
|
301
|
+
responseData = await GenericFunctions_1.unifiAccessApiRequest.call(this, 'DELETE', `credentials/nfc_cards/tokens/${nfcToken}`, {}, {});
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
if (resource === 'accessPolicy') {
|
|
305
|
+
if (operation === 'get') {
|
|
306
|
+
const accessPolicyId = this.getNodeParameter('accessPolicyId', i);
|
|
307
|
+
responseData = await GenericFunctions_1.unifiAccessApiRequest.call(this, 'GET', `access_policies/${accessPolicyId}`, {}, {});
|
|
308
|
+
}
|
|
309
|
+
if (operation === 'getAll') {
|
|
310
|
+
responseData = await GenericFunctions_1.unifiAccessApiRequest.call(this, 'GET', `access_policies`, {}, {});
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
if (resource === 'device') {
|
|
314
|
+
if (operation === 'getAll') {
|
|
315
|
+
const grouped = await GenericFunctions_1.unifiAccessApiRequest.call(this, 'GET', 'devices', {}, {});
|
|
316
|
+
const flat = grouped.flat();
|
|
317
|
+
const byId = new Map();
|
|
318
|
+
for (const d of flat) {
|
|
319
|
+
const id = d.id;
|
|
320
|
+
if (id)
|
|
321
|
+
byId.set(id, d);
|
|
322
|
+
}
|
|
323
|
+
responseData = [...byId.values()];
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
if (resource === 'notification') {
|
|
327
|
+
if (operation === 'getAll') {
|
|
328
|
+
responseData = await GenericFunctions_1.unifiAccessApiRequest.call(this, 'GET', 'webhooks/endpoints', {}, {});
|
|
329
|
+
}
|
|
330
|
+
if (operation === 'add') {
|
|
331
|
+
const name = this.getNodeParameter('name', i);
|
|
332
|
+
const endpoint = this.getNodeParameter('endpoint', i);
|
|
333
|
+
const events = this.getNodeParameter('events', i);
|
|
334
|
+
const body = {
|
|
335
|
+
name: name,
|
|
336
|
+
endpoint: endpoint,
|
|
337
|
+
events: events,
|
|
338
|
+
};
|
|
339
|
+
responseData = await GenericFunctions_1.unifiAccessApiRequest.call(this, 'POST', 'webhooks/endpoints', body, {});
|
|
340
|
+
}
|
|
341
|
+
if (operation === 'update') {
|
|
342
|
+
const webhookId = this.getNodeParameter('webhookId', i);
|
|
343
|
+
const name = this.getNodeParameter('name', i);
|
|
344
|
+
const endpoint = this.getNodeParameter('endpoint', i);
|
|
345
|
+
const events = this.getNodeParameter('events', i);
|
|
346
|
+
const body = {
|
|
347
|
+
name: name,
|
|
348
|
+
endpoint: endpoint,
|
|
349
|
+
events: events,
|
|
350
|
+
};
|
|
351
|
+
responseData = await GenericFunctions_1.unifiAccessApiRequest.call(this, 'PUT', `webhooks/endpoints/${webhookId}`, body, {});
|
|
352
|
+
}
|
|
353
|
+
if (operation === 'delete') {
|
|
354
|
+
const webhookId = this.getNodeParameter('webhookId', i);
|
|
355
|
+
responseData = await GenericFunctions_1.unifiAccessApiRequest.call(this, 'DELETE', `webhooks/endpoints/${webhookId}`, body, {});
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
|
|
359
|
+
returnData.push(...executionData);
|
|
360
|
+
}
|
|
361
|
+
catch (error) {
|
|
362
|
+
if (this.continueOnFail()) {
|
|
363
|
+
returnData.push({ json: { error: { code: error.message, description: error.description } } });
|
|
364
|
+
continue;
|
|
365
|
+
}
|
|
366
|
+
throw error;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
return [returnData];
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
exports.UnifiAccess = UnifiAccess;
|
|
373
|
+
//# sourceMappingURL=UnifiAccess.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnifiAccess.node.js","sourceRoot":"","sources":["../../../nodes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-0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"node": "n8n-nodes-unifi-access",
|
|
3
|
+
"nodeVersion": "1.0",
|
|
4
|
+
"codexVersion": "1.0",
|
|
5
|
+
"categories": ["Development", "Developer Tools", "Utility"],
|
|
6
|
+
"resources": {
|
|
7
|
+
"credentialDocumentation": [
|
|
8
|
+
{
|
|
9
|
+
"url": "https://github.com/Skrapion/n8n-nodes-unifi-access"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"primaryDocumentation": [
|
|
13
|
+
{
|
|
14
|
+
"url": "https://github.com/Skrapion/n8n-nodes-unifi-access"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IHookFunctions, IWebhookFunctions, INodeType, INodeTypeDescription, IWebhookResponseData } from 'n8n-workflow';
|
|
2
|
+
export declare class UnifiAccessTrigger 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,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UnifiAccessTrigger = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const GenericFunctions_1 = require("./GenericFunctions");
|
|
6
|
+
const EventOptions_1 = require("./EventOptions");
|
|
7
|
+
class UnifiAccessTrigger {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.description = {
|
|
10
|
+
displayName: 'UniFi Access Trigger',
|
|
11
|
+
name: 'unifiAccessTrigger',
|
|
12
|
+
icon: { light: 'file:unifiAccess.svg', dark: 'file:unifiAccess.dark.svg' },
|
|
13
|
+
group: ['trigger'],
|
|
14
|
+
version: 1,
|
|
15
|
+
subtitle: '={{$parameter["owner"] + "/" + $parameter["repository"] + ": " + $parameter["events"].join(", ")}}',
|
|
16
|
+
description: 'Starts the workflow when UniFi Access events occur',
|
|
17
|
+
defaults: {
|
|
18
|
+
name: 'UniFi Access Trigger',
|
|
19
|
+
},
|
|
20
|
+
usableAsTool: true,
|
|
21
|
+
inputs: [],
|
|
22
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
23
|
+
credentials: [{ name: 'unifiAccessApi', required: true }],
|
|
24
|
+
webhooks: [
|
|
25
|
+
{
|
|
26
|
+
name: 'default',
|
|
27
|
+
httpMethod: 'POST',
|
|
28
|
+
responseMode: 'onReceived',
|
|
29
|
+
path: 'webhook',
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
properties: [
|
|
33
|
+
{
|
|
34
|
+
displayName: 'Events',
|
|
35
|
+
name: 'events',
|
|
36
|
+
type: 'multiOptions',
|
|
37
|
+
options: [...EventOptions_1.eventOptions],
|
|
38
|
+
required: true,
|
|
39
|
+
default: [],
|
|
40
|
+
description: 'The events to listen to',
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
};
|
|
44
|
+
this.webhookMethods = {
|
|
45
|
+
default: {
|
|
46
|
+
async checkExists() {
|
|
47
|
+
const webhookData = this.getWorkflowStaticData('node');
|
|
48
|
+
if (webhookData.webhookId === undefined) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
const responseData = await GenericFunctions_1.unifiAccessApiRequest.call(this, 'GET', 'webhooks/endpoints', {});
|
|
52
|
+
for (const response of responseData) {
|
|
53
|
+
if (response.id === webhookData.webhookId) {
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return false;
|
|
58
|
+
},
|
|
59
|
+
async create() {
|
|
60
|
+
const webhookUrl = this.getNodeWebhookUrl('default');
|
|
61
|
+
if (webhookUrl.includes('//localhost')) {
|
|
62
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'The Webhook can not work on "localhost". Please setup n8n on a custom domain.');
|
|
63
|
+
}
|
|
64
|
+
const events = this.getNodeParameter('events', []);
|
|
65
|
+
const body = {
|
|
66
|
+
name: 'web',
|
|
67
|
+
endpoint: webhookUrl,
|
|
68
|
+
events: events,
|
|
69
|
+
};
|
|
70
|
+
const webhookData = this.getWorkflowStaticData('node');
|
|
71
|
+
const responseData = await GenericFunctions_1.unifiAccessApiRequest.call(this, 'POST', 'webhooks/endpoints', body);
|
|
72
|
+
webhookData.webhookId = responseData[0].id;
|
|
73
|
+
webhookData.webhookEvents = responseData[0].events;
|
|
74
|
+
webhookData.webhookSecret = responseData[0].secret;
|
|
75
|
+
return true;
|
|
76
|
+
},
|
|
77
|
+
async delete() {
|
|
78
|
+
const webhookData = this.getWorkflowStaticData('node');
|
|
79
|
+
if (webhookData.webhookId !== undefined) {
|
|
80
|
+
await GenericFunctions_1.unifiAccessApiRequest.call(this, 'DELETE', `webhooks/endpoints/${webhookData.webhookId}`, {});
|
|
81
|
+
delete webhookData.webhookId;
|
|
82
|
+
delete webhookData.webhookEvents;
|
|
83
|
+
delete webhookData.webhookSecret;
|
|
84
|
+
}
|
|
85
|
+
return true;
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
async webhook() {
|
|
91
|
+
const bodyData = this.getBodyData();
|
|
92
|
+
const returnData = [];
|
|
93
|
+
returnData.push(bodyData);
|
|
94
|
+
return {
|
|
95
|
+
workflowData: [this.helpers.returnJsonArray(returnData)],
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
exports.UnifiAccessTrigger = UnifiAccessTrigger;
|
|
100
|
+
//# sourceMappingURL=UnifiAccessTrigger.node.js.map
|
|
@@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AAC,CAAC,CAAC,MAAgB,CAAC;oBAE7D,OAAO,IAAI,CAAC;gBACb,CAAC;gBACD,KAAK,CAAC,MAAM;oBACX,MAAM,WAAW,GAAG,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;oBAEvD,IAAI,WAAW,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;wBACzC,MAAM,wCAAqB,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,sBAAsB,WAAW,CAAC,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC;wBAIpG,OAAO,WAAW,CAAC,SAAS,CAAC;wBAC7B,OAAO,WAAW,CAAC,aAAa,CAAC;wBACjC,OAAO,WAAW,CAAC,aAAa,CAAC;oBAClC,CAAC;oBAED,OAAO,IAAI,CAAC;gBACb,CAAC;aACD;SACD,CAAC;IAaH,CAAC;IAXA,KAAK,CAAC,OAAO;QACZ,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAEpC,MAAM,UAAU,GAAkB,EAAE,CAAC;QAErC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAE1B,OAAO;YACN,YAAY,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;SACxD,CAAC;IACH,CAAC;CACD;AApHD,gDAoHC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"node": "n8n-nodes-unifi-accessTrigger",
|
|
3
|
+
"nodeVersion": "1.0",
|
|
4
|
+
"codexVersion": "1.0",
|
|
5
|
+
"categories": ["Development", "Developer Tools", "Utility"],
|
|
6
|
+
"resources": {
|
|
7
|
+
"credentialDocumentation": [
|
|
8
|
+
{
|
|
9
|
+
"url": "https://github.com/Skrapion/n8n-nodes-unifi-access"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"primaryDocumentation": [
|
|
13
|
+
{
|
|
14
|
+
"url": "https://github.com/Skrapion/n8n-nodes-unifi-access"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
}
|