@thorprovider/types 3.13.3 → 3.13.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.
package/dist/index.d.mts CHANGED
@@ -4133,48 +4133,46 @@ interface DropshipperDraftOrderItem {
4133
4133
  /** Minimum quantity for the tier price that produced the effective sale price. */
4134
4134
  applied_tier_min_qty?: number | null;
4135
4135
  }
4136
- /** A draft order as returned in list responses */
4136
+ /** A draft order as returned in list responses (stored in custom table, NOT Medusa orders) */
4137
4137
  interface DropshipperDraftOrder {
4138
4138
  id: string;
4139
4139
  display_id: number;
4140
- status: string;
4141
- email: string | null;
4142
- created_at: string;
4143
- updated_at: string;
4140
+ sales_channel_id: string;
4141
+ customer_id: string | null;
4142
+ email: string;
4144
4143
  currency_code: string;
4145
- subtotal: number;
4146
- total: number;
4147
- customer: DropshipperOrderCustomer | null;
4144
+ region_id: string;
4148
4145
  items: DropshipperDraftOrderItem[];
4149
4146
  shipping_address: DropshipperOrderShippingAddress | null;
4150
4147
  billing_address: DropshipperOrderShippingAddress | null;
4151
- /** Shipping options returned by the backend as a Medusa array. */
4152
- shipping_methods?: Array<{
4153
- id: string;
4154
- name: string;
4155
- amount: number;
4156
- currency_code?: string;
4157
- }>;
4158
- /** Single shipping method selected by the UI for the draft workflow. */
4148
+ shipping_method_id: string | null;
4149
+ payment_method_id: string | null;
4150
+ notes: string | null;
4151
+ converted_order_id: string | null;
4152
+ converted_at: string | null;
4153
+ created_at: string;
4154
+ updated_at: string;
4155
+ metadata: Record<string, unknown> | null;
4156
+ /** UI-computed cost total (sum of item costs). */
4157
+ total_cost?: number;
4158
+ /** UI-computed estimated total (sum of item prices). */
4159
+ estimated_total?: number;
4160
+ /** UI-computed profit. */
4161
+ total_profit?: number;
4162
+ /** UI-computed grand total. */
4163
+ total?: number;
4164
+ customer?: DropshipperOrderCustomer & {
4165
+ phone?: string;
4166
+ };
4159
4167
  shipping_method?: {
4160
4168
  id: string;
4161
4169
  name: string;
4162
4170
  amount: number;
4163
4171
  } | null;
4164
- /** Payment method selected by the UI for the draft workflow. */
4165
4172
  payment_method?: {
4166
4173
  id: string;
4167
4174
  name: string;
4168
4175
  } | null;
4169
- metadata: Record<string, unknown> | null;
4170
- /** Region used to derive currency and shipping options. */
4171
- region_id?: string;
4172
- /** UI-computed cost total. */
4173
- total_cost?: number;
4174
- /** UI-computed profit. */
4175
- total_profit?: number;
4176
- /** UI-only flag for "same as shipping" billing address. */
4177
- use_same_address?: boolean;
4178
4176
  }
4179
4177
  /** Options for `GET /admin/thor/dropshipper/draft-orders` */
