@mitumba/sdk 0.16.0 → 0.17.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 +126 -1
- package/dist/index.d.ts +126 -1
- package/dist/index.js +81 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +81 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -10,6 +10,7 @@ interface EmailRegisterInput {
|
|
|
10
10
|
email: string;
|
|
11
11
|
password: string;
|
|
12
12
|
display_name?: string;
|
|
13
|
+
device?: string;
|
|
13
14
|
}
|
|
14
15
|
interface PhoneRegisterInput {
|
|
15
16
|
phone: string;
|
|
@@ -18,6 +19,7 @@ type RegisterInput = EmailRegisterInput | PhoneRegisterInput;
|
|
|
18
19
|
interface EmailLoginInput {
|
|
19
20
|
email: string;
|
|
20
21
|
password: string;
|
|
22
|
+
device?: string;
|
|
21
23
|
}
|
|
22
24
|
interface PhoneLoginInput {
|
|
23
25
|
phone: string;
|
|
@@ -371,6 +373,62 @@ interface CartItem {
|
|
|
371
373
|
added_at: string;
|
|
372
374
|
}
|
|
373
375
|
|
|
376
|
+
interface UpdateProfileInput {
|
|
377
|
+
display_name?: string;
|
|
378
|
+
phone?: string;
|
|
379
|
+
county?: string;
|
|
380
|
+
bio?: string;
|
|
381
|
+
avatar_url?: string;
|
|
382
|
+
}
|
|
383
|
+
interface ChangePasswordInput {
|
|
384
|
+
current_password: string;
|
|
385
|
+
new_password: string;
|
|
386
|
+
}
|
|
387
|
+
interface Session {
|
|
388
|
+
id: string;
|
|
389
|
+
device: string;
|
|
390
|
+
location: string;
|
|
391
|
+
last_active: string;
|
|
392
|
+
is_current: boolean;
|
|
393
|
+
}
|
|
394
|
+
interface NotificationPref {
|
|
395
|
+
channel: string;
|
|
396
|
+
enabled: boolean;
|
|
397
|
+
}
|
|
398
|
+
interface Address {
|
|
399
|
+
id: string;
|
|
400
|
+
label: string;
|
|
401
|
+
name: string;
|
|
402
|
+
phone: string;
|
|
403
|
+
line1: string;
|
|
404
|
+
line2: string | null;
|
|
405
|
+
city: string;
|
|
406
|
+
county: string;
|
|
407
|
+
is_default: boolean;
|
|
408
|
+
created_at: string;
|
|
409
|
+
}
|
|
410
|
+
type AddAddressInput = Omit<Address, 'id' | 'is_default' | 'created_at'>;
|
|
411
|
+
type PaymentMethodType = 'mpesa' | 'mpesa_till' | 'airtel' | 'telkom' | 'card';
|
|
412
|
+
interface PaymentMethod {
|
|
413
|
+
id: string;
|
|
414
|
+
type: PaymentMethodType;
|
|
415
|
+
label: string;
|
|
416
|
+
detail: string;
|
|
417
|
+
is_default: boolean;
|
|
418
|
+
created_at: string;
|
|
419
|
+
}
|
|
420
|
+
interface AddPaymentMethodInput {
|
|
421
|
+
type: PaymentMethodType;
|
|
422
|
+
label: string;
|
|
423
|
+
detail: string;
|
|
424
|
+
}
|
|
425
|
+
type LinkedAccountProvider = 'google' | 'apple';
|
|
426
|
+
interface LinkedAccount {
|
|
427
|
+
provider: LinkedAccountProvider;
|
|
428
|
+
email: string | null;
|
|
429
|
+
connected_at: string;
|
|
430
|
+
}
|
|
431
|
+
|
|
374
432
|
interface MitumbaClientConfig {
|
|
375
433
|
baseUrl: string;
|
|
376
434
|
debug?: boolean;
|
|
@@ -827,6 +885,72 @@ declare class CartModule {
|
|
|
827
885
|
}>;
|
|
828
886
|
}
|
|
829
887
|
|
|
888
|
+
declare class SettingsModule {
|
|
889
|
+
private readonly client;
|
|
890
|
+
constructor(client: APIClient);
|
|
891
|
+
getProfile(options?: RequestOptions): Promise<UserProfile>;
|
|
892
|
+
updateProfile(input: UpdateProfileInput, options?: RequestOptions): Promise<{
|
|
893
|
+
ok: true;
|
|
894
|
+
}>;
|
|
895
|
+
changePassword(input: ChangePasswordInput, options?: RequestOptions): Promise<{
|
|
896
|
+
ok: true;
|
|
897
|
+
}>;
|
|
898
|
+
getSessions(options?: RequestOptions): Promise<{
|
|
899
|
+
data: Session[];
|
|
900
|
+
}>;
|
|
901
|
+
revokeSession(sessionId: string, options?: RequestOptions): Promise<{
|
|
902
|
+
ok: true;
|
|
903
|
+
}>;
|
|
904
|
+
getNotificationPrefs(options?: RequestOptions): Promise<{
|
|
905
|
+
data: NotificationPref[];
|
|
906
|
+
}>;
|
|
907
|
+
updateNotificationPref(channel: string, enabled: boolean, options?: RequestOptions): Promise<{
|
|
908
|
+
ok: true;
|
|
909
|
+
}>;
|
|
910
|
+
getPreferences(options?: RequestOptions): Promise<{
|
|
911
|
+
data: Record<string, string>;
|
|
912
|
+
}>;
|
|
913
|
+
updatePreferences(prefs: Record<string, string>, options?: RequestOptions): Promise<{
|
|
914
|
+
ok: true;
|
|
915
|
+
}>;
|
|
916
|
+
getAddresses(options?: RequestOptions): Promise<{
|
|
917
|
+
data: Address[];
|
|
918
|
+
}>;
|
|
919
|
+
addAddress(input: AddAddressInput, options?: RequestOptions): Promise<{
|
|
920
|
+
id: string;
|
|
921
|
+
}>;
|
|
922
|
+
updateAddress(id: string, input: Partial<AddAddressInput>, options?: RequestOptions): Promise<{
|
|
923
|
+
ok: true;
|
|
924
|
+
}>;
|
|
925
|
+
deleteAddress(id: string, options?: RequestOptions): Promise<{
|
|
926
|
+
ok: true;
|
|
927
|
+
}>;
|
|
928
|
+
setDefaultAddress(id: string, options?: RequestOptions): Promise<{
|
|
929
|
+
ok: true;
|
|
930
|
+
}>;
|
|
931
|
+
getPaymentMethods(options?: RequestOptions): Promise<{
|
|
932
|
+
data: PaymentMethod[];
|
|
933
|
+
}>;
|
|
934
|
+
addPaymentMethod(input: AddPaymentMethodInput, options?: RequestOptions): Promise<{
|
|
935
|
+
id: string;
|
|
936
|
+
}>;
|
|
937
|
+
deletePaymentMethod(id: string, options?: RequestOptions): Promise<{
|
|
938
|
+
ok: true;
|
|
939
|
+
}>;
|
|
940
|
+
setDefaultPaymentMethod(id: string, options?: RequestOptions): Promise<{
|
|
941
|
+
ok: true;
|
|
942
|
+
}>;
|
|
943
|
+
getLinkedAccounts(options?: RequestOptions): Promise<{
|
|
944
|
+
data: LinkedAccount[];
|
|
945
|
+
}>;
|
|
946
|
+
linkAccount(provider: LinkedAccountProvider, token: string, options?: RequestOptions): Promise<{
|
|
947
|
+
ok: true;
|
|
948
|
+
}>;
|
|
949
|
+
unlinkAccount(provider: LinkedAccountProvider, options?: RequestOptions): Promise<{
|
|
950
|
+
ok: true;
|
|
951
|
+
}>;
|
|
952
|
+
}
|
|
953
|
+
|
|
830
954
|
declare class MitumbaClient {
|
|
831
955
|
readonly api: APIClient;
|
|
832
956
|
readonly auth: AuthModule;
|
|
@@ -841,6 +965,7 @@ declare class MitumbaClient {
|
|
|
841
965
|
readonly reviews: ReviewsModule;
|
|
842
966
|
readonly wishlists: WishlistsModule;
|
|
843
967
|
readonly cart: CartModule;
|
|
968
|
+
readonly settings: SettingsModule;
|
|
844
969
|
constructor(config: MitumbaClientConfig);
|
|
845
970
|
/**
|
|
846
971
|
* Set the access token for authenticated requests.
|
|
@@ -857,4 +982,4 @@ declare class MitumbaClient {
|
|
|
857
982
|
clearToken(): void;
|
|
858
983
|
}
|
|
859
984
|
|
|
860
|
-
export { APIClient, APIError, type APIErrorResponse, AuthModule, type AuthTokens, CONDITIONS, type CartItem, CartModule, type Category, type City, type CompleteOnboardingInput, type Condition, type Conversation, type CreateListingInput, type CreateOrderInput, type CreateReviewInput, type EmailLoginInput, type EmailRegisterInput, type ForgotPasswordInput, GARMENT_TYPES, type GarmentType, LISTING_STATUSES, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LoginInput, type Message, type MessageResponse, MessagesModule, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationType, NotificationsModule, ORDER_STATUSES, type Order, type OrderEvent, type OrderHistoryParams, type OrderStatus, OrdersModule, PAYMENT_STATUSES, type PaginatedResponse, PayModule, type PaymentStatus, type PaymentStatusResponse, type PaystackInitResponse, type PaystackInput, type PhoneLoginInput, type PhoneRegisterInput, type PresignImageResponse, type RegisterInput, type RequestOptions, type ResetPasswordInput, type Review, ReviewsModule, type SaveSearchInput, type SearchHistoryItem, SearchModule, type SearchParams, type SearchResult, type SellerProfile, type SellerStorefront, type SendMessageInput, type SendOtpInput, type SimilarListing, type StkPushInput, type StkPushResponse, type Store, StoresModule, type SubscriptionTier, type TransitionOrderInput, type TrendingTerm, type UpdateListingInput, type UserProfile, type VAZIOutfit, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type VerifyOtpInput, type WishlistListing, WishlistsModule };
|
|
985
|
+
export { APIClient, APIError, type APIErrorResponse, type AddAddressInput, type AddPaymentMethodInput, type Address, AuthModule, type AuthTokens, CONDITIONS, type CartItem, CartModule, type Category, type ChangePasswordInput, type City, type CompleteOnboardingInput, type Condition, type Conversation, type CreateListingInput, type CreateOrderInput, type CreateReviewInput, type EmailLoginInput, type EmailRegisterInput, type ForgotPasswordInput, GARMENT_TYPES, type GarmentType, LISTING_STATUSES, type LinkedAccount, type LinkedAccountProvider, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LoginInput, 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, ReviewsModule, type SaveSearchInput, type SearchHistoryItem, SearchModule, type SearchParams, type SearchResult, type SellerProfile, type SellerStorefront, type SendMessageInput, type SendOtpInput, type Session, SettingsModule, type SimilarListing, type StkPushInput, type StkPushResponse, type Store, StoresModule, type SubscriptionTier, type TransitionOrderInput, type TrendingTerm, type UpdateListingInput, type UpdateProfileInput, type UserProfile, type VAZIOutfit, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type VerifyOtpInput, type WishlistListing, WishlistsModule };
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ interface EmailRegisterInput {
|
|
|
10
10
|
email: string;
|
|
11
11
|
password: string;
|
|
12
12
|
display_name?: string;
|
|
13
|
+
device?: string;
|
|
13
14
|
}
|
|
14
15
|
interface PhoneRegisterInput {
|
|
15
16
|
phone: string;
|
|
@@ -18,6 +19,7 @@ type RegisterInput = EmailRegisterInput | PhoneRegisterInput;
|
|
|
18
19
|
interface EmailLoginInput {
|
|
19
20
|
email: string;
|
|
20
21
|
password: string;
|
|
22
|
+
device?: string;
|
|
21
23
|
}
|
|
22
24
|
interface PhoneLoginInput {
|
|
23
25
|
phone: string;
|
|
@@ -371,6 +373,62 @@ interface CartItem {
|
|
|
371
373
|
added_at: string;
|
|
372
374
|
}
|
|
373
375
|
|
|
376
|
+
interface UpdateProfileInput {
|
|
377
|
+
display_name?: string;
|
|
378
|
+
phone?: string;
|
|
379
|
+
county?: string;
|
|
380
|
+
bio?: string;
|
|
381
|
+
avatar_url?: string;
|
|
382
|
+
}
|
|
383
|
+
interface ChangePasswordInput {
|
|
384
|
+
current_password: string;
|
|
385
|
+
new_password: string;
|
|
386
|
+
}
|
|
387
|
+
interface Session {
|
|
388
|
+
id: string;
|
|
389
|
+
device: string;
|
|
390
|
+
location: string;
|
|
391
|
+
last_active: string;
|
|
392
|
+
is_current: boolean;
|
|
393
|
+
}
|
|
394
|
+
interface NotificationPref {
|
|
395
|
+
channel: string;
|
|
396
|
+
enabled: boolean;
|
|
397
|
+
}
|
|
398
|
+
interface Address {
|
|
399
|
+
id: string;
|
|
400
|
+
label: string;
|
|
401
|
+
name: string;
|
|
402
|
+
phone: string;
|
|
403
|
+
line1: string;
|
|
404
|
+
line2: string | null;
|
|
405
|
+
city: string;
|
|
406
|
+
county: string;
|
|
407
|
+
is_default: boolean;
|
|
408
|
+
created_at: string;
|
|
409
|
+
}
|
|
410
|
+
type AddAddressInput = Omit<Address, 'id' | 'is_default' | 'created_at'>;
|
|
411
|
+
type PaymentMethodType = 'mpesa' | 'mpesa_till' | 'airtel' | 'telkom' | 'card';
|
|
412
|
+
interface PaymentMethod {
|
|
413
|
+
id: string;
|
|
414
|
+
type: PaymentMethodType;
|
|
415
|
+
label: string;
|
|
416
|
+
detail: string;
|
|
417
|
+
is_default: boolean;
|
|
418
|
+
created_at: string;
|
|
419
|
+
}
|
|
420
|
+
interface AddPaymentMethodInput {
|
|
421
|
+
type: PaymentMethodType;
|
|
422
|
+
label: string;
|
|
423
|
+
detail: string;
|
|
424
|
+
}
|
|
425
|
+
type LinkedAccountProvider = 'google' | 'apple';
|
|
426
|
+
interface LinkedAccount {
|
|
427
|
+
provider: LinkedAccountProvider;
|
|
428
|
+
email: string | null;
|
|
429
|
+
connected_at: string;
|
|
430
|
+
}
|
|
431
|
+
|
|
374
432
|
interface MitumbaClientConfig {
|
|
375
433
|
baseUrl: string;
|
|
376
434
|
debug?: boolean;
|
|
@@ -827,6 +885,72 @@ declare class CartModule {
|
|
|
827
885
|
}>;
|
|
828
886
|
}
|
|
829
887
|
|
|
888
|
+
declare class SettingsModule {
|
|
889
|
+
private readonly client;
|
|
890
|
+
constructor(client: APIClient);
|
|
891
|
+
getProfile(options?: RequestOptions): Promise<UserProfile>;
|
|
892
|
+
updateProfile(input: UpdateProfileInput, options?: RequestOptions): Promise<{
|
|
893
|
+
ok: true;
|
|
894
|
+
}>;
|
|
895
|
+
changePassword(input: ChangePasswordInput, options?: RequestOptions): Promise<{
|
|
896
|
+
ok: true;
|
|
897
|
+
}>;
|
|
898
|
+
getSessions(options?: RequestOptions): Promise<{
|
|
899
|
+
data: Session[];
|
|
900
|
+
}>;
|
|
901
|
+
revokeSession(sessionId: string, options?: RequestOptions): Promise<{
|
|
902
|
+
ok: true;
|
|
903
|
+
}>;
|
|
904
|
+
getNotificationPrefs(options?: RequestOptions): Promise<{
|
|
905
|
+
data: NotificationPref[];
|
|
906
|
+
}>;
|
|
907
|
+
updateNotificationPref(channel: string, enabled: boolean, options?: RequestOptions): Promise<{
|
|
908
|
+
ok: true;
|
|
909
|
+
}>;
|
|
910
|
+
getPreferences(options?: RequestOptions): Promise<{
|
|
911
|
+
data: Record<string, string>;
|
|
912
|
+
}>;
|
|
913
|
+
updatePreferences(prefs: Record<string, string>, options?: RequestOptions): Promise<{
|
|
914
|
+
ok: true;
|
|
915
|
+
}>;
|
|
916
|
+
getAddresses(options?: RequestOptions): Promise<{
|
|
917
|
+
data: Address[];
|
|
918
|
+
}>;
|
|
919
|
+
addAddress(input: AddAddressInput, options?: RequestOptions): Promise<{
|
|
920
|
+
id: string;
|
|
921
|
+
}>;
|
|
922
|
+
updateAddress(id: string, input: Partial<AddAddressInput>, options?: RequestOptions): Promise<{
|
|
923
|
+
ok: true;
|
|
924
|
+
}>;
|
|
925
|
+
deleteAddress(id: string, options?: RequestOptions): Promise<{
|
|
926
|
+
ok: true;
|
|
927
|
+
}>;
|
|
928
|
+
setDefaultAddress(id: string, options?: RequestOptions): Promise<{
|
|
929
|
+
ok: true;
|
|
930
|
+
}>;
|
|
931
|
+
getPaymentMethods(options?: RequestOptions): Promise<{
|
|
932
|
+
data: PaymentMethod[];
|
|
933
|
+
}>;
|
|
934
|
+
addPaymentMethod(input: AddPaymentMethodInput, options?: RequestOptions): Promise<{
|
|
935
|
+
id: string;
|
|
936
|
+
}>;
|
|
937
|
+
deletePaymentMethod(id: string, options?: RequestOptions): Promise<{
|
|
938
|
+
ok: true;
|
|
939
|
+
}>;
|
|
940
|
+
setDefaultPaymentMethod(id: string, options?: RequestOptions): Promise<{
|
|
941
|
+
ok: true;
|
|
942
|
+
}>;
|
|
943
|
+
getLinkedAccounts(options?: RequestOptions): Promise<{
|
|
944
|
+
data: LinkedAccount[];
|
|
945
|
+
}>;
|
|
946
|
+
linkAccount(provider: LinkedAccountProvider, token: string, options?: RequestOptions): Promise<{
|
|
947
|
+
ok: true;
|
|
948
|
+
}>;
|
|
949
|
+
unlinkAccount(provider: LinkedAccountProvider, options?: RequestOptions): Promise<{
|
|
950
|
+
ok: true;
|
|
951
|
+
}>;
|
|
952
|
+
}
|
|
953
|
+
|
|
830
954
|
declare class MitumbaClient {
|
|
831
955
|
readonly api: APIClient;
|
|
832
956
|
readonly auth: AuthModule;
|
|
@@ -841,6 +965,7 @@ declare class MitumbaClient {
|
|
|
841
965
|
readonly reviews: ReviewsModule;
|
|
842
966
|
readonly wishlists: WishlistsModule;
|
|
843
967
|
readonly cart: CartModule;
|
|
968
|
+
readonly settings: SettingsModule;
|
|
844
969
|
constructor(config: MitumbaClientConfig);
|
|
845
970
|
/**
|
|
846
971
|
* Set the access token for authenticated requests.
|
|
@@ -857,4 +982,4 @@ declare class MitumbaClient {
|
|
|
857
982
|
clearToken(): void;
|
|
858
983
|
}
|
|
859
984
|
|
|
860
|
-
export { APIClient, APIError, type APIErrorResponse, AuthModule, type AuthTokens, CONDITIONS, type CartItem, CartModule, type Category, type City, type CompleteOnboardingInput, type Condition, type Conversation, type CreateListingInput, type CreateOrderInput, type CreateReviewInput, type EmailLoginInput, type EmailRegisterInput, type ForgotPasswordInput, GARMENT_TYPES, type GarmentType, LISTING_STATUSES, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LoginInput, type Message, type MessageResponse, MessagesModule, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationType, NotificationsModule, ORDER_STATUSES, type Order, type OrderEvent, type OrderHistoryParams, type OrderStatus, OrdersModule, PAYMENT_STATUSES, type PaginatedResponse, PayModule, type PaymentStatus, type PaymentStatusResponse, type PaystackInitResponse, type PaystackInput, type PhoneLoginInput, type PhoneRegisterInput, type PresignImageResponse, type RegisterInput, type RequestOptions, type ResetPasswordInput, type Review, ReviewsModule, type SaveSearchInput, type SearchHistoryItem, SearchModule, type SearchParams, type SearchResult, type SellerProfile, type SellerStorefront, type SendMessageInput, type SendOtpInput, type SimilarListing, type StkPushInput, type StkPushResponse, type Store, StoresModule, type SubscriptionTier, type TransitionOrderInput, type TrendingTerm, type UpdateListingInput, type UserProfile, type VAZIOutfit, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type VerifyOtpInput, type WishlistListing, WishlistsModule };
|
|
985
|
+
export { APIClient, APIError, type APIErrorResponse, type AddAddressInput, type AddPaymentMethodInput, type Address, AuthModule, type AuthTokens, CONDITIONS, type CartItem, CartModule, type Category, type ChangePasswordInput, type City, type CompleteOnboardingInput, type Condition, type Conversation, type CreateListingInput, type CreateOrderInput, type CreateReviewInput, type EmailLoginInput, type EmailRegisterInput, type ForgotPasswordInput, GARMENT_TYPES, type GarmentType, LISTING_STATUSES, type LinkedAccount, type LinkedAccountProvider, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LoginInput, 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, ReviewsModule, type SaveSearchInput, type SearchHistoryItem, SearchModule, type SearchParams, type SearchResult, type SellerProfile, type SellerStorefront, type SendMessageInput, type SendOtpInput, type Session, SettingsModule, type SimilarListing, type StkPushInput, type StkPushResponse, type Store, StoresModule, type SubscriptionTier, type TransitionOrderInput, type TrendingTerm, type UpdateListingInput, type UpdateProfileInput, type UserProfile, type VAZIOutfit, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type VerifyOtpInput, type WishlistListing, WishlistsModule };
|
package/dist/index.js
CHANGED
|
@@ -653,6 +653,84 @@ var CartModule = class {
|
|
|
653
653
|
}
|
|
654
654
|
};
|
|
655
655
|
|
|
656
|
+
// src/modules/settings.ts
|
|
657
|
+
var SettingsModule = class {
|
|
658
|
+
constructor(client) {
|
|
659
|
+
this.client = client;
|
|
660
|
+
}
|
|
661
|
+
client;
|
|
662
|
+
// ── Profile ──
|
|
663
|
+
async getProfile(options) {
|
|
664
|
+
return this.client.get("/auth/me", void 0, options);
|
|
665
|
+
}
|
|
666
|
+
async updateProfile(input, options) {
|
|
667
|
+
return this.client.put("/auth/me", input, options);
|
|
668
|
+
}
|
|
669
|
+
// ── Security ──
|
|
670
|
+
async changePassword(input, options) {
|
|
671
|
+
return this.client.post("/auth/change-password", input, options);
|
|
672
|
+
}
|
|
673
|
+
async getSessions(options) {
|
|
674
|
+
return this.client.get("/auth/sessions", void 0, options);
|
|
675
|
+
}
|
|
676
|
+
async revokeSession(sessionId, options) {
|
|
677
|
+
return this.client.delete(`/auth/sessions/${sessionId}`, options);
|
|
678
|
+
}
|
|
679
|
+
// ── Notification Preferences ──
|
|
680
|
+
async getNotificationPrefs(options) {
|
|
681
|
+
return this.client.get("/auth/notification-prefs", void 0, options);
|
|
682
|
+
}
|
|
683
|
+
async updateNotificationPref(channel, enabled, options) {
|
|
684
|
+
return this.client.put(`/auth/notification-prefs/${channel}`, { enabled }, options);
|
|
685
|
+
}
|
|
686
|
+
// ── Preferences ──
|
|
687
|
+
async getPreferences(options) {
|
|
688
|
+
return this.client.get("/auth/preferences", void 0, options);
|
|
689
|
+
}
|
|
690
|
+
async updatePreferences(prefs, options) {
|
|
691
|
+
return this.client.put("/auth/preferences", { prefs }, options);
|
|
692
|
+
}
|
|
693
|
+
// ── Addresses ──
|
|
694
|
+
async getAddresses(options) {
|
|
695
|
+
return this.client.get("/auth/addresses", void 0, options);
|
|
696
|
+
}
|
|
697
|
+
async addAddress(input, options) {
|
|
698
|
+
return this.client.post("/auth/addresses", input, options);
|
|
699
|
+
}
|
|
700
|
+
async updateAddress(id, input, options) {
|
|
701
|
+
return this.client.put(`/auth/addresses/${id}`, input, options);
|
|
702
|
+
}
|
|
703
|
+
async deleteAddress(id, options) {
|
|
704
|
+
return this.client.delete(`/auth/addresses/${id}`, options);
|
|
705
|
+
}
|
|
706
|
+
async setDefaultAddress(id, options) {
|
|
707
|
+
return this.client.post(`/auth/addresses/${id}/default`, void 0, options);
|
|
708
|
+
}
|
|
709
|
+
// ── Payment Methods ──
|
|
710
|
+
async getPaymentMethods(options) {
|
|
711
|
+
return this.client.get("/auth/payment-methods", void 0, options);
|
|
712
|
+
}
|
|
713
|
+
async addPaymentMethod(input, options) {
|
|
714
|
+
return this.client.post("/auth/payment-methods", input, options);
|
|
715
|
+
}
|
|
716
|
+
async deletePaymentMethod(id, options) {
|
|
717
|
+
return this.client.delete(`/auth/payment-methods/${id}`, options);
|
|
718
|
+
}
|
|
719
|
+
async setDefaultPaymentMethod(id, options) {
|
|
720
|
+
return this.client.post(`/auth/payment-methods/${id}/default`, void 0, options);
|
|
721
|
+
}
|
|
722
|
+
// ── Linked Accounts ──
|
|
723
|
+
async getLinkedAccounts(options) {
|
|
724
|
+
return this.client.get("/auth/linked-accounts", void 0, options);
|
|
725
|
+
}
|
|
726
|
+
async linkAccount(provider, token, options) {
|
|
727
|
+
return this.client.post("/auth/linked-accounts", { provider, token }, options);
|
|
728
|
+
}
|
|
729
|
+
async unlinkAccount(provider, options) {
|
|
730
|
+
return this.client.delete(`/auth/linked-accounts/${provider}`, options);
|
|
731
|
+
}
|
|
732
|
+
};
|
|
733
|
+
|
|
656
734
|
// src/types/listings.ts
|
|
657
735
|
var CONDITIONS = ["new", "like_new", "good", "fair"];
|
|
658
736
|
var LISTING_STATUSES = ["draft", "active", "sold", "removed"];
|
|
@@ -700,6 +778,7 @@ var MitumbaClient = class {
|
|
|
700
778
|
reviews;
|
|
701
779
|
wishlists;
|
|
702
780
|
cart;
|
|
781
|
+
settings;
|
|
703
782
|
constructor(config) {
|
|
704
783
|
this.api = new APIClient(config);
|
|
705
784
|
this.auth = new AuthModule(this.api);
|
|
@@ -714,6 +793,7 @@ var MitumbaClient = class {
|
|
|
714
793
|
this.reviews = new ReviewsModule(this.api);
|
|
715
794
|
this.wishlists = new WishlistsModule(this.api);
|
|
716
795
|
this.cart = new CartModule(this.api);
|
|
796
|
+
this.settings = new SettingsModule(this.api);
|
|
717
797
|
}
|
|
718
798
|
/**
|
|
719
799
|
* Set the access token for authenticated requests.
|
|
@@ -753,6 +833,7 @@ exports.PAYMENT_STATUSES = PAYMENT_STATUSES;
|
|
|
753
833
|
exports.PayModule = PayModule;
|
|
754
834
|
exports.ReviewsModule = ReviewsModule;
|
|
755
835
|
exports.SearchModule = SearchModule;
|
|
836
|
+
exports.SettingsModule = SettingsModule;
|
|
756
837
|
exports.StoresModule = StoresModule;
|
|
757
838
|
exports.VaziModule = VaziModule;
|
|
758
839
|
exports.WishlistsModule = WishlistsModule;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/client.ts","../src/modules/auth.ts","../src/modules/listings.ts","../src/modules/search.ts","../src/modules/orders.ts","../src/modules/pay.ts","../src/modules/vazi.ts","../src/modules/messages.ts","../src/modules/notifications.ts","../src/modules/stores.ts","../src/modules/reviews.ts","../src/modules/wishlists.ts","../src/modules/cart.ts","../src/types/listings.ts","../src/types/orders.ts","../src/types/pay.ts","../src/types/vazi.ts","../src/index.ts"],"names":[],"mappings":";;;AAEO,IAAM,QAAA,GAAN,cAAuB,KAAA,CAAM;AAAA,EAClB,IAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EAEhB,WAAA,CAAY,QAAgB,IAAA,EAAwB;AAClD,IAAA,KAAA,CAAM,IAAA,CAAK,OAAA,IAAW,IAAA,CAAK,KAAK,CAAA;AAChC,IAAA,IAAA,CAAK,IAAA,GAAO,UAAA;AACZ,IAAA,IAAA,CAAK,OAAO,IAAA,CAAK,KA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,GAAY,IAAI,eAAA,CAAgB,IAAA,CAAK,GAAG,CAAA;AAC7C,IAAA,IAAA,CAAK,IAAA,GAAO,IAAI,UAAA,CAAW,IAAA,CAAK,GAAG,CAAA;AAAA,EACrC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMO,QAAA,CAAS,OAAe,YAAA,EAAuB;AACpD,IAAA,IAAA,CAAK,GAAA,CAAI,QAAA,CAAS,KAAA,EAAO,YAAY,CAAA;AAAA,EACvC;AAAA;AAAA;AAAA;AAAA,EAKO,QAAA,GAA+B;AACpC,IAAA,OAAO,IAAA,CAAK,IAAI,QAAA,EAAS;AAAA,EAC3B;AAAA;AAAA;AAAA;AAAA,EAKO,UAAA,GAAa;AAClB,IAAA,IAAA,CAAK,IAAI,UAAA,EAAW;AAAA,EACtB;AACF","file":"index.js","sourcesContent":["import { MitumbaClientConfig, APIErrorResponse, RequestOptions } from './types'\n\nexport class APIError extends Error {\n public readonly code: string\n public readonly status: number\n public readonly details?: unknown\n\n constructor(status: number, data: APIErrorResponse) {\n super(data.message || data.error)\n this.name = 'APIError'\n this.code = data.error\n this.status = status\n this.details = data.details\n }\n}\n\nexport class APIClient {\n private config: MitumbaClientConfig\n private isRefreshing = false\n private refreshPromise: Promise<void> | null = null\n\n constructor(config: MitumbaClientConfig) {\n this.config = config\n }\n\n public setToken(token: string, refreshToken?: string) {\n this.config.token = token\n if (refreshToken) {\n this.config.refreshToken = refreshToken\n }\n }\n\n public getToken(): string | undefined {\n return this.config.token\n }\n\n public clearToken() {\n this.config.token = undefined\n this.config.refreshToken = undefined\n }\n\n private async request<T>(\n method: string, \n path: string, \n body?: unknown, \n params?: Record<string, string | number | boolean | undefined>,\n options?: RequestOptions\n ): Promise<T> {\n const url = new URL(path, this.config.baseUrl)\n \n if (params) {\n for (const [key, value] of Object.entries(params)) {\n if (value !== undefined) {\n url.searchParams.append(key, String(value))\n }\n }\n }\n\n const headers = new Headers()\n if (body && !(body instanceof FormData)) {\n headers.set('Content-Type', 'application/json')\n }\n\n if (this.config.token) {\n headers.set('Authorization', `Bearer ${this.config.token}`)\n }\n\n const init: RequestInit = {\n method,\n headers,\n body: body instanceof FormData ? body : body ? JSON.stringify(body) : undefined,\n signal: options?.signal\n }\n\n const maxRetries = this.config.maxRetries ?? 3\n let attempt = 0\n let response: Response\n\n while (true) {\n if (this.config.debug) {\n console.log(`[Mitumba SDK] ${method} ${url.toString()}`)\n }\n \n const startTime = Date.now()\n try {\n response = await fetch(url.toString(), init)\n } catch (err) {\n if (err instanceof Error && err.name === 'AbortError') {\n throw err\n }\n if (attempt < maxRetries) {\n attempt++\n if (this.config.debug) {\n console.log(`[Mitumba SDK] Network error. Retrying ${method} ${url.toString()} (attempt ${attempt})`)\n }\n await new Promise(resolve => setTimeout(resolve, Math.pow(2, attempt) * 100))\n continue\n }\n throw new APIError(0, { error: 'network_error', message: err instanceof Error ? err.message : 'Network request failed' })\n }\n\n if (this.config.debug) {\n console.log(`[Mitumba SDK] ${method} ${url.toString()} - ${response.status} (${Date.now() - startTime}ms)`)\n }\n\n if (response.status >= 500 && attempt < maxRetries) {\n attempt++\n if (this.config.debug) {\n console.log(`[Mitumba SDK] ${response.status} error. Retrying ${method} ${url.toString()} (attempt ${attempt})`)\n }\n await new Promise(resolve => setTimeout(resolve, Math.pow(2, attempt) * 100))\n continue\n }\n\n break\n }\n\n // Handle automatic token refresh\n if (response.status === 401 && this.config.refreshToken && !path.includes('/auth/refresh')) {\n await this.handleTokenRefresh()\n // Retry request with new token\n headers.set('Authorization', `Bearer ${this.config.token}`)\n response = await fetch(url.toString(), { ...init, headers })\n }\n\n if (!response.ok) {\n let errorData: APIErrorResponse\n try {\n errorData = await response.json()\n } catch {\n errorData = { error: 'unknown_error', message: response.statusText }\n }\n throw new APIError(response.status, errorData)\n }\n\n if (response.status === 204) {\n return undefined as unknown as T\n }\n\n return response.json() as Promise<T>\n }\n\n private async handleTokenRefresh(): Promise<void> {\n if (this.isRefreshing && this.refreshPromise) {\n return this.refreshPromise\n }\n\n this.isRefreshing = true\n this.refreshPromise = (async () => {\n try {\n const url = new URL('/auth/refresh', this.config.baseUrl)\n const response = await fetch(url.toString(), {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ refresh_token: this.config.refreshToken }),\n })\n\n if (!response.ok) {\n throw new Error('Refresh failed')\n }\n\n const data = await response.json() as { access_token: string, refresh_token: string }\n this.setToken(data.access_token, data.refresh_token)\n\n if (this.config.onTokenRefresh) {\n this.config.onTokenRefresh({ token: data.access_token, refreshToken: data.refresh_token })\n }\n } catch (err) {\n this.clearToken()\n throw new APIError(401, { error: 'token_expired', message: 'Session expired. Please log in again.' })\n } finally {\n this.isRefreshing = false\n this.refreshPromise = null\n }\n })()\n\n return this.refreshPromise\n }\n\n public get<T>(path: string, params?: Record<string, string | number | boolean | undefined>, options?: RequestOptions): Promise<T> {\n return this.request<T>('GET', path, undefined, params, options)\n }\n\n public post<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T> {\n return this.request<T>('POST', path, body, undefined, options)\n }\n\n public put<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T> {\n return this.request<T>('PUT', path, body, undefined, options)\n }\n\n public patch<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T> {\n return this.request<T>('PATCH', path, body, undefined, options)\n }\n\n public delete<T>(path: string, options?: RequestOptions): Promise<T> {\n return this.request<T>('DELETE', path, undefined, undefined, options)\n }\n}\n","import { APIClient } from '../client'\nimport type {\n RegisterInput,\n LoginInput,\n SendOtpInput,\n VerifyOtpInput,\n ForgotPasswordInput,\n ResetPasswordInput,\n CompleteOnboardingInput,\n UserProfile,\n AuthTokens,\n MessageResponse,\n RequestOptions,\n} from '../types'\n\nexport class AuthModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * Register a new account.\n * If using EmailRegisterInput, returns AuthTokens.\n * If using PhoneRegisterInput, returns MessageResponse (OTP sent).\n */\n async register(input: RegisterInput, options?: RequestOptions): Promise<AuthTokens | MessageResponse> {\n return this.client.post<AuthTokens | MessageResponse>('/auth/register', input, options)\n }\n\n /**\n * Log in to an existing account.\n * If using EmailLoginInput, returns AuthTokens.\n * If using PhoneLoginInput, returns MessageResponse (OTP sent).\n */\n async login(input: LoginInput, options?: RequestOptions): Promise<AuthTokens | MessageResponse> {\n return this.client.post<AuthTokens | MessageResponse>('/auth/login', input, options)\n }\n\n /**\n * Send an OTP code to a phone number.\n */\n async sendOtp(input: SendOtpInput, options?: RequestOptions): Promise<MessageResponse> {\n return this.client.post<MessageResponse>('/auth/otp/send', input, options)\n }\n\n /**\n * Verify an OTP code.\n */\n async verifyOtp(input: VerifyOtpInput, options?: RequestOptions): Promise<AuthTokens> {\n return this.client.post<AuthTokens>('/auth/otp/verify', input, options)\n }\n\n /**\n * Refresh the access token using a refresh token.\n */\n async refresh(input: { refresh_token: string }, options?: RequestOptions): Promise<AuthTokens> {\n return this.client.post<AuthTokens>('/auth/refresh', input, options)\n }\n\n /**\n * Revoke the refresh token and log out.\n */\n async logout(input: { refresh_token: string }, options?: RequestOptions): Promise<{ ok: boolean }> {\n return this.client.post<{ ok: boolean }>('/auth/logout', input, options)\n }\n\n /**\n * Request a password reset email.\n * Sends a reset link to the provided email address.\n */\n async forgotPassword(input: ForgotPasswordInput, options?: RequestOptions): Promise<MessageResponse> {\n return this.client.post<MessageResponse>('/auth/forgot-password', input, options)\n }\n\n /**\n * Reset the password using a token from the reset email.\n */\n async resetPassword(input: ResetPasswordInput, options?: RequestOptions): Promise<MessageResponse> {\n return this.client.post<MessageResponse>('/auth/reset-password', input, options)\n }\n\n /**\n * Get the current authenticated user's profile.\n */\n async me(options?: RequestOptions): Promise<UserProfile> {\n return this.client.get<UserProfile>('/auth/me', undefined, options)\n }\n\n /**\n * Complete the onboarding flow.\n */\n async completeOnboarding(input: CompleteOnboardingInput, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.post<{ ok: true }>('/auth/onboarding/complete', input, options)\n }\n}\n","import { APIClient } from '../client'\nimport type {\n Category,\n City,\n Condition,\n CreateListingInput,\n Listing,\n ListingImage,\n ListingStatus,\n ListingsFeedParams,\n PaginatedResponse,\n PresignImageResponse,\n SellerStorefront,\n SimilarListing,\n UpdateListingInput,\n RequestOptions,\n} from '../types'\n\nexport class ListingsModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * Browse the marketplace feed with optional filters.\n */\n async getFeed(params?: ListingsFeedParams, options?: RequestOptions): Promise<PaginatedResponse<Listing>> {\n // APIClient handles converting params to string|number|boolean properly\n return this.client.get<PaginatedResponse<Listing>>(\n '/listings/feed', \n params as unknown as Record<string, string | number | boolean | undefined>,\n options\n )\n }\n\n /**\n * Get full details of a single listing, including its images.\n */\n async getById(id: string, options?: RequestOptions): Promise<Listing & { images: ListingImage[] }> {\n return this.client.get<Listing & { images: ListingImage[] }>(`/listings/${id}`, undefined, options)\n }\n\n /**\n * Create a new listing (requires seller role).\n */\n async create(input: CreateListingInput, options?: RequestOptions): Promise<Listing> {\n return this.client.post<Listing>('/listings', input, options)\n }\n\n /**\n * Update an existing listing.\n */\n async update(id: string, input: UpdateListingInput, options?: RequestOptions): Promise<Listing> {\n return this.client.put<Listing>(`/listings/${id}`, input, options)\n }\n\n /**\n * Change the status of a listing.\n */\n async updateStatus(id: string, status: ListingStatus, options?: RequestOptions): Promise<{ ok: boolean; status: ListingStatus }> {\n return this.client.patch<{ ok: boolean; status: ListingStatus }>(`/listings/${id}/status`, { status }, options)\n }\n\n /**\n * Soft delete a listing (sets status to 'removed').\n */\n async delete(id: string, options?: RequestOptions): Promise<{ ok: boolean }> {\n return this.client.delete<{ ok: boolean }>(`/listings/${id}`, options)\n }\n\n /**\n * Get a seller's public storefront.\n */\n async getSellerStorefront(\n sellerId: string,\n params?: { page?: number; page_size?: number },\n options?: RequestOptions\n ): Promise<SellerStorefront> {\n return this.client.get<SellerStorefront>(\n `/listings/seller/${sellerId}`, \n params as unknown as Record<string, string | number | boolean | undefined>,\n options\n )\n }\n\n /**\n * List all supported categories.\n */\n async getCategories(options?: RequestOptions): Promise<Category[]> {\n return this.client.get<Category[]>('/listings/categories', undefined, options)\n }\n\n /**\n * List all supported cities.\n */\n async getCities(options?: RequestOptions): Promise<City[]> {\n return this.client.get<City[]>('/listings/cities', undefined, options)\n }\n\n /**\n * Get a presigned upload URL for a listing image.\n * Index should be between 0 and 9.\n */\n async presignImage(listingId: string, index: number, options?: RequestOptions): Promise<PresignImageResponse> {\n return this.client.post<PresignImageResponse>(`/listings/${listingId}/images/presign`, { index }, options)\n }\n\n /**\n * Browse the listing feed (alias for getFeed with simplified params).\n */\n async feed(params?: { page?: number; city?: string; category?: string; sort?: string }, options?: RequestOptions): Promise<{ data: Listing[]; page: number }> {\n return this.client.get<{ data: Listing[]; page: number }>(\n '/listings',\n params as unknown as Record<string, string | number | boolean | undefined>,\n options\n )\n }\n\n /**\n * Get a single listing by ID (alias for getById).\n */\n async get(id: string, options?: RequestOptions): Promise<Listing & { images: ListingImage[] }> {\n return this.getById(id, options)\n }\n\n /**\n * Full-text search with filters.\n */\n async search(params: { q: string; category?: string; condition?: Condition; min_price?: number; max_price?: number; sort?: string; page?: number }, options?: RequestOptions): Promise<{ data: Listing[]; total: number }> {\n return this.client.get<{ data: Listing[]; total: number }>(\n '/search',\n params as unknown as Record<string, string | number | boolean | undefined>,\n options\n )\n }\n\n /**\n * Get similar listings for a given listing.\n */\n async getSimilar(listingId: string, mode?: 'global' | 'store', options?: RequestOptions): Promise<{ data: SimilarListing[] }> {\n return this.client.get<{ data: SimilarListing[] }>(\n `/listings/${listingId}/similar`,\n mode ? { mode } : undefined,\n options\n )\n }\n}\n","import { APIClient } from '../client'\nimport type { PaginatedResponse, SearchParams, SearchResult, SearchHistoryItem, SaveSearchInput, TrendingTerm, RequestOptions } from '../types'\n\nexport class SearchModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * Perform a full-text search with optional filters.\n */\n async query(params: SearchParams, options?: RequestOptions): Promise<PaginatedResponse<SearchResult>> {\n return this.client.get<PaginatedResponse<SearchResult>>(\n '/search', \n params as unknown as Record<string, string | number | boolean | undefined>,\n options\n )\n }\n\n /**\n * Get trending search terms.\n */\n async trending(params?: { city_id?: string }, options?: RequestOptions): Promise<{ terms: TrendingTerm[] }> {\n return this.client.get<{ terms: TrendingTerm[] }>(\n '/search/trending',\n params as unknown as Record<string, string | number | boolean | undefined>,\n options\n )\n }\n\n /**\n * Get the user's search history.\n */\n async getHistory(options?: RequestOptions): Promise<{ data: SearchHistoryItem[] }> {\n return this.client.get<{ data: SearchHistoryItem[] }>('/search/history', undefined, options)\n }\n\n /**\n * Save a search query to history.\n */\n async saveHistory(input: SaveSearchInput, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.post<{ ok: true }>('/search/history', input, options)\n }\n}\n","import { APIClient } from '../client'\nimport type { CreateOrderInput, Order, OrderEvent, OrderHistoryParams, OrderStatus, TransitionOrderInput, RequestOptions } from '../types'\n\nexport class OrdersModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * Create a new order from a listing.\n */\n async create(input: CreateOrderInput, options?: RequestOptions): Promise<{ order_id: string; total: number; delivery_fee: number }> {\n return this.client.post<{ order_id: string; total: number; delivery_fee: number }>('/orders', input, options)\n }\n\n /**\n * Get full details of an order, including its event timeline.\n */\n async getById(id: string, options?: RequestOptions): Promise<Order & { events: OrderEvent[] }> {\n return this.client.get<Order & { events: OrderEvent[] }>(`/orders/${id}`, undefined, options)\n }\n\n /**\n * Transition the status of an order.\n */\n async transition(id: string, input: TransitionOrderInput, options?: RequestOptions): Promise<{ ok: boolean; status: OrderStatus }> {\n return this.client.post<{ ok: boolean; status: OrderStatus }>(`/orders/${id}/transition`, input, options)\n }\n\n /**\n * Get the order history for the current authenticated user.\n */\n async getHistory(params?: OrderHistoryParams, options?: RequestOptions): Promise<{ data: Order[]; page: number; page_size: number }> {\n return this.client.get<{ data: Order[]; page: number; page_size: number }>(\n '/orders/history',\n params as unknown as Record<string, string | number | boolean | undefined>,\n options\n )\n }\n}\n","import { APIClient } from '../client'\nimport type { MpesaInput, PaystackInput, PaystackInitResponse, PaymentStatusResponse, StkPushInput, StkPushResponse, RequestOptions } from '../types'\n\nexport class PayModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * Initiate an M-Pesa STK Push payment for an order.\n */\n async initiateStk(input: StkPushInput, options?: RequestOptions): Promise<StkPushResponse> {\n return this.client.post<StkPushResponse>('/pay/stk', input, options)\n }\n\n /**\n * Initiate M-Pesa STK Push (alias for initiateStk).\n */\n async initMpesa(input: MpesaInput, options?: RequestOptions): Promise<StkPushResponse> {\n return this.client.post<StkPushResponse>('/pay/stk', input, options)\n }\n\n /**\n * Initiate a Paystack payment — returns access_code for inline popup.\n */\n async initPaystack(input: PaystackInput, options?: RequestOptions): Promise<PaystackInitResponse> {\n return this.client.post<PaystackInitResponse>('/pay/paystack/init', input, options)\n }\n\n /**\n * Poll for the current status of a payment by its order ID.\n */\n async getStatus(orderId: string, options?: RequestOptions): Promise<PaymentStatusResponse> {\n return this.client.get<PaymentStatusResponse>(`/pay/status/${orderId}`, undefined, options)\n }\n}\n","import { APIClient } from '../client'\nimport type { VAZIOutfit, VaziFeedParams, VaziFeedResponse, RequestOptions } from '../types'\n\nexport class VaziModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * Browse the AI-curated outfit feed.\n */\n async getFeed(params?: VaziFeedParams, options?: RequestOptions): Promise<VaziFeedResponse> {\n return this.client.get<VaziFeedResponse>(\n '/vazi/feed',\n params as unknown as Record<string, string | number | boolean | undefined>,\n options\n )\n }\n\n /**\n * Get a complete outfit built around a specific seed listing.\n */\n async getCompleteLook(listingId: string, options?: RequestOptions): Promise<{ outfits: VAZIOutfit[] }> {\n return this.client.get<{ outfits: VAZIOutfit[] }>(`/vazi/complete/${listingId}`, undefined, options)\n }\n}\n","import { APIClient } from '../client'\nimport type { Conversation, Message, SendMessageInput, RequestOptions } from '../types'\n\nexport class MessagesModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * List all conversations for the authenticated user.\n */\n async list(storeId?: string, options?: RequestOptions): Promise<{ data: Conversation[] }> {\n return this.client.get<{ data: Conversation[] }>(\n '/notify/messages',\n storeId ? { store_id: storeId } : undefined,\n options\n )\n }\n\n /**\n * Get the message thread with a specific partner.\n */\n async getThread(partnerId: string, storeId?: string, options?: RequestOptions): Promise<{ data: Message[] }> {\n return this.client.get<{ data: Message[] }>(\n `/notify/messages/${partnerId}`,\n storeId ? { store_id: storeId } : undefined,\n options\n )\n }\n\n /**\n * Send a message to another user.\n */\n async send(input: SendMessageInput, options?: RequestOptions): Promise<{ id: string }> {\n return this.client.post<{ id: string }>('/notify/messages', input, options)\n }\n}\n","import { APIClient } from '../client'\nimport type { Notification, RequestOptions } from '../types'\n\nexport class NotificationsModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * List paginated notifications with unread count.\n */\n async list(page?: number, options?: RequestOptions): Promise<{ data: Notification[]; unread_count: number; page: number }> {\n return this.client.get<{ data: Notification[]; unread_count: number; page: number }>(\n '/notify/notifications',\n page !== undefined ? { page } : undefined,\n options\n )\n }\n\n /**\n * Mark notifications as read. If ids omitted, marks all as read.\n */\n async markRead(ids?: string[], options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.post<{ ok: true }>('/notify/notifications/read', ids ? { ids } : {}, options)\n }\n}\n","import { APIClient } from '../client'\nimport type { Listing, Store, RequestOptions } from '../types'\n\nexport class StoresModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * Get a store by its URL slug.\n */\n async getBySlug(slug: string, options?: RequestOptions): Promise<Store> {\n return this.client.get<Store>(`/listings/stores/${slug}`, undefined, options)\n }\n\n /**\n * Follow a store.\n */\n async follow(storeId: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.post<{ ok: true }>(`/listings/stores/${storeId}/follow`, undefined, options)\n }\n\n /**\n * Unfollow a store.\n */\n async unfollow(storeId: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.delete<{ ok: true }>(`/listings/stores/${storeId}/follow`, options)\n }\n\n /**\n * Get paginated listings for a specific store.\n */\n async getListings(storeId: string, page?: number, options?: RequestOptions): Promise<{ data: Listing[] }> {\n return this.client.get<{ data: Listing[] }>(\n `/listings/stores/${storeId}/listings`,\n page !== undefined ? { page } : undefined,\n options\n )\n }\n}\n","import { APIClient } from '../client'\nimport type { CreateReviewInput, Review, RequestOptions } from '../types'\n\nexport class ReviewsModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * List reviews for a store (public).\n */\n async list(storeId: string, page?: number, options?: RequestOptions): Promise<{ data: Review[]; total: number; avg_rating: number; page: number }> {\n return this.client.get<{ data: Review[]; total: number; avg_rating: number; page: number }>(\n `/listings/stores/${storeId}/reviews`,\n page !== undefined ? { page } : undefined,\n options\n )\n }\n\n /**\n * Create a review for a store (authenticated).\n */\n async create(storeId: string, input: CreateReviewInput, options?: RequestOptions): Promise<{ id: string }> {\n return this.client.post<{ id: string }>(`/listings/stores/${storeId}/reviews`, input, options)\n }\n}\n","import { APIClient } from '../client'\nimport type { WishlistListing, RequestOptions } from '../types'\n\nexport class WishlistsModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * List saved listings.\n */\n async list(options?: RequestOptions): Promise<{ data: WishlistListing[] }> {\n return this.client.get<{ data: WishlistListing[] }>('/listings/wishlists', undefined, options)\n }\n\n /**\n * Add a listing to the wishlist.\n */\n async add(listingId: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.post<{ ok: true }>(`/listings/wishlists/${listingId}`, undefined, options)\n }\n\n /**\n * Remove a listing from the wishlist.\n */\n async remove(listingId: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.delete<{ ok: true }>(`/listings/wishlists/${listingId}`, options)\n }\n}\n","import { APIClient } from '../client'\nimport type { CartItem, RequestOptions } from '../types'\n\nexport class CartModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * List items in the cart.\n */\n async list(options?: RequestOptions): Promise<{ data: CartItem[] }> {\n return this.client.get<{ data: CartItem[] }>('/listings/cart', undefined, options)\n }\n\n /**\n * Add a listing to the cart.\n */\n async add(listingId: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.post<{ ok: true }>(`/listings/cart/${listingId}`, undefined, options)\n }\n\n /**\n * Remove a listing from the cart.\n */\n async remove(listingId: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.delete<{ ok: true }>(`/listings/cart/${listingId}`, options)\n }\n\n /**\n * Checkout the cart — creates orders grouped by store and clears the cart.\n */\n async checkout(options?: RequestOptions): Promise<{ order_ids: string[]; count: number }> {\n return this.client.post<{ order_ids: string[]; count: number }>('/orders/checkout', undefined, options)\n }\n}\n","export const CONDITIONS = ['new', 'like_new', 'good', 'fair'] as const\nexport type Condition = typeof CONDITIONS[number]\n\nexport const LISTING_STATUSES = ['draft', 'active', 'sold', 'removed'] as const\nexport type ListingStatus = typeof LISTING_STATUSES[number]\n\nexport interface ListingImage {\n id: string\n listing_id: string\n url: string\n position: number\n created_at: string\n}\n\nexport interface SellerProfile {\n id: string\n sti_score: number\n verification_status: string\n seller_type: 'individual' | 'bale'\n}\n\nexport interface Listing {\n id: string\n seller_id: string\n title: string\n description: string | null\n category_id: string\n city_id: string\n price: number // KES integer\n condition: Condition\n status: ListingStatus\n photo_verified: boolean\n vazi_eligible: boolean\n created_at: string\n updated_at: string\n // Seller profile (joined)\n sti_score: number\n verification_status: string\n seller_type: 'individual' | 'bale'\n // Images (only present on GET /listings/:id, not in feed)\n images?: ListingImage[]\n}\n\nexport interface ListingsFeedParams {\n city_id?: string\n category_id?: string\n min_price?: number\n max_price?: number\n condition?: Condition\n sort?: 'recency' | 'price_asc' | 'price_desc'\n page?: number\n page_size?: number\n}\n\nexport interface CreateListingInput {\n store_id: string\n title: string\n description?: string\n category_id: string\n city_id: string\n price: number\n condition: Condition\n vazi_eligible?: boolean\n}\n\nexport type UpdateListingInput = Partial<CreateListingInput>\n\nexport interface Category {\n id: string\n name: string\n slug: string\n}\n\nexport interface City {\n id: string\n name: string\n delivery_fee: number\n}\n\nexport interface SellerStorefront {\n seller: SellerProfile\n listings: Listing[]\n total: number\n page: number\n page_size: number\n has_more: boolean\n}\n\nexport interface PresignImageResponse {\n r2_key: string\n image_id: string\n}\n\nexport interface SimilarListing {\n id: string\n title: string\n price: number\n condition: string\n category_id: string\n store_id: string | null\n image_keys: string | null\n created_at: string\n}\n","export const ORDER_STATUSES = [\n 'created',\n 'payment_pending',\n 'paid',\n 'seller_confirmed',\n 'shipped',\n 'delivered',\n 'completed',\n 'cancelled',\n 'disputed',\n] as const\n\nexport type OrderStatus = typeof ORDER_STATUSES[number]\n\nexport interface OrderEvent {\n id: string\n order_id: string\n actor: string // user ID or 'system'\n old_status: string\n new_status: string\n note: string | null\n created_at: string\n}\n\nexport interface Order {\n id: string\n buyer_id: string\n seller_id: string\n listing_id: string\n amount: number\n delivery_fee: number\n total: number\n status: OrderStatus\n city_id: string\n created_at: string\n updated_at: string\n events?: OrderEvent[]\n}\n\nexport interface CreateOrderInput {\n listing_id: string\n}\n\nexport interface TransitionOrderInput {\n status: OrderStatus\n note?: string\n}\n\nexport interface OrderHistoryParams {\n role?: 'buyer' | 'seller'\n page?: number\n}\n","export interface StkPushInput {\n order_id: string\n phone: string // format: +254XXXXXXXXX\n}\n\nexport type MpesaInput = StkPushInput\n\nexport interface StkPushResponse {\n payment_id: string\n provider: string\n}\n\nexport interface PaystackInput {\n order_id: string\n email: string\n}\n\nexport interface PaystackInitResponse {\n access_code: string\n authorization_url: string\n reference: string\n}\n\nexport const PAYMENT_STATUSES = ['initiated', 'funded', 'failed', 'refunded', 'cancelled'] as const\nexport type PaymentStatus = typeof PAYMENT_STATUSES[number]\n\nexport interface PaymentStatusResponse {\n id: string\n status: PaymentStatus\n total: number\n}\n","export const GARMENT_TYPES = [\n 'top',\n 'bottom',\n 'shoes',\n 'accessory',\n 'dress',\n 'outerwear',\n 'bag',\n 'kids',\n] as const\n\nexport type GarmentType = typeof GARMENT_TYPES[number]\n\nexport interface VAZIOutfitItem {\n listing_id: string\n garment_type: GarmentType\n price_kes: number\n seller_id: string\n seller_sti: number\n seller_city: string\n image_url: string | null\n is_seed: boolean\n final_score: number\n}\n\nexport interface VAZIOutfit {\n id: string\n name: string\n items: VAZIOutfitItem[]\n total_price_kes: number\n sellers_count: number\n is_multi_city: boolean\n assembled_at: string // ISO timestamp\n}\n\nexport interface VaziFeedParams {\n limit?: number\n offset?: number\n}\n\nexport interface VaziFeedResponse {\n outfits: VAZIOutfit[]\n total: number\n limit: number\n offset: number\n}\n","import { APIClient } from './client'\nimport { MitumbaClientConfig } from './types'\nimport { AuthModule } from './modules/auth'\nimport { ListingsModule } from './modules/listings'\nimport { SearchModule } from './modules/search'\nimport { OrdersModule } from './modules/orders'\nimport { PayModule } from './modules/pay'\nimport { VaziModule } from './modules/vazi'\nimport { MessagesModule } from './modules/messages'\nimport { NotificationsModule } from './modules/notifications'\nimport { StoresModule } from './modules/stores'\nimport { ReviewsModule } from './modules/reviews'\nimport { WishlistsModule } from './modules/wishlists'\nimport { CartModule } from './modules/cart'\n\nexport class MitumbaClient {\n public readonly api: APIClient\n public readonly auth: AuthModule\n public readonly listings: ListingsModule\n public readonly search: SearchModule\n public readonly orders: OrdersModule\n public readonly pay: PayModule\n public readonly vazi: VaziModule\n public readonly messages: MessagesModule\n public readonly notifications: NotificationsModule\n public readonly stores: StoresModule\n public readonly reviews: ReviewsModule\n public readonly wishlists: WishlistsModule\n public readonly cart: CartModule\n\n constructor(config: MitumbaClientConfig) {\n this.api = new APIClient(config)\n this.auth = new AuthModule(this.api)\n this.listings = new ListingsModule(this.api)\n this.search = new SearchModule(this.api)\n this.orders = new OrdersModule(this.api)\n this.pay = new PayModule(this.api)\n this.vazi = new VaziModule(this.api)\n this.messages = new MessagesModule(this.api)\n this.notifications = new NotificationsModule(this.api)\n this.stores = new StoresModule(this.api)\n this.reviews = new ReviewsModule(this.api)\n this.wishlists = new WishlistsModule(this.api)\n this.cart = new CartModule(this.api)\n }\n\n /**\n * Set the access token for authenticated requests.\n * Optionally pass a refresh token to enable automatic token rotation.\n */\n public setToken(token: string, refreshToken?: string) {\n this.api.setToken(token, refreshToken)\n }\n\n /**\n * Get the current access token.\n */\n public getToken(): string | undefined {\n return this.api.getToken()\n }\n\n /**\n * Clear the current tokens.\n */\n public clearToken() {\n this.api.clearToken()\n }\n}\n\nexport * from './types'\nexport { APIClient, APIError } from './client'\nexport { AuthModule } from './modules/auth'\nexport { ListingsModule } from './modules/listings'\nexport { SearchModule } from './modules/search'\nexport { OrdersModule } from './modules/orders'\nexport { PayModule } from './modules/pay'\nexport { VaziModule } from './modules/vazi'\nexport { MessagesModule } from './modules/messages'\nexport { NotificationsModule } from './modules/notifications'\nexport { StoresModule } from './modules/stores'\nexport { ReviewsModule } from './modules/reviews'\nexport { WishlistsModule } from './modules/wishlists'\nexport { CartModule } from './modules/cart'\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/client.ts","../src/modules/auth.ts","../src/modules/listings.ts","../src/modules/search.ts","../src/modules/orders.ts","../src/modules/pay.ts","../src/modules/vazi.ts","../src/modules/messages.ts","../src/modules/notifications.ts","../src/modules/stores.ts","../src/modules/reviews.ts","../src/modules/wishlists.ts","../src/modules/cart.ts","../src/modules/settings.ts","../src/types/listings.ts","../src/types/orders.ts","../src/types/pay.ts","../src/types/vazi.ts","../src/index.ts"],"names":[],"mappings":";;;AAEO,IAAM,QAAA,GAAN,cAAuB,KAAA,CAAM;AAAA,EAClB,IAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EAEhB,WAAA,CAAY,QAAgB,IAAA,EAAwB;AAClD,IAAA,KAAA,CAAM,IAAA,CAAK,OAAA,IAAW,IAAA,CAAK,KAAK,CAAA;AAChC,IAAA,IAAA,CAAK,IAAA,GAAO,UAAA;AACZ,IAAA,IAAA,CAAK,OAAO,IAAA,CAAK,KAAA;AACjB,IAAA,IAAA,CAAK,MAAA,GAAS,MAAA;AACd,IAAA,IAAA,CAAK,UAAU,IAAA,CAAK,OAAA;AAAA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AAAA;AAAA,EAMO,QAAA,CAAS,OAAe,YAAA,EAAuB;AACpD,IAAA,IAAA,CAAK,GAAA,CAAI,QAAA,CAAS,KAAA,EAAO,YAAY,CAAA;AAAA,EACvC;AAAA;AAAA;AAAA;AAAA,EAKO,QAAA,GAA+B;AACpC,IAAA,OAAO,IAAA,CAAK,IAAI,QAAA,EAAS;AAAA,EAC3B;AAAA;AAAA;AAAA;AAAA,EAKO,UAAA,GAAa;AAClB,IAAA,IAAA,CAAK,IAAI,UAAA,EAAW;AAAA,EACtB;AACF","file":"index.js","sourcesContent":["import { MitumbaClientConfig, APIErrorResponse, RequestOptions } from './types'\n\nexport class APIError extends Error {\n public readonly code: string\n public readonly status: number\n public readonly details?: unknown\n\n constructor(status: number, data: APIErrorResponse) {\n super(data.message || data.error)\n this.name = 'APIError'\n this.code = data.error\n this.status = status\n this.details = data.details\n }\n}\n\nexport class APIClient {\n private config: MitumbaClientConfig\n private isRefreshing = false\n private refreshPromise: Promise<void> | null = null\n\n constructor(config: MitumbaClientConfig) {\n this.config = config\n }\n\n public setToken(token: string, refreshToken?: string) {\n this.config.token = token\n if (refreshToken) {\n this.config.refreshToken = refreshToken\n }\n }\n\n public getToken(): string | undefined {\n return this.config.token\n }\n\n public clearToken() {\n this.config.token = undefined\n this.config.refreshToken = undefined\n }\n\n private async request<T>(\n method: string, \n path: string, \n body?: unknown, \n params?: Record<string, string | number | boolean | undefined>,\n options?: RequestOptions\n ): Promise<T> {\n const url = new URL(path, this.config.baseUrl)\n \n if (params) {\n for (const [key, value] of Object.entries(params)) {\n if (value !== undefined) {\n url.searchParams.append(key, String(value))\n }\n }\n }\n\n const headers = new Headers()\n if (body && !(body instanceof FormData)) {\n headers.set('Content-Type', 'application/json')\n }\n\n if (this.config.token) {\n headers.set('Authorization', `Bearer ${this.config.token}`)\n }\n\n const init: RequestInit = {\n method,\n headers,\n body: body instanceof FormData ? body : body ? JSON.stringify(body) : undefined,\n signal: options?.signal\n }\n\n const maxRetries = this.config.maxRetries ?? 3\n let attempt = 0\n let response: Response\n\n while (true) {\n if (this.config.debug) {\n console.log(`[Mitumba SDK] ${method} ${url.toString()}`)\n }\n \n const startTime = Date.now()\n try {\n response = await fetch(url.toString(), init)\n } catch (err) {\n if (err instanceof Error && err.name === 'AbortError') {\n throw err\n }\n if (attempt < maxRetries) {\n attempt++\n if (this.config.debug) {\n console.log(`[Mitumba SDK] Network error. Retrying ${method} ${url.toString()} (attempt ${attempt})`)\n }\n await new Promise(resolve => setTimeout(resolve, Math.pow(2, attempt) * 100))\n continue\n }\n throw new APIError(0, { error: 'network_error', message: err instanceof Error ? err.message : 'Network request failed' })\n }\n\n if (this.config.debug) {\n console.log(`[Mitumba SDK] ${method} ${url.toString()} - ${response.status} (${Date.now() - startTime}ms)`)\n }\n\n if (response.status >= 500 && attempt < maxRetries) {\n attempt++\n if (this.config.debug) {\n console.log(`[Mitumba SDK] ${response.status} error. Retrying ${method} ${url.toString()} (attempt ${attempt})`)\n }\n await new Promise(resolve => setTimeout(resolve, Math.pow(2, attempt) * 100))\n continue\n }\n\n break\n }\n\n // Handle automatic token refresh\n if (response.status === 401 && this.config.refreshToken && !path.includes('/auth/refresh')) {\n await this.handleTokenRefresh()\n // Retry request with new token\n headers.set('Authorization', `Bearer ${this.config.token}`)\n response = await fetch(url.toString(), { ...init, headers })\n }\n\n if (!response.ok) {\n let errorData: APIErrorResponse\n try {\n errorData = await response.json()\n } catch {\n errorData = { error: 'unknown_error', message: response.statusText }\n }\n throw new APIError(response.status, errorData)\n }\n\n if (response.status === 204) {\n return undefined as unknown as T\n }\n\n return response.json() as Promise<T>\n }\n\n private async handleTokenRefresh(): Promise<void> {\n if (this.isRefreshing && this.refreshPromise) {\n return this.refreshPromise\n }\n\n this.isRefreshing = true\n this.refreshPromise = (async () => {\n try {\n const url = new URL('/auth/refresh', this.config.baseUrl)\n const response = await fetch(url.toString(), {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ refresh_token: this.config.refreshToken }),\n })\n\n if (!response.ok) {\n throw new Error('Refresh failed')\n }\n\n const data = await response.json() as { access_token: string, refresh_token: string }\n this.setToken(data.access_token, data.refresh_token)\n\n if (this.config.onTokenRefresh) {\n this.config.onTokenRefresh({ token: data.access_token, refreshToken: data.refresh_token })\n }\n } catch (err) {\n this.clearToken()\n throw new APIError(401, { error: 'token_expired', message: 'Session expired. Please log in again.' })\n } finally {\n this.isRefreshing = false\n this.refreshPromise = null\n }\n })()\n\n return this.refreshPromise\n }\n\n public get<T>(path: string, params?: Record<string, string | number | boolean | undefined>, options?: RequestOptions): Promise<T> {\n return this.request<T>('GET', path, undefined, params, options)\n }\n\n public post<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T> {\n return this.request<T>('POST', path, body, undefined, options)\n }\n\n public put<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T> {\n return this.request<T>('PUT', path, body, undefined, options)\n }\n\n public patch<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T> {\n return this.request<T>('PATCH', path, body, undefined, options)\n }\n\n public delete<T>(path: string, options?: RequestOptions): Promise<T> {\n return this.request<T>('DELETE', path, undefined, undefined, options)\n }\n}\n","import { APIClient } from '../client'\nimport type {\n RegisterInput,\n LoginInput,\n SendOtpInput,\n VerifyOtpInput,\n ForgotPasswordInput,\n ResetPasswordInput,\n CompleteOnboardingInput,\n UserProfile,\n AuthTokens,\n MessageResponse,\n RequestOptions,\n} from '../types'\n\nexport class AuthModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * Register a new account.\n * If using EmailRegisterInput, returns AuthTokens.\n * If using PhoneRegisterInput, returns MessageResponse (OTP sent).\n */\n async register(input: RegisterInput, options?: RequestOptions): Promise<AuthTokens | MessageResponse> {\n return this.client.post<AuthTokens | MessageResponse>('/auth/register', input, options)\n }\n\n /**\n * Log in to an existing account.\n * If using EmailLoginInput, returns AuthTokens.\n * If using PhoneLoginInput, returns MessageResponse (OTP sent).\n */\n async login(input: LoginInput, options?: RequestOptions): Promise<AuthTokens | MessageResponse> {\n return this.client.post<AuthTokens | MessageResponse>('/auth/login', input, options)\n }\n\n /**\n * Send an OTP code to a phone number.\n */\n async sendOtp(input: SendOtpInput, options?: RequestOptions): Promise<MessageResponse> {\n return this.client.post<MessageResponse>('/auth/otp/send', input, options)\n }\n\n /**\n * Verify an OTP code.\n */\n async verifyOtp(input: VerifyOtpInput, options?: RequestOptions): Promise<AuthTokens> {\n return this.client.post<AuthTokens>('/auth/otp/verify', input, options)\n }\n\n /**\n * Refresh the access token using a refresh token.\n */\n async refresh(input: { refresh_token: string }, options?: RequestOptions): Promise<AuthTokens> {\n return this.client.post<AuthTokens>('/auth/refresh', input, options)\n }\n\n /**\n * Revoke the refresh token and log out.\n */\n async logout(input: { refresh_token: string }, options?: RequestOptions): Promise<{ ok: boolean }> {\n return this.client.post<{ ok: boolean }>('/auth/logout', input, options)\n }\n\n /**\n * Request a password reset email.\n * Sends a reset link to the provided email address.\n */\n async forgotPassword(input: ForgotPasswordInput, options?: RequestOptions): Promise<MessageResponse> {\n return this.client.post<MessageResponse>('/auth/forgot-password', input, options)\n }\n\n /**\n * Reset the password using a token from the reset email.\n */\n async resetPassword(input: ResetPasswordInput, options?: RequestOptions): Promise<MessageResponse> {\n return this.client.post<MessageResponse>('/auth/reset-password', input, options)\n }\n\n /**\n * Get the current authenticated user's profile.\n */\n async me(options?: RequestOptions): Promise<UserProfile> {\n return this.client.get<UserProfile>('/auth/me', undefined, options)\n }\n\n /**\n * Complete the onboarding flow.\n */\n async completeOnboarding(input: CompleteOnboardingInput, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.post<{ ok: true }>('/auth/onboarding/complete', input, options)\n }\n}\n","import { APIClient } from '../client'\nimport type {\n Category,\n City,\n Condition,\n CreateListingInput,\n Listing,\n ListingImage,\n ListingStatus,\n ListingsFeedParams,\n PaginatedResponse,\n PresignImageResponse,\n SellerStorefront,\n SimilarListing,\n UpdateListingInput,\n RequestOptions,\n} from '../types'\n\nexport class ListingsModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * Browse the marketplace feed with optional filters.\n */\n async getFeed(params?: ListingsFeedParams, options?: RequestOptions): Promise<PaginatedResponse<Listing>> {\n // APIClient handles converting params to string|number|boolean properly\n return this.client.get<PaginatedResponse<Listing>>(\n '/listings/feed', \n params as unknown as Record<string, string | number | boolean | undefined>,\n options\n )\n }\n\n /**\n * Get full details of a single listing, including its images.\n */\n async getById(id: string, options?: RequestOptions): Promise<Listing & { images: ListingImage[] }> {\n return this.client.get<Listing & { images: ListingImage[] }>(`/listings/${id}`, undefined, options)\n }\n\n /**\n * Create a new listing (requires seller role).\n */\n async create(input: CreateListingInput, options?: RequestOptions): Promise<Listing> {\n return this.client.post<Listing>('/listings', input, options)\n }\n\n /**\n * Update an existing listing.\n */\n async update(id: string, input: UpdateListingInput, options?: RequestOptions): Promise<Listing> {\n return this.client.put<Listing>(`/listings/${id}`, input, options)\n }\n\n /**\n * Change the status of a listing.\n */\n async updateStatus(id: string, status: ListingStatus, options?: RequestOptions): Promise<{ ok: boolean; status: ListingStatus }> {\n return this.client.patch<{ ok: boolean; status: ListingStatus }>(`/listings/${id}/status`, { status }, options)\n }\n\n /**\n * Soft delete a listing (sets status to 'removed').\n */\n async delete(id: string, options?: RequestOptions): Promise<{ ok: boolean }> {\n return this.client.delete<{ ok: boolean }>(`/listings/${id}`, options)\n }\n\n /**\n * Get a seller's public storefront.\n */\n async getSellerStorefront(\n sellerId: string,\n params?: { page?: number; page_size?: number },\n options?: RequestOptions\n ): Promise<SellerStorefront> {\n return this.client.get<SellerStorefront>(\n `/listings/seller/${sellerId}`, \n params as unknown as Record<string, string | number | boolean | undefined>,\n options\n )\n }\n\n /**\n * List all supported categories.\n */\n async getCategories(options?: RequestOptions): Promise<Category[]> {\n return this.client.get<Category[]>('/listings/categories', undefined, options)\n }\n\n /**\n * List all supported cities.\n */\n async getCities(options?: RequestOptions): Promise<City[]> {\n return this.client.get<City[]>('/listings/cities', undefined, options)\n }\n\n /**\n * Get a presigned upload URL for a listing image.\n * Index should be between 0 and 9.\n */\n async presignImage(listingId: string, index: number, options?: RequestOptions): Promise<PresignImageResponse> {\n return this.client.post<PresignImageResponse>(`/listings/${listingId}/images/presign`, { index }, options)\n }\n\n /**\n * Browse the listing feed (alias for getFeed with simplified params).\n */\n async feed(params?: { page?: number; city?: string; category?: string; sort?: string }, options?: RequestOptions): Promise<{ data: Listing[]; page: number }> {\n return this.client.get<{ data: Listing[]; page: number }>(\n '/listings',\n params as unknown as Record<string, string | number | boolean | undefined>,\n options\n )\n }\n\n /**\n * Get a single listing by ID (alias for getById).\n */\n async get(id: string, options?: RequestOptions): Promise<Listing & { images: ListingImage[] }> {\n return this.getById(id, options)\n }\n\n /**\n * Full-text search with filters.\n */\n async search(params: { q: string; category?: string; condition?: Condition; min_price?: number; max_price?: number; sort?: string; page?: number }, options?: RequestOptions): Promise<{ data: Listing[]; total: number }> {\n return this.client.get<{ data: Listing[]; total: number }>(\n '/search',\n params as unknown as Record<string, string | number | boolean | undefined>,\n options\n )\n }\n\n /**\n * Get similar listings for a given listing.\n */\n async getSimilar(listingId: string, mode?: 'global' | 'store', options?: RequestOptions): Promise<{ data: SimilarListing[] }> {\n return this.client.get<{ data: SimilarListing[] }>(\n `/listings/${listingId}/similar`,\n mode ? { mode } : undefined,\n options\n )\n }\n}\n","import { APIClient } from '../client'\nimport type { PaginatedResponse, SearchParams, SearchResult, SearchHistoryItem, SaveSearchInput, TrendingTerm, RequestOptions } from '../types'\n\nexport class SearchModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * Perform a full-text search with optional filters.\n */\n async query(params: SearchParams, options?: RequestOptions): Promise<PaginatedResponse<SearchResult>> {\n return this.client.get<PaginatedResponse<SearchResult>>(\n '/search', \n params as unknown as Record<string, string | number | boolean | undefined>,\n options\n )\n }\n\n /**\n * Get trending search terms.\n */\n async trending(params?: { city_id?: string }, options?: RequestOptions): Promise<{ terms: TrendingTerm[] }> {\n return this.client.get<{ terms: TrendingTerm[] }>(\n '/search/trending',\n params as unknown as Record<string, string | number | boolean | undefined>,\n options\n )\n }\n\n /**\n * Get the user's search history.\n */\n async getHistory(options?: RequestOptions): Promise<{ data: SearchHistoryItem[] }> {\n return this.client.get<{ data: SearchHistoryItem[] }>('/search/history', undefined, options)\n }\n\n /**\n * Save a search query to history.\n */\n async saveHistory(input: SaveSearchInput, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.post<{ ok: true }>('/search/history', input, options)\n }\n}\n","import { APIClient } from '../client'\nimport type { CreateOrderInput, Order, OrderEvent, OrderHistoryParams, OrderStatus, TransitionOrderInput, RequestOptions } from '../types'\n\nexport class OrdersModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * Create a new order from a listing.\n */\n async create(input: CreateOrderInput, options?: RequestOptions): Promise<{ order_id: string; total: number; delivery_fee: number }> {\n return this.client.post<{ order_id: string; total: number; delivery_fee: number }>('/orders', input, options)\n }\n\n /**\n * Get full details of an order, including its event timeline.\n */\n async getById(id: string, options?: RequestOptions): Promise<Order & { events: OrderEvent[] }> {\n return this.client.get<Order & { events: OrderEvent[] }>(`/orders/${id}`, undefined, options)\n }\n\n /**\n * Transition the status of an order.\n */\n async transition(id: string, input: TransitionOrderInput, options?: RequestOptions): Promise<{ ok: boolean; status: OrderStatus }> {\n return this.client.post<{ ok: boolean; status: OrderStatus }>(`/orders/${id}/transition`, input, options)\n }\n\n /**\n * Get the order history for the current authenticated user.\n */\n async getHistory(params?: OrderHistoryParams, options?: RequestOptions): Promise<{ data: Order[]; page: number; page_size: number }> {\n return this.client.get<{ data: Order[]; page: number; page_size: number }>(\n '/orders/history',\n params as unknown as Record<string, string | number | boolean | undefined>,\n options\n )\n }\n}\n","import { APIClient } from '../client'\nimport type { MpesaInput, PaystackInput, PaystackInitResponse, PaymentStatusResponse, StkPushInput, StkPushResponse, RequestOptions } from '../types'\n\nexport class PayModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * Initiate an M-Pesa STK Push payment for an order.\n */\n async initiateStk(input: StkPushInput, options?: RequestOptions): Promise<StkPushResponse> {\n return this.client.post<StkPushResponse>('/pay/stk', input, options)\n }\n\n /**\n * Initiate M-Pesa STK Push (alias for initiateStk).\n */\n async initMpesa(input: MpesaInput, options?: RequestOptions): Promise<StkPushResponse> {\n return this.client.post<StkPushResponse>('/pay/stk', input, options)\n }\n\n /**\n * Initiate a Paystack payment — returns access_code for inline popup.\n */\n async initPaystack(input: PaystackInput, options?: RequestOptions): Promise<PaystackInitResponse> {\n return this.client.post<PaystackInitResponse>('/pay/paystack/init', input, options)\n }\n\n /**\n * Poll for the current status of a payment by its order ID.\n */\n async getStatus(orderId: string, options?: RequestOptions): Promise<PaymentStatusResponse> {\n return this.client.get<PaymentStatusResponse>(`/pay/status/${orderId}`, undefined, options)\n }\n}\n","import { APIClient } from '../client'\nimport type { VAZIOutfit, VaziFeedParams, VaziFeedResponse, RequestOptions } from '../types'\n\nexport class VaziModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * Browse the AI-curated outfit feed.\n */\n async getFeed(params?: VaziFeedParams, options?: RequestOptions): Promise<VaziFeedResponse> {\n return this.client.get<VaziFeedResponse>(\n '/vazi/feed',\n params as unknown as Record<string, string | number | boolean | undefined>,\n options\n )\n }\n\n /**\n * Get a complete outfit built around a specific seed listing.\n */\n async getCompleteLook(listingId: string, options?: RequestOptions): Promise<{ outfits: VAZIOutfit[] }> {\n return this.client.get<{ outfits: VAZIOutfit[] }>(`/vazi/complete/${listingId}`, undefined, options)\n }\n}\n","import { APIClient } from '../client'\nimport type { Conversation, Message, SendMessageInput, RequestOptions } from '../types'\n\nexport class MessagesModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * List all conversations for the authenticated user.\n */\n async list(storeId?: string, options?: RequestOptions): Promise<{ data: Conversation[] }> {\n return this.client.get<{ data: Conversation[] }>(\n '/notify/messages',\n storeId ? { store_id: storeId } : undefined,\n options\n )\n }\n\n /**\n * Get the message thread with a specific partner.\n */\n async getThread(partnerId: string, storeId?: string, options?: RequestOptions): Promise<{ data: Message[] }> {\n return this.client.get<{ data: Message[] }>(\n `/notify/messages/${partnerId}`,\n storeId ? { store_id: storeId } : undefined,\n options\n )\n }\n\n /**\n * Send a message to another user.\n */\n async send(input: SendMessageInput, options?: RequestOptions): Promise<{ id: string }> {\n return this.client.post<{ id: string }>('/notify/messages', input, options)\n }\n}\n","import { APIClient } from '../client'\nimport type { Notification, RequestOptions } from '../types'\n\nexport class NotificationsModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * List paginated notifications with unread count.\n */\n async list(page?: number, options?: RequestOptions): Promise<{ data: Notification[]; unread_count: number; page: number }> {\n return this.client.get<{ data: Notification[]; unread_count: number; page: number }>(\n '/notify/notifications',\n page !== undefined ? { page } : undefined,\n options\n )\n }\n\n /**\n * Mark notifications as read. If ids omitted, marks all as read.\n */\n async markRead(ids?: string[], options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.post<{ ok: true }>('/notify/notifications/read', ids ? { ids } : {}, options)\n }\n}\n","import { APIClient } from '../client'\nimport type { Listing, Store, RequestOptions } from '../types'\n\nexport class StoresModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * Get a store by its URL slug.\n */\n async getBySlug(slug: string, options?: RequestOptions): Promise<Store> {\n return this.client.get<Store>(`/listings/stores/${slug}`, undefined, options)\n }\n\n /**\n * Follow a store.\n */\n async follow(storeId: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.post<{ ok: true }>(`/listings/stores/${storeId}/follow`, undefined, options)\n }\n\n /**\n * Unfollow a store.\n */\n async unfollow(storeId: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.delete<{ ok: true }>(`/listings/stores/${storeId}/follow`, options)\n }\n\n /**\n * Get paginated listings for a specific store.\n */\n async getListings(storeId: string, page?: number, options?: RequestOptions): Promise<{ data: Listing[] }> {\n return this.client.get<{ data: Listing[] }>(\n `/listings/stores/${storeId}/listings`,\n page !== undefined ? { page } : undefined,\n options\n )\n }\n}\n","import { APIClient } from '../client'\nimport type { CreateReviewInput, Review, RequestOptions } from '../types'\n\nexport class ReviewsModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * List reviews for a store (public).\n */\n async list(storeId: string, page?: number, options?: RequestOptions): Promise<{ data: Review[]; total: number; avg_rating: number; page: number }> {\n return this.client.get<{ data: Review[]; total: number; avg_rating: number; page: number }>(\n `/listings/stores/${storeId}/reviews`,\n page !== undefined ? { page } : undefined,\n options\n )\n }\n\n /**\n * Create a review for a store (authenticated).\n */\n async create(storeId: string, input: CreateReviewInput, options?: RequestOptions): Promise<{ id: string }> {\n return this.client.post<{ id: string }>(`/listings/stores/${storeId}/reviews`, input, options)\n }\n}\n","import { APIClient } from '../client'\nimport type { WishlistListing, RequestOptions } from '../types'\n\nexport class WishlistsModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * List saved listings.\n */\n async list(options?: RequestOptions): Promise<{ data: WishlistListing[] }> {\n return this.client.get<{ data: WishlistListing[] }>('/listings/wishlists', undefined, options)\n }\n\n /**\n * Add a listing to the wishlist.\n */\n async add(listingId: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.post<{ ok: true }>(`/listings/wishlists/${listingId}`, undefined, options)\n }\n\n /**\n * Remove a listing from the wishlist.\n */\n async remove(listingId: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.delete<{ ok: true }>(`/listings/wishlists/${listingId}`, options)\n }\n}\n","import { APIClient } from '../client'\nimport type { CartItem, RequestOptions } from '../types'\n\nexport class CartModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * List items in the cart.\n */\n async list(options?: RequestOptions): Promise<{ data: CartItem[] }> {\n return this.client.get<{ data: CartItem[] }>('/listings/cart', undefined, options)\n }\n\n /**\n * Add a listing to the cart.\n */\n async add(listingId: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.post<{ ok: true }>(`/listings/cart/${listingId}`, undefined, options)\n }\n\n /**\n * Remove a listing from the cart.\n */\n async remove(listingId: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.delete<{ ok: true }>(`/listings/cart/${listingId}`, options)\n }\n\n /**\n * Checkout the cart — creates orders grouped by store and clears the cart.\n */\n async checkout(options?: RequestOptions): Promise<{ order_ids: string[]; count: number }> {\n return this.client.post<{ order_ids: string[]; count: number }>('/orders/checkout', undefined, options)\n }\n}\n","import { APIClient } from '../client'\nimport type {\n UpdateProfileInput,\n ChangePasswordInput,\n Session,\n NotificationPref,\n Address,\n AddAddressInput,\n PaymentMethod,\n AddPaymentMethodInput,\n LinkedAccount,\n LinkedAccountProvider,\n UserProfile,\n RequestOptions,\n} from '../types'\n\nexport class SettingsModule {\n constructor(private readonly client: APIClient) {}\n\n // ── Profile ──\n\n async getProfile(options?: RequestOptions): Promise<UserProfile> {\n return this.client.get<UserProfile>('/auth/me', undefined, options)\n }\n\n async updateProfile(input: UpdateProfileInput, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.put<{ ok: true }>('/auth/me', input, options)\n }\n\n // ── Security ──\n\n async changePassword(input: ChangePasswordInput, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.post<{ ok: true }>('/auth/change-password', input, options)\n }\n\n async getSessions(options?: RequestOptions): Promise<{ data: Session[] }> {\n return this.client.get<{ data: Session[] }>('/auth/sessions', undefined, options)\n }\n\n async revokeSession(sessionId: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.delete<{ ok: true }>(`/auth/sessions/${sessionId}`, options)\n }\n\n // ── Notification Preferences ──\n\n async getNotificationPrefs(options?: RequestOptions): Promise<{ data: NotificationPref[] }> {\n return this.client.get<{ data: NotificationPref[] }>('/auth/notification-prefs', undefined, options)\n }\n\n async updateNotificationPref(channel: string, enabled: boolean, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.put<{ ok: true }>(`/auth/notification-prefs/${channel}`, { enabled }, options)\n }\n\n // ── Preferences ──\n\n async getPreferences(options?: RequestOptions): Promise<{ data: Record<string, string> }> {\n return this.client.get<{ data: Record<string, string> }>('/auth/preferences', undefined, options)\n }\n\n async updatePreferences(prefs: Record<string, string>, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.put<{ ok: true }>('/auth/preferences', { prefs }, options)\n }\n\n // ── Addresses ──\n\n async getAddresses(options?: RequestOptions): Promise<{ data: Address[] }> {\n return this.client.get<{ data: Address[] }>('/auth/addresses', undefined, options)\n }\n\n async addAddress(input: AddAddressInput, options?: RequestOptions): Promise<{ id: string }> {\n return this.client.post<{ id: string }>('/auth/addresses', input, options)\n }\n\n async updateAddress(id: string, input: Partial<AddAddressInput>, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.put<{ ok: true }>(`/auth/addresses/${id}`, input, options)\n }\n\n async deleteAddress(id: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.delete<{ ok: true }>(`/auth/addresses/${id}`, options)\n }\n\n async setDefaultAddress(id: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.post<{ ok: true }>(`/auth/addresses/${id}/default`, undefined, options)\n }\n\n // ── Payment Methods ──\n\n async getPaymentMethods(options?: RequestOptions): Promise<{ data: PaymentMethod[] }> {\n return this.client.get<{ data: PaymentMethod[] }>('/auth/payment-methods', undefined, options)\n }\n\n async addPaymentMethod(input: AddPaymentMethodInput, options?: RequestOptions): Promise<{ id: string }> {\n return this.client.post<{ id: string }>('/auth/payment-methods', input, options)\n }\n\n async deletePaymentMethod(id: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.delete<{ ok: true }>(`/auth/payment-methods/${id}`, options)\n }\n\n async setDefaultPaymentMethod(id: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.post<{ ok: true }>(`/auth/payment-methods/${id}/default`, undefined, options)\n }\n\n // ── Linked Accounts ──\n\n async getLinkedAccounts(options?: RequestOptions): Promise<{ data: LinkedAccount[] }> {\n return this.client.get<{ data: LinkedAccount[] }>('/auth/linked-accounts', undefined, options)\n }\n\n async linkAccount(provider: LinkedAccountProvider, token: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.post<{ ok: true }>('/auth/linked-accounts', { provider, token }, options)\n }\n\n async unlinkAccount(provider: LinkedAccountProvider, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.delete<{ ok: true }>(`/auth/linked-accounts/${provider}`, options)\n }\n}\n","export const CONDITIONS = ['new', 'like_new', 'good', 'fair'] as const\nexport type Condition = typeof CONDITIONS[number]\n\nexport const LISTING_STATUSES = ['draft', 'active', 'sold', 'removed'] as const\nexport type ListingStatus = typeof LISTING_STATUSES[number]\n\nexport interface ListingImage {\n id: string\n listing_id: string\n url: string\n position: number\n created_at: string\n}\n\nexport interface SellerProfile {\n id: string\n sti_score: number\n verification_status: string\n seller_type: 'individual' | 'bale'\n}\n\nexport interface Listing {\n id: string\n seller_id: string\n title: string\n description: string | null\n category_id: string\n city_id: string\n price: number // KES integer\n condition: Condition\n status: ListingStatus\n photo_verified: boolean\n vazi_eligible: boolean\n created_at: string\n updated_at: string\n // Seller profile (joined)\n sti_score: number\n verification_status: string\n seller_type: 'individual' | 'bale'\n // Images (only present on GET /listings/:id, not in feed)\n images?: ListingImage[]\n}\n\nexport interface ListingsFeedParams {\n city_id?: string\n category_id?: string\n min_price?: number\n max_price?: number\n condition?: Condition\n sort?: 'recency' | 'price_asc' | 'price_desc'\n page?: number\n page_size?: number\n}\n\nexport interface CreateListingInput {\n store_id: string\n title: string\n description?: string\n category_id: string\n city_id: string\n price: number\n condition: Condition\n vazi_eligible?: boolean\n}\n\nexport type UpdateListingInput = Partial<CreateListingInput>\n\nexport interface Category {\n id: string\n name: string\n slug: string\n}\n\nexport interface City {\n id: string\n name: string\n delivery_fee: number\n}\n\nexport interface SellerStorefront {\n seller: SellerProfile\n listings: Listing[]\n total: number\n page: number\n page_size: number\n has_more: boolean\n}\n\nexport interface PresignImageResponse {\n r2_key: string\n image_id: string\n}\n\nexport interface SimilarListing {\n id: string\n title: string\n price: number\n condition: string\n category_id: string\n store_id: string | null\n image_keys: string | null\n created_at: string\n}\n","export const ORDER_STATUSES = [\n 'created',\n 'payment_pending',\n 'paid',\n 'seller_confirmed',\n 'shipped',\n 'delivered',\n 'completed',\n 'cancelled',\n 'disputed',\n] as const\n\nexport type OrderStatus = typeof ORDER_STATUSES[number]\n\nexport interface OrderEvent {\n id: string\n order_id: string\n actor: string // user ID or 'system'\n old_status: string\n new_status: string\n note: string | null\n created_at: string\n}\n\nexport interface Order {\n id: string\n buyer_id: string\n seller_id: string\n listing_id: string\n amount: number\n delivery_fee: number\n total: number\n status: OrderStatus\n city_id: string\n created_at: string\n updated_at: string\n events?: OrderEvent[]\n}\n\nexport interface CreateOrderInput {\n listing_id: string\n}\n\nexport interface TransitionOrderInput {\n status: OrderStatus\n note?: string\n}\n\nexport interface OrderHistoryParams {\n role?: 'buyer' | 'seller'\n page?: number\n}\n","export interface StkPushInput {\n order_id: string\n phone: string // format: +254XXXXXXXXX\n}\n\nexport type MpesaInput = StkPushInput\n\nexport interface StkPushResponse {\n payment_id: string\n provider: string\n}\n\nexport interface PaystackInput {\n order_id: string\n email: string\n}\n\nexport interface PaystackInitResponse {\n access_code: string\n authorization_url: string\n reference: string\n}\n\nexport const PAYMENT_STATUSES = ['initiated', 'funded', 'failed', 'refunded', 'cancelled'] as const\nexport type PaymentStatus = typeof PAYMENT_STATUSES[number]\n\nexport interface PaymentStatusResponse {\n id: string\n status: PaymentStatus\n total: number\n}\n","export const GARMENT_TYPES = [\n 'top',\n 'bottom',\n 'shoes',\n 'accessory',\n 'dress',\n 'outerwear',\n 'bag',\n 'kids',\n] as const\n\nexport type GarmentType = typeof GARMENT_TYPES[number]\n\nexport interface VAZIOutfitItem {\n listing_id: string\n garment_type: GarmentType\n price_kes: number\n seller_id: string\n seller_sti: number\n seller_city: string\n image_url: string | null\n is_seed: boolean\n final_score: number\n}\n\nexport interface VAZIOutfit {\n id: string\n name: string\n items: VAZIOutfitItem[]\n total_price_kes: number\n sellers_count: number\n is_multi_city: boolean\n assembled_at: string // ISO timestamp\n}\n\nexport interface VaziFeedParams {\n limit?: number\n offset?: number\n}\n\nexport interface VaziFeedResponse {\n outfits: VAZIOutfit[]\n total: number\n limit: number\n offset: number\n}\n","import { APIClient } from './client'\nimport { MitumbaClientConfig } from './types'\nimport { AuthModule } from './modules/auth'\nimport { ListingsModule } from './modules/listings'\nimport { SearchModule } from './modules/search'\nimport { OrdersModule } from './modules/orders'\nimport { PayModule } from './modules/pay'\nimport { VaziModule } from './modules/vazi'\nimport { MessagesModule } from './modules/messages'\nimport { NotificationsModule } from './modules/notifications'\nimport { StoresModule } from './modules/stores'\nimport { ReviewsModule } from './modules/reviews'\nimport { WishlistsModule } from './modules/wishlists'\nimport { CartModule } from './modules/cart'\nimport { SettingsModule } from './modules/settings'\n\nexport class MitumbaClient {\n public readonly api: APIClient\n public readonly auth: AuthModule\n public readonly listings: ListingsModule\n public readonly search: SearchModule\n public readonly orders: OrdersModule\n public readonly pay: PayModule\n public readonly vazi: VaziModule\n public readonly messages: MessagesModule\n public readonly notifications: NotificationsModule\n public readonly stores: StoresModule\n public readonly reviews: ReviewsModule\n public readonly wishlists: WishlistsModule\n public readonly cart: CartModule\n public readonly settings: SettingsModule\n\n constructor(config: MitumbaClientConfig) {\n this.api = new APIClient(config)\n this.auth = new AuthModule(this.api)\n this.listings = new ListingsModule(this.api)\n this.search = new SearchModule(this.api)\n this.orders = new OrdersModule(this.api)\n this.pay = new PayModule(this.api)\n this.vazi = new VaziModule(this.api)\n this.messages = new MessagesModule(this.api)\n this.notifications = new NotificationsModule(this.api)\n this.stores = new StoresModule(this.api)\n this.reviews = new ReviewsModule(this.api)\n this.wishlists = new WishlistsModule(this.api)\n this.cart = new CartModule(this.api)\n this.settings = new SettingsModule(this.api)\n }\n\n /**\n * Set the access token for authenticated requests.\n * Optionally pass a refresh token to enable automatic token rotation.\n */\n public setToken(token: string, refreshToken?: string) {\n this.api.setToken(token, refreshToken)\n }\n\n /**\n * Get the current access token.\n */\n public getToken(): string | undefined {\n return this.api.getToken()\n }\n\n /**\n * Clear the current tokens.\n */\n public clearToken() {\n this.api.clearToken()\n }\n}\n\nexport * from './types'\nexport { APIClient, APIError } from './client'\nexport { AuthModule } from './modules/auth'\nexport { ListingsModule } from './modules/listings'\nexport { SearchModule } from './modules/search'\nexport { OrdersModule } from './modules/orders'\nexport { PayModule } from './modules/pay'\nexport { VaziModule } from './modules/vazi'\nexport { MessagesModule } from './modules/messages'\nexport { NotificationsModule } from './modules/notifications'\nexport { StoresModule } from './modules/stores'\nexport { ReviewsModule } from './modules/reviews'\nexport { WishlistsModule } from './modules/wishlists'\nexport { CartModule } from './modules/cart'\nexport { SettingsModule } from './modules/settings'\n"]}
|
package/dist/index.mjs
CHANGED
|
@@ -651,6 +651,84 @@ var CartModule = class {
|
|
|
651
651
|
}
|
|
652
652
|
};
|
|
653
653
|
|
|
654
|
+
// src/modules/settings.ts
|
|
655
|
+
var SettingsModule = class {
|
|
656
|
+
constructor(client) {
|
|
657
|
+
this.client = client;
|
|
658
|
+
}
|
|
659
|
+
client;
|
|
660
|
+
// ── Profile ──
|
|
661
|
+
async getProfile(options) {
|
|
662
|
+
return this.client.get("/auth/me", void 0, options);
|
|
663
|
+
}
|
|
664
|
+
async updateProfile(input, options) {
|
|
665
|
+
return this.client.put("/auth/me", input, options);
|
|
666
|
+
}
|
|
667
|
+
// ── Security ──
|
|
668
|
+
async changePassword(input, options) {
|
|
669
|
+
return this.client.post("/auth/change-password", input, options);
|
|
670
|
+
}
|
|
671
|
+
async getSessions(options) {
|
|
672
|
+
return this.client.get("/auth/sessions", void 0, options);
|
|
673
|
+
}
|
|
674
|
+
async revokeSession(sessionId, options) {
|
|
675
|
+
return this.client.delete(`/auth/sessions/${sessionId}`, options);
|
|
676
|
+
}
|
|
677
|
+
// ── Notification Preferences ──
|
|
678
|
+
async getNotificationPrefs(options) {
|
|
679
|
+
return this.client.get("/auth/notification-prefs", void 0, options);
|
|
680
|
+
}
|
|
681
|
+
async updateNotificationPref(channel, enabled, options) {
|
|
682
|
+
return this.client.put(`/auth/notification-prefs/${channel}`, { enabled }, options);
|
|
683
|
+
}
|
|
684
|
+
// ── Preferences ──
|
|
685
|
+
async getPreferences(options) {
|
|
686
|
+
return this.client.get("/auth/preferences", void 0, options);
|
|
687
|
+
}
|
|
688
|
+
async updatePreferences(prefs, options) {
|
|
689
|
+
return this.client.put("/auth/preferences", { prefs }, options);
|
|
690
|
+
}
|
|
691
|
+
// ── Addresses ──
|
|
692
|
+
async getAddresses(options) {
|
|
693
|
+
return this.client.get("/auth/addresses", void 0, options);
|
|
694
|
+
}
|
|
695
|
+
async addAddress(input, options) {
|
|
696
|
+
return this.client.post("/auth/addresses", input, options);
|
|
697
|
+
}
|
|
698
|
+
async updateAddress(id, input, options) {
|
|
699
|
+
return this.client.put(`/auth/addresses/${id}`, input, options);
|
|
700
|
+
}
|
|
701
|
+
async deleteAddress(id, options) {
|
|
702
|
+
return this.client.delete(`/auth/addresses/${id}`, options);
|
|
703
|
+
}
|
|
704
|
+
async setDefaultAddress(id, options) {
|
|
705
|
+
return this.client.post(`/auth/addresses/${id}/default`, void 0, options);
|
|
706
|
+
}
|
|
707
|
+
// ── Payment Methods ──
|
|
708
|
+
async getPaymentMethods(options) {
|
|
709
|
+
return this.client.get("/auth/payment-methods", void 0, options);
|
|
710
|
+
}
|
|
711
|
+
async addPaymentMethod(input, options) {
|
|
712
|
+
return this.client.post("/auth/payment-methods", input, options);
|
|
713
|
+
}
|
|
714
|
+
async deletePaymentMethod(id, options) {
|
|
715
|
+
return this.client.delete(`/auth/payment-methods/${id}`, options);
|
|
716
|
+
}
|
|
717
|
+
async setDefaultPaymentMethod(id, options) {
|
|
718
|
+
return this.client.post(`/auth/payment-methods/${id}/default`, void 0, options);
|
|
719
|
+
}
|
|
720
|
+
// ── Linked Accounts ──
|
|
721
|
+
async getLinkedAccounts(options) {
|
|
722
|
+
return this.client.get("/auth/linked-accounts", void 0, options);
|
|
723
|
+
}
|
|
724
|
+
async linkAccount(provider, token, options) {
|
|
725
|
+
return this.client.post("/auth/linked-accounts", { provider, token }, options);
|
|
726
|
+
}
|
|
727
|
+
async unlinkAccount(provider, options) {
|
|
728
|
+
return this.client.delete(`/auth/linked-accounts/${provider}`, options);
|
|
729
|
+
}
|
|
730
|
+
};
|
|
731
|
+
|
|
654
732
|
// src/types/listings.ts
|
|
655
733
|
var CONDITIONS = ["new", "like_new", "good", "fair"];
|
|
656
734
|
var LISTING_STATUSES = ["draft", "active", "sold", "removed"];
|
|
@@ -698,6 +776,7 @@ var MitumbaClient = class {
|
|
|
698
776
|
reviews;
|
|
699
777
|
wishlists;
|
|
700
778
|
cart;
|
|
779
|
+
settings;
|
|
701
780
|
constructor(config) {
|
|
702
781
|
this.api = new APIClient(config);
|
|
703
782
|
this.auth = new AuthModule(this.api);
|
|
@@ -712,6 +791,7 @@ var MitumbaClient = class {
|
|
|
712
791
|
this.reviews = new ReviewsModule(this.api);
|
|
713
792
|
this.wishlists = new WishlistsModule(this.api);
|
|
714
793
|
this.cart = new CartModule(this.api);
|
|
794
|
+
this.settings = new SettingsModule(this.api);
|
|
715
795
|
}
|
|
716
796
|
/**
|
|
717
797
|
* Set the access token for authenticated requests.
|
|
@@ -734,6 +814,6 @@ var MitumbaClient = class {
|
|
|
734
814
|
}
|
|
735
815
|
};
|
|
736
816
|
|
|
737
|
-
export { APIClient, APIError, AuthModule, CONDITIONS, CartModule, GARMENT_TYPES, LISTING_STATUSES, ListingsModule, MessagesModule, MitumbaClient, NotificationsModule, ORDER_STATUSES, OrdersModule, PAYMENT_STATUSES, PayModule, ReviewsModule, SearchModule, StoresModule, VaziModule, WishlistsModule };
|
|
817
|
+
export { APIClient, APIError, AuthModule, CONDITIONS, CartModule, GARMENT_TYPES, LISTING_STATUSES, ListingsModule, MessagesModule, MitumbaClient, NotificationsModule, ORDER_STATUSES, OrdersModule, PAYMENT_STATUSES, PayModule, ReviewsModule, SearchModule, SettingsModule, StoresModule, VaziModule, WishlistsModule };
|
|
738
818
|
//# sourceMappingURL=index.mjs.map
|
|
739
819
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/client.ts","../src/modules/auth.ts","../src/modules/listings.ts","../src/modules/search.ts","../src/modules/orders.ts","../src/modules/pay.ts","../src/modules/vazi.ts","../src/modules/messages.ts","../src/modules/notifications.ts","../src/modules/stores.ts","../src/modules/reviews.ts","../src/modules/wishlists.ts","../src/modules/cart.ts","../src/types/listings.ts","../src/types/orders.ts","../src/types/pay.ts","../src/types/vazi.ts","../src/index.ts"],"names":[],"mappings":";AAEO,IAAM,QAAA,GAAN,cAAuB,KAAA,CAAM;AAAA,EAClB,IAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EAEhB,WAAA,CAAY,QAAgB,IAAA,EAAwB;AAClD,IAAA,KAAA,CAAM,IAAA,CAAK,OAAA,IAAW,IAAA,CAAK,KAAK,CAAA;AAChC,IAAA,IAAA,CAAK,IAAA,GAAO,UAAA;AACZ,IAAA,IAAA,CAAK,OAAO,IAAA,CAAK,KAAA;AACjB,IAAA,IAAA,CAAK,MAAA,GAAS,MAAA;AACd,IAAA,IAAA,CAAK,UAAU,IAAA,CAAK,OAAA;AAAA,EACtB;AACF;AAEO,IAAM,YAAN,MAAgB;AAAA,EACb,MAAA;AAAA,EACA,YAAA,GAAe,KAAA;AAAA,EACf,cAAA,GAAuC,IAAA;AAAA,EAE/C,YAAY,MAAA,EAA6B;AACvC,IAAA,IAAA,CAAK,MAAA,GAAS,MAAA;AAAA,EAChB;AAAA,EAEO,QAAA,CAAS,OAAe,YAAA,EAAuB;AACpD,IAAA,IAAA,CAAK,OAAO,KAAA,GAAQ,KAAA;AACpB,IAAA,IAAI,YAAA,EAAc;AAChB,MAAA,IAAA,CAAK,OAAO,YAAA,GAAe,YAAA;AAAA,IAC7B;AAAA,EACF;AAAA,EAEO,QAAA,GAA+B;AACpC,IAAA,OAAO,KAAK,M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ponse, RequestOptions } from './types'\n\nexport class APIError extends Error {\n public readonly code: string\n public readonly status: number\n public readonly details?: unknown\n\n constructor(status: number, data: APIErrorResponse) {\n super(data.message || data.error)\n this.name = 'APIError'\n this.code = data.error\n this.status = status\n this.details = data.details\n }\n}\n\nexport class APIClient {\n private config: MitumbaClientConfig\n private isRefreshing = false\n private refreshPromise: Promise<void> | null = null\n\n constructor(config: MitumbaClientConfig) {\n this.config = config\n }\n\n public setToken(token: string, refreshToken?: string) {\n this.config.token = token\n if (refreshToken) {\n this.config.refreshToken = refreshToken\n }\n }\n\n public getToken(): string | undefined {\n return this.config.token\n }\n\n public clearToken() {\n this.config.token = undefined\n this.config.refreshToken = undefined\n }\n\n private async request<T>(\n method: string, \n path: string, \n body?: unknown, \n params?: Record<string, string | number | boolean | undefined>,\n options?: RequestOptions\n ): Promise<T> {\n const url = new URL(path, this.config.baseUrl)\n \n if (params) {\n for (const [key, value] of Object.entries(params)) {\n if (value !== undefined) {\n url.searchParams.append(key, String(value))\n }\n }\n }\n\n const headers = new Headers()\n if (body && !(body instanceof FormData)) {\n headers.set('Content-Type', 'application/json')\n }\n\n if (this.config.token) {\n headers.set('Authorization', `Bearer ${this.config.token}`)\n }\n\n const init: RequestInit = {\n method,\n headers,\n body: body instanceof FormData ? body : body ? JSON.stringify(body) : undefined,\n signal: options?.signal\n }\n\n const maxRetries = this.config.maxRetries ?? 3\n let attempt = 0\n let response: Response\n\n while (true) {\n if (this.config.debug) {\n console.log(`[Mitumba SDK] ${method} ${url.toString()}`)\n }\n \n const startTime = Date.now()\n try {\n response = await fetch(url.toString(), init)\n } catch (err) {\n if (err instanceof Error && err.name === 'AbortError') {\n throw err\n }\n if (attempt < maxRetries) {\n attempt++\n if (this.config.debug) {\n console.log(`[Mitumba SDK] Network error. Retrying ${method} ${url.toString()} (attempt ${attempt})`)\n }\n await new Promise(resolve => setTimeout(resolve, Math.pow(2, attempt) * 100))\n continue\n }\n throw new APIError(0, { error: 'network_error', message: err instanceof Error ? err.message : 'Network request failed' })\n }\n\n if (this.config.debug) {\n console.log(`[Mitumba SDK] ${method} ${url.toString()} - ${response.status} (${Date.now() - startTime}ms)`)\n }\n\n if (response.status >= 500 && attempt < maxRetries) {\n attempt++\n if (this.config.debug) {\n console.log(`[Mitumba SDK] ${response.status} error. Retrying ${method} ${url.toString()} (attempt ${attempt})`)\n }\n await new Promise(resolve => setTimeout(resolve, Math.pow(2, attempt) * 100))\n continue\n }\n\n break\n }\n\n // Handle automatic token refresh\n if (response.status === 401 && this.config.refreshToken && !path.includes('/auth/refresh')) {\n await this.handleTokenRefresh()\n // Retry request with new token\n headers.set('Authorization', `Bearer ${this.config.token}`)\n response = await fetch(url.toString(), { ...init, headers })\n }\n\n if (!response.ok) {\n let errorData: APIErrorResponse\n try {\n errorData = await response.json()\n } catch {\n errorData = { error: 'unknown_error', message: response.statusText }\n }\n throw new APIError(response.status, errorData)\n }\n\n if (response.status === 204) {\n return undefined as unknown as T\n }\n\n return response.json() as Promise<T>\n }\n\n private async handleTokenRefresh(): Promise<void> {\n if (this.isRefreshing && this.refreshPromise) {\n return this.refreshPromise\n }\n\n this.isRefreshing = true\n this.refreshPromise = (async () => {\n try {\n const url = new URL('/auth/refresh', this.config.baseUrl)\n const response = await fetch(url.toString(), {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ refresh_token: this.config.refreshToken }),\n })\n\n if (!response.ok) {\n throw new Error('Refresh failed')\n }\n\n const data = await response.json() as { access_token: string, refresh_token: string }\n this.setToken(data.access_token, data.refresh_token)\n\n if (this.config.onTokenRefresh) {\n this.config.onTokenRefresh({ token: data.access_token, refreshToken: data.refresh_token })\n }\n } catch (err) {\n this.clearToken()\n throw new APIError(401, { error: 'token_expired', message: 'Session expired. Please log in again.' })\n } finally {\n this.isRefreshing = false\n this.refreshPromise = null\n }\n })()\n\n return this.refreshPromise\n }\n\n public get<T>(path: string, params?: Record<string, string | number | boolean | undefined>, options?: RequestOptions): Promise<T> {\n return this.request<T>('GET', path, undefined, params, options)\n }\n\n public post<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T> {\n return this.request<T>('POST', path, body, undefined, options)\n }\n\n public put<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T> {\n return this.request<T>('PUT', path, body, undefined, options)\n }\n\n public patch<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T> {\n return this.request<T>('PATCH', path, body, undefined, options)\n }\n\n public delete<T>(path: string, options?: RequestOptions): Promise<T> {\n return this.request<T>('DELETE', path, undefined, undefined, options)\n }\n}\n","import { APIClient } from '../client'\nimport type {\n RegisterInput,\n LoginInput,\n SendOtpInput,\n VerifyOtpInput,\n ForgotPasswordInput,\n ResetPasswordInput,\n CompleteOnboardingInput,\n UserProfile,\n AuthTokens,\n MessageResponse,\n RequestOptions,\n} from '../types'\n\nexport class AuthModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * Register a new account.\n * If using EmailRegisterInput, returns AuthTokens.\n * If using PhoneRegisterInput, returns MessageResponse (OTP sent).\n */\n async register(input: RegisterInput, options?: RequestOptions): Promise<AuthTokens | MessageResponse> {\n return this.client.post<AuthTokens | MessageResponse>('/auth/register', input, options)\n }\n\n /**\n * Log in to an existing account.\n * If using EmailLoginInput, returns AuthTokens.\n * If using PhoneLoginInput, returns MessageResponse (OTP sent).\n */\n async login(input: LoginInput, options?: RequestOptions): Promise<AuthTokens | MessageResponse> {\n return this.client.post<AuthTokens | MessageResponse>('/auth/login', input, options)\n }\n\n /**\n * Send an OTP code to a phone number.\n */\n async sendOtp(input: SendOtpInput, options?: RequestOptions): Promise<MessageResponse> {\n return this.client.post<MessageResponse>('/auth/otp/send', input, options)\n }\n\n /**\n * Verify an OTP code.\n */\n async verifyOtp(input: VerifyOtpInput, options?: RequestOptions): Promise<AuthTokens> {\n return this.client.post<AuthTokens>('/auth/otp/verify', input, options)\n }\n\n /**\n * Refresh the access token using a refresh token.\n */\n async refresh(input: { refresh_token: string }, options?: RequestOptions): Promise<AuthTokens> {\n return this.client.post<AuthTokens>('/auth/refresh', input, options)\n }\n\n /**\n * Revoke the refresh token and log out.\n */\n async logout(input: { refresh_token: string }, options?: RequestOptions): Promise<{ ok: boolean }> {\n return this.client.post<{ ok: boolean }>('/auth/logout', input, options)\n }\n\n /**\n * Request a password reset email.\n * Sends a reset link to the provided email address.\n */\n async forgotPassword(input: ForgotPasswordInput, options?: RequestOptions): Promise<MessageResponse> {\n return this.client.post<MessageResponse>('/auth/forgot-password', input, options)\n }\n\n /**\n * Reset the password using a token from the reset email.\n */\n async resetPassword(input: ResetPasswordInput, options?: RequestOptions): Promise<MessageResponse> {\n return this.client.post<MessageResponse>('/auth/reset-password', input, options)\n }\n\n /**\n * Get the current authenticated user's profile.\n */\n async me(options?: RequestOptions): Promise<UserProfile> {\n return this.client.get<UserProfile>('/auth/me', undefined, options)\n }\n\n /**\n * Complete the onboarding flow.\n */\n async completeOnboarding(input: CompleteOnboardingInput, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.post<{ ok: true }>('/auth/onboarding/complete', input, options)\n }\n}\n","import { APIClient } from '../client'\nimport type {\n Category,\n City,\n Condition,\n CreateListingInput,\n Listing,\n ListingImage,\n ListingStatus,\n ListingsFeedParams,\n PaginatedResponse,\n PresignImageResponse,\n SellerStorefront,\n SimilarListing,\n UpdateListingInput,\n RequestOptions,\n} from '../types'\n\nexport class ListingsModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * Browse the marketplace feed with optional filters.\n */\n async getFeed(params?: ListingsFeedParams, options?: RequestOptions): Promise<PaginatedResponse<Listing>> {\n // APIClient handles converting params to string|number|boolean properly\n return this.client.get<PaginatedResponse<Listing>>(\n '/listings/feed', \n params as unknown as Record<string, string | number | boolean | undefined>,\n options\n )\n }\n\n /**\n * Get full details of a single listing, including its images.\n */\n async getById(id: string, options?: RequestOptions): Promise<Listing & { images: ListingImage[] }> {\n return this.client.get<Listing & { images: ListingImage[] }>(`/listings/${id}`, undefined, options)\n }\n\n /**\n * Create a new listing (requires seller role).\n */\n async create(input: CreateListingInput, options?: RequestOptions): Promise<Listing> {\n return this.client.post<Listing>('/listings', input, options)\n }\n\n /**\n * Update an existing listing.\n */\n async update(id: string, input: UpdateListingInput, options?: RequestOptions): Promise<Listing> {\n return this.client.put<Listing>(`/listings/${id}`, input, options)\n }\n\n /**\n * Change the status of a listing.\n */\n async updateStatus(id: string, status: ListingStatus, options?: RequestOptions): Promise<{ ok: boolean; status: ListingStatus }> {\n return this.client.patch<{ ok: boolean; status: ListingStatus }>(`/listings/${id}/status`, { status }, options)\n }\n\n /**\n * Soft delete a listing (sets status to 'removed').\n */\n async delete(id: string, options?: RequestOptions): Promise<{ ok: boolean }> {\n return this.client.delete<{ ok: boolean }>(`/listings/${id}`, options)\n }\n\n /**\n * Get a seller's public storefront.\n */\n async getSellerStorefront(\n sellerId: string,\n params?: { page?: number; page_size?: number },\n options?: RequestOptions\n ): Promise<SellerStorefront> {\n return this.client.get<SellerStorefront>(\n `/listings/seller/${sellerId}`, \n params as unknown as Record<string, string | number | boolean | undefined>,\n options\n )\n }\n\n /**\n * List all supported categories.\n */\n async getCategories(options?: RequestOptions): Promise<Category[]> {\n return this.client.get<Category[]>('/listings/categories', undefined, options)\n }\n\n /**\n * List all supported cities.\n */\n async getCities(options?: RequestOptions): Promise<City[]> {\n return this.client.get<City[]>('/listings/cities', undefined, options)\n }\n\n /**\n * Get a presigned upload URL for a listing image.\n * Index should be between 0 and 9.\n */\n async presignImage(listingId: string, index: number, options?: RequestOptions): Promise<PresignImageResponse> {\n return this.client.post<PresignImageResponse>(`/listings/${listingId}/images/presign`, { index }, options)\n }\n\n /**\n * Browse the listing feed (alias for getFeed with simplified params).\n */\n async feed(params?: { page?: number; city?: string; category?: string; sort?: string }, options?: RequestOptions): Promise<{ data: Listing[]; page: number }> {\n return this.client.get<{ data: Listing[]; page: number }>(\n '/listings',\n params as unknown as Record<string, string | number | boolean | undefined>,\n options\n )\n }\n\n /**\n * Get a single listing by ID (alias for getById).\n */\n async get(id: string, options?: RequestOptions): Promise<Listing & { images: ListingImage[] }> {\n return this.getById(id, options)\n }\n\n /**\n * Full-text search with filters.\n */\n async search(params: { q: string; category?: string; condition?: Condition; min_price?: number; max_price?: number; sort?: string; page?: number }, options?: RequestOptions): Promise<{ data: Listing[]; total: number }> {\n return this.client.get<{ data: Listing[]; total: number }>(\n '/search',\n params as unknown as Record<string, string | number | boolean | undefined>,\n options\n )\n }\n\n /**\n * Get similar listings for a given listing.\n */\n async getSimilar(listingId: string, mode?: 'global' | 'store', options?: RequestOptions): Promise<{ data: SimilarListing[] }> {\n return this.client.get<{ data: SimilarListing[] }>(\n `/listings/${listingId}/similar`,\n mode ? { mode } : undefined,\n options\n )\n }\n}\n","import { APIClient } from '../client'\nimport type { PaginatedResponse, SearchParams, SearchResult, SearchHistoryItem, SaveSearchInput, TrendingTerm, RequestOptions } from '../types'\n\nexport class SearchModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * Perform a full-text search with optional filters.\n */\n async query(params: SearchParams, options?: RequestOptions): Promise<PaginatedResponse<SearchResult>> {\n return this.client.get<PaginatedResponse<SearchResult>>(\n '/search', \n params as unknown as Record<string, string | number | boolean | undefined>,\n options\n )\n }\n\n /**\n * Get trending search terms.\n */\n async trending(params?: { city_id?: string }, options?: RequestOptions): Promise<{ terms: TrendingTerm[] }> {\n return this.client.get<{ terms: TrendingTerm[] }>(\n '/search/trending',\n params as unknown as Record<string, string | number | boolean | undefined>,\n options\n )\n }\n\n /**\n * Get the user's search history.\n */\n async getHistory(options?: RequestOptions): Promise<{ data: SearchHistoryItem[] }> {\n return this.client.get<{ data: SearchHistoryItem[] }>('/search/history', undefined, options)\n }\n\n /**\n * Save a search query to history.\n */\n async saveHistory(input: SaveSearchInput, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.post<{ ok: true }>('/search/history', input, options)\n }\n}\n","import { APIClient } from '../client'\nimport type { CreateOrderInput, Order, OrderEvent, OrderHistoryParams, OrderStatus, TransitionOrderInput, RequestOptions } from '../types'\n\nexport class OrdersModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * Create a new order from a listing.\n */\n async create(input: CreateOrderInput, options?: RequestOptions): Promise<{ order_id: string; total: number; delivery_fee: number }> {\n return this.client.post<{ order_id: string; total: number; delivery_fee: number }>('/orders', input, options)\n }\n\n /**\n * Get full details of an order, including its event timeline.\n */\n async getById(id: string, options?: RequestOptions): Promise<Order & { events: OrderEvent[] }> {\n return this.client.get<Order & { events: OrderEvent[] }>(`/orders/${id}`, undefined, options)\n }\n\n /**\n * Transition the status of an order.\n */\n async transition(id: string, input: TransitionOrderInput, options?: RequestOptions): Promise<{ ok: boolean; status: OrderStatus }> {\n return this.client.post<{ ok: boolean; status: OrderStatus }>(`/orders/${id}/transition`, input, options)\n }\n\n /**\n * Get the order history for the current authenticated user.\n */\n async getHistory(params?: OrderHistoryParams, options?: RequestOptions): Promise<{ data: Order[]; page: number; page_size: number }> {\n return this.client.get<{ data: Order[]; page: number; page_size: number }>(\n '/orders/history',\n params as unknown as Record<string, string | number | boolean | undefined>,\n options\n )\n }\n}\n","import { APIClient } from '../client'\nimport type { MpesaInput, PaystackInput, PaystackInitResponse, PaymentStatusResponse, StkPushInput, StkPushResponse, RequestOptions } from '../types'\n\nexport class PayModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * Initiate an M-Pesa STK Push payment for an order.\n */\n async initiateStk(input: StkPushInput, options?: RequestOptions): Promise<StkPushResponse> {\n return this.client.post<StkPushResponse>('/pay/stk', input, options)\n }\n\n /**\n * Initiate M-Pesa STK Push (alias for initiateStk).\n */\n async initMpesa(input: MpesaInput, options?: RequestOptions): Promise<StkPushResponse> {\n return this.client.post<StkPushResponse>('/pay/stk', input, options)\n }\n\n /**\n * Initiate a Paystack payment — returns access_code for inline popup.\n */\n async initPaystack(input: PaystackInput, options?: RequestOptions): Promise<PaystackInitResponse> {\n return this.client.post<PaystackInitResponse>('/pay/paystack/init', input, options)\n }\n\n /**\n * Poll for the current status of a payment by its order ID.\n */\n async getStatus(orderId: string, options?: RequestOptions): Promise<PaymentStatusResponse> {\n return this.client.get<PaymentStatusResponse>(`/pay/status/${orderId}`, undefined, options)\n }\n}\n","import { APIClient } from '../client'\nimport type { VAZIOutfit, VaziFeedParams, VaziFeedResponse, RequestOptions } from '../types'\n\nexport class VaziModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * Browse the AI-curated outfit feed.\n */\n async getFeed(params?: VaziFeedParams, options?: RequestOptions): Promise<VaziFeedResponse> {\n return this.client.get<VaziFeedResponse>(\n '/vazi/feed',\n params as unknown as Record<string, string | number | boolean | undefined>,\n options\n )\n }\n\n /**\n * Get a complete outfit built around a specific seed listing.\n */\n async getCompleteLook(listingId: string, options?: RequestOptions): Promise<{ outfits: VAZIOutfit[] }> {\n return this.client.get<{ outfits: VAZIOutfit[] }>(`/vazi/complete/${listingId}`, undefined, options)\n }\n}\n","import { APIClient } from '../client'\nimport type { Conversation, Message, SendMessageInput, RequestOptions } from '../types'\n\nexport class MessagesModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * List all conversations for the authenticated user.\n */\n async list(storeId?: string, options?: RequestOptions): Promise<{ data: Conversation[] }> {\n return this.client.get<{ data: Conversation[] }>(\n '/notify/messages',\n storeId ? { store_id: storeId } : undefined,\n options\n )\n }\n\n /**\n * Get the message thread with a specific partner.\n */\n async getThread(partnerId: string, storeId?: string, options?: RequestOptions): Promise<{ data: Message[] }> {\n return this.client.get<{ data: Message[] }>(\n `/notify/messages/${partnerId}`,\n storeId ? { store_id: storeId } : undefined,\n options\n )\n }\n\n /**\n * Send a message to another user.\n */\n async send(input: SendMessageInput, options?: RequestOptions): Promise<{ id: string }> {\n return this.client.post<{ id: string }>('/notify/messages', input, options)\n }\n}\n","import { APIClient } from '../client'\nimport type { Notification, RequestOptions } from '../types'\n\nexport class NotificationsModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * List paginated notifications with unread count.\n */\n async list(page?: number, options?: RequestOptions): Promise<{ data: Notification[]; unread_count: number; page: number }> {\n return this.client.get<{ data: Notification[]; unread_count: number; page: number }>(\n '/notify/notifications',\n page !== undefined ? { page } : undefined,\n options\n )\n }\n\n /**\n * Mark notifications as read. If ids omitted, marks all as read.\n */\n async markRead(ids?: string[], options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.post<{ ok: true }>('/notify/notifications/read', ids ? { ids } : {}, options)\n }\n}\n","import { APIClient } from '../client'\nimport type { Listing, Store, RequestOptions } from '../types'\n\nexport class StoresModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * Get a store by its URL slug.\n */\n async getBySlug(slug: string, options?: RequestOptions): Promise<Store> {\n return this.client.get<Store>(`/listings/stores/${slug}`, undefined, options)\n }\n\n /**\n * Follow a store.\n */\n async follow(storeId: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.post<{ ok: true }>(`/listings/stores/${storeId}/follow`, undefined, options)\n }\n\n /**\n * Unfollow a store.\n */\n async unfollow(storeId: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.delete<{ ok: true }>(`/listings/stores/${storeId}/follow`, options)\n }\n\n /**\n * Get paginated listings for a specific store.\n */\n async getListings(storeId: string, page?: number, options?: RequestOptions): Promise<{ data: Listing[] }> {\n return this.client.get<{ data: Listing[] }>(\n `/listings/stores/${storeId}/listings`,\n page !== undefined ? { page } : undefined,\n options\n )\n }\n}\n","import { APIClient } from '../client'\nimport type { CreateReviewInput, Review, RequestOptions } from '../types'\n\nexport class ReviewsModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * List reviews for a store (public).\n */\n async list(storeId: string, page?: number, options?: RequestOptions): Promise<{ data: Review[]; total: number; avg_rating: number; page: number }> {\n return this.client.get<{ data: Review[]; total: number; avg_rating: number; page: number }>(\n `/listings/stores/${storeId}/reviews`,\n page !== undefined ? { page } : undefined,\n options\n )\n }\n\n /**\n * Create a review for a store (authenticated).\n */\n async create(storeId: string, input: CreateReviewInput, options?: RequestOptions): Promise<{ id: string }> {\n return this.client.post<{ id: string }>(`/listings/stores/${storeId}/reviews`, input, options)\n }\n}\n","import { APIClient } from '../client'\nimport type { WishlistListing, RequestOptions } from '../types'\n\nexport class WishlistsModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * List saved listings.\n */\n async list(options?: RequestOptions): Promise<{ data: WishlistListing[] }> {\n return this.client.get<{ data: WishlistListing[] }>('/listings/wishlists', undefined, options)\n }\n\n /**\n * Add a listing to the wishlist.\n */\n async add(listingId: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.post<{ ok: true }>(`/listings/wishlists/${listingId}`, undefined, options)\n }\n\n /**\n * Remove a listing from the wishlist.\n */\n async remove(listingId: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.delete<{ ok: true }>(`/listings/wishlists/${listingId}`, options)\n }\n}\n","import { APIClient } from '../client'\nimport type { CartItem, RequestOptions } from '../types'\n\nexport class CartModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * List items in the cart.\n */\n async list(options?: RequestOptions): Promise<{ data: CartItem[] }> {\n return this.client.get<{ data: CartItem[] }>('/listings/cart', undefined, options)\n }\n\n /**\n * Add a listing to the cart.\n */\n async add(listingId: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.post<{ ok: true }>(`/listings/cart/${listingId}`, undefined, options)\n }\n\n /**\n * Remove a listing from the cart.\n */\n async remove(listingId: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.delete<{ ok: true }>(`/listings/cart/${listingId}`, options)\n }\n\n /**\n * Checkout the cart — creates orders grouped by store and clears the cart.\n */\n async checkout(options?: RequestOptions): Promise<{ order_ids: string[]; count: number }> {\n return this.client.post<{ order_ids: string[]; count: number }>('/orders/checkout', undefined, options)\n }\n}\n","export const CONDITIONS = ['new', 'like_new', 'good', 'fair'] as const\nexport type Condition = typeof CONDITIONS[number]\n\nexport const LISTING_STATUSES = ['draft', 'active', 'sold', 'removed'] as const\nexport type ListingStatus = typeof LISTING_STATUSES[number]\n\nexport interface ListingImage {\n id: string\n listing_id: string\n url: string\n position: number\n created_at: string\n}\n\nexport interface SellerProfile {\n id: string\n sti_score: number\n verification_status: string\n seller_type: 'individual' | 'bale'\n}\n\nexport interface Listing {\n id: string\n seller_id: string\n title: string\n description: string | null\n category_id: string\n city_id: string\n price: number // KES integer\n condition: Condition\n status: ListingStatus\n photo_verified: boolean\n vazi_eligible: boolean\n created_at: string\n updated_at: string\n // Seller profile (joined)\n sti_score: number\n verification_status: string\n seller_type: 'individual' | 'bale'\n // Images (only present on GET /listings/:id, not in feed)\n images?: ListingImage[]\n}\n\nexport interface ListingsFeedParams {\n city_id?: string\n category_id?: string\n min_price?: number\n max_price?: number\n condition?: Condition\n sort?: 'recency' | 'price_asc' | 'price_desc'\n page?: number\n page_size?: number\n}\n\nexport interface CreateListingInput {\n store_id: string\n title: string\n description?: string\n category_id: string\n city_id: string\n price: number\n condition: Condition\n vazi_eligible?: boolean\n}\n\nexport type UpdateListingInput = Partial<CreateListingInput>\n\nexport interface Category {\n id: string\n name: string\n slug: string\n}\n\nexport interface City {\n id: string\n name: string\n delivery_fee: number\n}\n\nexport interface SellerStorefront {\n seller: SellerProfile\n listings: Listing[]\n total: number\n page: number\n page_size: number\n has_more: boolean\n}\n\nexport interface PresignImageResponse {\n r2_key: string\n image_id: string\n}\n\nexport interface SimilarListing {\n id: string\n title: string\n price: number\n condition: string\n category_id: string\n store_id: string | null\n image_keys: string | null\n created_at: string\n}\n","export const ORDER_STATUSES = [\n 'created',\n 'payment_pending',\n 'paid',\n 'seller_confirmed',\n 'shipped',\n 'delivered',\n 'completed',\n 'cancelled',\n 'disputed',\n] as const\n\nexport type OrderStatus = typeof ORDER_STATUSES[number]\n\nexport interface OrderEvent {\n id: string\n order_id: string\n actor: string // user ID or 'system'\n old_status: string\n new_status: string\n note: string | null\n created_at: string\n}\n\nexport interface Order {\n id: string\n buyer_id: string\n seller_id: string\n listing_id: string\n amount: number\n delivery_fee: number\n total: number\n status: OrderStatus\n city_id: string\n created_at: string\n updated_at: string\n events?: OrderEvent[]\n}\n\nexport interface CreateOrderInput {\n listing_id: string\n}\n\nexport interface TransitionOrderInput {\n status: OrderStatus\n note?: string\n}\n\nexport interface OrderHistoryParams {\n role?: 'buyer' | 'seller'\n page?: number\n}\n","export interface StkPushInput {\n order_id: string\n phone: string // format: +254XXXXXXXXX\n}\n\nexport type MpesaInput = StkPushInput\n\nexport interface StkPushResponse {\n payment_id: string\n provider: string\n}\n\nexport interface PaystackInput {\n order_id: string\n email: string\n}\n\nexport interface PaystackInitResponse {\n access_code: string\n authorization_url: string\n reference: string\n}\n\nexport const PAYMENT_STATUSES = ['initiated', 'funded', 'failed', 'refunded', 'cancelled'] as const\nexport type PaymentStatus = typeof PAYMENT_STATUSES[number]\n\nexport interface PaymentStatusResponse {\n id: string\n status: PaymentStatus\n total: number\n}\n","export const GARMENT_TYPES = [\n 'top',\n 'bottom',\n 'shoes',\n 'accessory',\n 'dress',\n 'outerwear',\n 'bag',\n 'kids',\n] as const\n\nexport type GarmentType = typeof GARMENT_TYPES[number]\n\nexport interface VAZIOutfitItem {\n listing_id: string\n garment_type: GarmentType\n price_kes: number\n seller_id: string\n seller_sti: number\n seller_city: string\n image_url: string | null\n is_seed: boolean\n final_score: number\n}\n\nexport interface VAZIOutfit {\n id: string\n name: string\n items: VAZIOutfitItem[]\n total_price_kes: number\n sellers_count: number\n is_multi_city: boolean\n assembled_at: string // ISO timestamp\n}\n\nexport interface VaziFeedParams {\n limit?: number\n offset?: number\n}\n\nexport interface VaziFeedResponse {\n outfits: VAZIOutfit[]\n total: number\n limit: number\n offset: number\n}\n","import { APIClient } from './client'\nimport { MitumbaClientConfig } from './types'\nimport { AuthModule } from './modules/auth'\nimport { ListingsModule } from './modules/listings'\nimport { SearchModule } from './modules/search'\nimport { OrdersModule } from './modules/orders'\nimport { PayModule } from './modules/pay'\nimport { VaziModule } from './modules/vazi'\nimport { MessagesModule } from './modules/messages'\nimport { NotificationsModule } from './modules/notifications'\nimport { StoresModule } from './modules/stores'\nimport { ReviewsModule } from './modules/reviews'\nimport { WishlistsModule } from './modules/wishlists'\nimport { CartModule } from './modules/cart'\n\nexport class MitumbaClient {\n public readonly api: APIClient\n public readonly auth: AuthModule\n public readonly listings: ListingsModule\n public readonly search: SearchModule\n public readonly orders: OrdersModule\n public readonly pay: PayModule\n public readonly vazi: VaziModule\n public readonly messages: MessagesModule\n public readonly notifications: NotificationsModule\n public readonly stores: StoresModule\n public readonly reviews: ReviewsModule\n public readonly wishlists: WishlistsModule\n public readonly cart: CartModule\n\n constructor(config: MitumbaClientConfig) {\n this.api = new APIClient(config)\n this.auth = new AuthModule(this.api)\n this.listings = new ListingsModule(this.api)\n this.search = new SearchModule(this.api)\n this.orders = new OrdersModule(this.api)\n this.pay = new PayModule(this.api)\n this.vazi = new VaziModule(this.api)\n this.messages = new MessagesModule(this.api)\n this.notifications = new NotificationsModule(this.api)\n this.stores = new StoresModule(this.api)\n this.reviews = new ReviewsModule(this.api)\n this.wishlists = new WishlistsModule(this.api)\n this.cart = new CartModule(this.api)\n }\n\n /**\n * Set the access token for authenticated requests.\n * Optionally pass a refresh token to enable automatic token rotation.\n */\n public setToken(token: string, refreshToken?: string) {\n this.api.setToken(token, refreshToken)\n }\n\n /**\n * Get the current access token.\n */\n public getToken(): string | undefined {\n return this.api.getToken()\n }\n\n /**\n * Clear the current tokens.\n */\n public clearToken() {\n this.api.clearToken()\n }\n}\n\nexport * from './types'\nexport { APIClient, APIError } from './client'\nexport { AuthModule } from './modules/auth'\nexport { ListingsModule } from './modules/listings'\nexport { SearchModule } from './modules/search'\nexport { OrdersModule } from './modules/orders'\nexport { PayModule } from './modules/pay'\nexport { VaziModule } from './modules/vazi'\nexport { MessagesModule } from './modules/messages'\nexport { NotificationsModule } from './modules/notifications'\nexport { StoresModule } from './modules/stores'\nexport { ReviewsModule } from './modules/reviews'\nexport { WishlistsModule } from './modules/wishlists'\nexport { CartModule } from './modules/cart'\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/client.ts","../src/modules/auth.ts","../src/modules/listings.ts","../src/modules/search.ts","../src/modules/orders.ts","../src/modules/pay.ts","../src/modules/vazi.ts","../src/modules/messages.ts","../src/modules/notifications.ts","../src/modules/stores.ts","../src/modules/reviews.ts","../src/modules/wishlists.ts","../src/modules/cart.ts","../src/modules/settings.ts","../src/types/listings.ts","../src/types/orders.ts","../src/types/pay.ts","../src/types/vazi.ts","../src/index.ts"],"names":[],"mappings":";AAEO,IAAM,QAAA,GAAN,cAAuB,KAAA,CAAM;AAAA,EAClB,IAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EAEhB,WAAA,CAAY,QAAgB,IAAA,EAAwB;AAClD,IAAA,KAAA,CAAM,IAAA,CAAK,OAAA,IAAW,IAAA,CAAK,KAAK,CAAA;AAChC,IAAA,IAAA,CAAK,IAAA,GAAO,UAAA;AACZ,IAAA,IAAA,CAAK,OAAO,IAAA,CAAK,KAAA;AACjB,IAAA,IAAA,CAAK,MAAA,GAAS,MAAA;AACd,IAAA,IAAA,CAAK,UAAU,IAAA,CAAK,OAAA;AAAA,EACtB;AACF;AAEO,IAAM,YAAN,MAAgB;AAAA,EACb,MAAA;AAAA,EACA,YAAA,GAAe,KAAA;AAAA,EACf,cAAA,GAAuC,IAAA;AAAA,EAE/C,YAAY,MAAA,EAA6B;AACvC,IAAA,IAAA,CAAK,MAAA,GAAS,MAAA;AAAA,EAChB;AAAA,EAEO,QAAA,CAAS,OAAe,YAAA,EAAuB;AACpD,IAAA,IAAA,CAAK,OAAO,KAAA,GAAQ,KAAA;AACpB,IAAA,IAAI,YAAA,EAAc;AAChB,MAAA,IAAA,CAAK,OAAO,YAAA,GAAe,YAAA;AAAA,IAC7B;AAAA,EACF;AAAA,EAEO,QAAA,GAA+B;AACpC,IAAA,OAAO,KAAK,MAAA,CAAO,KAAA;AAAA,EACrB;AAAA,EAEO,UAAA,GAAa;AAClB,IAAA,IAAA,CAAK,OAAO,KAAA,GAAQ,M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,IAAA,CAAK,GAAG,CAAA;AACjC,IAAA,IAAA,CAAK,IAAA,GAAO,IAAI,UAAA,CAAW,IAAA,CAAK,GAAG,CAAA;AACnC,IAAA,IAAA,CAAK,QAAA,GAAW,IAAI,cAAA,CAAe,IAAA,CAAK,GAAG,CAAA;AAC3C,IAAA,IAAA,CAAK,aAAA,GAAgB,IAAI,mBAAA,CAAoB,IAAA,CAAK,GAAG,CAAA;AACrD,IAAA,IAAA,CAAK,MAAA,GAAS,IAAI,YAAA,CAAa,IAAA,CAAK,GAAG,CAAA;AACvC,IAAA,IAAA,CAAK,OAAA,GAAU,IAAI,aAAA,CAAc,IAAA,CAAK,GAAG,CAAA;AACzC,IAAA,IAAA,CAAK,SAAA,GAAY,IAAI,eAAA,CAAgB,IAAA,CAAK,GAAG,CAAA;AAC7C,IAAA,IAAA,CAAK,IAAA,GAAO,IAAI,UAAA,CAAW,IAAA,CAAK,GAAG,CAAA;AACnC,IAAA,IAAA,CAAK,QAAA,GAAW,IAAI,cAAA,CAAe,IAAA,CAAK,GAAG,CAAA;AAAA,EAC7C;AAAA;AAAA;AAAA;AAAA;AAAA,EAMO,QAAA,CAAS,OAAe,YAAA,EAAuB;AACpD,IAAA,IAAA,CAAK,GAAA,CAAI,QAAA,CAAS,KAAA,EAAO,YAAY,CAAA;AAAA,EACvC;AAAA;AAAA;AAAA;AAAA,EAKO,QAAA,GAA+B;AACpC,IAAA,OAAO,IAAA,CAAK,IAAI,QAAA,EAAS;AAAA,EAC3B;AAAA;AAAA;AAAA;AAAA,EAKO,UAAA,GAAa;AAClB,IAAA,IAAA,CAAK,IAAI,UAAA,EAAW;AAAA,EACtB;AACF","file":"index.mjs","sourcesContent":["import { MitumbaClientConfig, APIErrorResponse, RequestOptions } from './types'\n\nexport class APIError extends Error {\n public readonly code: string\n public readonly status: number\n public readonly details?: unknown\n\n constructor(status: number, data: APIErrorResponse) {\n super(data.message || data.error)\n this.name = 'APIError'\n this.code = data.error\n this.status = status\n this.details = data.details\n }\n}\n\nexport class APIClient {\n private config: MitumbaClientConfig\n private isRefreshing = false\n private refreshPromise: Promise<void> | null = null\n\n constructor(config: MitumbaClientConfig) {\n this.config = config\n }\n\n public setToken(token: string, refreshToken?: string) {\n this.config.token = token\n if (refreshToken) {\n this.config.refreshToken = refreshToken\n }\n }\n\n public getToken(): string | undefined {\n return this.config.token\n }\n\n public clearToken() {\n this.config.token = undefined\n this.config.refreshToken = undefined\n }\n\n private async request<T>(\n method: string, \n path: string, \n body?: unknown, \n params?: Record<string, string | number | boolean | undefined>,\n options?: RequestOptions\n ): Promise<T> {\n const url = new URL(path, this.config.baseUrl)\n \n if (params) {\n for (const [key, value] of Object.entries(params)) {\n if (value !== undefined) {\n url.searchParams.append(key, String(value))\n }\n }\n }\n\n const headers = new Headers()\n if (body && !(body instanceof FormData)) {\n headers.set('Content-Type', 'application/json')\n }\n\n if (this.config.token) {\n headers.set('Authorization', `Bearer ${this.config.token}`)\n }\n\n const init: RequestInit = {\n method,\n headers,\n body: body instanceof FormData ? body : body ? JSON.stringify(body) : undefined,\n signal: options?.signal\n }\n\n const maxRetries = this.config.maxRetries ?? 3\n let attempt = 0\n let response: Response\n\n while (true) {\n if (this.config.debug) {\n console.log(`[Mitumba SDK] ${method} ${url.toString()}`)\n }\n \n const startTime = Date.now()\n try {\n response = await fetch(url.toString(), init)\n } catch (err) {\n if (err instanceof Error && err.name === 'AbortError') {\n throw err\n }\n if (attempt < maxRetries) {\n attempt++\n if (this.config.debug) {\n console.log(`[Mitumba SDK] Network error. Retrying ${method} ${url.toString()} (attempt ${attempt})`)\n }\n await new Promise(resolve => setTimeout(resolve, Math.pow(2, attempt) * 100))\n continue\n }\n throw new APIError(0, { error: 'network_error', message: err instanceof Error ? err.message : 'Network request failed' })\n }\n\n if (this.config.debug) {\n console.log(`[Mitumba SDK] ${method} ${url.toString()} - ${response.status} (${Date.now() - startTime}ms)`)\n }\n\n if (response.status >= 500 && attempt < maxRetries) {\n attempt++\n if (this.config.debug) {\n console.log(`[Mitumba SDK] ${response.status} error. Retrying ${method} ${url.toString()} (attempt ${attempt})`)\n }\n await new Promise(resolve => setTimeout(resolve, Math.pow(2, attempt) * 100))\n continue\n }\n\n break\n }\n\n // Handle automatic token refresh\n if (response.status === 401 && this.config.refreshToken && !path.includes('/auth/refresh')) {\n await this.handleTokenRefresh()\n // Retry request with new token\n headers.set('Authorization', `Bearer ${this.config.token}`)\n response = await fetch(url.toString(), { ...init, headers })\n }\n\n if (!response.ok) {\n let errorData: APIErrorResponse\n try {\n errorData = await response.json()\n } catch {\n errorData = { error: 'unknown_error', message: response.statusText }\n }\n throw new APIError(response.status, errorData)\n }\n\n if (response.status === 204) {\n return undefined as unknown as T\n }\n\n return response.json() as Promise<T>\n }\n\n private async handleTokenRefresh(): Promise<void> {\n if (this.isRefreshing && this.refreshPromise) {\n return this.refreshPromise\n }\n\n this.isRefreshing = true\n this.refreshPromise = (async () => {\n try {\n const url = new URL('/auth/refresh', this.config.baseUrl)\n const response = await fetch(url.toString(), {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ refresh_token: this.config.refreshToken }),\n })\n\n if (!response.ok) {\n throw new Error('Refresh failed')\n }\n\n const data = await response.json() as { access_token: string, refresh_token: string }\n this.setToken(data.access_token, data.refresh_token)\n\n if (this.config.onTokenRefresh) {\n this.config.onTokenRefresh({ token: data.access_token, refreshToken: data.refresh_token })\n }\n } catch (err) {\n this.clearToken()\n throw new APIError(401, { error: 'token_expired', message: 'Session expired. Please log in again.' })\n } finally {\n this.isRefreshing = false\n this.refreshPromise = null\n }\n })()\n\n return this.refreshPromise\n }\n\n public get<T>(path: string, params?: Record<string, string | number | boolean | undefined>, options?: RequestOptions): Promise<T> {\n return this.request<T>('GET', path, undefined, params, options)\n }\n\n public post<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T> {\n return this.request<T>('POST', path, body, undefined, options)\n }\n\n public put<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T> {\n return this.request<T>('PUT', path, body, undefined, options)\n }\n\n public patch<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T> {\n return this.request<T>('PATCH', path, body, undefined, options)\n }\n\n public delete<T>(path: string, options?: RequestOptions): Promise<T> {\n return this.request<T>('DELETE', path, undefined, undefined, options)\n }\n}\n","import { APIClient } from '../client'\nimport type {\n RegisterInput,\n LoginInput,\n SendOtpInput,\n VerifyOtpInput,\n ForgotPasswordInput,\n ResetPasswordInput,\n CompleteOnboardingInput,\n UserProfile,\n AuthTokens,\n MessageResponse,\n RequestOptions,\n} from '../types'\n\nexport class AuthModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * Register a new account.\n * If using EmailRegisterInput, returns AuthTokens.\n * If using PhoneRegisterInput, returns MessageResponse (OTP sent).\n */\n async register(input: RegisterInput, options?: RequestOptions): Promise<AuthTokens | MessageResponse> {\n return this.client.post<AuthTokens | MessageResponse>('/auth/register', input, options)\n }\n\n /**\n * Log in to an existing account.\n * If using EmailLoginInput, returns AuthTokens.\n * If using PhoneLoginInput, returns MessageResponse (OTP sent).\n */\n async login(input: LoginInput, options?: RequestOptions): Promise<AuthTokens | MessageResponse> {\n return this.client.post<AuthTokens | MessageResponse>('/auth/login', input, options)\n }\n\n /**\n * Send an OTP code to a phone number.\n */\n async sendOtp(input: SendOtpInput, options?: RequestOptions): Promise<MessageResponse> {\n return this.client.post<MessageResponse>('/auth/otp/send', input, options)\n }\n\n /**\n * Verify an OTP code.\n */\n async verifyOtp(input: VerifyOtpInput, options?: RequestOptions): Promise<AuthTokens> {\n return this.client.post<AuthTokens>('/auth/otp/verify', input, options)\n }\n\n /**\n * Refresh the access token using a refresh token.\n */\n async refresh(input: { refresh_token: string }, options?: RequestOptions): Promise<AuthTokens> {\n return this.client.post<AuthTokens>('/auth/refresh', input, options)\n }\n\n /**\n * Revoke the refresh token and log out.\n */\n async logout(input: { refresh_token: string }, options?: RequestOptions): Promise<{ ok: boolean }> {\n return this.client.post<{ ok: boolean }>('/auth/logout', input, options)\n }\n\n /**\n * Request a password reset email.\n * Sends a reset link to the provided email address.\n */\n async forgotPassword(input: ForgotPasswordInput, options?: RequestOptions): Promise<MessageResponse> {\n return this.client.post<MessageResponse>('/auth/forgot-password', input, options)\n }\n\n /**\n * Reset the password using a token from the reset email.\n */\n async resetPassword(input: ResetPasswordInput, options?: RequestOptions): Promise<MessageResponse> {\n return this.client.post<MessageResponse>('/auth/reset-password', input, options)\n }\n\n /**\n * Get the current authenticated user's profile.\n */\n async me(options?: RequestOptions): Promise<UserProfile> {\n return this.client.get<UserProfile>('/auth/me', undefined, options)\n }\n\n /**\n * Complete the onboarding flow.\n */\n async completeOnboarding(input: CompleteOnboardingInput, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.post<{ ok: true }>('/auth/onboarding/complete', input, options)\n }\n}\n","import { APIClient } from '../client'\nimport type {\n Category,\n City,\n Condition,\n CreateListingInput,\n Listing,\n ListingImage,\n ListingStatus,\n ListingsFeedParams,\n PaginatedResponse,\n PresignImageResponse,\n SellerStorefront,\n SimilarListing,\n UpdateListingInput,\n RequestOptions,\n} from '../types'\n\nexport class ListingsModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * Browse the marketplace feed with optional filters.\n */\n async getFeed(params?: ListingsFeedParams, options?: RequestOptions): Promise<PaginatedResponse<Listing>> {\n // APIClient handles converting params to string|number|boolean properly\n return this.client.get<PaginatedResponse<Listing>>(\n '/listings/feed', \n params as unknown as Record<string, string | number | boolean | undefined>,\n options\n )\n }\n\n /**\n * Get full details of a single listing, including its images.\n */\n async getById(id: string, options?: RequestOptions): Promise<Listing & { images: ListingImage[] }> {\n return this.client.get<Listing & { images: ListingImage[] }>(`/listings/${id}`, undefined, options)\n }\n\n /**\n * Create a new listing (requires seller role).\n */\n async create(input: CreateListingInput, options?: RequestOptions): Promise<Listing> {\n return this.client.post<Listing>('/listings', input, options)\n }\n\n /**\n * Update an existing listing.\n */\n async update(id: string, input: UpdateListingInput, options?: RequestOptions): Promise<Listing> {\n return this.client.put<Listing>(`/listings/${id}`, input, options)\n }\n\n /**\n * Change the status of a listing.\n */\n async updateStatus(id: string, status: ListingStatus, options?: RequestOptions): Promise<{ ok: boolean; status: ListingStatus }> {\n return this.client.patch<{ ok: boolean; status: ListingStatus }>(`/listings/${id}/status`, { status }, options)\n }\n\n /**\n * Soft delete a listing (sets status to 'removed').\n */\n async delete(id: string, options?: RequestOptions): Promise<{ ok: boolean }> {\n return this.client.delete<{ ok: boolean }>(`/listings/${id}`, options)\n }\n\n /**\n * Get a seller's public storefront.\n */\n async getSellerStorefront(\n sellerId: string,\n params?: { page?: number; page_size?: number },\n options?: RequestOptions\n ): Promise<SellerStorefront> {\n return this.client.get<SellerStorefront>(\n `/listings/seller/${sellerId}`, \n params as unknown as Record<string, string | number | boolean | undefined>,\n options\n )\n }\n\n /**\n * List all supported categories.\n */\n async getCategories(options?: RequestOptions): Promise<Category[]> {\n return this.client.get<Category[]>('/listings/categories', undefined, options)\n }\n\n /**\n * List all supported cities.\n */\n async getCities(options?: RequestOptions): Promise<City[]> {\n return this.client.get<City[]>('/listings/cities', undefined, options)\n }\n\n /**\n * Get a presigned upload URL for a listing image.\n * Index should be between 0 and 9.\n */\n async presignImage(listingId: string, index: number, options?: RequestOptions): Promise<PresignImageResponse> {\n return this.client.post<PresignImageResponse>(`/listings/${listingId}/images/presign`, { index }, options)\n }\n\n /**\n * Browse the listing feed (alias for getFeed with simplified params).\n */\n async feed(params?: { page?: number; city?: string; category?: string; sort?: string }, options?: RequestOptions): Promise<{ data: Listing[]; page: number }> {\n return this.client.get<{ data: Listing[]; page: number }>(\n '/listings',\n params as unknown as Record<string, string | number | boolean | undefined>,\n options\n )\n }\n\n /**\n * Get a single listing by ID (alias for getById).\n */\n async get(id: string, options?: RequestOptions): Promise<Listing & { images: ListingImage[] }> {\n return this.getById(id, options)\n }\n\n /**\n * Full-text search with filters.\n */\n async search(params: { q: string; category?: string; condition?: Condition; min_price?: number; max_price?: number; sort?: string; page?: number }, options?: RequestOptions): Promise<{ data: Listing[]; total: number }> {\n return this.client.get<{ data: Listing[]; total: number }>(\n '/search',\n params as unknown as Record<string, string | number | boolean | undefined>,\n options\n )\n }\n\n /**\n * Get similar listings for a given listing.\n */\n async getSimilar(listingId: string, mode?: 'global' | 'store', options?: RequestOptions): Promise<{ data: SimilarListing[] }> {\n return this.client.get<{ data: SimilarListing[] }>(\n `/listings/${listingId}/similar`,\n mode ? { mode } : undefined,\n options\n )\n }\n}\n","import { APIClient } from '../client'\nimport type { PaginatedResponse, SearchParams, SearchResult, SearchHistoryItem, SaveSearchInput, TrendingTerm, RequestOptions } from '../types'\n\nexport class SearchModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * Perform a full-text search with optional filters.\n */\n async query(params: SearchParams, options?: RequestOptions): Promise<PaginatedResponse<SearchResult>> {\n return this.client.get<PaginatedResponse<SearchResult>>(\n '/search', \n params as unknown as Record<string, string | number | boolean | undefined>,\n options\n )\n }\n\n /**\n * Get trending search terms.\n */\n async trending(params?: { city_id?: string }, options?: RequestOptions): Promise<{ terms: TrendingTerm[] }> {\n return this.client.get<{ terms: TrendingTerm[] }>(\n '/search/trending',\n params as unknown as Record<string, string | number | boolean | undefined>,\n options\n )\n }\n\n /**\n * Get the user's search history.\n */\n async getHistory(options?: RequestOptions): Promise<{ data: SearchHistoryItem[] }> {\n return this.client.get<{ data: SearchHistoryItem[] }>('/search/history', undefined, options)\n }\n\n /**\n * Save a search query to history.\n */\n async saveHistory(input: SaveSearchInput, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.post<{ ok: true }>('/search/history', input, options)\n }\n}\n","import { APIClient } from '../client'\nimport type { CreateOrderInput, Order, OrderEvent, OrderHistoryParams, OrderStatus, TransitionOrderInput, RequestOptions } from '../types'\n\nexport class OrdersModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * Create a new order from a listing.\n */\n async create(input: CreateOrderInput, options?: RequestOptions): Promise<{ order_id: string; total: number; delivery_fee: number }> {\n return this.client.post<{ order_id: string; total: number; delivery_fee: number }>('/orders', input, options)\n }\n\n /**\n * Get full details of an order, including its event timeline.\n */\n async getById(id: string, options?: RequestOptions): Promise<Order & { events: OrderEvent[] }> {\n return this.client.get<Order & { events: OrderEvent[] }>(`/orders/${id}`, undefined, options)\n }\n\n /**\n * Transition the status of an order.\n */\n async transition(id: string, input: TransitionOrderInput, options?: RequestOptions): Promise<{ ok: boolean; status: OrderStatus }> {\n return this.client.post<{ ok: boolean; status: OrderStatus }>(`/orders/${id}/transition`, input, options)\n }\n\n /**\n * Get the order history for the current authenticated user.\n */\n async getHistory(params?: OrderHistoryParams, options?: RequestOptions): Promise<{ data: Order[]; page: number; page_size: number }> {\n return this.client.get<{ data: Order[]; page: number; page_size: number }>(\n '/orders/history',\n params as unknown as Record<string, string | number | boolean | undefined>,\n options\n )\n }\n}\n","import { APIClient } from '../client'\nimport type { MpesaInput, PaystackInput, PaystackInitResponse, PaymentStatusResponse, StkPushInput, StkPushResponse, RequestOptions } from '../types'\n\nexport class PayModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * Initiate an M-Pesa STK Push payment for an order.\n */\n async initiateStk(input: StkPushInput, options?: RequestOptions): Promise<StkPushResponse> {\n return this.client.post<StkPushResponse>('/pay/stk', input, options)\n }\n\n /**\n * Initiate M-Pesa STK Push (alias for initiateStk).\n */\n async initMpesa(input: MpesaInput, options?: RequestOptions): Promise<StkPushResponse> {\n return this.client.post<StkPushResponse>('/pay/stk', input, options)\n }\n\n /**\n * Initiate a Paystack payment — returns access_code for inline popup.\n */\n async initPaystack(input: PaystackInput, options?: RequestOptions): Promise<PaystackInitResponse> {\n return this.client.post<PaystackInitResponse>('/pay/paystack/init', input, options)\n }\n\n /**\n * Poll for the current status of a payment by its order ID.\n */\n async getStatus(orderId: string, options?: RequestOptions): Promise<PaymentStatusResponse> {\n return this.client.get<PaymentStatusResponse>(`/pay/status/${orderId}`, undefined, options)\n }\n}\n","import { APIClient } from '../client'\nimport type { VAZIOutfit, VaziFeedParams, VaziFeedResponse, RequestOptions } from '../types'\n\nexport class VaziModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * Browse the AI-curated outfit feed.\n */\n async getFeed(params?: VaziFeedParams, options?: RequestOptions): Promise<VaziFeedResponse> {\n return this.client.get<VaziFeedResponse>(\n '/vazi/feed',\n params as unknown as Record<string, string | number | boolean | undefined>,\n options\n )\n }\n\n /**\n * Get a complete outfit built around a specific seed listing.\n */\n async getCompleteLook(listingId: string, options?: RequestOptions): Promise<{ outfits: VAZIOutfit[] }> {\n return this.client.get<{ outfits: VAZIOutfit[] }>(`/vazi/complete/${listingId}`, undefined, options)\n }\n}\n","import { APIClient } from '../client'\nimport type { Conversation, Message, SendMessageInput, RequestOptions } from '../types'\n\nexport class MessagesModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * List all conversations for the authenticated user.\n */\n async list(storeId?: string, options?: RequestOptions): Promise<{ data: Conversation[] }> {\n return this.client.get<{ data: Conversation[] }>(\n '/notify/messages',\n storeId ? { store_id: storeId } : undefined,\n options\n )\n }\n\n /**\n * Get the message thread with a specific partner.\n */\n async getThread(partnerId: string, storeId?: string, options?: RequestOptions): Promise<{ data: Message[] }> {\n return this.client.get<{ data: Message[] }>(\n `/notify/messages/${partnerId}`,\n storeId ? { store_id: storeId } : undefined,\n options\n )\n }\n\n /**\n * Send a message to another user.\n */\n async send(input: SendMessageInput, options?: RequestOptions): Promise<{ id: string }> {\n return this.client.post<{ id: string }>('/notify/messages', input, options)\n }\n}\n","import { APIClient } from '../client'\nimport type { Notification, RequestOptions } from '../types'\n\nexport class NotificationsModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * List paginated notifications with unread count.\n */\n async list(page?: number, options?: RequestOptions): Promise<{ data: Notification[]; unread_count: number; page: number }> {\n return this.client.get<{ data: Notification[]; unread_count: number; page: number }>(\n '/notify/notifications',\n page !== undefined ? { page } : undefined,\n options\n )\n }\n\n /**\n * Mark notifications as read. If ids omitted, marks all as read.\n */\n async markRead(ids?: string[], options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.post<{ ok: true }>('/notify/notifications/read', ids ? { ids } : {}, options)\n }\n}\n","import { APIClient } from '../client'\nimport type { Listing, Store, RequestOptions } from '../types'\n\nexport class StoresModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * Get a store by its URL slug.\n */\n async getBySlug(slug: string, options?: RequestOptions): Promise<Store> {\n return this.client.get<Store>(`/listings/stores/${slug}`, undefined, options)\n }\n\n /**\n * Follow a store.\n */\n async follow(storeId: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.post<{ ok: true }>(`/listings/stores/${storeId}/follow`, undefined, options)\n }\n\n /**\n * Unfollow a store.\n */\n async unfollow(storeId: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.delete<{ ok: true }>(`/listings/stores/${storeId}/follow`, options)\n }\n\n /**\n * Get paginated listings for a specific store.\n */\n async getListings(storeId: string, page?: number, options?: RequestOptions): Promise<{ data: Listing[] }> {\n return this.client.get<{ data: Listing[] }>(\n `/listings/stores/${storeId}/listings`,\n page !== undefined ? { page } : undefined,\n options\n )\n }\n}\n","import { APIClient } from '../client'\nimport type { CreateReviewInput, Review, RequestOptions } from '../types'\n\nexport class ReviewsModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * List reviews for a store (public).\n */\n async list(storeId: string, page?: number, options?: RequestOptions): Promise<{ data: Review[]; total: number; avg_rating: number; page: number }> {\n return this.client.get<{ data: Review[]; total: number; avg_rating: number; page: number }>(\n `/listings/stores/${storeId}/reviews`,\n page !== undefined ? { page } : undefined,\n options\n )\n }\n\n /**\n * Create a review for a store (authenticated).\n */\n async create(storeId: string, input: CreateReviewInput, options?: RequestOptions): Promise<{ id: string }> {\n return this.client.post<{ id: string }>(`/listings/stores/${storeId}/reviews`, input, options)\n }\n}\n","import { APIClient } from '../client'\nimport type { WishlistListing, RequestOptions } from '../types'\n\nexport class WishlistsModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * List saved listings.\n */\n async list(options?: RequestOptions): Promise<{ data: WishlistListing[] }> {\n return this.client.get<{ data: WishlistListing[] }>('/listings/wishlists', undefined, options)\n }\n\n /**\n * Add a listing to the wishlist.\n */\n async add(listingId: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.post<{ ok: true }>(`/listings/wishlists/${listingId}`, undefined, options)\n }\n\n /**\n * Remove a listing from the wishlist.\n */\n async remove(listingId: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.delete<{ ok: true }>(`/listings/wishlists/${listingId}`, options)\n }\n}\n","import { APIClient } from '../client'\nimport type { CartItem, RequestOptions } from '../types'\n\nexport class CartModule {\n constructor(private readonly client: APIClient) {}\n\n /**\n * List items in the cart.\n */\n async list(options?: RequestOptions): Promise<{ data: CartItem[] }> {\n return this.client.get<{ data: CartItem[] }>('/listings/cart', undefined, options)\n }\n\n /**\n * Add a listing to the cart.\n */\n async add(listingId: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.post<{ ok: true }>(`/listings/cart/${listingId}`, undefined, options)\n }\n\n /**\n * Remove a listing from the cart.\n */\n async remove(listingId: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.delete<{ ok: true }>(`/listings/cart/${listingId}`, options)\n }\n\n /**\n * Checkout the cart — creates orders grouped by store and clears the cart.\n */\n async checkout(options?: RequestOptions): Promise<{ order_ids: string[]; count: number }> {\n return this.client.post<{ order_ids: string[]; count: number }>('/orders/checkout', undefined, options)\n }\n}\n","import { APIClient } from '../client'\nimport type {\n UpdateProfileInput,\n ChangePasswordInput,\n Session,\n NotificationPref,\n Address,\n AddAddressInput,\n PaymentMethod,\n AddPaymentMethodInput,\n LinkedAccount,\n LinkedAccountProvider,\n UserProfile,\n RequestOptions,\n} from '../types'\n\nexport class SettingsModule {\n constructor(private readonly client: APIClient) {}\n\n // ── Profile ──\n\n async getProfile(options?: RequestOptions): Promise<UserProfile> {\n return this.client.get<UserProfile>('/auth/me', undefined, options)\n }\n\n async updateProfile(input: UpdateProfileInput, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.put<{ ok: true }>('/auth/me', input, options)\n }\n\n // ── Security ──\n\n async changePassword(input: ChangePasswordInput, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.post<{ ok: true }>('/auth/change-password', input, options)\n }\n\n async getSessions(options?: RequestOptions): Promise<{ data: Session[] }> {\n return this.client.get<{ data: Session[] }>('/auth/sessions', undefined, options)\n }\n\n async revokeSession(sessionId: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.delete<{ ok: true }>(`/auth/sessions/${sessionId}`, options)\n }\n\n // ── Notification Preferences ──\n\n async getNotificationPrefs(options?: RequestOptions): Promise<{ data: NotificationPref[] }> {\n return this.client.get<{ data: NotificationPref[] }>('/auth/notification-prefs', undefined, options)\n }\n\n async updateNotificationPref(channel: string, enabled: boolean, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.put<{ ok: true }>(`/auth/notification-prefs/${channel}`, { enabled }, options)\n }\n\n // ── Preferences ──\n\n async getPreferences(options?: RequestOptions): Promise<{ data: Record<string, string> }> {\n return this.client.get<{ data: Record<string, string> }>('/auth/preferences', undefined, options)\n }\n\n async updatePreferences(prefs: Record<string, string>, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.put<{ ok: true }>('/auth/preferences', { prefs }, options)\n }\n\n // ── Addresses ──\n\n async getAddresses(options?: RequestOptions): Promise<{ data: Address[] }> {\n return this.client.get<{ data: Address[] }>('/auth/addresses', undefined, options)\n }\n\n async addAddress(input: AddAddressInput, options?: RequestOptions): Promise<{ id: string }> {\n return this.client.post<{ id: string }>('/auth/addresses', input, options)\n }\n\n async updateAddress(id: string, input: Partial<AddAddressInput>, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.put<{ ok: true }>(`/auth/addresses/${id}`, input, options)\n }\n\n async deleteAddress(id: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.delete<{ ok: true }>(`/auth/addresses/${id}`, options)\n }\n\n async setDefaultAddress(id: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.post<{ ok: true }>(`/auth/addresses/${id}/default`, undefined, options)\n }\n\n // ── Payment Methods ──\n\n async getPaymentMethods(options?: RequestOptions): Promise<{ data: PaymentMethod[] }> {\n return this.client.get<{ data: PaymentMethod[] }>('/auth/payment-methods', undefined, options)\n }\n\n async addPaymentMethod(input: AddPaymentMethodInput, options?: RequestOptions): Promise<{ id: string }> {\n return this.client.post<{ id: string }>('/auth/payment-methods', input, options)\n }\n\n async deletePaymentMethod(id: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.delete<{ ok: true }>(`/auth/payment-methods/${id}`, options)\n }\n\n async setDefaultPaymentMethod(id: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.post<{ ok: true }>(`/auth/payment-methods/${id}/default`, undefined, options)\n }\n\n // ── Linked Accounts ──\n\n async getLinkedAccounts(options?: RequestOptions): Promise<{ data: LinkedAccount[] }> {\n return this.client.get<{ data: LinkedAccount[] }>('/auth/linked-accounts', undefined, options)\n }\n\n async linkAccount(provider: LinkedAccountProvider, token: string, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.post<{ ok: true }>('/auth/linked-accounts', { provider, token }, options)\n }\n\n async unlinkAccount(provider: LinkedAccountProvider, options?: RequestOptions): Promise<{ ok: true }> {\n return this.client.delete<{ ok: true }>(`/auth/linked-accounts/${provider}`, options)\n }\n}\n","export const CONDITIONS = ['new', 'like_new', 'good', 'fair'] as const\nexport type Condition = typeof CONDITIONS[number]\n\nexport const LISTING_STATUSES = ['draft', 'active', 'sold', 'removed'] as const\nexport type ListingStatus = typeof LISTING_STATUSES[number]\n\nexport interface ListingImage {\n id: string\n listing_id: string\n url: string\n position: number\n created_at: string\n}\n\nexport interface SellerProfile {\n id: string\n sti_score: number\n verification_status: string\n seller_type: 'individual' | 'bale'\n}\n\nexport interface Listing {\n id: string\n seller_id: string\n title: string\n description: string | null\n category_id: string\n city_id: string\n price: number // KES integer\n condition: Condition\n status: ListingStatus\n photo_verified: boolean\n vazi_eligible: boolean\n created_at: string\n updated_at: string\n // Seller profile (joined)\n sti_score: number\n verification_status: string\n seller_type: 'individual' | 'bale'\n // Images (only present on GET /listings/:id, not in feed)\n images?: ListingImage[]\n}\n\nexport interface ListingsFeedParams {\n city_id?: string\n category_id?: string\n min_price?: number\n max_price?: number\n condition?: Condition\n sort?: 'recency' | 'price_asc' | 'price_desc'\n page?: number\n page_size?: number\n}\n\nexport interface CreateListingInput {\n store_id: string\n title: string\n description?: string\n category_id: string\n city_id: string\n price: number\n condition: Condition\n vazi_eligible?: boolean\n}\n\nexport type UpdateListingInput = Partial<CreateListingInput>\n\nexport interface Category {\n id: string\n name: string\n slug: string\n}\n\nexport interface City {\n id: string\n name: string\n delivery_fee: number\n}\n\nexport interface SellerStorefront {\n seller: SellerProfile\n listings: Listing[]\n total: number\n page: number\n page_size: number\n has_more: boolean\n}\n\nexport interface PresignImageResponse {\n r2_key: string\n image_id: string\n}\n\nexport interface SimilarListing {\n id: string\n title: string\n price: number\n condition: string\n category_id: string\n store_id: string | null\n image_keys: string | null\n created_at: string\n}\n","export const ORDER_STATUSES = [\n 'created',\n 'payment_pending',\n 'paid',\n 'seller_confirmed',\n 'shipped',\n 'delivered',\n 'completed',\n 'cancelled',\n 'disputed',\n] as const\n\nexport type OrderStatus = typeof ORDER_STATUSES[number]\n\nexport interface OrderEvent {\n id: string\n order_id: string\n actor: string // user ID or 'system'\n old_status: string\n new_status: string\n note: string | null\n created_at: string\n}\n\nexport interface Order {\n id: string\n buyer_id: string\n seller_id: string\n listing_id: string\n amount: number\n delivery_fee: number\n total: number\n status: OrderStatus\n city_id: string\n created_at: string\n updated_at: string\n events?: OrderEvent[]\n}\n\nexport interface CreateOrderInput {\n listing_id: string\n}\n\nexport interface TransitionOrderInput {\n status: OrderStatus\n note?: string\n}\n\nexport interface OrderHistoryParams {\n role?: 'buyer' | 'seller'\n page?: number\n}\n","export interface StkPushInput {\n order_id: string\n phone: string // format: +254XXXXXXXXX\n}\n\nexport type MpesaInput = StkPushInput\n\nexport interface StkPushResponse {\n payment_id: string\n provider: string\n}\n\nexport interface PaystackInput {\n order_id: string\n email: string\n}\n\nexport interface PaystackInitResponse {\n access_code: string\n authorization_url: string\n reference: string\n}\n\nexport const PAYMENT_STATUSES = ['initiated', 'funded', 'failed', 'refunded', 'cancelled'] as const\nexport type PaymentStatus = typeof PAYMENT_STATUSES[number]\n\nexport interface PaymentStatusResponse {\n id: string\n status: PaymentStatus\n total: number\n}\n","export const GARMENT_TYPES = [\n 'top',\n 'bottom',\n 'shoes',\n 'accessory',\n 'dress',\n 'outerwear',\n 'bag',\n 'kids',\n] as const\n\nexport type GarmentType = typeof GARMENT_TYPES[number]\n\nexport interface VAZIOutfitItem {\n listing_id: string\n garment_type: GarmentType\n price_kes: number\n seller_id: string\n seller_sti: number\n seller_city: string\n image_url: string | null\n is_seed: boolean\n final_score: number\n}\n\nexport interface VAZIOutfit {\n id: string\n name: string\n items: VAZIOutfitItem[]\n total_price_kes: number\n sellers_count: number\n is_multi_city: boolean\n assembled_at: string // ISO timestamp\n}\n\nexport interface VaziFeedParams {\n limit?: number\n offset?: number\n}\n\nexport interface VaziFeedResponse {\n outfits: VAZIOutfit[]\n total: number\n limit: number\n offset: number\n}\n","import { APIClient } from './client'\nimport { MitumbaClientConfig } from './types'\nimport { AuthModule } from './modules/auth'\nimport { ListingsModule } from './modules/listings'\nimport { SearchModule } from './modules/search'\nimport { OrdersModule } from './modules/orders'\nimport { PayModule } from './modules/pay'\nimport { VaziModule } from './modules/vazi'\nimport { MessagesModule } from './modules/messages'\nimport { NotificationsModule } from './modules/notifications'\nimport { StoresModule } from './modules/stores'\nimport { ReviewsModule } from './modules/reviews'\nimport { WishlistsModule } from './modules/wishlists'\nimport { CartModule } from './modules/cart'\nimport { SettingsModule } from './modules/settings'\n\nexport class MitumbaClient {\n public readonly api: APIClient\n public readonly auth: AuthModule\n public readonly listings: ListingsModule\n public readonly search: SearchModule\n public readonly orders: OrdersModule\n public readonly pay: PayModule\n public readonly vazi: VaziModule\n public readonly messages: MessagesModule\n public readonly notifications: NotificationsModule\n public readonly stores: StoresModule\n public readonly reviews: ReviewsModule\n public readonly wishlists: WishlistsModule\n public readonly cart: CartModule\n public readonly settings: SettingsModule\n\n constructor(config: MitumbaClientConfig) {\n this.api = new APIClient(config)\n this.auth = new AuthModule(this.api)\n this.listings = new ListingsModule(this.api)\n this.search = new SearchModule(this.api)\n this.orders = new OrdersModule(this.api)\n this.pay = new PayModule(this.api)\n this.vazi = new VaziModule(this.api)\n this.messages = new MessagesModule(this.api)\n this.notifications = new NotificationsModule(this.api)\n this.stores = new StoresModule(this.api)\n this.reviews = new ReviewsModule(this.api)\n this.wishlists = new WishlistsModule(this.api)\n this.cart = new CartModule(this.api)\n this.settings = new SettingsModule(this.api)\n }\n\n /**\n * Set the access token for authenticated requests.\n * Optionally pass a refresh token to enable automatic token rotation.\n */\n public setToken(token: string, refreshToken?: string) {\n this.api.setToken(token, refreshToken)\n }\n\n /**\n * Get the current access token.\n */\n public getToken(): string | undefined {\n return this.api.getToken()\n }\n\n /**\n * Clear the current tokens.\n */\n public clearToken() {\n this.api.clearToken()\n }\n}\n\nexport * from './types'\nexport { APIClient, APIError } from './client'\nexport { AuthModule } from './modules/auth'\nexport { ListingsModule } from './modules/listings'\nexport { SearchModule } from './modules/search'\nexport { OrdersModule } from './modules/orders'\nexport { PayModule } from './modules/pay'\nexport { VaziModule } from './modules/vazi'\nexport { MessagesModule } from './modules/messages'\nexport { NotificationsModule } from './modules/notifications'\nexport { StoresModule } from './modules/stores'\nexport { ReviewsModule } from './modules/reviews'\nexport { WishlistsModule } from './modules/wishlists'\nexport { CartModule } from './modules/cart'\nexport { SettingsModule } from './modules/settings'\n"]}
|