@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.
Files changed (98) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +206 -0
  3. package/dist/credentials/WeclappApi.credentials.d.ts +10 -0
  4. package/dist/credentials/WeclappApi.credentials.js +56 -0
  5. package/dist/credentials/WeclappApi.credentials.js.map +1 -0
  6. package/dist/credentials/weclapp.dark.svg +19 -0
  7. package/dist/credentials/weclapp.light.svg +19 -0
  8. package/dist/nodes/Weclapp/GenericFunctions.d.ts +19 -0
  9. package/dist/nodes/Weclapp/GenericFunctions.js +287 -0
  10. package/dist/nodes/Weclapp/GenericFunctions.js.map +1 -0
  11. package/dist/nodes/Weclapp/SharedFields.d.ts +24 -0
  12. package/dist/nodes/Weclapp/SharedFields.js +348 -0
  13. package/dist/nodes/Weclapp/SharedFields.js.map +1 -0
  14. package/dist/nodes/Weclapp/Weclapp.node.d.ts +27 -0
  15. package/dist/nodes/Weclapp/Weclapp.node.js +231 -0
  16. package/dist/nodes/Weclapp/Weclapp.node.js.map +1 -0
  17. package/dist/nodes/Weclapp/actions/applyPayment.d.ts +9 -0
  18. package/dist/nodes/Weclapp/actions/applyPayment.js +64 -0
  19. package/dist/nodes/Weclapp/actions/applyPayment.js.map +1 -0
  20. package/dist/nodes/Weclapp/actions/articlePriceSync.d.ts +41 -0
  21. package/dist/nodes/Weclapp/actions/articlePriceSync.js +238 -0
  22. package/dist/nodes/Weclapp/actions/articlePriceSync.js.map +1 -0
  23. package/dist/nodes/Weclapp/actions/documentUpload.d.ts +3 -0
  24. package/dist/nodes/Weclapp/actions/documentUpload.js +90 -0
  25. package/dist/nodes/Weclapp/actions/documentUpload.js.map +1 -0
  26. package/dist/nodes/Weclapp/descriptions/ArticleDescription.d.ts +3 -0
  27. package/dist/nodes/Weclapp/descriptions/ArticleDescription.js +724 -0
  28. package/dist/nodes/Weclapp/descriptions/ArticleDescription.js.map +1 -0
  29. package/dist/nodes/Weclapp/descriptions/BankDescription.d.ts +6 -0
  30. package/dist/nodes/Weclapp/descriptions/BankDescription.js +471 -0
  31. package/dist/nodes/Weclapp/descriptions/BankDescription.js.map +1 -0
  32. package/dist/nodes/Weclapp/descriptions/CustomApiDescription.d.ts +4 -0
  33. package/dist/nodes/Weclapp/descriptions/CustomApiDescription.js +238 -0
  34. package/dist/nodes/Weclapp/descriptions/CustomApiDescription.js.map +1 -0
  35. package/dist/nodes/Weclapp/descriptions/DocumentDescription.d.ts +3 -0
  36. package/dist/nodes/Weclapp/descriptions/DocumentDescription.js +976 -0
  37. package/dist/nodes/Weclapp/descriptions/DocumentDescription.js.map +1 -0
  38. package/dist/nodes/Weclapp/descriptions/PartyDescription.d.ts +4 -0
  39. package/dist/nodes/Weclapp/descriptions/PartyDescription.js +408 -0
  40. package/dist/nodes/Weclapp/descriptions/PartyDescription.js.map +1 -0
  41. package/dist/nodes/Weclapp/descriptions/ProductionOrderDescription.d.ts +4 -0
  42. package/dist/nodes/Weclapp/descriptions/ProductionOrderDescription.js +628 -0
  43. package/dist/nodes/Weclapp/descriptions/ProductionOrderDescription.js.map +1 -0
  44. package/dist/nodes/Weclapp/descriptions/PurchaseInvoiceDescription.d.ts +3 -0
  45. package/dist/nodes/Weclapp/descriptions/PurchaseInvoiceDescription.js +559 -0
  46. package/dist/nodes/Weclapp/descriptions/PurchaseInvoiceDescription.js.map +1 -0
  47. package/dist/nodes/Weclapp/descriptions/PurchaseOrderDescription.d.ts +3 -0
  48. package/dist/nodes/Weclapp/descriptions/PurchaseOrderDescription.js +681 -0
  49. package/dist/nodes/Weclapp/descriptions/PurchaseOrderDescription.js.map +1 -0
  50. package/dist/nodes/Weclapp/descriptions/QuotationDescription.d.ts +3 -0
  51. package/dist/nodes/Weclapp/descriptions/QuotationDescription.js +1069 -0
  52. package/dist/nodes/Weclapp/descriptions/QuotationDescription.js.map +1 -0
  53. package/dist/nodes/Weclapp/descriptions/SalesInvoiceDescription.d.ts +3 -0
  54. package/dist/nodes/Weclapp/descriptions/SalesInvoiceDescription.js +994 -0
  55. package/dist/nodes/Weclapp/descriptions/SalesInvoiceDescription.js.map +1 -0
  56. package/dist/nodes/Weclapp/descriptions/SalesOrderDescription.d.ts +4 -0
  57. package/dist/nodes/Weclapp/descriptions/SalesOrderDescription.js +1122 -0
  58. package/dist/nodes/Weclapp/descriptions/SalesOrderDescription.js.map +1 -0
  59. package/dist/nodes/Weclapp/descriptions/ShipmentDescription.d.ts +3 -0
  60. package/dist/nodes/Weclapp/descriptions/ShipmentDescription.js +502 -0
  61. package/dist/nodes/Weclapp/descriptions/ShipmentDescription.js.map +1 -0
  62. package/dist/nodes/Weclapp/descriptions/TagUnitUserDescription.d.ts +9 -0
  63. package/dist/nodes/Weclapp/descriptions/TagUnitUserDescription.js +664 -0
  64. package/dist/nodes/Weclapp/descriptions/TagUnitUserDescription.js.map +1 -0
  65. package/dist/nodes/Weclapp/descriptions/TicketDescription.d.ts +9 -0
  66. package/dist/nodes/Weclapp/descriptions/TicketDescription.js +745 -0
  67. package/dist/nodes/Weclapp/descriptions/TicketDescription.js.map +1 -0
  68. package/dist/nodes/Weclapp/descriptions/WarehouseDescription.d.ts +35 -0
  69. package/dist/nodes/Weclapp/descriptions/WarehouseDescription.js +935 -0
  70. package/dist/nodes/Weclapp/descriptions/WarehouseDescription.js.map +1 -0
  71. package/dist/nodes/Weclapp/descriptions/WebhookDescription.d.ts +4 -0
  72. package/dist/nodes/Weclapp/descriptions/WebhookDescription.js +411 -0
  73. package/dist/nodes/Weclapp/descriptions/WebhookDescription.js.map +1 -0
  74. package/dist/nodes/Weclapp/descriptions/index.d.ts +3 -0
  75. package/dist/nodes/Weclapp/descriptions/index.js +56 -0
  76. package/dist/nodes/Weclapp/descriptions/index.js.map +1 -0
  77. package/dist/nodes/Weclapp/generated/entityMetadata.d.ts +3 -0
  78. package/dist/nodes/Weclapp/generated/entityMetadata.js +368 -0
  79. package/dist/nodes/Weclapp/generated/entityMetadata.js.map +1 -0
  80. package/dist/nodes/Weclapp/generated/openapiMetadata.d.ts +3 -0
  81. package/dist/nodes/Weclapp/generated/openapiMetadata.js +212 -0
  82. package/dist/nodes/Weclapp/generated/openapiMetadata.js.map +1 -0
  83. package/dist/nodes/Weclapp/methods/customAttributes.d.ts +32 -0
  84. package/dist/nodes/Weclapp/methods/customAttributes.js +156 -0
  85. package/dist/nodes/Weclapp/methods/customAttributes.js.map +1 -0
  86. package/dist/nodes/Weclapp/methods/loadOptions.d.ts +3 -0
  87. package/dist/nodes/Weclapp/methods/loadOptions.js +107 -0
  88. package/dist/nodes/Weclapp/methods/loadOptions.js.map +1 -0
  89. package/dist/nodes/Weclapp/weclapp.dark.svg +19 -0
  90. package/dist/nodes/Weclapp/weclapp.light.svg +19 -0
  91. package/dist/nodes/WeclappTrigger/WeclappTrigger.node.d.ts +12 -0
  92. package/dist/nodes/WeclappTrigger/WeclappTrigger.node.js +198 -0
  93. package/dist/nodes/WeclappTrigger/WeclappTrigger.node.js.map +1 -0
  94. package/dist/nodes/WeclappTrigger/weclapp.dark.svg +19 -0
  95. package/dist/nodes/WeclappTrigger/weclapp.light.svg +19 -0
  96. package/dist/package.json +78 -0
  97. package/dist/tsconfig.tsbuildinfo +1 -0
  98. package/package.json +78 -0
