n8n-nodes-qwease 0.3.9
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 +21 -0
- package/README.md +74 -0
- package/dist/credentials/QweaseApi.credentials.d.ts +10 -0
- package/dist/credentials/QweaseApi.credentials.js +37 -0
- package/dist/credentials/qwease.png +0 -0
- package/dist/credentials/qwease.svg +4 -0
- package/dist/nodes/Qwease/FormFieldsHelper.d.ts +21 -0
- package/dist/nodes/Qwease/FormFieldsHelper.js +187 -0
- package/dist/nodes/Qwease/GenericFunctions.d.ts +4 -0
- package/dist/nodes/Qwease/GenericFunctions.js +30 -0
- package/dist/nodes/Qwease/KnowledgeTaskDescription.d.ts +5 -0
- package/dist/nodes/Qwease/KnowledgeTaskDescription.js +306 -0
- package/dist/nodes/Qwease/OtherResourcesDescription.d.ts +12 -0
- package/dist/nodes/Qwease/OtherResourcesDescription.js +444 -0
- package/dist/nodes/Qwease/Qwease.node.d.ts +32 -0
- package/dist/nodes/Qwease/Qwease.node.js +187 -0
- package/dist/nodes/Qwease/QweaseDescription.d.ts +3 -0
- package/dist/nodes/Qwease/QweaseDescription.js +390 -0
- package/dist/nodes/Qwease/QweaseMethods.d.ts +22 -0
- package/dist/nodes/Qwease/QweaseMethods.js +335 -0
- package/dist/nodes/Qwease/QweaseTrigger.node.d.ts +12 -0
- package/dist/nodes/Qwease/QweaseTrigger.node.js +152 -0
- package/dist/nodes/Qwease/TicketBody.d.ts +3 -0
- package/dist/nodes/Qwease/TicketBody.js +104 -0
- package/dist/nodes/Qwease/executeHelpers.d.ts +14 -0
- package/dist/nodes/Qwease/executeHelpers.js +66 -0
- package/dist/nodes/Qwease/executeKnowledgeTask.d.ts +3 -0
- package/dist/nodes/Qwease/executeKnowledgeTask.js +127 -0
- package/dist/nodes/Qwease/executeOtherResources.d.ts +7 -0
- package/dist/nodes/Qwease/executeOtherResources.js +256 -0
- package/dist/nodes/Qwease/qwease.png +0 -0
- package/dist/nodes/Qwease/qwease.svg +4 -0
- package/dist/nodes/Qwease/shared.d.ts +13 -0
- package/dist/nodes/Qwease/shared.js +155 -0
- package/package.json +54 -0
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.searchFields = exports.searchOperations = exports.teamFields = exports.teamOperations = exports.deviceFields = exports.deviceOperations = exports.organizationFields = exports.organizationOperations = exports.userFields = exports.userOperations = exports.meOperations = void 0;
|
|
4
|
+
const shared_1 = require("./shared");
|
|
5
|
+
exports.meOperations = [
|
|
6
|
+
{
|
|
7
|
+
displayName: 'Operation',
|
|
8
|
+
name: 'operation',
|
|
9
|
+
type: 'options',
|
|
10
|
+
noDataExpression: true,
|
|
11
|
+
displayOptions: { show: { resource: ['me'] } },
|
|
12
|
+
options: [{ name: 'Get', value: 'get', action: 'Get current user profile' }],
|
|
13
|
+
default: 'get',
|
|
14
|
+
},
|
|
15
|
+
];
|
|
16
|
+
exports.userOperations = [
|
|
17
|
+
{
|
|
18
|
+
displayName: 'Operation',
|
|
19
|
+
name: 'operation',
|
|
20
|
+
type: 'options',
|
|
21
|
+
noDataExpression: true,
|
|
22
|
+
displayOptions: { show: { resource: ['user'] } },
|
|
23
|
+
options: [
|
|
24
|
+
{ name: 'Create', value: 'create', action: 'Create a user' },
|
|
25
|
+
{ name: 'Get', value: 'get', action: 'Get a user' },
|
|
26
|
+
{ name: 'Get Many', value: 'getAll', action: 'Get many users' },
|
|
27
|
+
{ name: 'Update', value: 'update', action: 'Update a user' },
|
|
28
|
+
],
|
|
29
|
+
default: 'getAll',
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
exports.userFields = [
|
|
33
|
+
{
|
|
34
|
+
displayName: 'User',
|
|
35
|
+
name: 'userId',
|
|
36
|
+
type: 'resourceLocator',
|
|
37
|
+
default: { mode: 'list', value: '' },
|
|
38
|
+
required: true,
|
|
39
|
+
displayOptions: { show: { resource: ['user'], operation: ['get', 'update'] } },
|
|
40
|
+
modes: (0, shared_1.resourceLocatorModes)('getUsers', 'Select a user...'),
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
displayName: 'Email',
|
|
44
|
+
name: 'email',
|
|
45
|
+
type: 'string',
|
|
46
|
+
placeholder: 'name@email.com',
|
|
47
|
+
required: true,
|
|
48
|
+
displayOptions: { show: { resource: ['user'], operation: ['create'] } },
|
|
49
|
+
default: '',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
displayName: 'First Name',
|
|
53
|
+
name: 'firstName',
|
|
54
|
+
type: 'string',
|
|
55
|
+
required: true,
|
|
56
|
+
displayOptions: { show: { resource: ['user'], operation: ['create'] } },
|
|
57
|
+
default: '',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
displayName: 'Last Name',
|
|
61
|
+
name: 'lastName',
|
|
62
|
+
type: 'string',
|
|
63
|
+
required: true,
|
|
64
|
+
displayOptions: { show: { resource: ['user'], operation: ['create'] } },
|
|
65
|
+
default: '',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
displayName: 'Organization',
|
|
69
|
+
name: 'client',
|
|
70
|
+
type: 'resourceLocator',
|
|
71
|
+
default: { mode: 'list', value: '' },
|
|
72
|
+
required: true,
|
|
73
|
+
displayOptions: { show: { resource: ['user'], operation: ['create'] } },
|
|
74
|
+
description: 'Organization (client) the user belongs to',
|
|
75
|
+
modes: (0, shared_1.resourceLocatorModes)('getClients', 'Select an organization...'),
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
displayName: 'Additional Fields',
|
|
79
|
+
name: 'additionalFields',
|
|
80
|
+
type: 'collection',
|
|
81
|
+
placeholder: 'Add Field',
|
|
82
|
+
default: {},
|
|
83
|
+
displayOptions: { show: { resource: ['user'], operation: ['create'] } },
|
|
84
|
+
options: [
|
|
85
|
+
{
|
|
86
|
+
displayName: 'Active',
|
|
87
|
+
name: 'isActive',
|
|
88
|
+
type: 'boolean',
|
|
89
|
+
default: true,
|
|
90
|
+
},
|
|
91
|
+
(0, shared_1.customFieldsFixedCollectionWithList)('getUserCustomFields'),
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
displayName: 'Update Fields',
|
|
96
|
+
name: 'updateFields',
|
|
97
|
+
type: 'collection',
|
|
98
|
+
placeholder: 'Add Field',
|
|
99
|
+
default: {},
|
|
100
|
+
displayOptions: { show: { resource: ['user'], operation: ['update'] } },
|
|
101
|
+
options: [
|
|
102
|
+
{ displayName: 'Active', name: 'isActive', type: 'boolean', default: true },
|
|
103
|
+
(0, shared_1.customFieldsFixedCollectionWithList)('getUserCustomFields'),
|
|
104
|
+
{ displayName: 'Email', name: 'email', type: 'string',
|
|
105
|
+
placeholder: 'name@email.com', default: '' },
|
|
106
|
+
{ displayName: 'First Name', name: 'firstName', type: 'string', default: '' },
|
|
107
|
+
{ displayName: 'Last Name', name: 'lastName', type: 'string', default: '' },
|
|
108
|
+
{
|
|
109
|
+
displayName: 'Organization',
|
|
110
|
+
name: 'client',
|
|
111
|
+
type: 'resourceLocator',
|
|
112
|
+
default: { mode: 'list', value: '' },
|
|
113
|
+
modes: (0, shared_1.resourceLocatorModes)('getClients', 'Select an organization...'),
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
},
|
|
117
|
+
...(0, shared_1.returnAllLimitFields)('user'),
|
|
118
|
+
];
|
|
119
|
+
exports.organizationOperations = [
|
|
120
|
+
{
|
|
121
|
+
displayName: 'Operation',
|
|
122
|
+
name: 'operation',
|
|
123
|
+
type: 'options',
|
|
124
|
+
noDataExpression: true,
|
|
125
|
+
displayOptions: { show: { resource: ['organization'] } },
|
|
126
|
+
options: [
|
|
127
|
+
{ name: 'Create', value: 'create', action: 'Create an organization' },
|
|
128
|
+
{ name: 'Get', value: 'get', action: 'Get an organization' },
|
|
129
|
+
{ name: 'Get Many', value: 'getAll', action: 'Get many organizations' },
|
|
130
|
+
{ name: 'Update', value: 'update', action: 'Update an organization' },
|
|
131
|
+
],
|
|
132
|
+
default: 'getAll',
|
|
133
|
+
},
|
|
134
|
+
];
|
|
135
|
+
exports.organizationFields = [
|
|
136
|
+
{
|
|
137
|
+
displayName: 'Organization',
|
|
138
|
+
name: 'organizationId',
|
|
139
|
+
type: 'resourceLocator',
|
|
140
|
+
default: { mode: 'list', value: '' },
|
|
141
|
+
required: true,
|
|
142
|
+
displayOptions: { show: { resource: ['organization'], operation: ['get', 'update'] } },
|
|
143
|
+
modes: (0, shared_1.resourceLocatorModes)('getClients', 'Select an organization...'),
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
displayName: 'Name',
|
|
147
|
+
name: 'name',
|
|
148
|
+
type: 'string',
|
|
149
|
+
required: true,
|
|
150
|
+
displayOptions: { show: { resource: ['organization'], operation: ['create'] } },
|
|
151
|
+
default: '',
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
displayName: 'Additional Fields',
|
|
155
|
+
name: 'additionalFields',
|
|
156
|
+
type: 'collection',
|
|
157
|
+
placeholder: 'Add Field',
|
|
158
|
+
default: {},
|
|
159
|
+
displayOptions: { show: { resource: ['organization'], operation: ['create'] } },
|
|
160
|
+
options: [
|
|
161
|
+
{ displayName: 'Active', name: 'isActive', type: 'boolean', default: true },
|
|
162
|
+
(0, shared_1.customFieldsFixedCollectionWithList)('getClientCustomFields'),
|
|
163
|
+
],
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
displayName: 'Update Fields',
|
|
167
|
+
name: 'updateFields',
|
|
168
|
+
type: 'collection',
|
|
169
|
+
placeholder: 'Add Field',
|
|
170
|
+
default: {},
|
|
171
|
+
displayOptions: { show: { resource: ['organization'], operation: ['update'] } },
|
|
172
|
+
options: [
|
|
173
|
+
{ displayName: 'Name', name: 'name', type: 'string', default: '' },
|
|
174
|
+
{ displayName: 'Active', name: 'isActive', type: 'boolean', default: true },
|
|
175
|
+
(0, shared_1.customFieldsFixedCollectionWithList)('getClientCustomFields'),
|
|
176
|
+
],
|
|
177
|
+
},
|
|
178
|
+
...(0, shared_1.returnAllLimitFields)('organization'),
|
|
179
|
+
];
|
|
180
|
+
exports.deviceOperations = [
|
|
181
|
+
{
|
|
182
|
+
displayName: 'Operation',
|
|
183
|
+
name: 'operation',
|
|
184
|
+
type: 'options',
|
|
185
|
+
noDataExpression: true,
|
|
186
|
+
displayOptions: { show: { resource: ['device'] } },
|
|
187
|
+
options: [
|
|
188
|
+
{ name: 'Create', value: 'create', action: 'Create a device' },
|
|
189
|
+
{ name: 'Get', value: 'get', action: 'Get a device' },
|
|
190
|
+
{ name: 'Get Many', value: 'getAll', action: 'Get many devices' },
|
|
191
|
+
{ name: 'Update', value: 'update', action: 'Update a device' },
|
|
192
|
+
],
|
|
193
|
+
default: 'getAll',
|
|
194
|
+
},
|
|
195
|
+
];
|
|
196
|
+
exports.deviceFields = [
|
|
197
|
+
{
|
|
198
|
+
displayName: 'Device',
|
|
199
|
+
name: 'deviceId',
|
|
200
|
+
type: 'resourceLocator',
|
|
201
|
+
default: { mode: 'list', value: '' },
|
|
202
|
+
required: true,
|
|
203
|
+
displayOptions: { show: { resource: ['device'], operation: ['get', 'update'] } },
|
|
204
|
+
modes: (0, shared_1.resourceLocatorModes)('getDevices', 'Select a device...'),
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
displayName: 'Name',
|
|
208
|
+
name: 'name',
|
|
209
|
+
type: 'string',
|
|
210
|
+
required: true,
|
|
211
|
+
displayOptions: { show: { resource: ['device'], operation: ['create'] } },
|
|
212
|
+
default: '',
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
displayName: 'Organization',
|
|
216
|
+
name: 'client',
|
|
217
|
+
type: 'resourceLocator',
|
|
218
|
+
default: { mode: 'list', value: '' },
|
|
219
|
+
required: true,
|
|
220
|
+
displayOptions: { show: { resource: ['device'], operation: ['create'] } },
|
|
221
|
+
modes: (0, shared_1.resourceLocatorModes)('getClients', 'Select an organization...'),
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
displayName: 'Additional Fields',
|
|
225
|
+
name: 'additionalFields',
|
|
226
|
+
type: 'collection',
|
|
227
|
+
placeholder: 'Add Field',
|
|
228
|
+
default: {},
|
|
229
|
+
displayOptions: { show: { resource: ['device'], operation: ['create'] } },
|
|
230
|
+
options: [
|
|
231
|
+
{ displayName: 'Serial Number', name: 'serialNumber', type: 'string', default: '' },
|
|
232
|
+
{
|
|
233
|
+
displayName: 'Owner',
|
|
234
|
+
name: 'owner',
|
|
235
|
+
type: 'resourceLocator',
|
|
236
|
+
default: { mode: 'list', value: '' },
|
|
237
|
+
modes: (0, shared_1.resourceLocatorModes)('getUsers', 'Select a user...'),
|
|
238
|
+
},
|
|
239
|
+
{ displayName: 'Active', name: 'isActive', type: 'boolean', default: true },
|
|
240
|
+
(0, shared_1.customFieldsFixedCollectionWithList)('getDeviceCustomFields'),
|
|
241
|
+
],
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
displayName: 'Update Fields',
|
|
245
|
+
name: 'updateFields',
|
|
246
|
+
type: 'collection',
|
|
247
|
+
placeholder: 'Add Field',
|
|
248
|
+
default: {},
|
|
249
|
+
displayOptions: { show: { resource: ['device'], operation: ['update'] } },
|
|
250
|
+
options: [
|
|
251
|
+
{ displayName: 'Active', name: 'isActive', type: 'boolean', default: true },
|
|
252
|
+
(0, shared_1.customFieldsFixedCollectionWithList)('getDeviceCustomFields'),
|
|
253
|
+
{ displayName: 'Name', name: 'name', type: 'string', default: '' },
|
|
254
|
+
{
|
|
255
|
+
displayName: 'Organization',
|
|
256
|
+
name: 'client',
|
|
257
|
+
type: 'resourceLocator',
|
|
258
|
+
default: { mode: 'list', value: '' },
|
|
259
|
+
modes: (0, shared_1.resourceLocatorModes)('getClients', 'Select an organization...'),
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
displayName: 'Owner',
|
|
263
|
+
name: 'owner',
|
|
264
|
+
type: 'resourceLocator',
|
|
265
|
+
default: { mode: 'list', value: '' },
|
|
266
|
+
modes: (0, shared_1.resourceLocatorModes)('getUsers', 'Select a user...'),
|
|
267
|
+
},
|
|
268
|
+
{ displayName: 'Serial Number', name: 'serialNumber', type: 'string', default: '' },
|
|
269
|
+
],
|
|
270
|
+
},
|
|
271
|
+
...(0, shared_1.returnAllLimitFields)('device'),
|
|
272
|
+
];
|
|
273
|
+
exports.teamOperations = [
|
|
274
|
+
{
|
|
275
|
+
displayName: 'Operation',
|
|
276
|
+
name: 'operation',
|
|
277
|
+
type: 'options',
|
|
278
|
+
noDataExpression: true,
|
|
279
|
+
displayOptions: { show: { resource: ['team'] } },
|
|
280
|
+
options: [
|
|
281
|
+
{ name: 'Create', value: 'create', action: 'Create a team' },
|
|
282
|
+
{ name: 'Get', value: 'get', action: 'Get a team' },
|
|
283
|
+
{ name: 'Get Many', value: 'getAll', action: 'Get many teams' },
|
|
284
|
+
{ name: 'Update', value: 'update', action: 'Update a team' },
|
|
285
|
+
],
|
|
286
|
+
default: 'getAll',
|
|
287
|
+
},
|
|
288
|
+
];
|
|
289
|
+
exports.teamFields = [
|
|
290
|
+
{
|
|
291
|
+
displayName: 'Team',
|
|
292
|
+
name: 'teamId',
|
|
293
|
+
type: 'resourceLocator',
|
|
294
|
+
default: { mode: 'list', value: '' },
|
|
295
|
+
required: true,
|
|
296
|
+
displayOptions: { show: { resource: ['team'], operation: ['get', 'update'] } },
|
|
297
|
+
modes: (0, shared_1.resourceLocatorModes)('getTeams', 'Select a team...'),
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
displayName: 'Name',
|
|
301
|
+
name: 'name',
|
|
302
|
+
type: 'string',
|
|
303
|
+
required: true,
|
|
304
|
+
displayOptions: { show: { resource: ['team'], operation: ['create'] } },
|
|
305
|
+
default: '',
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
displayName: 'Additional Fields',
|
|
309
|
+
name: 'additionalFields',
|
|
310
|
+
type: 'collection',
|
|
311
|
+
placeholder: 'Add Field',
|
|
312
|
+
default: {},
|
|
313
|
+
displayOptions: { show: { resource: ['team'], operation: ['create'] } },
|
|
314
|
+
options: [
|
|
315
|
+
(0, shared_1.multiOptionsFromLoad)('Organizations', 'clients', 'getClientsLoad', 'Organizations (clients) linked to this team'),
|
|
316
|
+
(0, shared_1.multiOptionsFromLoad)('Members', 'members', 'getUsersLoad', 'Team members — pick one or more users'),
|
|
317
|
+
(0, shared_1.multiOptionsFromLoad)('Administrators', 'administrators', 'getUsersLoad', 'Team administrators — pick one or more users'),
|
|
318
|
+
],
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
displayName: 'Update Fields',
|
|
322
|
+
name: 'updateFields',
|
|
323
|
+
type: 'collection',
|
|
324
|
+
placeholder: 'Add Field',
|
|
325
|
+
default: {},
|
|
326
|
+
displayOptions: { show: { resource: ['team'], operation: ['update'] } },
|
|
327
|
+
options: [
|
|
328
|
+
{ displayName: 'Name', name: 'name', type: 'string', default: '' },
|
|
329
|
+
(0, shared_1.multiOptionsFromLoad)('Organizations', 'clients', 'getClientsLoad', 'Organizations (clients) linked to this team'),
|
|
330
|
+
(0, shared_1.multiOptionsFromLoad)('Members', 'members', 'getUsersLoad', 'Team members — pick one or more users'),
|
|
331
|
+
(0, shared_1.multiOptionsFromLoad)('Administrators', 'administrators', 'getUsersLoad', 'Team administrators — pick one or more users'),
|
|
332
|
+
],
|
|
333
|
+
},
|
|
334
|
+
...(0, shared_1.returnAllLimitFields)('team'),
|
|
335
|
+
];
|
|
336
|
+
exports.searchOperations = [
|
|
337
|
+
{
|
|
338
|
+
displayName: 'Operation',
|
|
339
|
+
name: 'operation',
|
|
340
|
+
type: 'options',
|
|
341
|
+
noDataExpression: true,
|
|
342
|
+
displayOptions: { show: { resource: ['search'] } },
|
|
343
|
+
options: [
|
|
344
|
+
{
|
|
345
|
+
name: 'Advanced Search',
|
|
346
|
+
value: 'advanced',
|
|
347
|
+
action: 'Advanced ticket search',
|
|
348
|
+
description: 'POST /advanced-search/ — filtered ticket list (same engine as support filters)',
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
name: 'Quick Search',
|
|
352
|
+
value: 'quick',
|
|
353
|
+
action: 'Quick search',
|
|
354
|
+
description: 'GET /search/ — search tickets or users by text',
|
|
355
|
+
},
|
|
356
|
+
],
|
|
357
|
+
default: 'advanced',
|
|
358
|
+
},
|
|
359
|
+
];
|
|
360
|
+
exports.searchFields = [
|
|
361
|
+
{
|
|
362
|
+
displayName: 'Conditions (JSON)',
|
|
363
|
+
name: 'conditionsJson',
|
|
364
|
+
type: 'json',
|
|
365
|
+
required: true,
|
|
366
|
+
displayOptions: { show: { resource: ['search'], operation: ['advanced'] } },
|
|
367
|
+
default: '{\n "condition": {\n "equation_type": "and",\n "equation": []\n }\n}',
|
|
368
|
+
description: 'Envelope with condition tree (conditions.condition). Empty equation = all visible tickets. See swagger /advanced-search/.',
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
displayName: 'Search Text',
|
|
372
|
+
name: 'searchText',
|
|
373
|
+
type: 'string',
|
|
374
|
+
displayOptions: { show: { resource: ['search'], operation: ['advanced'] } },
|
|
375
|
+
default: '',
|
|
376
|
+
description: 'Optional text search (min 2 characters)',
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
displayName: 'Page',
|
|
380
|
+
name: 'page',
|
|
381
|
+
type: 'number',
|
|
382
|
+
typeOptions: { minValue: 1 },
|
|
383
|
+
displayOptions: { show: { resource: ['search'], operation: ['advanced'] } },
|
|
384
|
+
default: 1,
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
displayName: 'Page Size',
|
|
388
|
+
name: 'pageSize',
|
|
389
|
+
type: 'number',
|
|
390
|
+
typeOptions: { minValue: 1 },
|
|
391
|
+
displayOptions: { show: { resource: ['search'], operation: ['advanced'] } },
|
|
392
|
+
default: 10,
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
displayName: 'Ordering',
|
|
396
|
+
name: 'ordering',
|
|
397
|
+
type: 'string',
|
|
398
|
+
displayOptions: { show: { resource: ['search'], operation: ['advanced'] } },
|
|
399
|
+
default: '',
|
|
400
|
+
description: 'E.g. -created_at.',
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
displayName: 'Include Custom Fields Display',
|
|
404
|
+
name: 'customFieldsDisplay',
|
|
405
|
+
type: 'boolean',
|
|
406
|
+
displayOptions: { show: { resource: ['search'], operation: ['advanced'] } },
|
|
407
|
+
default: false,
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
displayName: 'Return All Pages',
|
|
411
|
+
name: 'returnAll',
|
|
412
|
+
type: 'boolean',
|
|
413
|
+
displayOptions: { show: { resource: ['search'], operation: ['advanced'] } },
|
|
414
|
+
default: false,
|
|
415
|
+
description: 'Whether to return all results or only up to a given limit',
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
displayName: 'Query',
|
|
419
|
+
name: 'query',
|
|
420
|
+
type: 'string',
|
|
421
|
+
required: true,
|
|
422
|
+
displayOptions: { show: { resource: ['search'], operation: ['quick'] } },
|
|
423
|
+
default: '',
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
displayName: 'Type',
|
|
427
|
+
name: 'searchType',
|
|
428
|
+
type: 'options',
|
|
429
|
+
options: [
|
|
430
|
+
{ name: 'Ticket', value: 'ticket' },
|
|
431
|
+
{ name: 'User', value: 'user' },
|
|
432
|
+
],
|
|
433
|
+
displayOptions: { show: { resource: ['search'], operation: ['quick'] } },
|
|
434
|
+
default: 'ticket',
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
displayName: 'Limit',
|
|
438
|
+
name: 'quickLimit',
|
|
439
|
+
type: 'number',
|
|
440
|
+
typeOptions: { minValue: 1, maxValue: 100 },
|
|
441
|
+
displayOptions: { show: { resource: ['search'], operation: ['quick'] } },
|
|
442
|
+
default: 10,
|
|
443
|
+
},
|
|
444
|
+
];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
import { getClients, getClientsLoad, getClientCustomFields, getCustomFieldOptions, getDevices, getDevicesLoad, getDeviceCustomFields, getFormCustomFields, getFormStatuses, getForms, getPages, getPagesLoad, getTasks, getTeams, getTeamsLoad, getTickets, getTicketsLoad, getUserCustomFields, getUsers, getUsersLoad } from './QweaseMethods';
|
|
3
|
+
export declare class Qwease implements INodeType {
|
|
4
|
+
description: INodeTypeDescription;
|
|
5
|
+
methods: {
|
|
6
|
+
listSearch: {
|
|
7
|
+
getForms: typeof getForms;
|
|
8
|
+
getUsers: typeof getUsers;
|
|
9
|
+
getTeams: typeof getTeams;
|
|
10
|
+
getTickets: typeof getTickets;
|
|
11
|
+
getClients: typeof getClients;
|
|
12
|
+
getDevices: typeof getDevices;
|
|
13
|
+
getPages: typeof getPages;
|
|
14
|
+
getTasks: typeof getTasks;
|
|
15
|
+
getFormStatuses: typeof getFormStatuses;
|
|
16
|
+
getFormCustomFields: typeof getFormCustomFields;
|
|
17
|
+
getUserCustomFields: typeof getUserCustomFields;
|
|
18
|
+
getClientCustomFields: typeof getClientCustomFields;
|
|
19
|
+
getDeviceCustomFields: typeof getDeviceCustomFields;
|
|
20
|
+
getCustomFieldOptions: typeof getCustomFieldOptions;
|
|
21
|
+
};
|
|
22
|
+
loadOptions: {
|
|
23
|
+
getUsersLoad: typeof getUsersLoad;
|
|
24
|
+
getClientsLoad: typeof getClientsLoad;
|
|
25
|
+
getTeamsLoad: typeof getTeamsLoad;
|
|
26
|
+
getDevicesLoad: typeof getDevicesLoad;
|
|
27
|
+
getTicketsLoad: typeof getTicketsLoad;
|
|
28
|
+
getPagesLoad: typeof getPagesLoad;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Qwease = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const GenericFunctions_1 = require("./GenericFunctions");
|
|
6
|
+
const TicketBody_1 = require("./TicketBody");
|
|
7
|
+
const QweaseMethods_1 = require("./QweaseMethods");
|
|
8
|
+
const QweaseDescription_1 = require("./QweaseDescription");
|
|
9
|
+
const OtherResourcesDescription_1 = require("./OtherResourcesDescription");
|
|
10
|
+
const KnowledgeTaskDescription_1 = require("./KnowledgeTaskDescription");
|
|
11
|
+
const executeOtherResources_1 = require("./executeOtherResources");
|
|
12
|
+
const executeKnowledgeTask_1 = require("./executeKnowledgeTask");
|
|
13
|
+
class Qwease {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.description = {
|
|
16
|
+
displayName: 'Qwease',
|
|
17
|
+
name: 'qwease',
|
|
18
|
+
icon: 'file:qwease.svg',
|
|
19
|
+
group: ['transform'],
|
|
20
|
+
version: 1,
|
|
21
|
+
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
22
|
+
description: 'Interact with Qwease ITSM (tickets, users, organizations, devices, knowledge, tasks, search)',
|
|
23
|
+
defaults: {
|
|
24
|
+
name: 'Qwease',
|
|
25
|
+
},
|
|
26
|
+
inputs: ['main'],
|
|
27
|
+
outputs: ['main'],
|
|
28
|
+
usableAsTool: true,
|
|
29
|
+
credentials: [
|
|
30
|
+
{
|
|
31
|
+
name: 'qweaseApi',
|
|
32
|
+
required: true,
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
properties: [
|
|
36
|
+
{
|
|
37
|
+
displayName: 'Resource',
|
|
38
|
+
name: 'resource',
|
|
39
|
+
type: 'options',
|
|
40
|
+
noDataExpression: true,
|
|
41
|
+
options: [
|
|
42
|
+
{ name: 'Device', value: 'device' },
|
|
43
|
+
{ name: 'Knowledge', value: 'knowledge' },
|
|
44
|
+
{ name: 'Me', value: 'me' },
|
|
45
|
+
{ name: 'Organization', value: 'organization' },
|
|
46
|
+
{ name: 'Search', value: 'search' },
|
|
47
|
+
{ name: 'Task', value: 'task' },
|
|
48
|
+
{ name: 'Team', value: 'team' },
|
|
49
|
+
{ name: 'Ticket', value: 'ticket' },
|
|
50
|
+
{ name: 'User', value: 'user' },
|
|
51
|
+
],
|
|
52
|
+
default: 'ticket',
|
|
53
|
+
},
|
|
54
|
+
...QweaseDescription_1.ticketOperations,
|
|
55
|
+
...QweaseDescription_1.ticketFields,
|
|
56
|
+
...OtherResourcesDescription_1.userOperations,
|
|
57
|
+
...OtherResourcesDescription_1.userFields,
|
|
58
|
+
...OtherResourcesDescription_1.organizationOperations,
|
|
59
|
+
...OtherResourcesDescription_1.organizationFields,
|
|
60
|
+
...OtherResourcesDescription_1.deviceOperations,
|
|
61
|
+
...OtherResourcesDescription_1.deviceFields,
|
|
62
|
+
...OtherResourcesDescription_1.teamOperations,
|
|
63
|
+
...OtherResourcesDescription_1.teamFields,
|
|
64
|
+
...KnowledgeTaskDescription_1.knowledgeOperations,
|
|
65
|
+
...KnowledgeTaskDescription_1.knowledgeFields,
|
|
66
|
+
...KnowledgeTaskDescription_1.taskOperations,
|
|
67
|
+
...KnowledgeTaskDescription_1.taskFields,
|
|
68
|
+
...OtherResourcesDescription_1.searchOperations,
|
|
69
|
+
...OtherResourcesDescription_1.searchFields,
|
|
70
|
+
...OtherResourcesDescription_1.meOperations,
|
|
71
|
+
],
|
|
72
|
+
};
|
|
73
|
+
this.methods = {
|
|
74
|
+
listSearch: {
|
|
75
|
+
getForms: QweaseMethods_1.getForms,
|
|
76
|
+
getUsers: QweaseMethods_1.getUsers,
|
|
77
|
+
getTeams: QweaseMethods_1.getTeams,
|
|
78
|
+
getTickets: QweaseMethods_1.getTickets,
|
|
79
|
+
getClients: QweaseMethods_1.getClients,
|
|
80
|
+
getDevices: QweaseMethods_1.getDevices,
|
|
81
|
+
getPages: QweaseMethods_1.getPages,
|
|
82
|
+
getTasks: QweaseMethods_1.getTasks,
|
|
83
|
+
getFormStatuses: QweaseMethods_1.getFormStatuses,
|
|
84
|
+
getFormCustomFields: QweaseMethods_1.getFormCustomFields,
|
|
85
|
+
getUserCustomFields: QweaseMethods_1.getUserCustomFields,
|
|
86
|
+
getClientCustomFields: QweaseMethods_1.getClientCustomFields,
|
|
87
|
+
getDeviceCustomFields: QweaseMethods_1.getDeviceCustomFields,
|
|
88
|
+
getCustomFieldOptions: QweaseMethods_1.getCustomFieldOptions,
|
|
89
|
+
},
|
|
90
|
+
loadOptions: {
|
|
91
|
+
getUsersLoad: QweaseMethods_1.getUsersLoad,
|
|
92
|
+
getClientsLoad: QweaseMethods_1.getClientsLoad,
|
|
93
|
+
getTeamsLoad: QweaseMethods_1.getTeamsLoad,
|
|
94
|
+
getDevicesLoad: QweaseMethods_1.getDevicesLoad,
|
|
95
|
+
getTicketsLoad: QweaseMethods_1.getTicketsLoad,
|
|
96
|
+
getPagesLoad: QweaseMethods_1.getPagesLoad,
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
async execute() {
|
|
101
|
+
const items = this.getInputData();
|
|
102
|
+
const returnData = [];
|
|
103
|
+
const resource = this.getNodeParameter('resource', 0);
|
|
104
|
+
const operation = this.getNodeParameter('operation', 0);
|
|
105
|
+
for (let i = 0; i < items.length; i++) {
|
|
106
|
+
try {
|
|
107
|
+
let results = [];
|
|
108
|
+
if (resource === 'ticket') {
|
|
109
|
+
if (operation === 'create') {
|
|
110
|
+
const body = TicketBody_1.buildTicketBodyFromParameters.call(this, i, true);
|
|
111
|
+
const response = await GenericFunctions_1.qweaseApiRequest.call(this, 'POST', '/ticket/', body);
|
|
112
|
+
results = [{ json: response, pairedItem: { item: i } }];
|
|
113
|
+
}
|
|
114
|
+
else if (operation === 'get') {
|
|
115
|
+
const ticketId = TicketBody_1.getTicketIdParameter.call(this, i);
|
|
116
|
+
const response = await GenericFunctions_1.qweaseApiRequest.call(this, 'GET', `/ticket/${ticketId}/`);
|
|
117
|
+
results = [{ json: response, pairedItem: { item: i } }];
|
|
118
|
+
}
|
|
119
|
+
else if (operation === 'getAll') {
|
|
120
|
+
const returnAll = this.getNodeParameter('returnAll', i);
|
|
121
|
+
const limit = this.getNodeParameter('limit', i);
|
|
122
|
+
const response = await GenericFunctions_1.qweaseApiRequest.call(this, 'GET', '/ticket/');
|
|
123
|
+
const list = (0, GenericFunctions_1.qweaseListFromResponse)(response);
|
|
124
|
+
const sliced = returnAll ? list : list.slice(0, limit);
|
|
125
|
+
results = sliced.map((entry) => ({ json: entry, pairedItem: { item: i } }));
|
|
126
|
+
}
|
|
127
|
+
else if (operation === 'update') {
|
|
128
|
+
const ticketId = TicketBody_1.getTicketIdParameter.call(this, i);
|
|
129
|
+
const body = TicketBody_1.buildTicketBodyFromParameters.call(this, i, false);
|
|
130
|
+
if (Object.keys(body).length === 0) {
|
|
131
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Set at least one field to update.', {
|
|
132
|
+
itemIndex: i,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
const response = await GenericFunctions_1.qweaseApiRequest.call(this, 'PATCH', `/ticket/${ticketId}/`, body);
|
|
136
|
+
results = [{ json: response, pairedItem: { item: i } }];
|
|
137
|
+
}
|
|
138
|
+
else if (operation === 'addComment') {
|
|
139
|
+
const ticketId = TicketBody_1.getTicketIdParameter.call(this, i);
|
|
140
|
+
const comment = this.getNodeParameter('comment', i);
|
|
141
|
+
const isPrivate = this.getNodeParameter('commentPrivate', i, false);
|
|
142
|
+
const response = await GenericFunctions_1.qweaseApiRequest.call(this, 'POST', `/ticket/${ticketId}/commentary/`, {
|
|
143
|
+
content: comment,
|
|
144
|
+
is_private: isPrivate,
|
|
145
|
+
origin: 'api',
|
|
146
|
+
});
|
|
147
|
+
results = [{ json: response, pairedItem: { item: i } }];
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
else if (resource === 'user') {
|
|
151
|
+
results = await executeOtherResources_1.executeUser.call(this, i, operation);
|
|
152
|
+
}
|
|
153
|
+
else if (resource === 'organization') {
|
|
154
|
+
results = await executeOtherResources_1.executeOrganization.call(this, i, operation);
|
|
155
|
+
}
|
|
156
|
+
else if (resource === 'device') {
|
|
157
|
+
results = await executeOtherResources_1.executeDevice.call(this, i, operation);
|
|
158
|
+
}
|
|
159
|
+
else if (resource === 'team') {
|
|
160
|
+
results = await executeOtherResources_1.executeTeam.call(this, i, operation);
|
|
161
|
+
}
|
|
162
|
+
else if (resource === 'knowledge') {
|
|
163
|
+
results = await executeKnowledgeTask_1.executeKnowledge.call(this, i, operation);
|
|
164
|
+
}
|
|
165
|
+
else if (resource === 'task') {
|
|
166
|
+
results = await executeKnowledgeTask_1.executeTask.call(this, i, operation);
|
|
167
|
+
}
|
|
168
|
+
else if (resource === 'search') {
|
|
169
|
+
results = await executeOtherResources_1.executeSearch.call(this, i, operation);
|
|
170
|
+
}
|
|
171
|
+
else if (resource === 'me') {
|
|
172
|
+
results = await executeOtherResources_1.executeMe.call(this, i);
|
|
173
|
+
}
|
|
174
|
+
returnData.push(...results);
|
|
175
|
+
}
|
|
176
|
+
catch (error) {
|
|
177
|
+
if (this.continueOnFail()) {
|
|
178
|
+
returnData.push({ json: { error: error.message }, pairedItem: { item: i } });
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
throw error;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return [returnData];
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
exports.Qwease = Qwease;
|