@mitumba/sdk 1.13.0 → 1.14.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 +115 -1
- package/dist/index.d.ts +115 -1
- package/dist/index.js +59 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +56 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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,55 @@ 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
|
+
|
|
1420
1533
|
declare class MitumbaClient {
|
|
1421
1534
|
readonly api: APIClient;
|
|
1422
1535
|
readonly auth: AuthModule;
|
|
@@ -1435,6 +1548,7 @@ declare class MitumbaClient {
|
|
|
1435
1548
|
readonly mailer: MailerModule;
|
|
1436
1549
|
readonly businesses: BusinessesModule;
|
|
1437
1550
|
readonly admin: AdminModule;
|
|
1551
|
+
readonly disputes: DisputesModule;
|
|
1438
1552
|
constructor(config: MitumbaClientConfig);
|
|
1439
1553
|
/**
|
|
1440
1554
|
* Set the access token for authenticated requests.
|
|
@@ -1459,4 +1573,4 @@ declare class MitumbaClient {
|
|
|
1459
1573
|
isAuthenticated(): Promise<boolean>;
|
|
1460
1574
|
}
|
|
1461
1575
|
|
|
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 };
|
|
1576
|
+
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, 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,55 @@ 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
|
+
|
|
1420
1533
|
declare class MitumbaClient {
|
|
1421
1534
|
readonly api: APIClient;
|
|
1422
1535
|
readonly auth: AuthModule;
|
|
@@ -1435,6 +1548,7 @@ declare class MitumbaClient {
|
|
|
1435
1548
|
readonly mailer: MailerModule;
|
|
1436
1549
|
readonly businesses: BusinessesModule;
|
|
1437
1550
|
readonly admin: AdminModule;
|
|
1551
|
+
readonly disputes: DisputesModule;
|
|
1438
1552
|
constructor(config: MitumbaClientConfig);
|
|
1439
1553
|
/**
|
|
1440
1554
|
* Set the access token for authenticated requests.
|
|
@@ -1459,4 +1573,4 @@ declare class MitumbaClient {
|
|
|
1459
1573
|
isAuthenticated(): Promise<boolean>;
|
|
1460
1574
|
}
|
|
1461
1575
|
|
|
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 };
|
|
1576
|
+
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, 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,54 @@ 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
|
+
|
|
1112
1160
|
// src/types/listings.ts
|
|
1113
1161
|
var CONDITIONS = ["new", "like_new", "good", "fair"];
|
|
1114
1162
|
var LISTING_STATUSES = ["draft", "active", "sold", "removed"];
|
|
@@ -1129,6 +1177,11 @@ var ORDER_STATUSES = [
|
|
|
1129
1177
|
// src/types/pay.ts
|
|
1130
1178
|
var PAYMENT_STATUSES = ["initiated", "funded", "failed", "refunded", "cancelled"];
|
|
1131
1179
|
|
|
1180
|
+
// src/types/disputes.ts
|
|
1181
|
+
var DISPUTE_REASONS = ["not_received", "not_as_described", "damaged", "counterfeit", "wrong_item"];
|
|
1182
|
+
var DESIRED_RESOLUTIONS = ["refund", "replacement", "partial_refund"];
|
|
1183
|
+
var DISPUTE_STATUSES = ["open", "seller_responded", "under_review", "resolved_refund", "resolved_release", "resolved_partial", "withdrawn"];
|
|
1184
|
+
|
|
1132
1185
|
// src/index.ts
|
|
1133
1186
|
var MitumbaClient = class {
|
|
1134
1187
|
api;
|
|
@@ -1148,6 +1201,7 @@ var MitumbaClient = class {
|
|
|
1148
1201
|
mailer;
|
|
1149
1202
|
businesses;
|
|
1150
1203
|
admin;
|
|
1204
|
+
disputes;
|
|
1151
1205
|
constructor(config) {
|
|
1152
1206
|
this.api = new APIClient(config);
|
|
1153
1207
|
this.auth = new AuthModule(this.api);
|
|
@@ -1166,6 +1220,7 @@ var MitumbaClient = class {
|
|
|
1166
1220
|
this.mailer = new MailerModule(this.api);
|
|
1167
1221
|
this.businesses = new BusinessesModule(this.api);
|
|
1168
1222
|
this.admin = new AdminModule(this.api);
|
|
1223
|
+
this.disputes = new DisputesModule(this.api);
|
|
1169
1224
|
}
|
|
1170
1225
|
/**
|
|
1171
1226
|
* Set the access token for authenticated requests.
|
|
@@ -1207,6 +1262,10 @@ exports.AuthModule = AuthModule;
|
|
|
1207
1262
|
exports.BusinessesModule = BusinessesModule;
|
|
1208
1263
|
exports.CONDITIONS = CONDITIONS;
|
|
1209
1264
|
exports.CartModule = CartModule;
|
|
1265
|
+
exports.DESIRED_RESOLUTIONS = DESIRED_RESOLUTIONS;
|
|
1266
|
+
exports.DISPUTE_REASONS = DISPUTE_REASONS;
|
|
1267
|
+
exports.DISPUTE_STATUSES = DISPUTE_STATUSES;
|
|
1268
|
+
exports.DisputesModule = DisputesModule;
|
|
1210
1269
|
exports.IDBTokenStore = IDBTokenStore;
|
|
1211
1270
|
exports.LISTING_STATUSES = LISTING_STATUSES;
|
|
1212
1271
|
exports.ListingsModule = ListingsModule;
|