@revenexx/sdk 0.0.5 → 0.0.7

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.
@@ -617,32 +617,32 @@ export class Shipping {
617
617
  /**
618
618
  *
619
619
  * @param {string} params.methodId -
620
- * @param {Models.ShippingRateTierCreateRequest[]} params.tiers - The complete new tier set (set semantics) — positions are derived from the array order.
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.ShippingRateTierCreateRequest[] }): Promise<{}>;
624
+ shippingTiersReplace(params: { methodId: string, tiers: Models.ShippingRateTierReplaceItem[] }): Promise<{}>;
625
625
  /**
626
626
  *
627
627
  * @param {string} methodId -
628
- * @param {Models.ShippingRateTierCreateRequest[]} tiers - The complete new tier set (set semantics) — positions are derived from the array order.
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.ShippingRateTierCreateRequest[]): Promise<{}>;
633
+ shippingTiersReplace(methodId: string, tiers: Models.ShippingRateTierReplaceItem[]): Promise<{}>;
634
634
  shippingTiersReplace(
635
- paramsOrFirst: { methodId: string, tiers: Models.ShippingRateTierCreateRequest[] } | string,
636
- ...rest: [(Models.ShippingRateTierCreateRequest[])?]
635
+ paramsOrFirst: { methodId: string, tiers: Models.ShippingRateTierReplaceItem[] } | string,
636
+ ...rest: [(Models.ShippingRateTierReplaceItem[])?]
637
637
  ): Promise<{}> {
638
- let params: { methodId: string, tiers: Models.ShippingRateTierCreateRequest[] };
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.ShippingRateTierCreateRequest[] };
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.ShippingRateTierCreateRequest[]
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
- orderValue: rest[2] as number,
910
- quantity: rest[3] as number,
911
- weight: rest[4] as number
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
  }