@mitumba/sdk 1.32.1 → 1.33.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 +73 -1
- package/dist/index.d.ts +73 -1
- package/dist/index.js +46 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +46 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1642,6 +1642,43 @@ interface CreateBaleOrderInput {
|
|
|
1642
1642
|
qty?: number;
|
|
1643
1643
|
fulfillment: BaleFulfillment;
|
|
1644
1644
|
}
|
|
1645
|
+
/**
|
|
1646
|
+
* Result of uploading a bale image directly via multipart/form-data. Mirrors the listing image
|
|
1647
|
+
* upload result; the presign step reuses `PresignImageResponse` from the listings types.
|
|
1648
|
+
*/
|
|
1649
|
+
interface BaleImageUploadResult {
|
|
1650
|
+
r2_key: string;
|
|
1651
|
+
image_id: string;
|
|
1652
|
+
url: string;
|
|
1653
|
+
}
|
|
1654
|
+
/**
|
|
1655
|
+
* Performance analytics for a wholesale store. Mirrors the retail `StoreAnalytics` shape where it
|
|
1656
|
+
* applies (revenue series, order breakdown) and adapts the rest to bales (top bales, bale totals).
|
|
1657
|
+
*/
|
|
1658
|
+
interface WholesaleAnalytics {
|
|
1659
|
+
revenue: {
|
|
1660
|
+
date: string;
|
|
1661
|
+
revenue: number;
|
|
1662
|
+
orders: number;
|
|
1663
|
+
}[];
|
|
1664
|
+
orders_breakdown: {
|
|
1665
|
+
date: string;
|
|
1666
|
+
completed: number;
|
|
1667
|
+
pending: number;
|
|
1668
|
+
cancelled: number;
|
|
1669
|
+
}[];
|
|
1670
|
+
top_bales: {
|
|
1671
|
+
bale_id: string;
|
|
1672
|
+
title: string;
|
|
1673
|
+
orders: number;
|
|
1674
|
+
revenue: number;
|
|
1675
|
+
}[];
|
|
1676
|
+
totals: {
|
|
1677
|
+
bales: number;
|
|
1678
|
+
orders: number;
|
|
1679
|
+
revenue: number;
|
|
1680
|
+
};
|
|
1681
|
+
}
|
|
1645
1682
|
|
|
1646
1683
|
interface StkPushInput {
|
|
1647
1684
|
order_id: string;
|
|
@@ -3541,6 +3578,25 @@ declare class WholesaleModule {
|
|
|
3541
3578
|
myBales(options?: RequestOptions): Promise<{
|
|
3542
3579
|
data: Bale[];
|
|
3543
3580
|
}>;
|
|
3581
|
+
/**
|
|
3582
|
+
* Presign a bale image upload slot (requires the owning wholesale store).
|
|
3583
|
+
*
|
|
3584
|
+
* @param baleId - The bale to attach the image to
|
|
3585
|
+
* @param index - The slot index; slot 0 is the cover
|
|
3586
|
+
* @returns The storage key and image id for the slot
|
|
3587
|
+
* @throws {APIError} On network or server errors
|
|
3588
|
+
*/
|
|
3589
|
+
presignBaleImage(baleId: string, index: number, options?: RequestOptions): Promise<PresignImageResponse>;
|
|
3590
|
+
/**
|
|
3591
|
+
* Upload a bale image file directly. Uses multipart/form-data. Slot 0 is the cover.
|
|
3592
|
+
*
|
|
3593
|
+
* @param baleId - The bale to attach the image to
|
|
3594
|
+
* @param file - The image file as a `Blob` (React Native passes a `{ uri, name, type }` part)
|
|
3595
|
+
* @param index - The slot index; slot 0 is the cover
|
|
3596
|
+
* @returns The storage key, image id, and public URL
|
|
3597
|
+
* @throws {APIError} On network or server errors
|
|
3598
|
+
*/
|
|
3599
|
+
uploadBaleImage(baleId: string, file: Blob, index: number, options?: RequestOptions): Promise<BaleImageUploadResult>;
|
|
3544
3600
|
/** Browse the wholesale bale feed (public). */
|
|
3545
3601
|
wholesaleFeed(params?: WholesaleFeedParams, options?: RequestOptions): Promise<{
|
|
3546
3602
|
data: BaleFeedItem[];
|
|
@@ -3569,6 +3625,22 @@ declare class WholesaleModule {
|
|
|
3569
3625
|
ok: true;
|
|
3570
3626
|
status: BaleOrderStatus;
|
|
3571
3627
|
}>;
|
|
3628
|
+
/**
|
|
3629
|
+
* Get performance analytics for the current user's wholesale store (bale_seller only).
|
|
3630
|
+
*
|
|
3631
|
+
* The wholesale store is resolved server-side from the session, so no store id is passed — the
|
|
3632
|
+
* same way `getWholesaleStore`, `myBales`, and `incomingBaleOrders` work.
|
|
3633
|
+
*
|
|
3634
|
+
* @param period - Optional granularity; defaults to the server's default window
|
|
3635
|
+
* @returns Revenue series, order breakdown, top bales, and totals
|
|
3636
|
+
* @throws {APIError} On network or server errors
|
|
3637
|
+
*
|
|
3638
|
+
* @example
|
|
3639
|
+
* ```typescript
|
|
3640
|
+
* const analytics = await sdk.wholesale.getAnalytics('weekly')
|
|
3641
|
+
* ```
|
|
3642
|
+
*/
|
|
3643
|
+
getAnalytics(period?: 'daily' | 'weekly' | 'monthly', options?: RequestOptions): Promise<WholesaleAnalytics>;
|
|
3572
3644
|
}
|
|
3573
3645
|
|
|
3574
3646
|
/**
|
|
@@ -3646,4 +3718,4 @@ declare class MitumbaClient {
|
|
|
3646
3718
|
isAuthenticated(): Promise<boolean>;
|
|
3647
3719
|
}
|
|
3648
3720
|
|
|
3649
|
-
export { APIClient, APIError, type APIErrorResponse, type Add2FAMethodInput, type Add2FAMethodResult, type AddAddressInput, type AddDepotInput, type AddPaymentMethodInput, type Address, type AdminAuditEntry, type AdminAuthStrength, type AdminListingItem, AdminModule, type AdminOperator, type AdminOrderDetail, type AdminOrderListItem, type AdminPayoutItem, type AdminPermission, type AdminPermissionDescription, type AdminRecoveryEvent, type AdminRecoveryRequest, type AdminReport, type AdminRolePreset, type AdminStoreDetail, type AdminStoreListItem, type AdminUserDetail, type AdminUserListItem, type AdminVaziOutfit, type AdminVerificationItem, type AdminWholesalePendingStore, type ApiResponse, type AttachmentDownloadAuthorization, type AttachmentUploadAuthorization, type AttachmentUploadBody, type AttachmentUploadState, type AttachmentUploadStatus, type AuthCapabilities, AuthModule, type AuthTokens, type AuthenticationResponseJSON, BALE_ORDER_STATUSES, type Bale, type BaleDetail, type BaleFeedItem, type BaleFulfillment, type BaleGrade, type BaleOrder, type BaleOrderEvent, type BaleOrderStatus, type BaleType, type BecomeBaleSellerInput, type BecomeSellerInput, type BlockedIp, type Business, type BusinessType, BusinessesModule, type BuyerResolveThreadInput, type BuyerSummary, CONDITIONS, type CartItem, CartModule, type Category, type ChangePasswordInput, type CheckoutNextAction, type CheckoutOrder, type CheckoutPaymentMethod, type CheckoutStatus, type CheckoutStatusResponse, type City, type CompleteOnboardingInput, type CompleteRecoveryResult, type Condition, type Conversation, type ConversationId, type ConversationSummary, type CreateAttachmentUploadInput, type CreateBaleInput, type CreateBaleOrderInput, type CreateListingInput, type CreateMessageBlockInput, type CreateMessageBlockResult, type CreateMessageReportInput, type CreateMessageReportResult, type CreateOrderInput, type CreateReportInput, type CreateReviewInput, type CreateStoreInput, type CursorPage, DEFAULT_SHARE_ORIGIN, DESIRED_RESOLUTIONS, DISPUTE_REASONS, DISPUTE_STATUSES, type DeliveryAddress, type DesiredResolution, type Dispute, type DisputeEvent, type DisputeEvidence, type DisputeListParams, type DisputeReason, type DisputeStatus, DisputesModule, type EmailLoginInput, type EmailRegisterInput, type FollowedStore, type ForgotPasswordInput, IDBTokenStore, type InboxRealtimeEvent, type InitiateCheckoutInput, type InitiateCheckoutResponse, type KnownPaymentProvider, LISTING_STATUSES, type LegacyLinkResolution, type LegacyMessageArchiveSummary, type LegacyMessagePage, type LegacyMessageRecord, type LinkedAccount, type LinkedAccountProvider, type ListConversationsParams, type ListThreadMessagesParams, type ListThreadsParams, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LoginInput, MailerModule, type MailerTemplate, MemoryTokenStore, type Message, type MessageAttachment, type MessageAuthor, type MessageId, type MessagePage, type MessageReportReason, type MessageResponse, MessagesModule, type MessagesRealtimeConnection, type MessagesRealtimeEnvelope, type MessagesRealtimeEvent, type MessagesRealtimeOptions, type MessagesRealtimeState, type MessagesRealtimeTicket, type MessagingCapabilities, type MessagingCursor, type MessagingErrorCode, type MessagingIdempotentRequestOptions, type MessagingInboxes, type MessagingPerspective, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationPref, type NotificationType, NotificationsModule, ORDER_STATUSES, type OperatorPermissionGrant, type Order, type OrderEvent, type OrderHistoryParams, type OrderStatus, OrdersModule, PAYMENT_STATUSES, type PaginatedResponse, PayModule, type PaymentAttemptStatus, type PaymentMethod, type PaymentMethodType, type PaymentProvider, type PaymentStatus, type PaymentStatusResponse, type PaystackInitResponse, type PaystackInput, type PendingPayoutApproval, type PhoneLoginInput, type PhoneRegisterInput, type PresignImageResponse, type ProviderId, type PublicKeyCredentialCreationOptionsJSON, type PublicKeyCredentialRequestOptionsJSON, type RaiseDisputeInput, type ReadCursorResult, RealtimeProtocolError, RealtimeUnavailableError, type RecoveryStatus, type RecoveryStatusResult, type RegenerateBackupCodesResult, type RegisterInput, type RegistrationResponseJSON, ReportsModule, type RequestOptions, type RequestRecoveryInput, type RequestRecoveryResult, type ResetPasswordInput, type ResolveDisputeInput, type ResolveThreadResult, type RespondDisputeInput, type Review, type ReviewableOrder, ReviewsModule, type RootSetupInput, type RootSetupResult, type SaveSearchInput, type SaveWholesaleStoreInput, type SearchHistoryItem, SearchModule, type SearchParams, type SearchResult, type SellerProfile, type SellerStorefront, type SellerType, type SendEmailInput, type SendMessageInput, type SendOtpInput, type SendThreadMessageInput, type SendThreadMessageResult, type Session, SettingsModule, type ShareUrlOptions, type SimilarListing, type StiEvent, type StkPushInput, type StkPushResponse, type Store, type StoreAnalytics, type StoreResolveThreadInput, type StoreSettings, type StoreStats, type StoreSummary, StoresModule, type SubscriptionTier, type SystemStats, TWO_FACTOR_METHOD_TYPES, type ThreadCard, type ThreadId, type ThreadMessage, type ThreadSubject, type ThreadSystemEvent, type ThreadTimelineItem, type ThreadTimelineItemId, type TokenStore, type TransitionOrderInput, type TrendingTerm, type TwoFactorMethod, type TwoFactorMethodType, type TwoFactorRequired, type UpdateBusinessInput, type UpdateConversationPreferencesInput, type UpdateListingInput, type UpdateProfileInput, type UpdateStoreInput, type UpdateThreadPreferencesInput, UploadsModule, type UserProfile, type VAZIOutfit, type VAZIOutfitDetail, type VAZIOutfitDetailItem, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type Verify2FAInput, type VerifyOtpInput, type WebSocketCloseEventLike, type WebSocketFactory, type WebSocketLike, type WebSocketMessageEventLike, type WholesaleDepot, type WholesaleFeedParams, WholesaleModule, type WholesaleStore, type WishlistListing, WishlistsModule, baleShareUrl, createTokenStore, isMessagingAPIError, listingShareUrl, storeShareUrl };
|
|
3721
|
+
export { APIClient, APIError, type APIErrorResponse, type Add2FAMethodInput, type Add2FAMethodResult, type AddAddressInput, type AddDepotInput, type AddPaymentMethodInput, type Address, type AdminAuditEntry, type AdminAuthStrength, type AdminListingItem, AdminModule, type AdminOperator, type AdminOrderDetail, type AdminOrderListItem, type AdminPayoutItem, type AdminPermission, type AdminPermissionDescription, type AdminRecoveryEvent, type AdminRecoveryRequest, type AdminReport, type AdminRolePreset, type AdminStoreDetail, type AdminStoreListItem, type AdminUserDetail, type AdminUserListItem, type AdminVaziOutfit, type AdminVerificationItem, type AdminWholesalePendingStore, type ApiResponse, type AttachmentDownloadAuthorization, type AttachmentUploadAuthorization, type AttachmentUploadBody, type AttachmentUploadState, type AttachmentUploadStatus, type AuthCapabilities, AuthModule, type AuthTokens, type AuthenticationResponseJSON, BALE_ORDER_STATUSES, type Bale, type BaleDetail, type BaleFeedItem, type BaleFulfillment, type BaleGrade, type BaleImageUploadResult, type BaleOrder, type BaleOrderEvent, type BaleOrderStatus, type BaleType, type BecomeBaleSellerInput, type BecomeSellerInput, type BlockedIp, type Business, type BusinessType, BusinessesModule, type BuyerResolveThreadInput, type BuyerSummary, CONDITIONS, type CartItem, CartModule, type Category, type ChangePasswordInput, type CheckoutNextAction, type CheckoutOrder, type CheckoutPaymentMethod, type CheckoutStatus, type CheckoutStatusResponse, type City, type CompleteOnboardingInput, type CompleteRecoveryResult, type Condition, type Conversation, type ConversationId, type ConversationSummary, type CreateAttachmentUploadInput, type CreateBaleInput, type CreateBaleOrderInput, type CreateListingInput, type CreateMessageBlockInput, type CreateMessageBlockResult, type CreateMessageReportInput, type CreateMessageReportResult, type CreateOrderInput, type CreateReportInput, type CreateReviewInput, type CreateStoreInput, type CursorPage, DEFAULT_SHARE_ORIGIN, DESIRED_RESOLUTIONS, DISPUTE_REASONS, DISPUTE_STATUSES, type DeliveryAddress, type DesiredResolution, type Dispute, type DisputeEvent, type DisputeEvidence, type DisputeListParams, type DisputeReason, type DisputeStatus, DisputesModule, type EmailLoginInput, type EmailRegisterInput, type FollowedStore, type ForgotPasswordInput, IDBTokenStore, type InboxRealtimeEvent, type InitiateCheckoutInput, type InitiateCheckoutResponse, type KnownPaymentProvider, LISTING_STATUSES, type LegacyLinkResolution, type LegacyMessageArchiveSummary, type LegacyMessagePage, type LegacyMessageRecord, type LinkedAccount, type LinkedAccountProvider, type ListConversationsParams, type ListThreadMessagesParams, type ListThreadsParams, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LoginInput, MailerModule, type MailerTemplate, MemoryTokenStore, type Message, type MessageAttachment, type MessageAuthor, type MessageId, type MessagePage, type MessageReportReason, type MessageResponse, MessagesModule, type MessagesRealtimeConnection, type MessagesRealtimeEnvelope, type MessagesRealtimeEvent, type MessagesRealtimeOptions, type MessagesRealtimeState, type MessagesRealtimeTicket, type MessagingCapabilities, type MessagingCursor, type MessagingErrorCode, type MessagingIdempotentRequestOptions, type MessagingInboxes, type MessagingPerspective, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationPref, type NotificationType, NotificationsModule, ORDER_STATUSES, type OperatorPermissionGrant, type Order, type OrderEvent, type OrderHistoryParams, type OrderStatus, OrdersModule, PAYMENT_STATUSES, type PaginatedResponse, PayModule, type PaymentAttemptStatus, type PaymentMethod, type PaymentMethodType, type PaymentProvider, type PaymentStatus, type PaymentStatusResponse, type PaystackInitResponse, type PaystackInput, type PendingPayoutApproval, type PhoneLoginInput, type PhoneRegisterInput, type PresignImageResponse, type ProviderId, type PublicKeyCredentialCreationOptionsJSON, type PublicKeyCredentialRequestOptionsJSON, type RaiseDisputeInput, type ReadCursorResult, RealtimeProtocolError, RealtimeUnavailableError, type RecoveryStatus, type RecoveryStatusResult, type RegenerateBackupCodesResult, type RegisterInput, type RegistrationResponseJSON, ReportsModule, type RequestOptions, type RequestRecoveryInput, type RequestRecoveryResult, type ResetPasswordInput, type ResolveDisputeInput, type ResolveThreadResult, type RespondDisputeInput, type Review, type ReviewableOrder, ReviewsModule, type RootSetupInput, type RootSetupResult, type SaveSearchInput, type SaveWholesaleStoreInput, type SearchHistoryItem, SearchModule, type SearchParams, type SearchResult, type SellerProfile, type SellerStorefront, type SellerType, type SendEmailInput, type SendMessageInput, type SendOtpInput, type SendThreadMessageInput, type SendThreadMessageResult, type Session, SettingsModule, type ShareUrlOptions, type SimilarListing, type StiEvent, type StkPushInput, type StkPushResponse, type Store, type StoreAnalytics, type StoreResolveThreadInput, type StoreSettings, type StoreStats, type StoreSummary, StoresModule, type SubscriptionTier, type SystemStats, TWO_FACTOR_METHOD_TYPES, type ThreadCard, type ThreadId, type ThreadMessage, type ThreadSubject, type ThreadSystemEvent, type ThreadTimelineItem, type ThreadTimelineItemId, type TokenStore, type TransitionOrderInput, type TrendingTerm, type TwoFactorMethod, type TwoFactorMethodType, type TwoFactorRequired, type UpdateBusinessInput, type UpdateConversationPreferencesInput, type UpdateListingInput, type UpdateProfileInput, type UpdateStoreInput, type UpdateThreadPreferencesInput, UploadsModule, type UserProfile, type VAZIOutfit, type VAZIOutfitDetail, type VAZIOutfitDetailItem, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type Verify2FAInput, type VerifyOtpInput, type WebSocketCloseEventLike, type WebSocketFactory, type WebSocketLike, type WebSocketMessageEventLike, type WholesaleAnalytics, type WholesaleDepot, type WholesaleFeedParams, WholesaleModule, type WholesaleStore, type WishlistListing, WishlistsModule, baleShareUrl, createTokenStore, isMessagingAPIError, listingShareUrl, storeShareUrl };
|
package/dist/index.d.ts
CHANGED
|
@@ -1642,6 +1642,43 @@ interface CreateBaleOrderInput {
|
|
|
1642
1642
|
qty?: number;
|
|
1643
1643
|
fulfillment: BaleFulfillment;
|
|
1644
1644
|
}
|
|
1645
|
+
/**
|
|
1646
|
+
* Result of uploading a bale image directly via multipart/form-data. Mirrors the listing image
|
|
1647
|
+
* upload result; the presign step reuses `PresignImageResponse` from the listings types.
|
|
1648
|
+
*/
|
|
1649
|
+
interface BaleImageUploadResult {
|
|
1650
|
+
r2_key: string;
|
|
1651
|
+
image_id: string;
|
|
1652
|
+
url: string;
|
|
1653
|
+
}
|
|
1654
|
+
/**
|
|
1655
|
+
* Performance analytics for a wholesale store. Mirrors the retail `StoreAnalytics` shape where it
|
|
1656
|
+
* applies (revenue series, order breakdown) and adapts the rest to bales (top bales, bale totals).
|
|
1657
|
+
*/
|
|
1658
|
+
interface WholesaleAnalytics {
|
|
1659
|
+
revenue: {
|
|
1660
|
+
date: string;
|
|
1661
|
+
revenue: number;
|
|
1662
|
+
orders: number;
|
|
1663
|
+
}[];
|
|
1664
|
+
orders_breakdown: {
|
|
1665
|
+
date: string;
|
|
1666
|
+
completed: number;
|
|
1667
|
+
pending: number;
|
|
1668
|
+
cancelled: number;
|
|
1669
|
+
}[];
|
|
1670
|
+
top_bales: {
|
|
1671
|
+
bale_id: string;
|
|
1672
|
+
title: string;
|
|
1673
|
+
orders: number;
|
|
1674
|
+
revenue: number;
|
|
1675
|
+
}[];
|
|
1676
|
+
totals: {
|
|
1677
|
+
bales: number;
|
|
1678
|
+
orders: number;
|
|
1679
|
+
revenue: number;
|
|
1680
|
+
};
|
|
1681
|
+
}
|
|
1645
1682
|
|
|
1646
1683
|
interface StkPushInput {
|
|
1647
1684
|
order_id: string;
|
|
@@ -3541,6 +3578,25 @@ declare class WholesaleModule {
|
|
|
3541
3578
|
myBales(options?: RequestOptions): Promise<{
|
|
3542
3579
|
data: Bale[];
|
|
3543
3580
|
}>;
|
|
3581
|
+
/**
|
|
3582
|
+
* Presign a bale image upload slot (requires the owning wholesale store).
|
|
3583
|
+
*
|
|
3584
|
+
* @param baleId - The bale to attach the image to
|
|
3585
|
+
* @param index - The slot index; slot 0 is the cover
|
|
3586
|
+
* @returns The storage key and image id for the slot
|
|
3587
|
+
* @throws {APIError} On network or server errors
|
|
3588
|
+
*/
|
|
3589
|
+
presignBaleImage(baleId: string, index: number, options?: RequestOptions): Promise<PresignImageResponse>;
|
|
3590
|
+
/**
|
|
3591
|
+
* Upload a bale image file directly. Uses multipart/form-data. Slot 0 is the cover.
|
|
3592
|
+
*
|
|
3593
|
+
* @param baleId - The bale to attach the image to
|
|
3594
|
+
* @param file - The image file as a `Blob` (React Native passes a `{ uri, name, type }` part)
|
|
3595
|
+
* @param index - The slot index; slot 0 is the cover
|
|
3596
|
+
* @returns The storage key, image id, and public URL
|
|
3597
|
+
* @throws {APIError} On network or server errors
|
|
3598
|
+
*/
|
|
3599
|
+
uploadBaleImage(baleId: string, file: Blob, index: number, options?: RequestOptions): Promise<BaleImageUploadResult>;
|
|
3544
3600
|
/** Browse the wholesale bale feed (public). */
|
|
3545
3601
|
wholesaleFeed(params?: WholesaleFeedParams, options?: RequestOptions): Promise<{
|
|
3546
3602
|
data: BaleFeedItem[];
|
|
@@ -3569,6 +3625,22 @@ declare class WholesaleModule {
|
|
|
3569
3625
|
ok: true;
|
|
3570
3626
|
status: BaleOrderStatus;
|
|
3571
3627
|
}>;
|
|
3628
|
+
/**
|
|
3629
|
+
* Get performance analytics for the current user's wholesale store (bale_seller only).
|
|
3630
|
+
*
|
|
3631
|
+
* The wholesale store is resolved server-side from the session, so no store id is passed — the
|
|
3632
|
+
* same way `getWholesaleStore`, `myBales`, and `incomingBaleOrders` work.
|
|
3633
|
+
*
|
|
3634
|
+
* @param period - Optional granularity; defaults to the server's default window
|
|
3635
|
+
* @returns Revenue series, order breakdown, top bales, and totals
|
|
3636
|
+
* @throws {APIError} On network or server errors
|
|
3637
|
+
*
|
|
3638
|
+
* @example
|
|
3639
|
+
* ```typescript
|
|
3640
|
+
* const analytics = await sdk.wholesale.getAnalytics('weekly')
|
|
3641
|
+
* ```
|
|
3642
|
+
*/
|
|
3643
|
+
getAnalytics(period?: 'daily' | 'weekly' | 'monthly', options?: RequestOptions): Promise<WholesaleAnalytics>;
|
|
3572
3644
|
}
|
|
3573
3645
|
|
|
3574
3646
|
/**
|
|
@@ -3646,4 +3718,4 @@ declare class MitumbaClient {
|
|
|
3646
3718
|
isAuthenticated(): Promise<boolean>;
|
|
3647
3719
|
}
|
|
3648
3720
|
|
|
3649
|
-
export { APIClient, APIError, type APIErrorResponse, type Add2FAMethodInput, type Add2FAMethodResult, type AddAddressInput, type AddDepotInput, type AddPaymentMethodInput, type Address, type AdminAuditEntry, type AdminAuthStrength, type AdminListingItem, AdminModule, type AdminOperator, type AdminOrderDetail, type AdminOrderListItem, type AdminPayoutItem, type AdminPermission, type AdminPermissionDescription, type AdminRecoveryEvent, type AdminRecoveryRequest, type AdminReport, type AdminRolePreset, type AdminStoreDetail, type AdminStoreListItem, type AdminUserDetail, type AdminUserListItem, type AdminVaziOutfit, type AdminVerificationItem, type AdminWholesalePendingStore, type ApiResponse, type AttachmentDownloadAuthorization, type AttachmentUploadAuthorization, type AttachmentUploadBody, type AttachmentUploadState, type AttachmentUploadStatus, type AuthCapabilities, AuthModule, type AuthTokens, type AuthenticationResponseJSON, BALE_ORDER_STATUSES, type Bale, type BaleDetail, type BaleFeedItem, type BaleFulfillment, type BaleGrade, type BaleOrder, type BaleOrderEvent, type BaleOrderStatus, type BaleType, type BecomeBaleSellerInput, type BecomeSellerInput, type BlockedIp, type Business, type BusinessType, BusinessesModule, type BuyerResolveThreadInput, type BuyerSummary, CONDITIONS, type CartItem, CartModule, type Category, type ChangePasswordInput, type CheckoutNextAction, type CheckoutOrder, type CheckoutPaymentMethod, type CheckoutStatus, type CheckoutStatusResponse, type City, type CompleteOnboardingInput, type CompleteRecoveryResult, type Condition, type Conversation, type ConversationId, type ConversationSummary, type CreateAttachmentUploadInput, type CreateBaleInput, type CreateBaleOrderInput, type CreateListingInput, type CreateMessageBlockInput, type CreateMessageBlockResult, type CreateMessageReportInput, type CreateMessageReportResult, type CreateOrderInput, type CreateReportInput, type CreateReviewInput, type CreateStoreInput, type CursorPage, DEFAULT_SHARE_ORIGIN, DESIRED_RESOLUTIONS, DISPUTE_REASONS, DISPUTE_STATUSES, type DeliveryAddress, type DesiredResolution, type Dispute, type DisputeEvent, type DisputeEvidence, type DisputeListParams, type DisputeReason, type DisputeStatus, DisputesModule, type EmailLoginInput, type EmailRegisterInput, type FollowedStore, type ForgotPasswordInput, IDBTokenStore, type InboxRealtimeEvent, type InitiateCheckoutInput, type InitiateCheckoutResponse, type KnownPaymentProvider, LISTING_STATUSES, type LegacyLinkResolution, type LegacyMessageArchiveSummary, type LegacyMessagePage, type LegacyMessageRecord, type LinkedAccount, type LinkedAccountProvider, type ListConversationsParams, type ListThreadMessagesParams, type ListThreadsParams, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LoginInput, MailerModule, type MailerTemplate, MemoryTokenStore, type Message, type MessageAttachment, type MessageAuthor, type MessageId, type MessagePage, type MessageReportReason, type MessageResponse, MessagesModule, type MessagesRealtimeConnection, type MessagesRealtimeEnvelope, type MessagesRealtimeEvent, type MessagesRealtimeOptions, type MessagesRealtimeState, type MessagesRealtimeTicket, type MessagingCapabilities, type MessagingCursor, type MessagingErrorCode, type MessagingIdempotentRequestOptions, type MessagingInboxes, type MessagingPerspective, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationPref, type NotificationType, NotificationsModule, ORDER_STATUSES, type OperatorPermissionGrant, type Order, type OrderEvent, type OrderHistoryParams, type OrderStatus, OrdersModule, PAYMENT_STATUSES, type PaginatedResponse, PayModule, type PaymentAttemptStatus, type PaymentMethod, type PaymentMethodType, type PaymentProvider, type PaymentStatus, type PaymentStatusResponse, type PaystackInitResponse, type PaystackInput, type PendingPayoutApproval, type PhoneLoginInput, type PhoneRegisterInput, type PresignImageResponse, type ProviderId, type PublicKeyCredentialCreationOptionsJSON, type PublicKeyCredentialRequestOptionsJSON, type RaiseDisputeInput, type ReadCursorResult, RealtimeProtocolError, RealtimeUnavailableError, type RecoveryStatus, type RecoveryStatusResult, type RegenerateBackupCodesResult, type RegisterInput, type RegistrationResponseJSON, ReportsModule, type RequestOptions, type RequestRecoveryInput, type RequestRecoveryResult, type ResetPasswordInput, type ResolveDisputeInput, type ResolveThreadResult, type RespondDisputeInput, type Review, type ReviewableOrder, ReviewsModule, type RootSetupInput, type RootSetupResult, type SaveSearchInput, type SaveWholesaleStoreInput, type SearchHistoryItem, SearchModule, type SearchParams, type SearchResult, type SellerProfile, type SellerStorefront, type SellerType, type SendEmailInput, type SendMessageInput, type SendOtpInput, type SendThreadMessageInput, type SendThreadMessageResult, type Session, SettingsModule, type ShareUrlOptions, type SimilarListing, type StiEvent, type StkPushInput, type StkPushResponse, type Store, type StoreAnalytics, type StoreResolveThreadInput, type StoreSettings, type StoreStats, type StoreSummary, StoresModule, type SubscriptionTier, type SystemStats, TWO_FACTOR_METHOD_TYPES, type ThreadCard, type ThreadId, type ThreadMessage, type ThreadSubject, type ThreadSystemEvent, type ThreadTimelineItem, type ThreadTimelineItemId, type TokenStore, type TransitionOrderInput, type TrendingTerm, type TwoFactorMethod, type TwoFactorMethodType, type TwoFactorRequired, type UpdateBusinessInput, type UpdateConversationPreferencesInput, type UpdateListingInput, type UpdateProfileInput, type UpdateStoreInput, type UpdateThreadPreferencesInput, UploadsModule, type UserProfile, type VAZIOutfit, type VAZIOutfitDetail, type VAZIOutfitDetailItem, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type Verify2FAInput, type VerifyOtpInput, type WebSocketCloseEventLike, type WebSocketFactory, type WebSocketLike, type WebSocketMessageEventLike, type WholesaleDepot, type WholesaleFeedParams, WholesaleModule, type WholesaleStore, type WishlistListing, WishlistsModule, baleShareUrl, createTokenStore, isMessagingAPIError, listingShareUrl, storeShareUrl };
|
|
3721
|
+
export { APIClient, APIError, type APIErrorResponse, type Add2FAMethodInput, type Add2FAMethodResult, type AddAddressInput, type AddDepotInput, type AddPaymentMethodInput, type Address, type AdminAuditEntry, type AdminAuthStrength, type AdminListingItem, AdminModule, type AdminOperator, type AdminOrderDetail, type AdminOrderListItem, type AdminPayoutItem, type AdminPermission, type AdminPermissionDescription, type AdminRecoveryEvent, type AdminRecoveryRequest, type AdminReport, type AdminRolePreset, type AdminStoreDetail, type AdminStoreListItem, type AdminUserDetail, type AdminUserListItem, type AdminVaziOutfit, type AdminVerificationItem, type AdminWholesalePendingStore, type ApiResponse, type AttachmentDownloadAuthorization, type AttachmentUploadAuthorization, type AttachmentUploadBody, type AttachmentUploadState, type AttachmentUploadStatus, type AuthCapabilities, AuthModule, type AuthTokens, type AuthenticationResponseJSON, BALE_ORDER_STATUSES, type Bale, type BaleDetail, type BaleFeedItem, type BaleFulfillment, type BaleGrade, type BaleImageUploadResult, type BaleOrder, type BaleOrderEvent, type BaleOrderStatus, type BaleType, type BecomeBaleSellerInput, type BecomeSellerInput, type BlockedIp, type Business, type BusinessType, BusinessesModule, type BuyerResolveThreadInput, type BuyerSummary, CONDITIONS, type CartItem, CartModule, type Category, type ChangePasswordInput, type CheckoutNextAction, type CheckoutOrder, type CheckoutPaymentMethod, type CheckoutStatus, type CheckoutStatusResponse, type City, type CompleteOnboardingInput, type CompleteRecoveryResult, type Condition, type Conversation, type ConversationId, type ConversationSummary, type CreateAttachmentUploadInput, type CreateBaleInput, type CreateBaleOrderInput, type CreateListingInput, type CreateMessageBlockInput, type CreateMessageBlockResult, type CreateMessageReportInput, type CreateMessageReportResult, type CreateOrderInput, type CreateReportInput, type CreateReviewInput, type CreateStoreInput, type CursorPage, DEFAULT_SHARE_ORIGIN, DESIRED_RESOLUTIONS, DISPUTE_REASONS, DISPUTE_STATUSES, type DeliveryAddress, type DesiredResolution, type Dispute, type DisputeEvent, type DisputeEvidence, type DisputeListParams, type DisputeReason, type DisputeStatus, DisputesModule, type EmailLoginInput, type EmailRegisterInput, type FollowedStore, type ForgotPasswordInput, IDBTokenStore, type InboxRealtimeEvent, type InitiateCheckoutInput, type InitiateCheckoutResponse, type KnownPaymentProvider, LISTING_STATUSES, type LegacyLinkResolution, type LegacyMessageArchiveSummary, type LegacyMessagePage, type LegacyMessageRecord, type LinkedAccount, type LinkedAccountProvider, type ListConversationsParams, type ListThreadMessagesParams, type ListThreadsParams, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LoginInput, MailerModule, type MailerTemplate, MemoryTokenStore, type Message, type MessageAttachment, type MessageAuthor, type MessageId, type MessagePage, type MessageReportReason, type MessageResponse, MessagesModule, type MessagesRealtimeConnection, type MessagesRealtimeEnvelope, type MessagesRealtimeEvent, type MessagesRealtimeOptions, type MessagesRealtimeState, type MessagesRealtimeTicket, type MessagingCapabilities, type MessagingCursor, type MessagingErrorCode, type MessagingIdempotentRequestOptions, type MessagingInboxes, type MessagingPerspective, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationPref, type NotificationType, NotificationsModule, ORDER_STATUSES, type OperatorPermissionGrant, type Order, type OrderEvent, type OrderHistoryParams, type OrderStatus, OrdersModule, PAYMENT_STATUSES, type PaginatedResponse, PayModule, type PaymentAttemptStatus, type PaymentMethod, type PaymentMethodType, type PaymentProvider, type PaymentStatus, type PaymentStatusResponse, type PaystackInitResponse, type PaystackInput, type PendingPayoutApproval, type PhoneLoginInput, type PhoneRegisterInput, type PresignImageResponse, type ProviderId, type PublicKeyCredentialCreationOptionsJSON, type PublicKeyCredentialRequestOptionsJSON, type RaiseDisputeInput, type ReadCursorResult, RealtimeProtocolError, RealtimeUnavailableError, type RecoveryStatus, type RecoveryStatusResult, type RegenerateBackupCodesResult, type RegisterInput, type RegistrationResponseJSON, ReportsModule, type RequestOptions, type RequestRecoveryInput, type RequestRecoveryResult, type ResetPasswordInput, type ResolveDisputeInput, type ResolveThreadResult, type RespondDisputeInput, type Review, type ReviewableOrder, ReviewsModule, type RootSetupInput, type RootSetupResult, type SaveSearchInput, type SaveWholesaleStoreInput, type SearchHistoryItem, SearchModule, type SearchParams, type SearchResult, type SellerProfile, type SellerStorefront, type SellerType, type SendEmailInput, type SendMessageInput, type SendOtpInput, type SendThreadMessageInput, type SendThreadMessageResult, type Session, SettingsModule, type ShareUrlOptions, type SimilarListing, type StiEvent, type StkPushInput, type StkPushResponse, type Store, type StoreAnalytics, type StoreResolveThreadInput, type StoreSettings, type StoreStats, type StoreSummary, StoresModule, type SubscriptionTier, type SystemStats, TWO_FACTOR_METHOD_TYPES, type ThreadCard, type ThreadId, type ThreadMessage, type ThreadSubject, type ThreadSystemEvent, type ThreadTimelineItem, type ThreadTimelineItemId, type TokenStore, type TransitionOrderInput, type TrendingTerm, type TwoFactorMethod, type TwoFactorMethodType, type TwoFactorRequired, type UpdateBusinessInput, type UpdateConversationPreferencesInput, type UpdateListingInput, type UpdateProfileInput, type UpdateStoreInput, type UpdateThreadPreferencesInput, UploadsModule, type UserProfile, type VAZIOutfit, type VAZIOutfitDetail, type VAZIOutfitDetailItem, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type Verify2FAInput, type VerifyOtpInput, type WebSocketCloseEventLike, type WebSocketFactory, type WebSocketLike, type WebSocketMessageEventLike, type WholesaleAnalytics, type WholesaleDepot, type WholesaleFeedParams, WholesaleModule, type WholesaleStore, type WishlistListing, WishlistsModule, baleShareUrl, createTokenStore, isMessagingAPIError, listingShareUrl, storeShareUrl };
|
package/dist/index.js
CHANGED
|
@@ -2315,6 +2315,33 @@ var WholesaleModule = class {
|
|
|
2315
2315
|
async myBales(options) {
|
|
2316
2316
|
return this.client.get("/listings/wholesale/mine/bales", void 0, options);
|
|
2317
2317
|
}
|
|
2318
|
+
// ── Bale Images ──
|
|
2319
|
+
/**
|
|
2320
|
+
* Presign a bale image upload slot (requires the owning wholesale store).
|
|
2321
|
+
*
|
|
2322
|
+
* @param baleId - The bale to attach the image to
|
|
2323
|
+
* @param index - The slot index; slot 0 is the cover
|
|
2324
|
+
* @returns The storage key and image id for the slot
|
|
2325
|
+
* @throws {APIError} On network or server errors
|
|
2326
|
+
*/
|
|
2327
|
+
async presignBaleImage(baleId, index, options) {
|
|
2328
|
+
return this.client.post(`/listings/bales/${baleId}/images/presign`, { index }, options);
|
|
2329
|
+
}
|
|
2330
|
+
/**
|
|
2331
|
+
* Upload a bale image file directly. Uses multipart/form-data. Slot 0 is the cover.
|
|
2332
|
+
*
|
|
2333
|
+
* @param baleId - The bale to attach the image to
|
|
2334
|
+
* @param file - The image file as a `Blob` (React Native passes a `{ uri, name, type }` part)
|
|
2335
|
+
* @param index - The slot index; slot 0 is the cover
|
|
2336
|
+
* @returns The storage key, image id, and public URL
|
|
2337
|
+
* @throws {APIError} On network or server errors
|
|
2338
|
+
*/
|
|
2339
|
+
async uploadBaleImage(baleId, file, index, options) {
|
|
2340
|
+
const formData = new FormData();
|
|
2341
|
+
formData.append("file", file);
|
|
2342
|
+
formData.append("index", String(index));
|
|
2343
|
+
return this.client.post(`/listings/bales/${baleId}/images/upload`, formData, options);
|
|
2344
|
+
}
|
|
2318
2345
|
// ── Feed ──
|
|
2319
2346
|
/** Browse the wholesale bale feed (public). */
|
|
2320
2347
|
async wholesaleFeed(params, options) {
|
|
@@ -2345,6 +2372,25 @@ var WholesaleModule = class {
|
|
|
2345
2372
|
async transitionBaleOrder(id, action, options) {
|
|
2346
2373
|
return this.client.post(`/listings/bale-orders/${id}/transition`, { action }, options);
|
|
2347
2374
|
}
|
|
2375
|
+
// ── Analytics ──
|
|
2376
|
+
/**
|
|
2377
|
+
* Get performance analytics for the current user's wholesale store (bale_seller only).
|
|
2378
|
+
*
|
|
2379
|
+
* The wholesale store is resolved server-side from the session, so no store id is passed — the
|
|
2380
|
+
* same way `getWholesaleStore`, `myBales`, and `incomingBaleOrders` work.
|
|
2381
|
+
*
|
|
2382
|
+
* @param period - Optional granularity; defaults to the server's default window
|
|
2383
|
+
* @returns Revenue series, order breakdown, top bales, and totals
|
|
2384
|
+
* @throws {APIError} On network or server errors
|
|
2385
|
+
*
|
|
2386
|
+
* @example
|
|
2387
|
+
* ```typescript
|
|
2388
|
+
* const analytics = await sdk.wholesale.getAnalytics('weekly')
|
|
2389
|
+
* ```
|
|
2390
|
+
*/
|
|
2391
|
+
async getAnalytics(period, options) {
|
|
2392
|
+
return this.client.get("/listings/wholesale/analytics", period ? { period } : void 0, options);
|
|
2393
|
+
}
|
|
2348
2394
|
};
|
|
2349
2395
|
|
|
2350
2396
|
// src/types/auth.ts
|