@revenexx/sdk 0.0.4 → 0.0.6

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 (99) hide show
  1. package/dist/cjs/sdk.js +13491 -6163
  2. package/dist/cjs/sdk.js.map +1 -1
  3. package/dist/esm/sdk.js +13464 -6162
  4. package/dist/esm/sdk.js.map +1 -1
  5. package/dist/iife/sdk.js +13491 -6163
  6. package/package.json +1 -1
  7. package/src/client.ts +1 -1
  8. package/src/enums/address-type.ts +4 -0
  9. package/src/enums/cart-export-format.ts +4 -0
  10. package/src/enums/cart-io-apply-mode.ts +5 -0
  11. package/src/enums/cart-io-direction.ts +4 -0
  12. package/src/enums/cart-io-entity.ts +4 -0
  13. package/src/enums/cart-io-format.ts +4 -0
  14. package/src/enums/cart-item-type.ts +5 -0
  15. package/src/enums/channel-status.ts +4 -0
  16. package/src/enums/channel-type.ts +7 -0
  17. package/src/enums/contact-role.ts +6 -0
  18. package/src/enums/contact-status.ts +5 -0
  19. package/src/enums/location-type.ts +6 -0
  20. package/src/enums/market-status.ts +4 -0
  21. package/src/enums/order-comment-visibility.ts +4 -0
  22. package/src/enums/order-item-type.ts +5 -0
  23. package/src/enums/order-list-kind.ts +4 -0
  24. package/src/enums/order-payment-status.ts +9 -0
  25. package/src/enums/organization-status.ts +4 -0
  26. package/src/enums/page-status.ts +5 -0
  27. package/src/enums/payment-fee-type.ts +5 -0
  28. package/src/enums/payment-method-kind.ts +4 -0
  29. package/src/enums/price-entry-type.ts +4 -0
  30. package/src/enums/price-list-status.ts +4 -0
  31. package/src/enums/shipping-method-matrix-basis.ts +6 -0
  32. package/src/enums/shipping-method-pricing-type.ts +5 -0
  33. package/src/enums/store-asset-request-visibility.ts +4 -0
  34. package/src/enums/visibility.ts +4 -0
  35. package/src/index.ts +28 -2
  36. package/src/models.ts +5309 -1009
  37. package/src/services/apps.ts +154 -154
  38. package/src/services/avatars.ts +57 -57
  39. package/src/services/carts.ts +739 -104
  40. package/src/services/channels.ts +147 -19
  41. package/src/services/customers.ts +809 -69
  42. package/src/services/greetings.ts +18 -18
  43. package/src/services/inventories.ts +620 -65
  44. package/src/services/locale.ts +16 -16
  45. package/src/services/markets.ts +690 -75
  46. package/src/services/messaging.ts +273 -273
  47. package/src/services/orderlists.ts +889 -0
  48. package/src/services/orders.ts +692 -137
  49. package/src/services/pages.ts +661 -155
  50. package/src/services/payments.ts +591 -64
  51. package/src/services/prices.ts +585 -59
  52. package/src/services/products.ts +1908 -272
  53. package/src/services/search.ts +24 -24
  54. package/src/services/shipping.ts +451 -59
  55. package/src/services/sites.ts +116 -116
  56. package/src/services/storage.ts +933 -599
  57. package/src/services/tokens.ts +14 -14
  58. package/types/enums/address-type.d.ts +4 -0
  59. package/types/enums/cart-export-format.d.ts +4 -0
  60. package/types/enums/cart-io-apply-mode.d.ts +5 -0
  61. package/types/enums/cart-io-direction.d.ts +4 -0
  62. package/types/enums/cart-io-entity.d.ts +4 -0
  63. package/types/enums/cart-io-format.d.ts +4 -0
  64. package/types/enums/cart-item-type.d.ts +5 -0
  65. package/types/enums/channel-status.d.ts +4 -0
  66. package/types/enums/channel-type.d.ts +7 -0
  67. package/types/enums/contact-role.d.ts +6 -0
  68. package/types/enums/contact-status.d.ts +5 -0
  69. package/types/enums/location-type.d.ts +6 -0
  70. package/types/enums/market-status.d.ts +4 -0
  71. package/types/enums/order-comment-visibility.d.ts +4 -0
  72. package/types/enums/order-item-type.d.ts +5 -0
  73. package/types/enums/order-list-kind.d.ts +4 -0
  74. package/types/enums/order-payment-status.d.ts +9 -0
  75. package/types/enums/organization-status.d.ts +4 -0
  76. package/types/enums/page-status.d.ts +5 -0
  77. package/types/enums/payment-fee-type.d.ts +5 -0
  78. package/types/enums/payment-method-kind.d.ts +4 -0
  79. package/types/enums/price-entry-type.d.ts +4 -0
  80. package/types/enums/price-list-status.d.ts +4 -0
  81. package/types/enums/shipping-method-matrix-basis.d.ts +6 -0
  82. package/types/enums/shipping-method-pricing-type.d.ts +5 -0
  83. package/types/enums/store-asset-request-visibility.d.ts +4 -0
  84. package/types/enums/visibility.d.ts +4 -0
  85. package/types/index.d.ts +28 -2
  86. package/types/models.d.ts +5170 -1010
  87. package/types/services/carts.d.ts +271 -12
  88. package/types/services/channels.d.ts +54 -2
  89. package/types/services/customers.d.ts +298 -12
  90. package/types/services/inventories.d.ts +225 -11
  91. package/types/services/markets.d.ts +235 -6
  92. package/types/services/orderlists.d.ts +324 -0
  93. package/types/services/orders.d.ts +238 -16
  94. package/types/services/pages.d.ts +190 -6
  95. package/types/services/payments.d.ts +221 -7
  96. package/types/services/prices.d.ts +218 -6
  97. package/types/services/products.d.ts +672 -32
  98. package/types/services/shipping.d.ts +168 -6
  99. package/types/services/storage.d.ts +353 -285
@@ -2,6 +2,7 @@ import { Service } from '../service';
2
2
  import { RevenexxException, Client, type Payload, UploadProgress } from '../client';
3
3
  import type { Models } from '../models';
4
4
 
5
+ import { LocationType } from '../enums/location-type';
5
6
 
