@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.
- package/dist/cjs/sdk.js +13491 -6163
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +13464 -6162
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +13491 -6163
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/enums/address-type.ts +4 -0
- package/src/enums/cart-export-format.ts +4 -0
- package/src/enums/cart-io-apply-mode.ts +5 -0
- package/src/enums/cart-io-direction.ts +4 -0
- package/src/enums/cart-io-entity.ts +4 -0
- package/src/enums/cart-io-format.ts +4 -0
- package/src/enums/cart-item-type.ts +5 -0
- package/src/enums/channel-status.ts +4 -0
- package/src/enums/channel-type.ts +7 -0
- package/src/enums/contact-role.ts +6 -0
- package/src/enums/contact-status.ts +5 -0
- package/src/enums/location-type.ts +6 -0
- package/src/enums/market-status.ts +4 -0
- package/src/enums/order-comment-visibility.ts +4 -0
- package/src/enums/order-item-type.ts +5 -0
- package/src/enums/order-list-kind.ts +4 -0
- package/src/enums/order-payment-status.ts +9 -0
- package/src/enums/organization-status.ts +4 -0
- package/src/enums/page-status.ts +5 -0
- package/src/enums/payment-fee-type.ts +5 -0
- package/src/enums/payment-method-kind.ts +4 -0
- package/src/enums/price-entry-type.ts +4 -0
- package/src/enums/price-list-status.ts +4 -0
- package/src/enums/shipping-method-matrix-basis.ts +6 -0
- package/src/enums/shipping-method-pricing-type.ts +5 -0
- package/src/enums/store-asset-request-visibility.ts +4 -0
- package/src/enums/visibility.ts +4 -0
- package/src/index.ts +28 -2
- package/src/models.ts +5309 -1009
- package/src/services/apps.ts +154 -154
- package/src/services/avatars.ts +57 -57
- package/src/services/carts.ts +739 -104
- package/src/services/channels.ts +147 -19
- package/src/services/customers.ts +809 -69
- package/src/services/greetings.ts +18 -18
- package/src/services/inventories.ts +620 -65
- package/src/services/locale.ts +16 -16
- package/src/services/markets.ts +690 -75
- package/src/services/messaging.ts +273 -273
- package/src/services/orderlists.ts +889 -0
- package/src/services/orders.ts +692 -137
- package/src/services/pages.ts +661 -155
- package/src/services/payments.ts +591 -64
- package/src/services/prices.ts +585 -59
- package/src/services/products.ts +1908 -272
- package/src/services/search.ts +24 -24
- package/src/services/shipping.ts +451 -59
- package/src/services/sites.ts +116 -116
- package/src/services/storage.ts +933 -599
- package/src/services/tokens.ts +14 -14
- package/types/enums/address-type.d.ts +4 -0
- package/types/enums/cart-export-format.d.ts +4 -0
- package/types/enums/cart-io-apply-mode.d.ts +5 -0
- package/types/enums/cart-io-direction.d.ts +4 -0
- package/types/enums/cart-io-entity.d.ts +4 -0
- package/types/enums/cart-io-format.d.ts +4 -0
- package/types/enums/cart-item-type.d.ts +5 -0
- package/types/enums/channel-status.d.ts +4 -0
- package/types/enums/channel-type.d.ts +7 -0
- package/types/enums/contact-role.d.ts +6 -0
- package/types/enums/contact-status.d.ts +5 -0
- package/types/enums/location-type.d.ts +6 -0
- package/types/enums/market-status.d.ts +4 -0
- package/types/enums/order-comment-visibility.d.ts +4 -0
- package/types/enums/order-item-type.d.ts +5 -0
- package/types/enums/order-list-kind.d.ts +4 -0
- package/types/enums/order-payment-status.d.ts +9 -0
- package/types/enums/organization-status.d.ts +4 -0
- package/types/enums/page-status.d.ts +5 -0
- package/types/enums/payment-fee-type.d.ts +5 -0
- package/types/enums/payment-method-kind.d.ts +4 -0
- package/types/enums/price-entry-type.d.ts +4 -0
- package/types/enums/price-list-status.d.ts +4 -0
- package/types/enums/shipping-method-matrix-basis.d.ts +6 -0
- package/types/enums/shipping-method-pricing-type.d.ts +5 -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 +28 -2
- package/types/models.d.ts +5170 -1010
- package/types/services/carts.d.ts +271 -12
- package/types/services/channels.d.ts +54 -2
- package/types/services/customers.d.ts +298 -12
- package/types/services/inventories.d.ts +225 -11
- package/types/services/markets.d.ts +235 -6
- package/types/services/orderlists.d.ts +324 -0
- package/types/services/orders.d.ts +238 -16
- package/types/services/pages.d.ts +190 -6
- package/types/services/payments.d.ts +221 -7
- package/types/services/prices.d.ts +218 -6
- package/types/services/products.d.ts +672 -32
- package/types/services/shipping.d.ts +168 -6
- package/types/services/storage.d.ts +353 -285
package/src/services/prices.ts
CHANGED
|
@@ -2,6 +2,8 @@ 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 { PriceListStatus } from '../enums/price-list-status';
|
|
6
|
+
import { PriceEntryType } from '../enums/price-entry-type';
|
|
5
7
|
|
|
6
8
|
export class Prices {
|
|
7
9
|
client: Client;
|
|
@@ -18,7 +20,7 @@ export class Prices {
|
|
|
18
20
|
pricesListsList(): Promise<{}> {
|
|
19
21
|
|
|
20
22
|
const apiPath = '/v1/prices/lists';
|
|
21
|
-
const
|
|
23
|
+
const apiPayload: Payload = {};
|
|
22
24
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
23
25
|
|
|
24
26
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -28,19 +30,158 @@ export class Prices {
|
|
|
28
30
|
'get',
|
|
29
31
|
uri,
|
|
30
32
|
apiHeaders,
|
|
31
|
-
|
|
33
|
+
apiPayload
|
|
32
34
|
);
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
/**
|
|
36
38
|
*
|
|
39
|
+
* @param {string} params.code - Unique list code per tenant.
|
|
40
|
+
* @param {string} params.name -
|
|
41
|
+
* @param {string} params.channelId - Scope: only this channel.
|
|
42
|
+
* @param {string} params.contactId - Scope: only this contact — beats every other scope.
|
|
43
|
+
* @param {string} params.currency - ISO 4217 code (default EUR) — resolution only considers lists matching the requested currency.
|
|
44
|
+
* @param {string} params.description -
|
|
45
|
+
* @param {boolean} params.isDefault - Default lists resolve last within their group.
|
|
46
|
+
* @param {object} params.labels - Localised names ({de, en, …}).
|
|
47
|
+
* @param {string} params.marketId - Scope: only this market.
|
|
48
|
+
* @param {object} params.metadata - Free-form metadata.
|
|
49
|
+
* @param {string} params.organizationId - Scope: only this organization.
|
|
50
|
+
* @param {number} params.priority - Tie-breaker within a specificity group (higher wins, default 0).
|
|
51
|
+
* @param {PriceListStatus} params.status - Default 'active' — only active lists resolve.
|
|
52
|
+
* @param {boolean} params.taxIncluded - Gross (true) or net (false, default) prices.
|
|
53
|
+
* @param {string} params.validFrom - Validity window start.
|
|
54
|
+
* @param {string} params.validUntil - Validity window end.
|
|
37
55
|
* @throws {RevenexxException}
|
|
38
56
|
* @returns {Promise<Models.PriceList>}
|
|
39
57
|
*/
|
|
40
|
-
pricesListsCreate(): Promise<Models.PriceList
|
|
58
|
+
pricesListsCreate(params: { code: string, name: string, channelId?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object, marketId?: string, metadata?: object, organizationId?: string, priority?: number, status?: PriceListStatus, taxIncluded?: boolean, validFrom?: string, validUntil?: string }): Promise<Models.PriceList>;
|
|
59
|
+
/**
|
|
60
|
+
*
|
|
61
|
+
* @param {string} code - Unique list code per tenant.
|
|
62
|
+
* @param {string} name -
|
|
63
|
+
* @param {string} channelId - Scope: only this channel.
|
|
64
|
+
* @param {string} contactId - Scope: only this contact — beats every other scope.
|
|
65
|
+
* @param {string} currency - ISO 4217 code (default EUR) — resolution only considers lists matching the requested currency.
|
|
66
|
+
* @param {string} description -
|
|
67
|
+
* @param {boolean} isDefault - Default lists resolve last within their group.
|
|
68
|
+
* @param {object} labels - Localised names ({de, en, …}).
|
|
69
|
+
* @param {string} marketId - Scope: only this market.
|
|
70
|
+
* @param {object} metadata - Free-form metadata.
|
|
71
|
+
* @param {string} organizationId - Scope: only this organization.
|
|
72
|
+
* @param {number} priority - Tie-breaker within a specificity group (higher wins, default 0).
|
|
73
|
+
* @param {PriceListStatus} status - Default 'active' — only active lists resolve.
|
|
74
|
+
* @param {boolean} taxIncluded - Gross (true) or net (false, default) prices.
|
|
75
|
+
* @param {string} validFrom - Validity window start.
|
|
76
|
+
* @param {string} validUntil - Validity window end.
|
|
77
|
+
* @throws {RevenexxException}
|
|
78
|
+
* @returns {Promise<Models.PriceList>}
|
|
79
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
80
|
+
*/
|
|
81
|
+
pricesListsCreate(code: string, name: string, channelId?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object, marketId?: string, metadata?: object, organizationId?: string, priority?: number, status?: PriceListStatus, taxIncluded?: boolean, validFrom?: string, validUntil?: string): Promise<Models.PriceList>;
|
|
82
|
+
pricesListsCreate(
|
|
83
|
+
paramsOrFirst: { code: string, name: string, channelId?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object, marketId?: string, metadata?: object, organizationId?: string, priority?: number, status?: PriceListStatus, taxIncluded?: boolean, validFrom?: string, validUntil?: string } | string,
|
|
84
|
+
...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?, (object)?, (string)?, (object)?, (string)?, (number)?, (PriceListStatus)?, (boolean)?, (string)?, (string)?]
|
|
85
|
+
): Promise<Models.PriceList> {
|
|
86
|
+
let params: { code: string, name: string, channelId?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object, marketId?: string, metadata?: object, organizationId?: string, priority?: number, status?: PriceListStatus, taxIncluded?: boolean, validFrom?: string, validUntil?: string };
|
|
87
|
+
|
|
88
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
89
|
+
params = (paramsOrFirst || {}) as { code: string, name: string, channelId?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object, marketId?: string, metadata?: object, organizationId?: string, priority?: number, status?: PriceListStatus, taxIncluded?: boolean, validFrom?: string, validUntil?: string };
|
|
90
|
+
} else {
|
|
91
|
+
params = {
|
|
92
|
+
code: paramsOrFirst as string,
|
|
93
|
+
name: rest[0] as string,
|
|
94
|
+
channelId: rest[1] as string,
|
|
95
|
+
contactId: rest[2] as string,
|
|
96
|
+
currency: rest[3] as string,
|
|
97
|
+
description: rest[4] as string,
|
|
98
|
+
isDefault: rest[5] as boolean,
|
|
99
|
+
labels: rest[6] as object,
|
|
100
|
+
marketId: rest[7] as string,
|
|
101
|
+
metadata: rest[8] as object,
|
|
102
|
+
organizationId: rest[9] as string,
|
|
103
|
+
priority: rest[10] as number,
|
|
104
|
+
status: rest[11] as PriceListStatus,
|
|
105
|
+
taxIncluded: rest[12] as boolean,
|
|
106
|
+
validFrom: rest[13] as string,
|
|
107
|
+
validUntil: rest[14] as string
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const code = params.code;
|
|
112
|
+
const name = params.name;
|
|
113
|
+
const channelId = params.channelId;
|
|
114
|
+
const contactId = params.contactId;
|
|
115
|
+
const currency = params.currency;
|
|
116
|
+
const description = params.description;
|
|
117
|
+
const isDefault = params.isDefault;
|
|
118
|
+
const labels = params.labels;
|
|
119
|
+
const marketId = params.marketId;
|
|
120
|
+
const metadata = params.metadata;
|
|
121
|
+
const organizationId = params.organizationId;
|
|
122
|
+
const priority = params.priority;
|
|
123
|
+
const status = params.status;
|
|
124
|
+
const taxIncluded = params.taxIncluded;
|
|
125
|
+
const validFrom = params.validFrom;
|
|
126
|
+
const validUntil = params.validUntil;
|
|
127
|
+
|
|
128
|
+
if (typeof code === 'undefined') {
|
|
129
|
+
throw new RevenexxException('Missing required parameter: "code"');
|
|
130
|
+
}
|
|
131
|
+
if (typeof name === 'undefined') {
|
|
132
|
+
throw new RevenexxException('Missing required parameter: "name"');
|
|
133
|
+
}
|
|
41
134
|
|
|
42
135
|
const apiPath = '/v1/prices/lists';
|
|
43
|
-
const
|
|
136
|
+
const apiPayload: Payload = {};
|
|
137
|
+
if (typeof channelId !== 'undefined') {
|
|
138
|
+
apiPayload['channel_id'] = channelId;
|
|
139
|
+
}
|
|
140
|
+
if (typeof code !== 'undefined') {
|
|
141
|
+
apiPayload['code'] = code;
|
|
142
|
+
}
|
|
143
|
+
if (typeof contactId !== 'undefined') {
|
|
144
|
+
apiPayload['contact_id'] = contactId;
|
|
145
|
+
}
|
|
146
|
+
if (typeof currency !== 'undefined') {
|
|
147
|
+
apiPayload['currency'] = currency;
|
|
148
|
+
}
|
|
149
|
+
if (typeof description !== 'undefined') {
|
|
150
|
+
apiPayload['description'] = description;
|
|
151
|
+
}
|
|
152
|
+
if (typeof isDefault !== 'undefined') {
|
|
153
|
+
apiPayload['is_default'] = isDefault;
|
|
154
|
+
}
|
|
155
|
+
if (typeof labels !== 'undefined') {
|
|
156
|
+
apiPayload['labels'] = labels;
|
|
157
|
+
}
|
|
158
|
+
if (typeof marketId !== 'undefined') {
|
|
159
|
+
apiPayload['market_id'] = marketId;
|
|
160
|
+
}
|
|
161
|
+
if (typeof metadata !== 'undefined') {
|
|
162
|
+
apiPayload['metadata'] = metadata;
|
|
163
|
+
}
|
|
164
|
+
if (typeof name !== 'undefined') {
|
|
165
|
+
apiPayload['name'] = name;
|
|
166
|
+
}
|
|
167
|
+
if (typeof organizationId !== 'undefined') {
|
|
168
|
+
apiPayload['organization_id'] = organizationId;
|
|
169
|
+
}
|
|
170
|
+
if (typeof priority !== 'undefined') {
|
|
171
|
+
apiPayload['priority'] = priority;
|
|
172
|
+
}
|
|
173
|
+
if (typeof status !== 'undefined') {
|
|
174
|
+
apiPayload['status'] = status;
|
|
175
|
+
}
|
|
176
|
+
if (typeof taxIncluded !== 'undefined') {
|
|
177
|
+
apiPayload['tax_included'] = taxIncluded;
|
|
178
|
+
}
|
|
179
|
+
if (typeof validFrom !== 'undefined') {
|
|
180
|
+
apiPayload['valid_from'] = validFrom;
|
|
181
|
+
}
|
|
182
|
+
if (typeof validUntil !== 'undefined') {
|
|
183
|
+
apiPayload['valid_until'] = validUntil;
|
|
184
|
+
}
|
|
44
185
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45
186
|
|
|
46
187
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -51,7 +192,7 @@ export class Prices {
|
|
|
51
192
|
'post',
|
|
52
193
|
uri,
|
|
53
194
|
apiHeaders,
|
|
54
|
-
|
|
195
|
+
apiPayload
|
|
55
196
|
);
|
|
56
197
|
}
|
|
57
198
|
|
|
@@ -63,7 +204,7 @@ export class Prices {
|
|
|
63
204
|
pricesListsDefaults(): Promise<{}> {
|
|
64
205
|
|
|
65
206
|
const apiPath = '/v1/prices/lists/defaults';
|
|
66
|
-
const
|
|
207
|
+
const apiPayload: Payload = {};
|
|
67
208
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
68
209
|
|
|
69
210
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -73,7 +214,7 @@ export class Prices {
|
|
|
73
214
|
'post',
|
|
74
215
|
uri,
|
|
75
216
|
apiHeaders,
|
|
76
|
-
|
|
217
|
+
apiPayload
|
|
77
218
|
);
|
|
78
219
|
}
|
|
79
220
|
|
|
@@ -112,7 +253,7 @@ export class Prices {
|
|
|
112
253
|
}
|
|
113
254
|
|
|
114
255
|
const apiPath = '/v1/prices/lists/{id}'.replace('{id}', id);
|
|
115
|
-
const
|
|
256
|
+
const apiPayload: Payload = {};
|
|
116
257
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
117
258
|
|
|
118
259
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -122,7 +263,7 @@ export class Prices {
|
|
|
122
263
|
'delete',
|
|
123
264
|
uri,
|
|
124
265
|
apiHeaders,
|
|
125
|
-
|
|
266
|
+
apiPayload
|
|
126
267
|
);
|
|
127
268
|
}
|
|
128
269
|
|
|
@@ -161,7 +302,7 @@ export class Prices {
|
|
|
161
302
|
}
|
|
162
303
|
|
|
163
304
|
const apiPath = '/v1/prices/lists/{id}'.replace('{id}', id);
|
|
164
|
-
const
|
|
305
|
+
const apiPayload: Payload = {};
|
|
165
306
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
166
307
|
|
|
167
308
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -171,46 +312,159 @@ export class Prices {
|
|
|
171
312
|
'get',
|
|
172
313
|
uri,
|
|
173
314
|
apiHeaders,
|
|
174
|
-
|
|
315
|
+
apiPayload
|
|
175
316
|
);
|
|
176
317
|
}
|
|
177
318
|
|
|
178
319
|
/**
|
|
179
320
|
*
|
|
180
321
|
* @param {string} params.id -
|
|
322
|
+
* @param {string} params.channelId - Scope: only this channel.
|
|
323
|
+
* @param {string} params.code - Unique list code per tenant.
|
|
324
|
+
* @param {string} params.contactId - Scope: only this contact — beats every other scope.
|
|
325
|
+
* @param {string} params.currency - ISO 4217 code (default EUR) — resolution only considers lists matching the requested currency.
|
|
326
|
+
* @param {string} params.description -
|
|
327
|
+
* @param {boolean} params.isDefault - Default lists resolve last within their group.
|
|
328
|
+
* @param {object} params.labels - Localised names ({de, en, …}).
|
|
329
|
+
* @param {string} params.marketId - Scope: only this market.
|
|
330
|
+
* @param {object} params.metadata - Free-form metadata.
|
|
331
|
+
* @param {string} params.name -
|
|
332
|
+
* @param {string} params.organizationId - Scope: only this organization.
|
|
333
|
+
* @param {number} params.priority - Tie-breaker within a specificity group (higher wins, default 0).
|
|
334
|
+
* @param {PriceListStatus} params.status - Default 'active' — only active lists resolve.
|
|
335
|
+
* @param {boolean} params.taxIncluded - Gross (true) or net (false, default) prices.
|
|
336
|
+
* @param {string} params.validFrom - Validity window start.
|
|
337
|
+
* @param {string} params.validUntil - Validity window end.
|
|
181
338
|
* @throws {RevenexxException}
|
|
182
339
|
* @returns {Promise<Models.PriceList>}
|
|
183
340
|
*/
|
|
184
|
-
pricesListsUpdate(params: { id: string }): Promise<Models.PriceList>;
|
|
341
|
+
pricesListsUpdate(params: { id: string, channelId?: string, code?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object, marketId?: string, metadata?: object, name?: string, organizationId?: string, priority?: number, status?: PriceListStatus, taxIncluded?: boolean, validFrom?: string, validUntil?: string }): Promise<Models.PriceList>;
|
|
185
342
|
/**
|
|
186
343
|
*
|
|
187
344
|
* @param {string} id -
|
|
345
|
+
* @param {string} channelId - Scope: only this channel.
|
|
346
|
+
* @param {string} code - Unique list code per tenant.
|
|
347
|
+
* @param {string} contactId - Scope: only this contact — beats every other scope.
|
|
348
|
+
* @param {string} currency - ISO 4217 code (default EUR) — resolution only considers lists matching the requested currency.
|
|
349
|
+
* @param {string} description -
|
|
350
|
+
* @param {boolean} isDefault - Default lists resolve last within their group.
|
|
351
|
+
* @param {object} labels - Localised names ({de, en, …}).
|
|
352
|
+
* @param {string} marketId - Scope: only this market.
|
|
353
|
+
* @param {object} metadata - Free-form metadata.
|
|
354
|
+
* @param {string} name -
|
|
355
|
+
* @param {string} organizationId - Scope: only this organization.
|
|
356
|
+
* @param {number} priority - Tie-breaker within a specificity group (higher wins, default 0).
|
|
357
|
+
* @param {PriceListStatus} status - Default 'active' — only active lists resolve.
|
|
358
|
+
* @param {boolean} taxIncluded - Gross (true) or net (false, default) prices.
|
|
359
|
+
* @param {string} validFrom - Validity window start.
|
|
360
|
+
* @param {string} validUntil - Validity window end.
|
|
188
361
|
* @throws {RevenexxException}
|
|
189
362
|
* @returns {Promise<Models.PriceList>}
|
|
190
363
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
191
364
|
*/
|
|
192
|
-
pricesListsUpdate(id: string): Promise<Models.PriceList>;
|
|
365
|
+
pricesListsUpdate(id: string, channelId?: string, code?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object, marketId?: string, metadata?: object, name?: string, organizationId?: string, priority?: number, status?: PriceListStatus, taxIncluded?: boolean, validFrom?: string, validUntil?: string): Promise<Models.PriceList>;
|
|
193
366
|
pricesListsUpdate(
|
|
194
|
-
paramsOrFirst: { id: string } | string
|
|
367
|
+
paramsOrFirst: { id: string, channelId?: string, code?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object, marketId?: string, metadata?: object, name?: string, organizationId?: string, priority?: number, status?: PriceListStatus, taxIncluded?: boolean, validFrom?: string, validUntil?: string } | string,
|
|
368
|
+
...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?, (object)?, (string)?, (object)?, (string)?, (string)?, (number)?, (PriceListStatus)?, (boolean)?, (string)?, (string)?]
|
|
195
369
|
): Promise<Models.PriceList> {
|
|
196
|
-
let params: { id: string };
|
|
370
|
+
let params: { id: string, channelId?: string, code?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object, marketId?: string, metadata?: object, name?: string, organizationId?: string, priority?: number, status?: PriceListStatus, taxIncluded?: boolean, validFrom?: string, validUntil?: string };
|
|
197
371
|
|
|
198
372
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
199
|
-
params = (paramsOrFirst || {}) as { id: string };
|
|
373
|
+
params = (paramsOrFirst || {}) as { id: string, channelId?: string, code?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object, marketId?: string, metadata?: object, name?: string, organizationId?: string, priority?: number, status?: PriceListStatus, taxIncluded?: boolean, validFrom?: string, validUntil?: string };
|
|
200
374
|
} else {
|
|
201
375
|
params = {
|
|
202
|
-
id: paramsOrFirst as string
|
|
376
|
+
id: paramsOrFirst as string,
|
|
377
|
+
channelId: rest[0] as string,
|
|
378
|
+
code: rest[1] as string,
|
|
379
|
+
contactId: rest[2] as string,
|
|
380
|
+
currency: rest[3] as string,
|
|
381
|
+
description: rest[4] as string,
|
|
382
|
+
isDefault: rest[5] as boolean,
|
|
383
|
+
labels: rest[6] as object,
|
|
384
|
+
marketId: rest[7] as string,
|
|
385
|
+
metadata: rest[8] as object,
|
|
386
|
+
name: rest[9] as string,
|
|
387
|
+
organizationId: rest[10] as string,
|
|
388
|
+
priority: rest[11] as number,
|
|
389
|
+
status: rest[12] as PriceListStatus,
|
|
390
|
+
taxIncluded: rest[13] as boolean,
|
|
391
|
+
validFrom: rest[14] as string,
|
|
392
|
+
validUntil: rest[15] as string
|
|
203
393
|
};
|
|
204
394
|
}
|
|
205
395
|
|
|
206
396
|
const id = params.id;
|
|
397
|
+
const channelId = params.channelId;
|
|
398
|
+
const code = params.code;
|
|
399
|
+
const contactId = params.contactId;
|
|
400
|
+
const currency = params.currency;
|
|
401
|
+
const description = params.description;
|
|
402
|
+
const isDefault = params.isDefault;
|
|
403
|
+
const labels = params.labels;
|
|
404
|
+
const marketId = params.marketId;
|
|
405
|
+
const metadata = params.metadata;
|
|
406
|
+
const name = params.name;
|
|
407
|
+
const organizationId = params.organizationId;
|
|
408
|
+
const priority = params.priority;
|
|
409
|
+
const status = params.status;
|
|
410
|
+
const taxIncluded = params.taxIncluded;
|
|
411
|
+
const validFrom = params.validFrom;
|
|
412
|
+
const validUntil = params.validUntil;
|
|
207
413
|
|
|
208
414
|
if (typeof id === 'undefined') {
|
|
209
415
|
throw new RevenexxException('Missing required parameter: "id"');
|
|
210
416
|
}
|
|
211
417
|
|
|
212
418
|
const apiPath = '/v1/prices/lists/{id}'.replace('{id}', id);
|
|
213
|
-
const
|
|
419
|
+
const apiPayload: Payload = {};
|
|
420
|
+
if (typeof channelId !== 'undefined') {
|
|
421
|
+
apiPayload['channel_id'] = channelId;
|
|
422
|
+
}
|
|
423
|
+
if (typeof code !== 'undefined') {
|
|
424
|
+
apiPayload['code'] = code;
|
|
425
|
+
}
|
|
426
|
+
if (typeof contactId !== 'undefined') {
|
|
427
|
+
apiPayload['contact_id'] = contactId;
|
|
428
|
+
}
|
|
429
|
+
if (typeof currency !== 'undefined') {
|
|
430
|
+
apiPayload['currency'] = currency;
|
|
431
|
+
}
|
|
432
|
+
if (typeof description !== 'undefined') {
|
|
433
|
+
apiPayload['description'] = description;
|
|
434
|
+
}
|
|
435
|
+
if (typeof isDefault !== 'undefined') {
|
|
436
|
+
apiPayload['is_default'] = isDefault;
|
|
437
|
+
}
|
|
438
|
+
if (typeof labels !== 'undefined') {
|
|
439
|
+
apiPayload['labels'] = labels;
|
|
440
|
+
}
|
|
441
|
+
if (typeof marketId !== 'undefined') {
|
|
442
|
+
apiPayload['market_id'] = marketId;
|
|
443
|
+
}
|
|
444
|
+
if (typeof metadata !== 'undefined') {
|
|
445
|
+
apiPayload['metadata'] = metadata;
|
|
446
|
+
}
|
|
447
|
+
if (typeof name !== 'undefined') {
|
|
448
|
+
apiPayload['name'] = name;
|
|
449
|
+
}
|
|
450
|
+
if (typeof organizationId !== 'undefined') {
|
|
451
|
+
apiPayload['organization_id'] = organizationId;
|
|
452
|
+
}
|
|
453
|
+
if (typeof priority !== 'undefined') {
|
|
454
|
+
apiPayload['priority'] = priority;
|
|
455
|
+
}
|
|
456
|
+
if (typeof status !== 'undefined') {
|
|
457
|
+
apiPayload['status'] = status;
|
|
458
|
+
}
|
|
459
|
+
if (typeof taxIncluded !== 'undefined') {
|
|
460
|
+
apiPayload['tax_included'] = taxIncluded;
|
|
461
|
+
}
|
|
462
|
+
if (typeof validFrom !== 'undefined') {
|
|
463
|
+
apiPayload['valid_from'] = validFrom;
|
|
464
|
+
}
|
|
465
|
+
if (typeof validUntil !== 'undefined') {
|
|
466
|
+
apiPayload['valid_until'] = validUntil;
|
|
467
|
+
}
|
|
214
468
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
215
469
|
|
|
216
470
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -221,7 +475,7 @@ export class Prices {
|
|
|
221
475
|
'put',
|
|
222
476
|
uri,
|
|
223
477
|
apiHeaders,
|
|
224
|
-
|
|
478
|
+
apiPayload
|
|
225
479
|
);
|
|
226
480
|
}
|
|
227
481
|
|
|
@@ -259,8 +513,8 @@ export class Prices {
|
|
|
259
513
|
throw new RevenexxException('Missing required parameter: "listId"');
|
|
260
514
|
}
|
|
261
515
|
|
|
262
|
-
const apiPath = '/v1/prices/lists/{list_id}/entries'.replace('{
|
|
263
|
-
const
|
|
516
|
+
const apiPath = '/v1/prices/lists/{list_id}/entries'.replace('{list_id}', listId);
|
|
517
|
+
const apiPayload: Payload = {};
|
|
264
518
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
265
519
|
|
|
266
520
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -270,46 +524,110 @@ export class Prices {
|
|
|
270
524
|
'get',
|
|
271
525
|
uri,
|
|
272
526
|
apiHeaders,
|
|
273
|
-
|
|
527
|
+
apiPayload
|
|
274
528
|
);
|
|
275
529
|
}
|
|
276
530
|
|
|
277
531
|
/**
|
|
278
532
|
*
|
|
279
533
|
* @param {string} params.listId -
|
|
534
|
+
* @param {object} params.metadata - Free-form metadata.
|
|
535
|
+
* @param {PriceEntryType} params.priceType - Default 'standard'; 'on_request' is the explicit no-price marker — it stops resolution and answers "price on request".
|
|
536
|
+
* @param {string} params.productId - Priced product.
|
|
537
|
+
* @param {number} params.quantityMin - Tier threshold (Staffelpreis): this price applies from this quantity (default 1).
|
|
538
|
+
* @param {string} params.sku - Priced SKU (alternative to product_id).
|
|
539
|
+
* @param {string} params.unit -
|
|
540
|
+
* @param {number} params.unitPrice - Per-unit price (default 0).
|
|
541
|
+
* @param {string} params.validFrom - Per-entry validity start (promo prices).
|
|
542
|
+
* @param {string} params.validUntil - Per-entry validity end.
|
|
280
543
|
* @throws {RevenexxException}
|
|
281
544
|
* @returns {Promise<Models.PriceEntry>}
|
|
282
545
|
*/
|
|
283
|
-
pricesEntriesCreate(params: { listId: string }): Promise<Models.PriceEntry>;
|
|
546
|
+
pricesEntriesCreate(params: { listId: string, metadata?: object, priceType?: PriceEntryType, productId?: string, quantityMin?: number, sku?: string, unit?: string, unitPrice?: number, validFrom?: string, validUntil?: string }): Promise<Models.PriceEntry>;
|
|
284
547
|
/**
|
|
285
548
|
*
|
|
286
549
|
* @param {string} listId -
|
|
550
|
+
* @param {object} metadata - Free-form metadata.
|
|
551
|
+
* @param {PriceEntryType} priceType - Default 'standard'; 'on_request' is the explicit no-price marker — it stops resolution and answers "price on request".
|
|
552
|
+
* @param {string} productId - Priced product.
|
|
553
|
+
* @param {number} quantityMin - Tier threshold (Staffelpreis): this price applies from this quantity (default 1).
|
|
554
|
+
* @param {string} sku - Priced SKU (alternative to product_id).
|
|
555
|
+
* @param {string} unit -
|
|
556
|
+
* @param {number} unitPrice - Per-unit price (default 0).
|
|
557
|
+
* @param {string} validFrom - Per-entry validity start (promo prices).
|
|
558
|
+
* @param {string} validUntil - Per-entry validity end.
|
|
287
559
|
* @throws {RevenexxException}
|
|
288
560
|
* @returns {Promise<Models.PriceEntry>}
|
|
289
561
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
290
562
|
*/
|
|
291
|
-
pricesEntriesCreate(listId: string): Promise<Models.PriceEntry>;
|
|
563
|
+
pricesEntriesCreate(listId: string, metadata?: object, priceType?: PriceEntryType, productId?: string, quantityMin?: number, sku?: string, unit?: string, unitPrice?: number, validFrom?: string, validUntil?: string): Promise<Models.PriceEntry>;
|
|
292
564
|
pricesEntriesCreate(
|
|
293
|
-
paramsOrFirst: { listId: string } | string
|
|
565
|
+
paramsOrFirst: { listId: string, metadata?: object, priceType?: PriceEntryType, productId?: string, quantityMin?: number, sku?: string, unit?: string, unitPrice?: number, validFrom?: string, validUntil?: string } | string,
|
|
566
|
+
...rest: [(object)?, (PriceEntryType)?, (string)?, (number)?, (string)?, (string)?, (number)?, (string)?, (string)?]
|
|
294
567
|
): Promise<Models.PriceEntry> {
|
|
295
|
-
let params: { listId: string };
|
|
568
|
+
let params: { listId: string, metadata?: object, priceType?: PriceEntryType, productId?: string, quantityMin?: number, sku?: string, unit?: string, unitPrice?: number, validFrom?: string, validUntil?: string };
|
|
296
569
|
|
|
297
570
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
298
|
-
params = (paramsOrFirst || {}) as { listId: string };
|
|
571
|
+
params = (paramsOrFirst || {}) as { listId: string, metadata?: object, priceType?: PriceEntryType, productId?: string, quantityMin?: number, sku?: string, unit?: string, unitPrice?: number, validFrom?: string, validUntil?: string };
|
|
299
572
|
} else {
|
|
300
573
|
params = {
|
|
301
|
-
listId: paramsOrFirst as string
|
|
574
|
+
listId: paramsOrFirst as string,
|
|
575
|
+
metadata: rest[0] as object,
|
|
576
|
+
priceType: rest[1] as PriceEntryType,
|
|
577
|
+
productId: rest[2] as string,
|
|
578
|
+
quantityMin: rest[3] as number,
|
|
579
|
+
sku: rest[4] as string,
|
|
580
|
+
unit: rest[5] as string,
|
|
581
|
+
unitPrice: rest[6] as number,
|
|
582
|
+
validFrom: rest[7] as string,
|
|
583
|
+
validUntil: rest[8] as string
|
|
302
584
|
};
|
|
303
585
|
}
|
|
304
586
|
|
|
305
587
|
const listId = params.listId;
|
|
588
|
+
const metadata = params.metadata;
|
|
589
|
+
const priceType = params.priceType;
|
|
590
|
+
const productId = params.productId;
|
|
591
|
+
const quantityMin = params.quantityMin;
|
|
592
|
+
const sku = params.sku;
|
|
593
|
+
const unit = params.unit;
|
|
594
|
+
const unitPrice = params.unitPrice;
|
|
595
|
+
const validFrom = params.validFrom;
|
|
596
|
+
const validUntil = params.validUntil;
|
|
306
597
|
|
|
307
598
|
if (typeof listId === 'undefined') {
|
|
308
599
|
throw new RevenexxException('Missing required parameter: "listId"');
|
|
309
600
|
}
|
|
310
601
|
|
|
311
|
-
const apiPath = '/v1/prices/lists/{list_id}/entries'.replace('{
|
|
312
|
-
const
|
|
602
|
+
const apiPath = '/v1/prices/lists/{list_id}/entries'.replace('{list_id}', listId);
|
|
603
|
+
const apiPayload: Payload = {};
|
|
604
|
+
if (typeof metadata !== 'undefined') {
|
|
605
|
+
apiPayload['metadata'] = metadata;
|
|
606
|
+
}
|
|
607
|
+
if (typeof priceType !== 'undefined') {
|
|
608
|
+
apiPayload['price_type'] = priceType;
|
|
609
|
+
}
|
|
610
|
+
if (typeof productId !== 'undefined') {
|
|
611
|
+
apiPayload['product_id'] = productId;
|
|
612
|
+
}
|
|
613
|
+
if (typeof quantityMin !== 'undefined') {
|
|
614
|
+
apiPayload['quantity_min'] = quantityMin;
|
|
615
|
+
}
|
|
616
|
+
if (typeof sku !== 'undefined') {
|
|
617
|
+
apiPayload['sku'] = sku;
|
|
618
|
+
}
|
|
619
|
+
if (typeof unit !== 'undefined') {
|
|
620
|
+
apiPayload['unit'] = unit;
|
|
621
|
+
}
|
|
622
|
+
if (typeof unitPrice !== 'undefined') {
|
|
623
|
+
apiPayload['unit_price'] = unitPrice;
|
|
624
|
+
}
|
|
625
|
+
if (typeof validFrom !== 'undefined') {
|
|
626
|
+
apiPayload['valid_from'] = validFrom;
|
|
627
|
+
}
|
|
628
|
+
if (typeof validUntil !== 'undefined') {
|
|
629
|
+
apiPayload['valid_until'] = validUntil;
|
|
630
|
+
}
|
|
313
631
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
314
632
|
|
|
315
633
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -320,46 +638,57 @@ export class Prices {
|
|
|
320
638
|
'post',
|
|
321
639
|
uri,
|
|
322
640
|
apiHeaders,
|
|
323
|
-
|
|
641
|
+
apiPayload
|
|
324
642
|
);
|
|
325
643
|
}
|
|
326
644
|
|
|
327
645
|
/**
|
|
328
646
|
*
|
|
329
647
|
* @param {string} params.listId -
|
|
648
|
+
* @param {Models.PriceEntryReplaceItem[]} params.entries - The complete new entry set (set semantics).
|
|
330
649
|
* @throws {RevenexxException}
|
|
331
650
|
* @returns {Promise<{}>}
|
|
332
651
|
*/
|
|
333
|
-
pricesEntriesReplace(params: { listId: string }): Promise<{}>;
|
|
652
|
+
pricesEntriesReplace(params: { listId: string, entries: Models.PriceEntryReplaceItem[] }): Promise<{}>;
|
|
334
653
|
/**
|
|
335
654
|
*
|
|
336
655
|
* @param {string} listId -
|
|
656
|
+
* @param {Models.PriceEntryReplaceItem[]} entries - The complete new entry set (set semantics).
|
|
337
657
|
* @throws {RevenexxException}
|
|
338
658
|
* @returns {Promise<{}>}
|
|
339
659
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
340
660
|
*/
|
|
341
|
-
pricesEntriesReplace(listId: string): Promise<{}>;
|
|
661
|
+
pricesEntriesReplace(listId: string, entries: Models.PriceEntryReplaceItem[]): Promise<{}>;
|
|
342
662
|
pricesEntriesReplace(
|
|
343
|
-
paramsOrFirst: { listId: string } | string
|
|
663
|
+
paramsOrFirst: { listId: string, entries: Models.PriceEntryReplaceItem[] } | string,
|
|
664
|
+
...rest: [(Models.PriceEntryReplaceItem[])?]
|
|
344
665
|
): Promise<{}> {
|
|
345
|
-
let params: { listId: string };
|
|
666
|
+
let params: { listId: string, entries: Models.PriceEntryReplaceItem[] };
|
|
346
667
|
|
|
347
668
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
348
|
-
params = (paramsOrFirst || {}) as { listId: string };
|
|
669
|
+
params = (paramsOrFirst || {}) as { listId: string, entries: Models.PriceEntryReplaceItem[] };
|
|
349
670
|
} else {
|
|
350
671
|
params = {
|
|
351
|
-
listId: paramsOrFirst as string
|
|
672
|
+
listId: paramsOrFirst as string,
|
|
673
|
+
entries: rest[0] as Models.PriceEntryReplaceItem[]
|
|
352
674
|
};
|
|
353
675
|
}
|
|
354
676
|
|
|
355
677
|
const listId = params.listId;
|
|
678
|
+
const entries = params.entries;
|
|
356
679
|
|
|
357
680
|
if (typeof listId === 'undefined') {
|
|
358
681
|
throw new RevenexxException('Missing required parameter: "listId"');
|
|
359
682
|
}
|
|
683
|
+
if (typeof entries === 'undefined') {
|
|
684
|
+
throw new RevenexxException('Missing required parameter: "entries"');
|
|
685
|
+
}
|
|
360
686
|
|
|
361
|
-
const apiPath = '/v1/prices/lists/{list_id}/entries'.replace('{
|
|
362
|
-
const
|
|
687
|
+
const apiPath = '/v1/prices/lists/{list_id}/entries'.replace('{list_id}', listId);
|
|
688
|
+
const apiPayload: Payload = {};
|
|
689
|
+
if (typeof entries !== 'undefined') {
|
|
690
|
+
apiPayload['entries'] = entries;
|
|
691
|
+
}
|
|
363
692
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
364
693
|
|
|
365
694
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -370,7 +699,68 @@ export class Prices {
|
|
|
370
699
|
'put',
|
|
371
700
|
uri,
|
|
372
701
|
apiHeaders,
|
|
373
|
-
|
|
702
|
+
apiPayload
|
|
703
|
+
);
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
/**
|
|
707
|
+
*
|
|
708
|
+
* @param {string} params.listId -
|
|
709
|
+
* @param {Models.PriceEntryReplaceItem[]} params.entries - The complete new entry set (set semantics).
|
|
710
|
+
* @throws {RevenexxException}
|
|
711
|
+
* @returns {Promise<{}>}
|
|
712
|
+
*/
|
|
713
|
+
pricesEntriesBulk(params: { listId: string, entries: Models.PriceEntryReplaceItem[] }): Promise<{}>;
|
|
714
|
+
/**
|
|
715
|
+
*
|
|
716
|
+
* @param {string} listId -
|
|
717
|
+
* @param {Models.PriceEntryReplaceItem[]} entries - The complete new entry set (set semantics).
|
|
718
|
+
* @throws {RevenexxException}
|
|
719
|
+
* @returns {Promise<{}>}
|
|
720
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
721
|
+
*/
|
|
722
|
+
pricesEntriesBulk(listId: string, entries: Models.PriceEntryReplaceItem[]): Promise<{}>;
|
|
723
|
+
pricesEntriesBulk(
|
|
724
|
+
paramsOrFirst: { listId: string, entries: Models.PriceEntryReplaceItem[] } | string,
|
|
725
|
+
...rest: [(Models.PriceEntryReplaceItem[])?]
|
|
726
|
+
): Promise<{}> {
|
|
727
|
+
let params: { listId: string, entries: Models.PriceEntryReplaceItem[] };
|
|
728
|
+
|
|
729
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
730
|
+
params = (paramsOrFirst || {}) as { listId: string, entries: Models.PriceEntryReplaceItem[] };
|
|
731
|
+
} else {
|
|
732
|
+
params = {
|
|
733
|
+
listId: paramsOrFirst as string,
|
|
734
|
+
entries: rest[0] as Models.PriceEntryReplaceItem[]
|
|
735
|
+
};
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
const listId = params.listId;
|
|
739
|
+
const entries = params.entries;
|
|
740
|
+
|
|
741
|
+
if (typeof listId === 'undefined') {
|
|
742
|
+
throw new RevenexxException('Missing required parameter: "listId"');
|
|
743
|
+
}
|
|
744
|
+
if (typeof entries === 'undefined') {
|
|
745
|
+
throw new RevenexxException('Missing required parameter: "entries"');
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
const apiPath = '/v1/prices/lists/{list_id}/entries/bulk'.replace('{list_id}', listId);
|
|
749
|
+
const apiPayload: Payload = {};
|
|
750
|
+
if (typeof entries !== 'undefined') {
|
|
751
|
+
apiPayload['entries'] = entries;
|
|
752
|
+
}
|
|
753
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
754
|
+
|
|
755
|
+
const apiHeaders: { [header: string]: string } = {
|
|
756
|
+
'content-type': 'application/json',
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
return this.client.call(
|
|
760
|
+
'post',
|
|
761
|
+
uri,
|
|
762
|
+
apiHeaders,
|
|
763
|
+
apiPayload
|
|
374
764
|
);
|
|
375
765
|
}
|
|
376
766
|
|
|
@@ -416,8 +806,8 @@ export class Prices {
|
|
|
416
806
|
throw new RevenexxException('Missing required parameter: "id"');
|
|
417
807
|
}
|
|
418
808
|
|
|
419
|
-
const apiPath = '/v1/prices/lists/{list_id}/entries/{id}'.replace('{
|
|
420
|
-
const
|
|
809
|
+
const apiPath = '/v1/prices/lists/{list_id}/entries/{id}'.replace('{list_id}', listId).replace('{id}', id);
|
|
810
|
+
const apiPayload: Payload = {};
|
|
421
811
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
422
812
|
|
|
423
813
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -427,7 +817,7 @@ export class Prices {
|
|
|
427
817
|
'delete',
|
|
428
818
|
uri,
|
|
429
819
|
apiHeaders,
|
|
430
|
-
|
|
820
|
+
apiPayload
|
|
431
821
|
);
|
|
432
822
|
}
|
|
433
823
|
|
|
@@ -473,8 +863,8 @@ export class Prices {
|
|
|
473
863
|
throw new RevenexxException('Missing required parameter: "id"');
|
|
474
864
|
}
|
|
475
865
|
|
|
476
|
-
const apiPath = '/v1/prices/lists/{list_id}/entries/{id}'.replace('{
|
|
477
|
-
const
|
|
866
|
+
const apiPath = '/v1/prices/lists/{list_id}/entries/{id}'.replace('{list_id}', listId).replace('{id}', id);
|
|
867
|
+
const apiPayload: Payload = {};
|
|
478
868
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
479
869
|
|
|
480
870
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -484,7 +874,7 @@ export class Prices {
|
|
|
484
874
|
'get',
|
|
485
875
|
uri,
|
|
486
876
|
apiHeaders,
|
|
487
|
-
|
|
877
|
+
apiPayload
|
|
488
878
|
);
|
|
489
879
|
}
|
|
490
880
|
|
|
@@ -492,36 +882,72 @@ export class Prices {
|
|
|
492
882
|
*
|
|
493
883
|
* @param {string} params.listId -
|
|
494
884
|
* @param {string} params.id -
|
|
885
|
+
* @param {object} params.metadata - Free-form metadata.
|
|
886
|
+
* @param {PriceEntryType} params.priceType - Default 'standard'; 'on_request' is the explicit no-price marker — it stops resolution and answers "price on request".
|
|
887
|
+
* @param {string} params.productId - Priced product.
|
|
888
|
+
* @param {number} params.quantityMin - Tier threshold (Staffelpreis): this price applies from this quantity (default 1).
|
|
889
|
+
* @param {string} params.sku - Priced SKU (alternative to product_id).
|
|
890
|
+
* @param {string} params.unit -
|
|
891
|
+
* @param {number} params.unitPrice - Per-unit price (default 0).
|
|
892
|
+
* @param {string} params.validFrom - Per-entry validity start (promo prices).
|
|
893
|
+
* @param {string} params.validUntil - Per-entry validity end.
|
|
495
894
|
* @throws {RevenexxException}
|
|
496
895
|
* @returns {Promise<Models.PriceEntry>}
|
|
497
896
|
*/
|
|
498
|
-
pricesEntriesUpdate(params: { listId: string, id: string }): Promise<Models.PriceEntry>;
|
|
897
|
+
pricesEntriesUpdate(params: { listId: string, id: string, metadata?: object, priceType?: PriceEntryType, productId?: string, quantityMin?: number, sku?: string, unit?: string, unitPrice?: number, validFrom?: string, validUntil?: string }): Promise<Models.PriceEntry>;
|
|
499
898
|
/**
|
|
500
899
|
*
|
|
501
900
|
* @param {string} listId -
|
|
502
901
|
* @param {string} id -
|
|
902
|
+
* @param {object} metadata - Free-form metadata.
|
|
903
|
+
* @param {PriceEntryType} priceType - Default 'standard'; 'on_request' is the explicit no-price marker — it stops resolution and answers "price on request".
|
|
904
|
+
* @param {string} productId - Priced product.
|
|
905
|
+
* @param {number} quantityMin - Tier threshold (Staffelpreis): this price applies from this quantity (default 1).
|
|
906
|
+
* @param {string} sku - Priced SKU (alternative to product_id).
|
|
907
|
+
* @param {string} unit -
|
|
908
|
+
* @param {number} unitPrice - Per-unit price (default 0).
|
|
909
|
+
* @param {string} validFrom - Per-entry validity start (promo prices).
|
|
910
|
+
* @param {string} validUntil - Per-entry validity end.
|
|
503
911
|
* @throws {RevenexxException}
|
|
504
912
|
* @returns {Promise<Models.PriceEntry>}
|
|
505
913
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
506
914
|
*/
|
|
507
|
-
pricesEntriesUpdate(listId: string, id: string): Promise<Models.PriceEntry>;
|
|
915
|
+
pricesEntriesUpdate(listId: string, id: string, metadata?: object, priceType?: PriceEntryType, productId?: string, quantityMin?: number, sku?: string, unit?: string, unitPrice?: number, validFrom?: string, validUntil?: string): Promise<Models.PriceEntry>;
|
|
508
916
|
pricesEntriesUpdate(
|
|
509
|
-
paramsOrFirst: { listId: string, id: string } | string,
|
|
510
|
-
...rest: [(string)?]
|
|
917
|
+
paramsOrFirst: { listId: string, id: string, metadata?: object, priceType?: PriceEntryType, productId?: string, quantityMin?: number, sku?: string, unit?: string, unitPrice?: number, validFrom?: string, validUntil?: string } | string,
|
|
918
|
+
...rest: [(string)?, (object)?, (PriceEntryType)?, (string)?, (number)?, (string)?, (string)?, (number)?, (string)?, (string)?]
|
|
511
919
|
): Promise<Models.PriceEntry> {
|
|
512
|
-
let params: { listId: string, id: string };
|
|
920
|
+
let params: { listId: string, id: string, metadata?: object, priceType?: PriceEntryType, productId?: string, quantityMin?: number, sku?: string, unit?: string, unitPrice?: number, validFrom?: string, validUntil?: string };
|
|
513
921
|
|
|
514
922
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
515
|
-
params = (paramsOrFirst || {}) as { listId: string, id: string };
|
|
923
|
+
params = (paramsOrFirst || {}) as { listId: string, id: string, metadata?: object, priceType?: PriceEntryType, productId?: string, quantityMin?: number, sku?: string, unit?: string, unitPrice?: number, validFrom?: string, validUntil?: string };
|
|
516
924
|
} else {
|
|
517
925
|
params = {
|
|
518
926
|
listId: paramsOrFirst as string,
|
|
519
|
-
id: rest[0] as string
|
|
927
|
+
id: rest[0] as string,
|
|
928
|
+
metadata: rest[1] as object,
|
|
929
|
+
priceType: rest[2] as PriceEntryType,
|
|
930
|
+
productId: rest[3] as string,
|
|
931
|
+
quantityMin: rest[4] as number,
|
|
932
|
+
sku: rest[5] as string,
|
|
933
|
+
unit: rest[6] as string,
|
|
934
|
+
unitPrice: rest[7] as number,
|
|
935
|
+
validFrom: rest[8] as string,
|
|
936
|
+
validUntil: rest[9] as string
|
|
520
937
|
};
|
|
521
938
|
}
|
|
522
939
|
|
|
523
940
|
const listId = params.listId;
|
|
524
941
|
const id = params.id;
|
|
942
|
+
const metadata = params.metadata;
|
|
943
|
+
const priceType = params.priceType;
|
|
944
|
+
const productId = params.productId;
|
|
945
|
+
const quantityMin = params.quantityMin;
|
|
946
|
+
const sku = params.sku;
|
|
947
|
+
const unit = params.unit;
|
|
948
|
+
const unitPrice = params.unitPrice;
|
|
949
|
+
const validFrom = params.validFrom;
|
|
950
|
+
const validUntil = params.validUntil;
|
|
525
951
|
|
|
526
952
|
if (typeof listId === 'undefined') {
|
|
527
953
|
throw new RevenexxException('Missing required parameter: "listId"');
|
|
@@ -530,8 +956,35 @@ export class Prices {
|
|
|
530
956
|
throw new RevenexxException('Missing required parameter: "id"');
|
|
531
957
|
}
|
|
532
958
|
|
|
533
|
-
const apiPath = '/v1/prices/lists/{list_id}/entries/{id}'.replace('{
|
|
534
|
-
const
|
|
959
|
+
const apiPath = '/v1/prices/lists/{list_id}/entries/{id}'.replace('{list_id}', listId).replace('{id}', id);
|
|
960
|
+
const apiPayload: Payload = {};
|
|
961
|
+
if (typeof metadata !== 'undefined') {
|
|
962
|
+
apiPayload['metadata'] = metadata;
|
|
963
|
+
}
|
|
964
|
+
if (typeof priceType !== 'undefined') {
|
|
965
|
+
apiPayload['price_type'] = priceType;
|
|
966
|
+
}
|
|
967
|
+
if (typeof productId !== 'undefined') {
|
|
968
|
+
apiPayload['product_id'] = productId;
|
|
969
|
+
}
|
|
970
|
+
if (typeof quantityMin !== 'undefined') {
|
|
971
|
+
apiPayload['quantity_min'] = quantityMin;
|
|
972
|
+
}
|
|
973
|
+
if (typeof sku !== 'undefined') {
|
|
974
|
+
apiPayload['sku'] = sku;
|
|
975
|
+
}
|
|
976
|
+
if (typeof unit !== 'undefined') {
|
|
977
|
+
apiPayload['unit'] = unit;
|
|
978
|
+
}
|
|
979
|
+
if (typeof unitPrice !== 'undefined') {
|
|
980
|
+
apiPayload['unit_price'] = unitPrice;
|
|
981
|
+
}
|
|
982
|
+
if (typeof validFrom !== 'undefined') {
|
|
983
|
+
apiPayload['valid_from'] = validFrom;
|
|
984
|
+
}
|
|
985
|
+
if (typeof validUntil !== 'undefined') {
|
|
986
|
+
apiPayload['valid_until'] = validUntil;
|
|
987
|
+
}
|
|
535
988
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
536
989
|
|
|
537
990
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -542,19 +995,92 @@ export class Prices {
|
|
|
542
995
|
'put',
|
|
543
996
|
uri,
|
|
544
997
|
apiHeaders,
|
|
545
|
-
|
|
998
|
+
apiPayload
|
|
546
999
|
);
|
|
547
1000
|
}
|
|
548
1001
|
|
|
549
1002
|
/**
|
|
550
1003
|
*
|
|
1004
|
+
* @param {Models.PriceResolveItem[]} params.items - Items to price (at most 200 per call).
|
|
1005
|
+
* @param {string} params.at - Point in time for validity windows (ISO 8601 timestamp, default now).
|
|
1006
|
+
* @param {string} params.channelId - Buyer context: channel.
|
|
1007
|
+
* @param {string} params.contactId - Buyer context: contact — most specific scope.
|
|
1008
|
+
* @param {string} params.currency - ISO 4217 code (default EUR) — only lists in this currency resolve.
|
|
1009
|
+
* @param {string} params.marketId - Buyer context: market.
|
|
1010
|
+
* @param {string} params.organizationId - Buyer context: organization.
|
|
551
1011
|
* @throws {RevenexxException}
|
|
552
1012
|
* @returns {Promise<{}>}
|
|
553
1013
|
*/
|
|
554
|
-
pricesResolve(): Promise<{}
|
|
1014
|
+
pricesResolve(params: { items: Models.PriceResolveItem[], at?: string, channelId?: string, contactId?: string, currency?: string, marketId?: string, organizationId?: string }): Promise<{}>;
|
|
1015
|
+
/**
|
|
1016
|
+
*
|
|
1017
|
+
* @param {Models.PriceResolveItem[]} items - Items to price (at most 200 per call).
|
|
1018
|
+
* @param {string} at - Point in time for validity windows (ISO 8601 timestamp, default now).
|
|
1019
|
+
* @param {string} channelId - Buyer context: channel.
|
|
1020
|
+
* @param {string} contactId - Buyer context: contact — most specific scope.
|
|
1021
|
+
* @param {string} currency - ISO 4217 code (default EUR) — only lists in this currency resolve.
|
|
1022
|
+
* @param {string} marketId - Buyer context: market.
|
|
1023
|
+
* @param {string} organizationId - Buyer context: organization.
|
|
1024
|
+
* @throws {RevenexxException}
|
|
1025
|
+
* @returns {Promise<{}>}
|
|
1026
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1027
|
+
*/
|
|
1028
|
+
pricesResolve(items: Models.PriceResolveItem[], at?: string, channelId?: string, contactId?: string, currency?: string, marketId?: string, organizationId?: string): Promise<{}>;
|
|
1029
|
+
pricesResolve(
|
|
1030
|
+
paramsOrFirst: { items: Models.PriceResolveItem[], at?: string, channelId?: string, contactId?: string, currency?: string, marketId?: string, organizationId?: string } | Models.PriceResolveItem[],
|
|
1031
|
+
...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (string)?]
|
|
1032
|
+
): Promise<{}> {
|
|
1033
|
+
let params: { items: Models.PriceResolveItem[], at?: string, channelId?: string, contactId?: string, currency?: string, marketId?: string, organizationId?: string };
|
|
1034
|
+
|
|
1035
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('items' in paramsOrFirst || 'at' in paramsOrFirst || 'channelId' in paramsOrFirst || 'contactId' in paramsOrFirst || 'currency' in paramsOrFirst || 'marketId' in paramsOrFirst || 'organizationId' in paramsOrFirst))) {
|
|
1036
|
+
params = (paramsOrFirst || {}) as { items: Models.PriceResolveItem[], at?: string, channelId?: string, contactId?: string, currency?: string, marketId?: string, organizationId?: string };
|
|
1037
|
+
} else {
|
|
1038
|
+
params = {
|
|
1039
|
+
items: paramsOrFirst as Models.PriceResolveItem[],
|
|
1040
|
+
at: rest[0] as string,
|
|
1041
|
+
channelId: rest[1] as string,
|
|
1042
|
+
contactId: rest[2] as string,
|
|
1043
|
+
currency: rest[3] as string,
|
|
1044
|
+
marketId: rest[4] as string,
|
|
1045
|
+
organizationId: rest[5] as string
|
|
1046
|
+
};
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
const items = params.items;
|
|
1050
|
+
const at = params.at;
|
|
1051
|
+
const channelId = params.channelId;
|
|
1052
|
+
const contactId = params.contactId;
|
|
1053
|
+
const currency = params.currency;
|
|
1054
|
+
const marketId = params.marketId;
|
|
1055
|
+
const organizationId = params.organizationId;
|
|
1056
|
+
|
|
1057
|
+
if (typeof items === 'undefined') {
|
|
1058
|
+
throw new RevenexxException('Missing required parameter: "items"');
|
|
1059
|
+
}
|
|
555
1060
|
|
|
556
1061
|
const apiPath = '/v1/prices/resolve';
|
|
557
|
-
const
|
|
1062
|
+
const apiPayload: Payload = {};
|
|
1063
|
+
if (typeof at !== 'undefined') {
|
|
1064
|
+
apiPayload['at'] = at;
|
|
1065
|
+
}
|
|
1066
|
+
if (typeof channelId !== 'undefined') {
|
|
1067
|
+
apiPayload['channel_id'] = channelId;
|
|
1068
|
+
}
|
|
1069
|
+
if (typeof contactId !== 'undefined') {
|
|
1070
|
+
apiPayload['contact_id'] = contactId;
|
|
1071
|
+
}
|
|
1072
|
+
if (typeof currency !== 'undefined') {
|
|
1073
|
+
apiPayload['currency'] = currency;
|
|
1074
|
+
}
|
|
1075
|
+
if (typeof items !== 'undefined') {
|
|
1076
|
+
apiPayload['items'] = items;
|
|
1077
|
+
}
|
|
1078
|
+
if (typeof marketId !== 'undefined') {
|
|
1079
|
+
apiPayload['market_id'] = marketId;
|
|
1080
|
+
}
|
|
1081
|
+
if (typeof organizationId !== 'undefined') {
|
|
1082
|
+
apiPayload['organization_id'] = organizationId;
|
|
1083
|
+
}
|
|
558
1084
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
559
1085
|
|
|
560
1086
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -565,7 +1091,7 @@ export class Prices {
|
|
|
565
1091
|
'post',
|
|
566
1092
|
uri,
|
|
567
1093
|
apiHeaders,
|
|
568
|
-
|
|
1094
|
+
apiPayload
|
|
569
1095
|
);
|
|
570
1096
|
}
|
|
571
1097
|
}
|