@mitumba/sdk 1.13.0 → 1.15.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
@@ -668,6 +668,70 @@ interface SystemStats {
668
668
  active_today: number;
669
669
  }
670
670
 
671
+ declare const DISPUTE_REASONS: readonly ["not_received", "not_as_described", "damaged", "counterfeit", "wrong_item"];
672
+ type DisputeReason = typeof DISPUTE_REASONS[number];
673
+ declare const DESIRED_RESOLUTIONS: readonly ["refund", "replacement", "partial_refund"];
674
+ type DesiredResolution = typeof DESIRED_RESOLUTIONS[number];
675
+ declare const DISPUTE_STATUSES: readonly ["open", "seller_responded", "under_review", "resolved_refund", "resolved_release", "resolved_partial", "withdrawn"];
676
+ type DisputeStatus = typeof DISPUTE_STATUSES[number];
677
+ interface DisputeEvidence {
678
+ id: string;
679
+ uploader_role: 'buyer' | 'seller' | 'admin';
680
+ type: 'image' | 'text';
681
+ content: string;
682
+ created_at: string;
683
+ }
684
+ interface DisputeEvent {
685
+ actor_role: 'buyer' | 'seller' | 'admin' | 'system';
686
+ action: string;
687
+ old_status: string | null;
688
+ new_status: string | null;
689
+ note: string | null;
690
+ created_at: string;
691
+ }
692
+ interface Dispute {
693
+ id: string;
694
+ order_id: string;
695
+ buyer_id: string;
696
+ seller_id: string;
697
+ reason: DisputeReason;
698
+ description: string;
699
+ desired_resolution: DesiredResolution;
700
+ status: DisputeStatus;
701
+ amount_disputed: number;
702
+ resolution: 'refund' | 'release' | 'partial' | null;
703
+ resolution_amount: number | null;
704
+ resolution_note: string | null;
705
+ sti_impact: number | null;
706
+ seller_responded_at: string | null;
707
+ escalated_at: string | null;
708
+ resolved_at: string | null;
709
+ created_at: string;
710
+ updated_at: string;
711
+ evidence?: DisputeEvidence[];
712
+ events?: DisputeEvent[];
713
+ }
714
+ interface RaiseDisputeInput {
715
+ reason: DisputeReason;
716
+ description: string;
717
+ desired_resolution: DesiredResolution;
718
+ evidence_urls?: string[];
719
+ }
720
+ interface RespondDisputeInput {
721
+ accept: boolean;
722
+ message?: string;
723
+ evidence_urls?: string[];
724
+ }
725
+ interface ResolveDisputeInput {
726
+ resolution: 'refund' | 'release' | 'partial';
727
+ amount?: number;
728
+ note?: string;
729
+ }
730
+ interface DisputeListParams {
731
+ status?: DisputeStatus;
732
+ page?: number;
733
+ }
734
+
671
735
  interface MitumbaClientConfig {
672
736
  baseUrl: string;
673
737
  debug?: boolean;
@@ -1417,6 +1481,64 @@ declare class AdminModule {
1417
1481
  }>;
1418
1482
  }
1419
1483
 
