@thorprovider/medusa-extended 1.1.2 → 1.2.0
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/AGENTS.md +1 -1
- package/CHANGELOG.md +6 -0
- package/dist/index.d.mts +12 -2
- package/dist/index.d.ts +12 -2
- package/dist/index.js +92 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +91 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/dropshipper.test.ts +50 -3
- package/src/dropshipper.ts +36 -5
- package/dist/.tsbuildinfo +0 -1
package/AGENTS.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!-- MEDUSA-EXTENDED-AGENTS-MD-START -->[@thorprovider/medusa-extended Docs]|root: ./medusa-extended|Documentation for @thorprovider/medusa-extended. Always read package docs before making changes.|To regenerate: yarn
|
|
1
|
+
<!-- MEDUSA-EXTENDED-AGENTS-MD-START -->[@thorprovider/medusa-extended Docs]|root: ./medusa-extended|Documentation for @thorprovider/medusa-extended. Always read package docs before making changes.|To regenerate: yarn generate:agents-index|.:{README.md}<!-- MEDUSA-EXTENDED-AGENTS-MD-END -->
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @thorprovider/medusa-extended
|
|
2
2
|
|
|
3
|
+
## 1.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Add `getOrderShippingOptions()` to the dropshipper client so manual order creation can resolve shipping options through the canonical SDK instead of a local fetch wrapper.
|
|
8
|
+
|
|
3
9
|
## 1.1.2
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GetChannelCustomersOptions, GetChannelCustomersResponse, GetChannelApiKeysResponse, GetChannelCategoriesOptions, GetChannelCategoriesResponse, GetCategorySalesChannelsResponse, AssignCategoriesToChannelsBody, AssignCategoriesToChannelsResponse, UnassignCategoriesFromChannelsBody, UnassignCategoriesFromChannelsResponse, GetCollectionSalesChannelsResponse, AssignCollectionsToChannelsBody, AssignCollectionsToChannelsResponse, UnassignCollectionsFromChannelsBody, UnassignCollectionsFromChannelsResponse, GetAdminStorefrontConfigResponse, UpdateStorefrontConfigBody, UpdateStorefrontConfigResponse, GetAdminSiteConfigResponse, UpdateSiteConfigBody, UpdateSiteConfigResponse, GetAdminSiteConfigHistoryOptions, GetAdminSiteConfigHistoryResponse, RestoreSiteConfigResponse, OnboardDropshipperBody, OnboardDropshipperResponse, GetVariantCostsOptions, GetVariantCostsResponse, CreateVariantCostBody, CreateVariantCostResponse, BatchVariantCostsBody, BatchVariantCostsResponse, DeleteVariantCostResponse, GetDropshipperProductsOptions, GetDropshipperProductsResponse, UpdateDropshipperPricesBody, UpdateDropshipperPricesResponse, GetDropshipperOrdersOptions, GetDropshipperOrdersResponse, GetDropshipperOrderDetailResponse,
|
|
1
|
+
import { GetChannelCustomersOptions, GetChannelCustomersResponse, GetChannelApiKeysResponse, GetChannelCategoriesOptions, GetChannelCategoriesResponse, GetCategorySalesChannelsResponse, AssignCategoriesToChannelsBody, AssignCategoriesToChannelsResponse, UnassignCategoriesFromChannelsBody, UnassignCategoriesFromChannelsResponse, GetCollectionSalesChannelsResponse, AssignCollectionsToChannelsBody, AssignCollectionsToChannelsResponse, UnassignCollectionsFromChannelsBody, UnassignCollectionsFromChannelsResponse, GetAdminStorefrontConfigResponse, UpdateStorefrontConfigBody, UpdateStorefrontConfigResponse, GetAdminSiteConfigResponse, UpdateSiteConfigBody, UpdateSiteConfigResponse, GetAdminSiteConfigHistoryOptions, GetAdminSiteConfigHistoryResponse, RestoreSiteConfigResponse, OnboardDropshipperBody, OnboardDropshipperResponse, GetVariantCostsOptions, GetVariantCostsResponse, CreateVariantCostBody, CreateVariantCostResponse, BatchVariantCostsBody, BatchVariantCostsResponse, DeleteVariantCostResponse, GetDropshipperProductsOptions, GetDropshipperProductsResponse, UpdateDropshipperPricesBody, UpdateDropshipperPricesResponse, GetDropshipperOrdersOptions, GetDropshipperOrdersResponse, GetDropshipperOrderDetailResponse, GetDropshipperShippingOptionsParams, GetDropshipperShippingOptionsResponse, ExtendedCreateDropshipperOrderBody, ExtendedCreateDropshipperOrderResponse, SetPaymentCollectorBody, SetPaymentCollectorResponse, CancelDropshipperOrderResponse, CreateOrderEditBody, CreateOrderEditResponse, AddOrderEditItemBody, AddOrderEditItemResponse, ConfirmOrderEditResponse, GetOrderNotesResponse, CreateOrderNoteBody, OrderNote, DeleteOrderNoteResponse, GetProviderCategoriesResponse, GetDropshipperCategoriesOptions, GetDropshipperCategoriesResponse, CreateDropshipperCategoryBody, DropshipperCategory, UpdateDropshipperCategoryBody, DeleteDropshipperCategoryResponse, GetCategoryMappingsOptions, GetCategoryMappingsResponse, CreateCategoryMappingBody, CreateCategoryMappingResponse, DeleteCategoryMappingResponse, GetDropshipperCustomersOptions, GetDropshipperCustomersResponse, GetDropshipperCustomerDetailResponse, CreateDropshipperCustomerBody, CreateDropshipperCustomerResponse, GetDropshipperAddressesResponse, DropshipperAddressBody, DropshipperAddressResponse, GetDropshipperAccountResponse, GetDropshipperPayableResponse, GetDropshipperReceivableResponse, GetSettlementsOptions, GetSettlementsResponse, GetSettlementDetailResponse, CreateSettlementBody, CreateSettlementResponse, ConfirmSettlementBody, UpdateSettlementStatusResponse, CancelSettlementBody, GetAdminDropshipperAccountsResponse, GetAdminAccountBalanceResponse, GetAdminPriceListsResponse, GetUserChannelResponse, GetDropshipperPromotionsOptions, GetDropshipperPromotionsResponse, CreateDropshipperPromotionBody, DropshipperPromotion, UpdateDropshipperPromotionBody, DeleteDropshipperPromotionResponse, GetDashboardStatsOptions, GetDashboardStatsResponse, GetStorefrontDropshipperCategoriesResponse } from '@thorprovider/types';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @fileoverview Medusa Multi-Tenant Admin Client
|
|
@@ -256,12 +256,18 @@ declare class DropshipperClient {
|
|
|
256
256
|
* `GET /admin/thor/dropshipper/orders/:id`
|
|
257
257
|
*/
|
|
258
258
|
getOrder(orderId: string): Promise<GetDropshipperOrderDetailResponse>;
|
|
259
|
+
/**
|
|
260
|
+
* List shipping options for a manual dropshipper order.
|
|
261
|
+
*
|
|
262
|
+
* `GET /admin/thor/dropshipper/orders/shipping-options`
|
|
263
|
+
*/
|
|
264
|
+
getOrderShippingOptions(params: GetDropshipperShippingOptionsParams): Promise<GetDropshipperShippingOptionsResponse>;
|
|
259
265
|
/**
|
|
260
266
|
* Manually create an order on behalf of a customer.
|
|
261
267
|
*
|
|
262
268
|
* `POST /admin/thor/dropshipper/orders`
|
|
263
269
|
*/
|
|
264
|
-
createOrder(body:
|
|
270
|
+
createOrder(body: ExtendedCreateDropshipperOrderBody): Promise<ExtendedCreateDropshipperOrderResponse>;
|
|
265
271
|
/**
|
|
266
272
|
* Set who collects payment for an order (Solo X).
|
|
267
273
|
*
|
|
@@ -368,6 +374,10 @@ declare class DropshipperClient {
|
|
|
368
374
|
* `GET /admin/thor/dropshipper/customers`
|
|
369
375
|
*/
|
|
370
376
|
getCustomers(options?: GetDropshipperCustomersOptions): Promise<GetDropshipperCustomersResponse>;
|
|
377
|
+
/**
|
|
378
|
+
* Backwards-compatible alias used by the dashboard checkout flow.
|
|
379
|
+
*/
|
|
380
|
+
getChannelCustomers(_channelId: string, options?: GetDropshipperCustomersOptions): Promise<GetDropshipperCustomersResponse>;
|
|
371
381
|
/**
|
|
372
382
|
* Full detail for a single customer.
|
|
373
383
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GetChannelCustomersOptions, GetChannelCustomersResponse, GetChannelApiKeysResponse, GetChannelCategoriesOptions, GetChannelCategoriesResponse, GetCategorySalesChannelsResponse, AssignCategoriesToChannelsBody, AssignCategoriesToChannelsResponse, UnassignCategoriesFromChannelsBody, UnassignCategoriesFromChannelsResponse, GetCollectionSalesChannelsResponse, AssignCollectionsToChannelsBody, AssignCollectionsToChannelsResponse, UnassignCollectionsFromChannelsBody, UnassignCollectionsFromChannelsResponse, GetAdminStorefrontConfigResponse, UpdateStorefrontConfigBody, UpdateStorefrontConfigResponse, GetAdminSiteConfigResponse, UpdateSiteConfigBody, UpdateSiteConfigResponse, GetAdminSiteConfigHistoryOptions, GetAdminSiteConfigHistoryResponse, RestoreSiteConfigResponse, OnboardDropshipperBody, OnboardDropshipperResponse, GetVariantCostsOptions, GetVariantCostsResponse, CreateVariantCostBody, CreateVariantCostResponse, BatchVariantCostsBody, BatchVariantCostsResponse, DeleteVariantCostResponse, GetDropshipperProductsOptions, GetDropshipperProductsResponse, UpdateDropshipperPricesBody, UpdateDropshipperPricesResponse, GetDropshipperOrdersOptions, GetDropshipperOrdersResponse, GetDropshipperOrderDetailResponse,
|
|
1
|
+
import { GetChannelCustomersOptions, GetChannelCustomersResponse, GetChannelApiKeysResponse, GetChannelCategoriesOptions, GetChannelCategoriesResponse, GetCategorySalesChannelsResponse, AssignCategoriesToChannelsBody, AssignCategoriesToChannelsResponse, UnassignCategoriesFromChannelsBody, UnassignCategoriesFromChannelsResponse, GetCollectionSalesChannelsResponse, AssignCollectionsToChannelsBody, AssignCollectionsToChannelsResponse, UnassignCollectionsFromChannelsBody, UnassignCollectionsFromChannelsResponse, GetAdminStorefrontConfigResponse, UpdateStorefrontConfigBody, UpdateStorefrontConfigResponse, GetAdminSiteConfigResponse, UpdateSiteConfigBody, UpdateSiteConfigResponse, GetAdminSiteConfigHistoryOptions, GetAdminSiteConfigHistoryResponse, RestoreSiteConfigResponse, OnboardDropshipperBody, OnboardDropshipperResponse, GetVariantCostsOptions, GetVariantCostsResponse, CreateVariantCostBody, CreateVariantCostResponse, BatchVariantCostsBody, BatchVariantCostsResponse, DeleteVariantCostResponse, GetDropshipperProductsOptions, GetDropshipperProductsResponse, UpdateDropshipperPricesBody, UpdateDropshipperPricesResponse, GetDropshipperOrdersOptions, GetDropshipperOrdersResponse, GetDropshipperOrderDetailResponse, GetDropshipperShippingOptionsParams, GetDropshipperShippingOptionsResponse, ExtendedCreateDropshipperOrderBody, ExtendedCreateDropshipperOrderResponse, SetPaymentCollectorBody, SetPaymentCollectorResponse, CancelDropshipperOrderResponse, CreateOrderEditBody, CreateOrderEditResponse, AddOrderEditItemBody, AddOrderEditItemResponse, ConfirmOrderEditResponse, GetOrderNotesResponse, CreateOrderNoteBody, OrderNote, DeleteOrderNoteResponse, GetProviderCategoriesResponse, GetDropshipperCategoriesOptions, GetDropshipperCategoriesResponse, CreateDropshipperCategoryBody, DropshipperCategory, UpdateDropshipperCategoryBody, DeleteDropshipperCategoryResponse, GetCategoryMappingsOptions, GetCategoryMappingsResponse, CreateCategoryMappingBody, CreateCategoryMappingResponse, DeleteCategoryMappingResponse, GetDropshipperCustomersOptions, GetDropshipperCustomersResponse, GetDropshipperCustomerDetailResponse, CreateDropshipperCustomerBody, CreateDropshipperCustomerResponse, GetDropshipperAddressesResponse, DropshipperAddressBody, DropshipperAddressResponse, GetDropshipperAccountResponse, GetDropshipperPayableResponse, GetDropshipperReceivableResponse, GetSettlementsOptions, GetSettlementsResponse, GetSettlementDetailResponse, CreateSettlementBody, CreateSettlementResponse, ConfirmSettlementBody, UpdateSettlementStatusResponse, CancelSettlementBody, GetAdminDropshipperAccountsResponse, GetAdminAccountBalanceResponse, GetAdminPriceListsResponse, GetUserChannelResponse, GetDropshipperPromotionsOptions, GetDropshipperPromotionsResponse, CreateDropshipperPromotionBody, DropshipperPromotion, UpdateDropshipperPromotionBody, DeleteDropshipperPromotionResponse, GetDashboardStatsOptions, GetDashboardStatsResponse, GetStorefrontDropshipperCategoriesResponse } from '@thorprovider/types';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @fileoverview Medusa Multi-Tenant Admin Client
|
|
@@ -256,12 +256,18 @@ declare class DropshipperClient {
|
|
|
256
256
|
* `GET /admin/thor/dropshipper/orders/:id`
|
|
257
257
|
*/
|
|
258
258
|
getOrder(orderId: string): Promise<GetDropshipperOrderDetailResponse>;
|
|
259
|
+
/**
|
|
260
|
+
* List shipping options for a manual dropshipper order.
|
|
261
|
+
*
|
|
262
|
+
* `GET /admin/thor/dropshipper/orders/shipping-options`
|
|
263
|
+
*/
|
|
264
|
+
getOrderShippingOptions(params: GetDropshipperShippingOptionsParams): Promise<GetDropshipperShippingOptionsResponse>;
|
|
259
265
|
/**
|
|
260
266
|
* Manually create an order on behalf of a customer.
|
|
261
267
|
*
|
|
262
268
|
* `POST /admin/thor/dropshipper/orders`
|
|
263
269
|
*/
|
|
264
|
-
createOrder(body:
|
|
270
|
+
createOrder(body: ExtendedCreateDropshipperOrderBody): Promise<ExtendedCreateDropshipperOrderResponse>;
|
|
265
271
|
/**
|
|
266
272
|
* Set who collects payment for an order (Solo X).
|
|
267
273
|
*
|
|
@@ -368,6 +374,10 @@ declare class DropshipperClient {
|
|
|
368
374
|
* `GET /admin/thor/dropshipper/customers`
|
|
369
375
|
*/
|
|
370
376
|
getCustomers(options?: GetDropshipperCustomersOptions): Promise<GetDropshipperCustomersResponse>;
|
|
377
|
+
/**
|
|
378
|
+
* Backwards-compatible alias used by the dashboard checkout flow.
|
|
379
|
+
*/
|
|
380
|
+
getChannelCustomers(_channelId: string, options?: GetDropshipperCustomersOptions): Promise<GetDropshipperCustomersResponse>;
|
|
371
381
|
/**
|
|
372
382
|
* Full detail for a single customer.
|
|
373
383
|
*
|
package/dist/index.js
CHANGED
|
@@ -26,7 +26,69 @@ __export(src_exports, {
|
|
|
26
26
|
module.exports = __toCommonJS(src_exports);
|
|
27
27
|
|
|
28
28
|
// src/admin.ts
|
|
29
|
+
var import_adapters2 = require("@thorprovider/adapters");
|
|
30
|
+
|
|
31
|
+
// src/request-resilience.ts
|
|
29
32
|
var import_adapters = require("@thorprovider/adapters");
|
|
33
|
+
var DEFAULT_RETRY_CONFIG = {
|
|
34
|
+
maxRetries: 3,
|
|
35
|
+
initialDelayMs: 300,
|
|
36
|
+
backoffMultiplier: 2,
|
|
37
|
+
maxDelayMs: 5e3,
|
|
38
|
+
timeoutMs: 1e4,
|
|
39
|
+
retryableStatusCodes: [408, 429, 500, 502, 503, 504]
|
|
40
|
+
};
|
|
41
|
+
function sleep(ms) {
|
|
42
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
43
|
+
}
|
|
44
|
+
function calculateDelay(attempt, config) {
|
|
45
|
+
const delay = config.initialDelayMs * Math.pow(config.backoffMultiplier, attempt);
|
|
46
|
+
return Math.min(delay, config.maxDelayMs);
|
|
47
|
+
}
|
|
48
|
+
function isRetryableError(error, config) {
|
|
49
|
+
const err = error;
|
|
50
|
+
if (err.name === "TypeError" || err.message?.includes("fetch failed")) return true;
|
|
51
|
+
if (err.name === "AbortError" || err.message?.includes("timeout")) return true;
|
|
52
|
+
if (typeof err.status === "number" && config.retryableStatusCodes.includes(err.status)) return true;
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
async function fetchWithRetry(url, init, retryConfig) {
|
|
56
|
+
const config = { ...DEFAULT_RETRY_CONFIG, ...retryConfig };
|
|
57
|
+
let lastError;
|
|
58
|
+
for (let attempt = 0; attempt <= config.maxRetries; attempt++) {
|
|
59
|
+
try {
|
|
60
|
+
const controller = new AbortController();
|
|
61
|
+
const timeoutId = setTimeout(() => controller.abort(), config.timeoutMs);
|
|
62
|
+
const response = await fetch(url, { ...init, signal: controller.signal });
|
|
63
|
+
clearTimeout(timeoutId);
|
|
64
|
+
if (!response.ok && config.retryableStatusCodes.includes(response.status)) {
|
|
65
|
+
const error = new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
66
|
+
error.status = response.status;
|
|
67
|
+
throw error;
|
|
68
|
+
}
|
|
69
|
+
return response;
|
|
70
|
+
} catch (error) {
|
|
71
|
+
lastError = error;
|
|
72
|
+
const shouldRetry = attempt < config.maxRetries && isRetryableError(error, config);
|
|
73
|
+
if (shouldRetry) {
|
|
74
|
+
await sleep(calculateDelay(attempt, config));
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
throw lastError instanceof Error ? lastError : new Error("Backend request failed");
|
|
81
|
+
}
|
|
82
|
+
async function fetchBackendWithResilience(url, init, retryConfig) {
|
|
83
|
+
try {
|
|
84
|
+
return await import_adapters.backendCircuitBreaker.execute(() => fetchWithRetry(url, init, retryConfig));
|
|
85
|
+
} catch (error) {
|
|
86
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
87
|
+
throw new import_adapters.ProviderAPIError(`Backend request failed: ${message}`, "backend", 503);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// src/admin.ts
|
|
30
92
|
var MedusaAdminClient = class {
|
|
31
93
|
baseUrl;
|
|
32
94
|
apiKey;
|
|
@@ -34,7 +96,7 @@ var MedusaAdminClient = class {
|
|
|
34
96
|
constructor(config) {
|
|
35
97
|
this.baseUrl = config.baseUrl.replace(/\/$/, "");
|
|
36
98
|
this.apiKey = config.apiKey;
|
|
37
|
-
this.logger = (0,
|
|
99
|
+
this.logger = (0, import_adapters2.createLogger)("MedusaAdminClient", config.debug);
|
|
38
100
|
}
|
|
39
101
|
// -----------------------------------------------------------------------
|
|
40
102
|
// Private — HTTP helper
|
|
@@ -53,9 +115,9 @@ var MedusaAdminClient = class {
|
|
|
53
115
|
};
|
|
54
116
|
let response;
|
|
55
117
|
try {
|
|
56
|
-
response = await
|
|
118
|
+
response = await fetchBackendWithResilience(url, init);
|
|
57
119
|
} catch (networkError) {
|
|
58
|
-
throw new
|
|
120
|
+
throw new import_adapters2.ProviderAPIError(
|
|
59
121
|
`[admin] Network error on ${method} ${path}: ${networkError.message}`,
|
|
60
122
|
"NETWORK_ERROR",
|
|
61
123
|
networkError
|
|
@@ -68,7 +130,7 @@ var MedusaAdminClient = class {
|
|
|
68
130
|
message = json?.message ?? message;
|
|
69
131
|
} catch {
|
|
70
132
|
}
|
|
71
|
-
throw new
|
|
133
|
+
throw new import_adapters2.ProviderAPIError(
|
|
72
134
|
`[admin] ${method} ${path} failed: ${message}`,
|
|
73
135
|
`ADMIN_API_${response.status}`,
|
|
74
136
|
response.status
|
|
@@ -311,7 +373,7 @@ var MedusaAdminClient = class {
|
|
|
311
373
|
};
|
|
312
374
|
|
|
313
375
|
// src/dropshipper.ts
|
|
314
|
-
var
|
|
376
|
+
var import_adapters3 = require("@thorprovider/adapters");
|
|
315
377
|
var DropshipperClient = class {
|
|
316
378
|
baseUrl;
|
|
317
379
|
token;
|
|
@@ -319,7 +381,7 @@ var DropshipperClient = class {
|
|
|
319
381
|
constructor(config) {
|
|
320
382
|
this.baseUrl = config.baseUrl.replace(/\/$/, "");
|
|
321
383
|
this.token = config.token;
|
|
322
|
-
this.logger = (0,
|
|
384
|
+
this.logger = (0, import_adapters3.createLogger)("DropshipperClient", config.debug);
|
|
323
385
|
}
|
|
324
386
|
// -------------------------------------------------------------------------
|
|
325
387
|
// Private — HTTP helper
|
|
@@ -338,9 +400,9 @@ var DropshipperClient = class {
|
|
|
338
400
|
};
|
|
339
401
|
let response;
|
|
340
402
|
try {
|
|
341
|
-
response = await
|
|
403
|
+
response = await fetchBackendWithResilience(url, init);
|
|
342
404
|
} catch (networkError) {
|
|
343
|
-
throw new
|
|
405
|
+
throw new import_adapters3.ProviderAPIError(
|
|
344
406
|
`[dropshipper] Network error on ${method} ${path}: ${networkError.message}`,
|
|
345
407
|
"NETWORK_ERROR",
|
|
346
408
|
networkError
|
|
@@ -353,7 +415,7 @@ var DropshipperClient = class {
|
|
|
353
415
|
message = json?.message ?? message;
|
|
354
416
|
} catch {
|
|
355
417
|
}
|
|
356
|
-
throw new
|
|
418
|
+
throw new import_adapters3.ProviderAPIError(
|
|
357
419
|
`[dropshipper] ${method} ${path} failed: ${message}`,
|
|
358
420
|
`DROPSHIPPER_API_${response.status}`,
|
|
359
421
|
response.status
|
|
@@ -507,6 +569,21 @@ var DropshipperClient = class {
|
|
|
507
569
|
`/admin/thor/dropshipper/orders/${orderId}`
|
|
508
570
|
);
|
|
509
571
|
}
|
|
572
|
+
/**
|
|
573
|
+
* List shipping options for a manual dropshipper order.
|
|
574
|
+
*
|
|
575
|
+
* `GET /admin/thor/dropshipper/orders/shipping-options`
|
|
576
|
+
*/
|
|
577
|
+
async getOrderShippingOptions(params) {
|
|
578
|
+
const qs = new URLSearchParams({
|
|
579
|
+
currency_code: params.currency_code.toLowerCase(),
|
|
580
|
+
...params.country_code ? { country_code: params.country_code.toLowerCase() } : {}
|
|
581
|
+
});
|
|
582
|
+
return this.request(
|
|
583
|
+
"GET",
|
|
584
|
+
`/admin/thor/dropshipper/orders/shipping-options?${qs}`
|
|
585
|
+
);
|
|
586
|
+
}
|
|
510
587
|
/**
|
|
511
588
|
* Manually create an order on behalf of a customer.
|
|
512
589
|
*
|
|
@@ -740,6 +817,12 @@ var DropshipperClient = class {
|
|
|
740
817
|
`/admin/thor/dropshipper/customers?${qs}`
|
|
741
818
|
);
|
|
742
819
|
}
|
|
820
|
+
/**
|
|
821
|
+
* Backwards-compatible alias used by the dashboard checkout flow.
|
|
822
|
+
*/
|
|
823
|
+
async getChannelCustomers(_channelId, options = {}) {
|
|
824
|
+
return this.getCustomers(options);
|
|
825
|
+
}
|
|
743
826
|
/**
|
|
744
827
|
* Full detail for a single customer.
|
|
745
828
|
*
|