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