@revenexx/sdk 0.0.5 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/sdk.js +7188 -5721
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +7185 -5720
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +7188 -5721
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/enums/order-list-kind.ts +4 -0
- package/src/enums/store-asset-request-visibility.ts +4 -0
- package/src/enums/visibility.ts +4 -0
- package/src/index.ts +4 -2
- package/src/models.ts +1232 -294
- package/src/services/customers.ts +14 -6
- package/src/services/markets.ts +317 -0
- package/src/services/orderlists.ts +889 -0
- package/src/services/pages.ts +293 -7
- package/src/services/prices.ts +70 -9
- package/src/services/products.ts +86 -14
- package/src/services/shipping.ts +26 -19
- package/src/services/storage.ts +910 -576
- package/types/enums/order-list-kind.d.ts +4 -0
- package/types/enums/store-asset-request-visibility.d.ts +4 -0
- package/types/enums/visibility.d.ts +4 -0
- package/types/index.d.ts +4 -2
- package/types/models.d.ts +1199 -283
- package/types/services/customers.d.ts +4 -1
- package/types/services/markets.d.ts +112 -0
- package/types/services/orderlists.d.ts +324 -0
- package/types/services/pages.d.ts +96 -1
- package/types/services/prices.d.ts +24 -4
- package/types/services/products.d.ts +28 -2
- package/types/services/shipping.d.ts +8 -5
- package/types/services/storage.d.ts +353 -285
|
@@ -0,0 +1,889 @@
|
|
|
1
|
+
import { Service } from '../service';
|
|
2
|
+
import { RevenexxException, Client, type Payload, UploadProgress } from '../client';
|
|
3
|
+
import type { Models } from '../models';
|
|
4
|
+
|
|
5
|
+
import { OrderListKind } from '../enums/order-list-kind';
|
|
6
|
+
|
|
7
|
+
export class Orderlists {
|
|
8
|
+
client: Client;
|
|
9
|
+
|
|
10
|
+
constructor(client: Client) {
|
|
11
|
+
this.client = client;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @throws {RevenexxException}
|
|
17
|
+
* @returns {Promise<{}>}
|
|
18
|
+
*/
|
|
19
|
+
orderlistsList(): Promise<{}> {
|
|
20
|
+
|
|
21
|
+
const apiPath = '/v1/orderlists';
|
|
22
|
+
const apiPayload: Payload = {};
|
|
23
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
24
|
+
|
|
25
|
+
const apiHeaders: { [header: string]: string } = {
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return this.client.call(
|
|
29
|
+
'get',
|
|
30
|
+
uri,
|
|
31
|
+
apiHeaders,
|
|
32
|
+
apiPayload
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @param {string} params.name -
|
|
39
|
+
* @param {string} params.ownerId - Owning contact.
|
|
40
|
+
* @param {string} params.ownerName - Owner display name (snapshot).
|
|
41
|
+
* @param {Models.OrderListItemInput[]} params.items - Optional initial positions.
|
|
42
|
+
* @param {OrderListKind} params.kind - List kind (default 'shopping').
|
|
43
|
+
* @param {object} params.metadata -
|
|
44
|
+
* @param {string} params.organizationId - Owning organization (scopes public sharing).
|
|
45
|
+
* @param {boolean} params.shared - Shared read-only across the organization (default false).
|
|
46
|
+
* @throws {RevenexxException}
|
|
47
|
+
* @returns {Promise<Models.OrderListWithItems>}
|
|
48
|
+
*/
|
|
49
|
+
orderlistsCreate(params: { name: string, ownerId: string, ownerName: string, items?: Models.OrderListItemInput[], kind?: OrderListKind, metadata?: object, organizationId?: string, shared?: boolean }): Promise<Models.OrderListWithItems>;
|
|
50
|
+
/**
|
|
51
|
+
*
|
|
52
|
+
* @param {string} name -
|
|
53
|
+
* @param {string} ownerId - Owning contact.
|
|
54
|
+
* @param {string} ownerName - Owner display name (snapshot).
|
|
55
|
+
* @param {Models.OrderListItemInput[]} items - Optional initial positions.
|
|
56
|
+
* @param {OrderListKind} kind - List kind (default 'shopping').
|
|
57
|
+
* @param {object} metadata -
|
|
58
|
+
* @param {string} organizationId - Owning organization (scopes public sharing).
|
|
59
|
+
* @param {boolean} shared - Shared read-only across the organization (default false).
|
|
60
|
+
* @throws {RevenexxException}
|
|
61
|
+
* @returns {Promise<Models.OrderListWithItems>}
|
|
62
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
63
|
+
*/
|
|
64
|
+
orderlistsCreate(name: string, ownerId: string, ownerName: string, items?: Models.OrderListItemInput[], kind?: OrderListKind, metadata?: object, organizationId?: string, shared?: boolean): Promise<Models.OrderListWithItems>;
|
|
65
|
+
orderlistsCreate(
|
|
66
|
+
paramsOrFirst: { name: string, ownerId: string, ownerName: string, items?: Models.OrderListItemInput[], kind?: OrderListKind, metadata?: object, organizationId?: string, shared?: boolean } | string,
|
|
67
|
+
...rest: [(string)?, (string)?, (Models.OrderListItemInput[])?, (OrderListKind)?, (object)?, (string)?, (boolean)?]
|
|
68
|
+
): Promise<Models.OrderListWithItems> {
|
|
69
|
+
let params: { name: string, ownerId: string, ownerName: string, items?: Models.OrderListItemInput[], kind?: OrderListKind, metadata?: object, organizationId?: string, shared?: boolean };
|
|
70
|
+
|
|
71
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
72
|
+
params = (paramsOrFirst || {}) as { name: string, ownerId: string, ownerName: string, items?: Models.OrderListItemInput[], kind?: OrderListKind, metadata?: object, organizationId?: string, shared?: boolean };
|
|
73
|
+
} else {
|
|
74
|
+
params = {
|
|
75
|
+
name: paramsOrFirst as string,
|
|
76
|
+
ownerId: rest[0] as string,
|
|
77
|
+
ownerName: rest[1] as string,
|
|
78
|
+
items: rest[2] as Models.OrderListItemInput[],
|
|
79
|
+
kind: rest[3] as OrderListKind,
|
|
80
|
+
metadata: rest[4] as object,
|
|
81
|
+
organizationId: rest[5] as string,
|
|
82
|
+
shared: rest[6] as boolean
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const name = params.name;
|
|
87
|
+
const ownerId = params.ownerId;
|
|
88
|
+
const ownerName = params.ownerName;
|
|
89
|
+
const items = params.items;
|
|
90
|
+
const kind = params.kind;
|
|
91
|
+
const metadata = params.metadata;
|
|
92
|
+
const organizationId = params.organizationId;
|
|
93
|
+
const shared = params.shared;
|
|
94
|
+
|
|
95
|
+
if (typeof name === 'undefined') {
|
|
96
|
+
throw new RevenexxException('Missing required parameter: "name"');
|
|
97
|
+
}
|
|
98
|
+
if (typeof ownerId === 'undefined') {
|
|
99
|
+
throw new RevenexxException('Missing required parameter: "ownerId"');
|
|
100
|
+
}
|
|
101
|
+
if (typeof ownerName === 'undefined') {
|
|
102
|
+
throw new RevenexxException('Missing required parameter: "ownerName"');
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const apiPath = '/v1/orderlists';
|
|
106
|
+
const apiPayload: Payload = {};
|
|
107
|
+
if (typeof items !== 'undefined') {
|
|
108
|
+
apiPayload['items'] = items;
|
|
109
|
+
}
|
|
110
|
+
if (typeof kind !== 'undefined') {
|
|
111
|
+
apiPayload['kind'] = kind;
|
|
112
|
+
}
|
|
113
|
+
if (typeof metadata !== 'undefined') {
|
|
114
|
+
apiPayload['metadata'] = metadata;
|
|
115
|
+
}
|
|
116
|
+
if (typeof name !== 'undefined') {
|
|
117
|
+
apiPayload['name'] = name;
|
|
118
|
+
}
|
|
119
|
+
if (typeof organizationId !== 'undefined') {
|
|
120
|
+
apiPayload['organization_id'] = organizationId;
|
|
121
|
+
}
|
|
122
|
+
if (typeof ownerId !== 'undefined') {
|
|
123
|
+
apiPayload['owner_id'] = ownerId;
|
|
124
|
+
}
|
|
125
|
+
if (typeof ownerName !== 'undefined') {
|
|
126
|
+
apiPayload['owner_name'] = ownerName;
|
|
127
|
+
}
|
|
128
|
+
if (typeof shared !== 'undefined') {
|
|
129
|
+
apiPayload['shared'] = shared;
|
|
130
|
+
}
|
|
131
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
132
|
+
|
|
133
|
+
const apiHeaders: { [header: string]: string } = {
|
|
134
|
+
'content-type': 'application/json',
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return this.client.call(
|
|
138
|
+
'post',
|
|
139
|
+
uri,
|
|
140
|
+
apiHeaders,
|
|
141
|
+
apiPayload
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
*
|
|
147
|
+
* @throws {RevenexxException}
|
|
148
|
+
* @returns {Promise<{}>}
|
|
149
|
+
*/
|
|
150
|
+
orderlistsDefaults(): Promise<{}> {
|
|
151
|
+
|
|
152
|
+
const apiPath = '/v1/orderlists/defaults';
|
|
153
|
+
const apiPayload: Payload = {};
|
|
154
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
155
|
+
|
|
156
|
+
const apiHeaders: { [header: string]: string } = {
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
return this.client.call(
|
|
160
|
+
'post',
|
|
161
|
+
uri,
|
|
162
|
+
apiHeaders,
|
|
163
|
+
apiPayload
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
*
|
|
169
|
+
* @param {string} params.id -
|
|
170
|
+
* @throws {RevenexxException}
|
|
171
|
+
* @returns {Promise<{}>}
|
|
172
|
+
*/
|
|
173
|
+
orderlistsDelete(params: { id: string }): Promise<{}>;
|
|
174
|
+
/**
|
|
175
|
+
*
|
|
176
|
+
* @param {string} id -
|
|
177
|
+
* @throws {RevenexxException}
|
|
178
|
+
* @returns {Promise<{}>}
|
|
179
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
180
|
+
*/
|
|
181
|
+
orderlistsDelete(id: string): Promise<{}>;
|
|
182
|
+
orderlistsDelete(
|
|
183
|
+
paramsOrFirst: { id: string } | string
|
|
184
|
+
): Promise<{}> {
|
|
185
|
+
let params: { id: string };
|
|
186
|
+
|
|
187
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
188
|
+
params = (paramsOrFirst || {}) as { id: string };
|
|
189
|
+
} else {
|
|
190
|
+
params = {
|
|
191
|
+
id: paramsOrFirst as string
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const id = params.id;
|
|
196
|
+
|
|
197
|
+
if (typeof id === 'undefined') {
|
|
198
|
+
throw new RevenexxException('Missing required parameter: "id"');
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
const apiPath = '/v1/orderlists/{id}'.replace('{id}', id);
|
|
202
|
+
const apiPayload: Payload = {};
|
|
203
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
204
|
+
|
|
205
|
+
const apiHeaders: { [header: string]: string } = {
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
return this.client.call(
|
|
209
|
+
'delete',
|
|
210
|
+
uri,
|
|
211
|
+
apiHeaders,
|
|
212
|
+
apiPayload
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
*
|
|
218
|
+
* @param {string} params.id -
|
|
219
|
+
* @throws {RevenexxException}
|
|
220
|
+
* @returns {Promise<Models.OrderListWithItems>}
|
|
221
|
+
*/
|
|
222
|
+
orderlistsGet(params: { id: string }): Promise<Models.OrderListWithItems>;
|
|
223
|
+
/**
|
|
224
|
+
*
|
|
225
|
+
* @param {string} id -
|
|
226
|
+
* @throws {RevenexxException}
|
|
227
|
+
* @returns {Promise<Models.OrderListWithItems>}
|
|
228
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
229
|
+
*/
|
|
230
|
+
orderlistsGet(id: string): Promise<Models.OrderListWithItems>;
|
|
231
|
+
orderlistsGet(
|
|
232
|
+
paramsOrFirst: { id: string } | string
|
|
233
|
+
): Promise<Models.OrderListWithItems> {
|
|
234
|
+
let params: { id: string };
|
|
235
|
+
|
|
236
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
237
|
+
params = (paramsOrFirst || {}) as { id: string };
|
|
238
|
+
} else {
|
|
239
|
+
params = {
|
|
240
|
+
id: paramsOrFirst as string
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
const id = params.id;
|
|
245
|
+
|
|
246
|
+
if (typeof id === 'undefined') {
|
|
247
|
+
throw new RevenexxException('Missing required parameter: "id"');
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
const apiPath = '/v1/orderlists/{id}'.replace('{id}', id);
|
|
251
|
+
const apiPayload: Payload = {};
|
|
252
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
253
|
+
|
|
254
|
+
const apiHeaders: { [header: string]: string } = {
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
return this.client.call(
|
|
258
|
+
'get',
|
|
259
|
+
uri,
|
|
260
|
+
apiHeaders,
|
|
261
|
+
apiPayload
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
*
|
|
267
|
+
* @param {string} params.id -
|
|
268
|
+
* @param {OrderListKind} params.kind - List kind (default 'shopping').
|
|
269
|
+
* @param {object} params.metadata -
|
|
270
|
+
* @param {string} params.name -
|
|
271
|
+
* @param {boolean} params.shared -
|
|
272
|
+
* @throws {RevenexxException}
|
|
273
|
+
* @returns {Promise<Models.OrderListWithItems>}
|
|
274
|
+
*/
|
|
275
|
+
orderlistsUpdate(params: { id: string, kind?: OrderListKind, metadata?: object, name?: string, shared?: boolean }): Promise<Models.OrderListWithItems>;
|
|
276
|
+
/**
|
|
277
|
+
*
|
|
278
|
+
* @param {string} id -
|
|
279
|
+
* @param {OrderListKind} kind - List kind (default 'shopping').
|
|
280
|
+
* @param {object} metadata -
|
|
281
|
+
* @param {string} name -
|
|
282
|
+
* @param {boolean} shared -
|
|
283
|
+
* @throws {RevenexxException}
|
|
284
|
+
* @returns {Promise<Models.OrderListWithItems>}
|
|
285
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
286
|
+
*/
|
|
287
|
+
orderlistsUpdate(id: string, kind?: OrderListKind, metadata?: object, name?: string, shared?: boolean): Promise<Models.OrderListWithItems>;
|
|
288
|
+
orderlistsUpdate(
|
|
289
|
+
paramsOrFirst: { id: string, kind?: OrderListKind, metadata?: object, name?: string, shared?: boolean } | string,
|
|
290
|
+
...rest: [(OrderListKind)?, (object)?, (string)?, (boolean)?]
|
|
291
|
+
): Promise<Models.OrderListWithItems> {
|
|
292
|
+
let params: { id: string, kind?: OrderListKind, metadata?: object, name?: string, shared?: boolean };
|
|
293
|
+
|
|
294
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
295
|
+
params = (paramsOrFirst || {}) as { id: string, kind?: OrderListKind, metadata?: object, name?: string, shared?: boolean };
|
|
296
|
+
} else {
|
|
297
|
+
params = {
|
|
298
|
+
id: paramsOrFirst as string,
|
|
299
|
+
kind: rest[0] as OrderListKind,
|
|
300
|
+
metadata: rest[1] as object,
|
|
301
|
+
name: rest[2] as string,
|
|
302
|
+
shared: rest[3] as boolean
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
const id = params.id;
|
|
307
|
+
const kind = params.kind;
|
|
308
|
+
const metadata = params.metadata;
|
|
309
|
+
const name = params.name;
|
|
310
|
+
const shared = params.shared;
|
|
311
|
+
|
|
312
|
+
if (typeof id === 'undefined') {
|
|
313
|
+
throw new RevenexxException('Missing required parameter: "id"');
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
const apiPath = '/v1/orderlists/{id}'.replace('{id}', id);
|
|
317
|
+
const apiPayload: Payload = {};
|
|
318
|
+
if (typeof kind !== 'undefined') {
|
|
319
|
+
apiPayload['kind'] = kind;
|
|
320
|
+
}
|
|
321
|
+
if (typeof metadata !== 'undefined') {
|
|
322
|
+
apiPayload['metadata'] = metadata;
|
|
323
|
+
}
|
|
324
|
+
if (typeof name !== 'undefined') {
|
|
325
|
+
apiPayload['name'] = name;
|
|
326
|
+
}
|
|
327
|
+
if (typeof shared !== 'undefined') {
|
|
328
|
+
apiPayload['shared'] = shared;
|
|
329
|
+
}
|
|
330
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
331
|
+
|
|
332
|
+
const apiHeaders: { [header: string]: string } = {
|
|
333
|
+
'content-type': 'application/json',
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
return this.client.call(
|
|
337
|
+
'put',
|
|
338
|
+
uri,
|
|
339
|
+
apiHeaders,
|
|
340
|
+
apiPayload
|
|
341
|
+
);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
*
|
|
346
|
+
* @param {string} params.listId -
|
|
347
|
+
* @throws {RevenexxException}
|
|
348
|
+
* @returns {Promise<{}>}
|
|
349
|
+
*/
|
|
350
|
+
orderlistsItemsList(params: { listId: string }): Promise<{}>;
|
|
351
|
+
/**
|
|
352
|
+
*
|
|
353
|
+
* @param {string} listId -
|
|
354
|
+
* @throws {RevenexxException}
|
|
355
|
+
* @returns {Promise<{}>}
|
|
356
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
357
|
+
*/
|
|
358
|
+
orderlistsItemsList(listId: string): Promise<{}>;
|
|
359
|
+
orderlistsItemsList(
|
|
360
|
+
paramsOrFirst: { listId: string } | string
|
|
361
|
+
): Promise<{}> {
|
|
362
|
+
let params: { listId: string };
|
|
363
|
+
|
|
364
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
365
|
+
params = (paramsOrFirst || {}) as { listId: string };
|
|
366
|
+
} else {
|
|
367
|
+
params = {
|
|
368
|
+
listId: paramsOrFirst as string
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
const listId = params.listId;
|
|
373
|
+
|
|
374
|
+
if (typeof listId === 'undefined') {
|
|
375
|
+
throw new RevenexxException('Missing required parameter: "listId"');
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
const apiPath = '/v1/orderlists/{list_id}/items'.replace('{list_id}', listId);
|
|
379
|
+
const apiPayload: Payload = {};
|
|
380
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
381
|
+
|
|
382
|
+
const apiHeaders: { [header: string]: string } = {
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
return this.client.call(
|
|
386
|
+
'get',
|
|
387
|
+
uri,
|
|
388
|
+
apiHeaders,
|
|
389
|
+
apiPayload
|
|
390
|
+
);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
*
|
|
395
|
+
* @param {string} params.listId -
|
|
396
|
+
* @param {string} params.name - Display name (snapshot).
|
|
397
|
+
* @param {string} params.categorySlug -
|
|
398
|
+
* @param {string} params.costCenterId - Cost center reference (free-text).
|
|
399
|
+
* @param {string} params.customSku - Customer's own article number.
|
|
400
|
+
* @param {string} params.image -
|
|
401
|
+
* @param {object} params.metadata -
|
|
402
|
+
* @param {number} params.position - Sort order (assigned automatically when omitted).
|
|
403
|
+
* @param {string[]} params.positionTexts - Per-position notes.
|
|
404
|
+
* @param {number} params.price - Unit price snapshot.
|
|
405
|
+
* @param {string} params.productId - Catalog product (alternative to sku).
|
|
406
|
+
* @param {number} params.quantity - Default 1.
|
|
407
|
+
* @param {string} params.sku - Article SKU (alternative to product_id).
|
|
408
|
+
* @param {string} params.subcategorySlug -
|
|
409
|
+
* @param {number} params.taxRate -
|
|
410
|
+
* @param {string} params.unit -
|
|
411
|
+
* @throws {RevenexxException}
|
|
412
|
+
* @returns {Promise<Models.OrderListItem>}
|
|
413
|
+
*/
|
|
414
|
+
orderlistsItemsCreate(params: { listId: string, name: string, categorySlug?: string, costCenterId?: string, customSku?: string, image?: string, metadata?: object, position?: number, positionTexts?: string[], price?: number, productId?: string, quantity?: number, sku?: string, subcategorySlug?: string, taxRate?: number, unit?: string }): Promise<Models.OrderListItem>;
|
|
415
|
+
/**
|
|
416
|
+
*
|
|
417
|
+
* @param {string} listId -
|
|
418
|
+
* @param {string} name - Display name (snapshot).
|
|
419
|
+
* @param {string} categorySlug -
|
|
420
|
+
* @param {string} costCenterId - Cost center reference (free-text).
|
|
421
|
+
* @param {string} customSku - Customer's own article number.
|
|
422
|
+
* @param {string} image -
|
|
423
|
+
* @param {object} metadata -
|
|
424
|
+
* @param {number} position - Sort order (assigned automatically when omitted).
|
|
425
|
+
* @param {string[]} positionTexts - Per-position notes.
|
|
426
|
+
* @param {number} price - Unit price snapshot.
|
|
427
|
+
* @param {string} productId - Catalog product (alternative to sku).
|
|
428
|
+
* @param {number} quantity - Default 1.
|
|
429
|
+
* @param {string} sku - Article SKU (alternative to product_id).
|
|
430
|
+
* @param {string} subcategorySlug -
|
|
431
|
+
* @param {number} taxRate -
|
|
432
|
+
* @param {string} unit -
|
|
433
|
+
* @throws {RevenexxException}
|
|
434
|
+
* @returns {Promise<Models.OrderListItem>}
|
|
435
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
436
|
+
*/
|
|
437
|
+
orderlistsItemsCreate(listId: string, name: string, categorySlug?: string, costCenterId?: string, customSku?: string, image?: string, metadata?: object, position?: number, positionTexts?: string[], price?: number, productId?: string, quantity?: number, sku?: string, subcategorySlug?: string, taxRate?: number, unit?: string): Promise<Models.OrderListItem>;
|
|
438
|
+
orderlistsItemsCreate(
|
|
439
|
+
paramsOrFirst: { listId: string, name: string, categorySlug?: string, costCenterId?: string, customSku?: string, image?: string, metadata?: object, position?: number, positionTexts?: string[], price?: number, productId?: string, quantity?: number, sku?: string, subcategorySlug?: string, taxRate?: number, unit?: string } | string,
|
|
440
|
+
...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (object)?, (number)?, (string[])?, (number)?, (string)?, (number)?, (string)?, (string)?, (number)?, (string)?]
|
|
441
|
+
): Promise<Models.OrderListItem> {
|
|
442
|
+
let params: { listId: string, name: string, categorySlug?: string, costCenterId?: string, customSku?: string, image?: string, metadata?: object, position?: number, positionTexts?: string[], price?: number, productId?: string, quantity?: number, sku?: string, subcategorySlug?: string, taxRate?: number, unit?: string };
|
|
443
|
+
|
|
444
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
445
|
+
params = (paramsOrFirst || {}) as { listId: string, name: string, categorySlug?: string, costCenterId?: string, customSku?: string, image?: string, metadata?: object, position?: number, positionTexts?: string[], price?: number, productId?: string, quantity?: number, sku?: string, subcategorySlug?: string, taxRate?: number, unit?: string };
|
|
446
|
+
} else {
|
|
447
|
+
params = {
|
|
448
|
+
listId: paramsOrFirst as string,
|
|
449
|
+
name: rest[0] as string,
|
|
450
|
+
categorySlug: rest[1] as string,
|
|
451
|
+
costCenterId: rest[2] as string,
|
|
452
|
+
customSku: rest[3] as string,
|
|
453
|
+
image: rest[4] as string,
|
|
454
|
+
metadata: rest[5] as object,
|
|
455
|
+
position: rest[6] as number,
|
|
456
|
+
positionTexts: rest[7] as string[],
|
|
457
|
+
price: rest[8] as number,
|
|
458
|
+
productId: rest[9] as string,
|
|
459
|
+
quantity: rest[10] as number,
|
|
460
|
+
sku: rest[11] as string,
|
|
461
|
+
subcategorySlug: rest[12] as string,
|
|
462
|
+
taxRate: rest[13] as number,
|
|
463
|
+
unit: rest[14] as string
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
const listId = params.listId;
|
|
468
|
+
const name = params.name;
|
|
469
|
+
const categorySlug = params.categorySlug;
|
|
470
|
+
const costCenterId = params.costCenterId;
|
|
471
|
+
const customSku = params.customSku;
|
|
472
|
+
const image = params.image;
|
|
473
|
+
const metadata = params.metadata;
|
|
474
|
+
const position = params.position;
|
|
475
|
+
const positionTexts = params.positionTexts;
|
|
476
|
+
const price = params.price;
|
|
477
|
+
const productId = params.productId;
|
|
478
|
+
const quantity = params.quantity;
|
|
479
|
+
const sku = params.sku;
|
|
480
|
+
const subcategorySlug = params.subcategorySlug;
|
|
481
|
+
const taxRate = params.taxRate;
|
|
482
|
+
const unit = params.unit;
|
|
483
|
+
|
|
484
|
+
if (typeof listId === 'undefined') {
|
|
485
|
+
throw new RevenexxException('Missing required parameter: "listId"');
|
|
486
|
+
}
|
|
487
|
+
if (typeof name === 'undefined') {
|
|
488
|
+
throw new RevenexxException('Missing required parameter: "name"');
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
const apiPath = '/v1/orderlists/{list_id}/items'.replace('{list_id}', listId);
|
|
492
|
+
const apiPayload: Payload = {};
|
|
493
|
+
if (typeof categorySlug !== 'undefined') {
|
|
494
|
+
apiPayload['category_slug'] = categorySlug;
|
|
495
|
+
}
|
|
496
|
+
if (typeof costCenterId !== 'undefined') {
|
|
497
|
+
apiPayload['cost_center_id'] = costCenterId;
|
|
498
|
+
}
|
|
499
|
+
if (typeof customSku !== 'undefined') {
|
|
500
|
+
apiPayload['custom_sku'] = customSku;
|
|
501
|
+
}
|
|
502
|
+
if (typeof image !== 'undefined') {
|
|
503
|
+
apiPayload['image'] = image;
|
|
504
|
+
}
|
|
505
|
+
if (typeof metadata !== 'undefined') {
|
|
506
|
+
apiPayload['metadata'] = metadata;
|
|
507
|
+
}
|
|
508
|
+
if (typeof name !== 'undefined') {
|
|
509
|
+
apiPayload['name'] = name;
|
|
510
|
+
}
|
|
511
|
+
if (typeof position !== 'undefined') {
|
|
512
|
+
apiPayload['position'] = position;
|
|
513
|
+
}
|
|
514
|
+
if (typeof positionTexts !== 'undefined') {
|
|
515
|
+
apiPayload['position_texts'] = positionTexts;
|
|
516
|
+
}
|
|
517
|
+
if (typeof price !== 'undefined') {
|
|
518
|
+
apiPayload['price'] = price;
|
|
519
|
+
}
|
|
520
|
+
if (typeof productId !== 'undefined') {
|
|
521
|
+
apiPayload['product_id'] = productId;
|
|
522
|
+
}
|
|
523
|
+
if (typeof quantity !== 'undefined') {
|
|
524
|
+
apiPayload['quantity'] = quantity;
|
|
525
|
+
}
|
|
526
|
+
if (typeof sku !== 'undefined') {
|
|
527
|
+
apiPayload['sku'] = sku;
|
|
528
|
+
}
|
|
529
|
+
if (typeof subcategorySlug !== 'undefined') {
|
|
530
|
+
apiPayload['subcategory_slug'] = subcategorySlug;
|
|
531
|
+
}
|
|
532
|
+
if (typeof taxRate !== 'undefined') {
|
|
533
|
+
apiPayload['tax_rate'] = taxRate;
|
|
534
|
+
}
|
|
535
|
+
if (typeof unit !== 'undefined') {
|
|
536
|
+
apiPayload['unit'] = unit;
|
|
537
|
+
}
|
|
538
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
539
|
+
|
|
540
|
+
const apiHeaders: { [header: string]: string } = {
|
|
541
|
+
'content-type': 'application/json',
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
return this.client.call(
|
|
545
|
+
'post',
|
|
546
|
+
uri,
|
|
547
|
+
apiHeaders,
|
|
548
|
+
apiPayload
|
|
549
|
+
);
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
*
|
|
554
|
+
* @param {string} params.listId -
|
|
555
|
+
* @param {Models.OrderListItemInput[]} params.items - The new full set of positions.
|
|
556
|
+
* @throws {RevenexxException}
|
|
557
|
+
* @returns {Promise<{}>}
|
|
558
|
+
*/
|
|
559
|
+
orderlistsItemsReplace(params: { listId: string, items: Models.OrderListItemInput[] }): Promise<{}>;
|
|
560
|
+
/**
|
|
561
|
+
*
|
|
562
|
+
* @param {string} listId -
|
|
563
|
+
* @param {Models.OrderListItemInput[]} items - The new full set of positions.
|
|
564
|
+
* @throws {RevenexxException}
|
|
565
|
+
* @returns {Promise<{}>}
|
|
566
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
567
|
+
*/
|
|
568
|
+
orderlistsItemsReplace(listId: string, items: Models.OrderListItemInput[]): Promise<{}>;
|
|
569
|
+
orderlistsItemsReplace(
|
|
570
|
+
paramsOrFirst: { listId: string, items: Models.OrderListItemInput[] } | string,
|
|
571
|
+
...rest: [(Models.OrderListItemInput[])?]
|
|
572
|
+
): Promise<{}> {
|
|
573
|
+
let params: { listId: string, items: Models.OrderListItemInput[] };
|
|
574
|
+
|
|
575
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
576
|
+
params = (paramsOrFirst || {}) as { listId: string, items: Models.OrderListItemInput[] };
|
|
577
|
+
} else {
|
|
578
|
+
params = {
|
|
579
|
+
listId: paramsOrFirst as string,
|
|
580
|
+
items: rest[0] as Models.OrderListItemInput[]
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
const listId = params.listId;
|
|
585
|
+
const items = params.items;
|
|
586
|
+
|
|
587
|
+
if (typeof listId === 'undefined') {
|
|
588
|
+
throw new RevenexxException('Missing required parameter: "listId"');
|
|
589
|
+
}
|
|
590
|
+
if (typeof items === 'undefined') {
|
|
591
|
+
throw new RevenexxException('Missing required parameter: "items"');
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
const apiPath = '/v1/orderlists/{list_id}/items'.replace('{list_id}', listId);
|
|
595
|
+
const apiPayload: Payload = {};
|
|
596
|
+
if (typeof items !== 'undefined') {
|
|
597
|
+
apiPayload['items'] = items;
|
|
598
|
+
}
|
|
599
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
600
|
+
|
|
601
|
+
const apiHeaders: { [header: string]: string } = {
|
|
602
|
+
'content-type': 'application/json',
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
return this.client.call(
|
|
606
|
+
'put',
|
|
607
|
+
uri,
|
|
608
|
+
apiHeaders,
|
|
609
|
+
apiPayload
|
|
610
|
+
);
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
/**
|
|
614
|
+
*
|
|
615
|
+
* @param {string} params.listId -
|
|
616
|
+
* @param {string} params.id -
|
|
617
|
+
* @throws {RevenexxException}
|
|
618
|
+
* @returns {Promise<{}>}
|
|
619
|
+
*/
|
|
620
|
+
orderlistsItemsDelete(params: { listId: string, id: string }): Promise<{}>;
|
|
621
|
+
/**
|
|
622
|
+
*
|
|
623
|
+
* @param {string} listId -
|
|
624
|
+
* @param {string} id -
|
|
625
|
+
* @throws {RevenexxException}
|
|
626
|
+
* @returns {Promise<{}>}
|
|
627
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
628
|
+
*/
|
|
629
|
+
orderlistsItemsDelete(listId: string, id: string): Promise<{}>;
|
|
630
|
+
orderlistsItemsDelete(
|
|
631
|
+
paramsOrFirst: { listId: string, id: string } | string,
|
|
632
|
+
...rest: [(string)?]
|
|
633
|
+
): Promise<{}> {
|
|
634
|
+
let params: { listId: string, id: string };
|
|
635
|
+
|
|
636
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
637
|
+
params = (paramsOrFirst || {}) as { listId: string, id: string };
|
|
638
|
+
} else {
|
|
639
|
+
params = {
|
|
640
|
+
listId: paramsOrFirst as string,
|
|
641
|
+
id: rest[0] as string
|
|
642
|
+
};
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
const listId = params.listId;
|
|
646
|
+
const id = params.id;
|
|
647
|
+
|
|
648
|
+
if (typeof listId === 'undefined') {
|
|
649
|
+
throw new RevenexxException('Missing required parameter: "listId"');
|
|
650
|
+
}
|
|
651
|
+
if (typeof id === 'undefined') {
|
|
652
|
+
throw new RevenexxException('Missing required parameter: "id"');
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
const apiPath = '/v1/orderlists/{list_id}/items/{id}'.replace('{list_id}', listId).replace('{id}', id);
|
|
656
|
+
const apiPayload: Payload = {};
|
|
657
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
658
|
+
|
|
659
|
+
const apiHeaders: { [header: string]: string } = {
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
return this.client.call(
|
|
663
|
+
'delete',
|
|
664
|
+
uri,
|
|
665
|
+
apiHeaders,
|
|
666
|
+
apiPayload
|
|
667
|
+
);
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
*
|
|
672
|
+
* @param {string} params.listId -
|
|
673
|
+
* @param {string} params.id -
|
|
674
|
+
* @throws {RevenexxException}
|
|
675
|
+
* @returns {Promise<Models.OrderListItem>}
|
|
676
|
+
*/
|
|
677
|
+
orderlistsItemsGet(params: { listId: string, id: string }): Promise<Models.OrderListItem>;
|
|
678
|
+
/**
|
|
679
|
+
*
|
|
680
|
+
* @param {string} listId -
|
|
681
|
+
* @param {string} id -
|
|
682
|
+
* @throws {RevenexxException}
|
|
683
|
+
* @returns {Promise<Models.OrderListItem>}
|
|
684
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
685
|
+
*/
|
|
686
|
+
orderlistsItemsGet(listId: string, id: string): Promise<Models.OrderListItem>;
|
|
687
|
+
orderlistsItemsGet(
|
|
688
|
+
paramsOrFirst: { listId: string, id: string } | string,
|
|
689
|
+
...rest: [(string)?]
|
|
690
|
+
): Promise<Models.OrderListItem> {
|
|
691
|
+
let params: { listId: string, id: string };
|
|
692
|
+
|
|
693
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
694
|
+
params = (paramsOrFirst || {}) as { listId: string, id: string };
|
|
695
|
+
} else {
|
|
696
|
+
params = {
|
|
697
|
+
listId: paramsOrFirst as string,
|
|
698
|
+
id: rest[0] as string
|
|
699
|
+
};
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
const listId = params.listId;
|
|
703
|
+
const id = params.id;
|
|
704
|
+
|
|
705
|
+
if (typeof listId === 'undefined') {
|
|
706
|
+
throw new RevenexxException('Missing required parameter: "listId"');
|
|
707
|
+
}
|
|
708
|
+
if (typeof id === 'undefined') {
|
|
709
|
+
throw new RevenexxException('Missing required parameter: "id"');
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
const apiPath = '/v1/orderlists/{list_id}/items/{id}'.replace('{list_id}', listId).replace('{id}', id);
|
|
713
|
+
const apiPayload: Payload = {};
|
|
714
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
715
|
+
|
|
716
|
+
const apiHeaders: { [header: string]: string } = {
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
return this.client.call(
|
|
720
|
+
'get',
|
|
721
|
+
uri,
|
|
722
|
+
apiHeaders,
|
|
723
|
+
apiPayload
|
|
724
|
+
);
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
/**
|
|
728
|
+
*
|
|
729
|
+
* @param {string} params.listId -
|
|
730
|
+
* @param {string} params.id -
|
|
731
|
+
* @param {string} params.categorySlug -
|
|
732
|
+
* @param {string} params.costCenterId - Cost center reference (free-text).
|
|
733
|
+
* @param {string} params.customSku - Customer's own article number.
|
|
734
|
+
* @param {string} params.image -
|
|
735
|
+
* @param {object} params.metadata -
|
|
736
|
+
* @param {string} params.name - Display name (snapshot).
|
|
737
|
+
* @param {number} params.position - Sort order (assigned automatically when omitted).
|
|
738
|
+
* @param {string[]} params.positionTexts - Per-position notes.
|
|
739
|
+
* @param {number} params.price - Unit price snapshot.
|
|
740
|
+
* @param {string} params.productId - Catalog product (alternative to sku).
|
|
741
|
+
* @param {number} params.quantity - Default 1.
|
|
742
|
+
* @param {string} params.sku - Article SKU (alternative to product_id).
|
|
743
|
+
* @param {string} params.subcategorySlug -
|
|
744
|
+
* @param {number} params.taxRate -
|
|
745
|
+
* @param {string} params.unit -
|
|
746
|
+
* @throws {RevenexxException}
|
|
747
|
+
* @returns {Promise<Models.OrderListItem>}
|
|
748
|
+
*/
|
|
749
|
+
orderlistsItemsUpdate(params: { listId: string, id: string, categorySlug?: string, costCenterId?: string, customSku?: string, image?: string, metadata?: object, name?: string, position?: number, positionTexts?: string[], price?: number, productId?: string, quantity?: number, sku?: string, subcategorySlug?: string, taxRate?: number, unit?: string }): Promise<Models.OrderListItem>;
|
|
750
|
+
/**
|
|
751
|
+
*
|
|
752
|
+
* @param {string} listId -
|
|
753
|
+
* @param {string} id -
|
|
754
|
+
* @param {string} categorySlug -
|
|
755
|
+
* @param {string} costCenterId - Cost center reference (free-text).
|
|
756
|
+
* @param {string} customSku - Customer's own article number.
|
|
757
|
+
* @param {string} image -
|
|
758
|
+
* @param {object} metadata -
|
|
759
|
+
* @param {string} name - Display name (snapshot).
|
|
760
|
+
* @param {number} position - Sort order (assigned automatically when omitted).
|
|
761
|
+
* @param {string[]} positionTexts - Per-position notes.
|
|
762
|
+
* @param {number} price - Unit price snapshot.
|
|
763
|
+
* @param {string} productId - Catalog product (alternative to sku).
|
|
764
|
+
* @param {number} quantity - Default 1.
|
|
765
|
+
* @param {string} sku - Article SKU (alternative to product_id).
|
|
766
|
+
* @param {string} subcategorySlug -
|
|
767
|
+
* @param {number} taxRate -
|
|
768
|
+
* @param {string} unit -
|
|
769
|
+
* @throws {RevenexxException}
|
|
770
|
+
* @returns {Promise<Models.OrderListItem>}
|
|
771
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
772
|
+
*/
|
|
773
|
+
orderlistsItemsUpdate(listId: string, id: string, categorySlug?: string, costCenterId?: string, customSku?: string, image?: string, metadata?: object, name?: string, position?: number, positionTexts?: string[], price?: number, productId?: string, quantity?: number, sku?: string, subcategorySlug?: string, taxRate?: number, unit?: string): Promise<Models.OrderListItem>;
|
|
774
|
+
orderlistsItemsUpdate(
|
|
775
|
+
paramsOrFirst: { listId: string, id: string, categorySlug?: string, costCenterId?: string, customSku?: string, image?: string, metadata?: object, name?: string, position?: number, positionTexts?: string[], price?: number, productId?: string, quantity?: number, sku?: string, subcategorySlug?: string, taxRate?: number, unit?: string } | string,
|
|
776
|
+
...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (object)?, (string)?, (number)?, (string[])?, (number)?, (string)?, (number)?, (string)?, (string)?, (number)?, (string)?]
|
|
777
|
+
): Promise<Models.OrderListItem> {
|
|
778
|
+
let params: { listId: string, id: string, categorySlug?: string, costCenterId?: string, customSku?: string, image?: string, metadata?: object, name?: string, position?: number, positionTexts?: string[], price?: number, productId?: string, quantity?: number, sku?: string, subcategorySlug?: string, taxRate?: number, unit?: string };
|
|
779
|
+
|
|
780
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
781
|
+
params = (paramsOrFirst || {}) as { listId: string, id: string, categorySlug?: string, costCenterId?: string, customSku?: string, image?: string, metadata?: object, name?: string, position?: number, positionTexts?: string[], price?: number, productId?: string, quantity?: number, sku?: string, subcategorySlug?: string, taxRate?: number, unit?: string };
|
|
782
|
+
} else {
|
|
783
|
+
params = {
|
|
784
|
+
listId: paramsOrFirst as string,
|
|
785
|
+
id: rest[0] as string,
|
|
786
|
+
categorySlug: rest[1] as string,
|
|
787
|
+
costCenterId: rest[2] as string,
|
|
788
|
+
customSku: rest[3] as string,
|
|
789
|
+
image: rest[4] as string,
|
|
790
|
+
metadata: rest[5] as object,
|
|
791
|
+
name: rest[6] as string,
|
|
792
|
+
position: rest[7] as number,
|
|
793
|
+
positionTexts: rest[8] as string[],
|
|
794
|
+
price: rest[9] as number,
|
|
795
|
+
productId: rest[10] as string,
|
|
796
|
+
quantity: rest[11] as number,
|
|
797
|
+
sku: rest[12] as string,
|
|
798
|
+
subcategorySlug: rest[13] as string,
|
|
799
|
+
taxRate: rest[14] as number,
|
|
800
|
+
unit: rest[15] as string
|
|
801
|
+
};
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
const listId = params.listId;
|
|
805
|
+
const id = params.id;
|
|
806
|
+
const categorySlug = params.categorySlug;
|
|
807
|
+
const costCenterId = params.costCenterId;
|
|
808
|
+
const customSku = params.customSku;
|
|
809
|
+
const image = params.image;
|
|
810
|
+
const metadata = params.metadata;
|
|
811
|
+
const name = params.name;
|
|
812
|
+
const position = params.position;
|
|
813
|
+
const positionTexts = params.positionTexts;
|
|
814
|
+
const price = params.price;
|
|
815
|
+
const productId = params.productId;
|
|
816
|
+
const quantity = params.quantity;
|
|
817
|
+
const sku = params.sku;
|
|
818
|
+
const subcategorySlug = params.subcategorySlug;
|
|
819
|
+
const taxRate = params.taxRate;
|
|
820
|
+
const unit = params.unit;
|
|
821
|
+
|
|
822
|
+
if (typeof listId === 'undefined') {
|
|
823
|
+
throw new RevenexxException('Missing required parameter: "listId"');
|
|
824
|
+
}
|
|
825
|
+
if (typeof id === 'undefined') {
|
|
826
|
+
throw new RevenexxException('Missing required parameter: "id"');
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
const apiPath = '/v1/orderlists/{list_id}/items/{id}'.replace('{list_id}', listId).replace('{id}', id);
|
|
830
|
+
const apiPayload: Payload = {};
|
|
831
|
+
if (typeof categorySlug !== 'undefined') {
|
|
832
|
+
apiPayload['category_slug'] = categorySlug;
|
|
833
|
+
}
|
|
834
|
+
if (typeof costCenterId !== 'undefined') {
|
|
835
|
+
apiPayload['cost_center_id'] = costCenterId;
|
|
836
|
+
}
|
|
837
|
+
if (typeof customSku !== 'undefined') {
|
|
838
|
+
apiPayload['custom_sku'] = customSku;
|
|
839
|
+
}
|
|
840
|
+
if (typeof image !== 'undefined') {
|
|
841
|
+
apiPayload['image'] = image;
|
|
842
|
+
}
|
|
843
|
+
if (typeof metadata !== 'undefined') {
|
|
844
|
+
apiPayload['metadata'] = metadata;
|
|
845
|
+
}
|
|
846
|
+
if (typeof name !== 'undefined') {
|
|
847
|
+
apiPayload['name'] = name;
|
|
848
|
+
}
|
|
849
|
+
if (typeof position !== 'undefined') {
|
|
850
|
+
apiPayload['position'] = position;
|
|
851
|
+
}
|
|
852
|
+
if (typeof positionTexts !== 'undefined') {
|
|
853
|
+
apiPayload['position_texts'] = positionTexts;
|
|
854
|
+
}
|
|
855
|
+
if (typeof price !== 'undefined') {
|
|
856
|
+
apiPayload['price'] = price;
|
|
857
|
+
}
|
|
858
|
+
if (typeof productId !== 'undefined') {
|
|
859
|
+
apiPayload['product_id'] = productId;
|
|
860
|
+
}
|
|
861
|
+
if (typeof quantity !== 'undefined') {
|
|
862
|
+
apiPayload['quantity'] = quantity;
|
|
863
|
+
}
|
|
864
|
+
if (typeof sku !== 'undefined') {
|
|
865
|
+
apiPayload['sku'] = sku;
|
|
866
|
+
}
|
|
867
|
+
if (typeof subcategorySlug !== 'undefined') {
|
|
868
|
+
apiPayload['subcategory_slug'] = subcategorySlug;
|
|
869
|
+
}
|
|
870
|
+
if (typeof taxRate !== 'undefined') {
|
|
871
|
+
apiPayload['tax_rate'] = taxRate;
|
|
872
|
+
}
|
|
873
|
+
if (typeof unit !== 'undefined') {
|
|
874
|
+
apiPayload['unit'] = unit;
|
|
875
|
+
}
|
|
876
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
877
|
+
|
|
878
|
+
const apiHeaders: { [header: string]: string } = {
|
|
879
|
+
'content-type': 'application/json',
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
return this.client.call(
|
|
883
|
+
'put',
|
|
884
|
+
uri,
|
|
885
|
+
apiHeaders,
|
|
886
|
+
apiPayload
|
|
887
|
+
);
|
|
888
|
+
}
|
|
889
|
+
}
|