@thorprovider/medusa-extended 1.9.0 → 1.10.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/dist/index.d.mts +23 -2
- package/dist/index.d.ts +23 -2
- package/dist/index.js +33 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/dropshipper.test.ts +3 -3
- package/src/dropshipper.ts +42 -2
package/src/dropshipper.ts
CHANGED
|
@@ -74,6 +74,7 @@ import type {
|
|
|
74
74
|
UpdateDropshipperDraftOrderResponse,
|
|
75
75
|
ConvertDropshipperDraftOrderBody,
|
|
76
76
|
ConvertDropshipperDraftOrderResponse,
|
|
77
|
+
DeleteDropshipperDraftOrderResponse,
|
|
77
78
|
// Dropshipper Addresses
|
|
78
79
|
DropshipperAddressBody,
|
|
79
80
|
DropshipperAddressResponse,
|
|
@@ -162,6 +163,9 @@ import type {
|
|
|
162
163
|
GetGeoCitiesResponse,
|
|
163
164
|
// Dashboard Capabilities
|
|
164
165
|
DropshipperDashboardCapabilities,
|
|
166
|
+
// AI Assistant Chat
|
|
167
|
+
ChatRequest,
|
|
168
|
+
ChatResponse,
|
|
165
169
|
// Profile
|
|
166
170
|
GetMyProfileResponse,
|
|
167
171
|
// Notifications
|
|
@@ -312,6 +316,28 @@ export class DropshipperClient {
|
|
|
312
316
|
);
|
|
313
317
|
}
|
|
314
318
|
|
|
319
|
+
/**
|
|
320
|
+
* Send a chat message to the AI assistant (catalog intelligence).
|
|
321
|
+
* The conversation is stateless — the client sends the full message
|
|
322
|
+
* history on every request.
|
|
323
|
+
*
|
|
324
|
+
* `POST /admin/thor/dropshipper/ai/chat`
|
|
325
|
+
*
|
|
326
|
+
* @example
|
|
327
|
+
* ```typescript
|
|
328
|
+
* const { answer, sources } = await client.chatAssistant({
|
|
329
|
+
* messages: [{ role: 'user', content: 'productos con mejor margen' }],
|
|
330
|
+
* });
|
|
331
|
+
* ```
|
|
332
|
+
*/
|
|
333
|
+
async chatAssistant(body: ChatRequest): Promise<ChatResponse> {
|
|
334
|
+
return this.request<ChatResponse>(
|
|
335
|
+
'POST',
|
|
336
|
+
'/admin/thor/dropshipper/ai/chat',
|
|
337
|
+
body,
|
|
338
|
+
);
|
|
339
|
+
}
|
|
340
|
+
|
|
315
341
|
// -------------------------------------------------------------------------
|
|
316
342
|
// Notifications
|
|
317
343
|
// -------------------------------------------------------------------------
|
|
@@ -450,7 +476,7 @@ export class DropshipperClient {
|
|
|
450
476
|
}
|
|
451
477
|
|
|
452
478
|
/**
|
|
453
|
-
* Validate cart items for checkout — returns current
|
|
479
|
+
* Validate cart items for checkout — returns current availableQuantity, sale_price,
|
|
454
480
|
* and cost_price for each variant so the client can detect stale prices or
|
|
455
481
|
* insufficient stock before creating an order or converting a draft.
|
|
456
482
|
*
|
|
@@ -1762,6 +1788,20 @@ export class DropshipperClient {
|
|
|
1762
1788
|
);
|
|
1763
1789
|
}
|
|
1764
1790
|
|
|
1791
|
+
/**
|
|
1792
|
+
* Delete a draft order.
|
|
1793
|
+
*
|
|
1794
|
+
* `DELETE /admin/thor/dropshipper/draft-orders/:id`
|
|
1795
|
+
*/
|
|
1796
|
+
async deleteDraftOrder(
|
|
1797
|
+
draftOrderId: string,
|
|
1798
|
+
): Promise<DeleteDropshipperDraftOrderResponse> {
|
|
1799
|
+
return this.request<DeleteDropshipperDraftOrderResponse>(
|
|
1800
|
+
'DELETE',
|
|
1801
|
+
`/admin/thor/dropshipper/draft-orders/${draftOrderId}`,
|
|
1802
|
+
);
|
|
1803
|
+
}
|
|
1804
|
+
|
|
1765
1805
|
// -------------------------------------------------------------------------
|
|
1766
1806
|
// Geo-reference
|
|
1767
1807
|
// -------------------------------------------------------------------------
|
|
@@ -1801,4 +1841,4 @@ export class DropshipperClient {
|
|
|
1801
1841
|
}
|
|
1802
1842
|
|
|
1803
1843
|
// Re-export types used by callers so they don't need to import from @thorprovider/types directly.
|
|
1804
|
-
export type { DropshipperCategory, DropshipperPromotion, RawNotification, GetNotificationsOptions, GetNotificationsResponse } from '@thorprovider/types';
|
|
1844
|
+
export type { DropshipperCategory, DropshipperPromotion, RawNotification, GetNotificationsOptions, GetNotificationsResponse, ChatRequest, ChatResponse, ChatMessage, ChatIntent, ChatSource, ChatSourceVariant } from '@thorprovider/types';
|