@thorprovider/medusa-extended 1.0.0 → 1.1.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 -0
- package/README.md +206 -0
- package/dist/index.d.mts +369 -2
- package/dist/index.d.ts +369 -2
- package/dist/index.js +757 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +756 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/dropshipper.test.ts +1072 -0
- package/src/dropshipper.ts +1078 -0
- package/src/index.ts +4 -0
- package/stelorder/client.test-helpers.ts +3 -0
- package/vitest.config.ts +13 -0
- package/vitest.setup.ts +6 -0
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 } from '@thorprovider/types';
|
|
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, CreateDropshipperOrderBody, CreateDropshipperOrderResponse, SetPaymentCollectorBody, SetPaymentCollectorResponse, CancelDropshipperOrderResponse, CreateOrderEditBody, CreateOrderEditResponse, AddOrderEditItemBody, AddOrderEditItemResponse, ConfirmOrderEditResponse, GetOrderNotesResponse, CreateOrderNoteBody, OrderNote, DeleteOrderNoteResponse, GetDropshipperCategoriesOptions, GetDropshipperCategoriesResponse, CreateDropshipperCategoryBody, DropshipperCategory, UpdateDropshipperCategoryBody, DeleteDropshipperCategoryResponse, 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
|
|
@@ -147,4 +147,371 @@ declare class MedusaAdminClient {
|
|
|
147
147
|
restoreSiteConfig(salesChannelId: string, version: string): Promise<RestoreSiteConfigResponse>;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
|
|
150
|
+
/**
|
|
151
|
+
* @fileoverview Dropshipper Client — Thor Commerce Extended
|
|
152
|
+
* @module @thorprovider/medusa-extended/dropshipper
|
|
153
|
+
*
|
|
154
|
+
* HTTP client for all `/admin/thor/dropshipper/` endpoints.
|
|
155
|
+
*
|
|
156
|
+
* Used by both:
|
|
157
|
+
* - X (ThorProvider admin) — authenticated via admin JWT, role "Admin"
|
|
158
|
+
* - Y (Dropshipper panel) — authenticated via dropshipper JWT, role "Dropshipper"
|
|
159
|
+
*
|
|
160
|
+
* Access control is enforced server-side via `withDropshipperScope` middleware.
|
|
161
|
+
* This client always sends `Authorization: Bearer <token>`.
|
|
162
|
+
*
|
|
163
|
+
* Endpoint reference: `dropshipping-api-contract.md`
|
|
164
|
+
*/
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Configuration required to instantiate the dropshipper client.
|
|
168
|
+
*/
|
|
169
|
+
interface DropshipperClientConfig {
|
|
170
|
+
/** Medusa backend base URL */
|
|
171
|
+
baseUrl: string;
|
|
172
|
+
/**
|
|
173
|
+
* JWT token obtained from `POST /auth/user/emailpass`.
|
|
174
|
+
* Used as `Authorization: Bearer <token>`.
|
|
175
|
+
*/
|
|
176
|
+
token: string;
|
|
177
|
+
/** Enable debug logging */
|
|
178
|
+
debug?: boolean;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* HTTP client for Thor Commerce dropshipping endpoints (`/admin/thor/dropshipper/`).
|
|
182
|
+
*
|
|
183
|
+
* All methods throw `ProviderAPIError` on non-2xx responses.
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* ```typescript
|
|
187
|
+
* const client = new DropshipperClient({
|
|
188
|
+
* baseUrl: process.env.MEDUSA_BACKEND_URL!,
|
|
189
|
+
* token: jwtFromLogin,
|
|
190
|
+
* });
|
|
191
|
+
*
|
|
192
|
+
* // Y: list own products
|
|
193
|
+
* const { products } = await client.getProducts();
|
|
194
|
+
*
|
|
195
|
+
* // X: onboard a new dropshipper
|
|
196
|
+
* const { dropshipper } = await client.onboardDropshipper({ ... });
|
|
197
|
+
* ```
|
|
198
|
+
*/
|
|
199
|
+
declare class DropshipperClient {
|
|
200
|
+
private baseUrl;
|
|
201
|
+
private token;
|
|
202
|
+
private logger;
|
|
203
|
+
constructor(config: DropshipperClientConfig);
|
|
204
|
+
private request;
|
|
205
|
+
/**
|
|
206
|
+
* Create a new dropshipper account (sales channel + user + price list).
|
|
207
|
+
*
|
|
208
|
+
* `POST /admin/thor/dropshipper/onboard`
|
|
209
|
+
*/
|
|
210
|
+
onboardDropshipper(body: OnboardDropshipperBody): Promise<OnboardDropshipperResponse>;
|
|
211
|
+
/**
|
|
212
|
+
* List variant cost records, optionally filtered by account/variant/currency.
|
|
213
|
+
*
|
|
214
|
+
* `GET /admin/thor/dropshipper/variant-costs`
|
|
215
|
+
*/
|
|
216
|
+
getVariantCosts(options?: GetVariantCostsOptions): Promise<GetVariantCostsResponse>;
|
|
217
|
+
/**
|
|
218
|
+
* Upsert a single variant cost record.
|
|
219
|
+
*
|
|
220
|
+
* `POST /admin/thor/dropshipper/variant-costs`
|
|
221
|
+
*/
|
|
222
|
+
createVariantCost(body: CreateVariantCostBody): Promise<CreateVariantCostResponse>;
|
|
223
|
+
/**
|
|
224
|
+
* Batch-upsert variant costs for a given account and currency.
|
|
225
|
+
*
|
|
226
|
+
* `POST /admin/thor/dropshipper/variant-costs/batch`
|
|
227
|
+
*/
|
|
228
|
+
batchVariantCosts(body: BatchVariantCostsBody): Promise<BatchVariantCostsResponse>;
|
|
229
|
+
/**
|
|
230
|
+
* Delete a variant cost record by ID.
|
|
231
|
+
*
|
|
232
|
+
* `DELETE /admin/thor/dropshipper/variant-costs/:id`
|
|
233
|
+
*/
|
|
234
|
+
deleteVariantCost(id: string): Promise<DeleteVariantCostResponse>;
|
|
235
|
+
/**
|
|
236
|
+
* List products available in Y's channel with cost/margin data.
|
|
237
|
+
*
|
|
238
|
+
* `GET /admin/thor/dropshipper/products`
|
|
239
|
+
*/
|
|
240
|
+
getProducts(options?: GetDropshipperProductsOptions): Promise<GetDropshipperProductsResponse>;
|
|
241
|
+
/**
|
|
242
|
+
* Bulk-update sale prices on Y's channel price list.
|
|
243
|
+
*
|
|
244
|
+
* `PUT /admin/thor/dropshipper/prices`
|
|
245
|
+
*/
|
|
246
|
+
updatePrices(body: UpdateDropshipperPricesBody): Promise<UpdateDropshipperPricesResponse>;
|
|
247
|
+
/**
|
|
248
|
+
* Paginated list of orders in Y's channel.
|
|
249
|
+
*
|
|
250
|
+
* `GET /admin/thor/dropshipper/orders`
|
|
251
|
+
*/
|
|
252
|
+
getOrders(options?: GetDropshipperOrdersOptions): Promise<GetDropshipperOrdersResponse>;
|
|
253
|
+
/**
|
|
254
|
+
* Full detail for a single order with profit breakdown.
|
|
255
|
+
*
|
|
256
|
+
* `GET /admin/thor/dropshipper/orders/:id`
|
|
257
|
+
*/
|
|
258
|
+
getOrder(orderId: string): Promise<GetDropshipperOrderDetailResponse>;
|
|
259
|
+
/**
|
|
260
|
+
* Manually create an order on behalf of a customer.
|
|
261
|
+
*
|
|
262
|
+
* `POST /admin/thor/dropshipper/orders`
|
|
263
|
+
*/
|
|
264
|
+
createOrder(body: CreateDropshipperOrderBody): Promise<CreateDropshipperOrderResponse>;
|
|
265
|
+
/**
|
|
266
|
+
* Set who collects payment for an order (Solo X).
|
|
267
|
+
*
|
|
268
|
+
* `POST /admin/thor/dropshipper/orders/:id/set-payment-collector`
|
|
269
|
+
*/
|
|
270
|
+
setPaymentCollector(orderId: string, body: SetPaymentCollectorBody): Promise<SetPaymentCollectorResponse>;
|
|
271
|
+
/**
|
|
272
|
+
* Cancel a dropshipper order.
|
|
273
|
+
*
|
|
274
|
+
* `POST /admin/thor/dropshipper/orders/:id/cancel`
|
|
275
|
+
*/
|
|
276
|
+
cancelOrder(orderId: string): Promise<CancelDropshipperOrderResponse>;
|
|
277
|
+
/**
|
|
278
|
+
* Create an order edit for a dropshipper order.
|
|
279
|
+
*
|
|
280
|
+
* `POST /admin/thor/dropshipper/orders/:id/edit`
|
|
281
|
+
*/
|
|
282
|
+
createOrderEdit(orderId: string, body?: CreateOrderEditBody): Promise<CreateOrderEditResponse>;
|
|
283
|
+
/**
|
|
284
|
+
* Add an item to the active order edit.
|
|
285
|
+
*
|
|
286
|
+
* `POST /admin/thor/dropshipper/orders/:id/edit/items`
|
|
287
|
+
*/
|
|
288
|
+
addOrderEditItem(orderId: string, body: AddOrderEditItemBody): Promise<AddOrderEditItemResponse>;
|
|
289
|
+
/**
|
|
290
|
+
* Confirm the active order edit, applying changes to the order.
|
|
291
|
+
*
|
|
292
|
+
* `POST /admin/thor/dropshipper/orders/:id/edit/confirm`
|
|
293
|
+
*/
|
|
294
|
+
confirmOrderEdit(orderId: string): Promise<ConfirmOrderEditResponse>;
|
|
295
|
+
/**
|
|
296
|
+
* Get all notes for an order.
|
|
297
|
+
*
|
|
298
|
+
* `GET /admin/thor/dropshipper/orders/:id/notes`
|
|
299
|
+
*/
|
|
300
|
+
getOrderNotes(orderId: string): Promise<GetOrderNotesResponse>;
|
|
301
|
+
/**
|
|
302
|
+
* Create a new note for an order.
|
|
303
|
+
*
|
|
304
|
+
* `POST /admin/thor/dropshipper/orders/:id/notes`
|
|
305
|
+
*/
|
|
306
|
+
createOrderNote(orderId: string, body: CreateOrderNoteBody): Promise<OrderNote>;
|
|
307
|
+
/**
|
|
308
|
+
* Delete a note from an order.
|
|
309
|
+
*
|
|
310
|
+
* `DELETE /admin/thor/dropshipper/orders/:id/notes/:noteId`
|
|
311
|
+
*/
|
|
312
|
+
deleteOrderNote(orderId: string, noteId: string): Promise<DeleteOrderNoteResponse>;
|
|
313
|
+
/**
|
|
314
|
+
* List Y's custom product categories.
|
|
315
|
+
*
|
|
316
|
+
* `GET /admin/thor/dropshipper/categories`
|
|
317
|
+
*/
|
|
318
|
+
getCategories(options?: GetDropshipperCategoriesOptions): Promise<GetDropshipperCategoriesResponse>;
|
|
319
|
+
/**
|
|
320
|
+
* Create a custom category in Y's channel.
|
|
321
|
+
*
|
|
322
|
+
* `POST /admin/thor/dropshipper/categories`
|
|
323
|
+
*/
|
|
324
|
+
createCategory(body: CreateDropshipperCategoryBody): Promise<DropshipperCategory>;
|
|
325
|
+
/**
|
|
326
|
+
* Update a custom category.
|
|
327
|
+
*
|
|
328
|
+
* `PUT /admin/thor/dropshipper/categories/:id`
|
|
329
|
+
*/
|
|
330
|
+
updateCategory(categoryId: string, body: UpdateDropshipperCategoryBody): Promise<DropshipperCategory>;
|
|
331
|
+
/**
|
|
332
|
+
* Delete a custom category.
|
|
333
|
+
*
|
|
334
|
+
* `DELETE /admin/thor/dropshipper/categories/:id`
|
|
335
|
+
*/
|
|
336
|
+
deleteCategory(categoryId: string): Promise<DeleteDropshipperCategoryResponse>;
|
|
337
|
+
/**
|
|
338
|
+
* Map a product to a custom category.
|
|
339
|
+
*
|
|
340
|
+
* `POST /admin/thor/dropshipper/category-mappings`
|
|
341
|
+
*/
|
|
342
|
+
createCategoryMapping(body: CreateCategoryMappingBody): Promise<CreateCategoryMappingResponse>;
|
|
343
|
+
/**
|
|
344
|
+
* Remove a product-to-category mapping.
|
|
345
|
+
*
|
|
346
|
+
* `DELETE /admin/thor/dropshipper/category-mappings/:id`
|
|
347
|
+
*/
|
|
348
|
+
deleteCategoryMapping(mappingId: string): Promise<DeleteCategoryMappingResponse>;
|
|
349
|
+
/**
|
|
350
|
+
* Paginated list of customers in Y's channel.
|
|
351
|
+
*
|
|
352
|
+
* `GET /admin/thor/dropshipper/customers`
|
|
353
|
+
*/
|
|
354
|
+
getCustomers(options?: GetDropshipperCustomersOptions): Promise<GetDropshipperCustomersResponse>;
|
|
355
|
+
/**
|
|
356
|
+
* Full detail for a single customer.
|
|
357
|
+
*
|
|
358
|
+
* `GET /admin/thor/dropshipper/customers/:id`
|
|
359
|
+
*/
|
|
360
|
+
getCustomer(customerId: string): Promise<GetDropshipperCustomerDetailResponse>;
|
|
361
|
+
/**
|
|
362
|
+
* Create a customer scoped to Y's channel.
|
|
363
|
+
*
|
|
364
|
+
* `POST /admin/thor/dropshipper/customers`
|
|
365
|
+
*/
|
|
366
|
+
createCustomer(body: CreateDropshipperCustomerBody): Promise<CreateDropshipperCustomerResponse>;
|
|
367
|
+
/**
|
|
368
|
+
* List addresses for a customer in Y's channel.
|
|
369
|
+
*
|
|
370
|
+
* `GET /admin/thor/dropshipper/customers/:id/addresses`
|
|
371
|
+
*/
|
|
372
|
+
getCustomerAddresses(customerId: string): Promise<GetDropshipperAddressesResponse>;
|
|
373
|
+
/**
|
|
374
|
+
* Create a new address for a customer.
|
|
375
|
+
*
|
|
376
|
+
* `POST /admin/thor/dropshipper/customers/:id/addresses`
|
|
377
|
+
*/
|
|
378
|
+
createCustomerAddress(customerId: string, body: DropshipperAddressBody): Promise<DropshipperAddressResponse>;
|
|
379
|
+
/**
|
|
380
|
+
* Update an existing customer address.
|
|
381
|
+
*
|
|
382
|
+
* `PUT /admin/thor/dropshipper/customers/:id/addresses/:addressId`
|
|
383
|
+
*/
|
|
384
|
+
updateCustomerAddress(customerId: string, addressId: string, body: Partial<DropshipperAddressBody>): Promise<DropshipperAddressResponse>;
|
|
385
|
+
/**
|
|
386
|
+
* Delete a customer address.
|
|
387
|
+
*
|
|
388
|
+
* `DELETE /admin/thor/dropshipper/customers/:id/addresses/:addressId`
|
|
389
|
+
*/
|
|
390
|
+
deleteCustomerAddress(customerId: string, addressId: string): Promise<{
|
|
391
|
+
deleted: true;
|
|
392
|
+
id: string;
|
|
393
|
+
}>;
|
|
394
|
+
/**
|
|
395
|
+
* Y's account info with current balance.
|
|
396
|
+
*
|
|
397
|
+
* `GET /admin/thor/dropshipper/account`
|
|
398
|
+
*/
|
|
399
|
+
getAccount(): Promise<GetDropshipperAccountResponse>;
|
|
400
|
+
/**
|
|
401
|
+
* Orders where Y owes money to X (Y collected payment, needs to pay costs).
|
|
402
|
+
*
|
|
403
|
+
* `GET /admin/thor/dropshipper/account/payable`
|
|
404
|
+
*/
|
|
405
|
+
getPayable(): Promise<GetDropshipperPayableResponse>;
|
|
406
|
+
/**
|
|
407
|
+
* Orders where X owes money to Y (X collected COD, needs to transfer profit).
|
|
408
|
+
*
|
|
409
|
+
* `GET /admin/thor/dropshipper/account/receivable`
|
|
410
|
+
*/
|
|
411
|
+
getReceivable(): Promise<GetDropshipperReceivableResponse>;
|
|
412
|
+
/**
|
|
413
|
+
* List settlements (Y sees own; X can filter by account_id).
|
|
414
|
+
*
|
|
415
|
+
* `GET /admin/thor/dropshipper/settlements`
|
|
416
|
+
*/
|
|
417
|
+
getSettlements(options?: GetSettlementsOptions): Promise<GetSettlementsResponse>;
|
|
418
|
+
/**
|
|
419
|
+
* Full detail for a single settlement record.
|
|
420
|
+
*
|
|
421
|
+
* `GET /admin/thor/dropshipper/settlements/:id`
|
|
422
|
+
*/
|
|
423
|
+
getSettlement(settlementId: string): Promise<GetSettlementDetailResponse>;
|
|
424
|
+
/**
|
|
425
|
+
* Create a settlement record for a dropshipper account.
|
|
426
|
+
*
|
|
427
|
+
* `POST /admin/thor/dropshipper/admin/settlements`
|
|
428
|
+
*/
|
|
429
|
+
createSettlement(body: CreateSettlementBody): Promise<CreateSettlementResponse>;
|
|
430
|
+
/**
|
|
431
|
+
* Confirm a pending settlement (marks it as paid/received).
|
|
432
|
+
*
|
|
433
|
+
* `POST /admin/thor/dropshipper/admin/settlements/:id/confirm`
|
|
434
|
+
*/
|
|
435
|
+
confirmSettlement(settlementId: string, body?: ConfirmSettlementBody): Promise<UpdateSettlementStatusResponse>;
|
|
436
|
+
/**
|
|
437
|
+
* Cancel a pending settlement.
|
|
438
|
+
*
|
|
439
|
+
* `POST /admin/thor/dropshipper/admin/settlements/:id/cancel`
|
|
440
|
+
*/
|
|
441
|
+
cancelSettlement(settlementId: string, body?: CancelSettlementBody): Promise<UpdateSettlementStatusResponse>;
|
|
442
|
+
/**
|
|
443
|
+
* X views all settlement records across all dropshipper accounts.
|
|
444
|
+
*
|
|
445
|
+
* `GET /admin/thor/dropshipper/admin/settlements`
|
|
446
|
+
*/
|
|
447
|
+
getAdminSettlements(options?: GetSettlementsOptions): Promise<GetSettlementsResponse>;
|
|
448
|
+
/**
|
|
449
|
+
* List all dropshipper accounts.
|
|
450
|
+
*
|
|
451
|
+
* `GET /admin/thor/dropshipper/admin/accounts`
|
|
452
|
+
*/
|
|
453
|
+
getAdminAccounts(): Promise<GetAdminDropshipperAccountsResponse>;
|
|
454
|
+
/**
|
|
455
|
+
* Full balance detail for a specific dropshipper account.
|
|
456
|
+
*
|
|
457
|
+
* `GET /admin/thor/dropshipper/admin/accounts/:id/balance`
|
|
458
|
+
*/
|
|
459
|
+
getAdminAccountBalance(accountId: string): Promise<GetAdminAccountBalanceResponse>;
|
|
460
|
+
/**
|
|
461
|
+
* List all dropshipper price lists.
|
|
462
|
+
*
|
|
463
|
+
* `GET /admin/thor/dropshipper/admin/price-lists`
|
|
464
|
+
*/
|
|
465
|
+
getAdminPriceLists(): Promise<GetAdminPriceListsResponse>;
|
|
466
|
+
/**
|
|
467
|
+
* Utility: look up which sales channel a user belongs to.
|
|
468
|
+
*
|
|
469
|
+
* `GET /admin/thor/dropshipper/admin/user-channel`
|
|
470
|
+
*/
|
|
471
|
+
getUserChannel(): Promise<GetUserChannelResponse>;
|
|
472
|
+
/**
|
|
473
|
+
* List Y's promotions (discount codes).
|
|
474
|
+
*
|
|
475
|
+
* `GET /admin/thor/dropshipper/promotions`
|
|
476
|
+
*/
|
|
477
|
+
getPromotions(options?: GetDropshipperPromotionsOptions): Promise<GetDropshipperPromotionsResponse>;
|
|
478
|
+
/**
|
|
479
|
+
* Create a promotion for Y's channel.
|
|
480
|
+
*
|
|
481
|
+
* `POST /admin/thor/dropshipper/promotions`
|
|
482
|
+
*/
|
|
483
|
+
createPromotion(body: CreateDropshipperPromotionBody): Promise<DropshipperPromotion>;
|
|
484
|
+
/**
|
|
485
|
+
* Get a single promotion by ID.
|
|
486
|
+
*
|
|
487
|
+
* `GET /admin/thor/dropshipper/promotions/:id`
|
|
488
|
+
*/
|
|
489
|
+
getPromotion(promotionId: string): Promise<DropshipperPromotion>;
|
|
490
|
+
/**
|
|
491
|
+
* Update an existing promotion.
|
|
492
|
+
*
|
|
493
|
+
* `PUT /admin/thor/dropshipper/promotions/:id`
|
|
494
|
+
*/
|
|
495
|
+
updatePromotion(promotionId: string, body: UpdateDropshipperPromotionBody): Promise<DropshipperPromotion>;
|
|
496
|
+
/**
|
|
497
|
+
* Delete a promotion.
|
|
498
|
+
*
|
|
499
|
+
* `DELETE /admin/thor/dropshipper/promotions/:id`
|
|
500
|
+
*/
|
|
501
|
+
deletePromotion(promotionId: string): Promise<DeleteDropshipperPromotionResponse>;
|
|
502
|
+
/**
|
|
503
|
+
* Aggregate stats for Y's dashboard (revenue, profit, top products).
|
|
504
|
+
*
|
|
505
|
+
* `GET /admin/thor/dropshipper/dashboard/stats`
|
|
506
|
+
*/
|
|
507
|
+
getDashboardStats(options?: GetDashboardStatsOptions): Promise<GetDashboardStatsResponse>;
|
|
508
|
+
/**
|
|
509
|
+
* Public endpoint: dropshipper-scoped categories for the storefront.
|
|
510
|
+
* Typically called with a publishable API key rather than a JWT.
|
|
511
|
+
*
|
|
512
|
+
* `GET /store/thor/dropshipper-categories`
|
|
513
|
+
*/
|
|
514
|
+
getStorefrontCategories(): Promise<GetStorefrontDropshipperCategoriesResponse>;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
export { DropshipperClient, type DropshipperClientConfig, MedusaAdminClient, type MedusaAdminClientConfig };
|