4180
4178
  interface GetDropshipperDraftOrdersOptions {
@@ -4201,6 +4199,7 @@ interface CreateDropshipperDraftOrderBody {
4201
4199
  shipping_address?: DropshipperOrderShippingAddress;
4202
4200
  billing_address?: DropshipperOrderShippingAddress;
4203
4201
  shipping_method_id?: string;
4202
+ payment_method_id?: string;
4204
4203
  notes?: string;
4205
4204
  }
4206
4205
  /** Response for `POST /admin/thor/dropshipper/draft-orders` */
@@ -4218,6 +4217,7 @@ interface UpdateDropshipperDraftOrderBody {
4218
4217
  shipping_address?: DropshipperOrderShippingAddress;
4219
4218
  billing_address?: DropshipperOrderShippingAddress;
4220
4219
  shipping_method_id?: string;
4220
+ payment_method_id?: string;
4221
4221
  notes?: string;
4222
4222
  }
4223
4223
  /** Response for `POST /admin/thor/dropshipper/draft-orders/:id` */
@@ -4226,12 +4226,13 @@ interface UpdateDropshipperDraftOrderResponse {
4226
4226
  }
4227
4227
  /** Body for `POST /admin/thor/dropshipper/draft-orders/:id/convert` */
4228
4228
  interface ConvertDropshipperDraftOrderBody {
4229
- payment_method_id: string;
4229
+ metadata?: Record<string, unknown>;
4230
4230
  }
4231
4231
  /** Response for `POST /admin/thor/dropshipper/draft-orders/:id/convert` */
4232
4232
  interface ConvertDropshipperDraftOrderResponse {
4233
4233
  order: DropshipperOrderDetail;
4234
4234
  message: string;
4235
+ draft_id: string;
4235
4236
  }
4236
4237
  /** A dropshipper custom category node */
4237
4238
  interface DropshipperCategory {
@@ -4341,6 +4342,8 @@ interface DropshipperCustomer {
4341
4342
  total_spent: number;
4342
4343
  currency_code: string;
4343
4344
  last_order_at: string | null;
4345
+ type: string;
4346
+ status: string;
4344
4347
  }
4345
4348
  /** Stats on a customer as seen by the dropshipper */
4346
4349
  interface DropshipperCustomerStats {
@@ -5272,20 +5275,20 @@ interface GeoCountry {
5272
5275
  iso_2: string;
5273
5276
  iso_3: string;
5274
5277
  name: string;
5275
- display_name: string;
5278
+ display_name: string | null;
5276
5279
  }
5277
5280
  /** A geo-reference province/state */
5278
5281
  interface GeoProvince {
5279
5282
  id: string;
5280
5283
  code: string;
5281
5284
  name: string;
5282
- display_name: string;
5285
+ display_name: string | null;
5283
5286
  }
5284
5287
  /** A geo-reference city */
5285
5288
  interface GeoCity {
5286
5289
  id: string;
5287
5290
  name: string;
5288
- display_name: string;
5291
+ display_name: string | null;
5289
5292
  }
5290
5293
  /** Response for `GET /admin/geo-reference` */
5291
5294
  interface GetGeoCountriesResponse {
package/dist/index.d.ts CHANGED
@@ -4133,48 +4133,46 @@ interface DropshipperDraftOrderItem {
4133
4133
  /** Minimum quantity for the tier price that produced the effective sale price. */
4134
4134
  applied_tier_min_qty?: number | null;
4135
4135
  }
4136
- /** A draft order as returned in list responses */
4136
+ /** A draft order as returned in list responses (stored in custom table, NOT Medusa orders) */
4137
4137
  interface DropshipperDraftOrder {
4138
4138
  id: string;
4139
4139
  display_id: number;
4140
- status: string;
4141
- email: string | null;
4142
- created_at: string;
4143
- updated_at: string;
4140
+ sales_channel_id: string;
4141
+ customer_id: string | null;
4142
+ email: string;
4144
4143
  currency_code: string;
4145
- subtotal: number;
4146
- total: number;
4147
- customer: DropshipperOrderCustomer | null;
4144
+ region_id: string;
4148
4145
  items: DropshipperDraftOrderItem[];
4149
4146
  shipping_address: DropshipperOrderShippingAddress | null;
4150
4147
  billing_address: DropshipperOrderShippingAddress | null;
4151
- /** Shipping options returned by the backend as a Medusa array. */
4152
- shipping_methods?: Array<{
4153
- id: string;
4154
- name: string;
4155
- amount: number;
4156
- currency_code?: string;
4157
- }>;
4158
- /** Single shipping method selected by the UI for the draft workflow. */
4148
+ shipping_method_id: string | null;
4149
+ payment_method_id: string | null;
4150
+ notes: string | null;
4151
+ converted_order_id: string | null;
4152
+ converted_at: string | null;
4153
+ created_at: string;
4154
+ updated_at: string;
4155
+ metadata: Record<string, unknown> | null;
4156
+ /** UI-computed cost total (sum of item costs). */
4157
+ total_cost?: number;
4158
+ /** UI-computed estimated total (sum of item prices). */
4159
+ estimated_total?: number;
4160
+ /** UI-computed profit. */
4161
+ total_profit?: number;
4162
+ /** UI-computed grand total. */
4163
+ total?: number;
4164
+ customer?: DropshipperOrderCustomer & {
4165
+ phone?: string;
4166
+ };
4159
4167
  shipping_method?: {
4160
4168
  id: string;
4161
4169
  name: string;
4162
4170
  amount: number;
4163
4171
  } | null;
4164
- /** Payment method selected by the UI for the draft workflow. */
4165
4172
  payment_method?: {
4166
4173
  id: string;
4167
4174
  name: string;
4168
4175
  } | null;
4169
- metadata: Record<string, unknown> | null;
4170
- /** Region used to derive currency and shipping options. */
4171
- region_id?: string;
4172
- /** UI-computed cost total. */
4173
- total_cost?: number;
4174
- /** UI-computed profit. */
4175
- total_profit?: number;
4176
- /** UI-only flag for "same as shipping" billing address. */
4177
- use_same_address?: boolean;
4178
4176
  }
4179
4177
  /** Options for `GET /admin/thor/dropshipper/draft-orders` */
4180
4178
  interface GetDropshipperDraftOrdersOptions {
@@ -4201,6 +4199,7 @@ interface CreateDropshipperDraftOrderBody {
4201
4199
  shipping_address?: DropshipperOrderShippingAddress;
4202
4200
  billing_address?: DropshipperOrderShippingAddress;
4203
4201
  shipping_method_id?: string;
4202
+ payment_method_id?: string;
4204
4203
  notes?: string;
4205
4204
  }
4206
4205
  /** Response for `POST /admin/thor/dropshipper/draft-orders` */
@@ -4218,6 +4217,7 @@ interface UpdateDropshipperDraftOrderBody {
4218
4217
  shipping_address?: DropshipperOrderShippingAddress;
4219
4218
  billing_address?: DropshipperOrderShippingAddress;
4220
4219
  shipping_method_id?: string;
4220
+ payment_method_id?: string;
4221
4221
  notes?: string;
4222
4222
  }
4223
4223
  /** Response for `POST /admin/thor/dropshipper/draft-orders/:id` */
@@ -4226,12 +4226,13 @@ interface UpdateDropshipperDraftOrderResponse {
4226
4226
  }
4227
4227
  /** Body for `POST /admin/thor/dropshipper/draft-orders/:id/convert` */
4228
4228
  interface ConvertDropshipperDraftOrderBody {
4229
- payment_method_id: string;
4229
+ metadata?: Record<string, unknown>;
4230
4230
  }
4231
4231
  /** Response for `POST /admin/thor/dropshipper/draft-orders/:id/convert` */
4232
4232
  interface ConvertDropshipperDraftOrderResponse {
4233
4233
  order: DropshipperOrderDetail;
4234
4234
  message: string;
4235
+ draft_id: string;
4235
4236
  }
4236
4237
  /** A dropshipper custom category node */
4237
4238
  interface DropshipperCategory {
@@ -4341,6 +4342,8 @@ interface DropshipperCustomer {
4341
4342
  total_spent: number;
4342
4343
  currency_code: string;
4343
4344
  last_order_at: string | null;
4345
+ type: string;
4346
+ status: string;
4344
4347
  }
4345
4348
  /** Stats on a customer as seen by the dropshipper */
4346
4349
  interface DropshipperCustomerStats {
@@ -5272,20 +5275,20 @@ interface GeoCountry {
5272
5275
  iso_2: string;
5273
5276
  iso_3: string;
5274
5277
  name: string;
5275
- display_name: string;
5278
+ display_name: string | null;
5276
5279
  }
5277
5280
  /** A geo-reference province/state */
5278
5281
  interface GeoProvince {
5279
5282
  id: string;
5280
5283
  code: string;
5281
5284
  name: string;
5282
- display_name: string;
5285
+ display_name: string | null;
5283
5286
  }
5284
5287
  /** A geo-reference city */
5285
5288
  interface GeoCity {
5286
5289
  id: string;
5287
5290
  name: string;
5288
- display_name: string;
5291
+ display_name: string | null;
5289
5292
  }
5290
5293
  /** Response for `GET /admin/geo-reference` */
5291
5294
  interface GetGeoCountriesResponse {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thorprovider/types",
3
- "version": "3.13.3",
3
+ "version": "3.13.7",
4
4
  "description": "Shared TypeScript types for Thor Commerce ecosystem - Framework-agnostic type definitions",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -535,41 +535,37 @@ export interface DropshipperDraftOrderItem {
535
535
  applied_tier_min_qty?: number | null;
536
536
  }
537
537
 
538
- /** A draft order as returned in list responses */
538
+ /** A draft order as returned in list responses (stored in custom table, NOT Medusa orders) */
539
539
  export interface DropshipperDraftOrder {
540
- id: string;
540
+ id: string; // Format: "ddraft_..." (custom table ID)
541
541
  display_id: number;
542
- status: string;
543
- email: string | null;
544
- created_at: string;
545
- updated_at: string;
542
+ sales_channel_id: string;
543
+ customer_id: string | null;
544
+ email: string;
546
545
  currency_code: string;
547
- subtotal: number;
548
- total: number;
549
- customer: DropshipperOrderCustomer | null;
546
+ region_id: string;
550
547
  items: DropshipperDraftOrderItem[];
551
548
  shipping_address: DropshipperOrderShippingAddress | null;
552
549
  billing_address: DropshipperOrderShippingAddress | null;
553
- /** Shipping options returned by the backend as a Medusa array. */
554
- shipping_methods?: Array<{
555
- id: string;
556
- name: string;
557
- amount: number;
558
- currency_code?: string;
559
- }>;
560
- /** Single shipping method selected by the UI for the draft workflow. */
561
- shipping_method?: { id: string; name: string; amount: number } | null;
562
- /** Payment method selected by the UI for the draft workflow. */
563
- payment_method?: { id: string; name: string } | null;
550
+ shipping_method_id: string | null;
551
+ payment_method_id: string | null;
552
+ notes: string | null;
553
+ converted_order_id: string | null; // Reference to Medusa order.id after conversion
554
+ converted_at: string | null; // ISO timestamp when converted
555
+ created_at: string;
556
+ updated_at: string;
564
557
  metadata: Record<string, unknown> | null;
565
- /** Region used to derive currency and shipping options. */
566
- region_id?: string;
567
- /** UI-computed cost total. */
558
+ /** UI-computed cost total (sum of item costs). */
568
559
  total_cost?: number;
560
+ /** UI-computed estimated total (sum of item prices). */
561
+ estimated_total?: number;
569
562
  /** UI-computed profit. */
570
563
  total_profit?: number;
571
- /** UI-only flag for "same as shipping" billing address. */
572
- use_same_address?: boolean;
564
+ /** UI-computed grand total. */
565
+ total?: number;
566
+ customer?: DropshipperOrderCustomer & { phone?: string };
567
+ shipping_method?: { id: string; name: string; amount: number } | null;
568
+ payment_method?: { id: string; name: string } | null;
573
569
  }
574
570
 
575
571
  /** Options for `GET /admin/thor/dropshipper/draft-orders` */
@@ -599,6 +595,7 @@ export interface CreateDropshipperDraftOrderBody {
599
595
  shipping_address?: DropshipperOrderShippingAddress;
600
596
  billing_address?: DropshipperOrderShippingAddress;
601
597
  shipping_method_id?: string;
598
+ payment_method_id?: string;
602
599
  notes?: string;
603
600
  }
604
601
 
@@ -619,6 +616,7 @@ export interface UpdateDropshipperDraftOrderBody {
619
616
  shipping_address?: DropshipperOrderShippingAddress;
620
617
  billing_address?: DropshipperOrderShippingAddress;
621
618
  shipping_method_id?: string;
619
+ payment_method_id?: string;
622
620
  notes?: string;
623
621
  }
624
622
 
@@ -629,13 +627,14 @@ export interface UpdateDropshipperDraftOrderResponse {
629
627
 
630
628
  /** Body for `POST /admin/thor/dropshipper/draft-orders/:id/convert` */
631
629
  export interface ConvertDropshipperDraftOrderBody {
632
- payment_method_id: string;
630
+ metadata?: Record<string, unknown>; // Optional additional metadata for the created order
633
631
  }
634
632
 
635
633
  /** Response for `POST /admin/thor/dropshipper/draft-orders/:id/convert` */
636
634
  export interface ConvertDropshipperDraftOrderResponse {
637
635
  order: DropshipperOrderDetail;
638
636
  message: string;
637
+ draft_id: string; // ID of the draft that was converted
639
638
  }
640
639
 
641
640
  // ============================================================
@@ -772,6 +771,8 @@ export interface DropshipperCustomer {
772
771
  total_spent: number;
773
772
  currency_code: string;
774
773
  last_order_at: string | null;
774
+ type: string;
775
+ status: string;
775
776
  }
776
777
 
777
778
  /** Stats on a customer as seen by the dropshipper */
@@ -1955,7 +1956,7 @@ export interface GeoCountry {
1955
1956
  iso_2: string;
1956
1957
  iso_3: string;
1957
1958
  name: string;
1958
- display_name: string;
1959
+ display_name: string | null;
1959
1960
  }
1960
1961
 
1961
1962
  /** A geo-reference province/state */
@@ -1963,14 +1964,14 @@ export interface GeoProvince {
1963
1964
  id: string;
1964
1965
  code: string;
1965
1966
  name: string;
1966
- display_name: string;
1967
+ display_name: string | null;
1967
1968
  }
1968
1969
 
1969
1970
  /** A geo-reference city */
1970
1971
  export interface GeoCity {
1971
1972
  id: string;
1972
1973
  name: string;
1973
- display_name: string;
1974
+ display_name: string | null;
1974
1975
  }
1975
1976
 
1976
1977
  /** Response for `GET /admin/geo-reference` */