@mitumba/sdk 1.19.0 → 1.21.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
@@ -360,17 +360,15 @@ interface VaziFeedResponse {
360
360
  }
361
361
 
362
362
  interface Conversation {
363
- id: string;
364
- sender_id: string;
365
- receiver_id: string;
366
363
  partner_id: string;
367
- partner_name: string | null;
364
+ partner_name: string;
365
+ store_name?: string | null;
368
366
  body: string;
369
- listing_id: string | null;
370
- listing_title: string | null;
371
- store_id: string | null;
372
- read_at: string | null;
373
367
  created_at: string;
368
+ store_id?: string | null;
369
+ listing_id?: string | null;
370
+ listing_title?: string | null;
371
+ unread_count: number;
374
372
  }
375
373
  interface Message {
376
374
  id: string;
@@ -379,6 +377,7 @@ interface Message {
379
377
  body: string;
380
378
  listing_id: string | null;
381
379
  store_id: string | null;
380
+ order_id?: string | null;
382
381
  read_at: string | null;
383
382
  created_at: string;
384
383
  }
@@ -387,6 +386,7 @@ interface SendMessageInput {
387
386
  body: string;
388
387
  listing_id?: string;
389
388
  store_id?: string;
389
+ order_id?: string;
390
390
  }
391
391
 
392
392
  type NotificationType = 'order' | 'message' | 'price_drop' | 'offer' | 'payout' | 'system';
@@ -998,7 +998,7 @@ declare class APIClient {
998
998
  post<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
999
999
  put<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
1000
1000
  patch<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
1001
- delete<T>(path: string, options?: RequestOptions): Promise<T>;
1001
+ delete<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
1002
1002
  }
1003
1003
 
1004
1004
  declare class AuthModule {
@@ -1080,6 +1080,32 @@ declare class AuthModule {
1080
1080
  roles: string[];
1081
1081
  sti_score: number;
1082
1082
  }>;
1083
+ /**
1084
+ * Check if the account is eligible for deletion and what blockers exist.
1085
+ */
1086
+ getDeletionEligibility(options?: RequestOptions): Promise<{
1087
+ eligible: boolean;
1088
+ reasons: string[];
1089
+ totp_enabled: boolean;
1090
+ }>;
1091
+ /**
1092
+ * Request account deletion. Sends a confirmation email if eligible.
1093
+ */
1094
+ requestAccountDeletion(options?: RequestOptions): Promise<{
1095
+ ok: true;
1096
+ } | {
1097
+ blocked: true;
1098
+ reasons: string[];
1099
+ }>;
1100
+ /**
1101
+ * Confirm account deletion (from emailed link). Clears local session on success.
1102
+ */
1103
+ confirmAccountDeletion(input: {
1104
+ token: string;
1105
+ code?: string;
1106
+ }, options?: RequestOptions): Promise<{
1107
+ ok: true;
1108
+ }>;
1083
1109
  }
1084
1110
 
1085
1111
  declare class ListingsModule {
@@ -1444,6 +1470,15 @@ declare class StoresModule {
1444
1470
  uploadBanner(storeId: string, file: Blob, options?: RequestOptions): Promise<{
1445
1471
  url: string;
1446
1472
  }>;
1473
+ /**
1474
+ * Delete a store. Blocked if active orders, pending payouts, or open disputes exist.
1475
+ */
1476
+ delete(storeId: string, options?: RequestOptions): Promise<{
1477
+ ok: true;
1478
+ } | {
1479
+ blocked: true;
1480
+ reasons: string[];
1481
+ }>;
1447
1482
  }
1448
1483
 
1449
1484
  declare class ReviewsModule {
package/dist/index.d.ts CHANGED
@@ -360,17 +360,15 @@ interface VaziFeedResponse {
360
360
  }
361
361
 
362
362
  interface Conversation {
363
- id: string;
364
- sender_id: string;
365
- receiver_id: string;
366
363
  partner_id: string;
367
- partner_name: string | null;
364
+ partner_name: string;
365
+ store_name?: string | null;
368
366
  body: string;
369
- listing_id: string | null;
370
- listing_title: string | null;
371
- store_id: string | null;
372
- read_at: string | null;
373
367
  created_at: string;
368
+ store_id?: string | null;
369
+ listing_id?: string | null;
370
+ listing_title?: string | null;
371
+ unread_count: number;
374
372
  }
375
373
  interface Message {
376
374
  id: string;
@@ -379,6 +377,7 @@ interface Message {
379
377
  body: string;
380
378
  listing_id: string | null;
381
379
  store_id: string | null;
380
+ order_id?: string | null;
382
381
  read_at: string | null;
383
382
  created_at: string;
384
383
  }
@@ -387,6 +386,7 @@ interface SendMessageInput {
387
386
  body: string;
388
387
  listing_id?: string;
389
388
  store_id?: string;
389
+ order_id?: string;
390
390
  }
391
391
 
392
392
  type NotificationType = 'order' | 'message' | 'price_drop' | 'offer' | 'payout' | 'system';
@@ -998,7 +998,7 @@ declare class APIClient {
998
998
  post<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
999
999
  put<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
1000
1000
  patch<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
1001
- delete<T>(path: string, options?: RequestOptions): Promise<T>;
1001
+ delete<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
1002
1002
  }
1003
1003
 
1004
1004
  declare class AuthModule {
@@ -1080,6 +1080,32 @@ declare class AuthModule {
1080
1080
  roles: string[];
1081
1081
  sti_score: number;
1082
1082
  }>;
1083
+ /**
1084
+ * Check if the account is eligible for deletion and what blockers exist.
1085
+ */
1086
+ getDeletionEligibility(options?: RequestOptions): Promise<{
1087
+ eligible: boolean;
1088
+ reasons: string[];
1089
+ totp_enabled: boolean;
1090
+ }>;
1091
+ /**
1092
+ * Request account deletion. Sends a confirmation email if eligible.
1093
+ */
1094
+ requestAccountDeletion(options?: RequestOptions): Promise<{
1095
+ ok: true;
1096
+ } | {
1097
+ blocked: true;
1098
+ reasons: string[];
1099
+ }>;
1100
+ /**
1101
+ * Confirm account deletion (from emailed link). Clears local session on success.
1102
+ */
1103
+ confirmAccountDeletion(input: {
1104
+ token: string;
1105
+ code?: string;
1106
+ }, options?: RequestOptions): Promise<{
1107
+ ok: true;
1108
+ }>;
1083
1109
  }
1084
1110
 
1085
1111
  declare class ListingsModule {
@@ -1444,6 +1470,15 @@ declare class StoresModule {
1444
1470
  uploadBanner(storeId: string, file: Blob, options?: RequestOptions): Promise<{
1445
1471
  url: string;
1446
1472
  }>;
1473
+ /**
1474
+ * Delete a store. Blocked if active orders, pending payouts, or open disputes exist.
1475
+ */
1476
+ delete(storeId: string, options?: RequestOptions): Promise<{
1477
+ ok: true;
1478
+ } | {
1479
+ blocked: true;
1480
+ reasons: string[];
1481
+ }>;
1447
1482
  }
1448
1483
 
1449
1484
  declare class ReviewsModule {
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) {