@revenexx/sdk 0.0.2 → 0.0.4

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.
@@ -0,0 +1,723 @@
1
+ import { Service } from '../service';
2
+ import { RevenexxException, Client, type Payload, UploadProgress } from '../client';
3
+ import type { Models } from '../models';
4
+
5
+
6
+ export class Inventories {
7
+ client: Client;
8
+
9
+ constructor(client: Client) {
10
+ this.client = client;
11
+ }
12
+
13
+ /**
14
+ *
15
+ * @throws {RevenexxException}
16
+ * @returns {Promise<{}>}
17
+ */
18
+ inventoriesAdjust(): Promise<{}> {
19
+
20
+ const apiPath = '/v1/inventories/adjust';
21
+ const payload: Payload = {};
22
+ const uri = new URL(this.client.config.endpoint + apiPath);
23
+
24
+ const apiHeaders: { [header: string]: string } = {
25
+ 'content-type': 'application/json',
26
+ }
27
+
28
+ return this.client.call(
29
+ 'post',
30
+ uri,
31
+ apiHeaders,
32
+ payload
33
+ );
34
+ }
35
+
36
+ /**
37
+ *
38
+ * @throws {RevenexxException}
39
+ * @returns {Promise<{}>}
40
+ */
41
+ inventoriesAvailability(): Promise<{}> {
42
+
43
+ const apiPath = '/v1/inventories/availability';
44
+ const payload: Payload = {};
45
+ const uri = new URL(this.client.config.endpoint + apiPath);
46
+
47
+ const apiHeaders: { [header: string]: string } = {
48
+ 'content-type': 'application/json',
49
+ }
50
+
51
+ return this.client.call(
52
+ 'post',
53
+ uri,
54
+ apiHeaders,
55
+ payload
56
+ );
57
+ }
58
+
59
+ /**
60
+ *
61
+ * @throws {RevenexxException}
62
+ * @returns {Promise<{}>}
63
+ */
64
+ inventoriesCommit(): Promise<{}> {
65
+
66
+ const apiPath = '/v1/inventories/commit';
67
+ const payload: Payload = {};
68
+ const uri = new URL(this.client.config.endpoint + apiPath);
69
+
70
+ const apiHeaders: { [header: string]: string } = {
71
+ 'content-type': 'application/json',
72
+ }
73
+
74
+ return this.client.call(
75
+ 'post',
76
+ uri,
77
+ apiHeaders,
78
+ payload
79
+ );
80
+ }
81
+
82
+ /**
83
+ *
84
+ * @throws {RevenexxException}
85
+ * @returns {Promise<{}>}
86
+ */
87
+ inventoriesLocationsList(): Promise<{}> {
88
+
89
+ const apiPath = '/v1/inventories/locations';
90
+ const payload: Payload = {};
91
+ const uri = new URL(this.client.config.endpoint + apiPath);
92
+
93
+ const apiHeaders: { [header: string]: string } = {
94
+ }
95
+
96
+ return this.client.call(
97
+ 'get',
98
+ uri,
99
+ apiHeaders,
100
+ payload
101
+ );
102
+ }
103
+
104
+ /**
105
+ *
106
+ * @throws {RevenexxException}
107
+ * @returns {Promise<Models.Location>}
108
+ */
109
+ inventoriesLocationsCreate(): Promise<Models.Location> {
110
+
111
+ const apiPath = '/v1/inventories/locations';
112
+ const payload: Payload = {};
113
+ const uri = new URL(this.client.config.endpoint + apiPath);
114
+
115
+ const apiHeaders: { [header: string]: string } = {
116
+ 'content-type': 'application/json',
117
+ }
118
+
119
+ return this.client.call(
120
+ 'post',
121
+ uri,
122
+ apiHeaders,
123
+ payload
124
+ );
125
+ }
126
+
127
+ /**
128
+ *
129
+ * @throws {RevenexxException}
130
+ * @returns {Promise<{}>}
131
+ */
132
+ inventoriesLocationsDefaults(): Promise<{}> {
133
+
134
+ const apiPath = '/v1/inventories/locations/defaults';
135
+ const payload: Payload = {};
136
+ const uri = new URL(this.client.config.endpoint + apiPath);
137
+
138
+ const apiHeaders: { [header: string]: string } = {
139
+ }
140
+
141
+ return this.client.call(
142
+ 'post',
143
+ uri,
144
+ apiHeaders,
145
+ payload
146
+ );
147
+ }
148
+
149
+ /**
150
+ *
151
+ * @param {string} params.id -
152
+ * @throws {RevenexxException}
153
+ * @returns {Promise<{}>}
154
+ */
155
+ inventoriesLocationsDelete(params: { id: string }): Promise<{}>;
156
+ /**
157
+ *
158
+ * @param {string} id -
159
+ * @throws {RevenexxException}
160
+ * @returns {Promise<{}>}
161
+ * @deprecated Use the object parameter style method for a better developer experience.
162
+ */
163
+ inventoriesLocationsDelete(id: string): Promise<{}>;
164
+ inventoriesLocationsDelete(
165
+ paramsOrFirst: { id: string } | string
166
+ ): Promise<{}> {
167
+ let params: { id: string };
168
+
169
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
170
+ params = (paramsOrFirst || {}) as { id: string };
171
+ } else {
172
+ params = {
173
+ id: paramsOrFirst as string
174
+ };
175
+ }
176
+
177
+ const id = params.id;
178
+
179
+ if (typeof id === 'undefined') {
180
+ throw new RevenexxException('Missing required parameter: "id"');
181
+ }
182
+
183
+ const apiPath = '/v1/inventories/locations/{id}'.replace('{id}', id);
184
+ const payload: Payload = {};
185
+ const uri = new URL(this.client.config.endpoint + apiPath);
186
+
187
+ const apiHeaders: { [header: string]: string } = {
188
+ }
189
+
190
+ return this.client.call(
191
+ 'delete',
192
+ uri,
193
+ apiHeaders,
194
+ payload
195
+ );
196
+ }
197
+
198
+ /**
199
+ *
200
+ * @param {string} params.id -
201
+ * @throws {RevenexxException}
202
+ * @returns {Promise<Models.Location>}
203
+ */
204
+ inventoriesLocationsGet(params: { id: string }): Promise<Models.Location>;
205
+ /**
206
+ *
207
+ * @param {string} id -
208
+ * @throws {RevenexxException}
209
+ * @returns {Promise<Models.Location>}
210
+ * @deprecated Use the object parameter style method for a better developer experience.
211
+ */
212
+ inventoriesLocationsGet(id: string): Promise<Models.Location>;
213
+ inventoriesLocationsGet(
214
+ paramsOrFirst: { id: string } | string
215
+ ): Promise<Models.Location> {
216
+ let params: { id: string };
217
+
218
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
219
+ params = (paramsOrFirst || {}) as { id: string };
220
+ } else {
221
+ params = {
222
+ id: paramsOrFirst as string
223
+ };
224
+ }
225
+
226
+ const id = params.id;
227
+
228
+ if (typeof id === 'undefined') {
229
+ throw new RevenexxException('Missing required parameter: "id"');
230
+ }
231
+
232
+ const apiPath = '/v1/inventories/locations/{id}'.replace('{id}', id);
233
+ const payload: Payload = {};
234
+ const uri = new URL(this.client.config.endpoint + apiPath);
235
+
236
+ const apiHeaders: { [header: string]: string } = {
237
+ }
238
+
239
+ return this.client.call(
240
+ 'get',
241
+ uri,
242
+ apiHeaders,
243
+ payload
244
+ );
245
+ }
246
+
247
+ /**
248
+ *
249
+ * @param {string} params.id -
250
+ * @throws {RevenexxException}
251
+ * @returns {Promise<Models.Location>}
252
+ */
253
+ inventoriesLocationsUpdate(params: { id: string }): Promise<Models.Location>;
254
+ /**
255
+ *
256
+ * @param {string} id -
257
+ * @throws {RevenexxException}
258
+ * @returns {Promise<Models.Location>}
259
+ * @deprecated Use the object parameter style method for a better developer experience.
260
+ */
261
+ inventoriesLocationsUpdate(id: string): Promise<Models.Location>;
262
+ inventoriesLocationsUpdate(
263
+ paramsOrFirst: { id: string } | string
264
+ ): Promise<Models.Location> {
265
+ let params: { id: string };
266
+
267
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
268
+ params = (paramsOrFirst || {}) as { id: string };
269
+ } else {
270
+ params = {
271
+ id: paramsOrFirst as string
272
+ };
273
+ }
274
+
275
+ const id = params.id;
276
+
277
+ if (typeof id === 'undefined') {
278
+ throw new RevenexxException('Missing required parameter: "id"');
279
+ }
280
+
281
+ const apiPath = '/v1/inventories/locations/{id}'.replace('{id}', id);
282
+ const payload: Payload = {};
283
+ const uri = new URL(this.client.config.endpoint + apiPath);
284
+
285
+ const apiHeaders: { [header: string]: string } = {
286
+ 'content-type': 'application/json',
287
+ }
288
+
289
+ return this.client.call(
290
+ 'put',
291
+ uri,
292
+ apiHeaders,
293
+ payload
294
+ );
295
+ }
296
+
297
+ /**
298
+ *
299
+ * @throws {RevenexxException}
300
+ * @returns {Promise<{}>}
301
+ */
302
+ inventoriesMovementsList(): Promise<{}> {
303
+
304
+ const apiPath = '/v1/inventories/movements';
305
+ const payload: Payload = {};
306
+ const uri = new URL(this.client.config.endpoint + apiPath);
307
+
308
+ const apiHeaders: { [header: string]: string } = {
309
+ }
310
+
311
+ return this.client.call(
312
+ 'get',
313
+ uri,
314
+ apiHeaders,
315
+ payload
316
+ );
317
+ }
318
+
319
+ /**
320
+ *
321
+ * @param {string} params.id -
322
+ * @throws {RevenexxException}
323
+ * @returns {Promise<Models.StockMovement>}
324
+ */
325
+ inventoriesMovementsGet(params: { id: string }): Promise<Models.StockMovement>;
326
+ /**
327
+ *
328
+ * @param {string} id -
329
+ * @throws {RevenexxException}
330
+ * @returns {Promise<Models.StockMovement>}
331
+ * @deprecated Use the object parameter style method for a better developer experience.
332
+ */
333
+ inventoriesMovementsGet(id: string): Promise<Models.StockMovement>;
334
+ inventoriesMovementsGet(
335
+ paramsOrFirst: { id: string } | string
336
+ ): Promise<Models.StockMovement> {
337
+ let params: { id: string };
338
+
339
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
340
+ params = (paramsOrFirst || {}) as { id: string };
341
+ } else {
342
+ params = {
343
+ id: paramsOrFirst as string
344
+ };
345
+ }
346
+
347
+ const id = params.id;
348
+
349
+ if (typeof id === 'undefined') {
350
+ throw new RevenexxException('Missing required parameter: "id"');
351
+ }
352
+
353
+ const apiPath = '/v1/inventories/movements/{id}'.replace('{id}', id);
354
+ const payload: Payload = {};
355
+ const uri = new URL(this.client.config.endpoint + apiPath);
356
+
357
+ const apiHeaders: { [header: string]: string } = {
358
+ }
359
+
360
+ return this.client.call(
361
+ 'get',
362
+ uri,
363
+ apiHeaders,
364
+ payload
365
+ );
366
+ }
367
+
368
+ /**
369
+ *
370
+ * @throws {RevenexxException}
371
+ * @returns {Promise<{}>}
372
+ */
373
+ inventoriesReceive(): Promise<{}> {
374
+
375
+ const apiPath = '/v1/inventories/receive';
376
+ const payload: Payload = {};
377
+ const uri = new URL(this.client.config.endpoint + apiPath);
378
+
379
+ const apiHeaders: { [header: string]: string } = {
380
+ 'content-type': 'application/json',
381
+ }
382
+
383
+ return this.client.call(
384
+ 'post',
385
+ uri,
386
+ apiHeaders,
387
+ payload
388
+ );
389
+ }
390
+
391
+ /**
392
+ *
393
+ * @throws {RevenexxException}
394
+ * @returns {Promise<{}>}
395
+ */
396
+ inventoriesRelease(): Promise<{}> {
397
+
398
+ const apiPath = '/v1/inventories/release';
399
+ const payload: Payload = {};
400
+ const uri = new URL(this.client.config.endpoint + apiPath);
401
+
402
+ const apiHeaders: { [header: string]: string } = {
403
+ 'content-type': 'application/json',
404
+ }
405
+
406
+ return this.client.call(
407
+ 'post',
408
+ uri,
409
+ apiHeaders,
410
+ payload
411
+ );
412
+ }
413
+
414
+ /**
415
+ *
416
+ * @throws {RevenexxException}
417
+ * @returns {Promise<{}>}
418
+ */
419
+ inventoriesReservationsList(): Promise<{}> {
420
+
421
+ const apiPath = '/v1/inventories/reservations';
422
+ const payload: Payload = {};
423
+ const uri = new URL(this.client.config.endpoint + apiPath);
424
+
425
+ const apiHeaders: { [header: string]: string } = {
426
+ }
427
+
428
+ return this.client.call(
429
+ 'get',
430
+ uri,
431
+ apiHeaders,
432
+ payload
433
+ );
434
+ }
435
+
436
+ /**
437
+ *
438
+ * @param {string} params.id -
439
+ * @throws {RevenexxException}
440
+ * @returns {Promise<Models.Reservation>}
441
+ */
442
+ inventoriesReservationsGet(params: { id: string }): Promise<Models.Reservation>;
443
+ /**
444
+ *
445
+ * @param {string} id -
446
+ * @throws {RevenexxException}
447
+ * @returns {Promise<Models.Reservation>}
448
+ * @deprecated Use the object parameter style method for a better developer experience.
449
+ */
450
+ inventoriesReservationsGet(id: string): Promise<Models.Reservation>;
451
+ inventoriesReservationsGet(
452
+ paramsOrFirst: { id: string } | string
453
+ ): Promise<Models.Reservation> {
454
+ let params: { id: string };
455
+
456
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
457
+ params = (paramsOrFirst || {}) as { id: string };
458
+ } else {
459
+ params = {
460
+ id: paramsOrFirst as string
461
+ };
462
+ }
463
+
464
+ const id = params.id;
465
+
466
+ if (typeof id === 'undefined') {
467
+ throw new RevenexxException('Missing required parameter: "id"');
468
+ }
469
+
470
+ const apiPath = '/v1/inventories/reservations/{id}'.replace('{id}', id);
471
+ const payload: Payload = {};
472
+ const uri = new URL(this.client.config.endpoint + apiPath);
473
+
474
+ const apiHeaders: { [header: string]: string } = {
475
+ }
476
+
477
+ return this.client.call(
478
+ 'get',
479
+ uri,
480
+ apiHeaders,
481
+ payload
482
+ );
483
+ }
484
+
485
+ /**
486
+ *
487
+ * @throws {RevenexxException}
488
+ * @returns {Promise<{}>}
489
+ */
490
+ inventoriesReserve(): Promise<{}> {
491
+
492
+ const apiPath = '/v1/inventories/reserve';
493
+ const payload: Payload = {};
494
+ const uri = new URL(this.client.config.endpoint + apiPath);
495
+
496
+ const apiHeaders: { [header: string]: string } = {
497
+ 'content-type': 'application/json',
498
+ }
499
+
500
+ return this.client.call(
501
+ 'post',
502
+ uri,
503
+ apiHeaders,
504
+ payload
505
+ );
506
+ }
507
+
508
+ /**
509
+ *
510
+ * @throws {RevenexxException}
511
+ * @returns {Promise<{}>}
512
+ */
513
+ inventoriesRestock(): Promise<{}> {
514
+
515
+ const apiPath = '/v1/inventories/restock';
516
+ const payload: Payload = {};
517
+ const uri = new URL(this.client.config.endpoint + apiPath);
518
+
519
+ const apiHeaders: { [header: string]: string } = {
520
+ 'content-type': 'application/json',
521
+ }
522
+
523
+ return this.client.call(
524
+ 'post',
525
+ uri,
526
+ apiHeaders,
527
+ payload
528
+ );
529
+ }
530
+
531
+ /**
532
+ *
533
+ * @throws {RevenexxException}
534
+ * @returns {Promise<{}>}
535
+ */
536
+ inventoriesStockList(): Promise<{}> {
537
+
538
+ const apiPath = '/v1/inventories/stock';
539
+ const payload: Payload = {};
540
+ const uri = new URL(this.client.config.endpoint + apiPath);
541
+
542
+ const apiHeaders: { [header: string]: string } = {
543
+ }
544
+
545
+ return this.client.call(
546
+ 'get',
547
+ uri,
548
+ apiHeaders,
549
+ payload
550
+ );
551
+ }
552
+
553
+ /**
554
+ *
555
+ * @throws {RevenexxException}
556
+ * @returns {Promise<Models.StockLevel>}
557
+ */
558
+ inventoriesStockCreate(): Promise<Models.StockLevel> {
559
+
560
+ const apiPath = '/v1/inventories/stock';
561
+ const payload: Payload = {};
562
+ const uri = new URL(this.client.config.endpoint + apiPath);
563
+
564
+ const apiHeaders: { [header: string]: string } = {
565
+ 'content-type': 'application/json',
566
+ }
567
+
568
+ return this.client.call(
569
+ 'post',
570
+ uri,
571
+ apiHeaders,
572
+ payload
573
+ );
574
+ }
575
+
576
+ /**
577
+ *
578
+ * @param {string} params.id -
579
+ * @throws {RevenexxException}
580
+ * @returns {Promise<{}>}
581
+ */
582
+ inventoriesStockDelete(params: { id: string }): Promise<{}>;
583
+ /**
584
+ *
585
+ * @param {string} id -
586
+ * @throws {RevenexxException}
587
+ * @returns {Promise<{}>}
588
+ * @deprecated Use the object parameter style method for a better developer experience.
589
+ */
590
+ inventoriesStockDelete(id: string): Promise<{}>;
591
+ inventoriesStockDelete(
592
+ paramsOrFirst: { id: string } | string
593
+ ): Promise<{}> {
594
+ let params: { id: string };
595
+
596
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
597
+ params = (paramsOrFirst || {}) as { id: string };
598
+ } else {
599
+ params = {
600
+ id: paramsOrFirst as string
601
+ };
602
+ }
603
+
604
+ const id = params.id;
605
+
606
+ if (typeof id === 'undefined') {
607
+ throw new RevenexxException('Missing required parameter: "id"');
608
+ }
609
+
610
+ const apiPath = '/v1/inventories/stock/{id}'.replace('{id}', id);
611
+ const payload: Payload = {};
612
+ const uri = new URL(this.client.config.endpoint + apiPath);
613
+
614
+ const apiHeaders: { [header: string]: string } = {
615
+ }
616
+
617
+ return this.client.call(
618
+ 'delete',
619
+ uri,
620
+ apiHeaders,
621
+ payload
622
+ );
623
+ }
624
+
625
+ /**
626
+ *
627
+ * @param {string} params.id -
628
+ * @throws {RevenexxException}
629
+ * @returns {Promise<Models.StockLevel>}
630
+ */
631
+ inventoriesStockGet(params: { id: string }): Promise<Models.StockLevel>;
632
+ /**
633
+ *
634
+ * @param {string} id -
635
+ * @throws {RevenexxException}
636
+ * @returns {Promise<Models.StockLevel>}
637
+ * @deprecated Use the object parameter style method for a better developer experience.
638
+ */
639
+ inventoriesStockGet(id: string): Promise<Models.StockLevel>;
640
+ inventoriesStockGet(
641
+ paramsOrFirst: { id: string } | string
642
+ ): Promise<Models.StockLevel> {
643
+ let params: { id: string };
644
+
645
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
646
+ params = (paramsOrFirst || {}) as { id: string };
647
+ } else {
648
+ params = {
649
+ id: paramsOrFirst as string
650
+ };
651
+ }
652
+
653
+ const id = params.id;
654
+
655
+ if (typeof id === 'undefined') {
656
+ throw new RevenexxException('Missing required parameter: "id"');
657
+ }
658
+
659
+ const apiPath = '/v1/inventories/stock/{id}'.replace('{id}', id);
660
+ const payload: Payload = {};
661
+ const uri = new URL(this.client.config.endpoint + apiPath);
662
+
663
+ const apiHeaders: { [header: string]: string } = {
664
+ }
665
+
666
+ return this.client.call(
667
+ 'get',
668
+ uri,
669
+ apiHeaders,
670
+ payload
671
+ );
672
+ }
673
+
674
+ /**
675
+ *
676
+ * @param {string} params.id -
677
+ * @throws {RevenexxException}
678
+ * @returns {Promise<Models.StockLevel>}
679
+ */
680
+ inventoriesStockUpdate(params: { id: string }): Promise<Models.StockLevel>;
681
+ /**
682
+ *
683
+ * @param {string} id -
684
+ * @throws {RevenexxException}
685
+ * @returns {Promise<Models.StockLevel>}
686
+ * @deprecated Use the object parameter style method for a better developer experience.
687
+ */
688
+ inventoriesStockUpdate(id: string): Promise<Models.StockLevel>;
689
+ inventoriesStockUpdate(
690
+ paramsOrFirst: { id: string } | string
691
+ ): Promise<Models.StockLevel> {
692
+ let params: { id: string };
693
+
694
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
695
+ params = (paramsOrFirst || {}) as { id: string };
696
+ } else {
697
+ params = {
698
+ id: paramsOrFirst as string
699
+ };
700
+ }
701
+
702
+ const id = params.id;
703
+
704
+ if (typeof id === 'undefined') {
705
+ throw new RevenexxException('Missing required parameter: "id"');
706
+ }
707
+
708
+ const apiPath = '/v1/inventories/stock/{id}'.replace('{id}', id);
709
+ const payload: Payload = {};
710
+ const uri = new URL(this.client.config.endpoint + apiPath);
711
+
712
+ const apiHeaders: { [header: string]: string } = {
713
+ 'content-type': 'application/json',
714
+ }
715
+
716
+ return this.client.call(
717
+ 'put',
718
+ uri,
719
+ apiHeaders,
720
+ payload
721
+ );
722
+ }
723
+ }