@thorprovider/medusa-extended 1.13.4 → 1.14.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thorprovider/medusa-extended",
3
- "version": "1.13.4",
3
+ "version": "1.14.1",
4
4
  "description": "Thor Commerce multi-tenant admin extensions for Medusa v2",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@thorprovider/adapters": "^5.0.8",
28
- "@thorprovider/types": "^5.7.1"
28
+ "@thorprovider/types": "^5.7.10"
29
29
  },
30
30
  "devDependencies": {
31
31
  "msw": "^2.12.3",
@@ -43,6 +43,8 @@ import type {
43
43
  ExtendedCreateDropshipperOrderResponse,
44
44
  SetPaymentCollectorBody,
45
45
  SetPaymentCollectorResponse,
46
+ ValidateGiftCardBody,
47
+ ValidateGiftCardResponse,
46
48
  // Order Cancel & Edits
47
49
  CancelDropshipperOrderResponse,
48
50
  CreateOrderEditBody,
@@ -67,6 +69,9 @@ import type {
67
69
  ConvertDropshipperDraftOrderBody,
68
70
  ConvertDropshipperDraftOrderResponse,
69
71
  DeleteDropshipperDraftOrderResponse,
72
+ // Order totals preview
73
+ PreviewDropshipperOrderTotalsBody,
74
+ PreviewDropshipperOrderTotalsResponse,
70
75
  // Dropshipper Addresses
71
76
  DropshipperAddressBody,
72
77
  DropshipperAddressResponse,
@@ -869,6 +874,44 @@ export class DropshipperClient {
869
874
  );
870
875
  }
871
876
 
877
+ /**
878
+ * Validate a gift card code for the dropshipper's channel (existence, status,
879
+ * currency and channel restriction). Balance is returned when valid.
880
+ *
881
+ * `POST /admin/thor/dropshipper/gift-cards/validate`
882
+ */
883
+ async validateGiftCard(
884
+ body: ValidateGiftCardBody,
885
+ ): Promise<ValidateGiftCardResponse> {
886
+ return this.request<ValidateGiftCardResponse>(
887
+ 'POST',
888
+ '/admin/thor/dropshipper/gift-cards/validate',
889
+ body,
890
+ );
891
+ }
892
+
893
+ /**
894
+ * Preview order totals (including taxes) without creating the order.
895
+ *
896
+ * Replicates the creation pipeline (pricing honoring `unit_price`, region,
897
+ * shipping groups) and computes tax lines with the Medusa tax module, so the
898
+ * totals match what the created order will produce.
899
+ *
900
+ * `POST /admin/thor/dropshipper/orders/preview-totals`
901
+ */
902
+ async previewOrderTotals(
903
+ body: PreviewDropshipperOrderTotalsBody,
904
+ ): Promise<PreviewDropshipperOrderTotalsResponse> {
905
+ return this.request<PreviewDropshipperOrderTotalsResponse>(
906
+ 'POST',
907
+ '/admin/thor/dropshipper/orders/preview-totals',
908
+ {
909
+ ...body,
910
+ currency_code: body.currency_code.toLowerCase(),
911
+ },
912
+ );
913
+ }
914
+
872
915
  /**
873
916
  * Set who collects payment for an order (Solo X).
874
917
  *