@thorprovider/medusa-extended 1.14.1 → 1.14.2

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.ts DELETED
@@ -1,990 +0,0 @@
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, ChatIntent, ChatSource, QueryEntitiesInput, QueryResponse, DropshipperDashboardCapabilities, GetMyProfileResponse, ChatRequest, ChatResponse, ChatAssistantHealthResponse, GetNotificationsOptions, GetNotificationsResponse, GetNotificationPreferencesResponse, UpdateNotificationPreferencesBody, OnboardDropshipperBody, OnboardDropshipperResponse, GetDropshipperProductsOptions, GetDropshipperProductsResponse, ValidateCheckoutItemsRequest, ValidateCheckoutItemsResponse, CostPriceChangesCheckResponse, CostPriceChangesResponse, AcknowledgeCostPriceChangesResponse, UpdateDropshipperProductStatusBody, UpdateDropshipperProductStatusResponse, GetProductAttributesResponse, GetDropshipperAttributesResponse, UpdateDropshipperPricesBody, UpdateDropshipperPricesResponse, GetDropshipperOrdersOptions, GetDropshipperOrdersResponse, GetDropshipperOrderDetailResponse, GetDropshipperShippingOptionsBody, GetDropshipperShippingOptionsResponse, ExtendedCreateDropshipperOrderBody, ExtendedCreateDropshipperOrderResponse, ValidateGiftCardBody, ValidateGiftCardResponse, PreviewDropshipperOrderTotalsBody, PreviewDropshipperOrderTotalsResponse, SetPaymentCollectorBody, SetPaymentCollectorResponse, SetPaymentMethodBody, SetPaymentMethodResponse, CancelDropshipperOrderResponse, CreateOrderEditBody, CreateOrderEditResponse, AddOrderEditItemBody, AddOrderEditItemResponse, ConfirmOrderEditResponse, GetOrderNotesResponse, CreateOrderNoteBody, CreateOrderNoteResponse, DeleteOrderNoteResponse, GetProviderCategoriesResponse, GetDropshipperCategoriesOptions, GetDropshipperCategoriesResponse, CreateDropshipperCategoryBody, DropshipperCategory, UpdateDropshipperCategoryBody, DeleteDropshipperCategoryResponse, GetCategoryMappingsOptions, GetCategoryMappingsResponse, CreateCategoryMappingBody, CreateCategoryMappingResponse, DeleteCategoryMappingResponse, GetDropshipperCustomersOptions, GetDropshipperCustomersResponse, GetDropshipperCustomerDetailResponse, CreateDropshipperCustomerBody, CreateDropshipperCustomerResponse, UpdateDropshipperCustomerBody, UpdateDropshipperCustomerResponse, GetDropshipperAddressesResponse, DropshipperAddressBody, DropshipperAddressResponse, GetDropshipperAccountResponse, GetBusinessPolicyResponse, UpdateBusinessPolicyBody, UpdateBusinessPolicyResponse, GetDropshipperPayableResponse, GetDropshipperReceivableResponse, GetSettlementsOptions, GetSettlementsResponse, GetSettlementDetailResponse, GetDropshipperAccountBalanceResponse, GetDropshipperAccountOrdersOptions, GetDropshipperAccountOrdersResponse, CreateSettlementBody, CreateSettlementResponse, ConfirmSettlementBody, UpdateSettlementStatusResponse, CancelSettlementBody, GetAdminDropshipperAccountsResponse, GetAdminAccountBalanceResponse, GetAdminPriceListsResponse, GetUserChannelResponse, GetAdminDropshipperAccountOrdersResponse, GetAdminDropshipperAccountSettlementsOptions, GetAdminDropshipperAccountSettlementsResponse, ResolveGuaranteeBody, ResolveGuaranteeResponse, CreateCompensacionBody, CreateCompensacionResponse, CreateAjusteBody, CreateAjusteResponse, CreateCobroBody, CreateCobroResponse, CreatePagoBody, CreatePagoResponse, CreateReversoBody, CreateReversoResponse, ConfirmMovementBody, ConfirmMovementResponse, CancelMovementBody, CancelMovementResponse, GetFinancialAnalysisResponse, RegisterPaymentBody, RegisterPaymentResponse, GetDropshipperPromotionsOptions, GetDropshipperPromotionsResponse, CreateDropshipperPromotionBody, DropshipperPromotion, UpdateDropshipperPromotionBody, DeleteDropshipperPromotionResponse, GetDashboardStatsOptions, GetDashboardStatsResponse, GetStorefrontDropshipperCategoriesResponse, GetDropshipperDraftOrdersOptions, GetDropshipperDraftOrdersResponse, GetDropshipperDraftOrderDetailResponse, CreateDropshipperDraftOrderBody, CreateDropshipperDraftOrderResponse, UpdateDropshipperDraftOrderBody, UpdateDropshipperDraftOrderResponse, ConvertDropshipperDraftOrderBody, ConvertDropshipperDraftOrderResponse, DeleteDropshipperDraftOrderResponse, GetGeoCountriesResponse, GetGeoProvincesResponse, GetGeoCitiesResponse, TokenVerifyResult, RecoveryConfirmResult, SubmitApplicationBody, SubmitApplicationResult } from '@thorprovider/types';
2
-
3
- /**
4
- * @fileoverview Medusa Multi-Tenant Admin Client
5
- * @module @thorprovider/adapters/providers/medusa/admin
6
- *
7
- * Wrapper methods for all `/admin/thor/` endpoints defined in the Thor Commerce
8
- * multi-tenant API contract. Requires an admin API key (`adminConfig.apiKey`)
9
- * to be provided when creating the Medusa provider.
10
- *
11
- * Every method performs a raw `fetch` against the Medusa backend using the
12
- * admin API key (`x-medusa-access-token`) — the Medusa JS-SDK's admin client
13
- * does not expose these custom Thor plugin routes, so we use direct HTTP calls.
14
- *
15
- * Endpoint reference: `multitenant-api-contract.md`
16
- */
17
-
18
- /**
19
- * Configuration required to instantiate the admin client.
20
- */
21
- interface MedusaAdminClientConfig {
22
- /** Medusa backend base URL */
23
- baseUrl: string;
24
- /** Secret admin API key (x-medusa-access-token) */
25
- apiKey: string;
26
- /** Enable debug logging */
27
- debug?: boolean;
28
- }
29
- /**
30
- * HTTP client for Thor Commerce multi-tenant admin endpoints (`/admin/thor/`).
31
- *
32
- * All methods throw `ProviderAPIError` on non-2xx responses.
33
- *
34
- * @example
35
- * ```typescript
36
- * const admin = new MedusaAdminClient({
37
- * baseUrl: process.env.MEDUSA_BACKEND_URL!,
38
- * apiKey: process.env.MEDUSA_ADMIN_API_KEY!,
39
- * });
40
- *
41
- * const { customers } = await admin.getChannelCustomers('sc_01JXXXXX');
42
- * ```
43
- */
44
- declare class MedusaAdminClient {
45
- private baseUrl;
46
- private apiKey;
47
- private logger;
48
- constructor(config: MedusaAdminClientConfig);
49
- private request;
50
- /**
51
- * Paginated list of customers linked to a sales channel.
52
- *
53
- * `GET /admin/thor/sales-channels/:id/customers`
54
- */
55
- getChannelCustomers(salesChannelId: string, options?: GetChannelCustomersOptions): Promise<GetChannelCustomersResponse>;
56
- /**
57
- * Publishable API keys associated with a sales channel.
58
- *
59
- * `GET /admin/thor/sales-channels/:id/api-keys`
60
- */
61
- getChannelApiKeys(salesChannelId: string): Promise<GetChannelApiKeysResponse>;
62
- /**
63
- * Product categories assigned to a sales channel.
64
- *
65
- * `GET /admin/thor/sales-channels/:id/categories`
66
- */
67
- getChannelCategories(salesChannelId: string, options?: GetChannelCategoriesOptions): Promise<GetChannelCategoriesResponse>;
68
- /**
69
- * Sales channels to which a category is assigned.
70
- *
71
- * `GET /admin/thor/categories/:id/sales-channels`
72
- */
73
- getCategorySalesChannels(categoryId: string): Promise<GetCategorySalesChannelsResponse>;
74
- /**
75
- * Assign a category to one or more sales channels (idempotent).
76
- *
77
- * `POST /admin/thor/categories/:id/sales-channels`
78
- */
79
- assignCategoryToChannels(categoryId: string, body: AssignCategoriesToChannelsBody): Promise<AssignCategoriesToChannelsResponse>;
80
- /**
81
- * Remove category assignment from one or more sales channels (idempotent).
82
- *
83
- * `DELETE /admin/thor/categories/:id/sales-channels`
84
- */
85
- unassignCategoryFromChannels(categoryId: string, body: UnassignCategoriesFromChannelsBody): Promise<UnassignCategoriesFromChannelsResponse>;
86
- /**
87
- * Sales channels to which a collection is assigned.
88
- *
89
- * `GET /admin/thor/collections/:id/sales-channels`
90
- */
91
- getCollectionSalesChannels(collectionId: string): Promise<GetCollectionSalesChannelsResponse>;
92
- /**
93
- * Assign a collection to one or more sales channels (idempotent).
94
- *
95
- * `POST /admin/thor/collections/:id/sales-channels`
96
- */
97
- assignCollectionToChannels(collectionId: string, body: AssignCollectionsToChannelsBody): Promise<AssignCollectionsToChannelsResponse>;
98
- /**
99
- * Remove collection assignment from one or more sales channels (idempotent).
100
- *
101
- * `DELETE /admin/thor/collections/:id/sales-channels`
102
- */
103
- unassignCollectionFromChannels(collectionId: string, body: UnassignCollectionsFromChannelsBody): Promise<UnassignCollectionsFromChannelsResponse>;
104
- /**
105
- * Read the visual storefront configuration for a channel.
106
- * `:id` is the `sales_channel_id`.
107
- *
108
- * `GET /admin/thor/storefront-config/:id`
109
- */
110
- getStorefrontConfig(salesChannelId: string): Promise<GetAdminStorefrontConfigResponse>;
111
- /**
112
- * Update the visual storefront configuration for a channel.
113
- * Triggers the `storefront_config.updated` event → ISR webhook.
114
- *
115
- * `PUT /admin/thor/storefront-config/:id`
116
- */
117
- updateStorefrontConfig(salesChannelId: string, body: UpdateStorefrontConfigBody): Promise<UpdateStorefrontConfigResponse>;
118
- /**
119
- * Read the active Site Designer configuration for a channel, including the
120
- * last 10 history entries.
121
- *
122
- * `GET /admin/thor/site-config/:sales_channel_id`
123
- */
124
- getSiteConfig(salesChannelId: string): Promise<GetAdminSiteConfigResponse>;
125
- /**
126
- * Update the Site Designer configuration for a channel.
127
- * Creates a new history entry on every PUT.
128
- *
129
- * `PUT /admin/thor/site-config/:sales_channel_id`
130
- */
131
- updateSiteConfig(salesChannelId: string, body: UpdateSiteConfigBody): Promise<UpdateSiteConfigResponse>;
132
- /**
133
- * Full paginated history of Site Designer versions for a channel.
134
- * Entries are immutable — they are never deleted.
135
- *
136
- * `GET /admin/thor/site-config/:sales_channel_id/history`
137
- */
138
- getSiteConfigHistory(salesChannelId: string, options?: GetAdminSiteConfigHistoryOptions): Promise<GetAdminSiteConfigHistoryResponse>;
139
- /**
140
- * Restore a previous Site Designer version.
141
- * Internally runs the update workflow with the stored config of the target
142
- * version — this creates a **new** history entry and does NOT mutate past
143
- * entries.
144
- *
145
- * `POST /admin/thor/site-config/:sales_channel_id/restore/:version`
146
- */
147
- restoreSiteConfig(salesChannelId: string, version: string): Promise<RestoreSiteConfigResponse>;
148
- }
149
-
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
- * One event from the streamed AI assistant chat (`chatAssistantStream`).
168
- *
169
- * The backend returns a UI-message stream (SSE over `text/event-stream`) for
170
- * catalog searches, and a plain JSON `ChatResponse` for `default` intents.
171
- * `chatAssistantStream` normalizes both into this single event type so
172
- * consumers can render incremental text and update the "thinking" label as the
173
- * model progresses without knowing the transport details.
174
- */
175
- type ChatStreamEvent = {
176
- type: 'start';
177
- /** Semantic intent as soon as the backend resolves it. */
178
- intent?: ChatIntent;
179
- } | {
180
- type: 'text-delta';
181
- /** A chunk of the assistant's answer, appended to the bubble. */
182
- delta: string;
183
- } | {
184
- type: 'finish';
185
- intent: ChatIntent;
186
- /** Products referenced by the answer (empty for `default` intents). */
187
- sources: ChatSource[];
188
- } | {
189
- type: 'error';
190
- errorText: string;
191
- };
192
- /**
193
- * Configuration required to instantiate the dropshipper client.
194
- */
195
- interface DropshipperClientConfig {
196
- /** Medusa backend base URL */
197
- baseUrl: string;
198
- /**
199
- * JWT token obtained from `POST /auth/user/emailpass`.
200
- * Used as `Authorization: Bearer <token>`.
201
- */
202
- token: string;
203
- /** Enable debug logging */
204
- debug?: boolean;
205
- }
206
- /**
207
- * HTTP client for Thor Commerce dropshipping endpoints (`/admin/thor/dropshipper/`).
208
- *
209
- * All methods throw `ProviderAPIError` on non-2xx responses.
210
- *
211
- * @example
212
- * ```typescript
213
- * const client = new DropshipperClient({
214
- * baseUrl: process.env.MEDUSA_BACKEND_URL!,
215
- * token: jwtFromLogin,
216
- * });
217
- *
218
- * // Y: list own products
219
- * const { products } = await client.getProducts();
220
- *
221
- * // X: onboard a new dropshipper
222
- * const { dropshipper } = await client.onboardDropshipper({ ... });
223
- * ```
224
- */
225
- declare class DropshipperClient {
226
- private baseUrl;
227
- private token;
228
- private logger;
229
- constructor(config: DropshipperClientConfig);
230
- private request;
231
- /**
232
- * Resolve multiple entities in a single request.
233
- *
234
- * `POST /admin/thor/dropshipper/query`
235
- *
236
- * Entities are resolved in parallel (per layer) and errors are isolated per
237
- * entity: `response.errors[key]` holds the per-entity error while the rest
238
- * of `data` still resolves. `data[key]` is an array (list entities) or a
239
- * single object (singular entities such as account, balance, me).
240
- *
241
- * @example
242
- * ```typescript
243
- * const { data } = await client.query({
244
- * entities: [
245
- * { entity: 'capabilities' },
246
- * { entity: 'me' },
247
- * { entity: 'account' },
248
- * ],
249
- * });
250
- * ```
251
- */
252
- query(input: QueryEntitiesInput): Promise<QueryResponse>;
253
- /**
254
- * Fetch dashboard capabilities from the backend.
255
- *
256
- * `GET /admin/thor/dropshipper/capabilities`
257
- */
258
- getCapabilities(): Promise<DropshipperDashboardCapabilities>;
259
- /**
260
- * Fetch the authenticated dropshipper's personal profile including
261
- * first_name, last_name, email, avatar_url, and linked sales channel.
262
- *
263
- * `GET /admin/thor/dropshipper/me`
264
- */
265
- getMyProfile(): Promise<GetMyProfileResponse>;
266
- /**
267
- * Send a chat message to the AI assistant (catalog intelligence).
268
- * The conversation is stateless — the client sends the full message
269
- * history on every request.
270
- *
271
- * `POST /admin/thor/dropshipper/ai/chat`
272
- *
273
- * @example
274
- * ```typescript
275
- * const { answer, sources } = await client.chatAssistant({
276
- * messages: [{ role: 'user', content: 'productos con mejor margen' }],
277
- * });
278
- * ```
279
- */
280
- chatAssistant(body: ChatRequest): Promise<ChatResponse>;
281
- /**
282
- * Stream the AI assistant's reply.
283
- *
284
- * Unlike `chatAssistant`, this surfaces the model's progress: the backend
285
- * resolves the intent first and then streams the answer token by token
286
- * (catalog searches) or returns the full answer in one shot (`default`).
287
- * The response is normalized into a single `ReadableStream<ChatStreamEvent>`
288
- * so callers can show a live "thinking" label and render text incrementally.
289
- *
290
- * `POST /admin/thor/dropshipper/ai/chat`
291
- */
292
- chatAssistantStream(body: ChatRequest): Promise<ReadableStream<ChatStreamEvent>>;
293
- /**
294
- * Cheap liveness probe for the AI assistant.
295
- *
296
- * The backend performs no LLM or retrieval work, so this is safe to poll
297
- * (e.g. from a dashboard availability indicator). Returns 200 with
298
- * `available: true` when the assistant is configured; the backend answers
299
- * HTTP 503 with `available: false` when `AI_GATEWAY_API_KEY` is missing.
300
- *
301
- * Deliberately does NOT go through `fetchBackendWithResilience`: that layer
302
- * funnels every call through the SHARED `backendCircuitBreaker`, and the
303
- * definitive 503 "not configured" answer would count as failures and could
304
- * open the circuit, taking down all dropshipper API traffic. A health probe
305
- * must stay isolated, with no retries and a short timeout.
306
- *
307
- * `GET /admin/thor/dropshipper/ai/health`
308
- */
309
- chatAssistantHealth(): Promise<ChatAssistantHealthResponse>;
310
- /**
311
- * List feed notifications for the authenticated dropshipper.
312
- *
313
- * `GET /admin/thor/dropshipper/notifications`
314
- */
315
- getNotifications(options?: GetNotificationsOptions): Promise<GetNotificationsResponse>;
316
- /**
317
- * Get the authenticated dropshipper's notification preferences.
318
- *
319
- * `GET /admin/thor/dropshipper/notifications/preferences`
320
- */
321
- getNotificationPreferences(): Promise<GetNotificationPreferencesResponse>;
322
- /**
323
- * Update the authenticated dropshipper's notification preferences.
324
- *
325
- * `PATCH /admin/thor/dropshipper/notifications/preferences`
326
- */
327
- updateNotificationPreferences(body: UpdateNotificationPreferencesBody): Promise<GetNotificationPreferencesResponse>;
328
- /**
329
- * Create a new dropshipper account (sales channel + user + price list).
330
- *
331
- * `POST /admin/thor/dropshipper/onboard`
332
- */
333
- onboardDropshipper(body: OnboardDropshipperBody): Promise<OnboardDropshipperResponse>;
334
- /**
335
- * List products available in Y's channel with cost/margin data.
336
- *
337
- * `GET /admin/thor/dropshipper/products`
338
- */
339
- getProducts(options?: GetDropshipperProductsOptions): Promise<GetDropshipperProductsResponse>;
340
- /**
341
- * Validate cart items for checkout — returns current availableQuantity, sale_price,
342
- * and cost_price for each variant so the client can detect stale prices or
343
- * insufficient stock before creating an order or converting a draft.
344
- *
345
- * `POST /admin/thor/dropshipper/checkout/validate`
346
- */
347
- validateCheckoutItems(body: ValidateCheckoutItemsRequest): Promise<ValidateCheckoutItemsResponse>;
348
- /**
349
- * Check whether cost prices have changed since the last acknowledgment.
350
- * Compares a hash of all base cost prices from the channel's price list
351
- * against a stored snapshot on the dropshipper account.
352
- *
353
- * `GET /admin/thor/dropshipper/cost-prices/has-changes`
354
- */
355
- checkCostPriceChanges(): Promise<CostPriceChangesCheckResponse>;
356
- /**
357
- * Get the full diff of cost price changes since the last acknowledgment.
358
- * Returns product/variant info with old and new cost prices.
359
- *
360
- * `GET /admin/thor/dropshipper/cost-prices/changes`
361
- */
362
- getCostPriceChanges(): Promise<CostPriceChangesResponse>;
363
- /**
364
- * Acknowledge current cost prices as reviewed. Stores the current hash
365
- * and snapshot so subsequent checks will not report these prices as changed.
366
- *
367
- * `POST /admin/thor/dropshipper/cost-prices/acknowledge`
368
- */
369
- acknowledgeCostPriceChanges(): Promise<AcknowledgeCostPriceChangesResponse>;
370
- /**
371
- * Toggle whether a product is visible in the public store for the current sales channel.
372
- * This does not mutate the shared global Medusa product status.
373
- *
374
- * `POST /admin/thor/dropshipper/products/:id/status`
375
- */
376
- updateProductStatus(productId: string, body: UpdateDropshipperProductStatusBody): Promise<UpdateDropshipperProductStatusResponse>;
377
- /**
378
- * Fetch custom attribute values assigned to a product, grouped by attribute.
379
- *
380
- * `GET /admin/thor/dropshipper/products/:id/attributes`
381
- */
382
- getProductAttributes(productId: string): Promise<GetProductAttributesResponse>;
383
- /**
384
- * List attribute definitions (with their possible values) scoped to the
385
- * dropshipper's channel. Only attributes linked to at least one channel
386
- * product are returned.
387
- *
388
- * `GET /admin/thor/dropshipper/attributes`
389
- */
390
- getAttributes(): Promise<GetDropshipperAttributesResponse>;
391
- /**
392
- * Bulk-update product and variant margins on Y's channel price list.
393
- *
394
- * `PUT /admin/thor/dropshipper/prices`
395
- */
396
- updatePrices(body: UpdateDropshipperPricesBody): Promise<UpdateDropshipperPricesResponse>;
397
- /**
398
- * Paginated list of orders in Y's channel.
399
- *
400
- * `GET /admin/thor/dropshipper/orders`
401
- */
402
- getOrders(options?: GetDropshipperOrdersOptions): Promise<GetDropshipperOrdersResponse>;
403
- /**
404
- * Full detail for a single order with profit breakdown.
405
- *
406
- * `GET /admin/thor/dropshipper/orders/:id`
407
- */
408
- getOrder(orderId: string): Promise<GetDropshipperOrderDetailResponse>;
409
- /**
410
- * List shipping groups and their valid options for a manual dropshipper order.
411
- *
412
- * `POST /admin/thor/dropshipper/orders/shipping-options`
413
- */
414
- getOrderShippingOptions(body: GetDropshipperShippingOptionsBody): Promise<GetDropshipperShippingOptionsResponse>;
415
- /**
416
- * Manually create an order on behalf of a customer.
417
- *
418
- * `POST /admin/thor/dropshipper/orders`
419
- */
420
- createOrder(body: ExtendedCreateDropshipperOrderBody): Promise<ExtendedCreateDropshipperOrderResponse>;
421
- /**
422
- * Validate a gift card code for the dropshipper's channel (existence, status,
423
- * currency and channel restriction). Balance is returned when valid.
424
- *
425
- * `POST /admin/thor/dropshipper/gift-cards/validate`
426
- */
427
- validateGiftCard(body: ValidateGiftCardBody): Promise<ValidateGiftCardResponse>;
428
- /**
429
- * Preview order totals (including taxes) without creating the order.
430
- *
431
- * Replicates the creation pipeline (pricing honoring `unit_price`, region,
432
- * shipping groups) and computes tax lines with the Medusa tax module, so the
433
- * totals match what the created order will produce.
434
- *
435
- * `POST /admin/thor/dropshipper/orders/preview-totals`
436
- */
437
- previewOrderTotals(body: PreviewDropshipperOrderTotalsBody): Promise<PreviewDropshipperOrderTotalsResponse>;
438
- /**
439
- * Set who collects payment for an order (Solo X).
440
- *
441
- * `POST /admin/thor/dropshipper/orders/:id/set-payment-collector`
442
- */
443
- setPaymentCollector(orderId: string, body: SetPaymentCollectorBody): Promise<SetPaymentCollectorResponse>;
444
- /**
445
- * Change the payment method of a confirmed order.
446
- *
447
- * `POST /admin/thor/dropshipper/orders/:id/set-payment-method`
448
- */
449
- setPaymentMethod(orderId: string, body: SetPaymentMethodBody): Promise<SetPaymentMethodResponse>;
450
- /**
451
- * Cancel a dropshipper order.
452
- *
453
- * `POST /admin/thor/dropshipper/orders/:id/cancel`
454
- */
455
- cancelOrder(orderId: string): Promise<CancelDropshipperOrderResponse>;
456
- /**
457
- * Create an order edit for a dropshipper order.
458
- *
459
- * `POST /admin/thor/dropshipper/orders/:id/edit`
460
- */
461
- createOrderEdit(orderId: string, body?: CreateOrderEditBody): Promise<CreateOrderEditResponse>;
462
- /**
463
- * Add an item to the active order edit.
464
- *
465
- * `POST /admin/thor/dropshipper/orders/:id/edit/items`
466
- */
467
- addOrderEditItem(orderId: string, body: AddOrderEditItemBody): Promise<AddOrderEditItemResponse>;
468
- /**
469
- * Confirm the active order edit, applying changes to the order.
470
- *
471
- * `POST /admin/thor/dropshipper/orders/:id/edit/confirm`
472
- */
473
- confirmOrderEdit(orderId: string): Promise<ConfirmOrderEditResponse>;
474
- /**
475
- * Get all notes for an order.
476
- *
477
- * `GET /admin/thor/dropshipper/orders/:id/notes`
478
- */
479
- getOrderNotes(orderId: string): Promise<GetOrderNotesResponse>;
480
- /**
481
- * Create a new note for an order.
482
- *
483
- * `POST /admin/thor/dropshipper/orders/:id/notes`
484
- */
485
- createOrderNote(orderId: string, body: CreateOrderNoteBody): Promise<CreateOrderNoteResponse>;
486
- /**
487
- * Delete a note from an order.
488
- *
489
- * `DELETE /admin/thor/dropshipper/orders/:id/notes/:noteId`
490
- */
491
- deleteOrderNote(orderId: string, noteId: string): Promise<DeleteOrderNoteResponse>;
492
- /**
493
- * List Medusa provider categories linked to Y's channel (read-only).
494
- *
495
- * `GET /admin/thor/dropshipper/categories/provider`
496
- */
497
- getProviderCategories(): Promise<GetProviderCategoriesResponse>;
498
- /**
499
- * List Y's custom product categories.
500
- *
501
- * `GET /admin/thor/dropshipper/categories`
502
- */
503
- getCategories(options?: GetDropshipperCategoriesOptions): Promise<GetDropshipperCategoriesResponse>;
504
- /**
505
- * Create a custom category in Y's channel.
506
- *
507
- * `POST /admin/thor/dropshipper/categories`
508
- */
509
- createCategory(body: CreateDropshipperCategoryBody): Promise<DropshipperCategory>;
510
- /**
511
- * Update a custom category.
512
- *
513
- * `PUT /admin/thor/dropshipper/categories/:id`
514
- */
515
- updateCategory(categoryId: string, body: UpdateDropshipperCategoryBody): Promise<DropshipperCategory>;
516
- /**
517
- * Delete a custom category.
518
- *
519
- * `DELETE /admin/thor/dropshipper/categories/:id`
520
- */
521
- deleteCategory(categoryId: string, options?: {
522
- force?: boolean;
523
- }): Promise<DeleteDropshipperCategoryResponse>;
524
- /**
525
- * List product-to-category mappings, optionally filtered by product.
526
- *
527
- * `GET /admin/thor/dropshipper/category-mappings`
528
- */
529
- getCategoryMappings(options?: GetCategoryMappingsOptions): Promise<GetCategoryMappingsResponse>;
530
- /**
531
- * Map a product to a custom category.
532
- *
533
- * `POST /admin/thor/dropshipper/category-mappings`
534
- */
535
- createCategoryMapping(body: CreateCategoryMappingBody): Promise<CreateCategoryMappingResponse>;
536
- /**
537
- * Remove a product-to-category mapping.
538
- *
539
- * `DELETE /admin/thor/dropshipper/category-mappings/:id`
540
- */
541
- deleteCategoryMapping(mappingId: string): Promise<DeleteCategoryMappingResponse>;
542
- /**
543
- * Paginated list of customers in Y's channel.
544
- *
545
- * `GET /admin/thor/dropshipper/customers`
546
- */
547
- getCustomers(options?: GetDropshipperCustomersOptions): Promise<GetDropshipperCustomersResponse>;
548
- /**
549
- * Backwards-compatible alias used by the dashboard checkout flow.
550
- */
551
- getChannelCustomers(_channelId: string, options?: GetDropshipperCustomersOptions): Promise<GetDropshipperCustomersResponse>;
552
- /**
553
- * Full detail for a single customer.
554
- *
555
- * `GET /admin/thor/dropshipper/customers/:id`
556
- */
557
- getCustomer(customerId: string): Promise<GetDropshipperCustomerDetailResponse>;
558
- /**
559
- * Create a customer scoped to Y's channel.
560
- *
561
- * `POST /admin/thor/dropshipper/customers`
562
- */
563
- createCustomer(body: CreateDropshipperCustomerBody): Promise<CreateDropshipperCustomerResponse>;
564
- /**
565
- * Update a customer scoped to Y's channel.
566
- *
567
- * `POST /admin/thor/dropshipper/customers/:id`
568
- */
569
- updateCustomer(customerId: string, body: UpdateDropshipperCustomerBody): Promise<UpdateDropshipperCustomerResponse>;
570
- /**
571
- * Transform a raw snake_case address from the API into a camelCase Address.
572
- */
573
- private transformAddress;
574
- /**
575
- * List addresses for a customer in Y's channel.
576
- *
577
- * `GET /admin/thor/dropshipper/customers/:id/addresses`
578
- */
579
- getCustomerAddresses(customerId: string): Promise<GetDropshipperAddressesResponse>;
580
- /**
581
- * Create a new address for a customer.
582
- *
583
- * `POST /admin/thor/dropshipper/customers/:id/addresses`
584
- */
585
- createCustomerAddress(customerId: string, body: DropshipperAddressBody): Promise<DropshipperAddressResponse>;
586
- /**
587
- * Update an existing customer address.
588
- *
589
- * `POST /admin/thor/dropshipper/customers/:id/addresses/:addressId`
590
- */
591
- updateCustomerAddress(customerId: string, addressId: string, body: Partial<DropshipperAddressBody>): Promise<DropshipperAddressResponse>;
592
- /**
593
- * Delete a customer address.
594
- *
595
- * `DELETE /admin/thor/dropshipper/customers/:id/addresses/:addressId`
596
- */
597
- deleteCustomerAddress(customerId: string, addressId: string): Promise<{
598
- deleted: true;
599
- id: string;
600
- }>;
601
- /**
602
- * Y's account info with current balance.
603
- *
604
- * `GET /admin/thor/dropshipper/account`
605
- */
606
- getAccount(): Promise<GetDropshipperAccountResponse>;
607
- /**
608
- * Get the authenticated dropshipper's business policy text.
609
- * Returns an empty string when no policy is set.
610
- *
611
- * `GET /admin/thor/dropshipper/account/policies`
612
- */
613
- getBusinessPolicy(): Promise<GetBusinessPolicyResponse>;
614
- /**
615
- * Update the authenticated dropshipper's business policy text.
616
- * The value is trimmed server-side before being persisted.
617
- *
618
- * `PATCH /admin/thor/dropshipper/account/policies`
619
- */
620
- updateBusinessPolicy(body: UpdateBusinessPolicyBody): Promise<UpdateBusinessPolicyResponse>;
621
- /**
622
- * Orders where Y owes money to X (Y collected payment, needs to pay costs).
623
- *
624
- * `GET /admin/thor/dropshipper/account/payable`
625
- */
626
- getPayable(): Promise<GetDropshipperPayableResponse>;
627
- /**
628
- * Orders where X owes money to Y (X collected COD, needs to transfer profit).
629
- *
630
- * `GET /admin/thor/dropshipper/account/receivable`
631
- */
632
- getReceivable(): Promise<GetDropshipperReceivableResponse>;
633
- /**
634
- * List settlements (Y sees own; X can filter by account_id).
635
- *
636
- * `GET /admin/thor/dropshipper/settlements`
637
- */
638
- getSettlements(options?: GetSettlementsOptions): Promise<GetSettlementsResponse>;
639
- /**
640
- * Full detail for a single settlement record.
641
- *
642
- * `GET /admin/thor/dropshipper/settlements/:id`
643
- */
644
- getSettlement(settlementId: string): Promise<GetSettlementDetailResponse>;
645
- /**
646
- * Consolidated financial balance for the authenticated dropshipper.
647
- *
648
- * `GET /admin/thor/dropshipper/account/balance`
649
- */
650
- getAccountBalance(): Promise<GetDropshipperAccountBalanceResponse>;
651
- /**
652
- * Unified financial order list for the authenticated dropshipper.
653
- *
654
- * `GET /admin/thor/dropshipper/account/orders`
655
- */
656
- getAccountOrders(options?: GetDropshipperAccountOrdersOptions): Promise<GetDropshipperAccountOrdersResponse>;
657
- /**
658
- * Create a settlement record for a dropshipper account.
659
- *
660
- * `POST /admin/thor/dropshipper/admin/settlements`
661
- */
662
- createSettlement(body: CreateSettlementBody): Promise<CreateSettlementResponse>;
663
- /**
664
- * Confirm a pending settlement (marks it as paid/received).
665
- *
666
- * `POST /admin/thor/dropshipper/admin/settlements/:id/confirm`
667
- */
668
- confirmSettlement(settlementId: string, body?: ConfirmSettlementBody): Promise<UpdateSettlementStatusResponse>;
669
- /**
670
- * Cancel a pending settlement.
671
- *
672
- * `POST /admin/thor/dropshipper/admin/settlements/:id/cancel`
673
- */
674
- cancelSettlement(settlementId: string, body?: CancelSettlementBody): Promise<UpdateSettlementStatusResponse>;
675
- /**
676
- * X views all settlement records across all dropshipper accounts.
677
- *
678
- * `GET /admin/thor/dropshipper/admin/settlements`
679
- */
680
- getAdminSettlements(options?: GetSettlementsOptions): Promise<GetSettlementsResponse>;
681
- /**
682
- * List all dropshipper accounts.
683
- *
684
- * `GET /admin/thor/dropshipper/admin/accounts`
685
- */
686
- getAdminAccounts(): Promise<GetAdminDropshipperAccountsResponse>;
687
- /**
688
- * Full balance detail for a specific dropshipper account.
689
- *
690
- * `GET /admin/thor/dropshipper/admin/accounts/:id/balance`
691
- */
692
- getAdminAccountBalance(accountId: string): Promise<GetAdminAccountBalanceResponse>;
693
- /**
694
- * List all dropshipper price lists.
695
- *
696
- * `GET /admin/thor/dropshipper/admin/price-lists`
697
- */
698
- getAdminPriceLists(): Promise<GetAdminPriceListsResponse>;
699
- /**
700
- * Utility: look up which sales channel a user belongs to.
701
- *
702
- * `GET /admin/thor/dropshipper/admin/user-channel`
703
- */
704
- getUserChannel(): Promise<GetUserChannelResponse>;
705
- /**
706
- * List orders with financial detail for a dropshipper account (Admin only).
707
- *
708
- * `GET /admin/thor/dropshipper/admin/accounts/:id/orders`
709
- */
710
- getAdminAccountOrders(accountId: string, options?: GetDropshipperAccountOrdersOptions): Promise<GetAdminDropshipperAccountOrdersResponse>;
711
- /**
712
- * List financial movements for a dropshipper account (Admin only).
713
- *
714
- * `GET /admin/thor/dropshipper/admin/accounts/:id/settlements`
715
- */
716
- getAdminAccountSettlements(accountId: string, options?: GetAdminDropshipperAccountSettlementsOptions): Promise<GetAdminDropshipperAccountSettlementsResponse>;
717
- /**
718
- * Manually resolve a guarantee on an order (Admin only).
719
- *
720
- * `POST /admin/thor/dropshipper/admin/accounts/:id/guarantee/:order_id`
721
- */
722
- resolveGuarantee(accountId: string, orderId: string, body: ResolveGuaranteeBody): Promise<ResolveGuaranteeResponse>;
723
- /**
724
- * Create an internal compensation (netting) between DS and Thor debts (Admin only).
725
- *
726
- * `POST /admin/thor/dropshipper/admin/accounts/:id/settlements/compensacion`
727
- */
728
- createCompensacion(accountId: string, body: CreateCompensacionBody): Promise<CreateCompensacionResponse>;
729
- /**
730
- * Create a financial adjustment (Admin only).
731
- *
732
- * `POST /admin/thor/dropshipper/admin/accounts/:id/settlements/ajuste`
733
- */
734
- createAjuste(accountId: string, body: CreateAjusteBody): Promise<CreateAjusteResponse>;
735
- /**
736
- * Register a cobro — DS pays Thor the product cost (Admin only).
737
- *
738
- * `POST /admin/thor/dropshipper/admin/accounts/:id/settlements/cobro`
739
- */
740
- createCobro(accountId: string, body: CreateCobroBody): Promise<CreateCobroResponse>;
741
- /**
742
- * Register a pago — Thor pays the dropshipper their commission (Admin only).
743
- *
744
- * `POST /admin/thor/dropshipper/admin/accounts/:id/settlements/pago`
745
- */
746
- createPago(accountId: string, body: CreatePagoBody): Promise<CreatePagoResponse>;
747
- /**
748
- * Reverse a confirmed financial movement (Admin only).
749
- *
750
- * `POST /admin/thor/dropshipper/admin/accounts/:id/settlements/:mov_id/reverso`
751
- */
752
- reverseSettlement(accountId: string, movementId: string, body: CreateReversoBody): Promise<CreateReversoResponse>;
753
- /**
754
- * Confirm a pending financial movement (Admin only).
755
- *
756
- * `POST /admin/thor/dropshipper/admin/accounts/:id/settlements/:mov_id/confirm`
757
- */
758
- confirmSettlementMovement(accountId: string, movementId: string, body?: ConfirmMovementBody): Promise<ConfirmMovementResponse>;
759
- /**
760
- * Cancel a pending financial movement draft (Admin only).
761
- *
762
- * `POST /admin/thor/dropshipper/admin/accounts/:id/settlements/:mov_id/cancel`
763
- */
764
- cancelSettlementMovement(accountId: string, movementId: string, body: CancelMovementBody): Promise<CancelMovementResponse>;
765
- /**
766
- * Get financial analysis for a dropshipper order (Admin only).
767
- *
768
- * `GET /admin/thor/dropshipper/admin/orders/:id/financial-analysis`
769
- */
770
- getOrderFinancialAnalysis(orderId: string): Promise<GetFinancialAnalysisResponse>;
771
- /**
772
- * Register a partial or full payment for an order.
773
- *
774
- * `POST /admin/thor/dropshipper/orders/:id/payment`
775
- */
776
- registerOrderPayment(orderId: string, body: RegisterPaymentBody): Promise<RegisterPaymentResponse>;
777
- /**
778
- * List Y's promotions (discount codes).
779
- *
780
- * `GET /admin/thor/dropshipper/promotions`
781
- */
782
- getPromotions(options?: GetDropshipperPromotionsOptions): Promise<GetDropshipperPromotionsResponse>;
783
- /**
784
- * Create a promotion for Y's channel.
785
- *
786
- * `POST /admin/thor/dropshipper/promotions`
787
- */
788
- createPromotion(body: CreateDropshipperPromotionBody): Promise<DropshipperPromotion>;
789
- /**
790
- * Get a single promotion by ID.
791
- *
792
- * `GET /admin/thor/dropshipper/promotions/:id`
793
- */
794
- getPromotion(promotionId: string): Promise<DropshipperPromotion>;
795
- /**
796
- * Update an existing promotion.
797
- *
798
- * `PUT /admin/thor/dropshipper/promotions/:id`
799
- */
800
- updatePromotion(promotionId: string, body: UpdateDropshipperPromotionBody): Promise<DropshipperPromotion>;
801
- /**
802
- * Delete a promotion.
803
- *
804
- * `DELETE /admin/thor/dropshipper/promotions/:id`
805
- */
806
- deletePromotion(promotionId: string): Promise<DeleteDropshipperPromotionResponse>;
807
- /**
808
- * Aggregate stats for Y's dashboard (revenue, profit, top products).
809
- *
810
- * `GET /admin/thor/dropshipper/dashboard/stats`
811
- */
812
- getDashboardStats(options?: GetDashboardStatsOptions): Promise<GetDashboardStatsResponse>;
813
- /**
814
- * Public endpoint: dropshipper-scoped categories for the storefront.
815
- * Typically called with a publishable API key rather than a JWT.
816
- *
817
- * `GET /store/thor/dropshipper-categories`
818
- */
819
- getStorefrontCategories(): Promise<GetStorefrontDropshipperCategoriesResponse>;
820
- /**
821
- * List all draft orders in the dropshipper's channel.
822
- *
823
- * `GET /admin/thor/dropshipper/draft-orders`
824
- */
825
- getDraftOrders(options?: GetDropshipperDraftOrdersOptions): Promise<GetDropshipperDraftOrdersResponse>;
826
- /**
827
- * Get a specific draft order by ID.
828
- *
829
- * `GET /admin/thor/dropshipper/draft-orders/:id`
830
- */
831
- getDraftOrder(draftOrderId: string): Promise<GetDropshipperDraftOrderDetailResponse>;
832
- /**
833
- * Create a new draft order.
834
- *
835
- * `POST /admin/thor/dropshipper/draft-orders`
836
- */
837
- createDraftOrder(body: CreateDropshipperDraftOrderBody): Promise<CreateDropshipperDraftOrderResponse>;
838
- /**
839
- * Update a draft order.
840
- *
841
- * `POST /admin/thor/dropshipper/draft-orders/:id`
842
- */
843
- updateDraftOrder(draftOrderId: string, body: UpdateDropshipperDraftOrderBody): Promise<UpdateDropshipperDraftOrderResponse>;
844
- /**
845
- * Convert a draft order to a real order.
846
- *
847
- * `POST /admin/thor/dropshipper/draft-orders/:id/convert`
848
- */
849
- convertDraftOrder(draftOrderId: string, body: ConvertDropshipperDraftOrderBody): Promise<ConvertDropshipperDraftOrderResponse>;
850
- /**
851
- * Delete a draft order.
852
- *
853
- * `DELETE /admin/thor/dropshipper/draft-orders/:id`
854
- */
855
- deleteDraftOrder(draftOrderId: string): Promise<DeleteDropshipperDraftOrderResponse>;
856
- /**
857
- * List all geo-reference countries.
858
- *
859
- * `GET /admin/geo-reference`
860
- */
861
- getGeoCountries(): Promise<GetGeoCountriesResponse>;
862
- /**
863
- * List provinces/states for a country.
864
- *
865
- * `GET /admin/geo-reference/countries/:iso_2/provinces`
866
- */
867
- getGeoProvinces(iso2: string): Promise<GetGeoProvincesResponse>;
868
- /**
869
- * List cities for a province/state.
870
- *
871
- * `GET /admin/geo-reference/provinces/:code/cities`
872
- */
873
- getGeoCities(code: string): Promise<GetGeoCitiesResponse>;
874
- }
875
-
876
- /**
877
- * @fileoverview Recovery Client — Thor Commerce Extended
878
- * @module @thorprovider/medusa-extended/recovery
879
- *
880
- * Public HTTP client for account-recovery flows (password reset + activation).
881
- *
882
- * Unlike `DropshipperClient`, this client does NOT require a JWT: it talks to
883
- * public storefront endpoints so a user can recover access without being
884
- * logged in. Backend URLs are owned here; the dashboard never builds them.
885
- *
886
- * Endpoints:
887
- * - `POST /dropshipper/auth/emailpass/reset-password` (request reset, dropshipper)
888
- * - `GET /dropshipper/auth/emailpass/reset-password/verify` (verify reset token, no consume)
889
- * - `POST /dropshipper/auth/emailpass/update` (confirm reset, consumes token)
890
- * - `GET /store/dropshipper/applications/activate/verify` (verify activation token, no consume)
891
- * - `POST /store/dropshipper/applications/activate` (confirm activation, consumes token)
892
- * - `POST /public/dropshipper/applications` (submit application, no auth)
893
- *
894
- * Confirm methods follow the two-phase contract: verify (no consume) first,
895
- * then confirm (atomic consume). A re-verify after a failed confirm maps the
896
- * TOCTOU state (used/expired/revoked) into `RecoveryConfirmResult.status`.
897
- *
898
- * `submitApplication` returns a discriminated `SubmitApplicationResult` instead
899
- * of throwing on 400/409/429 so the caller can surface the backend's structured
900
- * payload (existing application on 409, retry window on 429). Network/5xx
901
- * errors are re-thrown as `ProviderAPIError`.
902
- */
903
-
904
- /**
905
- * Configuration required to instantiate the recovery client.
906
- */
907
- interface RecoveryClientConfig {
908
- /** Medusa backend base URL */
909
- baseUrl: string;
910
- /** Enable debug logging */
911
- debug?: boolean;
912
- }
913
- /**
914
- * HTTP client for account-recovery endpoints (public, no auth required).
915
- *
916
- * All methods throw `ProviderAPIError` on non-2xx responses except the
917
- * confirm methods, which normalize failures into `RecoveryConfirmResult`.
918
- *
919
- * @example
920
- * ```typescript
921
- * const client = new RecoveryClient({
922
- * baseUrl: process.env.MEDUSA_BACKEND_URL!,
923
- * });
924
- *
925
- * await client.requestUserPasswordReset('juan@ejemplo.com');
926
- * const result = await client.verifyUserPasswordResetToken(token);
927
- * const confirm = await client.confirmUserPasswordReset(token, 'NuevaClave1');
928
- * ```
929
- */
930
- declare class RecoveryClient {
931
- private baseUrl;
932
- private logger;
933
- constructor(config: RecoveryClientConfig);
934
- private request;
935
- /**
936
- * Solicita un email de reset de contraseña para el actor `user`
937
- * (dropshippers). El backend responde de forma uniforme exista o no la
938
- * cuenta (anti enumeración).
939
- *
940
- * `POST /dropshipper/auth/emailpass/reset-password`
941
- */
942
- requestUserPasswordReset(email: string): Promise<void>;
943
- /**
944
- * Verifica un token de reset de contraseña sin consumirlo. Devuelve el
945
- * email enmascarado (p. ej. `j***@ejemplo.com`) solo cuando `status === 'valid'`.
946
- *
947
- * `GET /dropshipper/auth/emailpass/reset-password/verify`
948
- */
949
- verifyUserPasswordResetToken(token: string): Promise<TokenVerifyResult>;
950
- /**
951
- * Confirma el reset: re-verifica el token (sin consumir), luego consume el
952
- * token vía `POST /dropshipper/auth/emailpass/update`. El email se deriva del
953
- * propio JWT en el backend; aquí solo se envía la nueva contraseña. Nunca
954
- * devuelve auto-login: al éxito, la UI redirige a /login.
955
- */
956
- confirmUserPasswordReset(token: string, password: string): Promise<RecoveryConfirmResult>;
957
- /**
958
- * Verifica un token de activación de cuenta dropshipper sin consumirlo.
959
- *
960
- * `GET /store/dropshipper/applications/activate/verify`
961
- */
962
- verifyActivationToken(token: string): Promise<TokenVerifyResult>;
963
- /**
964
- * Activa la cuenta: re-verifica el token (sin consumir), luego consume el
965
- * token vía `POST /store/dropshipper/applications/activate` y establece la
966
- * contraseña inicial. Al éxito, la UI redirige a /login sin auto-login.
967
- */
968
- activateAccount(token: string, password: string): Promise<RecoveryConfirmResult>;
969
- /**
970
- * Envía una solicitud de acceso dropshipper al endpoint público.
971
- *
972
- * `POST /public/dropshipper/applications`
973
- *
974
- * No requiere autenticación. Devuelve un resultado discriminado:
975
- * - `{ ok: true }` → 201, solicitud creada (`application.number`).
976
- * - `{ ok: false, reason: 'conflict' }` → 409, email ya registrado; la
977
- * solicitud existente incluye `status_label`/`reason` para la UI.
978
- * - `{ ok: false, reason: 'rate_limited' }` → 429, se respetó el límite del
979
- * backend; `retryAfterSeconds` indica cuándo reintentar.
980
- * - `{ ok: false, reason: 'invalid_data' }` → 400, validación del backend.
981
- *
982
- * Los errores de red/5xx se re-lanzan como `ProviderAPIError` para que el
983
- * llamador los categorice (p. ej. con `parseError`). El 429 no se reintenta
984
- * (`retryableStatusCodes` sin 429) para que el caller reciba de inmediato el
985
- * `retry_after_seconds` del backend y pueda bloquear el envío.
986
- */
987
- submitApplication(body: SubmitApplicationBody): Promise<SubmitApplicationResult>;
988
- }
989
-
990
- export { type ChatStreamEvent, DropshipperClient, type DropshipperClientConfig, MedusaAdminClient, type MedusaAdminClientConfig, RecoveryClient, type RecoveryClientConfig };