@revenexx/sdk 0.0.5 → 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 +7188 -5721
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +7185 -5720
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +7188 -5721
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/enums/order-list-kind.ts +4 -0
- package/src/enums/store-asset-request-visibility.ts +4 -0
- package/src/enums/visibility.ts +4 -0
- package/src/index.ts +4 -2
- package/src/models.ts +1232 -294
- package/src/services/customers.ts +14 -6
- package/src/services/markets.ts +317 -0
- package/src/services/orderlists.ts +889 -0
- package/src/services/pages.ts +293 -7
- package/src/services/prices.ts +70 -9
- package/src/services/products.ts +86 -14
- package/src/services/shipping.ts +26 -19
- package/src/services/storage.ts +910 -576
- package/types/enums/order-list-kind.d.ts +4 -0
- package/types/enums/store-asset-request-visibility.d.ts +4 -0
- package/types/enums/visibility.d.ts +4 -0
- package/types/index.d.ts +4 -2
- package/types/models.d.ts +1199 -283
- package/types/services/customers.d.ts +4 -1
- package/types/services/markets.d.ts +112 -0
- package/types/services/orderlists.d.ts +324 -0
- package/types/services/pages.d.ts +96 -1
- package/types/services/prices.d.ts +24 -4
- package/types/services/products.d.ts +28 -2
- package/types/services/shipping.d.ts +8 -5
- package/types/services/storage.d.ts +353 -285
package/src/services/shipping.ts
CHANGED
|
@@ -617,32 +617,32 @@ export class Shipping {
|
|
|
617
617
|
/**
|
|
618
618
|
*
|
|
619
619
|
* @param {string} params.methodId -
|
|
620
|
-
* @param {Models.
|
|
620
|
+
* @param {Models.ShippingRateTierReplaceItem[]} params.tiers - The complete new tier set (set semantics) — positions are derived from the array order.
|
|
621
621
|
* @throws {RevenexxException}
|
|
622
622
|
* @returns {Promise<{}>}
|
|
623
623
|
*/
|
|
624
|
-
shippingTiersReplace(params: { methodId: string, tiers: Models.
|
|
624
|
+
shippingTiersReplace(params: { methodId: string, tiers: Models.ShippingRateTierReplaceItem[] }): Promise<{}>;
|
|
625
625
|
/**
|
|
626
626
|
*
|
|
627
627
|
* @param {string} methodId -
|
|
628
|
-
* @param {Models.
|
|
628
|
+
* @param {Models.ShippingRateTierReplaceItem[]} tiers - The complete new tier set (set semantics) — positions are derived from the array order.
|
|
629
629
|
* @throws {RevenexxException}
|
|
630
630
|
* @returns {Promise<{}>}
|
|
631
631
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
632
632
|
*/
|
|
633
|
-
shippingTiersReplace(methodId: string, tiers: Models.
|
|
633
|
+
shippingTiersReplace(methodId: string, tiers: Models.ShippingRateTierReplaceItem[]): Promise<{}>;
|
|
634
634
|
shippingTiersReplace(
|
|
635
|
-
paramsOrFirst: { methodId: string, tiers: Models.
|
|
636
|
-
...rest: [(Models.
|
|
635
|
+
paramsOrFirst: { methodId: string, tiers: Models.ShippingRateTierReplaceItem[] } | string,
|
|
636
|
+
...rest: [(Models.ShippingRateTierReplaceItem[])?]
|
|
637
637
|
): Promise<{}> {
|
|
638
|
-
let params: { methodId: string, tiers: Models.
|
|
638
|
+
let params: { methodId: string, tiers: Models.ShippingRateTierReplaceItem[] };
|
|
639
639
|
|
|
640
640
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
641
|
-
params = (paramsOrFirst || {}) as { methodId: string, tiers: Models.
|
|
641
|
+
params = (paramsOrFirst || {}) as { methodId: string, tiers: Models.ShippingRateTierReplaceItem[] };
|
|
642
642
|
} else {
|
|
643
643
|
params = {
|
|
644
644
|
methodId: paramsOrFirst as string,
|
|
645
|
-
tiers: rest[0] as Models.
|
|
645
|
+
tiers: rest[0] as Models.ShippingRateTierReplaceItem[]
|
|
646
646
|
};
|
|
647
647
|
}
|
|
648
648
|
|
|
@@ -873,18 +873,20 @@ export class Shipping {
|
|
|
873
873
|
* @param {object} params.attributes - Measure values for attribute matrices, keyed by attribute name.
|
|
874
874
|
* @param {string} params.country - Destination ISO 3166-1 alpha-2 code — checked against method country restrictions.
|
|
875
875
|
* @param {string} params.currency - Echoed into the rates (default 'EUR').
|
|
876
|
+
* @param {string} params.marketId - Buyer market for tax resolution (else inferred from country, else first market).
|
|
876
877
|
* @param {number} params.orderValue - Order value (default 0) — drives free-above thresholds and order_value matrices.
|
|
877
878
|
* @param {number} params.quantity - Total quantity — measure for quantity matrices.
|
|
878
879
|
* @param {number} params.weight - Total weight — measure for weight matrices.
|
|
879
880
|
* @throws {RevenexxException}
|
|
880
881
|
* @returns {Promise<{}>}
|
|
881
882
|
*/
|
|
882
|
-
shippingRates(params?: { attributes?: object, country?: string, currency?: string, orderValue?: number, quantity?: number, weight?: number }): Promise<{}>;
|
|
883
|
+
shippingRates(params?: { attributes?: object, country?: string, currency?: string, marketId?: string, orderValue?: number, quantity?: number, weight?: number }): Promise<{}>;
|
|
883
884
|
/**
|
|
884
885
|
*
|
|
885
886
|
* @param {object} attributes - Measure values for attribute matrices, keyed by attribute name.
|
|
886
887
|
* @param {string} country - Destination ISO 3166-1 alpha-2 code — checked against method country restrictions.
|
|
887
888
|
* @param {string} currency - Echoed into the rates (default 'EUR').
|
|
889
|
+
* @param {string} marketId - Buyer market for tax resolution (else inferred from country, else first market).
|
|
888
890
|
* @param {number} orderValue - Order value (default 0) — drives free-above thresholds and order_value matrices.
|
|
889
891
|
* @param {number} quantity - Total quantity — measure for quantity matrices.
|
|
890
892
|
* @param {number} weight - Total weight — measure for weight matrices.
|
|
@@ -892,29 +894,31 @@ export class Shipping {
|
|
|
892
894
|
* @returns {Promise<{}>}
|
|
893
895
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
894
896
|
*/
|
|
895
|
-
shippingRates(attributes?: object, country?: string, currency?: string, orderValue?: number, quantity?: number, weight?: number): Promise<{}>;
|
|
897
|
+
shippingRates(attributes?: object, country?: string, currency?: string, marketId?: string, orderValue?: number, quantity?: number, weight?: number): Promise<{}>;
|
|
896
898
|
shippingRates(
|
|
897
|
-
paramsOrFirst?: { attributes?: object, country?: string, currency?: string, orderValue?: number, quantity?: number, weight?: number } | object,
|
|
898
|
-
...rest: [(string)?, (string)?, (number)?, (number)?, (number)?]
|
|
899
|
+
paramsOrFirst?: { attributes?: object, country?: string, currency?: string, marketId?: string, orderValue?: number, quantity?: number, weight?: number } | object,
|
|
900
|
+
...rest: [(string)?, (string)?, (string)?, (number)?, (number)?, (number)?]
|
|
899
901
|
): Promise<{}> {
|
|
900
|
-
let params: { attributes?: object, country?: string, currency?: string, orderValue?: number, quantity?: number, weight?: number };
|
|
902
|
+
let params: { attributes?: object, country?: string, currency?: string, marketId?: string, orderValue?: number, quantity?: number, weight?: number };
|
|
901
903
|
|
|
902
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('attributes' in paramsOrFirst || 'country' in paramsOrFirst || 'currency' in paramsOrFirst || 'orderValue' in paramsOrFirst || 'quantity' in paramsOrFirst || 'weight' in paramsOrFirst))) {
|
|
903
|
-
params = (paramsOrFirst || {}) as { attributes?: object, country?: string, currency?: string, orderValue?: number, quantity?: number, weight?: number };
|
|
904
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('attributes' in paramsOrFirst || 'country' in paramsOrFirst || 'currency' in paramsOrFirst || 'marketId' in paramsOrFirst || 'orderValue' in paramsOrFirst || 'quantity' in paramsOrFirst || 'weight' in paramsOrFirst))) {
|
|
905
|
+
params = (paramsOrFirst || {}) as { attributes?: object, country?: string, currency?: string, marketId?: string, orderValue?: number, quantity?: number, weight?: number };
|
|
904
906
|
} else {
|
|
905
907
|
params = {
|
|
906
908
|
attributes: paramsOrFirst as object,
|
|
907
909
|
country: rest[0] as string,
|
|
908
910
|
currency: rest[1] as string,
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
911
|
+
marketId: rest[2] as string,
|
|
912
|
+
orderValue: rest[3] as number,
|
|
913
|
+
quantity: rest[4] as number,
|
|
914
|
+
weight: rest[5] as number
|
|
912
915
|
};
|
|
913
916
|
}
|
|
914
917
|
|
|
915
918
|
const attributes = params.attributes;
|
|
916
919
|
const country = params.country;
|
|
917
920
|
const currency = params.currency;
|
|
921
|
+
const marketId = params.marketId;
|
|
918
922
|
const orderValue = params.orderValue;
|
|
919
923
|
const quantity = params.quantity;
|
|
920
924
|
const weight = params.weight;
|
|
@@ -931,6 +935,9 @@ export class Shipping {
|
|
|
931
935
|
if (typeof currency !== 'undefined') {
|
|
932
936
|
apiPayload['currency'] = currency;
|
|
933
937
|
}
|
|
938
|
+
if (typeof marketId !== 'undefined') {
|
|
939
|
+
apiPayload['market_id'] = marketId;
|
|
940
|
+
}
|
|
934
941
|
if (typeof orderValue !== 'undefined') {
|
|
935
942
|
apiPayload['order_value'] = orderValue;
|
|
936
943
|
}
|