@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,724 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.articleDescription = exports.articleOperations = void 0;
4
+ const SharedFields_1 = require("../SharedFields");
5
+ const GenericFunctions_1 = require("../GenericFunctions");
6
+ exports.articleOperations = [
7
+ {
8
+ displayName: 'Operation',
9
+ name: 'operation',
10
+ type: 'options',
11
+ noDataExpression: true,
12
+ displayOptions: {
13
+ show: {
14
+ resource: ['article'],
15
+ },
16
+ },
17
+ options: [
18
+ {
19
+ name: 'Change Unit',
20
+ value: 'changeUnit',
21
+ description: 'Change the unit of an article',
22
+ action: 'Change article unit',
23
+ routing: {
24
+ request: {
25
+ method: 'POST',
26
+ url: '=/article/id/{{$parameter["articleId"]}}/changeUnit',
27
+ },
28
+ },
29
+ },
30
+ {
31
+ name: 'Create',
32
+ value: 'create',
33
+ description: 'Create a new article',
34
+ action: 'Create article',
35
+ routing: {
36
+ request: {
37
+ method: 'POST',
38
+ url: '/article',
39
+ },
40
+ },
41
+ },
42
+ {
43
+ name: 'Create Datasheet PDF',
44
+ value: 'createDatasheetPdf',
45
+ description: 'Generate and download an article datasheet as PDF (binary)',
46
+ action: 'Create article datasheet PDF',
47
+ routing: {
48
+ request: {
49
+ method: 'POST',
50
+ url: '=/article/id/{{$parameter["articleId"]}}/createDatasheetPdf',
51
+ encoding: 'arraybuffer',
52
+ returnFullResponse: true,
53
+ },
54
+ output: {
55
+ postReceive: [
56
+ {
57
+ type: 'binaryData',
58
+ properties: {
59
+ destinationProperty: 'data',
60
+ },
61
+ },
62
+ ],
63
+ },
64
+ },
65
+ },
66
+ {
67
+ name: 'Create Label PDF',
68
+ value: 'createLabelPdf',
69
+ description: 'Generate and download an article label as PDF (binary)',
70
+ action: 'Create article label PDF',
71
+ routing: {
72
+ request: {
73
+ method: 'POST',
74
+ url: '=/article/id/{{$parameter["articleId"]}}/createLabelPdf',
75
+ encoding: 'arraybuffer',
76
+ returnFullResponse: true,
77
+ },
78
+ output: {
79
+ postReceive: [
80
+ {
81
+ type: 'binaryData',
82
+ properties: {
83
+ destinationProperty: 'data',
84
+ },
85
+ },
86
+ ],
87
+ },
88
+ },
89
+ },
90
+ {
91
+ name: 'Delete',
92
+ value: 'delete',
93
+ description: 'Delete an article',
94
+ action: 'Delete article',
95
+ routing: {
96
+ request: {
97
+ method: 'DELETE',
98
+ url: '=/article/id/{{$parameter["articleId"]}}',
99
+ },
100
+ output: {
101
+ postReceive: [
102
+ {
103
+ type: 'set',
104
+ properties: {
105
+ value: '={{ { "deleted": true } }}',
106
+ },
107
+ },
108
+ ],
109
+ },
110
+ },
111
+ },
112
+ {
113
+ name: 'Download Article Image',
114
+ value: 'downloadArticleImage',
115
+ description: 'Download an article image (binary)',
116
+ action: 'Download article image',
117
+ routing: {
118
+ request: {
119
+ method: 'GET',
120
+ url: '=/article/id/{{$parameter["articleId"]}}/downloadArticleImage',
121
+ encoding: 'arraybuffer',
122
+ returnFullResponse: true,
123
+ },
124
+ output: {
125
+ postReceive: [
126
+ {
127
+ type: 'binaryData',
128
+ properties: {
129
+ destinationProperty: 'data',
130
+ },
131
+ },
132
+ ],
133
+ },
134
+ },
135
+ },
136
+ {
137
+ name: 'Download Main Article Image',
138
+ value: 'downloadMainArticleImage',
139
+ description: 'Download the main article image (binary)',
140
+ action: 'Download main article image',
141
+ routing: {
142
+ request: {
143
+ method: 'GET',
144
+ url: '=/article/id/{{$parameter["articleId"]}}/downloadMainArticleImage',
145
+ encoding: 'arraybuffer',
146
+ returnFullResponse: true,
147
+ },
148
+ output: {
149
+ postReceive: [
150
+ {
151
+ type: 'binaryData',
152
+ properties: {
153
+ destinationProperty: 'data',
154
+ },
155
+ },
156
+ ],
157
+ },
158
+ },
159
+ },
160
+ {
161
+ name: 'Get',
162
+ value: 'get',
163
+ description: 'Retrieve a single article by ID',
164
+ action: 'Get article',
165
+ routing: {
166
+ request: {
167
+ method: 'GET',
168
+ url: '=/article/id/{{$parameter["articleId"]}}',
169
+ },
170
+ output: {
171
+ postReceive: [GenericFunctions_1.simplifyPostReceive],
172
+ },
173
+ },
174
+ },
175
+ {
176
+ name: 'Get Many',
177
+ value: 'list',
178
+ description: 'Retrieve a list of articles',
179
+ action: 'Get many articles',
180
+ routing: {
181
+ ...SharedFields_1.listPaginationRouting,
182
+ request: {
183
+ method: 'GET',
184
+ url: '/article',
185
+ },
186
+ output: {
187
+ postReceive: [
188
+ {
189
+ type: 'rootProperty',
190
+ properties: {
191
+ property: 'result',
192
+ },
193
+ },
194
+ GenericFunctions_1.mergeAdditionalProperties,
195
+ GenericFunctions_1.simplifyPostReceive,
196
+ ],
197
+ },
198
+ },
199
+ },
200
+ {
201
+ name: 'Packaging Unit Structure',
202
+ value: 'packagingUnitStructure',
203
+ description: 'Retrieve the packaging unit structure of an article',
204
+ action: 'Get article packaging unit structure',
205
+ routing: {
206
+ request: {
207
+ method: 'GET',
208
+ url: '=/article/id/{{$parameter["articleId"]}}/packagingUnitStructure',
209
+ },
210
+ },
211
+ },
212
+ {
213
+ name: 'Update',
214
+ value: 'update',
215
+ description: 'Update an existing article',
216
+ action: 'Update article',
217
+ routing: {
218
+ request: {
219
+ method: 'PUT',
220
+ url: '=/article/id/{{$parameter["articleId"]}}',
221
+ qs: {
222
+ ignoreMissingProperties: true,
223
+ },
224
+ },
225
+ },
226
+ },
227
+ {
228
+ name: 'Update Prices',
229
+ value: 'updatePrices',
230
+ description: 'Sync article prices for a sales channel (closes overlapping prices, sets new price)',
231
+ action: 'Update article prices',
232
+ },
233
+ {
234
+ name: 'Upload Article Image',
235
+ value: 'uploadArticleImage',
236
+ description: 'Upload an image for an article',
237
+ action: 'Upload article image',
238
+ routing: {
239
+ request: {
240
+ method: 'POST',
241
+ url: '=/article/id/{{$parameter["articleId"]}}/uploadArticleImage',
242
+ },
243
+ },
244
+ },
245
+ ],
246
+ default: 'list',
247
+ },
248
+ ];
249
+ const articleIdField = {
250
+ displayName: 'Article',
251
+ name: 'articleId',
252
+ type: 'resourceLocator',
253
+ default: { mode: 'list', value: '' },
254
+ required: true,
255
+ description: 'The article to operate on',
256
+ displayOptions: {
257
+ show: {
258
+ resource: ['article'],
259
+ operation: [
260
+ 'changeUnit',
261
+ 'createDatasheetPdf',
262
+ 'createLabelPdf',
263
+ 'delete',
264
+ 'downloadArticleImage',
265
+ 'downloadMainArticleImage',
266
+ 'get',
267
+ 'packagingUnitStructure',
268
+ 'update',
269
+ 'updatePrices',
270
+ 'uploadArticleImage',
271
+ ],
272
+ },
273
+ },
274
+ modes: [
275
+ {
276
+ displayName: 'ID',
277
+ name: 'id',
278
+ type: 'string',
279
+ placeholder: 'e.g. 1234567890',
280
+ validation: [
281
+ {
282
+ type: 'regex',
283
+ properties: {
284
+ regex: '^[0-9]+$',
285
+ errorMessage: 'Article ID must be numeric',
286
+ },
287
+ },
288
+ ],
289
+ },
290
+ {
291
+ displayName: 'From List',
292
+ name: 'list',
293
+ type: 'list',
294
+ typeOptions: {
295
+ searchListMethod: 'searchArticles',
296
+ searchable: true,
297
+ },
298
+ },
299
+ {
300
+ displayName: 'URL',
301
+ name: 'url',
302
+ type: 'string',
303
+ placeholder: 'e.g. https://tenant.weclapp.com/webapp/api/v2/article/id/1234567890',
304
+ extractValue: {
305
+ type: 'regex',
306
+ regex: '/article/id/([0-9]+)',
307
+ },
308
+ validation: [
309
+ {
310
+ type: 'regex',
311
+ properties: {
312
+ regex: '/article/id/[0-9]+',
313
+ errorMessage: 'URL must contain /article/id/{id}',
314
+ },
315
+ },
316
+ ],
317
+ },
318
+ ],
319
+ };
320
+ const listLimit = {
321
+ ...SharedFields_1.limitField,
322
+ displayOptions: {
323
+ show: {
324
+ resource: ['article'],
325
+ operation: ['list'],
326
+ },
327
+ },
328
+ };
329
+ const listFilters = {
330
+ ...SharedFields_1.filtersCollection,
331
+ displayOptions: {
332
+ show: {
333
+ resource: ['article'],
334
+ operation: ['list'],
335
+ },
336
+ },
337
+ };
338
+ const listSimplify = {
339
+ ...SharedFields_1.simplifyField,
340
+ displayOptions: {
341
+ show: {
342
+ resource: ['article'],
343
+ operation: ['get', 'list'],
344
+ },
345
+ },
346
+ };
347
+ const listAdditionalFields = {
348
+ ...SharedFields_1.additionalFields,
349
+ displayOptions: {
350
+ show: {
351
+ resource: ['article'],
352
+ operation: ['get', 'list'],
353
+ },
354
+ },
355
+ };
356
+ const createArticleNumber = {
357
+ displayName: 'Article Number',
358
+ name: 'articleNumber',
359
+ type: 'string',
360
+ required: true,
361
+ default: '',
362
+ description: 'Unique article number (SKU)',
363
+ displayOptions: {
364
+ show: {
365
+ resource: ['article'],
366
+ operation: ['create'],
367
+ },
368
+ },
369
+ routing: {
370
+ send: {
371
+ type: 'body',
372
+ property: 'articleNumber',
373
+ },
374
+ },
375
+ };
376
+ const createName = {
377
+ displayName: 'Name',
378
+ name: 'name',
379
+ type: 'string',
380
+ required: true,
381
+ default: '',
382
+ description: 'Article name / description',
383
+ displayOptions: {
384
+ show: {
385
+ resource: ['article'],
386
+ operation: ['create'],
387
+ },
388
+ },
389
+ routing: {
390
+ send: {
391
+ type: 'body',
392
+ property: 'name',
393
+ },
394
+ },
395
+ };
396
+ const articleTypeOptions = [
397
+ { name: 'Non-Storable', value: 'NON_STORABLE' },
398
+ { name: 'Production Bill of Material', value: 'PRODUCTION_BILL_OF_MATERIAL' },
399
+ { name: 'Sales Bill of Material', value: 'SALES_BILL_OF_MATERIAL' },
400
+ { name: 'Service', value: 'SERVICE' },
401
+ { name: 'Storable', value: 'STORABLE' },
402
+ { name: 'Virtual', value: 'VIRTUAL' },
403
+ ];
404
+ const createArticleType = {
405
+ displayName: 'Article Type',
406
+ name: 'articleType',
407
+ type: 'options',
408
+ required: true,
409
+ default: 'STORABLE',
410
+ description: 'The type of article',
411
+ displayOptions: {
412
+ show: {
413
+ resource: ['article'],
414
+ operation: ['create'],
415
+ },
416
+ },
417
+ options: articleTypeOptions,
418
+ routing: {
419
+ send: {
420
+ type: 'body',
421
+ property: 'articleType',
422
+ },
423
+ },
424
+ };
425
+ const createAdditionalFields = {
426
+ displayName: 'Additional Fields',
427
+ name: 'createAdditionalFields',
428
+ type: 'collection',
429
+ placeholder: 'Add Field',
430
+ default: {},
431
+ displayOptions: {
432
+ show: {
433
+ resource: ['article'],
434
+ operation: ['create'],
435
+ },
436
+ },
437
+ options: [
438
+ {
439
+ displayName: 'Active',
440
+ name: 'active',
441
+ type: 'boolean',
442
+ default: true,
443
+ description: 'Whether the article is active',
444
+ routing: {
445
+ send: {
446
+ type: 'body',
447
+ property: 'active',
448
+ },
449
+ },
450
+ },
451
+ {
452
+ displayName: 'Description',
453
+ name: 'description',
454
+ type: 'string',
455
+ default: '',
456
+ description: 'Long description of the article',
457
+ routing: {
458
+ send: {
459
+ type: 'body',
460
+ property: 'description',
461
+ },
462
+ },
463
+ },
464
+ {
465
+ displayName: 'EAN / GTIN',
466
+ name: 'ean',
467
+ type: 'string',
468
+ default: '',
469
+ description: 'EAN / GTIN barcode of the article',
470
+ routing: {
471
+ send: {
472
+ type: 'body',
473
+ property: 'ean',
474
+ },
475
+ },
476
+ },
477
+ {
478
+ displayName: 'Tax Rate Type',
479
+ name: 'taxRateType',
480
+ type: 'options',
481
+ default: 'STANDARD',
482
+ options: [
483
+ { name: 'Reduced', value: 'REDUCED' },
484
+ { name: 'Standard', value: 'STANDARD' },
485
+ { name: 'Zero', value: 'ZERO' },
486
+ ],
487
+ routing: {
488
+ send: {
489
+ type: 'body',
490
+ property: 'taxRateType',
491
+ },
492
+ },
493
+ },
494
+ {
495
+ displayName: 'Unit ID',
496
+ name: 'unitId',
497
+ type: 'string',
498
+ default: '',
499
+ description: 'ID of the unit (e.g. piece, kg)',
500
+ routing: {
501
+ send: {
502
+ type: 'body',
503
+ property: 'unitId',
504
+ },
505
+ },
506
+ },
507
+ ],
508
+ };
509
+ const updateBody = {
510
+ displayName: 'Update Fields',
511
+ name: 'updateFields',
512
+ type: 'collection',
513
+ placeholder: 'Add Field',
514
+ default: {},
515
+ description: 'Fields to update on the article',
516
+ displayOptions: {
517
+ show: {
518
+ resource: ['article'],
519
+ operation: ['update'],
520
+ },
521
+ },
522
+ options: [
523
+ {
524
+ displayName: 'Active',
525
+ name: 'active',
526
+ type: 'boolean',
527
+ default: true,
528
+ routing: {
529
+ send: {
530
+ type: 'body',
531
+ property: 'active',
532
+ },
533
+ },
534
+ },
535
+ {
536
+ displayName: 'Article Number',
537
+ name: 'articleNumber',
538
+ type: 'string',
539
+ default: '',
540
+ routing: {
541
+ send: {
542
+ type: 'body',
543
+ property: 'articleNumber',
544
+ },
545
+ },
546
+ },
547
+ {
548
+ displayName: 'Article Type',
549
+ name: 'articleType',
550
+ type: 'options',
551
+ default: 'STORABLE',
552
+ options: articleTypeOptions,
553
+ routing: {
554
+ send: {
555
+ type: 'body',
556
+ property: 'articleType',
557
+ },
558
+ },
559
+ },
560
+ {
561
+ displayName: 'Description',
562
+ name: 'description',
563
+ type: 'string',
564
+ default: '',
565
+ routing: {
566
+ send: {
567
+ type: 'body',
568
+ property: 'description',
569
+ },
570
+ },
571
+ },
572
+ {
573
+ displayName: 'EAN / GTIN',
574
+ name: 'ean',
575
+ type: 'string',
576
+ default: '',
577
+ routing: {
578
+ send: {
579
+ type: 'body',
580
+ property: 'ean',
581
+ },
582
+ },
583
+ },
584
+ {
585
+ displayName: 'Name',
586
+ name: 'name',
587
+ type: 'string',
588
+ default: '',
589
+ routing: {
590
+ send: {
591
+ type: 'body',
592
+ property: 'name',
593
+ },
594
+ },
595
+ },
596
+ {
597
+ displayName: 'Unit ID',
598
+ name: 'unitId',
599
+ type: 'string',
600
+ default: '',
601
+ routing: {
602
+ send: {
603
+ type: 'body',
604
+ property: 'unitId',
605
+ },
606
+ },
607
+ },
608
+ ],
609
+ };
610
+ const changeUnitFields = {
611
+ displayName: 'Unit ID',
612
+ name: 'changeUnitId',
613
+ type: 'string',
614
+ required: true,
615
+ default: '',
616
+ description: 'ID of the new unit to assign to the article',
617
+ displayOptions: {
618
+ show: {
619
+ resource: ['article'],
620
+ operation: ['changeUnit'],
621
+ },
622
+ },
623
+ routing: {
624
+ send: {
625
+ type: 'body',
626
+ property: 'unitId',
627
+ },
628
+ },
629
+ };
630
+ const uploadImageFields = {
631
+ displayName: 'Binary Property',
632
+ name: 'binaryPropertyName',
633
+ type: 'string',
634
+ required: true,
635
+ default: 'data',
636
+ description: 'Name of the binary property containing the image to upload',
637
+ displayOptions: {
638
+ show: {
639
+ resource: ['article'],
640
+ operation: ['uploadArticleImage'],
641
+ },
642
+ },
643
+ };
644
+ const updatePricesFields = [
645
+ {
646
+ displayName: 'Gross Price',
647
+ name: 'grossPrice',
648
+ type: 'number',
649
+ required: true,
650
+ default: 0,
651
+ description: 'Target gross price for the sales channel',
652
+ displayOptions: {
653
+ show: {
654
+ resource: ['article'],
655
+ operation: ['updatePrices'],
656
+ },
657
+ },
658
+ },
659
+ {
660
+ displayName: 'Currency ID',
661
+ name: 'currencyId',
662
+ type: 'string',
663
+ required: true,
664
+ default: '',
665
+ description: 'ID of the currency (e.g. the ID for EUR in your weclapp instance)',
666
+ placeholder: 'e.g. 256',
667
+ displayOptions: {
668
+ show: {
669
+ resource: ['article'],
670
+ operation: ['updatePrices'],
671
+ },
672
+ },
673
+ },
674
+ {
675
+ displayName: 'Update Fields',
676
+ name: 'updatePricesOptions',
677
+ type: 'collection',
678
+ placeholder: 'Add Option',
679
+ default: {},
680
+ displayOptions: {
681
+ show: {
682
+ resource: ['article'],
683
+ operation: ['updatePrices'],
684
+ },
685
+ },
686
+ options: [
687
+ {
688
+ displayName: 'Sales Channel',
689
+ name: 'salesChannel',
690
+ type: 'string',
691
+ default: 'GROSS1',
692
+ description: 'Target sales channel (default: GROSS1)',
693
+ },
694
+ {
695
+ displayName: 'Valid From Timestamp',
696
+ name: 'validFrom',
697
+ type: 'number',
698
+ default: 0,
699
+ description: 'Start of the new price validity in milliseconds since epoch. Leave 0 to default to now.',
700
+ },
701
+ ],
702
+ },
703
+ ];
704
+ exports.articleDescription = [
705
+ ...exports.articleOperations,
706
+ articleIdField,
707
+ listLimit,
708
+ listFilters,
709
+ listSimplify,
710
+ listAdditionalFields,
711
+ createArticleNumber,
712
+ createName,
713
+ createArticleType,
714
+ createAdditionalFields,
715
+ updateBody,
716
+ {
717
+ ...SharedFields_1.customAttributesField,
718
+ displayOptions: { show: { resource: ['article'], operation: ['create', 'update'] } },
719
+ },
720
+ changeUnitFields,
721
+ uploadImageFields,
722
+ ...updatePricesFields,
723
+ ];
724
+ //# sourceMappingURL=ArticleDescription.js.map