@mitumba/sdk 1.25.0 → 1.27.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 +221 -3
- package/dist/index.d.ts +221 -3
- package/dist/index.js +90 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +89 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -434,6 +434,13 @@ var AuthModule = class {
|
|
|
434
434
|
async becomeSeller(input, options) {
|
|
435
435
|
return this.client.post("/auth/become-seller", input, options);
|
|
436
436
|
}
|
|
437
|
+
/**
|
|
438
|
+
* Upgrade the current user to a bale (wholesale) seller role.
|
|
439
|
+
* Mutually exclusive with retail seller — 409 if already a retail seller.
|
|
440
|
+
*/
|
|
441
|
+
async becomeBaleSeller(input, options) {
|
|
442
|
+
return this.client.post("/auth/become-bale-seller", input, options);
|
|
443
|
+
}
|
|
437
444
|
/**
|
|
438
445
|
* Check if the account is eligible for deletion and what blockers exist.
|
|
439
446
|
*/
|
|
@@ -1414,6 +1421,82 @@ var ReportsModule = class {
|
|
|
1414
1421
|
}
|
|
1415
1422
|
};
|
|
1416
1423
|
|
|
1424
|
+
// src/modules/wholesale.ts
|
|
1425
|
+
var WholesaleModule = class {
|
|
1426
|
+
constructor(client) {
|
|
1427
|
+
this.client = client;
|
|
1428
|
+
}
|
|
1429
|
+
client;
|
|
1430
|
+
// ── Wholesale Store ──
|
|
1431
|
+
/** Get the current user's wholesale store and depots. */
|
|
1432
|
+
async getWholesaleStore(options) {
|
|
1433
|
+
return this.client.get("/listings/wholesale/store", void 0, options);
|
|
1434
|
+
}
|
|
1435
|
+
/** Create or update the wholesale store (bale_seller only). */
|
|
1436
|
+
async saveWholesaleStore(input, options) {
|
|
1437
|
+
return this.client.post("/listings/wholesale/store", input, options);
|
|
1438
|
+
}
|
|
1439
|
+
/** Add a depot to the wholesale store. */
|
|
1440
|
+
async addDepot(input, options) {
|
|
1441
|
+
return this.client.post("/listings/wholesale/store/depots", input, options);
|
|
1442
|
+
}
|
|
1443
|
+
/** Remove a depot. */
|
|
1444
|
+
async removeDepot(id, options) {
|
|
1445
|
+
return this.client.delete(`/listings/wholesale/store/depots/${id}`, void 0, options);
|
|
1446
|
+
}
|
|
1447
|
+
// ── Bales ──
|
|
1448
|
+
/** Create a bale listing (requires verified wholesale store). */
|
|
1449
|
+
async createBale(input, options) {
|
|
1450
|
+
return this.client.post("/listings/bales", input, options);
|
|
1451
|
+
}
|
|
1452
|
+
/** Get a bale by ID (public). */
|
|
1453
|
+
async getBale(id, options) {
|
|
1454
|
+
return this.client.get(`/listings/bales/${id}`, void 0, options);
|
|
1455
|
+
}
|
|
1456
|
+
/** Update a bale. */
|
|
1457
|
+
async updateBale(id, input, options) {
|
|
1458
|
+
return this.client.patch(`/listings/bales/${id}`, input, options);
|
|
1459
|
+
}
|
|
1460
|
+
/** Soft-delete a bale. */
|
|
1461
|
+
async removeBale(id, options) {
|
|
1462
|
+
return this.client.delete(`/listings/bales/${id}`, void 0, options);
|
|
1463
|
+
}
|
|
1464
|
+
/** Get all bales for the current user's wholesale store. */
|
|
1465
|
+
async myBales(options) {
|
|
1466
|
+
return this.client.get("/listings/wholesale/mine/bales", void 0, options);
|
|
1467
|
+
}
|
|
1468
|
+
// ── Feed ──
|
|
1469
|
+
/** Browse the wholesale bale feed (public). */
|
|
1470
|
+
async wholesaleFeed(params, options) {
|
|
1471
|
+
return this.client.get(
|
|
1472
|
+
"/listings/wholesale/feed",
|
|
1473
|
+
params,
|
|
1474
|
+
options
|
|
1475
|
+
);
|
|
1476
|
+
}
|
|
1477
|
+
// ── Bale Orders ──
|
|
1478
|
+
/** Create a bale order (buyer). */
|
|
1479
|
+
async createBaleOrder(input, options) {
|
|
1480
|
+
return this.client.post("/listings/bale-orders", input, options);
|
|
1481
|
+
}
|
|
1482
|
+
/** Get the buyer's bale orders. */
|
|
1483
|
+
async myBaleOrders(options) {
|
|
1484
|
+
return this.client.get("/listings/bale-orders/mine", void 0, options);
|
|
1485
|
+
}
|
|
1486
|
+
/** Get incoming bale orders (seller). */
|
|
1487
|
+
async incomingBaleOrders(options) {
|
|
1488
|
+
return this.client.get("/listings/wholesale/orders", void 0, options);
|
|
1489
|
+
}
|
|
1490
|
+
/** Get a bale order by ID with event timeline. */
|
|
1491
|
+
async getBaleOrder(id, options) {
|
|
1492
|
+
return this.client.get(`/listings/bale-orders/${id}`, void 0, options);
|
|
1493
|
+
}
|
|
1494
|
+
/** Transition a bale order status. */
|
|
1495
|
+
async transitionBaleOrder(id, action, options) {
|
|
1496
|
+
return this.client.post(`/listings/bale-orders/${id}/transition`, { action }, options);
|
|
1497
|
+
}
|
|
1498
|
+
};
|
|
1499
|
+
|
|
1417
1500
|
// src/types/auth.ts
|
|
1418
1501
|
var TWO_FACTOR_METHOD_TYPES = ["totp", "sms", "email", "passkey"];
|
|
1419
1502
|
|
|
@@ -1442,6 +1525,9 @@ var DISPUTE_REASONS = ["not_received", "not_as_described", "damaged", "counterfe
|
|
|
1442
1525
|
var DESIRED_RESOLUTIONS = ["refund", "replacement", "partial_refund"];
|
|
1443
1526
|
var DISPUTE_STATUSES = ["open", "seller_responded", "under_review", "resolved_refund", "resolved_release", "resolved_partial", "withdrawn"];
|
|
1444
1527
|
|
|
1528
|
+
// src/types/wholesale.ts
|
|
1529
|
+
var BALE_ORDER_STATUSES = ["pending_payment", "paid", "confirmed", "in_transit", "delivered", "completed", "cancelled"];
|
|
1530
|
+
|
|
1445
1531
|
// src/index.ts
|
|
1446
1532
|
var MitumbaClient = class {
|
|
1447
1533
|
api;
|
|
@@ -1464,6 +1550,7 @@ var MitumbaClient = class {
|
|
|
1464
1550
|
disputes;
|
|
1465
1551
|
uploads;
|
|
1466
1552
|
reports;
|
|
1553
|
+
wholesale;
|
|
1467
1554
|
constructor(config) {
|
|
1468
1555
|
this.api = new APIClient(config);
|
|
1469
1556
|
this.auth = new AuthModule(this.api);
|
|
@@ -1485,6 +1572,7 @@ var MitumbaClient = class {
|
|
|
1485
1572
|
this.disputes = new DisputesModule(this.api);
|
|
1486
1573
|
this.uploads = new UploadsModule(this.api);
|
|
1487
1574
|
this.reports = new ReportsModule(this.api);
|
|
1575
|
+
this.wholesale = new WholesaleModule(this.api);
|
|
1488
1576
|
}
|
|
1489
1577
|
/**
|
|
1490
1578
|
* Set the access token for authenticated requests.
|
|
@@ -1525,6 +1613,6 @@ var MitumbaClient = class {
|
|
|
1525
1613
|
}
|
|
1526
1614
|
};
|
|
1527
1615
|
|
|
1528
|
-
export { APIClient, APIError, AdminModule, AuthModule, BusinessesModule, CONDITIONS, CartModule, DESIRED_RESOLUTIONS, DISPUTE_REASONS, DISPUTE_STATUSES, DisputesModule, IDBTokenStore, LISTING_STATUSES, ListingsModule, MailerModule, MemoryTokenStore, MessagesModule, MitumbaClient, NotificationsModule, ORDER_STATUSES, OrdersModule, PAYMENT_STATUSES, PayModule, ReportsModule, ReviewsModule, SearchModule, SettingsModule, StoresModule, TWO_FACTOR_METHOD_TYPES, UploadsModule, VaziModule, WishlistsModule, createTokenStore };
|
|
1616
|
+
export { APIClient, APIError, AdminModule, AuthModule, BALE_ORDER_STATUSES, BusinessesModule, CONDITIONS, CartModule, DESIRED_RESOLUTIONS, DISPUTE_REASONS, DISPUTE_STATUSES, DisputesModule, IDBTokenStore, LISTING_STATUSES, ListingsModule, MailerModule, MemoryTokenStore, MessagesModule, MitumbaClient, NotificationsModule, ORDER_STATUSES, OrdersModule, PAYMENT_STATUSES, PayModule, ReportsModule, ReviewsModule, SearchModule, SettingsModule, StoresModule, TWO_FACTOR_METHOD_TYPES, UploadsModule, VaziModule, WholesaleModule, WishlistsModule, createTokenStore };
|
|
1529
1617
|
//# sourceMappingURL=index.mjs.map
|
|
1530
1618
|
//# sourceMappingURL=index.mjs.map
|