6
7
  export class Inventories {
7
8
  client: Client;
@@ -12,13 +13,61 @@ export class Inventories {
12
13
 
13
14
  /**
14
15
  *
16
+ * @param {Models.InventoryAdjustItem[]} params.items - The corrections — quantities are SIGNED deltas (at most 200).
17
+ * @param {string} params.reason - Mandatory audit reason — every adjustment is a ledger row.
18
+ * @param {string} params.locationCode - Adjusted location (default 'main').
15
19
  * @throws {RevenexxException}
16
20
  * @returns {Promise<{}>}
17
21
  */
18
- inventoriesAdjust(): Promise<{}> {
22
+ inventoriesAdjust(params: { items: Models.InventoryAdjustItem[], reason: string, locationCode?: string }): Promise<{}>;
23
+ /**
24
+ *
25
+ * @param {Models.InventoryAdjustItem[]} items - The corrections — quantities are SIGNED deltas (at most 200).
26
+ * @param {string} reason - Mandatory audit reason — every adjustment is a ledger row.
27
+ * @param {string} locationCode - Adjusted location (default 'main').
28
+ * @throws {RevenexxException}
29
+ * @returns {Promise<{}>}
30
+ * @deprecated Use the object parameter style method for a better developer experience.
31
+ */
32
+ inventoriesAdjust(items: Models.InventoryAdjustItem[], reason: string, locationCode?: string): Promise<{}>;
33
+ inventoriesAdjust(
34
+ paramsOrFirst: { items: Models.InventoryAdjustItem[], reason: string, locationCode?: string } | Models.InventoryAdjustItem[],
35
+ ...rest: [(string)?, (string)?]
36
+ ): Promise<{}> {
37
+ let params: { items: Models.InventoryAdjustItem[], reason: string, locationCode?: string };
38
+
39
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('items' in paramsOrFirst || 'reason' in paramsOrFirst || 'locationCode' in paramsOrFirst))) {
40
+ params = (paramsOrFirst || {}) as { items: Models.InventoryAdjustItem[], reason: string, locationCode?: string };
41
+ } else {
42
+ params = {
43
+ items: paramsOrFirst as Models.InventoryAdjustItem[],
44
+ reason: rest[0] as string,
45
+ locationCode: rest[1] as string
46
+ };
47
+ }
48
+
49
+ const items = params.items;
50
+ const reason = params.reason;
51
+ const locationCode = params.locationCode;
52
+
53
+ if (typeof items === 'undefined') {
54
+ throw new RevenexxException('Missing required parameter: "items"');
55
+ }
56
+ if (typeof reason === 'undefined') {
57
+ throw new RevenexxException('Missing required parameter: "reason"');
58
+ }
19
59
 
20
60
  const apiPath = '/v1/inventories/adjust';
21
- const payload: Payload = {};
61
+ const apiPayload: Payload = {};
62
+ if (typeof items !== 'undefined') {
63
+ apiPayload['items'] = items;
64
+ }
65
+ if (typeof locationCode !== 'undefined') {
66
+ apiPayload['location_code'] = locationCode;
67
+ }
68
+ if (typeof reason !== 'undefined') {
69
+ apiPayload['reason'] = reason;
70
+ }
22
71
  const uri = new URL(this.client.config.endpoint + apiPath);
23
72
 
24
73
  const apiHeaders: { [header: string]: string } = {
@@ -29,19 +78,57 @@ export class Inventories {
29
78
  'post',
30
79
  uri,
31
80
  apiHeaders,
32
- payload
81
+ apiPayload
33
82
  );
34
83
  }
35
84
 
36
85
  /**
37
86
  *
87
+ * @param {Models.InventoryAvailabilityItem[]} params.items - The items to check (batch, at most 200).
88
+ * @param {string} params.locationCode - Restrict the check to one location (default: all enabled locations).
38
89
  * @throws {RevenexxException}
39
90
  * @returns {Promise<{}>}
40
91
  */
41
- inventoriesAvailability(): Promise<{}> {
92
+ inventoriesAvailability(params: { items: Models.InventoryAvailabilityItem[], locationCode?: string }): Promise<{}>;
93
+ /**
94
+ *
95
+ * @param {Models.InventoryAvailabilityItem[]} items - The items to check (batch, at most 200).
96
+ * @param {string} locationCode - Restrict the check to one location (default: all enabled locations).
97
+ * @throws {RevenexxException}
98
+ * @returns {Promise<{}>}
99
+ * @deprecated Use the object parameter style method for a better developer experience.
100
+ */
101
+ inventoriesAvailability(items: Models.InventoryAvailabilityItem[], locationCode?: string): Promise<{}>;
102
+ inventoriesAvailability(
103
+ paramsOrFirst: { items: Models.InventoryAvailabilityItem[], locationCode?: string } | Models.InventoryAvailabilityItem[],
104
+ ...rest: [(string)?]
105
+ ): Promise<{}> {
106
+ let params: { items: Models.InventoryAvailabilityItem[], locationCode?: string };
107
+
108
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('items' in paramsOrFirst || 'locationCode' in paramsOrFirst))) {
109
+ params = (paramsOrFirst || {}) as { items: Models.InventoryAvailabilityItem[], locationCode?: string };
110
+ } else {
111
+ params = {
112
+ items: paramsOrFirst as Models.InventoryAvailabilityItem[],
113
+ locationCode: rest[0] as string
114
+ };
115
+ }
116
+
117
+ const items = params.items;
118
+ const locationCode = params.locationCode;
119
+
120
+ if (typeof items === 'undefined') {
121
+ throw new RevenexxException('Missing required parameter: "items"');
122
+ }
42
123
 
43
124
  const apiPath = '/v1/inventories/availability';
44
- const payload: Payload = {};
125
+ const apiPayload: Payload = {};
126
+ if (typeof items !== 'undefined') {
127
+ apiPayload['items'] = items;
128
+ }
129
+ if (typeof locationCode !== 'undefined') {
130
+ apiPayload['location_code'] = locationCode;
131
+ }
45
132
  const uri = new URL(this.client.config.endpoint + apiPath);
46
133
 
47
134
  const apiHeaders: { [header: string]: string } = {
@@ -52,19 +139,49 @@ export class Inventories {
52
139
  'post',
53
140
  uri,
54
141
  apiHeaders,
55
- payload
142
+ apiPayload
56
143
  );
57
144
  }
58
145
 
59
146
  /**
60
147
  *
148
+ * @param {string} params.orderRef - The order whose active reservations are committed (shipment).
149
+ * @throws {RevenexxException}
150
+ * @returns {Promise<{}>}
151
+ */
152
+ inventoriesCommit(params: { orderRef: string }): Promise<{}>;
153
+ /**
154
+ *
155
+ * @param {string} orderRef - The order whose active reservations are committed (shipment).
61
156
  * @throws {RevenexxException}
62
157
  * @returns {Promise<{}>}
158
+ * @deprecated Use the object parameter style method for a better developer experience.
63
159
  */
64
- inventoriesCommit(): Promise<{}> {
160
+ inventoriesCommit(orderRef: string): Promise<{}>;
161
+ inventoriesCommit(
162
+ paramsOrFirst: { orderRef: string } | string
163
+ ): Promise<{}> {
164
+ let params: { orderRef: string };
165
+
166
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
167
+ params = (paramsOrFirst || {}) as { orderRef: string };
168
+ } else {
169
+ params = {
170
+ orderRef: paramsOrFirst as string
171
+ };
172
+ }
173
+
174
+ const orderRef = params.orderRef;
175
+
176
+ if (typeof orderRef === 'undefined') {
177
+ throw new RevenexxException('Missing required parameter: "orderRef"');
178
+ }
65
179
 
66
180
  const apiPath = '/v1/inventories/commit';
67
- const payload: Payload = {};
181
+ const apiPayload: Payload = {};
182
+ if (typeof orderRef !== 'undefined') {
183
+ apiPayload['order_ref'] = orderRef;
184
+ }
68
185
  const uri = new URL(this.client.config.endpoint + apiPath);
69
186
 
70
187
  const apiHeaders: { [header: string]: string } = {
@@ -75,7 +192,7 @@ export class Inventories {
75
192
  'post',
76
193
  uri,
77
194
  apiHeaders,
78
- payload
195
+ apiPayload
79
196
  );
80
197
  }
81
198
 
@@ -87,7 +204,7 @@ export class Inventories {
87
204
  inventoriesLocationsList(): Promise<{}> {
88
205
 
89
206
  const apiPath = '/v1/inventories/locations';
90
- const payload: Payload = {};
207
+ const apiPayload: Payload = {};
91
208
  const uri = new URL(this.client.config.endpoint + apiPath);
92
209
 
93
210
  const apiHeaders: { [header: string]: string } = {
@@ -97,19 +214,102 @@ export class Inventories {
97
214
  'get',
98
215
  uri,
99
216
  apiHeaders,
100
- payload
217
+ apiPayload
101
218
  );
102
219
  }
103
220
 
104
221
  /**
105
222
  *
223
+ * @param {string} params.code - Unique location code (per tenant).
224
+ * @param {string} params.name -
225
+ * @param {object} params.address -
226
+ * @param {boolean} params.enabled - Disabled locations are skipped by availability and reserve (default true).
227
+ * @param {object} params.labels - Localised display names ({de, en, …}).
228
+ * @param {object} params.metadata - Free-form metadata.
229
+ * @param {number} params.priority - Sourcing order — lower wins (default 0).
230
+ * @param {LocationType} params.type - Default 'warehouse'.
106
231
  * @throws {RevenexxException}
107
232
  * @returns {Promise<Models.Location>}
108
233
  */
109
- inventoriesLocationsCreate(): Promise<Models.Location> {
234
+ inventoriesLocationsCreate(params: { code: string, name: string, address?: object, enabled?: boolean, labels?: object, metadata?: object, priority?: number, type?: LocationType }): Promise<Models.Location>;
235
+ /**
236
+ *
237
+ * @param {string} code - Unique location code (per tenant).
238
+ * @param {string} name -
239
+ * @param {object} address -
240
+ * @param {boolean} enabled - Disabled locations are skipped by availability and reserve (default true).
241
+ * @param {object} labels - Localised display names ({de, en, …}).
242
+ * @param {object} metadata - Free-form metadata.
243
+ * @param {number} priority - Sourcing order — lower wins (default 0).
244
+ * @param {LocationType} type - Default 'warehouse'.
245
+ * @throws {RevenexxException}
246
+ * @returns {Promise<Models.Location>}
247
+ * @deprecated Use the object parameter style method for a better developer experience.
248
+ */
249
+ inventoriesLocationsCreate(code: string, name: string, address?: object, enabled?: boolean, labels?: object, metadata?: object, priority?: number, type?: LocationType): Promise<Models.Location>;
250
+ inventoriesLocationsCreate(
251
+ paramsOrFirst: { code: string, name: string, address?: object, enabled?: boolean, labels?: object, metadata?: object, priority?: number, type?: LocationType } | string,
252
+ ...rest: [(string)?, (object)?, (boolean)?, (object)?, (object)?, (number)?, (LocationType)?]
253
+ ): Promise<Models.Location> {
254
+ let params: { code: string, name: string, address?: object, enabled?: boolean, labels?: object, metadata?: object, priority?: number, type?: LocationType };
255
+
256
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
257
+ params = (paramsOrFirst || {}) as { code: string, name: string, address?: object, enabled?: boolean, labels?: object, metadata?: object, priority?: number, type?: LocationType };
258
+ } else {
259
+ params = {
260
+ code: paramsOrFirst as string,
261
+ name: rest[0] as string,
262
+ address: rest[1] as object,
263
+ enabled: rest[2] as boolean,
264
+ labels: rest[3] as object,
265
+ metadata: rest[4] as object,
266
+ priority: rest[5] as number,
267
+ type: rest[6] as LocationType
268
+ };
269
+ }
270
+
271
+ const code = params.code;
272
+ const name = params.name;
273
+ const address = params.address;
274
+ const enabled = params.enabled;
275
+ const labels = params.labels;
276
+ const metadata = params.metadata;
277
+ const priority = params.priority;
278
+ const type = params.type;
279
+
280
+ if (typeof code === 'undefined') {
281
+ throw new RevenexxException('Missing required parameter: "code"');
282
+ }
283
+ if (typeof name === 'undefined') {
284
+ throw new RevenexxException('Missing required parameter: "name"');
285
+ }
110
286
 
111
287
  const apiPath = '/v1/inventories/locations';
112
- const payload: Payload = {};
288
+ const apiPayload: Payload = {};
289
+ if (typeof address !== 'undefined') {
290
+ apiPayload['address'] = address;
291
+ }
292
+ if (typeof code !== 'undefined') {
293
+ apiPayload['code'] = code;
294
+ }
295
+ if (typeof enabled !== 'undefined') {
296
+ apiPayload['enabled'] = enabled;
297
+ }
298
+ if (typeof labels !== 'undefined') {
299
+ apiPayload['labels'] = labels;
300
+ }
301
+ if (typeof metadata !== 'undefined') {
302
+ apiPayload['metadata'] = metadata;
303
+ }
304
+ if (typeof name !== 'undefined') {
305
+ apiPayload['name'] = name;
306
+ }
307
+ if (typeof priority !== 'undefined') {
308
+ apiPayload['priority'] = priority;
309
+ }
310
+ if (typeof type !== 'undefined') {
311
+ apiPayload['type'] = type;
312
+ }
113
313
  const uri = new URL(this.client.config.endpoint + apiPath);
114
314
 
115
315
  const apiHeaders: { [header: string]: string } = {
@@ -120,7 +320,7 @@ export class Inventories {
120
320
  'post',
121
321
  uri,
122
322
  apiHeaders,
123
- payload
323
+ apiPayload
124
324
  );
125
325
  }
126
326
 
@@ -132,7 +332,7 @@ export class Inventories {
132
332
  inventoriesLocationsDefaults(): Promise<{}> {
133
333
 
134
334
  const apiPath = '/v1/inventories/locations/defaults';
135
- const payload: Payload = {};
335
+ const apiPayload: Payload = {};
136
336
  const uri = new URL(this.client.config.endpoint + apiPath);
137
337
 
138
338
  const apiHeaders: { [header: string]: string } = {
@@ -142,7 +342,7 @@ export class Inventories {
142
342
  'post',
143
343
  uri,
144
344
  apiHeaders,
145
- payload
345
+ apiPayload
146
346
  );
147
347
  }
148
348
 
@@ -181,7 +381,7 @@ export class Inventories {
181
381
  }
182
382
 
183
383
  const apiPath = '/v1/inventories/locations/{id}'.replace('{id}', id);
184
- const payload: Payload = {};
384
+ const apiPayload: Payload = {};
185
385
  const uri = new URL(this.client.config.endpoint + apiPath);
186
386
 
187
387
  const apiHeaders: { [header: string]: string } = {
@@ -191,7 +391,7 @@ export class Inventories {
191
391
  'delete',
192
392
  uri,
193
393
  apiHeaders,
194
- payload
394
+ apiPayload
195
395
  );
196
396
  }
197
397
 
@@ -230,7 +430,7 @@ export class Inventories {
230
430
  }
231
431
 
232
432
  const apiPath = '/v1/inventories/locations/{id}'.replace('{id}', id);
233
- const payload: Payload = {};
433
+ const apiPayload: Payload = {};
234
434
  const uri = new URL(this.client.config.endpoint + apiPath);
235
435
 
236
436
  const apiHeaders: { [header: string]: string } = {
@@ -240,46 +440,103 @@ export class Inventories {
240
440
  'get',
241
441
  uri,
242
442
  apiHeaders,
243
- payload
443
+ apiPayload
244
444
  );
245
445
  }
246
446
 
247
447
  /**
248
448
  *
249
449
  * @param {string} params.id -
450
+ * @param {object} params.address -
451
+ * @param {string} params.code - Unique location code (per tenant).
452
+ * @param {boolean} params.enabled - Disabled locations are skipped by availability and reserve (default true).
453
+ * @param {object} params.labels - Localised display names ({de, en, …}).
454
+ * @param {object} params.metadata - Free-form metadata.
455
+ * @param {string} params.name -
456
+ * @param {number} params.priority - Sourcing order — lower wins (default 0).
457
+ * @param {LocationType} params.type - Default 'warehouse'.
250
458
  * @throws {RevenexxException}
251
459
  * @returns {Promise<Models.Location>}
252
460
  */
253
- inventoriesLocationsUpdate(params: { id: string }): Promise<Models.Location>;
461
+ inventoriesLocationsUpdate(params: { id: string, address?: object, code?: string, enabled?: boolean, labels?: object, metadata?: object, name?: string, priority?: number, type?: LocationType }): Promise<Models.Location>;
254
462
  /**
255
463
  *
256
464
  * @param {string} id -
465
+ * @param {object} address -
466
+ * @param {string} code - Unique location code (per tenant).
467
+ * @param {boolean} enabled - Disabled locations are skipped by availability and reserve (default true).
468
+ * @param {object} labels - Localised display names ({de, en, …}).
469
+ * @param {object} metadata - Free-form metadata.
470
+ * @param {string} name -
471
+ * @param {number} priority - Sourcing order — lower wins (default 0).
472
+ * @param {LocationType} type - Default 'warehouse'.
257
473
  * @throws {RevenexxException}
258
474
  * @returns {Promise<Models.Location>}
259
475
  * @deprecated Use the object parameter style method for a better developer experience.
260
476
  */
261
- inventoriesLocationsUpdate(id: string): Promise<Models.Location>;
477
+ inventoriesLocationsUpdate(id: string, address?: object, code?: string, enabled?: boolean, labels?: object, metadata?: object, name?: string, priority?: number, type?: LocationType): Promise<Models.Location>;
262
478
  inventoriesLocationsUpdate(
263
- paramsOrFirst: { id: string } | string
479
+ paramsOrFirst: { id: string, address?: object, code?: string, enabled?: boolean, labels?: object, metadata?: object, name?: string, priority?: number, type?: LocationType } | string,
480
+ ...rest: [(object)?, (string)?, (boolean)?, (object)?, (object)?, (string)?, (number)?, (LocationType)?]
264
481
  ): Promise<Models.Location> {
265
- let params: { id: string };
482
+ let params: { id: string, address?: object, code?: string, enabled?: boolean, labels?: object, metadata?: object, name?: string, priority?: number, type?: LocationType };
266
483
 
267
484
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
268
- params = (paramsOrFirst || {}) as { id: string };
485
+ params = (paramsOrFirst || {}) as { id: string, address?: object, code?: string, enabled?: boolean, labels?: object, metadata?: object, name?: string, priority?: number, type?: LocationType };
269
486
  } else {
270
487
  params = {
271
- id: paramsOrFirst as string
488
+ id: paramsOrFirst as string,
489
+ address: rest[0] as object,
490
+ code: rest[1] as string,
491
+ enabled: rest[2] as boolean,
492
+ labels: rest[3] as object,
493
+ metadata: rest[4] as object,
494
+ name: rest[5] as string,
495
+ priority: rest[6] as number,
496
+ type: rest[7] as LocationType
272
497
  };
273
498
  }
274
499
 
275
500
  const id = params.id;
501
+ const address = params.address;
502
+ const code = params.code;
503
+ const enabled = params.enabled;
504
+ const labels = params.labels;
505
+ const metadata = params.metadata;
506
+ const name = params.name;
507
+ const priority = params.priority;
508
+ const type = params.type;
276
509
 
277
510
  if (typeof id === 'undefined') {
278
511
  throw new RevenexxException('Missing required parameter: "id"');
279
512
  }
280
513
 
281
514
  const apiPath = '/v1/inventories/locations/{id}'.replace('{id}', id);
282
- const payload: Payload = {};
515
+ const apiPayload: Payload = {};
516
+ if (typeof address !== 'undefined') {
517
+ apiPayload['address'] = address;
518
+ }
519
+ if (typeof code !== 'undefined') {
520
+ apiPayload['code'] = code;
521
+ }
522
+ if (typeof enabled !== 'undefined') {
523
+ apiPayload['enabled'] = enabled;
524
+ }
525
+ if (typeof labels !== 'undefined') {
526
+ apiPayload['labels'] = labels;
527
+ }
528
+ if (typeof metadata !== 'undefined') {
529
+ apiPayload['metadata'] = metadata;
530
+ }
531
+ if (typeof name !== 'undefined') {
532
+ apiPayload['name'] = name;
533
+ }
534
+ if (typeof priority !== 'undefined') {
535
+ apiPayload['priority'] = priority;
536
+ }
537
+ if (typeof type !== 'undefined') {
538
+ apiPayload['type'] = type;
539
+ }
283
540
  const uri = new URL(this.client.config.endpoint + apiPath);
284
541
 
285
542
  const apiHeaders: { [header: string]: string } = {
@@ -290,7 +547,7 @@ export class Inventories {
290
547
  'put',
291
548
  uri,
292
549
  apiHeaders,
293
- payload
550
+ apiPayload
294
551
  );
295
552
  }
296
553
 
@@ -302,7 +559,7 @@ export class Inventories {
302
559
  inventoriesMovementsList(): Promise<{}> {
303
560
 
304
561
  const apiPath = '/v1/inventories/movements';
305
- const payload: Payload = {};
562
+ const apiPayload: Payload = {};
306
563
  const uri = new URL(this.client.config.endpoint + apiPath);
307
564
 
308
565
  const apiHeaders: { [header: string]: string } = {
@@ -312,7 +569,7 @@ export class Inventories {
312
569
  'get',
313
570
  uri,
314
571
  apiHeaders,
315
- payload
572
+ apiPayload
316
573
  );
317
574
  }
318
575
 
@@ -351,7 +608,7 @@ export class Inventories {
351
608
  }
352
609
 
353
610
  const apiPath = '/v1/inventories/movements/{id}'.replace('{id}', id);
354
- const payload: Payload = {};
611
+ const apiPayload: Payload = {};
355
612
  const uri = new URL(this.client.config.endpoint + apiPath);
356
613
 
357
614
  const apiHeaders: { [header: string]: string } = {
@@ -361,19 +618,64 @@ export class Inventories {
361
618
  'get',
362
619
  uri,
363
620
  apiHeaders,
364
- payload
621
+ apiPayload
365
622
  );
366
623
  }
367
624
 
368
625
  /**
369
626
  *
627
+ * @param {Models.InventoryStockItem[]} params.items - The inbound items (at most 200).
628
+ * @param {string} params.locationCode - Receiving location (default 'main').
629
+ * @param {string} params.reason - Ledger note (e.g. delivery note number).
630
+ * @throws {RevenexxException}
631
+ * @returns {Promise<{}>}
632
+ */
633
+ inventoriesReceive(params: { items: Models.InventoryStockItem[], locationCode?: string, reason?: string }): Promise<{}>;
634
+ /**
635
+ *
636
+ * @param {Models.InventoryStockItem[]} items - The inbound items (at most 200).
637
+ * @param {string} locationCode - Receiving location (default 'main').
638
+ * @param {string} reason - Ledger note (e.g. delivery note number).
370
639
  * @throws {RevenexxException}
371
640
  * @returns {Promise<{}>}
641
+ * @deprecated Use the object parameter style method for a better developer experience.
372
642
  */
373
- inventoriesReceive(): Promise<{}> {
643
+ inventoriesReceive(items: Models.InventoryStockItem[], locationCode?: string, reason?: string): Promise<{}>;
644
+ inventoriesReceive(
645
+ paramsOrFirst: { items: Models.InventoryStockItem[], locationCode?: string, reason?: string } | Models.InventoryStockItem[],
646
+ ...rest: [(string)?, (string)?]
647
+ ): Promise<{}> {
648
+ let params: { items: Models.InventoryStockItem[], locationCode?: string, reason?: string };
649
+
650
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('items' in paramsOrFirst || 'locationCode' in paramsOrFirst || 'reason' in paramsOrFirst))) {
651
+ params = (paramsOrFirst || {}) as { items: Models.InventoryStockItem[], locationCode?: string, reason?: string };
652
+ } else {
653
+ params = {
654
+ items: paramsOrFirst as Models.InventoryStockItem[],
655
+ locationCode: rest[0] as string,
656
+ reason: rest[1] as string
657
+ };
658
+ }
659
+
660
+ const items = params.items;
661
+ const locationCode = params.locationCode;
662
+ const reason = params.reason;
663
+
664
+ if (typeof items === 'undefined') {
665
+ throw new RevenexxException('Missing required parameter: "items"');
666
+ }
374
667
 
375
668
  const apiPath = '/v1/inventories/receive';
376
- const payload: Payload = {};
669
+ const apiPayload: Payload = {};
670
+ if (typeof items !== 'undefined') {
671
+ apiPayload['items'] = items;
672
+ }
673
+ if (typeof locationCode !== 'undefined') {
674
+ apiPayload['location_code'] = locationCode;
675
+ }
676
+ if (typeof reason !== 'undefined') {
677
+ apiPayload['reason'] = reason;
678
+ }
377
679
  const uri = new URL(this.client.config.endpoint + apiPath);
378
680
 
379
681
  const apiHeaders: { [header: string]: string } = {
@@ -384,19 +686,49 @@ export class Inventories {
384
686
  'post',
385
687
  uri,
386
688
  apiHeaders,
387
- payload
689
+ apiPayload
388
690
  );
389
691
  }
390
692
 
391
693
  /**
392
694
  *
695
+ * @param {string} params.orderRef - The order whose active reservations are released.
393
696
  * @throws {RevenexxException}
394
697
  * @returns {Promise<{}>}
395
698
  */
396
- inventoriesRelease(): Promise<{}> {
699
+ inventoriesRelease(params: { orderRef: string }): Promise<{}>;
700
+ /**
701
+ *
702
+ * @param {string} orderRef - The order whose active reservations are released.
703
+ * @throws {RevenexxException}
704
+ * @returns {Promise<{}>}
705
+ * @deprecated Use the object parameter style method for a better developer experience.
706
+ */
707
+ inventoriesRelease(orderRef: string): Promise<{}>;
708
+ inventoriesRelease(
709
+ paramsOrFirst: { orderRef: string } | string
710
+ ): Promise<{}> {
711
+ let params: { orderRef: string };
712
+
713
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
714
+ params = (paramsOrFirst || {}) as { orderRef: string };
715
+ } else {
716
+ params = {
717
+ orderRef: paramsOrFirst as string
718
+ };
719
+ }
720
+
721
+ const orderRef = params.orderRef;
722
+
723
+ if (typeof orderRef === 'undefined') {
724
+ throw new RevenexxException('Missing required parameter: "orderRef"');
725
+ }
397
726
 
398
727
  const apiPath = '/v1/inventories/release';
399
- const payload: Payload = {};
728
+ const apiPayload: Payload = {};
729
+ if (typeof orderRef !== 'undefined') {
730
+ apiPayload['order_ref'] = orderRef;
731
+ }
400
732
  const uri = new URL(this.client.config.endpoint + apiPath);
401
733
 
402
734
  const apiHeaders: { [header: string]: string } = {
@@ -407,7 +739,7 @@ export class Inventories {
407
739
  'post',
408
740
  uri,
409
741
  apiHeaders,
410
- payload
742
+ apiPayload
411
743
  );
412
744
  }
413
745
 
@@ -419,7 +751,7 @@ export class Inventories {
419
751
  inventoriesReservationsList(): Promise<{}> {
420
752
 
421
753
  const apiPath = '/v1/inventories/reservations';
422
- const payload: Payload = {};
754
+ const apiPayload: Payload = {};
423
755
  const uri = new URL(this.client.config.endpoint + apiPath);
424
756
 
425
757
  const apiHeaders: { [header: string]: string } = {
@@ -429,7 +761,7 @@ export class Inventories {
429
761
  'get',
430
762
  uri,
431
763
  apiHeaders,
432
- payload
764
+ apiPayload
433
765
  );
434
766
  }
435
767
 
@@ -468,7 +800,7 @@ export class Inventories {
468
800
  }
469
801
 
470
802
  const apiPath = '/v1/inventories/reservations/{id}'.replace('{id}', id);
471
- const payload: Payload = {};
803
+ const apiPayload: Payload = {};
472
804
  const uri = new URL(this.client.config.endpoint + apiPath);
473
805
 
474
806
  const apiHeaders: { [header: string]: string } = {
@@ -478,19 +810,67 @@ export class Inventories {
478
810
  'get',
479
811
  uri,
480
812
  apiHeaders,
481
- payload
813
+ apiPayload
482
814
  );
483
815
  }
484
816
 
485
817
  /**
486
818
  *
819
+ * @param {Models.InventoryStockItem[]} params.items - The items to reserve — all-or-nothing (at most 200).
820
+ * @param {string} params.orderRef - The order this reservation belongs to.
821
+ * @param {string} params.expiresAt - Optional reservation expiry.
822
+ * @throws {RevenexxException}
823
+ * @returns {Promise<{}>}
824
+ */
825
+ inventoriesReserve(params: { items: Models.InventoryStockItem[], orderRef: string, expiresAt?: string }): Promise<{}>;
826
+ /**
827
+ *
828
+ * @param {Models.InventoryStockItem[]} items - The items to reserve — all-or-nothing (at most 200).
829
+ * @param {string} orderRef - The order this reservation belongs to.
830
+ * @param {string} expiresAt - Optional reservation expiry.
487
831
  * @throws {RevenexxException}
488
832
  * @returns {Promise<{}>}
833
+ * @deprecated Use the object parameter style method for a better developer experience.
489
834
  */
490
- inventoriesReserve(): Promise<{}> {
835
+ inventoriesReserve(items: Models.InventoryStockItem[], orderRef: string, expiresAt?: string): Promise<{}>;
836
+ inventoriesReserve(
837
+ paramsOrFirst: { items: Models.InventoryStockItem[], orderRef: string, expiresAt?: string } | Models.InventoryStockItem[],
838
+ ...rest: [(string)?, (string)?]
839
+ ): Promise<{}> {
840
+ let params: { items: Models.InventoryStockItem[], orderRef: string, expiresAt?: string };
841
+
842
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('items' in paramsOrFirst || 'orderRef' in paramsOrFirst || 'expiresAt' in paramsOrFirst))) {
843
+ params = (paramsOrFirst || {}) as { items: Models.InventoryStockItem[], orderRef: string, expiresAt?: string };
844
+ } else {
845
+ params = {
846
+ items: paramsOrFirst as Models.InventoryStockItem[],
847
+ orderRef: rest[0] as string,
848
+ expiresAt: rest[1] as string
849
+ };
850
+ }
851
+
852
+ const items = params.items;
853
+ const orderRef = params.orderRef;
854
+ const expiresAt = params.expiresAt;
855
+
856
+ if (typeof items === 'undefined') {
857
+ throw new RevenexxException('Missing required parameter: "items"');
858
+ }
859
+ if (typeof orderRef === 'undefined') {
860
+ throw new RevenexxException('Missing required parameter: "orderRef"');
861
+ }
491
862
 
492
863
  const apiPath = '/v1/inventories/reserve';
493
- const payload: Payload = {};
864
+ const apiPayload: Payload = {};
865
+ if (typeof expiresAt !== 'undefined') {
866
+ apiPayload['expires_at'] = expiresAt;
867
+ }
868
+ if (typeof items !== 'undefined') {
869
+ apiPayload['items'] = items;
870
+ }
871
+ if (typeof orderRef !== 'undefined') {
872
+ apiPayload['order_ref'] = orderRef;
873
+ }
494
874
  const uri = new URL(this.client.config.endpoint + apiPath);
495
875
 
496
876
  const apiHeaders: { [header: string]: string } = {
@@ -501,19 +881,71 @@ export class Inventories {
501
881
  'post',
502
882
  uri,
503
883
  apiHeaders,
504
- payload
884
+ apiPayload
505
885
  );
506
886
  }
507
887
 
508
888
  /**
509
889
  *
890
+ * @param {Models.InventoryStockItem[]} params.items - The returned items (at most 200).
891
+ * @param {string} params.locationCode - Restocking location (default 'main').
892
+ * @param {string} params.orderRef - Originating order (ledger reference).
893
+ * @param {string} params.reason - Ledger note (e.g. return reason).
510
894
  * @throws {RevenexxException}
511
895
  * @returns {Promise<{}>}
512
896
  */
513
- inventoriesRestock(): Promise<{}> {
897
+ inventoriesRestock(params: { items: Models.InventoryStockItem[], locationCode?: string, orderRef?: string, reason?: string }): Promise<{}>;
898
+ /**
899
+ *
900
+ * @param {Models.InventoryStockItem[]} items - The returned items (at most 200).
901
+ * @param {string} locationCode - Restocking location (default 'main').
902
+ * @param {string} orderRef - Originating order (ledger reference).
903
+ * @param {string} reason - Ledger note (e.g. return reason).
904
+ * @throws {RevenexxException}
905
+ * @returns {Promise<{}>}
906
+ * @deprecated Use the object parameter style method for a better developer experience.
907
+ */
908
+ inventoriesRestock(items: Models.InventoryStockItem[], locationCode?: string, orderRef?: string, reason?: string): Promise<{}>;
909
+ inventoriesRestock(
910
+ paramsOrFirst: { items: Models.InventoryStockItem[], locationCode?: string, orderRef?: string, reason?: string } | Models.InventoryStockItem[],
911
+ ...rest: [(string)?, (string)?, (string)?]
912
+ ): Promise<{}> {
913
+ let params: { items: Models.InventoryStockItem[], locationCode?: string, orderRef?: string, reason?: string };
914
+
915
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('items' in paramsOrFirst || 'locationCode' in paramsOrFirst || 'orderRef' in paramsOrFirst || 'reason' in paramsOrFirst))) {
916
+ params = (paramsOrFirst || {}) as { items: Models.InventoryStockItem[], locationCode?: string, orderRef?: string, reason?: string };
917
+ } else {
918
+ params = {
919
+ items: paramsOrFirst as Models.InventoryStockItem[],
920
+ locationCode: rest[0] as string,
921
+ orderRef: rest[1] as string,
922
+ reason: rest[2] as string
923
+ };
924
+ }
925
+
926
+ const items = params.items;
927
+ const locationCode = params.locationCode;
928
+ const orderRef = params.orderRef;
929
+ const reason = params.reason;
930
+
931
+ if (typeof items === 'undefined') {
932
+ throw new RevenexxException('Missing required parameter: "items"');
933
+ }
514
934
 
515
935
  const apiPath = '/v1/inventories/restock';
516
- const payload: Payload = {};
936
+ const apiPayload: Payload = {};
937
+ if (typeof items !== 'undefined') {
938
+ apiPayload['items'] = items;
939
+ }
940
+ if (typeof locationCode !== 'undefined') {
941
+ apiPayload['location_code'] = locationCode;
942
+ }
943
+ if (typeof orderRef !== 'undefined') {
944
+ apiPayload['order_ref'] = orderRef;
945
+ }
946
+ if (typeof reason !== 'undefined') {
947
+ apiPayload['reason'] = reason;
948
+ }
517
949
  const uri = new URL(this.client.config.endpoint + apiPath);
518
950
 
519
951
  const apiHeaders: { [header: string]: string } = {
@@ -524,7 +956,7 @@ export class Inventories {
524
956
  'post',
525
957
  uri,
526
958
  apiHeaders,
527
- payload
959
+ apiPayload
528
960
  );
529
961
  }
530
962
 
@@ -536,7 +968,7 @@ export class Inventories {
536
968
  inventoriesStockList(): Promise<{}> {
537
969
 
538
970
  const apiPath = '/v1/inventories/stock';
539
- const payload: Payload = {};
971
+ const apiPayload: Payload = {};
540
972
  const uri = new URL(this.client.config.endpoint + apiPath);
541
973
 
542
974
  const apiHeaders: { [header: string]: string } = {
@@ -546,19 +978,92 @@ export class Inventories {
546
978
  'get',
547
979
  uri,
548
980
  apiHeaders,
549
- payload
981
+ apiPayload
550
982
  );
551
983
  }
552
984
 
553
985
  /**
554
986
  *
987
+ * @param {string} params.locationId - Owning location.
988
+ * @param {object} params.metadata - Free-form metadata.
989
+ * @param {number} params.onHand - Physical stock (default 0).
990
+ * @param {string} params.productId - Tracked product.
991
+ * @param {number} params.reorderPoint -
992
+ * @param {number} params.reserved - Reserved stock (default 0) — normally managed by reserve/release/commit.
993
+ * @param {string} params.sku - Tracked SKU (alternative to product_id).
994
+ * @throws {RevenexxException}
995
+ * @returns {Promise<Models.StockLevel>}
996
+ */
997
+ inventoriesStockCreate(params: { locationId: string, metadata?: object, onHand?: number, productId?: string, reorderPoint?: number, reserved?: number, sku?: string }): Promise<Models.StockLevel>;
998
+ /**
999
+ *
1000
+ * @param {string} locationId - Owning location.
1001
+ * @param {object} metadata - Free-form metadata.
1002
+ * @param {number} onHand - Physical stock (default 0).
1003
+ * @param {string} productId - Tracked product.
1004
+ * @param {number} reorderPoint -
1005
+ * @param {number} reserved - Reserved stock (default 0) — normally managed by reserve/release/commit.
1006
+ * @param {string} sku - Tracked SKU (alternative to product_id).
555
1007
  * @throws {RevenexxException}
556
1008
  * @returns {Promise<Models.StockLevel>}
1009
+ * @deprecated Use the object parameter style method for a better developer experience.
557
1010
  */
558
- inventoriesStockCreate(): Promise<Models.StockLevel> {
1011
+ inventoriesStockCreate(locationId: string, metadata?: object, onHand?: number, productId?: string, reorderPoint?: number, reserved?: number, sku?: string): Promise<Models.StockLevel>;
1012
+ inventoriesStockCreate(
1013
+ paramsOrFirst: { locationId: string, metadata?: object, onHand?: number, productId?: string, reorderPoint?: number, reserved?: number, sku?: string } | string,
1014
+ ...rest: [(object)?, (number)?, (string)?, (number)?, (number)?, (string)?]
1015
+ ): Promise<Models.StockLevel> {
1016
+ let params: { locationId: string, metadata?: object, onHand?: number, productId?: string, reorderPoint?: number, reserved?: number, sku?: string };
1017
+
1018
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1019
+ params = (paramsOrFirst || {}) as { locationId: string, metadata?: object, onHand?: number, productId?: string, reorderPoint?: number, reserved?: number, sku?: string };
1020
+ } else {
1021
+ params = {
1022
+ locationId: paramsOrFirst as string,
1023
+ metadata: rest[0] as object,
1024
+ onHand: rest[1] as number,
1025
+ productId: rest[2] as string,
1026
+ reorderPoint: rest[3] as number,
1027
+ reserved: rest[4] as number,
1028
+ sku: rest[5] as string
1029
+ };
1030
+ }
1031
+
1032
+ const locationId = params.locationId;
1033
+ const metadata = params.metadata;
1034
+ const onHand = params.onHand;
1035
+ const productId = params.productId;
1036
+ const reorderPoint = params.reorderPoint;
1037
+ const reserved = params.reserved;
1038
+ const sku = params.sku;
1039
+
1040
+ if (typeof locationId === 'undefined') {
1041
+ throw new RevenexxException('Missing required parameter: "locationId"');
1042
+ }
559
1043
 
560
1044
  const apiPath = '/v1/inventories/stock';
561
- const payload: Payload = {};
1045
+ const apiPayload: Payload = {};
1046
+ if (typeof locationId !== 'undefined') {
1047
+ apiPayload['location_id'] = locationId;
1048
+ }
1049
+ if (typeof metadata !== 'undefined') {
1050
+ apiPayload['metadata'] = metadata;
1051
+ }
1052
+ if (typeof onHand !== 'undefined') {
1053
+ apiPayload['on_hand'] = onHand;
1054
+ }
1055
+ if (typeof productId !== 'undefined') {
1056
+ apiPayload['product_id'] = productId;
1057
+ }
1058
+ if (typeof reorderPoint !== 'undefined') {
1059
+ apiPayload['reorder_point'] = reorderPoint;
1060
+ }
1061
+ if (typeof reserved !== 'undefined') {
1062
+ apiPayload['reserved'] = reserved;
1063
+ }
1064
+ if (typeof sku !== 'undefined') {
1065
+ apiPayload['sku'] = sku;
1066
+ }
562
1067
  const uri = new URL(this.client.config.endpoint + apiPath);
563
1068
 
564
1069
  const apiHeaders: { [header: string]: string } = {
@@ -569,7 +1074,7 @@ export class Inventories {
569
1074
  'post',
570
1075
  uri,
571
1076
  apiHeaders,
572
- payload
1077
+ apiPayload
573
1078
  );
574
1079
  }
575
1080
 
@@ -608,7 +1113,7 @@ export class Inventories {
608
1113
  }
609
1114
 
610
1115
  const apiPath = '/v1/inventories/stock/{id}'.replace('{id}', id);
611
- const payload: Payload = {};
1116
+ const apiPayload: Payload = {};
612
1117
  const uri = new URL(this.client.config.endpoint + apiPath);
613
1118
 
614
1119
  const apiHeaders: { [header: string]: string } = {
@@ -618,7 +1123,7 @@ export class Inventories {
618
1123
  'delete',
619
1124
  uri,
620
1125
  apiHeaders,
621
- payload
1126
+ apiPayload
622
1127
  );
623
1128
  }
624
1129
 
@@ -657,7 +1162,7 @@ export class Inventories {
657
1162
  }
658
1163
 
659
1164
  const apiPath = '/v1/inventories/stock/{id}'.replace('{id}', id);
660
- const payload: Payload = {};
1165
+ const apiPayload: Payload = {};
661
1166
  const uri = new URL(this.client.config.endpoint + apiPath);
662
1167
 
663
1168
  const apiHeaders: { [header: string]: string } = {
@@ -667,46 +1172,96 @@ export class Inventories {
667
1172
  'get',
668
1173
  uri,
669
1174
  apiHeaders,
670
- payload
1175
+ apiPayload
671
1176
  );
672
1177
  }
673
1178
 
674
1179
  /**
675
1180
  *
676
1181
  * @param {string} params.id -
1182
+ * @param {string} params.locationId - Owning location.
1183
+ * @param {object} params.metadata - Free-form metadata.
1184
+ * @param {number} params.onHand - Physical stock (default 0).
1185
+ * @param {string} params.productId - Tracked product.
1186
+ * @param {number} params.reorderPoint -
1187
+ * @param {number} params.reserved - Reserved stock (default 0) — normally managed by reserve/release/commit.
1188
+ * @param {string} params.sku - Tracked SKU (alternative to product_id).
677
1189
  * @throws {RevenexxException}
678
1190
  * @returns {Promise<Models.StockLevel>}
679
1191
  */
680
- inventoriesStockUpdate(params: { id: string }): Promise<Models.StockLevel>;
1192
+ inventoriesStockUpdate(params: { id: string, locationId?: string, metadata?: object, onHand?: number, productId?: string, reorderPoint?: number, reserved?: number, sku?: string }): Promise<Models.StockLevel>;
681
1193
  /**
682
1194
  *
683
1195
  * @param {string} id -
1196
+ * @param {string} locationId - Owning location.
1197
+ * @param {object} metadata - Free-form metadata.
1198
+ * @param {number} onHand - Physical stock (default 0).
1199
+ * @param {string} productId - Tracked product.
1200
+ * @param {number} reorderPoint -
1201
+ * @param {number} reserved - Reserved stock (default 0) — normally managed by reserve/release/commit.
1202
+ * @param {string} sku - Tracked SKU (alternative to product_id).
684
1203
  * @throws {RevenexxException}
685
1204
  * @returns {Promise<Models.StockLevel>}
686
1205
  * @deprecated Use the object parameter style method for a better developer experience.
687
1206
  */
688
- inventoriesStockUpdate(id: string): Promise<Models.StockLevel>;
1207
+ inventoriesStockUpdate(id: string, locationId?: string, metadata?: object, onHand?: number, productId?: string, reorderPoint?: number, reserved?: number, sku?: string): Promise<Models.StockLevel>;
689
1208
  inventoriesStockUpdate(
690
- paramsOrFirst: { id: string } | string
1209
+ paramsOrFirst: { id: string, locationId?: string, metadata?: object, onHand?: number, productId?: string, reorderPoint?: number, reserved?: number, sku?: string } | string,
1210
+ ...rest: [(string)?, (object)?, (number)?, (string)?, (number)?, (number)?, (string)?]
691
1211
  ): Promise<Models.StockLevel> {
692
- let params: { id: string };
1212
+ let params: { id: string, locationId?: string, metadata?: object, onHand?: number, productId?: string, reorderPoint?: number, reserved?: number, sku?: string };
693
1213
 
694
1214
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
695
- params = (paramsOrFirst || {}) as { id: string };
1215
+ params = (paramsOrFirst || {}) as { id: string, locationId?: string, metadata?: object, onHand?: number, productId?: string, reorderPoint?: number, reserved?: number, sku?: string };
696
1216
  } else {
697
1217
  params = {
698
- id: paramsOrFirst as string
1218
+ id: paramsOrFirst as string,
1219
+ locationId: rest[0] as string,
1220
+ metadata: rest[1] as object,
1221
+ onHand: rest[2] as number,
1222
+ productId: rest[3] as string,
1223
+ reorderPoint: rest[4] as number,
1224
+ reserved: rest[5] as number,
1225
+ sku: rest[6] as string
699
1226
  };
700
1227
  }
701
1228
 
702
1229
  const id = params.id;
1230
+ const locationId = params.locationId;
1231
+ const metadata = params.metadata;
1232
+ const onHand = params.onHand;
1233
+ const productId = params.productId;
1234
+ const reorderPoint = params.reorderPoint;
1235
+ const reserved = params.reserved;
1236
+ const sku = params.sku;
703
1237
 
704
1238
  if (typeof id === 'undefined') {
705
1239
  throw new RevenexxException('Missing required parameter: "id"');
706
1240
  }
707
1241
 
708
1242
  const apiPath = '/v1/inventories/stock/{id}'.replace('{id}', id);
709
- const payload: Payload = {};
1243
+ const apiPayload: Payload = {};
1244
+ if (typeof locationId !== 'undefined') {
1245
+ apiPayload['location_id'] = locationId;
1246
+ }
1247
+ if (typeof metadata !== 'undefined') {
1248
+ apiPayload['metadata'] = metadata;
1249
+ }
1250
+ if (typeof onHand !== 'undefined') {
1251
+ apiPayload['on_hand'] = onHand;
1252
+ }
1253
+ if (typeof productId !== 'undefined') {
1254
+ apiPayload['product_id'] = productId;
1255
+ }
1256
+ if (typeof reorderPoint !== 'undefined') {
1257
+ apiPayload['reorder_point'] = reorderPoint;
1258
+ }
1259
+ if (typeof reserved !== 'undefined') {
1260
+ apiPayload['reserved'] = reserved;
1261
+ }
1262
+ if (typeof sku !== 'undefined') {
1263
+ apiPayload['sku'] = sku;
1264
+ }
710
1265
  const uri = new URL(this.client.config.endpoint + apiPath);
711
1266
 
712
1267
  const apiHeaders: { [header: string]: string } = {
@@ -717,7 +1272,7 @@ export class Inventories {
717
1272
  'put',
718
1273
  uri,
719
1274
  apiHeaders,
720
- payload
1275
+ apiPayload
721
1276
  );
722
1277
  }
723
1278
  }