@revenexx/sdk 0.0.13 → 0.0.15
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 +109 -68
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +109 -69
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +109 -68
- package/package.json +1 -1
- package/src/client.ts +19 -1
- package/src/index.ts +1 -0
- package/src/models.ts +12 -36
- package/src/services/carts.ts +17 -31
- package/src/services/orders.ts +25 -39
- package/src/services/prices.ts +33 -33
- package/src/services/settings.ts +71 -0
- package/types/client.d.ts +12 -0
- package/types/index.d.ts +1 -0
- package/types/models.d.ts +12 -36
- package/types/services/carts.d.ts +2 -8
- package/types/services/orders.d.ts +2 -8
- package/types/services/prices.d.ts +8 -8
- package/types/services/settings.d.ts +27 -0
package/src/services/carts.ts
CHANGED
|
@@ -107,21 +107,19 @@ export class Carts {
|
|
|
107
107
|
* @param {string} params.contactId - Owning customer contact.
|
|
108
108
|
* @param {string} params.currency - ISO 4217 code (default EUR).
|
|
109
109
|
* @param {boolean} params.isCurrent - Make this THE current cart of its owner.
|
|
110
|
-
* @param {string} params.marketId -
|
|
111
110
|
* @param {object} params.metadata - Free-form metadata.
|
|
112
111
|
* @param {string} params.name - Display name (default 'Cart').
|
|
113
112
|
* @param {string} params.sessionKey - Owning guest session.
|
|
114
113
|
* @throws {RevenexxException}
|
|
115
114
|
* @returns {Promise<Models.Cart>}
|
|
116
115
|
*/
|
|
117
|
-
cartsCreate(params?: { channelId?: string, contactId?: string, currency?: string, isCurrent?: boolean,
|
|
116
|
+
cartsCreate(params?: { channelId?: string, contactId?: string, currency?: string, isCurrent?: boolean, metadata?: object, name?: string, sessionKey?: string }): Promise<Models.Cart>;
|
|
118
117
|
/**
|
|
119
118
|
*
|
|
120
119
|
* @param {string} channelId -
|
|
121
120
|
* @param {string} contactId - Owning customer contact.
|
|
122
121
|
* @param {string} currency - ISO 4217 code (default EUR).
|
|
123
122
|
* @param {boolean} isCurrent - Make this THE current cart of its owner.
|
|
124
|
-
* @param {string} marketId -
|
|
125
123
|
* @param {object} metadata - Free-form metadata.
|
|
126
124
|
* @param {string} name - Display name (default 'Cart').
|
|
127
125
|
* @param {string} sessionKey - Owning guest session.
|
|
@@ -129,25 +127,24 @@ export class Carts {
|
|
|
129
127
|
* @returns {Promise<Models.Cart>}
|
|
130
128
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
131
129
|
*/
|
|
132
|
-
cartsCreate(channelId?: string, contactId?: string, currency?: string, isCurrent?: boolean,
|
|
130
|
+
cartsCreate(channelId?: string, contactId?: string, currency?: string, isCurrent?: boolean, metadata?: object, name?: string, sessionKey?: string): Promise<Models.Cart>;
|
|
133
131
|
cartsCreate(
|
|
134
|
-
paramsOrFirst?: { channelId?: string, contactId?: string, currency?: string, isCurrent?: boolean,
|
|
135
|
-
...rest: [(string)?, (string)?, (boolean)?, (
|
|
132
|
+
paramsOrFirst?: { channelId?: string, contactId?: string, currency?: string, isCurrent?: boolean, metadata?: object, name?: string, sessionKey?: string } | string,
|
|
133
|
+
...rest: [(string)?, (string)?, (boolean)?, (object)?, (string)?, (string)?]
|
|
136
134
|
): Promise<Models.Cart> {
|
|
137
|
-
let params: { channelId?: string, contactId?: string, currency?: string, isCurrent?: boolean,
|
|
135
|
+
let params: { channelId?: string, contactId?: string, currency?: string, isCurrent?: boolean, metadata?: object, name?: string, sessionKey?: string };
|
|
138
136
|
|
|
139
137
|
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
140
|
-
params = (paramsOrFirst || {}) as { channelId?: string, contactId?: string, currency?: string, isCurrent?: boolean,
|
|
138
|
+
params = (paramsOrFirst || {}) as { channelId?: string, contactId?: string, currency?: string, isCurrent?: boolean, metadata?: object, name?: string, sessionKey?: string };
|
|
141
139
|
} else {
|
|
142
140
|
params = {
|
|
143
141
|
channelId: paramsOrFirst as string,
|
|
144
142
|
contactId: rest[0] as string,
|
|
145
143
|
currency: rest[1] as string,
|
|
146
144
|
isCurrent: rest[2] as boolean,
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
sessionKey: rest[6] as string
|
|
145
|
+
metadata: rest[3] as object,
|
|
146
|
+
name: rest[4] as string,
|
|
147
|
+
sessionKey: rest[5] as string
|
|
151
148
|
};
|
|
152
149
|
}
|
|
153
150
|
|
|
@@ -155,7 +152,6 @@ export class Carts {
|
|
|
155
152
|
const contactId = params.contactId;
|
|
156
153
|
const currency = params.currency;
|
|
157
154
|
const isCurrent = params.isCurrent;
|
|
158
|
-
const marketId = params.marketId;
|
|
159
155
|
const metadata = params.metadata;
|
|
160
156
|
const name = params.name;
|
|
161
157
|
const sessionKey = params.sessionKey;
|
|
@@ -175,9 +171,6 @@ export class Carts {
|
|
|
175
171
|
if (typeof isCurrent !== 'undefined') {
|
|
176
172
|
apiPayload['is_current'] = isCurrent;
|
|
177
173
|
}
|
|
178
|
-
if (typeof marketId !== 'undefined') {
|
|
179
|
-
apiPayload['market_id'] = marketId;
|
|
180
|
-
}
|
|
181
174
|
if (typeof metadata !== 'undefined') {
|
|
182
175
|
apiPayload['metadata'] = metadata;
|
|
183
176
|
}
|
|
@@ -1444,49 +1437,45 @@ export class Carts {
|
|
|
1444
1437
|
* @param {string} params.id -
|
|
1445
1438
|
* @param {string} params.channelId -
|
|
1446
1439
|
* @param {string} params.currency - ISO 4217 code.
|
|
1447
|
-
* @param {string} params.marketId -
|
|
1448
1440
|
* @param {object} params.metadata - Free-form metadata.
|
|
1449
1441
|
* @param {string} params.name -
|
|
1450
1442
|
* @throws {RevenexxException}
|
|
1451
1443
|
* @returns {Promise<Models.Cart>}
|
|
1452
1444
|
*/
|
|
1453
|
-
cartsUpdate(params: { id: string, channelId?: string, currency?: string,
|
|
1445
|
+
cartsUpdate(params: { id: string, channelId?: string, currency?: string, metadata?: object, name?: string }): Promise<Models.Cart>;
|
|
1454
1446
|
/**
|
|
1455
1447
|
*
|
|
1456
1448
|
* @param {string} id -
|
|
1457
1449
|
* @param {string} channelId -
|
|
1458
1450
|
* @param {string} currency - ISO 4217 code.
|
|
1459
|
-
* @param {string} marketId -
|
|
1460
1451
|
* @param {object} metadata - Free-form metadata.
|
|
1461
1452
|
* @param {string} name -
|
|
1462
1453
|
* @throws {RevenexxException}
|
|
1463
1454
|
* @returns {Promise<Models.Cart>}
|
|
1464
1455
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1465
1456
|
*/
|
|
1466
|
-
cartsUpdate(id: string, channelId?: string, currency?: string,
|
|
1457
|
+
cartsUpdate(id: string, channelId?: string, currency?: string, metadata?: object, name?: string): Promise<Models.Cart>;
|
|
1467
1458
|
cartsUpdate(
|
|
1468
|
-
paramsOrFirst: { id: string, channelId?: string, currency?: string,
|
|
1469
|
-
...rest: [(string)?, (string)?, (
|
|
1459
|
+
paramsOrFirst: { id: string, channelId?: string, currency?: string, metadata?: object, name?: string } | string,
|
|
1460
|
+
...rest: [(string)?, (string)?, (object)?, (string)?]
|
|
1470
1461
|
): Promise<Models.Cart> {
|
|
1471
|
-
let params: { id: string, channelId?: string, currency?: string,
|
|
1462
|
+
let params: { id: string, channelId?: string, currency?: string, metadata?: object, name?: string };
|
|
1472
1463
|
|
|
1473
1464
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1474
|
-
params = (paramsOrFirst || {}) as { id: string, channelId?: string, currency?: string,
|
|
1465
|
+
params = (paramsOrFirst || {}) as { id: string, channelId?: string, currency?: string, metadata?: object, name?: string };
|
|
1475
1466
|
} else {
|
|
1476
1467
|
params = {
|
|
1477
1468
|
id: paramsOrFirst as string,
|
|
1478
1469
|
channelId: rest[0] as string,
|
|
1479
1470
|
currency: rest[1] as string,
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
name: rest[4] as string
|
|
1471
|
+
metadata: rest[2] as object,
|
|
1472
|
+
name: rest[3] as string
|
|
1483
1473
|
};
|
|
1484
1474
|
}
|
|
1485
1475
|
|
|
1486
1476
|
const id = params.id;
|
|
1487
1477
|
const channelId = params.channelId;
|
|
1488
1478
|
const currency = params.currency;
|
|
1489
|
-
const marketId = params.marketId;
|
|
1490
1479
|
const metadata = params.metadata;
|
|
1491
1480
|
const name = params.name;
|
|
1492
1481
|
|
|
@@ -1502,9 +1491,6 @@ export class Carts {
|
|
|
1502
1491
|
if (typeof currency !== 'undefined') {
|
|
1503
1492
|
apiPayload['currency'] = currency;
|
|
1504
1493
|
}
|
|
1505
|
-
if (typeof marketId !== 'undefined') {
|
|
1506
|
-
apiPayload['market_id'] = marketId;
|
|
1507
|
-
}
|
|
1508
1494
|
if (typeof metadata !== 'undefined') {
|
|
1509
1495
|
apiPayload['metadata'] = metadata;
|
|
1510
1496
|
}
|
package/src/services/orders.ts
CHANGED
|
@@ -22,7 +22,6 @@ export class Orders {
|
|
|
22
22
|
* @param {string} params.contactId - Filter to one ordering contact.
|
|
23
23
|
* @param {string} params.organizationId - Filter to one B2B organization.
|
|
24
24
|
* @param {string} params.channelId - Filter to one sales channel.
|
|
25
|
-
* @param {string} params.marketId - Filter to one market.
|
|
26
25
|
* @param {string} params.number - Filter by exact order number.
|
|
27
26
|
* @param {number} params.limit - Page size (default 50, max 200).
|
|
28
27
|
* @param {number} params.offset - Row offset for pagination (default 0).
|
|
@@ -30,7 +29,7 @@ export class Orders {
|
|
|
30
29
|
* @throws {RevenexxException}
|
|
31
30
|
* @returns {Promise<{}>}
|
|
32
31
|
*/
|
|
33
|
-
ordersList(params?: { status?: OrderStatus, paymentStatus?: OrderPaymentStatus, fulfillmentStatus?: OrderFulfillmentStatus, contactId?: string, organizationId?: string, channelId?: string,
|
|
32
|
+
ordersList(params?: { status?: OrderStatus, paymentStatus?: OrderPaymentStatus, fulfillmentStatus?: OrderFulfillmentStatus, contactId?: string, organizationId?: string, channelId?: string, number?: string, limit?: number, offset?: number, order?: string }): Promise<{}>;
|
|
34
33
|
/**
|
|
35
34
|
*
|
|
36
35
|
* @param {OrderStatus} status - Filter by order status (exact match).
|
|
@@ -39,7 +38,6 @@ export class Orders {
|
|
|
39
38
|
* @param {string} contactId - Filter to one ordering contact.
|
|
40
39
|
* @param {string} organizationId - Filter to one B2B organization.
|
|
41
40
|
* @param {string} channelId - Filter to one sales channel.
|
|
42
|
-
* @param {string} marketId - Filter to one market.
|
|
43
41
|
* @param {string} number - Filter by exact order number.
|
|
44
42
|
* @param {number} limit - Page size (default 50, max 200).
|
|
45
43
|
* @param {number} offset - Row offset for pagination (default 0).
|
|
@@ -48,15 +46,15 @@ export class Orders {
|
|
|
48
46
|
* @returns {Promise<{}>}
|
|
49
47
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
50
48
|
*/
|
|
51
|
-
ordersList(status?: OrderStatus, paymentStatus?: OrderPaymentStatus, fulfillmentStatus?: OrderFulfillmentStatus, contactId?: string, organizationId?: string, channelId?: string,
|
|
49
|
+
ordersList(status?: OrderStatus, paymentStatus?: OrderPaymentStatus, fulfillmentStatus?: OrderFulfillmentStatus, contactId?: string, organizationId?: string, channelId?: string, number?: string, limit?: number, offset?: number, order?: string): Promise<{}>;
|
|
52
50
|
ordersList(
|
|
53
|
-
paramsOrFirst?: { status?: OrderStatus, paymentStatus?: OrderPaymentStatus, fulfillmentStatus?: OrderFulfillmentStatus, contactId?: string, organizationId?: string, channelId?: string,
|
|
54
|
-
...rest: [(OrderPaymentStatus)?, (OrderFulfillmentStatus)?, (string)?, (string)?, (string)?, (string)?, (
|
|
51
|
+
paramsOrFirst?: { status?: OrderStatus, paymentStatus?: OrderPaymentStatus, fulfillmentStatus?: OrderFulfillmentStatus, contactId?: string, organizationId?: string, channelId?: string, number?: string, limit?: number, offset?: number, order?: string } | OrderStatus,
|
|
52
|
+
...rest: [(OrderPaymentStatus)?, (OrderFulfillmentStatus)?, (string)?, (string)?, (string)?, (string)?, (number)?, (number)?, (string)?]
|
|
55
53
|
): Promise<{}> {
|
|
56
|
-
let params: { status?: OrderStatus, paymentStatus?: OrderPaymentStatus, fulfillmentStatus?: OrderFulfillmentStatus, contactId?: string, organizationId?: string, channelId?: string,
|
|
54
|
+
let params: { status?: OrderStatus, paymentStatus?: OrderPaymentStatus, fulfillmentStatus?: OrderFulfillmentStatus, contactId?: string, organizationId?: string, channelId?: string, number?: string, limit?: number, offset?: number, order?: string };
|
|
57
55
|
|
|
58
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('status' in paramsOrFirst || 'paymentStatus' in paramsOrFirst || 'fulfillmentStatus' in paramsOrFirst || 'contactId' in paramsOrFirst || 'organizationId' in paramsOrFirst || 'channelId' in paramsOrFirst || '
|
|
59
|
-
params = (paramsOrFirst || {}) as { status?: OrderStatus, paymentStatus?: OrderPaymentStatus, fulfillmentStatus?: OrderFulfillmentStatus, contactId?: string, organizationId?: string, channelId?: string,
|
|
56
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('status' in paramsOrFirst || 'paymentStatus' in paramsOrFirst || 'fulfillmentStatus' in paramsOrFirst || 'contactId' in paramsOrFirst || 'organizationId' in paramsOrFirst || 'channelId' in paramsOrFirst || 'number' in paramsOrFirst || 'limit' in paramsOrFirst || 'offset' in paramsOrFirst || 'order' in paramsOrFirst))) {
|
|
57
|
+
params = (paramsOrFirst || {}) as { status?: OrderStatus, paymentStatus?: OrderPaymentStatus, fulfillmentStatus?: OrderFulfillmentStatus, contactId?: string, organizationId?: string, channelId?: string, number?: string, limit?: number, offset?: number, order?: string };
|
|
60
58
|
} else {
|
|
61
59
|
params = {
|
|
62
60
|
status: paramsOrFirst as OrderStatus,
|
|
@@ -65,11 +63,10 @@ export class Orders {
|
|
|
65
63
|
contactId: rest[2] as string,
|
|
66
64
|
organizationId: rest[3] as string,
|
|
67
65
|
channelId: rest[4] as string,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
order: rest[9] as string
|
|
66
|
+
number: rest[5] as string,
|
|
67
|
+
limit: rest[6] as number,
|
|
68
|
+
offset: rest[7] as number,
|
|
69
|
+
order: rest[8] as string
|
|
73
70
|
};
|
|
74
71
|
}
|
|
75
72
|
|
|
@@ -79,7 +76,6 @@ export class Orders {
|
|
|
79
76
|
const contactId = params.contactId;
|
|
80
77
|
const organizationId = params.organizationId;
|
|
81
78
|
const channelId = params.channelId;
|
|
82
|
-
const marketId = params.marketId;
|
|
83
79
|
const number = params.number;
|
|
84
80
|
const limit = params.limit;
|
|
85
81
|
const offset = params.offset;
|
|
@@ -106,9 +102,6 @@ export class Orders {
|
|
|
106
102
|
if (typeof channelId !== 'undefined') {
|
|
107
103
|
apiPayload['channel_id'] = channelId;
|
|
108
104
|
}
|
|
109
|
-
if (typeof marketId !== 'undefined') {
|
|
110
|
-
apiPayload['market_id'] = marketId;
|
|
111
|
-
}
|
|
112
105
|
if (typeof number !== 'undefined') {
|
|
113
106
|
apiPayload['number'] = number;
|
|
114
107
|
}
|
|
@@ -553,7 +546,6 @@ export class Orders {
|
|
|
553
546
|
* @param {string} params.currency - ISO 4217 code (default EUR).
|
|
554
547
|
* @param {string} params.customerOrderNumber - The buyer's own order/PO number.
|
|
555
548
|
* @param {number} params.grandTotal - Override — computed as subtotal + shipping + tax when omitted.
|
|
556
|
-
* @param {string} params.marketId -
|
|
557
549
|
* @param {object} params.metadata - Free-form metadata.
|
|
558
550
|
* @param {string} params.organizationId - B2B organization.
|
|
559
551
|
* @param {object} params.payment - Frozen payment snapshot — a known 'payment.status' seeds payment_status (otherwise 'open').
|
|
@@ -564,7 +556,7 @@ export class Orders {
|
|
|
564
556
|
* @throws {RevenexxException}
|
|
565
557
|
* @returns {Promise<Models.OrderDetail>}
|
|
566
558
|
*/
|
|
567
|
-
ordersPlace(params: { items: Models.OrderItemCreateRequest[], billingAddress?: object, buyer?: object, cartId?: string, channelId?: string, contactId?: string, currency?: string, customerOrderNumber?: string, grandTotal?: number,
|
|
559
|
+
ordersPlace(params: { items: Models.OrderItemCreateRequest[], billingAddress?: object, buyer?: object, cartId?: string, channelId?: string, contactId?: string, currency?: string, customerOrderNumber?: string, grandTotal?: number, metadata?: object, organizationId?: string, payment?: object, shipping?: object, shippingAddress?: object, shippingTotal?: number, userData?: object }): Promise<Models.OrderDetail>;
|
|
568
560
|
/**
|
|
569
561
|
*
|
|
570
562
|
* @param {Models.OrderItemCreateRequest[]} items - The order positions (at most 500).
|
|
@@ -576,7 +568,6 @@ export class Orders {
|
|
|
576
568
|
* @param {string} currency - ISO 4217 code (default EUR).
|
|
577
569
|
* @param {string} customerOrderNumber - The buyer's own order/PO number.
|
|
578
570
|
* @param {number} grandTotal - Override — computed as subtotal + shipping + tax when omitted.
|
|
579
|
-
* @param {string} marketId -
|
|
580
571
|
* @param {object} metadata - Free-form metadata.
|
|
581
572
|
* @param {string} organizationId - B2B organization.
|
|
582
573
|
* @param {object} payment - Frozen payment snapshot — a known 'payment.status' seeds payment_status (otherwise 'open').
|
|
@@ -588,15 +579,15 @@ export class Orders {
|
|
|
588
579
|
* @returns {Promise<Models.OrderDetail>}
|
|
589
580
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
590
581
|
*/
|
|
591
|
-
ordersPlace(items: Models.OrderItemCreateRequest[], billingAddress?: object, buyer?: object, cartId?: string, channelId?: string, contactId?: string, currency?: string, customerOrderNumber?: string, grandTotal?: number,
|
|
582
|
+
ordersPlace(items: Models.OrderItemCreateRequest[], billingAddress?: object, buyer?: object, cartId?: string, channelId?: string, contactId?: string, currency?: string, customerOrderNumber?: string, grandTotal?: number, metadata?: object, organizationId?: string, payment?: object, shipping?: object, shippingAddress?: object, shippingTotal?: number, userData?: object): Promise<Models.OrderDetail>;
|
|
592
583
|
ordersPlace(
|
|
593
|
-
paramsOrFirst: { items: Models.OrderItemCreateRequest[], billingAddress?: object, buyer?: object, cartId?: string, channelId?: string, contactId?: string, currency?: string, customerOrderNumber?: string, grandTotal?: number,
|
|
594
|
-
...rest: [(object)?, (object)?, (string)?, (string)?, (string)?, (string)?, (string)?, (number)?, (
|
|
584
|
+
paramsOrFirst: { items: Models.OrderItemCreateRequest[], billingAddress?: object, buyer?: object, cartId?: string, channelId?: string, contactId?: string, currency?: string, customerOrderNumber?: string, grandTotal?: number, metadata?: object, organizationId?: string, payment?: object, shipping?: object, shippingAddress?: object, shippingTotal?: number, userData?: object } | Models.OrderItemCreateRequest[],
|
|
585
|
+
...rest: [(object)?, (object)?, (string)?, (string)?, (string)?, (string)?, (string)?, (number)?, (object)?, (string)?, (object)?, (object)?, (object)?, (number)?, (object)?]
|
|
595
586
|
): Promise<Models.OrderDetail> {
|
|
596
|
-
let params: { items: Models.OrderItemCreateRequest[], billingAddress?: object, buyer?: object, cartId?: string, channelId?: string, contactId?: string, currency?: string, customerOrderNumber?: string, grandTotal?: number,
|
|
587
|
+
let params: { items: Models.OrderItemCreateRequest[], billingAddress?: object, buyer?: object, cartId?: string, channelId?: string, contactId?: string, currency?: string, customerOrderNumber?: string, grandTotal?: number, metadata?: object, organizationId?: string, payment?: object, shipping?: object, shippingAddress?: object, shippingTotal?: number, userData?: object };
|
|
597
588
|
|
|
598
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('items' in paramsOrFirst || 'billingAddress' in paramsOrFirst || 'buyer' in paramsOrFirst || 'cartId' in paramsOrFirst || 'channelId' in paramsOrFirst || 'contactId' in paramsOrFirst || 'currency' in paramsOrFirst || 'customerOrderNumber' in paramsOrFirst || 'grandTotal' in paramsOrFirst || '
|
|
599
|
-
params = (paramsOrFirst || {}) as { items: Models.OrderItemCreateRequest[], billingAddress?: object, buyer?: object, cartId?: string, channelId?: string, contactId?: string, currency?: string, customerOrderNumber?: string, grandTotal?: number,
|
|
589
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('items' in paramsOrFirst || 'billingAddress' in paramsOrFirst || 'buyer' in paramsOrFirst || 'cartId' in paramsOrFirst || 'channelId' in paramsOrFirst || 'contactId' in paramsOrFirst || 'currency' in paramsOrFirst || 'customerOrderNumber' in paramsOrFirst || 'grandTotal' in paramsOrFirst || 'metadata' in paramsOrFirst || 'organizationId' in paramsOrFirst || 'payment' in paramsOrFirst || 'shipping' in paramsOrFirst || 'shippingAddress' in paramsOrFirst || 'shippingTotal' in paramsOrFirst || 'userData' in paramsOrFirst))) {
|
|
590
|
+
params = (paramsOrFirst || {}) as { items: Models.OrderItemCreateRequest[], billingAddress?: object, buyer?: object, cartId?: string, channelId?: string, contactId?: string, currency?: string, customerOrderNumber?: string, grandTotal?: number, metadata?: object, organizationId?: string, payment?: object, shipping?: object, shippingAddress?: object, shippingTotal?: number, userData?: object };
|
|
600
591
|
} else {
|
|
601
592
|
params = {
|
|
602
593
|
items: paramsOrFirst as Models.OrderItemCreateRequest[],
|
|
@@ -608,14 +599,13 @@ export class Orders {
|
|
|
608
599
|
currency: rest[5] as string,
|
|
609
600
|
customerOrderNumber: rest[6] as string,
|
|
610
601
|
grandTotal: rest[7] as number,
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
userData: rest[15] as object
|
|
602
|
+
metadata: rest[8] as object,
|
|
603
|
+
organizationId: rest[9] as string,
|
|
604
|
+
payment: rest[10] as object,
|
|
605
|
+
shipping: rest[11] as object,
|
|
606
|
+
shippingAddress: rest[12] as object,
|
|
607
|
+
shippingTotal: rest[13] as number,
|
|
608
|
+
userData: rest[14] as object
|
|
619
609
|
};
|
|
620
610
|
}
|
|
621
611
|
|
|
@@ -628,7 +618,6 @@ export class Orders {
|
|
|
628
618
|
const currency = params.currency;
|
|
629
619
|
const customerOrderNumber = params.customerOrderNumber;
|
|
630
620
|
const grandTotal = params.grandTotal;
|
|
631
|
-
const marketId = params.marketId;
|
|
632
621
|
const metadata = params.metadata;
|
|
633
622
|
const organizationId = params.organizationId;
|
|
634
623
|
const payment = params.payment;
|
|
@@ -670,9 +659,6 @@ export class Orders {
|
|
|
670
659
|
if (typeof items !== 'undefined') {
|
|
671
660
|
apiPayload['items'] = Client.toWireKeys(items, {"costCenter":{"wire":"cost_center","children":null},"positionText":{"wire":"position_text","children":null},"productId":{"wire":"product_id","children":null},"taxAmount":{"wire":"tax_amount","children":null},"taxRate":{"wire":"tax_rate","children":null},"unitPrice":{"wire":"unit_price","children":null},"userData":{"wire":"user_data","children":null}});
|
|
672
661
|
}
|
|
673
|
-
if (typeof marketId !== 'undefined') {
|
|
674
|
-
apiPayload['market_id'] = marketId;
|
|
675
|
-
}
|
|
676
662
|
if (typeof metadata !== 'undefined') {
|
|
677
663
|
apiPayload['metadata'] = metadata;
|
|
678
664
|
}
|
package/src/services/prices.ts
CHANGED
|
@@ -86,10 +86,10 @@ export class Prices {
|
|
|
86
86
|
* @param {string} params.description -
|
|
87
87
|
* @param {boolean} params.isDefault - Default lists resolve last within their group.
|
|
88
88
|
* @param {object} params.labels - Localised names ({de, en, …}).
|
|
89
|
-
* @param {string} params.marketId - Scope: only this market.
|
|
90
89
|
* @param {object} params.metadata - Free-form metadata.
|
|
91
90
|
* @param {string} params.organizationId - Scope: only this organization.
|
|
92
91
|
* @param {number} params.priority - Tie-breaker within a specificity group (higher wins, default 0).
|
|
92
|
+
* @param {boolean} params.requiresAuth - Gate: when true the list resolves only for an authenticated buyer (contact or organization context); anonymous resolve calls get on_request. Default false (open to everyone).
|
|
93
93
|
* @param {PriceListStatus} params.status - Default 'active' — only active lists resolve.
|
|
94
94
|
* @param {boolean} params.taxIncluded - Gross (true) or net (false, default) prices.
|
|
95
95
|
* @param {string} params.validFrom - Validity window start.
|
|
@@ -97,7 +97,7 @@ export class Prices {
|
|
|
97
97
|
* @throws {RevenexxException}
|
|
98
98
|
* @returns {Promise<Models.PriceList>}
|
|
99
99
|
*/
|
|
100
|
-
pricesListsCreate(params: { code: string, name: string, channelId?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object,
|
|
100
|
+
pricesListsCreate(params: { code: string, name: string, channelId?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object, metadata?: object, organizationId?: string, priority?: number, requiresAuth?: boolean, status?: PriceListStatus, taxIncluded?: boolean, validFrom?: string, validUntil?: string }): Promise<Models.PriceList>;
|
|
101
101
|
/**
|
|
102
102
|
*
|
|
103
103
|
* @param {string} code - Unique list code per tenant.
|
|
@@ -108,10 +108,10 @@ export class Prices {
|
|
|
108
108
|
* @param {string} description -
|
|
109
109
|
* @param {boolean} isDefault - Default lists resolve last within their group.
|
|
110
110
|
* @param {object} labels - Localised names ({de, en, …}).
|
|
111
|
-
* @param {string} marketId - Scope: only this market.
|
|
112
111
|
* @param {object} metadata - Free-form metadata.
|
|
113
112
|
* @param {string} organizationId - Scope: only this organization.
|
|
114
113
|
* @param {number} priority - Tie-breaker within a specificity group (higher wins, default 0).
|
|
114
|
+
* @param {boolean} requiresAuth - Gate: when true the list resolves only for an authenticated buyer (contact or organization context); anonymous resolve calls get on_request. Default false (open to everyone).
|
|
115
115
|
* @param {PriceListStatus} status - Default 'active' — only active lists resolve.
|
|
116
116
|
* @param {boolean} taxIncluded - Gross (true) or net (false, default) prices.
|
|
117
117
|
* @param {string} validFrom - Validity window start.
|
|
@@ -120,15 +120,15 @@ export class Prices {
|
|
|
120
120
|
* @returns {Promise<Models.PriceList>}
|
|
121
121
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
122
122
|
*/
|
|
123
|
-
pricesListsCreate(code: string, name: string, channelId?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object,
|
|
123
|
+
pricesListsCreate(code: string, name: string, channelId?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object, metadata?: object, organizationId?: string, priority?: number, requiresAuth?: boolean, status?: PriceListStatus, taxIncluded?: boolean, validFrom?: string, validUntil?: string): Promise<Models.PriceList>;
|
|
124
124
|
pricesListsCreate(
|
|
125
|
-
paramsOrFirst: { code: string, name: string, channelId?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object,
|
|
126
|
-
...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?, (object)?, (
|
|
125
|
+
paramsOrFirst: { code: string, name: string, channelId?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object, metadata?: object, organizationId?: string, priority?: number, requiresAuth?: boolean, status?: PriceListStatus, taxIncluded?: boolean, validFrom?: string, validUntil?: string } | string,
|
|
126
|
+
...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?, (object)?, (object)?, (string)?, (number)?, (boolean)?, (PriceListStatus)?, (boolean)?, (string)?, (string)?]
|
|
127
127
|
): Promise<Models.PriceList> {
|
|
128
|
-
let params: { code: string, name: string, channelId?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object,
|
|
128
|
+
let params: { code: string, name: string, channelId?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object, metadata?: object, organizationId?: string, priority?: number, requiresAuth?: boolean, status?: PriceListStatus, taxIncluded?: boolean, validFrom?: string, validUntil?: string };
|
|
129
129
|
|
|
130
130
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
131
|
-
params = (paramsOrFirst || {}) as { code: string, name: string, channelId?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object,
|
|
131
|
+
params = (paramsOrFirst || {}) as { code: string, name: string, channelId?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object, metadata?: object, organizationId?: string, priority?: number, requiresAuth?: boolean, status?: PriceListStatus, taxIncluded?: boolean, validFrom?: string, validUntil?: string };
|
|
132
132
|
} else {
|
|
133
133
|
params = {
|
|
134
134
|
code: paramsOrFirst as string,
|
|
@@ -139,10 +139,10 @@ export class Prices {
|
|
|
139
139
|
description: rest[4] as string,
|
|
140
140
|
isDefault: rest[5] as boolean,
|
|
141
141
|
labels: rest[6] as object,
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
142
|
+
metadata: rest[7] as object,
|
|
143
|
+
organizationId: rest[8] as string,
|
|
144
|
+
priority: rest[9] as number,
|
|
145
|
+
requiresAuth: rest[10] as boolean,
|
|
146
146
|
status: rest[11] as PriceListStatus,
|
|
147
147
|
taxIncluded: rest[12] as boolean,
|
|
148
148
|
validFrom: rest[13] as string,
|
|
@@ -158,10 +158,10 @@ export class Prices {
|
|
|
158
158
|
const description = params.description;
|
|
159
159
|
const isDefault = params.isDefault;
|
|
160
160
|
const labels = params.labels;
|
|
161
|
-
const marketId = params.marketId;
|
|
162
161
|
const metadata = params.metadata;
|
|
163
162
|
const organizationId = params.organizationId;
|
|
164
163
|
const priority = params.priority;
|
|
164
|
+
const requiresAuth = params.requiresAuth;
|
|
165
165
|
const status = params.status;
|
|
166
166
|
const taxIncluded = params.taxIncluded;
|
|
167
167
|
const validFrom = params.validFrom;
|
|
@@ -197,9 +197,6 @@ export class Prices {
|
|
|
197
197
|
if (typeof labels !== 'undefined') {
|
|
198
198
|
apiPayload['labels'] = labels;
|
|
199
199
|
}
|
|
200
|
-
if (typeof marketId !== 'undefined') {
|
|
201
|
-
apiPayload['market_id'] = marketId;
|
|
202
|
-
}
|
|
203
200
|
if (typeof metadata !== 'undefined') {
|
|
204
201
|
apiPayload['metadata'] = metadata;
|
|
205
202
|
}
|
|
@@ -212,6 +209,9 @@ export class Prices {
|
|
|
212
209
|
if (typeof priority !== 'undefined') {
|
|
213
210
|
apiPayload['priority'] = priority;
|
|
214
211
|
}
|
|
212
|
+
if (typeof requiresAuth !== 'undefined') {
|
|
213
|
+
apiPayload['requires_auth'] = requiresAuth;
|
|
214
|
+
}
|
|
215
215
|
if (typeof status !== 'undefined') {
|
|
216
216
|
apiPayload['status'] = status;
|
|
217
217
|
}
|
|
@@ -368,11 +368,11 @@ export class Prices {
|
|
|
368
368
|
* @param {string} params.description -
|
|
369
369
|
* @param {boolean} params.isDefault - Default lists resolve last within their group.
|
|
370
370
|
* @param {object} params.labels - Localised names ({de, en, …}).
|
|
371
|
-
* @param {string} params.marketId - Scope: only this market.
|
|
372
371
|
* @param {object} params.metadata - Free-form metadata.
|
|
373
372
|
* @param {string} params.name -
|
|
374
373
|
* @param {string} params.organizationId - Scope: only this organization.
|
|
375
374
|
* @param {number} params.priority - Tie-breaker within a specificity group (higher wins, default 0).
|
|
375
|
+
* @param {boolean} params.requiresAuth - Gate: when true the list resolves only for an authenticated buyer (contact or organization context); anonymous resolve calls get on_request. Default false (open to everyone).
|
|
376
376
|
* @param {PriceListStatus} params.status - Default 'active' — only active lists resolve.
|
|
377
377
|
* @param {boolean} params.taxIncluded - Gross (true) or net (false, default) prices.
|
|
378
378
|
* @param {string} params.validFrom - Validity window start.
|
|
@@ -380,7 +380,7 @@ export class Prices {
|
|
|
380
380
|
* @throws {RevenexxException}
|
|
381
381
|
* @returns {Promise<Models.PriceList>}
|
|
382
382
|
*/
|
|
383
|
-
pricesListsUpdate(params: { id: string, channelId?: string, code?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object,
|
|
383
|
+
pricesListsUpdate(params: { id: string, channelId?: string, code?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object, metadata?: object, name?: string, organizationId?: string, priority?: number, requiresAuth?: boolean, status?: PriceListStatus, taxIncluded?: boolean, validFrom?: string, validUntil?: string }): Promise<Models.PriceList>;
|
|
384
384
|
/**
|
|
385
385
|
*
|
|
386
386
|
* @param {string} id -
|
|
@@ -391,11 +391,11 @@ export class Prices {
|
|
|
391
391
|
* @param {string} description -
|
|
392
392
|
* @param {boolean} isDefault - Default lists resolve last within their group.
|
|
393
393
|
* @param {object} labels - Localised names ({de, en, …}).
|
|
394
|
-
* @param {string} marketId - Scope: only this market.
|
|
395
394
|
* @param {object} metadata - Free-form metadata.
|
|
396
395
|
* @param {string} name -
|
|
397
396
|
* @param {string} organizationId - Scope: only this organization.
|
|
398
397
|
* @param {number} priority - Tie-breaker within a specificity group (higher wins, default 0).
|
|
398
|
+
* @param {boolean} requiresAuth - Gate: when true the list resolves only for an authenticated buyer (contact or organization context); anonymous resolve calls get on_request. Default false (open to everyone).
|
|
399
399
|
* @param {PriceListStatus} status - Default 'active' — only active lists resolve.
|
|
400
400
|
* @param {boolean} taxIncluded - Gross (true) or net (false, default) prices.
|
|
401
401
|
* @param {string} validFrom - Validity window start.
|
|
@@ -404,15 +404,15 @@ export class Prices {
|
|
|
404
404
|
* @returns {Promise<Models.PriceList>}
|
|
405
405
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
406
406
|
*/
|
|
407
|
-
pricesListsUpdate(id: string, channelId?: string, code?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object,
|
|
407
|
+
pricesListsUpdate(id: string, channelId?: string, code?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object, metadata?: object, name?: string, organizationId?: string, priority?: number, requiresAuth?: boolean, status?: PriceListStatus, taxIncluded?: boolean, validFrom?: string, validUntil?: string): Promise<Models.PriceList>;
|
|
408
408
|
pricesListsUpdate(
|
|
409
|
-
paramsOrFirst: { id: string, channelId?: string, code?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object,
|
|
410
|
-
...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?, (object)?, (
|
|
409
|
+
paramsOrFirst: { id: string, channelId?: string, code?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object, metadata?: object, name?: string, organizationId?: string, priority?: number, requiresAuth?: boolean, status?: PriceListStatus, taxIncluded?: boolean, validFrom?: string, validUntil?: string } | string,
|
|
410
|
+
...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?, (object)?, (object)?, (string)?, (string)?, (number)?, (boolean)?, (PriceListStatus)?, (boolean)?, (string)?, (string)?]
|
|
411
411
|
): Promise<Models.PriceList> {
|
|
412
|
-
let params: { id: string, channelId?: string, code?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object,
|
|
412
|
+
let params: { id: string, channelId?: string, code?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object, metadata?: object, name?: string, organizationId?: string, priority?: number, requiresAuth?: boolean, status?: PriceListStatus, taxIncluded?: boolean, validFrom?: string, validUntil?: string };
|
|
413
413
|
|
|
414
414
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
415
|
-
params = (paramsOrFirst || {}) as { id: string, channelId?: string, code?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object,
|
|
415
|
+
params = (paramsOrFirst || {}) as { id: string, channelId?: string, code?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object, metadata?: object, name?: string, organizationId?: string, priority?: number, requiresAuth?: boolean, status?: PriceListStatus, taxIncluded?: boolean, validFrom?: string, validUntil?: string };
|
|
416
416
|
} else {
|
|
417
417
|
params = {
|
|
418
418
|
id: paramsOrFirst as string,
|
|
@@ -423,11 +423,11 @@ export class Prices {
|
|
|
423
423
|
description: rest[4] as string,
|
|
424
424
|
isDefault: rest[5] as boolean,
|
|
425
425
|
labels: rest[6] as object,
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
426
|
+
metadata: rest[7] as object,
|
|
427
|
+
name: rest[8] as string,
|
|
428
|
+
organizationId: rest[9] as string,
|
|
429
|
+
priority: rest[10] as number,
|
|
430
|
+
requiresAuth: rest[11] as boolean,
|
|
431
431
|
status: rest[12] as PriceListStatus,
|
|
432
432
|
taxIncluded: rest[13] as boolean,
|
|
433
433
|
validFrom: rest[14] as string,
|
|
@@ -443,11 +443,11 @@ export class Prices {
|
|
|
443
443
|
const description = params.description;
|
|
444
444
|
const isDefault = params.isDefault;
|
|
445
445
|
const labels = params.labels;
|
|
446
|
-
const marketId = params.marketId;
|
|
447
446
|
const metadata = params.metadata;
|
|
448
447
|
const name = params.name;
|
|
449
448
|
const organizationId = params.organizationId;
|
|
450
449
|
const priority = params.priority;
|
|
450
|
+
const requiresAuth = params.requiresAuth;
|
|
451
451
|
const status = params.status;
|
|
452
452
|
const taxIncluded = params.taxIncluded;
|
|
453
453
|
const validFrom = params.validFrom;
|
|
@@ -480,9 +480,6 @@ export class Prices {
|
|
|
480
480
|
if (typeof labels !== 'undefined') {
|
|
481
481
|
apiPayload['labels'] = labels;
|
|
482
482
|
}
|
|
483
|
-
if (typeof marketId !== 'undefined') {
|
|
484
|
-
apiPayload['market_id'] = marketId;
|
|
485
|
-
}
|
|
486
483
|
if (typeof metadata !== 'undefined') {
|
|
487
484
|
apiPayload['metadata'] = metadata;
|
|
488
485
|
}
|
|
@@ -495,6 +492,9 @@ export class Prices {
|
|
|
495
492
|
if (typeof priority !== 'undefined') {
|
|
496
493
|
apiPayload['priority'] = priority;
|
|
497
494
|
}
|
|
495
|
+
if (typeof requiresAuth !== 'undefined') {
|
|
496
|
+
apiPayload['requires_auth'] = requiresAuth;
|
|
497
|
+
}
|
|
498
498
|
if (typeof status !== 'undefined') {
|
|
499
499
|
apiPayload['status'] = status;
|
|
500
500
|
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Service } from '../service';
|
|
2
|
+
import { RevenexxException, Client, type Payload, UploadProgress } from '../client';
|
|
3
|
+
import type { Models } from '../models';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export class Settings {
|
|
7
|
+
client: Client;
|
|
8
|
+
|
|
9
|
+
constructor(client: Client) {
|
|
10
|
+
this.client = client;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The tenant's effective settings for the app — the declared schema's defaults merged with stored tenant/market values. Sensitive settings are masked (listed in `masked`, omitted from `settings`).
|
|
15
|
+
*
|
|
16
|
+
* @param {string} params.app - App name, e.g. `pages`.
|
|
17
|
+
* @param {string} params.market - Resolve market-scoped settings for this market code; falls back to the tenant value.
|
|
18
|
+
* @throws {RevenexxException}
|
|
19
|
+
* @returns {Promise<{}>}
|
|
20
|
+
*/
|
|
21
|
+
settingsGetAppSettings(params: { app: string, market?: string }): Promise<{}>;
|
|
22
|
+
/**
|
|
23
|
+
* The tenant's effective settings for the app — the declared schema's defaults merged with stored tenant/market values. Sensitive settings are masked (listed in `masked`, omitted from `settings`).
|
|
24
|
+
*
|
|
25
|
+
* @param {string} app - App name, e.g. `pages`.
|
|
26
|
+
* @param {string} market - Resolve market-scoped settings for this market code; falls back to the tenant value.
|
|
27
|
+
* @throws {RevenexxException}
|
|
28
|
+
* @returns {Promise<{}>}
|
|
29
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
30
|
+
*/
|
|
31
|
+
settingsGetAppSettings(app: string, market?: string): Promise<{}>;
|
|
32
|
+
settingsGetAppSettings(
|
|
33
|
+
paramsOrFirst: { app: string, market?: string } | string,
|
|
34
|
+
...rest: [(string)?]
|
|
35
|
+
): Promise<{}> {
|
|
36
|
+
let params: { app: string, market?: string };
|
|
37
|
+
|
|
38
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
39
|
+
params = (paramsOrFirst || {}) as { app: string, market?: string };
|
|
40
|
+
} else {
|
|
41
|
+
params = {
|
|
42
|
+
app: paramsOrFirst as string,
|
|
43
|
+
market: rest[0] as string
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const app = params.app;
|
|
48
|
+
const market = params.market;
|
|
49
|
+
|
|
50
|
+
if (typeof app === 'undefined') {
|
|
51
|
+
throw new RevenexxException('Missing required parameter: "app"');
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const apiPath = '/v1/settings/apps/{app}'.replace('{app}', app);
|
|
55
|
+
const apiPayload: Payload = {};
|
|
56
|
+
if (typeof market !== 'undefined') {
|
|
57
|
+
apiPayload['market'] = market;
|
|
58
|
+
}
|
|
59
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
60
|
+
|
|
61
|
+
const apiHeaders: { [header: string]: string } = {
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return this.client.call(
|
|
65
|
+
'get',
|
|
66
|
+
uri,
|
|
67
|
+
apiHeaders,
|
|
68
|
+
apiPayload
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
}
|
package/types/client.d.ts
CHANGED
|
@@ -102,6 +102,7 @@ declare class Client {
|
|
|
102
102
|
endpoint: string;
|
|
103
103
|
endpointRealtime: string;
|
|
104
104
|
tenant: string;
|
|
105
|
+
market: string;
|
|
105
106
|
apikeyauth: string;
|
|
106
107
|
bearerauth: string;
|
|
107
108
|
};
|
|
@@ -138,6 +139,17 @@ declare class Client {
|
|
|
138
139
|
* @return {this}
|
|
139
140
|
*/
|
|
140
141
|
setTenant(value: string): this;
|
|
142
|
+
/**
|
|
143
|
+
* Set Market
|
|
144
|
+
*
|
|
145
|
+
* The active market slug to scope requests to, sent as the
|
|
146
|
+
* X-Revenexx-Market header. Optional — omit it to see only global rows.
|
|
147
|
+
*
|
|
148
|
+
* @param value string
|
|
149
|
+
*
|
|
150
|
+
* @return {this}
|
|
151
|
+
*/
|
|
152
|
+
setMarket(value: string): this;
|
|
141
153
|
/**
|
|
142
154
|
* Set ApiKeyAuth
|
|
143
155
|
*
|
package/types/index.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export { Payments } from './services/payments';
|
|
|
23
23
|
export { Prices } from './services/prices';
|
|
24
24
|
export { Products } from './services/products';
|
|
25
25
|
export { Search } from './services/search';
|
|
26
|
+
export { Settings } from './services/settings';
|
|
26
27
|
export { Shipping } from './services/shipping';
|
|
27
28
|
export { Sites } from './services/sites';
|
|
28
29
|
export { Storage } from './services/storage';
|