@mitumba/sdk 1.20.0 → 1.22.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 CHANGED
@@ -103,6 +103,7 @@ interface UserProfile {
103
103
  onboarding_completed: boolean;
104
104
  email_verified: boolean;
105
105
  totp_enabled: boolean;
106
+ totp_configured: boolean;
106
107
  is_active: boolean;
107
108
  created_at: string;
108
109
  roles: string[];
@@ -378,6 +379,7 @@ interface Message {
378
379
  listing_id: string | null;
379
380
  store_id: string | null;
380
381
  order_id?: string | null;
382
+ from_store?: number;
381
383
  read_at: string | null;
382
384
  created_at: string;
383
385
  }
@@ -387,6 +389,7 @@ interface SendMessageInput {
387
389
  listing_id?: string;
388
390
  store_id?: string;
389
391
  order_id?: string;
392
+ from_store?: boolean;
390
393
  }
391
394
 
392
395
  type NotificationType = 'order' | 'message' | 'price_drop' | 'offer' | 'payout' | 'system';
@@ -998,7 +1001,7 @@ declare class APIClient {
998
1001
  post<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
999
1002
  put<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
1000
1003
  patch<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
1001
- delete<T>(path: string, options?: RequestOptions): Promise<T>;
1004
+ delete<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
1002
1005
  }
1003
1006
 
1004
1007
  declare class AuthModule {
@@ -1080,6 +1083,32 @@ declare class AuthModule {
1080
1083
  roles: string[];
1081
1084
  sti_score: number;
1082
1085
  }>;
1086
+ /**
1087
+ * Check if the account is eligible for deletion and what blockers exist.
1088
+ */
1089
+ getDeletionEligibility(options?: RequestOptions): Promise<{
1090
+ eligible: boolean;
1091
+ reasons: string[];
1092
+ totp_enabled: boolean;
1093
+ }>;
1094
+ /**
1095
+ * Request account deletion. Sends a confirmation email if eligible.
1096
+ */
1097
+ requestAccountDeletion(options?: RequestOptions): Promise<{
1098
+ ok: true;
1099
+ } | {
1100
+ blocked: true;
1101
+ reasons: string[];
1102
+ }>;
1103
+ /**
1104
+ * Confirm account deletion (from emailed link). Clears local session on success.
1105
+ */
1106
+ confirmAccountDeletion(input: {
1107
+ token: string;
1108
+ code?: string;
1109
+ }, options?: RequestOptions): Promise<{
1110
+ ok: true;
1111
+ }>;
1083
1112
  }
1084
1113
 
1085
1114
  declare class ListingsModule {
@@ -1444,6 +1473,15 @@ declare class StoresModule {
1444
1473
  uploadBanner(storeId: string, file: Blob, options?: RequestOptions): Promise<{
1445
1474
  url: string;
1446
1475
  }>;
1476
+ /**
1477
+ * Delete a store. Blocked if active orders, pending payouts, or open disputes exist.
1478
+ */
1479
+ delete(storeId: string, options?: RequestOptions): Promise<{
1480
+ ok: true;
1481
+ } | {
1482
+ blocked: true;
1483
+ reasons: string[];
1484
+ }>;
1447
1485
  }
1448
1486
 
1449
1487
  declare class ReviewsModule {
@@ -1607,6 +1645,12 @@ declare class SettingsModule {
1607
1645
  disable2FA(code: string, options?: RequestOptions): Promise<{
1608
1646
  ok: true;
1609
1647
  }>;
1648
+ enable2FA(code: string, options?: RequestOptions): Promise<{
1649
+ ok: true;
1650
+ }>;
1651
+ delete2FA(code: string, options?: RequestOptions): Promise<{
1652
+ ok: true;
1653
+ }>;
1610
1654
  }
1611
1655
 
1612
1656
  declare class MailerModule {
package/dist/index.d.ts CHANGED
@@ -103,6 +103,7 @@ interface UserProfile {
103
103
  onboarding_completed: boolean;
104
104
  email_verified: boolean;
105
105
  totp_enabled: boolean;
106
+ totp_configured: boolean;
106
107
  is_active: boolean;
107
108
  created_at: string;
108
109
  roles: string[];
@@ -378,6 +379,7 @@ interface Message {
378
379
  listing_id: string | null;
379
380
  store_id: string | null;
380
381
  order_id?: string | null;
382
+ from_store?: number;
381
383
  read_at: string | null;
382
384
  created_at: string;
383
385
  }
@@ -387,6 +389,7 @@ interface SendMessageInput {
387
389
  listing_id?: string;
388
390
  store_id?: string;
389
391
  order_id?: string;
392
+ from_store?: boolean;
390
393
  }
391
394
 
392
395
  type NotificationType = 'order' | 'message' | 'price_drop' | 'offer' | 'payout' | 'system';
@@ -998,7 +1001,7 @@ declare class APIClient {
998
1001
  post<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
999
1002
  put<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
1000
1003
  patch<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
1001
- delete<T>(path: string, options?: RequestOptions): Promise<T>;
1004
+ delete<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
1002
1005
  }
1003
1006
 
1004
1007
  declare class AuthModule {
@@ -1080,6 +1083,32 @@ declare class AuthModule {
1080
1083
  roles: string[];
1081
1084
  sti_score: number;
1082
1085
  }>;
1086
+ /**
1087
+ * Check if the account is eligible for deletion and what blockers exist.
1088
+ */
1089
+ getDeletionEligibility(options?: RequestOptions): Promise<{
1090
+ eligible: boolean;
1091
+ reasons: string[];
1092
+ totp_enabled: boolean;
1093
+ }>;
1094
+ /**
1095
+ * Request account deletion. Sends a confirmation email if eligible.
1096
+ */
1097
+ requestAccountDeletion(options?: RequestOptions): Promise<{
1098
+ ok: true;
1099
+ } | {
1100
+ blocked: true;
1101
+ reasons: string[];
1102
+ }>;
1103
+ /**
1104
+ * Confirm account deletion (from emailed link). Clears local session on success.
1105
+ */
1106
+ confirmAccountDeletion(input: {
1107
+ token: string;
1108
+ code?: string;
1109
+ }, options?: RequestOptions): Promise<{
1110
+ ok: true;
1111
+ }>;
1083
1112
  }
1084
1113
 
1085
1114
  declare class ListingsModule {
@@ -1444,6 +1473,15 @@ declare class StoresModule {
1444
1473
  uploadBanner(storeId: string, file: Blob, options?: RequestOptions): Promise<{
1445
1474
  url: string;
1446
1475
  }>;
1476
+ /**
1477
+ * Delete a store. Blocked if active orders, pending payouts, or open disputes exist.
1478
+ */
1479
+ delete(storeId: string, options?: RequestOptions): Promise<{
1480
+ ok: true;
1481
+ } | {
1482
+ blocked: true;
1483
+ reasons: string[];
1484
+ }>;
1447
1485
  }
1448
1486
 
1449
1487
  declare class ReviewsModule {
@@ -1607,6 +1645,12 @@ declare class SettingsModule {
1607
1645
  disable2FA(code: string, options?: RequestOptions): Promise<{
1608
1646
  ok: true;
1609
1647
  }>;
1648
+ enable2FA(code: string, options?: RequestOptions): Promise<{
1649
+ ok: true;
1650
+ }>;
1651
+ delete2FA(code: string, options?: RequestOptions): Promise<{
1652
+ ok: true;
1653
+ }>;
1610
1654
  }
1611
1655
 
1612
1656
  declare class MailerModule {
package/dist/index.js CHANGED
@@ -311,8 +311,8 @@ var APIClient = class {
311
311
  patch(path, body, options) {
312
312
  return this.request("PATCH", path, body, void 0, options);
313
313
  }
314
- delete(path, options) {
315
- return this.request("DELETE", path, void 0, void 0, options);
314
+ delete(path, body, options) {
315
+ return this.request("DELETE", path, body, void 0, options);
316
316
  }
317
317
  };
318
318
 
@@ -429,6 +429,26 @@ var AuthModule = class {
429
429
  async becomeSeller(input, options) {
430
430
  return this.client.post("/auth/become-seller", input, options);
431
431
  }
432
+ /**
433
+ * Check if the account is eligible for deletion and what blockers exist.
434
+ */
435
+ async getDeletionEligibility(options) {
436
+ return this.client.get("/auth/account/deletion-eligibility", void 0, options);
437
+ }
438
+ /**
439
+ * Request account deletion. Sends a confirmation email if eligible.
440
+ */
441
+ async requestAccountDeletion(options) {
442
+ return this.client.post("/auth/account/deletion-request", void 0, options);
443
+ }
444
+ /**
445
+ * Confirm account deletion (from emailed link). Clears local session on success.
446
+ */
447
+ async confirmAccountDeletion(input, options) {
448
+ const result = await this.client.delete("/auth/account", input, options);
449
+ await this.client.clearToken();
450
+ return result;
451
+ }
432
452
  };
433
453
 
434
454
  // src/modules/listings.ts
@@ -475,7 +495,7 @@ var ListingsModule = class {
475
495
  * Soft delete a listing (sets status to 'removed').
476
496
  */
477
497
  async delete(id, options) {
478
- return this.client.delete(`/listings/${id}`, options);
498
+ return this.client.delete(`/listings/${id}`, void 0, options);
479
499
  }
480
500
  /**
481
501
  * Get a seller's public storefront.
@@ -810,7 +830,7 @@ var StoresModule = class {
810
830
  * Unfollow a store.
811
831
  */
812
832
  async unfollow(storeId, options) {
813
- return this.client.delete(`/listings/stores/${storeId}/follow`, options);
833
+ return this.client.delete(`/listings/stores/${storeId}/follow`, void 0, options);
814
834
  }
815
835
  /**
816
836
  * Get paginated listings for a specific store.
@@ -894,6 +914,12 @@ var StoresModule = class {
894
914
  formData.append("file", file);
895
915
  return this.client.post(`/listings/stores/${storeId}/banner`, formData, options);
896
916
  }
917
+ /**
918
+ * Delete a store. Blocked if active orders, pending payouts, or open disputes exist.
919
+ */
920
+ async delete(storeId, options) {
921
+ return this.client.delete(`/listings/stores/${storeId}`, void 0, options);
922
+ }
897
923
  };
898
924
 
899
925
  // src/modules/reviews.ts
@@ -948,7 +974,7 @@ var WishlistsModule = class {
948
974
  * Remove a listing from the wishlist.
949
975
  */
950
976
  async remove(listingId, options) {
951
- return this.client.delete(`/listings/wishlists/${listingId}`, options);
977
+ return this.client.delete(`/listings/wishlists/${listingId}`, void 0, options);
952
978
  }
953
979
  };
954
980
 
@@ -974,7 +1000,7 @@ var CartModule = class {
974
1000
  * Remove a listing from the cart.
975
1001
  */
976
1002
  async remove(listingId, options) {
977
- return this.client.delete(`/listings/cart/${listingId}`, options);
1003
+ return this.client.delete(`/listings/cart/${listingId}`, void 0, options);
978
1004
  }
979
1005
  /**
980
1006
  * Update the quantity of a cart item.
@@ -1011,7 +1037,7 @@ var SettingsModule = class {
1011
1037
  return this.client.get("/auth/sessions", void 0, options);
1012
1038
  }
1013
1039
  async revokeSession(sessionId, options) {
1014
- return this.client.delete(`/auth/sessions/${sessionId}`, options);
1040
+ return this.client.delete(`/auth/sessions/${sessionId}`, void 0, options);
1015
1041
  }
1016
1042
  // ── Notification Preferences ──
1017
1043
  async getNotificationPrefs(options) {
@@ -1038,7 +1064,7 @@ var SettingsModule = class {
1038
1064
  return this.client.put(`/auth/addresses/${id}`, input, options);
1039
1065
  }
1040
1066
  async deleteAddress(id, options) {
1041
- return this.client.delete(`/auth/addresses/${id}`, options);
1067
+ return this.client.delete(`/auth/addresses/${id}`, void 0, options);
1042
1068
  }
1043
1069
  async setDefaultAddress(id, options) {
1044
1070
  return this.client.post(`/auth/addresses/${id}/default`, void 0, options);
@@ -1051,7 +1077,7 @@ var SettingsModule = class {
1051
1077
  return this.client.post("/auth/payment-methods", input, options);
1052
1078
  }
1053
1079
  async deletePaymentMethod(id, options) {
1054
- return this.client.delete(`/auth/payment-methods/${id}`, options);
1080
+ return this.client.delete(`/auth/payment-methods/${id}`, void 0, options);
1055
1081
  }
1056
1082
  async setDefaultPaymentMethod(id, options) {
1057
1083
  return this.client.post(`/auth/payment-methods/${id}/default`, void 0, options);
@@ -1064,7 +1090,7 @@ var SettingsModule = class {
1064
1090
  return this.client.post("/auth/linked-accounts", { provider, token }, options);
1065
1091
  }
1066
1092
  async unlinkAccount(provider, options) {
1067
- return this.client.delete(`/auth/linked-accounts/${provider}`, options);
1093
+ return this.client.delete(`/auth/linked-accounts/${provider}`, void 0, options);
1068
1094
  }
1069
1095
  // ── 2FA ──
1070
1096
  async setup2FA(options) {
@@ -1076,6 +1102,12 @@ var SettingsModule = class {
1076
1102
  async disable2FA(code, options) {
1077
1103
  return this.client.post("/auth/2fa/disable", { code }, options);
1078
1104
  }
1105
+ async enable2FA(code, options) {
1106
+ return this.client.post("/auth/2fa/enable", { code }, options);
1107
+ }
1108
+ async delete2FA(code, options) {
1109
+ return this.client.delete("/auth/2fa", { code }, options);
1110
+ }
1079
1111
  };
1080
1112
 
1081
1113
  // src/modules/mailer.ts