1484
+ declare class DisputesModule {
1485
+ private readonly client;
1486
+ constructor(client: APIClient);
1487
+ /** Raise a dispute on an order (buyer). */
1488
+ raise(orderId: string, input: RaiseDisputeInput, options?: RequestOptions): Promise<{
1489
+ dispute_id: string;
1490
+ status: 'open';
1491
+ }>;
1492
+ /** Get the dispute for a specific order. */
1493
+ getForOrder(orderId: string, options?: RequestOptions): Promise<Dispute>;
1494
+ /** Get a dispute by ID. */
1495
+ get(disputeId: string, options?: RequestOptions): Promise<Dispute>;
1496
+ /** Add evidence to a dispute. */
1497
+ addEvidence(disputeId: string, input: {
1498
+ type: 'image' | 'text';
1499
+ content: string;
1500
+ }, options?: RequestOptions): Promise<{
1501
+ ok: true;
1502
+ }>;
1503
+ /** Escalate a dispute to admin review (buyer). */
1504
+ escalate(disputeId: string, options?: RequestOptions): Promise<{
1505
+ ok: true;
1506
+ status: 'under_review';
1507
+ }>;
1508
+ /** Withdraw a dispute (buyer). */
1509
+ withdraw(disputeId: string, options?: RequestOptions): Promise<{
1510
+ ok: true;
1511
+ status: 'withdrawn';
1512
+ }>;
1513
+ /** Respond to a dispute (seller). */
1514
+ respond(disputeId: string, input: RespondDisputeInput, options?: RequestOptions): Promise<{
1515
+ ok: true;
1516
+ status?: string;
1517
+ voluntary?: boolean;
1518
+ }>;
1519
+ /** List all disputes (admin). */
1520
+ list(params?: DisputeListParams, options?: RequestOptions): Promise<{
1521
+ data: Dispute[];
1522
+ page: number;
1523
+ page_size: number;
1524
+ }>;
1525
+ /** Resolve a dispute (admin). */
1526
+ resolve(disputeId: string, input: ResolveDisputeInput, options?: RequestOptions): Promise<{
1527
+ ok: true;
1528
+ status: string;
1529
+ sti_impact: number;
1530
+ }>;
1531
+ }
1532
+
1533
+ declare class UploadsModule {
1534
+ private readonly client;
1535
+ constructor(client: APIClient);
1536
+ /** Upload a file (avatar, evidence, etc). Returns the public CDN URL. */
1537
+ upload(file: Blob, options?: RequestOptions): Promise<{
1538
+ url: string;
1539
+ }>;
1540
+ }
1541
+
1420
1542
  declare class MitumbaClient {
1421
1543
  readonly api: APIClient;
1422
1544
  readonly auth: AuthModule;
@@ -1435,6 +1557,8 @@ declare class MitumbaClient {
1435
1557
  readonly mailer: MailerModule;
1436
1558
  readonly businesses: BusinessesModule;
1437
1559
  readonly admin: AdminModule;
1560
+ readonly disputes: DisputesModule;
1561
+ readonly uploads: UploadsModule;
1438
1562
  constructor(config: MitumbaClientConfig);
1439
1563
  /**
1440
1564
  * Set the access token for authenticated requests.
@@ -1459,4 +1583,4 @@ declare class MitumbaClient {
1459
1583
  isAuthenticated(): Promise<boolean>;
1460
1584
  }
1461
1585
 
1462
- export { APIClient, APIError, type APIErrorResponse, type AddAddressInput, type AddPaymentMethodInput, type Address, AdminModule, AuthModule, type AuthTokens, type BecomeSellerInput, type BlockedIp, type Business, BusinessesModule, CONDITIONS, type CartItem, CartModule, type Category, type ChangePasswordInput, type City, type CompleteOnboardingInput, type Condition, type Conversation, type CreateListingInput, type CreateOrderInput, type CreateReviewInput, type CreateStoreInput, type DeliveryAddress, type EmailLoginInput, type EmailRegisterInput, type ForgotPasswordInput, IDBTokenStore, LISTING_STATUSES, type LinkedAccount, type LinkedAccountProvider, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LoginInput, MailerModule, type MailerTemplate, MemoryTokenStore, type Message, type MessageResponse, MessagesModule, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationPref, type NotificationType, NotificationsModule, ORDER_STATUSES, type Order, type OrderEvent, type OrderHistoryParams, type OrderStatus, OrdersModule, PAYMENT_STATUSES, type PaginatedResponse, PayModule, type PaymentMethod, type PaymentMethodType, type PaymentStatus, type PaymentStatusResponse, type PaystackInitResponse, type PaystackInput, type PhoneLoginInput, type PhoneRegisterInput, type PresignImageResponse, type RegisterInput, type RequestOptions, type ResetPasswordInput, type Review, type ReviewableOrder, ReviewsModule, type SaveSearchInput, type SearchHistoryItem, SearchModule, type SearchParams, type SearchResult, type SellerProfile, type SellerStorefront, type SendEmailInput, type SendMessageInput, type SendOtpInput, type Session, SettingsModule, type SimilarListing, type StkPushInput, type StkPushResponse, type Store, type StoreAnalytics, type StoreSettings, type StoreStats, StoresModule, type SubscriptionTier, type SystemStats, type TokenStore, type TransitionOrderInput, type TrendingTerm, type TwoFactorRequired, type UpdateBusinessInput, type UpdateListingInput, type UpdateProfileInput, type UpdateStoreInput, type UserProfile, type VAZIOutfit, type VAZIOutfitDetail, type VAZIOutfitDetailItem, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type Verify2FAInput, type VerifyOtpInput, type WishlistListing, WishlistsModule, createTokenStore };
1586
+ export { APIClient, APIError, type APIErrorResponse, type AddAddressInput, type AddPaymentMethodInput, type Address, AdminModule, AuthModule, type AuthTokens, type BecomeSellerInput, type BlockedIp, type Business, BusinessesModule, CONDITIONS, type CartItem, CartModule, type Category, type ChangePasswordInput, type City, type CompleteOnboardingInput, type Condition, type Conversation, type CreateListingInput, type CreateOrderInput, type CreateReviewInput, type CreateStoreInput, DESIRED_RESOLUTIONS, DISPUTE_REASONS, DISPUTE_STATUSES, type DeliveryAddress, type DesiredResolution, type Dispute, type DisputeEvent, type DisputeEvidence, type DisputeListParams, type DisputeReason, type DisputeStatus, DisputesModule, type EmailLoginInput, type EmailRegisterInput, type ForgotPasswordInput, IDBTokenStore, LISTING_STATUSES, type LinkedAccount, type LinkedAccountProvider, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LoginInput, MailerModule, type MailerTemplate, MemoryTokenStore, type Message, type MessageResponse, MessagesModule, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationPref, type NotificationType, NotificationsModule, ORDER_STATUSES, type Order, type OrderEvent, type OrderHistoryParams, type OrderStatus, OrdersModule, PAYMENT_STATUSES, type PaginatedResponse, PayModule, type PaymentMethod, type PaymentMethodType, type PaymentStatus, type PaymentStatusResponse, type PaystackInitResponse, type PaystackInput, type PhoneLoginInput, type PhoneRegisterInput, type PresignImageResponse, type RaiseDisputeInput, type RegisterInput, type RequestOptions, type ResetPasswordInput, type ResolveDisputeInput, type RespondDisputeInput, type Review, type ReviewableOrder, ReviewsModule, type SaveSearchInput, type SearchHistoryItem, SearchModule, type SearchParams, type SearchResult, type SellerProfile, type SellerStorefront, type SendEmailInput, type SendMessageInput, type SendOtpInput, type Session, SettingsModule, type SimilarListing, type StkPushInput, type StkPushResponse, type Store, type StoreAnalytics, type StoreSettings, type StoreStats, StoresModule, type SubscriptionTier, type SystemStats, type TokenStore, type TransitionOrderInput, type TrendingTerm, type TwoFactorRequired, type UpdateBusinessInput, type UpdateListingInput, type UpdateProfileInput, type UpdateStoreInput, UploadsModule, type UserProfile, type VAZIOutfit, type VAZIOutfitDetail, type VAZIOutfitDetailItem, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type Verify2FAInput, type VerifyOtpInput, type WishlistListing, WishlistsModule, createTokenStore };
package/dist/index.d.ts CHANGED
@@ -668,6 +668,70 @@ interface SystemStats {
668
668
  active_today: number;
669
669
  }
670
670
 
671
+ declare const DISPUTE_REASONS: readonly ["not_received", "not_as_described", "damaged", "counterfeit", "wrong_item"];
672
+ type DisputeReason = typeof DISPUTE_REASONS[number];
673
+ declare const DESIRED_RESOLUTIONS: readonly ["refund", "replacement", "partial_refund"];
674
+ type DesiredResolution = typeof DESIRED_RESOLUTIONS[number];
675
+ declare const DISPUTE_STATUSES: readonly ["open", "seller_responded", "under_review", "resolved_refund", "resolved_release", "resolved_partial", "withdrawn"];
676
+ type DisputeStatus = typeof DISPUTE_STATUSES[number];
677
+ interface DisputeEvidence {
678
+ id: string;
679
+ uploader_role: 'buyer' | 'seller' | 'admin';
680
+ type: 'image' | 'text';
681
+ content: string;
682
+ created_at: string;
683
+ }
684
+ interface DisputeEvent {
685
+ actor_role: 'buyer' | 'seller' | 'admin' | 'system';
686
+ action: string;
687
+ old_status: string | null;
688
+ new_status: string | null;
689
+ note: string | null;
690
+ created_at: string;
691
+ }
692
+ interface Dispute {
693
+ id: string;
694
+ order_id: string;
695
+ buyer_id: string;
696
+ seller_id: string;
697
+ reason: DisputeReason;
698
+ description: string;
699
+ desired_resolution: DesiredResolution;
700
+ status: DisputeStatus;
701
+ amount_disputed: number;
702
+ resolution: 'refund' | 'release' | 'partial' | null;
703
+ resolution_amount: number | null;
704
+ resolution_note: string | null;
705
+ sti_impact: number | null;
706
+ seller_responded_at: string | null;
707
+ escalated_at: string | null;
708
+ resolved_at: string | null;
709
+ created_at: string;
710
+ updated_at: string;
711
+ evidence?: DisputeEvidence[];
712
+ events?: DisputeEvent[];
713
+ }
714
+ interface RaiseDisputeInput {
715
+ reason: DisputeReason;
716
+ description: string;
717
+ desired_resolution: DesiredResolution;
718
+ evidence_urls?: string[];
719
+ }
720
+ interface RespondDisputeInput {
721
+ accept: boolean;
722
+ message?: string;
723
+ evidence_urls?: string[];
724
+ }
725
+ interface ResolveDisputeInput {
726
+ resolution: 'refund' | 'release' | 'partial';
727
+ amount?: number;
728
+ note?: string;
729
+ }
730
+ interface DisputeListParams {
731
+ status?: DisputeStatus;
732
+ page?: number;
733
+ }
734
+
671
735
  interface MitumbaClientConfig {
672
736
  baseUrl: string;
673
737
  debug?: boolean;
@@ -1417,6 +1481,64 @@ declare class AdminModule {
1417
1481
  }>;
1418
1482
  }
1419
1483
 
1484
+ declare class DisputesModule {
1485
+ private readonly client;
1486
+ constructor(client: APIClient);
1487
+ /** Raise a dispute on an order (buyer). */
1488
+ raise(orderId: string, input: RaiseDisputeInput, options?: RequestOptions): Promise<{
1489
+ dispute_id: string;
1490
+ status: 'open';
1491
+ }>;
1492
+ /** Get the dispute for a specific order. */
1493
+ getForOrder(orderId: string, options?: RequestOptions): Promise<Dispute>;
1494
+ /** Get a dispute by ID. */
1495
+ get(disputeId: string, options?: RequestOptions): Promise<Dispute>;
1496
+ /** Add evidence to a dispute. */
1497
+ addEvidence(disputeId: string, input: {
1498
+ type: 'image' | 'text';
1499
+ content: string;
1500
+ }, options?: RequestOptions): Promise<{
1501
+ ok: true;
1502
+ }>;
1503
+ /** Escalate a dispute to admin review (buyer). */
1504
+ escalate(disputeId: string, options?: RequestOptions): Promise<{
1505
+ ok: true;
1506
+ status: 'under_review';
1507
+ }>;
1508
+ /** Withdraw a dispute (buyer). */
1509
+ withdraw(disputeId: string, options?: RequestOptions): Promise<{
1510
+ ok: true;
1511
+ status: 'withdrawn';
1512
+ }>;
1513
+ /** Respond to a dispute (seller). */
1514
+ respond(disputeId: string, input: RespondDisputeInput, options?: RequestOptions): Promise<{
1515
+ ok: true;
1516
+ status?: string;
1517
+ voluntary?: boolean;
1518
+ }>;
1519
+ /** List all disputes (admin). */
1520
+ list(params?: DisputeListParams, options?: RequestOptions): Promise<{
1521
+ data: Dispute[];
1522
+ page: number;
1523
+ page_size: number;
1524
+ }>;
1525
+ /** Resolve a dispute (admin). */
1526
+ resolve(disputeId: string, input: ResolveDisputeInput, options?: RequestOptions): Promise<{
1527
+ ok: true;
1528
+ status: string;
1529
+ sti_impact: number;
1530
+ }>;
1531
+ }
1532
+
1533
+ declare class UploadsModule {
1534
+ private readonly client;
1535
+ constructor(client: APIClient);
1536
+ /** Upload a file (avatar, evidence, etc). Returns the public CDN URL. */
1537
+ upload(file: Blob, options?: RequestOptions): Promise<{
1538
+ url: string;
1539
+ }>;
1540
+ }
1541
+
1420
1542
  declare class MitumbaClient {
1421
1543
  readonly api: APIClient;
1422
1544
  readonly auth: AuthModule;
@@ -1435,6 +1557,8 @@ declare class MitumbaClient {
1435
1557
  readonly mailer: MailerModule;
1436
1558
  readonly businesses: BusinessesModule;
1437
1559
  readonly admin: AdminModule;
1560
+ readonly disputes: DisputesModule;
1561
+ readonly uploads: UploadsModule;
1438
1562
  constructor(config: MitumbaClientConfig);
1439
1563
  /**
1440
1564
  * Set the access token for authenticated requests.
@@ -1459,4 +1583,4 @@ declare class MitumbaClient {
1459
1583
  isAuthenticated(): Promise<boolean>;
1460
1584
  }
1461
1585
 
1462
- export { APIClient, APIError, type APIErrorResponse, type AddAddressInput, type AddPaymentMethodInput, type Address, AdminModule, AuthModule, type AuthTokens, type BecomeSellerInput, type BlockedIp, type Business, BusinessesModule, CONDITIONS, type CartItem, CartModule, type Category, type ChangePasswordInput, type City, type CompleteOnboardingInput, type Condition, type Conversation, type CreateListingInput, type CreateOrderInput, type CreateReviewInput, type CreateStoreInput, type DeliveryAddress, type EmailLoginInput, type EmailRegisterInput, type ForgotPasswordInput, IDBTokenStore, LISTING_STATUSES, type LinkedAccount, type LinkedAccountProvider, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LoginInput, MailerModule, type MailerTemplate, MemoryTokenStore, type Message, type MessageResponse, MessagesModule, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationPref, type NotificationType, NotificationsModule, ORDER_STATUSES, type Order, type OrderEvent, type OrderHistoryParams, type OrderStatus, OrdersModule, PAYMENT_STATUSES, type PaginatedResponse, PayModule, type PaymentMethod, type PaymentMethodType, type PaymentStatus, type PaymentStatusResponse, type PaystackInitResponse, type PaystackInput, type PhoneLoginInput, type PhoneRegisterInput, type PresignImageResponse, type RegisterInput, type RequestOptions, type ResetPasswordInput, type Review, type ReviewableOrder, ReviewsModule, type SaveSearchInput, type SearchHistoryItem, SearchModule, type SearchParams, type SearchResult, type SellerProfile, type SellerStorefront, type SendEmailInput, type SendMessageInput, type SendOtpInput, type Session, SettingsModule, type SimilarListing, type StkPushInput, type StkPushResponse, type Store, type StoreAnalytics, type StoreSettings, type StoreStats, StoresModule, type SubscriptionTier, type SystemStats, type TokenStore, type TransitionOrderInput, type TrendingTerm, type TwoFactorRequired, type UpdateBusinessInput, type UpdateListingInput, type UpdateProfileInput, type UpdateStoreInput, type UserProfile, type VAZIOutfit, type VAZIOutfitDetail, type VAZIOutfitDetailItem, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type Verify2FAInput, type VerifyOtpInput, type WishlistListing, WishlistsModule, createTokenStore };
1586
+ export { APIClient, APIError, type APIErrorResponse, type AddAddressInput, type AddPaymentMethodInput, type Address, AdminModule, AuthModule, type AuthTokens, type BecomeSellerInput, type BlockedIp, type Business, BusinessesModule, CONDITIONS, type CartItem, CartModule, type Category, type ChangePasswordInput, type City, type CompleteOnboardingInput, type Condition, type Conversation, type CreateListingInput, type CreateOrderInput, type CreateReviewInput, type CreateStoreInput, DESIRED_RESOLUTIONS, DISPUTE_REASONS, DISPUTE_STATUSES, type DeliveryAddress, type DesiredResolution, type Dispute, type DisputeEvent, type DisputeEvidence, type DisputeListParams, type DisputeReason, type DisputeStatus, DisputesModule, type EmailLoginInput, type EmailRegisterInput, type ForgotPasswordInput, IDBTokenStore, LISTING_STATUSES, type LinkedAccount, type LinkedAccountProvider, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LoginInput, MailerModule, type MailerTemplate, MemoryTokenStore, type Message, type MessageResponse, MessagesModule, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationPref, type NotificationType, NotificationsModule, ORDER_STATUSES, type Order, type OrderEvent, type OrderHistoryParams, type OrderStatus, OrdersModule, PAYMENT_STATUSES, type PaginatedResponse, PayModule, type PaymentMethod, type PaymentMethodType, type PaymentStatus, type PaymentStatusResponse, type PaystackInitResponse, type PaystackInput, type PhoneLoginInput, type PhoneRegisterInput, type PresignImageResponse, type RaiseDisputeInput, type RegisterInput, type RequestOptions, type ResetPasswordInput, type ResolveDisputeInput, type RespondDisputeInput, type Review, type ReviewableOrder, ReviewsModule, type SaveSearchInput, type SearchHistoryItem, SearchModule, type SearchParams, type SearchResult, type SellerProfile, type SellerStorefront, type SendEmailInput, type SendMessageInput, type SendOtpInput, type Session, SettingsModule, type SimilarListing, type StkPushInput, type StkPushResponse, type Store, type StoreAnalytics, type StoreSettings, type StoreStats, StoresModule, type SubscriptionTier, type SystemStats, type TokenStore, type TransitionOrderInput, type TrendingTerm, type TwoFactorRequired, type UpdateBusinessInput, type UpdateListingInput, type UpdateProfileInput, type UpdateStoreInput, UploadsModule, type UserProfile, type VAZIOutfit, type VAZIOutfitDetail, type VAZIOutfitDetailItem, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type Verify2FAInput, type VerifyOtpInput, type WishlistListing, WishlistsModule, createTokenStore };
package/dist/index.js CHANGED
@@ -1109,6 +1109,68 @@ var AdminModule = class {
1109
1109
  }
1110
1110
  };
1111
1111
 
1112
+ // src/modules/disputes.ts
1113
+ var DisputesModule = class {
1114
+ constructor(client) {
1115
+ this.client = client;
1116
+ }
1117
+ client;
1118
+ /** Raise a dispute on an order (buyer). */
1119
+ async raise(orderId, input, options) {
1120
+ return this.client.post(`/orders/${orderId}/dispute`, input, options);
1121
+ }
1122
+ /** Get the dispute for a specific order. */
1123
+ async getForOrder(orderId, options) {
1124
+ return this.client.get(`/orders/${orderId}/dispute`, void 0, options);
1125
+ }
1126
+ /** Get a dispute by ID. */
1127
+ async get(disputeId, options) {
1128
+ return this.client.get(`/orders/disputes/${disputeId}`, void 0, options);
1129
+ }
1130
+ /** Add evidence to a dispute. */
1131
+ async addEvidence(disputeId, input, options) {
1132
+ return this.client.post(`/orders/disputes/${disputeId}/evidence`, input, options);
1133
+ }
1134
+ /** Escalate a dispute to admin review (buyer). */
1135
+ async escalate(disputeId, options) {
1136
+ return this.client.post(`/orders/disputes/${disputeId}/escalate`, void 0, options);
1137
+ }
1138
+ /** Withdraw a dispute (buyer). */
1139
+ async withdraw(disputeId, options) {
1140
+ return this.client.post(`/orders/disputes/${disputeId}/withdraw`, void 0, options);
1141
+ }
1142
+ /** Respond to a dispute (seller). */
1143
+ async respond(disputeId, input, options) {
1144
+ return this.client.post(`/orders/disputes/${disputeId}/respond`, input, options);
1145
+ }
1146
+ /** List all disputes (admin). */
1147
+ async list(params, options) {
1148
+ return this.client.get(
1149
+ "/orders/disputes",
1150
+ params,
1151
+ options
1152
+ );
1153
+ }
1154
+ /** Resolve a dispute (admin). */
1155
+ async resolve(disputeId, input, options) {
1156
+ return this.client.post(`/orders/disputes/${disputeId}/resolve`, input, options);
1157
+ }
1158
+ };
1159
+
1160
+ // src/modules/uploads.ts
1161
+ var UploadsModule = class {
1162
+ constructor(client) {
1163
+ this.client = client;
1164
+ }
1165
+ client;
1166
+ /** Upload a file (avatar, evidence, etc). Returns the public CDN URL. */
1167
+ async upload(file, options) {
1168
+ const formData = new FormData();
1169
+ formData.append("file", file);
1170
+ return this.client.post("/listings/uploads", formData, options);
1171
+ }
1172
+ };
1173
+
1112
1174
  // src/types/listings.ts
1113
1175
  var CONDITIONS = ["new", "like_new", "good", "fair"];
1114
1176
  var LISTING_STATUSES = ["draft", "active", "sold", "removed"];
@@ -1129,6 +1191,11 @@ var ORDER_STATUSES = [
1129
1191
  // src/types/pay.ts
1130
1192
  var PAYMENT_STATUSES = ["initiated", "funded", "failed", "refunded", "cancelled"];
1131
1193
 
1194
+ // src/types/disputes.ts
1195
+ var DISPUTE_REASONS = ["not_received", "not_as_described", "damaged", "counterfeit", "wrong_item"];
1196
+ var DESIRED_RESOLUTIONS = ["refund", "replacement", "partial_refund"];
1197
+ var DISPUTE_STATUSES = ["open", "seller_responded", "under_review", "resolved_refund", "resolved_release", "resolved_partial", "withdrawn"];
1198
+
1132
1199
  // src/index.ts
1133
1200
  var MitumbaClient = class {
1134
1201
  api;
@@ -1148,6 +1215,8 @@ var MitumbaClient = class {
1148
1215
  mailer;
1149
1216
  businesses;
1150
1217
  admin;
1218
+ disputes;
1219
+ uploads;
1151
1220
  constructor(config) {
1152
1221
  this.api = new APIClient(config);
1153
1222
  this.auth = new AuthModule(this.api);
@@ -1166,6 +1235,8 @@ var MitumbaClient = class {
1166
1235
  this.mailer = new MailerModule(this.api);
1167
1236
  this.businesses = new BusinessesModule(this.api);
1168
1237
  this.admin = new AdminModule(this.api);
1238
+ this.disputes = new DisputesModule(this.api);
1239
+ this.uploads = new UploadsModule(this.api);
1169
1240
  }
1170
1241
  /**
1171
1242
  * Set the access token for authenticated requests.
@@ -1207,6 +1278,10 @@ exports.AuthModule = AuthModule;
1207
1278
  exports.BusinessesModule = BusinessesModule;
1208
1279
  exports.CONDITIONS = CONDITIONS;
1209
1280
  exports.CartModule = CartModule;
1281
+ exports.DESIRED_RESOLUTIONS = DESIRED_RESOLUTIONS;
1282
+ exports.DISPUTE_REASONS = DISPUTE_REASONS;
1283
+ exports.DISPUTE_STATUSES = DISPUTE_STATUSES;
1284
+ exports.DisputesModule = DisputesModule;
1210
1285
  exports.IDBTokenStore = IDBTokenStore;
1211
1286
  exports.LISTING_STATUSES = LISTING_STATUSES;
1212
1287
  exports.ListingsModule = ListingsModule;
@@ -1223,6 +1298,7 @@ exports.ReviewsModule = ReviewsModule;
1223
1298
  exports.SearchModule = SearchModule;
1224
1299
  exports.SettingsModule = SettingsModule;
1225
1300
  exports.StoresModule = StoresModule;
1301
+ exports.UploadsModule = UploadsModule;
1226
1302
  exports.VaziModule = VaziModule;
1227
1303
  exports.WishlistsModule = WishlistsModule;
1228
1304
  exports.createTokenStore = createTokenStore;