@@ -0,0 +1,1069 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.quotationFields = exports.quotationOperations = void 0;
4
+ const SharedFields_1 = require("../SharedFields");
5
+ const GenericFunctions_1 = require("../GenericFunctions");
6
+ exports.quotationOperations = [
7
+ {
8
+ displayName: 'Operation',
9
+ name: 'operation',
10
+ type: 'options',
11
+ noDataExpression: true,
12
+ displayOptions: {
13
+ show: {
14
+ resource: ['quotation'],
15
+ },
16
+ },
17
+ options: [
18
+ {
19
+ name: 'Accept',
20
+ value: 'accept',
21
+ description: 'Accept a quotation and trigger downstream processing',
22
+ action: 'Accept a quotation',
23
+ routing: {
24
+ request: {
25
+ method: 'POST',
26
+ url: '=/quotation/id/{{$parameter["quotationId"]}}/accept',
27
+ },
28
+ output: {
29
+ postReceive: [
30
+ {
31
+ type: 'rootProperty',
32
+ properties: {
33
+ property: 'result',
34
+ },
35
+ },
36
+ ],
37
+ },
38
+ },
39
+ },
40
+ {
41
+ name: 'Add Default Scale Prices to Items',
42
+ value: 'addDefaultScalePricesToItems',
43
+ description: 'Add default scale prices to specified quotation items',
44
+ action: 'Add default scale prices to items',
45
+ routing: {
46
+ request: {
47
+ method: 'POST',
48
+ url: '=/quotation/id/{{$parameter["quotationId"]}}/addDefaultScalePricesToItems',
49
+ },
50
+ output: {
51
+ postReceive: [
52
+ {
53
+ type: 'rootProperty',
54
+ properties: {
55
+ property: 'result',
56
+ },
57
+ },
58
+ ],
59
+ },
60
+ },
61
+ },
62
+ {
63
+ name: 'Calculate Sales Prices',
64
+ value: 'calculateSalesPrices',
65
+ description: 'Calculate sales prices for quotation items based on costs',
66
+ action: 'Calculate sales prices',
67
+ routing: {
68
+ request: {
69
+ method: 'POST',
70
+ url: '=/quotation/id/{{$parameter["quotationId"]}}/calculateSalesPrices',
71
+ },
72
+ output: {
73
+ postReceive: [
74
+ {
75
+ type: 'rootProperty',
76
+ properties: {
77
+ property: 'result',
78
+ },
79
+ },
80
+ ],
81
+ },
82
+ },
83
+ },
84
+ {
85
+ name: 'Create',
86
+ value: 'create',
87
+ description: 'Create a new quotation',
88
+ action: 'Create a quotation',
89
+ routing: {
90
+ request: {
91
+ method: 'POST',
92
+ url: '/quotation',
93
+ },
94
+ },
95
+ },
96
+ {
97
+ name: 'Create New Version',
98
+ value: 'createNewVersion',
99
+ description: 'Create a new version of the quotation',
100
+ action: 'Create new version',
101
+ routing: {
102
+ request: {
103
+ method: 'POST',
104
+ url: '=/quotation/id/{{$parameter["quotationId"]}}/createNewVersion',
105
+ },
106
+ output: {
107
+ postReceive: [
108
+ {
109
+ type: 'rootProperty',
110
+ properties: {
111
+ property: 'result',
112
+ },
113
+ },
114
+ ],
115
+ },
116
+ },
117
+ },
118
+ {
119
+ name: 'Create Public Page Link',
120
+ value: 'createPublicPageLink',
121
+ description: 'Generate a public shareable link for the quotation',
122
+ action: 'Create public page link',
123
+ routing: {
124
+ request: {
125
+ method: 'POST',
126
+ url: '=/quotation/id/{{$parameter["quotationId"]}}/createPublicPageLink',
127
+ },
128
+ },
129
+ },
130
+ {
131
+ name: 'Create Purchase Order Request',
132
+ value: 'createPurchaseOrderRequest',
133
+ description: 'Create a purchase order request from the quotation',
134
+ action: 'Create purchase order request',
135
+ routing: {
136
+ request: {
137
+ method: 'POST',
138
+ url: '=/quotation/id/{{$parameter["quotationId"]}}/createPurchaseOrderRequest',
139
+ },
140
+ output: {
141
+ postReceive: [
142
+ {
143
+ type: 'rootProperty',
144
+ properties: {
145
+ property: 'result',
146
+ },
147
+ },
148
+ ],
149
+ },
150
+ },
151
+ },
152
+ {
153
+ name: 'Create Quotation PDF',
154
+ value: 'createQuotationPdf',
155
+ description: 'Generate and download the quotation PDF',
156
+ action: 'Create quotation PDF',
157
+ routing: {
158
+ request: {
159
+ method: 'POST',
160
+ url: '=/quotation/id/{{$parameter["quotationId"]}}/createQuotationPdf',
161
+ encoding: 'arraybuffer',
162
+ returnFullResponse: true,
163
+ },
164
+ output: {
165
+ postReceive: [
166
+ {
167
+ type: 'binaryData',
168
+ properties: {
169
+ destinationProperty: 'data',
170
+ },
171
+ },
172
+ ],
173
+ },
174
+ },
175
+ },
176
+ {
177
+ name: 'Delete',
178
+ value: 'delete',
179
+ description: 'Delete a quotation by ID',
180
+ action: 'Delete a quotation',
181
+ routing: {
182
+ request: {
183
+ method: 'DELETE',
184
+ url: '=/quotation/id/{{$parameter["quotationId"]}}',
185
+ },
186
+ output: {
187
+ postReceive: [
188
+ {
189
+ type: 'set',
190
+ properties: {
191
+ value: '={{ { "deleted": true, "id": $parameter["quotationId"] } }}',
192
+ },
193
+ },
194
+ ],
195
+ },
196
+ },
197
+ },
198
+ {
199
+ name: 'Disable Public Page Link',
200
+ value: 'disablePublicPageLink',
201
+ description: 'Disable the public shareable link for the quotation',
202
+ action: 'Disable public page link',
203
+ routing: {
204
+ request: {
205
+ method: 'POST',
206
+ url: '=/quotation/id/{{$parameter["quotationId"]}}/disablePublicPageLink',
207
+ },
208
+ },
209
+ },
210
+ {
211
+ name: 'Download Latest Quotation PDF',
212
+ value: 'downloadLatestQuotationPdf',
213
+ description: 'Download the latest generated quotation PDF',
214
+ action: 'Download latest quotation PDF',
215
+ routing: {
216
+ request: {
217
+ method: 'GET',
218
+ url: '=/quotation/id/{{$parameter["quotationId"]}}/downloadLatestQuotationPdf',
219
+ encoding: 'arraybuffer',
220
+ returnFullResponse: true,
221
+ },
222
+ output: {
223
+ postReceive: [
224
+ {
225
+ type: 'binaryData',
226
+ properties: {
227
+ destinationProperty: 'data',
228
+ },
229
+ },
230
+ ],
231
+ },
232
+ },
233
+ },
234
+ {
235
+ name: 'Get',
236
+ value: 'get',
237
+ description: 'Retrieve a quotation by ID',
238
+ action: 'Get a quotation',
239
+ routing: {
240
+ request: {
241
+ method: 'GET',
242
+ url: '=/quotation/id/{{$parameter["quotationId"]}}',
243
+ },
244
+ output: {
245
+ postReceive: [GenericFunctions_1.simplifyPostReceive],
246
+ },
247
+ },
248
+ },
249
+ {
250
+ name: 'Inquire',
251
+ value: 'inquire',
252
+ description: 'Send an inquiry for the quotation',
253
+ action: 'Inquire quotation',
254
+ routing: {
255
+ request: {
256
+ method: 'POST',
257
+ url: '=/quotation/id/{{$parameter["quotationId"]}}/inquire',
258
+ },
259
+ output: {
260
+ postReceive: [
261
+ {
262
+ type: 'rootProperty',
263
+ properties: {
264
+ property: 'result',
265
+ },
266
+ },
267
+ ],
268
+ },
269
+ },
270
+ },
271
+ {
272
+ name: 'Get Many',
273
+ value: 'list',
274
+ description: 'Retrieve a list of quotations',
275
+ action: 'Get many quotations',
276
+ routing: {
277
+ request: {
278
+ method: 'GET',
279
+ url: '/quotation',
280
+ },
281
+ ...SharedFields_1.listPaginationRouting,
282
+ output: {
283
+ postReceive: [
284
+ {
285
+ type: 'rootProperty',
286
+ properties: {
287
+ property: 'result',
288
+ },
289
+ },
290
+ GenericFunctions_1.mergeAdditionalProperties,
291
+ GenericFunctions_1.simplifyPostReceive,
292
+ ],
293
+ },
294
+ },
295
+ },
296
+ {
297
+ name: 'Print Label',
298
+ value: 'printLabel',
299
+ description: 'Print item labels for quotation items',
300
+ action: 'Print label',
301
+ routing: {
302
+ request: {
303
+ method: 'POST',
304
+ url: '=/quotation/id/{{$parameter["quotationId"]}}/printLabel',
305
+ encoding: 'arraybuffer',
306
+ returnFullResponse: true,
307
+ },
308
+ output: {
309
+ postReceive: [
310
+ {
311
+ type: 'binaryData',
312
+ properties: {
313
+ destinationProperty: 'data',
314
+ },
315
+ },
316
+ ],
317
+ },
318
+ },
319
+ },
320
+ {
321
+ name: 'Print Quotation Data',
322
+ value: 'printQuotationData',
323
+ description: 'Download printable quotation data (requires workflow option to be enabled)',
324
+ action: 'Print quotation data',
325
+ routing: {
326
+ request: {
327
+ method: 'GET',
328
+ url: '=/quotation/id/{{$parameter["quotationId"]}}/printQuotationData',
329
+ encoding: 'arraybuffer',
330
+ returnFullResponse: true,
331
+ },
332
+ output: {
333
+ postReceive: [
334
+ {
335
+ type: 'binaryData',
336
+ properties: {
337
+ destinationProperty: 'data',
338
+ },
339
+ },
340
+ ],
341
+ },
342
+ },
343
+ },
344
+ {
345
+ name: 'Recalculate Costs',
346
+ value: 'recalculateCosts',
347
+ description: 'Recalculate item costs for the quotation based on current purchase prices',
348
+ action: 'Recalculate costs',
349
+ routing: {
350
+ request: {
351
+ method: 'POST',
352
+ url: '=/quotation/id/{{$parameter["quotationId"]}}/recalculateCosts',
353
+ },
354
+ output: {
355
+ postReceive: [
356
+ {
357
+ type: 'rootProperty',
358
+ properties: {
359
+ property: 'result',
360
+ },
361
+ },
362
+ ],
363
+ },
364
+ },
365
+ },
366
+ {
367
+ name: 'Reset Taxes',
368
+ value: 'resetTaxes',
369
+ description: 'Reset taxes to default for all quotation items',
370
+ action: 'Reset taxes',
371
+ routing: {
372
+ request: {
373
+ method: 'POST',
374
+ url: '=/quotation/id/{{$parameter["quotationId"]}}/resetTaxes',
375
+ },
376
+ output: {
377
+ postReceive: [
378
+ {
379
+ type: 'rootProperty',
380
+ properties: {
381
+ property: 'result',
382
+ },
383
+ },
384
+ ],
385
+ },
386
+ },
387
+ },
388
+ {
389
+ name: 'Set Costs for Items Without Cost',
390
+ value: 'setCostsForItemsWithoutCost',
391
+ description: 'Set unit cost for all quotation items that currently have no cost',
392
+ action: 'Set costs for items without cost',
393
+ routing: {
394
+ request: {
395
+ method: 'POST',
396
+ url: '=/quotation/id/{{$parameter["quotationId"]}}/setCostsForItemsWithoutCost',
397
+ },
398
+ output: {
399
+ postReceive: [
400
+ {
401
+ type: 'rootProperty',
402
+ properties: {
403
+ property: 'result',
404
+ },
405
+ },
406
+ ],
407
+ },
408
+ },
409
+ },
410
+ {
411
+ name: 'Update',
412
+ value: 'update',
413
+ description: 'Update a quotation by ID',
414
+ action: 'Update a quotation',
415
+ routing: {
416
+ request: {
417
+ method: 'PUT',
418
+ url: '=/quotation/id/{{$parameter["quotationId"]}}',
419
+ qs: {
420
+ ignoreMissingProperties: true,
421
+ },
422
+ },
423
+ },
424
+ },
425
+ {
426
+ name: 'Update Prices',
427
+ value: 'updatePrices',
428
+ description: 'Update prices for all items in the quotation from current price lists',
429
+ action: 'Update prices',
430
+ routing: {
431
+ request: {
432
+ method: 'POST',
433
+ url: '=/quotation/id/{{$parameter["quotationId"]}}/updatePrices',
434
+ },
435
+ output: {
436
+ postReceive: [
437
+ {
438
+ type: 'rootProperty',
439
+ properties: {
440
+ property: 'result',
441
+ },
442
+ },
443
+ ],
444
+ },
445
+ },
446
+ },
447
+ ],
448
+ default: 'list',
449
+ },
450
+ ];
451
+ exports.quotationFields = [
452
+ {
453
+ displayName: 'Quotation',
454
+ name: 'quotationId',
455
+ type: 'resourceLocator',
456
+ default: { mode: 'list', value: '' },
457
+ required: true,
458
+ description: 'The quotation to operate on',
459
+ displayOptions: {
460
+ show: {
461
+ resource: ['quotation'],
462
+ operation: [
463
+ 'accept',
464
+ 'addDefaultScalePricesToItems',
465
+ 'calculateSalesPrices',
466
+ 'createNewVersion',
467
+ 'createPublicPageLink',
468
+ 'createPurchaseOrderRequest',
469
+ 'createQuotationPdf',
470
+ 'delete',
471
+ 'disablePublicPageLink',
472
+ 'downloadLatestQuotationPdf',
473
+ 'get',
474
+ 'inquire',
475
+ 'printLabel',
476
+ 'printQuotationData',
477
+ 'recalculateCosts',
478
+ 'resetTaxes',
479
+ 'setCostsForItemsWithoutCost',
480
+ 'update',
481
+ 'updatePrices',
482
+ ],
483
+ },
484
+ },
485
+ modes: [
486
+ {
487
+ displayName: 'From List',
488
+ name: 'list',
489
+ type: 'list',
490
+ typeOptions: {
491
+ searchListMethod: 'searchQuotations',
492
+ searchable: true,
493
+ },
494
+ },
495
+ {
496
+ displayName: 'By ID',
497
+ name: 'id',
498
+ type: 'string',
499
+ placeholder: 'e.g. 1234567890',
500
+ validation: [
501
+ {
502
+ type: 'regex',
503
+ properties: {
504
+ regex: '^[0-9]+$',
505
+ errorMessage: 'Quotation ID must be numeric',
506
+ },
507
+ },
508
+ ],
509
+ },
510
+ {
511
+ displayName: 'By URL',
512
+ name: 'url',
513
+ type: 'string',
514
+ placeholder: 'e.g. https://tenant.weclapp.com/webapp/api/v2/quotation/id/1234567890',
515
+ extractValue: {
516
+ type: 'regex',
517
+ regex: '/quotation/id/([0-9]+)',
518
+ },
519
+ validation: [
520
+ {
521
+ type: 'regex',
522
+ properties: {
523
+ regex: '/quotation/id/[0-9]+',
524
+ errorMessage: 'URL must contain /quotation/id/{id}',
525
+ },
526
+ },
527
+ ],
528
+ },
529
+ ],
530
+ },
531
+ {
532
+ ...SharedFields_1.limitField,
533
+ displayOptions: {
534
+ show: {
535
+ resource: ['quotation'],
536
+ operation: ['list'],
537
+ },
538
+ },
539
+ },
540
+ {
541
+ displayName: 'Quick Filters',
542
+ name: 'quickFilters',
543
+ type: 'collection',
544
+ placeholder: 'Add Filter',
545
+ default: {},
546
+ displayOptions: {
547
+ show: {
548
+ resource: ['quotation'],
549
+ operation: ['list'],
550
+ },
551
+ },
552
+ options: [
553
+ {
554
+ displayName: 'Customer ID',
555
+ name: 'customerId',
556
+ type: 'string',
557
+ default: '',
558
+ description: 'Filter by customer ID',
559
+ routing: {
560
+ request: {
561
+ qs: {
562
+ 'customerId-eq': '={{$value}}',
563
+ },
564
+ },
565
+ },
566
+ },
567
+ {
568
+ displayName: 'Quotation Date From',
569
+ name: 'quotationDateFrom',
570
+ type: 'string',
571
+ default: '',
572
+ description: 'Filter quotations with date >= this value (milliseconds epoch or ISO 8601)',
573
+ placeholder: 'e.g. 1704067200000',
574
+ routing: {
575
+ request: {
576
+ qs: {
577
+ 'quotationDate-ge': '={{$value}}',
578
+ },
579
+ },
580
+ },
581
+ },
582
+ {
583
+ displayName: 'Quotation Date To',
584
+ name: 'quotationDateTo',
585
+ type: 'string',
586
+ default: '',
587
+ description: 'Filter quotations with date <= this value (milliseconds epoch or ISO 8601)',
588
+ placeholder: 'e.g. 1735689600000',
589
+ routing: {
590
+ request: {
591
+ qs: {
592
+ 'quotationDate-le': '={{$value}}',
593
+ },
594
+ },
595
+ },
596
+ },
597
+ {
598
+ displayName: 'Quotation Number',
599
+ name: 'quotationNumber',
600
+ type: 'string',
601
+ default: '',
602
+ description: 'Filter by exact quotation number',
603
+ routing: {
604
+ request: {
605
+ qs: {
606
+ 'quotationNumber-eq': '={{$value}}',
607
+ },
608
+ },
609
+ },
610
+ },
611
+ {
612
+ displayName: 'Record Currency ID',
613
+ name: 'recordCurrencyId',
614
+ type: 'string',
615
+ default: '',
616
+ description: 'Filter by currency ID',
617
+ routing: {
618
+ request: {
619
+ qs: {
620
+ 'recordCurrencyId-eq': '={{$value}}',
621
+ },
622
+ },
623
+ },
624
+ },
625
+ {
626
+ displayName: 'Status',
627
+ name: 'status',
628
+ type: 'options',
629
+ default: '',
630
+ description: 'Filter by quotation status',
631
+ options: [
632
+ { name: '(Any)', value: '' },
633
+ { name: 'Accepted', value: 'ACCEPTED' },
634
+ { name: 'Cancelled', value: 'CANCELLED' },
635
+ { name: 'Inquiry', value: 'INQUIRY' },
636
+ { name: 'New', value: 'NEW' },
637
+ { name: 'Offer Sent', value: 'OFFER_SENT' },
638
+ { name: 'Ordered', value: 'ORDERED' },
639
+ { name: 'Rejected', value: 'REJECTED' },
640
+ ],
641
+ routing: {
642
+ request: {
643
+ qs: {
644
+ 'status-eq': '={{$value || undefined}}',
645
+ },
646
+ },
647
+ },
648
+ },
649
+ ],
650
+ },
651
+ {
652
+ ...SharedFields_1.filtersCollection,
653
+ displayOptions: {
654
+ show: {
655
+ resource: ['quotation'],
656
+ operation: ['list'],
657
+ },
658
+ },
659
+ },
660
+ {
661
+ ...SharedFields_1.simplifyField,
662
+ displayOptions: {
663
+ show: {
664
+ resource: ['quotation'],
665
+ operation: ['get', 'list'],
666
+ },
667
+ },
668
+ },
669
+ {
670
+ displayName: 'Quotation Data',
671
+ name: 'quotationData',
672
+ type: 'json',
673
+ required: true,
674
+ default: '{}',
675
+ description: 'JSON body of the quotation to create. See weclapp API docs for the full schema.',
676
+ displayOptions: {
677
+ show: {
678
+ resource: ['quotation'],
679
+ operation: ['create'],
680
+ },
681
+ },
682
+ routing: {
683
+ request: {
684
+ body: '={{JSON.parse($value)}}',
685
+ },
686
+ },
687
+ },
688
+ {
689
+ displayName: 'Update Fields',
690
+ name: 'updateFields',
691
+ type: 'json',
692
+ required: true,
693
+ default: '{}',
694
+ description: 'JSON object with the fields to update (uses ignoreMissingProperties=true — only listed fields are updated)',
695
+ displayOptions: {
696
+ show: {
697
+ resource: ['quotation'],
698
+ operation: ['update'],
699
+ },
700
+ },
701
+ routing: {
702
+ request: {
703
+ body: '={{JSON.parse($value)}}',
704
+ },
705
+ },
706
+ },
707
+ {
708
+ displayName: 'Accept Options',
709
+ name: 'acceptOptions',
710
+ type: 'collection',
711
+ placeholder: 'Add Option',
712
+ default: {},
713
+ description: 'Optional parameters for accepting the quotation',
714
+ displayOptions: {
715
+ show: {
716
+ resource: ['quotation'],
717
+ operation: ['accept'],
718
+ },
719
+ },
720
+ options: [
721
+ {
722
+ displayName: 'Accept Quotation Items (JSON)',
723
+ name: 'acceptQuotationItems',
724
+ type: 'json',
725
+ default: '[]',
726
+ description: 'Array of items to accept with specific quantities. Each item needs quotationItemId and quantity. Leave empty to accept all items.',
727
+ placeholder: '[{"quotationItemId":"123","quantity":"5"}]',
728
+ routing: {
729
+ request: {
730
+ body: {
731
+ acceptQuotationItems: '={{JSON.parse($value)}}',
732
+ },
733
+ },
734
+ },
735
+ },
736
+ ],
737
+ },
738
+ {
739
+ displayName: 'Item IDs',
740
+ name: 'itemIds',
741
+ type: 'string',
742
+ required: true,
743
+ default: '',
744
+ description: 'Comma-separated list of quotation item IDs to add scale prices to (e.g. 123,456,789)',
745
+ placeholder: 'e.g. 123456,789012',
746
+ displayOptions: {
747
+ show: {
748
+ resource: ['quotation'],
749
+ operation: ['addDefaultScalePricesToItems'],
750
+ },
751
+ },
752
+ routing: {
753
+ request: {
754
+ body: {
755
+ itemIds: '={{$value.split(",").map(id => id.trim()).filter(Boolean)}}',
756
+ },
757
+ },
758
+ },
759
+ },
760
+ {
761
+ displayName: 'Calculation Mode',
762
+ name: 'calculationMode',
763
+ type: 'options',
764
+ required: true,
765
+ default: 'COST_SURCHARGE',
766
+ description: 'How to calculate the new sales prices for quotation items',
767
+ options: [
768
+ {
769
+ name: 'Cost Surcharge',
770
+ value: 'COST_SURCHARGE',
771
+ description: 'Net price = purchase costs + purchase costs x surcharge / 100',
772
+ },
773
+ {
774
+ name: 'Target Margin',
775
+ value: 'TARGET_MARGIN',
776
+ description: 'Net price = purchase costs x 100 / (100 - target margin)',
777
+ },
778
+ ],
779
+ displayOptions: {
780
+ show: {
781
+ resource: ['quotation'],
782
+ operation: ['calculateSalesPrices'],
783
+ },
784
+ },
785
+ routing: {
786
+ request: {
787
+ body: {
788
+ calculationMode: '={{$value}}',
789
+ },
790
+ },
791
+ },
792
+ },
793
+ {
794
+ displayName: 'Percentage',
795
+ name: 'percentage',
796
+ type: 'string',
797
+ required: true,
798
+ default: '',
799
+ description: 'Surcharge percentage (for Cost Surcharge mode) or target margin percentage (for Target Margin mode)',
800
+ placeholder: 'e.g. 10.5',
801
+ displayOptions: {
802
+ show: {
803
+ resource: ['quotation'],
804
+ operation: ['calculateSalesPrices'],
805
+ },
806
+ },
807
+ routing: {
808
+ request: {
809
+ body: {
810
+ percentage: '={{$value}}',
811
+ },
812
+ },
813
+ },
814
+ },
815
+ {
816
+ displayName: 'Quotation Item IDs (Optional)',
817
+ name: 'calculateItemIds',
818
+ type: 'string',
819
+ default: '',
820
+ description: 'Comma-separated list of item IDs to calculate prices for. Leave empty to calculate for all items.',
821
+ placeholder: 'e.g. 123456,789012',
822
+ displayOptions: {
823
+ show: {
824
+ resource: ['quotation'],
825
+ operation: ['calculateSalesPrices'],
826
+ },
827
+ },
828
+ routing: {
829
+ request: {
830
+ body: {
831
+ quotationItemIds: '={{$value ? $value.split(",").map(id => id.trim()).filter(Boolean) : undefined}}',
832
+ },
833
+ },
834
+ },
835
+ },
836
+ {
837
+ displayName: 'Request Type',
838
+ name: 'requestType',
839
+ type: 'options',
840
+ required: true,
841
+ default: 'PURCHASE_ORDER_REQUEST',
842
+ description: 'The type of purchase order request to create',
843
+ options: [
844
+ { name: 'Blanket Order Request', value: 'BLANKET_ORDER_REQUEST' },
845
+ { name: 'Blanket Purchase Order Request', value: 'BLANKET_PURCHASE_ORDER_REQUEST' },
846
+ { name: 'Drop Shipping Request', value: 'DROP_SHIPPING_REQUEST' },
847
+ { name: 'Purchase Order Request', value: 'PURCHASE_ORDER_REQUEST' },
848
+ { name: 'Sales Order Commission Request', value: 'SALES_ORDER_COMMISSION_REQUEST' },
849
+ ],
850
+ displayOptions: {
851
+ show: {
852
+ resource: ['quotation'],
853
+ operation: ['createPurchaseOrderRequest'],
854
+ },
855
+ },
856
+ routing: {
857
+ request: {
858
+ body: {
859
+ requestType: '={{$value}}',
860
+ },
861
+ },
862
+ },
863
+ },
864
+ {
865
+ displayName: 'Warehouse ID',
866
+ name: 'warehouseId',
867
+ type: 'string',
868
+ required: true,
869
+ default: '',
870
+ description: 'The ID of the warehouse to use for the purchase order request',
871
+ displayOptions: {
872
+ show: {
873
+ resource: ['quotation'],
874
+ operation: ['createPurchaseOrderRequest'],
875
+ },
876
+ },
877
+ routing: {
878
+ request: {
879
+ body: {
880
+ warehouseId: '={{$value}}',
881
+ },
882
+ },
883
+ },
884
+ },
885
+ {
886
+ displayName: 'Purchase Order Request Options',
887
+ name: 'purchaseOrderRequestOptions',
888
+ type: 'collection',
889
+ placeholder: 'Add Option',
890
+ default: {},
891
+ displayOptions: {
892
+ show: {
893
+ resource: ['quotation'],
894
+ operation: ['createPurchaseOrderRequest'],
895
+ },
896
+ },
897
+ options: [
898
+ {
899
+ displayName: 'Merge Items',
900
+ name: 'mergeItems',
901
+ type: 'boolean',
902
+ default: false,
903
+ description: 'Whether to merge items with the same article (only valid when Use Item Quantity is true)',
904
+ routing: {
905
+ request: {
906
+ body: {
907
+ mergeItems: '={{$value}}',
908
+ },
909
+ },
910
+ },
911
+ },
912
+ {
913
+ displayName: 'Quotation Item IDs (JSON)',
914
+ name: 'quotationItemIds',
915
+ type: 'json',
916
+ default: '[]',
917
+ description: 'Array of quotation item IDs to include. Leave empty to include all quotation items.',
918
+ routing: {
919
+ request: {
920
+ body: {
921
+ quotationItemIds: '={{JSON.parse($value)}}',
922
+ },
923
+ },
924
+ },
925
+ },
926
+ {
927
+ displayName: 'Supplier IDs (JSON)',
928
+ name: 'supplierIds',
929
+ type: 'json',
930
+ default: '[]',
931
+ description: 'Array of supplier IDs to restrict the purchase order request to',
932
+ routing: {
933
+ request: {
934
+ body: {
935
+ supplierIds: '={{JSON.parse($value)}}',
936
+ },
937
+ },
938
+ },
939
+ },
940
+ {
941
+ displayName: 'Use Item Quantity',
942
+ name: 'useItemQuantity',
943
+ type: 'boolean',
944
+ default: false,
945
+ description: 'Whether to use the quotation item quantity (only valid for PURCHASE_ORDER_REQUEST and BLANKET_ORDER_REQUEST types)',
946
+ routing: {
947
+ request: {
948
+ body: {
949
+ useItemQuantity: '={{$value}}',
950
+ },
951
+ },
952
+ },
953
+ },
954
+ ],
955
+ },
956
+ {
957
+ displayName: 'Task ID',
958
+ name: 'taskId',
959
+ type: 'string',
960
+ default: '',
961
+ description: 'Optional task ID to associate with the inquiry',
962
+ displayOptions: {
963
+ show: {
964
+ resource: ['quotation'],
965
+ operation: ['inquire'],
966
+ },
967
+ },
968
+ routing: {
969
+ request: {
970
+ body: {
971
+ taskId: '={{$value || undefined}}',
972
+ },
973
+ },
974
+ },
975
+ },
976
+ {
977
+ displayName: 'Item Label Quantity Print Setting',
978
+ name: 'itemLabelQuantityPrintSetting',
979
+ type: 'options',
980
+ required: true,
981
+ default: 'ONLY_ONE_LABEL_PER_ITEM',
982
+ description: 'How many labels to print per item',
983
+ options: [
984
+ {
985
+ name: 'Item Quantity',
986
+ value: 'ITEM_QUANTITY',
987
+ description: 'Print one label per unit of quantity',
988
+ },
989
+ {
990
+ name: 'Only One Label per Booking Record',
991
+ value: 'ONLY_ONE_LABEL_PER_BOOKING_RECORD',
992
+ description: 'Print one label per booking record',
993
+ },
994
+ {
995
+ name: 'Only One Label per Item',
996
+ value: 'ONLY_ONE_LABEL_PER_ITEM',
997
+ description: 'Print exactly one label per line item',
998
+ },
999
+ ],
1000
+ displayOptions: {
1001
+ show: {
1002
+ resource: ['quotation'],
1003
+ operation: ['printLabel'],
1004
+ },
1005
+ },
1006
+ routing: {
1007
+ request: {
1008
+ body: {
1009
+ itemLabelQuantityPrintSetting: '={{$value}}',
1010
+ },
1011
+ },
1012
+ },
1013
+ },
1014
+ {
1015
+ displayName: 'Quotation Item IDs (Optional)',
1016
+ name: 'printLabelItemIds',
1017
+ type: 'string',
1018
+ default: '',
1019
+ description: 'Comma-separated list of quotation item IDs to print labels for. Leave empty for all items.',
1020
+ placeholder: 'e.g. 123456,789012',
1021
+ displayOptions: {
1022
+ show: {
1023
+ resource: ['quotation'],
1024
+ operation: ['printLabel'],
1025
+ },
1026
+ },
1027
+ routing: {
1028
+ request: {
1029
+ body: {
1030
+ quotationItemIds: '={{$value ? $value.split(",").map(id => id.trim()).filter(Boolean) : undefined}}',
1031
+ },
1032
+ },
1033
+ },
1034
+ },
1035
+ {
1036
+ displayName: 'Cost Update Mode',
1037
+ name: 'costUpdateMode',
1038
+ type: 'options',
1039
+ required: true,
1040
+ default: 'SET_TO_NET_UNIT_PRICE',
1041
+ description: 'How to set the unit cost for items that currently have no cost',
1042
+ options: [
1043
+ {
1044
+ name: 'Set to Net Unit Price',
1045
+ value: 'SET_TO_NET_UNIT_PRICE',
1046
+ description: 'Sets unitCost to the net unit price derived from the item price (accounting for tax if gross)',
1047
+ },
1048
+ {
1049
+ name: 'Set to Zero',
1050
+ value: 'SET_TO_ZERO',
1051
+ description: 'Sets unitCost to zero',
1052
+ },
1053
+ ],
1054
+ displayOptions: {
1055
+ show: {
1056
+ resource: ['quotation'],
1057
+ operation: ['setCostsForItemsWithoutCost'],
1058
+ },
1059
+ },
1060
+ routing: {
1061
+ request: {
1062
+ body: {
1063
+ costUpdateMode: '={{$value}}',
1064
+ },
1065
+ },
1066
+ },
1067
+ },
1068
+ ];
1069
+ //# sourceMappingURL=QuotationDescription.js.map