@wals-pro/n8n-nodes-weclapp 0.3.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 +21 -0
- package/README.md +206 -0
- package/dist/credentials/WeclappApi.credentials.d.ts +10 -0
- package/dist/credentials/WeclappApi.credentials.js +56 -0
- package/dist/credentials/WeclappApi.credentials.js.map +1 -0
- package/dist/credentials/weclapp.dark.svg +19 -0
- package/dist/credentials/weclapp.light.svg +19 -0
- package/dist/nodes/Weclapp/GenericFunctions.d.ts +19 -0
- package/dist/nodes/Weclapp/GenericFunctions.js +287 -0
- package/dist/nodes/Weclapp/GenericFunctions.js.map +1 -0
- package/dist/nodes/Weclapp/SharedFields.d.ts +24 -0
- package/dist/nodes/Weclapp/SharedFields.js +348 -0
- package/dist/nodes/Weclapp/SharedFields.js.map +1 -0
- package/dist/nodes/Weclapp/Weclapp.node.d.ts +27 -0
- package/dist/nodes/Weclapp/Weclapp.node.js +231 -0
- package/dist/nodes/Weclapp/Weclapp.node.js.map +1 -0
- package/dist/nodes/Weclapp/actions/applyPayment.d.ts +9 -0
- package/dist/nodes/Weclapp/actions/applyPayment.js +64 -0
- package/dist/nodes/Weclapp/actions/applyPayment.js.map +1 -0
- package/dist/nodes/Weclapp/actions/articlePriceSync.d.ts +41 -0
- package/dist/nodes/Weclapp/actions/articlePriceSync.js +238 -0
- package/dist/nodes/Weclapp/actions/articlePriceSync.js.map +1 -0
- package/dist/nodes/Weclapp/actions/documentUpload.d.ts +3 -0
- package/dist/nodes/Weclapp/actions/documentUpload.js +90 -0
- package/dist/nodes/Weclapp/actions/documentUpload.js.map +1 -0
- package/dist/nodes/Weclapp/descriptions/ArticleDescription.d.ts +3 -0
- package/dist/nodes/Weclapp/descriptions/ArticleDescription.js +724 -0
- package/dist/nodes/Weclapp/descriptions/ArticleDescription.js.map +1 -0
- package/dist/nodes/Weclapp/descriptions/BankDescription.d.ts +6 -0
- package/dist/nodes/Weclapp/descriptions/BankDescription.js +471 -0
- package/dist/nodes/Weclapp/descriptions/BankDescription.js.map +1 -0
- package/dist/nodes/Weclapp/descriptions/CustomApiDescription.d.ts +4 -0
- package/dist/nodes/Weclapp/descriptions/CustomApiDescription.js +238 -0
- package/dist/nodes/Weclapp/descriptions/CustomApiDescription.js.map +1 -0
- package/dist/nodes/Weclapp/descriptions/DocumentDescription.d.ts +3 -0
- package/dist/nodes/Weclapp/descriptions/DocumentDescription.js +976 -0
- package/dist/nodes/Weclapp/descriptions/DocumentDescription.js.map +1 -0
- package/dist/nodes/Weclapp/descriptions/PartyDescription.d.ts +4 -0
- package/dist/nodes/Weclapp/descriptions/PartyDescription.js +408 -0
- package/dist/nodes/Weclapp/descriptions/PartyDescription.js.map +1 -0
- package/dist/nodes/Weclapp/descriptions/ProductionOrderDescription.d.ts +4 -0
- package/dist/nodes/Weclapp/descriptions/ProductionOrderDescription.js +628 -0
- package/dist/nodes/Weclapp/descriptions/ProductionOrderDescription.js.map +1 -0
- package/dist/nodes/Weclapp/descriptions/PurchaseInvoiceDescription.d.ts +3 -0
- package/dist/nodes/Weclapp/descriptions/PurchaseInvoiceDescription.js +559 -0
- package/dist/nodes/Weclapp/descriptions/PurchaseInvoiceDescription.js.map +1 -0
- package/dist/nodes/Weclapp/descriptions/PurchaseOrderDescription.d.ts +3 -0
- package/dist/nodes/Weclapp/descriptions/PurchaseOrderDescription.js +681 -0
- package/dist/nodes/Weclapp/descriptions/PurchaseOrderDescription.js.map +1 -0
- package/dist/nodes/Weclapp/descriptions/QuotationDescription.d.ts +3 -0
- package/dist/nodes/Weclapp/descriptions/QuotationDescription.js +1069 -0
- package/dist/nodes/Weclapp/descriptions/QuotationDescription.js.map +1 -0
- package/dist/nodes/Weclapp/descriptions/SalesInvoiceDescription.d.ts +3 -0
- package/dist/nodes/Weclapp/descriptions/SalesInvoiceDescription.js +994 -0
- package/dist/nodes/Weclapp/descriptions/SalesInvoiceDescription.js.map +1 -0
- package/dist/nodes/Weclapp/descriptions/SalesOrderDescription.d.ts +4 -0
- package/dist/nodes/Weclapp/descriptions/SalesOrderDescription.js +1122 -0
- package/dist/nodes/Weclapp/descriptions/SalesOrderDescription.js.map +1 -0
- package/dist/nodes/Weclapp/descriptions/ShipmentDescription.d.ts +3 -0
- package/dist/nodes/Weclapp/descriptions/ShipmentDescription.js +502 -0
- package/dist/nodes/Weclapp/descriptions/ShipmentDescription.js.map +1 -0
- package/dist/nodes/Weclapp/descriptions/TagUnitUserDescription.d.ts +9 -0
- package/dist/nodes/Weclapp/descriptions/TagUnitUserDescription.js +664 -0
- package/dist/nodes/Weclapp/descriptions/TagUnitUserDescription.js.map +1 -0
- package/dist/nodes/Weclapp/descriptions/TicketDescription.d.ts +9 -0
- package/dist/nodes/Weclapp/descriptions/TicketDescription.js +745 -0
- package/dist/nodes/Weclapp/descriptions/TicketDescription.js.map +1 -0
- package/dist/nodes/Weclapp/descriptions/WarehouseDescription.d.ts +35 -0
- package/dist/nodes/Weclapp/descriptions/WarehouseDescription.js +935 -0
- package/dist/nodes/Weclapp/descriptions/WarehouseDescription.js.map +1 -0
- package/dist/nodes/Weclapp/descriptions/WebhookDescription.d.ts +4 -0
- package/dist/nodes/Weclapp/descriptions/WebhookDescription.js +411 -0
- package/dist/nodes/Weclapp/descriptions/WebhookDescription.js.map +1 -0
- package/dist/nodes/Weclapp/descriptions/index.d.ts +3 -0
- package/dist/nodes/Weclapp/descriptions/index.js +56 -0
- package/dist/nodes/Weclapp/descriptions/index.js.map +1 -0
- package/dist/nodes/Weclapp/generated/entityMetadata.d.ts +3 -0
- package/dist/nodes/Weclapp/generated/entityMetadata.js +368 -0
- package/dist/nodes/Weclapp/generated/entityMetadata.js.map +1 -0
- package/dist/nodes/Weclapp/generated/openapiMetadata.d.ts +3 -0
- package/dist/nodes/Weclapp/generated/openapiMetadata.js +212 -0
- package/dist/nodes/Weclapp/generated/openapiMetadata.js.map +1 -0
- package/dist/nodes/Weclapp/methods/customAttributes.d.ts +32 -0
- package/dist/nodes/Weclapp/methods/customAttributes.js +156 -0
- package/dist/nodes/Weclapp/methods/customAttributes.js.map +1 -0
- package/dist/nodes/Weclapp/methods/loadOptions.d.ts +3 -0
- package/dist/nodes/Weclapp/methods/loadOptions.js +107 -0
- package/dist/nodes/Weclapp/methods/loadOptions.js.map +1 -0
- package/dist/nodes/Weclapp/weclapp.dark.svg +19 -0
- package/dist/nodes/Weclapp/weclapp.light.svg +19 -0
- package/dist/nodes/WeclappTrigger/WeclappTrigger.node.d.ts +12 -0
- package/dist/nodes/WeclappTrigger/WeclappTrigger.node.js +198 -0
- package/dist/nodes/WeclappTrigger/WeclappTrigger.node.js.map +1 -0
- package/dist/nodes/WeclappTrigger/weclapp.dark.svg +19 -0
- package/dist/nodes/WeclappTrigger/weclapp.light.svg +19 -0
- package/dist/package.json +78 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +78 -0
|
@@ -0,0 +1,745 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.COMMENT_SIMPLE_FIELDS = exports.TICKET_SIMPLE_FIELDS = exports.commentFields = exports.commentOperations = exports.ticketFields = exports.ticketOperations = void 0;
|
|
4
|
+
exports.simplifyTicket = simplifyTicket;
|
|
5
|
+
exports.simplifyComment = simplifyComment;
|
|
6
|
+
const SharedFields_1 = require("../SharedFields");
|
|
7
|
+
const GenericFunctions_1 = require("../GenericFunctions");
|
|
8
|
+
exports.ticketOperations = [
|
|
9
|
+
{
|
|
10
|
+
displayName: 'Operation',
|
|
11
|
+
name: 'operation',
|
|
12
|
+
type: 'options',
|
|
13
|
+
noDataExpression: true,
|
|
14
|
+
displayOptions: { show: { resource: ['ticket'] } },
|
|
15
|
+
default: 'list',
|
|
16
|
+
options: [
|
|
17
|
+
{
|
|
18
|
+
name: 'Create',
|
|
19
|
+
value: 'create',
|
|
20
|
+
description: 'Create a new ticket',
|
|
21
|
+
action: 'Create a ticket',
|
|
22
|
+
routing: {
|
|
23
|
+
request: {
|
|
24
|
+
method: 'POST',
|
|
25
|
+
url: '/ticket',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'Create Performance Record',
|
|
31
|
+
value: 'createPerformanceRecord',
|
|
32
|
+
description: 'Create a performance record for a ticket',
|
|
33
|
+
action: 'Create a performance record for a ticket',
|
|
34
|
+
routing: {
|
|
35
|
+
request: {
|
|
36
|
+
method: 'POST',
|
|
37
|
+
url: '=/ticket/id/{{$parameter["ticketId"]}}/createPerformanceRecord',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'Delete',
|
|
43
|
+
value: 'delete',
|
|
44
|
+
description: 'Delete a ticket by ID',
|
|
45
|
+
action: 'Delete a ticket',
|
|
46
|
+
routing: {
|
|
47
|
+
request: {
|
|
48
|
+
method: 'DELETE',
|
|
49
|
+
url: '=/ticket/id/{{$parameter["ticketId"]}}',
|
|
50
|
+
},
|
|
51
|
+
output: {
|
|
52
|
+
postReceive: [
|
|
53
|
+
{
|
|
54
|
+
type: 'set',
|
|
55
|
+
properties: {
|
|
56
|
+
value: '={{ { "deleted": true, "id": $parameter["ticketId"] } }}',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: 'Get',
|
|
65
|
+
value: 'get',
|
|
66
|
+
description: 'Get a ticket by ID',
|
|
67
|
+
action: 'Get a ticket',
|
|
68
|
+
routing: {
|
|
69
|
+
request: {
|
|
70
|
+
method: 'GET',
|
|
71
|
+
url: '=/ticket/id/{{$parameter["ticketId"]}}',
|
|
72
|
+
},
|
|
73
|
+
output: {
|
|
74
|
+
postReceive: [GenericFunctions_1.simplifyPostReceive],
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: 'Get Many',
|
|
80
|
+
value: 'list',
|
|
81
|
+
description: 'Get many tickets',
|
|
82
|
+
action: 'Get many tickets',
|
|
83
|
+
routing: {
|
|
84
|
+
request: {
|
|
85
|
+
method: 'GET',
|
|
86
|
+
url: '/ticket',
|
|
87
|
+
},
|
|
88
|
+
...SharedFields_1.listPaginationRouting,
|
|
89
|
+
output: {
|
|
90
|
+
postReceive: [
|
|
91
|
+
{
|
|
92
|
+
type: 'rootProperty',
|
|
93
|
+
properties: { property: 'result' },
|
|
94
|
+
},
|
|
95
|
+
GenericFunctions_1.mergeAdditionalProperties,
|
|
96
|
+
GenericFunctions_1.simplifyPostReceive,
|
|
97
|
+
],
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: 'Mark Read',
|
|
103
|
+
value: 'markRead',
|
|
104
|
+
description: 'Mark a ticket as read (may return 404 on some weclapp versions; check permissions)',
|
|
105
|
+
action: 'Mark a ticket as read',
|
|
106
|
+
routing: {
|
|
107
|
+
request: {
|
|
108
|
+
method: 'POST',
|
|
109
|
+
url: '=/ticket/id/{{$parameter["ticketId"]}}/markRead',
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: 'Update',
|
|
115
|
+
value: 'update',
|
|
116
|
+
description: 'Update a ticket by ID',
|
|
117
|
+
action: 'Update a ticket',
|
|
118
|
+
routing: {
|
|
119
|
+
request: {
|
|
120
|
+
method: 'PUT',
|
|
121
|
+
url: '=/ticket/id/{{$parameter["ticketId"]}}',
|
|
122
|
+
qs: {
|
|
123
|
+
ignoreMissingProperties: true,
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
},
|
|
130
|
+
];
|
|
131
|
+
exports.ticketFields = [
|
|
132
|
+
{
|
|
133
|
+
displayName: 'Ticket',
|
|
134
|
+
name: 'ticketId',
|
|
135
|
+
type: 'resourceLocator',
|
|
136
|
+
default: { mode: 'list', value: '' },
|
|
137
|
+
required: true,
|
|
138
|
+
description: 'The ticket to operate on',
|
|
139
|
+
displayOptions: {
|
|
140
|
+
show: {
|
|
141
|
+
resource: ['ticket'],
|
|
142
|
+
operation: ['get', 'update', 'delete', 'markRead', 'createPerformanceRecord'],
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
modes: [
|
|
146
|
+
{
|
|
147
|
+
displayName: 'From List',
|
|
148
|
+
name: 'list',
|
|
149
|
+
type: 'list',
|
|
150
|
+
typeOptions: {
|
|
151
|
+
searchListMethod: 'searchTickets',
|
|
152
|
+
searchable: true,
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
displayName: 'ID',
|
|
157
|
+
name: 'id',
|
|
158
|
+
type: 'string',
|
|
159
|
+
placeholder: 'e.g. 1234567890',
|
|
160
|
+
validation: [
|
|
161
|
+
{
|
|
162
|
+
type: 'regex',
|
|
163
|
+
properties: {
|
|
164
|
+
regex: '^[0-9]+$',
|
|
165
|
+
errorMessage: 'Ticket ID must be numeric',
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
displayName: 'URL',
|
|
172
|
+
name: 'url',
|
|
173
|
+
type: 'string',
|
|
174
|
+
placeholder: 'e.g. https://tenant.weclapp.com/webapp/api/v2/ticket/id/1234567890',
|
|
175
|
+
extractValue: {
|
|
176
|
+
type: 'regex',
|
|
177
|
+
regex: '/ticket/id/([0-9]+)',
|
|
178
|
+
},
|
|
179
|
+
validation: [
|
|
180
|
+
{
|
|
181
|
+
type: 'regex',
|
|
182
|
+
properties: {
|
|
183
|
+
regex: '/ticket/id/[0-9]+',
|
|
184
|
+
errorMessage: 'URL must contain /ticket/id/{id}',
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
],
|
|
188
|
+
},
|
|
189
|
+
],
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
...SharedFields_1.limitField,
|
|
193
|
+
displayOptions: { show: { resource: ['ticket'], operation: ['list'] } },
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
...SharedFields_1.filtersCollection,
|
|
197
|
+
displayOptions: { show: { resource: ['ticket'], operation: ['list'] } },
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
...SharedFields_1.simplifyField,
|
|
201
|
+
displayOptions: { show: { resource: ['ticket'], operation: ['list', 'get'] } },
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
displayName: 'Subject',
|
|
205
|
+
name: 'subject',
|
|
206
|
+
type: 'string',
|
|
207
|
+
required: true,
|
|
208
|
+
default: '',
|
|
209
|
+
displayOptions: { show: { resource: ['ticket'], operation: ['create'] } },
|
|
210
|
+
description: 'The subject of the ticket',
|
|
211
|
+
routing: {
|
|
212
|
+
send: { type: 'body', property: 'subject' },
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
displayName: 'Ticket Status Name or ID',
|
|
217
|
+
name: 'ticketStatusId',
|
|
218
|
+
type: 'options',
|
|
219
|
+
default: '',
|
|
220
|
+
typeOptions: { loadOptionsMethod: 'getTicketStatuses' },
|
|
221
|
+
displayOptions: { show: { resource: ['ticket'], operation: ['create'] } },
|
|
222
|
+
description: 'The status of the ticket (foreign key to ticketStatus entity). Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
223
|
+
routing: {
|
|
224
|
+
send: { type: 'body', property: 'ticketStatusId' },
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
displayName: 'Additional Fields',
|
|
229
|
+
name: 'additionalFields',
|
|
230
|
+
type: 'collection',
|
|
231
|
+
placeholder: 'Add Field',
|
|
232
|
+
default: {},
|
|
233
|
+
displayOptions: { show: { resource: ['ticket'], operation: ['create'] } },
|
|
234
|
+
options: [
|
|
235
|
+
{
|
|
236
|
+
displayName: 'Assignee ID',
|
|
237
|
+
name: 'assigneeId',
|
|
238
|
+
type: 'string',
|
|
239
|
+
default: '',
|
|
240
|
+
description: 'The ID of the user assigned to this ticket',
|
|
241
|
+
routing: {
|
|
242
|
+
send: { type: 'body', property: 'assigneeId' },
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
displayName: 'Due Date',
|
|
247
|
+
name: 'dueDate',
|
|
248
|
+
type: 'dateTime',
|
|
249
|
+
default: '',
|
|
250
|
+
description: 'The due date for the ticket (as timestamp in ms)',
|
|
251
|
+
routing: {
|
|
252
|
+
send: { type: 'body', property: 'dueDate' },
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
displayName: 'Requester ID',
|
|
257
|
+
name: 'requesterId',
|
|
258
|
+
type: 'string',
|
|
259
|
+
default: '',
|
|
260
|
+
description: 'The ID of the user who requested this ticket',
|
|
261
|
+
routing: {
|
|
262
|
+
send: { type: 'body', property: 'requesterId' },
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
displayName: 'Ticket Pooling Group ID',
|
|
267
|
+
name: 'ticketPoolingGroupId',
|
|
268
|
+
type: 'string',
|
|
269
|
+
default: '',
|
|
270
|
+
description: 'The ID of the ticket pooling group',
|
|
271
|
+
routing: {
|
|
272
|
+
send: { type: 'body', property: 'ticketPoolingGroupId' },
|
|
273
|
+
},
|
|
274
|
+
},
|
|
275
|
+
],
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
displayName: 'Update Fields',
|
|
279
|
+
name: 'updateFields',
|
|
280
|
+
type: 'collection',
|
|
281
|
+
placeholder: 'Add Field',
|
|
282
|
+
default: {},
|
|
283
|
+
displayOptions: { show: { resource: ['ticket'], operation: ['update'] } },
|
|
284
|
+
options: [
|
|
285
|
+
{
|
|
286
|
+
displayName: 'Assignee ID',
|
|
287
|
+
name: 'assigneeId',
|
|
288
|
+
type: 'string',
|
|
289
|
+
default: '',
|
|
290
|
+
routing: {
|
|
291
|
+
send: { type: 'body', property: 'assigneeId' },
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
displayName: 'Due Date',
|
|
296
|
+
name: 'dueDate',
|
|
297
|
+
type: 'dateTime',
|
|
298
|
+
default: '',
|
|
299
|
+
routing: {
|
|
300
|
+
send: { type: 'body', property: 'dueDate' },
|
|
301
|
+
},
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
displayName: 'Requester ID',
|
|
305
|
+
name: 'requesterId',
|
|
306
|
+
type: 'string',
|
|
307
|
+
default: '',
|
|
308
|
+
routing: {
|
|
309
|
+
send: { type: 'body', property: 'requesterId' },
|
|
310
|
+
},
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
displayName: 'Subject',
|
|
314
|
+
name: 'subject',
|
|
315
|
+
type: 'string',
|
|
316
|
+
default: '',
|
|
317
|
+
description: 'The subject of the ticket',
|
|
318
|
+
routing: {
|
|
319
|
+
send: { type: 'body', property: 'subject' },
|
|
320
|
+
},
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
displayName: 'Ticket Pooling Group ID',
|
|
324
|
+
name: 'ticketPoolingGroupId',
|
|
325
|
+
type: 'string',
|
|
326
|
+
default: '',
|
|
327
|
+
routing: {
|
|
328
|
+
send: { type: 'body', property: 'ticketPoolingGroupId' },
|
|
329
|
+
},
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
displayName: 'Ticket Status Name or ID',
|
|
333
|
+
name: 'ticketStatusId',
|
|
334
|
+
type: 'options',
|
|
335
|
+
default: '',
|
|
336
|
+
typeOptions: { loadOptionsMethod: 'getTicketStatuses' },
|
|
337
|
+
description: 'The status of the ticket (foreign key to ticketStatus entity). Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
338
|
+
routing: {
|
|
339
|
+
send: { type: 'body', property: 'ticketStatusId' },
|
|
340
|
+
},
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
displayName: 'Version',
|
|
344
|
+
name: 'version',
|
|
345
|
+
type: 'string',
|
|
346
|
+
default: '',
|
|
347
|
+
description: 'Optimistic-lock version string. Include to prevent conflicting concurrent updates.',
|
|
348
|
+
routing: {
|
|
349
|
+
send: { type: 'body', property: 'version' },
|
|
350
|
+
},
|
|
351
|
+
},
|
|
352
|
+
],
|
|
353
|
+
},
|
|
354
|
+
];
|
|
355
|
+
exports.commentOperations = [
|
|
356
|
+
{
|
|
357
|
+
displayName: 'Operation',
|
|
358
|
+
name: 'operation',
|
|
359
|
+
type: 'options',
|
|
360
|
+
noDataExpression: true,
|
|
361
|
+
displayOptions: { show: { resource: ['comment'] } },
|
|
362
|
+
default: 'list',
|
|
363
|
+
options: [
|
|
364
|
+
{
|
|
365
|
+
name: 'Create',
|
|
366
|
+
value: 'create',
|
|
367
|
+
description: 'Create a new comment on an entity',
|
|
368
|
+
action: 'Create a comment',
|
|
369
|
+
routing: {
|
|
370
|
+
request: {
|
|
371
|
+
method: 'POST',
|
|
372
|
+
url: '/comment',
|
|
373
|
+
},
|
|
374
|
+
},
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
name: 'Delete',
|
|
378
|
+
value: 'delete',
|
|
379
|
+
description: 'Delete a comment by ID',
|
|
380
|
+
action: 'Delete a comment',
|
|
381
|
+
routing: {
|
|
382
|
+
request: {
|
|
383
|
+
method: 'DELETE',
|
|
384
|
+
url: '=/comment/id/{{$parameter["commentId"]}}',
|
|
385
|
+
},
|
|
386
|
+
output: {
|
|
387
|
+
postReceive: [
|
|
388
|
+
{
|
|
389
|
+
type: 'set',
|
|
390
|
+
properties: {
|
|
391
|
+
value: '={{ { "deleted": true, "id": $parameter["commentId"] } }}',
|
|
392
|
+
},
|
|
393
|
+
},
|
|
394
|
+
],
|
|
395
|
+
},
|
|
396
|
+
},
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
name: 'Get',
|
|
400
|
+
value: 'get',
|
|
401
|
+
description: 'Get a comment by ID',
|
|
402
|
+
action: 'Get a comment',
|
|
403
|
+
routing: {
|
|
404
|
+
request: {
|
|
405
|
+
method: 'GET',
|
|
406
|
+
url: '=/comment/id/{{$parameter["commentId"]}}',
|
|
407
|
+
},
|
|
408
|
+
output: {
|
|
409
|
+
postReceive: [GenericFunctions_1.simplifyPostReceive],
|
|
410
|
+
},
|
|
411
|
+
},
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
name: 'Get Many',
|
|
415
|
+
value: 'list',
|
|
416
|
+
description: 'Get many comments for an entity',
|
|
417
|
+
action: 'Get many comments',
|
|
418
|
+
routing: {
|
|
419
|
+
request: {
|
|
420
|
+
method: 'GET',
|
|
421
|
+
url: '/comment',
|
|
422
|
+
},
|
|
423
|
+
...SharedFields_1.listPaginationRouting,
|
|
424
|
+
output: {
|
|
425
|
+
postReceive: [
|
|
426
|
+
{
|
|
427
|
+
type: 'rootProperty',
|
|
428
|
+
properties: { property: 'result' },
|
|
429
|
+
},
|
|
430
|
+
GenericFunctions_1.mergeAdditionalProperties,
|
|
431
|
+
GenericFunctions_1.simplifyPostReceive,
|
|
432
|
+
],
|
|
433
|
+
},
|
|
434
|
+
},
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
name: 'Update',
|
|
438
|
+
value: 'update',
|
|
439
|
+
description: 'Update a comment by ID',
|
|
440
|
+
action: 'Update a comment',
|
|
441
|
+
routing: {
|
|
442
|
+
request: {
|
|
443
|
+
method: 'PUT',
|
|
444
|
+
url: '=/comment/id/{{$parameter["commentId"]}}',
|
|
445
|
+
qs: {
|
|
446
|
+
ignoreMissingProperties: true,
|
|
447
|
+
},
|
|
448
|
+
},
|
|
449
|
+
},
|
|
450
|
+
},
|
|
451
|
+
],
|
|
452
|
+
},
|
|
453
|
+
];
|
|
454
|
+
exports.commentFields = [
|
|
455
|
+
{
|
|
456
|
+
displayName: 'Comment ID',
|
|
457
|
+
name: 'commentId',
|
|
458
|
+
type: 'string',
|
|
459
|
+
required: true,
|
|
460
|
+
default: '',
|
|
461
|
+
displayOptions: {
|
|
462
|
+
show: {
|
|
463
|
+
resource: ['comment'],
|
|
464
|
+
operation: ['get', 'update', 'delete'],
|
|
465
|
+
},
|
|
466
|
+
},
|
|
467
|
+
description: 'The ID of the comment',
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
displayName: 'Entity Name',
|
|
471
|
+
name: 'entityName',
|
|
472
|
+
type: 'options',
|
|
473
|
+
required: true,
|
|
474
|
+
default: 'ticket',
|
|
475
|
+
displayOptions: {
|
|
476
|
+
show: {
|
|
477
|
+
resource: ['comment'],
|
|
478
|
+
operation: ['list'],
|
|
479
|
+
},
|
|
480
|
+
},
|
|
481
|
+
description: 'The entity type these comments belong to (e.g. ticket, salesOrder, purchaseOrder)',
|
|
482
|
+
options: [
|
|
483
|
+
{ name: 'Article', value: 'article' },
|
|
484
|
+
{ name: 'Document', value: 'document' },
|
|
485
|
+
{ name: 'Party', value: 'party' },
|
|
486
|
+
{ name: 'Production Order', value: 'productionOrder' },
|
|
487
|
+
{ name: 'Purchase Invoice', value: 'purchaseInvoice' },
|
|
488
|
+
{ name: 'Purchase Order', value: 'purchaseOrder' },
|
|
489
|
+
{ name: 'Quotation', value: 'quotation' },
|
|
490
|
+
{ name: 'Sales Invoice', value: 'salesInvoice' },
|
|
491
|
+
{ name: 'Sales Order', value: 'salesOrder' },
|
|
492
|
+
{ name: 'Shipment', value: 'shipment' },
|
|
493
|
+
{ name: 'Ticket', value: 'ticket' },
|
|
494
|
+
],
|
|
495
|
+
routing: {
|
|
496
|
+
send: {
|
|
497
|
+
type: 'query',
|
|
498
|
+
property: 'entityName',
|
|
499
|
+
},
|
|
500
|
+
},
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
displayName: 'Entity Name',
|
|
504
|
+
name: 'entityNameCreate',
|
|
505
|
+
type: 'options',
|
|
506
|
+
required: true,
|
|
507
|
+
default: 'ticket',
|
|
508
|
+
displayOptions: {
|
|
509
|
+
show: {
|
|
510
|
+
resource: ['comment'],
|
|
511
|
+
operation: ['create'],
|
|
512
|
+
},
|
|
513
|
+
},
|
|
514
|
+
description: 'The entity type this comment belongs to (e.g. ticket, salesOrder, purchaseOrder)',
|
|
515
|
+
options: [
|
|
516
|
+
{ name: 'Article', value: 'article' },
|
|
517
|
+
{ name: 'Document', value: 'document' },
|
|
518
|
+
{ name: 'Party', value: 'party' },
|
|
519
|
+
{ name: 'Production Order', value: 'productionOrder' },
|
|
520
|
+
{ name: 'Purchase Invoice', value: 'purchaseInvoice' },
|
|
521
|
+
{ name: 'Purchase Order', value: 'purchaseOrder' },
|
|
522
|
+
{ name: 'Quotation', value: 'quotation' },
|
|
523
|
+
{ name: 'Sales Invoice', value: 'salesInvoice' },
|
|
524
|
+
{ name: 'Sales Order', value: 'salesOrder' },
|
|
525
|
+
{ name: 'Shipment', value: 'shipment' },
|
|
526
|
+
{ name: 'Ticket', value: 'ticket' },
|
|
527
|
+
],
|
|
528
|
+
routing: {
|
|
529
|
+
send: {
|
|
530
|
+
type: 'body',
|
|
531
|
+
property: 'entityName',
|
|
532
|
+
},
|
|
533
|
+
},
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
displayName: 'Entity ID',
|
|
537
|
+
name: 'entityId',
|
|
538
|
+
type: 'string',
|
|
539
|
+
required: true,
|
|
540
|
+
default: '',
|
|
541
|
+
displayOptions: {
|
|
542
|
+
show: {
|
|
543
|
+
resource: ['comment'],
|
|
544
|
+
operation: ['list'],
|
|
545
|
+
},
|
|
546
|
+
},
|
|
547
|
+
description: 'The ID of the entity whose comments to list',
|
|
548
|
+
routing: {
|
|
549
|
+
send: {
|
|
550
|
+
type: 'query',
|
|
551
|
+
property: 'entityId',
|
|
552
|
+
},
|
|
553
|
+
},
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
...SharedFields_1.limitField,
|
|
557
|
+
displayOptions: { show: { resource: ['comment'], operation: ['list'] } },
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
...SharedFields_1.simplifyField,
|
|
561
|
+
displayOptions: { show: { resource: ['comment'], operation: ['list', 'get'] } },
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
displayName: 'Entity ID',
|
|
565
|
+
name: 'entityIdCreate',
|
|
566
|
+
type: 'string',
|
|
567
|
+
required: true,
|
|
568
|
+
default: '',
|
|
569
|
+
displayOptions: {
|
|
570
|
+
show: {
|
|
571
|
+
resource: ['comment'],
|
|
572
|
+
operation: ['create'],
|
|
573
|
+
},
|
|
574
|
+
},
|
|
575
|
+
description: 'The ID of the entity this comment belongs to',
|
|
576
|
+
routing: {
|
|
577
|
+
send: { type: 'body', property: 'entityId' },
|
|
578
|
+
},
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
displayName: 'Comment',
|
|
582
|
+
name: 'comment',
|
|
583
|
+
type: 'string',
|
|
584
|
+
required: true,
|
|
585
|
+
default: '',
|
|
586
|
+
typeOptions: { rows: 4 },
|
|
587
|
+
displayOptions: { show: { resource: ['comment'], operation: ['create'] } },
|
|
588
|
+
description: 'The comment text',
|
|
589
|
+
routing: {
|
|
590
|
+
send: { type: 'body', property: 'comment' },
|
|
591
|
+
},
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
displayName: 'Additional Fields',
|
|
595
|
+
name: 'additionalFields',
|
|
596
|
+
type: 'collection',
|
|
597
|
+
placeholder: 'Add Field',
|
|
598
|
+
default: {},
|
|
599
|
+
displayOptions: { show: { resource: ['comment'], operation: ['create'] } },
|
|
600
|
+
options: [
|
|
601
|
+
{
|
|
602
|
+
displayName: 'HTML Comment',
|
|
603
|
+
name: 'htmlComment',
|
|
604
|
+
type: 'string',
|
|
605
|
+
default: '',
|
|
606
|
+
description: 'The comment text in HTML format (used instead of plain comment if set)',
|
|
607
|
+
routing: {
|
|
608
|
+
send: { type: 'body', property: 'htmlComment' },
|
|
609
|
+
},
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
displayName: 'Parent Comment ID',
|
|
613
|
+
name: 'parentCommentId',
|
|
614
|
+
type: 'string',
|
|
615
|
+
default: '',
|
|
616
|
+
description: 'The ID of the parent comment (for threaded replies)',
|
|
617
|
+
routing: {
|
|
618
|
+
send: { type: 'body', property: 'parentCommentId' },
|
|
619
|
+
},
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
displayName: 'Private Comment',
|
|
623
|
+
name: 'privateComment',
|
|
624
|
+
type: 'boolean',
|
|
625
|
+
default: false,
|
|
626
|
+
description: 'Whether this comment is private (internal only)',
|
|
627
|
+
routing: {
|
|
628
|
+
send: { type: 'body', property: 'privateComment' },
|
|
629
|
+
},
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
displayName: 'Public Comment',
|
|
633
|
+
name: 'publicComment',
|
|
634
|
+
type: 'boolean',
|
|
635
|
+
default: false,
|
|
636
|
+
description: 'Whether this comment is public (visible to external parties)',
|
|
637
|
+
routing: {
|
|
638
|
+
send: { type: 'body', property: 'publicComment' },
|
|
639
|
+
},
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
displayName: 'Solution',
|
|
643
|
+
name: 'solution',
|
|
644
|
+
type: 'boolean',
|
|
645
|
+
default: false,
|
|
646
|
+
description: 'Whether this comment marks the solution to the ticket',
|
|
647
|
+
routing: {
|
|
648
|
+
send: { type: 'body', property: 'solution' },
|
|
649
|
+
},
|
|
650
|
+
},
|
|
651
|
+
],
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
displayName: 'Update Fields',
|
|
655
|
+
name: 'updateFields',
|
|
656
|
+
type: 'collection',
|
|
657
|
+
placeholder: 'Add Field',
|
|
658
|
+
default: {},
|
|
659
|
+
displayOptions: { show: { resource: ['comment'], operation: ['update'] } },
|
|
660
|
+
options: [
|
|
661
|
+
{
|
|
662
|
+
displayName: 'Comment',
|
|
663
|
+
name: 'comment',
|
|
664
|
+
type: 'string',
|
|
665
|
+
default: '',
|
|
666
|
+
typeOptions: { rows: 4 },
|
|
667
|
+
routing: {
|
|
668
|
+
send: { type: 'body', property: 'comment' },
|
|
669
|
+
},
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
displayName: 'HTML Comment',
|
|
673
|
+
name: 'htmlComment',
|
|
674
|
+
type: 'string',
|
|
675
|
+
default: '',
|
|
676
|
+
routing: {
|
|
677
|
+
send: { type: 'body', property: 'htmlComment' },
|
|
678
|
+
},
|
|
679
|
+
},
|
|
680
|
+
{
|
|
681
|
+
displayName: 'Private Comment',
|
|
682
|
+
name: 'privateComment',
|
|
683
|
+
type: 'boolean',
|
|
684
|
+
default: false,
|
|
685
|
+
routing: {
|
|
686
|
+
send: { type: 'body', property: 'privateComment' },
|
|
687
|
+
},
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
displayName: 'Public Comment',
|
|
691
|
+
name: 'publicComment',
|
|
692
|
+
type: 'boolean',
|
|
693
|
+
default: false,
|
|
694
|
+
routing: {
|
|
695
|
+
send: { type: 'body', property: 'publicComment' },
|
|
696
|
+
},
|
|
697
|
+
},
|
|
698
|
+
{
|
|
699
|
+
displayName: 'Solution',
|
|
700
|
+
name: 'solution',
|
|
701
|
+
type: 'boolean',
|
|
702
|
+
default: false,
|
|
703
|
+
routing: {
|
|
704
|
+
send: { type: 'body', property: 'solution' },
|
|
705
|
+
},
|
|
706
|
+
},
|
|
707
|
+
{
|
|
708
|
+
displayName: 'Version',
|
|
709
|
+
name: 'version',
|
|
710
|
+
type: 'string',
|
|
711
|
+
default: '',
|
|
712
|
+
description: 'Optimistic-lock version string. Include to prevent conflicting concurrent updates.',
|
|
713
|
+
routing: {
|
|
714
|
+
send: { type: 'body', property: 'version' },
|
|
715
|
+
},
|
|
716
|
+
},
|
|
717
|
+
],
|
|
718
|
+
},
|
|
719
|
+
];
|
|
720
|
+
exports.TICKET_SIMPLE_FIELDS = new Set([
|
|
721
|
+
'id',
|
|
722
|
+
'version',
|
|
723
|
+
'ticketStatusId',
|
|
724
|
+
'subject',
|
|
725
|
+
'assigneeId',
|
|
726
|
+
'requesterId',
|
|
727
|
+
'createdDate',
|
|
728
|
+
'dueDate',
|
|
729
|
+
]);
|
|
730
|
+
exports.COMMENT_SIMPLE_FIELDS = new Set([
|
|
731
|
+
'id',
|
|
732
|
+
'version',
|
|
733
|
+
'entityName',
|
|
734
|
+
'entityId',
|
|
735
|
+
'comment',
|
|
736
|
+
'createdUserId',
|
|
737
|
+
'createdDate',
|
|
738
|
+
]);
|
|
739
|
+
function simplifyTicket(ticket) {
|
|
740
|
+
return Object.fromEntries(Object.entries(ticket).filter(([k]) => exports.TICKET_SIMPLE_FIELDS.has(k)));
|
|
741
|
+
}
|
|
742
|
+
function simplifyComment(comment) {
|
|
743
|
+
return Object.fromEntries(Object.entries(comment).filter(([k]) => exports.COMMENT_SIMPLE_FIELDS.has(k)));
|
|
744
|
+
}
|
|
745
|
+
//# sourceMappingURL=TicketDescription.js.map
|