@revenexx/sdk 0.0.7 → 0.0.9
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 +94 -2
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +94 -2
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +94 -2
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/enums/fulfillment-status.ts +5 -0
- package/src/enums/payment-status.ts +9 -0
- package/src/enums/status.ts +7 -0
- package/src/services/orders.ts +99 -1
- package/types/enums/fulfillment-status.d.ts +5 -0
- package/types/enums/payment-status.d.ts +9 -0
- package/types/enums/status.d.ts +7 -0
- package/types/services/orders.d.ts +42 -1
package/dist/esm/sdk.js
CHANGED
|
@@ -651,7 +651,7 @@ class Client {
|
|
|
651
651
|
'x-sdk-name': 'Revenexx Web',
|
|
652
652
|
'x-sdk-platform': '',
|
|
653
653
|
'x-sdk-language': 'web',
|
|
654
|
-
'x-sdk-version': '0.0.
|
|
654
|
+
'x-sdk-version': '0.0.9'
|
|
655
655
|
};
|
|
656
656
|
|
|
657
657
|
/**
|
|
@@ -12582,12 +12582,104 @@ class Orders {
|
|
|
12582
12582
|
|
|
12583
12583
|
/**
|
|
12584
12584
|
*
|
|
12585
|
+
* @param {string} params.status - Filter by order status (exact match): pending | placed | in_fulfillment | completed | cancelled.
|
|
12586
|
+
* @param {string} params.paymentStatus - Filter by payment status (exact match): open | pending | authorized | paid | partially_paid | refunded | failed.
|
|
12587
|
+
* @param {string} params.fulfillmentStatus - Filter by fulfillment status (exact match): unfulfilled | partial | fulfilled.
|
|
12588
|
+
* @param {string} params.contactId - Filter to one ordering contact.
|
|
12589
|
+
* @param {string} params.organizationId - Filter to one B2B organization.
|
|
12590
|
+
* @param {string} params.channelId - Filter to one sales channel.
|
|
12591
|
+
* @param {string} params.marketId - Filter to one market.
|
|
12592
|
+
* @param {string} params.number - Filter by exact order number.
|
|
12593
|
+
* @param {number} params.limit - Page size (default 50, max 200).
|
|
12594
|
+
* @param {number} params.offset - Row offset for pagination (default 0).
|
|
12595
|
+
* @param {string} params.order - Sort as 'column.asc' | 'column.desc', e.g. 'created_at.desc'.
|
|
12585
12596
|
* @throws {RevenexxException}
|
|
12586
12597
|
* @returns {Promise<{}>}
|
|
12587
12598
|
*/
|
|
12588
|
-
|
|
12599
|
+
|
|
12600
|
+
/**
|
|
12601
|
+
*
|
|
12602
|
+
* @param {string} status - Filter by order status (exact match): pending | placed | in_fulfillment | completed | cancelled.
|
|
12603
|
+
* @param {string} paymentStatus - Filter by payment status (exact match): open | pending | authorized | paid | partially_paid | refunded | failed.
|
|
12604
|
+
* @param {string} fulfillmentStatus - Filter by fulfillment status (exact match): unfulfilled | partial | fulfilled.
|
|
12605
|
+
* @param {string} contactId - Filter to one ordering contact.
|
|
12606
|
+
* @param {string} organizationId - Filter to one B2B organization.
|
|
12607
|
+
* @param {string} channelId - Filter to one sales channel.
|
|
12608
|
+
* @param {string} marketId - Filter to one market.
|
|
12609
|
+
* @param {string} number - Filter by exact order number.
|
|
12610
|
+
* @param {number} limit - Page size (default 50, max 200).
|
|
12611
|
+
* @param {number} offset - Row offset for pagination (default 0).
|
|
12612
|
+
* @param {string} order - Sort as 'column.asc' | 'column.desc', e.g. 'created_at.desc'.
|
|
12613
|
+
* @throws {RevenexxException}
|
|
12614
|
+
* @returns {Promise<{}>}
|
|
12615
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
12616
|
+
*/
|
|
12617
|
+
|
|
12618
|
+
ordersList(paramsOrFirst, ...rest) {
|
|
12619
|
+
let params;
|
|
12620
|
+
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) {
|
|
12621
|
+
params = paramsOrFirst || {};
|
|
12622
|
+
} else {
|
|
12623
|
+
params = {
|
|
12624
|
+
status: paramsOrFirst,
|
|
12625
|
+
paymentStatus: rest[0],
|
|
12626
|
+
fulfillmentStatus: rest[1],
|
|
12627
|
+
contactId: rest[2],
|
|
12628
|
+
organizationId: rest[3],
|
|
12629
|
+
channelId: rest[4],
|
|
12630
|
+
marketId: rest[5],
|
|
12631
|
+
number: rest[6],
|
|
12632
|
+
limit: rest[7],
|
|
12633
|
+
offset: rest[8],
|
|
12634
|
+
order: rest[9]
|
|
12635
|
+
};
|
|
12636
|
+
}
|
|
12637
|
+
const status = params.status;
|
|
12638
|
+
const paymentStatus = params.paymentStatus;
|
|
12639
|
+
const fulfillmentStatus = params.fulfillmentStatus;
|
|
12640
|
+
const contactId = params.contactId;
|
|
12641
|
+
const organizationId = params.organizationId;
|
|
12642
|
+
const channelId = params.channelId;
|
|
12643
|
+
const marketId = params.marketId;
|
|
12644
|
+
const number = params.number;
|
|
12645
|
+
const limit = params.limit;
|
|
12646
|
+
const offset = params.offset;
|
|
12647
|
+
const order = params.order;
|
|
12589
12648
|
const apiPath = '/v1/orders';
|
|
12590
12649
|
const apiPayload = {};
|
|
12650
|
+
if (typeof status !== 'undefined') {
|
|
12651
|
+
apiPayload['status'] = status;
|
|
12652
|
+
}
|
|
12653
|
+
if (typeof paymentStatus !== 'undefined') {
|
|
12654
|
+
apiPayload['payment_status'] = paymentStatus;
|
|
12655
|
+
}
|
|
12656
|
+
if (typeof fulfillmentStatus !== 'undefined') {
|
|
12657
|
+
apiPayload['fulfillment_status'] = fulfillmentStatus;
|
|
12658
|
+
}
|
|
12659
|
+
if (typeof contactId !== 'undefined') {
|
|
12660
|
+
apiPayload['contact_id'] = contactId;
|
|
12661
|
+
}
|
|
12662
|
+
if (typeof organizationId !== 'undefined') {
|
|
12663
|
+
apiPayload['organization_id'] = organizationId;
|
|
12664
|
+
}
|
|
12665
|
+
if (typeof channelId !== 'undefined') {
|
|
12666
|
+
apiPayload['channel_id'] = channelId;
|
|
12667
|
+
}
|
|
12668
|
+
if (typeof marketId !== 'undefined') {
|
|
12669
|
+
apiPayload['market_id'] = marketId;
|
|
12670
|
+
}
|
|
12671
|
+
if (typeof number !== 'undefined') {
|
|
12672
|
+
apiPayload['number'] = number;
|
|
12673
|
+
}
|
|
12674
|
+
if (typeof limit !== 'undefined') {
|
|
12675
|
+
apiPayload['limit'] = limit;
|
|
12676
|
+
}
|
|
12677
|
+
if (typeof offset !== 'undefined') {
|
|
12678
|
+
apiPayload['offset'] = offset;
|
|
12679
|
+
}
|
|
12680
|
+
if (typeof order !== 'undefined') {
|
|
12681
|
+
apiPayload['order'] = order;
|
|
12682
|
+
}
|
|
12591
12683
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
12592
12684
|
const apiHeaders = {};
|
|
12593
12685
|
return this.client.call('get', uri, apiHeaders, apiPayload);
|