@mitumba/sdk 1.24.1 → 1.26.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 +265 -4
- package/dist/index.d.ts +265 -4
- package/dist/index.js +90 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +90 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -454,6 +454,21 @@ var AuthModule = class {
|
|
|
454
454
|
await this.client.clearToken();
|
|
455
455
|
return result;
|
|
456
456
|
}
|
|
457
|
+
// ── Passkey Login ──
|
|
458
|
+
/**
|
|
459
|
+
* Start passkey login — get assertion options for navigator.credentials.get().
|
|
460
|
+
*/
|
|
461
|
+
async startPasskeyLogin(input, options) {
|
|
462
|
+
return this.client.post("/auth/2fa/login/passkey/start", input, options);
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* Finish passkey login — submit the browser's assertion response. Tokens are auto-persisted.
|
|
466
|
+
*/
|
|
467
|
+
async finishPasskeyLogin(input, options) {
|
|
468
|
+
const result = await this.client.post("/auth/2fa/login/passkey/finish", input, options);
|
|
469
|
+
await this.client.setSession(result);
|
|
470
|
+
return result;
|
|
471
|
+
}
|
|
457
472
|
};
|
|
458
473
|
|
|
459
474
|
// src/modules/listings.ts
|
|
@@ -787,6 +802,15 @@ var MessagesModule = class {
|
|
|
787
802
|
const wsUrl = this.client.getBaseUrl().replace(/^http/, "ws") + `/notify/messages/${partnerId}/ws?token=${token}`;
|
|
788
803
|
return new WebSocket(wsUrl);
|
|
789
804
|
}
|
|
805
|
+
/**
|
|
806
|
+
* Connect to the user-scoped inbox WebSocket.
|
|
807
|
+
* Emits InboxRealtimeEvent for every inbound message across all conversations.
|
|
808
|
+
*/
|
|
809
|
+
connectInbox() {
|
|
810
|
+
const token = this.client.getToken();
|
|
811
|
+
const wsUrl = this.client.getBaseUrl().replace(/^http/, "ws") + `/notify/messages/inbox?token=${token}`;
|
|
812
|
+
return new WebSocket(wsUrl);
|
|
813
|
+
}
|
|
790
814
|
};
|
|
791
815
|
|
|
792
816
|
// src/modules/notifications.ts
|
|
@@ -1138,6 +1162,13 @@ var SettingsModule = class {
|
|
|
1138
1162
|
async challenge2FAMethod(id, options) {
|
|
1139
1163
|
return this.client.post(`/auth/2fa/methods/${id}/challenge`, void 0, options);
|
|
1140
1164
|
}
|
|
1165
|
+
// ── Passkey Registration ──
|
|
1166
|
+
async startPasskeyRegistration(input, options) {
|
|
1167
|
+
return this.client.post("/auth/2fa/methods", { type: "passkey", ...input }, options);
|
|
1168
|
+
}
|
|
1169
|
+
async finishPasskeyRegistration(methodId, credential, options) {
|
|
1170
|
+
return this.client.post(`/auth/2fa/methods/${methodId}/passkey/finish`, credential, options);
|
|
1171
|
+
}
|
|
1141
1172
|
};
|
|
1142
1173
|
|
|
1143
1174
|
// src/modules/mailer.ts
|
|
@@ -1383,8 +1414,63 @@ var ReportsModule = class {
|
|
|
1383
1414
|
}
|
|
1384
1415
|
};
|
|
1385
1416
|
|
|
1417
|
+
// src/modules/wholesale.ts
|
|
1418
|
+
var WholesaleModule = class {
|
|
1419
|
+
constructor(client) {
|
|
1420
|
+
this.client = client;
|
|
1421
|
+
}
|
|
1422
|
+
client;
|
|
1423
|
+
// ── Wholesale Store ──
|
|
1424
|
+
/** Get the current user's wholesale store and depots. */
|
|
1425
|
+
async getWholesaleStore(options) {
|
|
1426
|
+
return this.client.get("/listings/wholesale/store", void 0, options);
|
|
1427
|
+
}
|
|
1428
|
+
/** Create or update the wholesale store (bale_seller only). */
|
|
1429
|
+
async saveWholesaleStore(input, options) {
|
|
1430
|
+
return this.client.post("/listings/wholesale/store", input, options);
|
|
1431
|
+
}
|
|
1432
|
+
/** Add a depot to the wholesale store. */
|
|
1433
|
+
async addDepot(input, options) {
|
|
1434
|
+
return this.client.post("/listings/wholesale/store/depots", input, options);
|
|
1435
|
+
}
|
|
1436
|
+
/** Remove a depot. */
|
|
1437
|
+
async removeDepot(id, options) {
|
|
1438
|
+
return this.client.delete(`/listings/wholesale/store/depots/${id}`, void 0, options);
|
|
1439
|
+
}
|
|
1440
|
+
// ── Bales ──
|
|
1441
|
+
/** Create a bale listing (requires verified wholesale store). */
|
|
1442
|
+
async createBale(input, options) {
|
|
1443
|
+
return this.client.post("/listings/bales", input, options);
|
|
1444
|
+
}
|
|
1445
|
+
/** Get a bale by ID (public). */
|
|
1446
|
+
async getBale(id, options) {
|
|
1447
|
+
return this.client.get(`/listings/bales/${id}`, void 0, options);
|
|
1448
|
+
}
|
|
1449
|
+
/** Update a bale. */
|
|
1450
|
+
async updateBale(id, input, options) {
|
|
1451
|
+
return this.client.patch(`/listings/bales/${id}`, input, options);
|
|
1452
|
+
}
|
|
1453
|
+
/** Soft-delete a bale. */
|
|
1454
|
+
async removeBale(id, options) {
|
|
1455
|
+
return this.client.delete(`/listings/bales/${id}`, void 0, options);
|
|
1456
|
+
}
|
|
1457
|
+
/** Get all bales for the current user's wholesale store. */
|
|
1458
|
+
async myBales(options) {
|
|
1459
|
+
return this.client.get("/listings/wholesale/mine/bales", void 0, options);
|
|
1460
|
+
}
|
|
1461
|
+
// ── Feed ──
|
|
1462
|
+
/** Browse the wholesale bale feed (public). */
|
|
1463
|
+
async wholesaleFeed(params, options) {
|
|
1464
|
+
return this.client.get(
|
|
1465
|
+
"/listings/wholesale/feed",
|
|
1466
|
+
params,
|
|
1467
|
+
options
|
|
1468
|
+
);
|
|
1469
|
+
}
|
|
1470
|
+
};
|
|
1471
|
+
|
|
1386
1472
|
// src/types/auth.ts
|
|
1387
|
-
var TWO_FACTOR_METHOD_TYPES = ["totp", "sms", "email"];
|
|
1473
|
+
var TWO_FACTOR_METHOD_TYPES = ["totp", "sms", "email", "passkey"];
|
|
1388
1474
|
|
|
1389
1475
|
// src/types/listings.ts
|
|
1390
1476
|
var CONDITIONS = ["new", "like_new", "good", "fair"];
|
|
@@ -1433,6 +1519,7 @@ var MitumbaClient = class {
|
|
|
1433
1519
|
disputes;
|
|
1434
1520
|
uploads;
|
|
1435
1521
|
reports;
|
|
1522
|
+
wholesale;
|
|
1436
1523
|
constructor(config) {
|
|
1437
1524
|
this.api = new APIClient(config);
|
|
1438
1525
|
this.auth = new AuthModule(this.api);
|
|
@@ -1454,6 +1541,7 @@ var MitumbaClient = class {
|
|
|
1454
1541
|
this.disputes = new DisputesModule(this.api);
|
|
1455
1542
|
this.uploads = new UploadsModule(this.api);
|
|
1456
1543
|
this.reports = new ReportsModule(this.api);
|
|
1544
|
+
this.wholesale = new WholesaleModule(this.api);
|
|
1457
1545
|
}
|
|
1458
1546
|
/**
|
|
1459
1547
|
* Set the access token for authenticated requests.
|
|
@@ -1494,6 +1582,6 @@ var MitumbaClient = class {
|
|
|
1494
1582
|
}
|
|
1495
1583
|
};
|
|
1496
1584
|
|
|
1497
|
-
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 };
|
|
1585
|
+
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, WholesaleModule, WishlistsModule, createTokenStore };
|
|
1498
1586
|
//# sourceMappingURL=index.mjs.map
|
|
1499
1587
|
//# sourceMappingURL=index.mjs.map
|