@mitumba/sdk 5.17.0 → 5.18.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 +212 -81
- package/dist/index.d.ts +212 -81
- package/dist/index.js +33 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -841,6 +841,86 @@ interface MessagingBlockRemovedResult {
|
|
|
841
841
|
active: false;
|
|
842
842
|
}
|
|
843
843
|
|
|
844
|
+
/** @deprecated Use ConversationSummary from Messaging v2. */
|
|
845
|
+
interface Conversation {
|
|
846
|
+
partner_id: string;
|
|
847
|
+
partner_name: string;
|
|
848
|
+
store_name?: string | null;
|
|
849
|
+
body: string;
|
|
850
|
+
created_at: string;
|
|
851
|
+
store_id?: string | null;
|
|
852
|
+
listing_id?: string | null;
|
|
853
|
+
listing_title?: string | null;
|
|
854
|
+
unread_count: number;
|
|
855
|
+
}
|
|
856
|
+
/** @deprecated Use ThreadMessage from Messaging v2. */
|
|
857
|
+
interface Message {
|
|
858
|
+
id: string;
|
|
859
|
+
sender_id: string;
|
|
860
|
+
receiver_id: string;
|
|
861
|
+
body: string;
|
|
862
|
+
listing_id: string | null;
|
|
863
|
+
store_id: string | null;
|
|
864
|
+
order_id?: string | null;
|
|
865
|
+
from_store?: number;
|
|
866
|
+
read_at: string | null;
|
|
867
|
+
created_at: string;
|
|
868
|
+
}
|
|
869
|
+
/** @deprecated Resolve a thread and use SendThreadMessageInput. Context fields are server-validated hints. */
|
|
870
|
+
interface SendMessageInput {
|
|
871
|
+
receiver_id: string;
|
|
872
|
+
body: string;
|
|
873
|
+
listing_id?: string;
|
|
874
|
+
store_id?: string;
|
|
875
|
+
order_id?: string;
|
|
876
|
+
from_store?: boolean;
|
|
877
|
+
}
|
|
878
|
+
/** @deprecated Use validated managed Messaging realtime events. */
|
|
879
|
+
interface InboxRealtimeEvent {
|
|
880
|
+
type: 'message';
|
|
881
|
+
conversation_key: string;
|
|
882
|
+
partner_id: string;
|
|
883
|
+
store_id?: string | null;
|
|
884
|
+
from_store?: boolean;
|
|
885
|
+
preview: string;
|
|
886
|
+
created_at: string;
|
|
887
|
+
unread_count?: number;
|
|
888
|
+
}
|
|
889
|
+
/** Recipient-safe reason for a message or conversation report. */
|
|
890
|
+
type MessageReportReason = 'off_platform_payment' | 'contact_sharing' | 'spam' | 'scam' | 'harassment' | 'counterfeit' | 'offensive' | 'other';
|
|
891
|
+
/** Typed report input for a message or buyer/store conversation. */
|
|
892
|
+
type CreateMessageReportInput = {
|
|
893
|
+
subject_kind: 'message';
|
|
894
|
+
message_id: string;
|
|
895
|
+
reason: MessageReportReason;
|
|
896
|
+
detail?: string;
|
|
897
|
+
} | {
|
|
898
|
+
subject_kind: 'conversation';
|
|
899
|
+
partner_id: string;
|
|
900
|
+
store_id: string;
|
|
901
|
+
reason: MessageReportReason;
|
|
902
|
+
detail?: string;
|
|
903
|
+
};
|
|
904
|
+
/** Idempotent open-report result. */
|
|
905
|
+
interface CreateMessageReportResult {
|
|
906
|
+
id: string;
|
|
907
|
+
status: 'open';
|
|
908
|
+
deduplicated: boolean;
|
|
909
|
+
}
|
|
910
|
+
/** Context used to block one buyer/store relationship. */
|
|
911
|
+
interface CreateMessageBlockInput {
|
|
912
|
+
partner_id: string;
|
|
913
|
+
store_id: string;
|
|
914
|
+
from_store?: boolean;
|
|
915
|
+
reason?: string;
|
|
916
|
+
}
|
|
917
|
+
/** Idempotent active-block result. */
|
|
918
|
+
interface CreateMessageBlockResult {
|
|
919
|
+
id: string;
|
|
920
|
+
active: true;
|
|
921
|
+
deduplicated: boolean;
|
|
922
|
+
}
|
|
923
|
+
|
|
844
924
|
interface BlockedIp {
|
|
845
925
|
ip: string;
|
|
846
926
|
reason: string;
|
|
@@ -988,6 +1068,114 @@ interface AdminPayoutItem {
|
|
|
988
1068
|
status: 'pending' | 'sent' | 'failed';
|
|
989
1069
|
on_hold: boolean;
|
|
990
1070
|
created_at: string;
|
|
1071
|
+
/**
|
|
1072
|
+
* True for a Daraja payout that was submitted (`sent`) but whose provider reference was never
|
|
1073
|
+
* stored, so its result cannot be matched. Repair it with `admin.repairPayoutCorrelation()`.
|
|
1074
|
+
*/
|
|
1075
|
+
needs_correlation?: boolean;
|
|
1076
|
+
}
|
|
1077
|
+
type MessageReportStatus = 'open' | 'reviewed' | 'dismissed' | 'actioned';
|
|
1078
|
+
type MessageReportOutcome = 'upheld' | 'not_upheld';
|
|
1079
|
+
type MessagingSide = 'buyer' | 'store';
|
|
1080
|
+
/** One reported conversation or message in the safety queue, from `admin.listMessageReports()`. */
|
|
1081
|
+
interface AdminMessageReport {
|
|
1082
|
+
id: string;
|
|
1083
|
+
reporter_principal_kind: MessagingSide;
|
|
1084
|
+
reporter_principal_id: string;
|
|
1085
|
+
conversation_id: string;
|
|
1086
|
+
thread_id: string;
|
|
1087
|
+
message_id: string | null;
|
|
1088
|
+
subject_kind: 'conversation' | 'message';
|
|
1089
|
+
/** The side of the conversation being reported. */
|
|
1090
|
+
reported_side: MessagingSide;
|
|
1091
|
+
reason: MessageReportReason | string;
|
|
1092
|
+
detail: string | null;
|
|
1093
|
+
status: MessageReportStatus;
|
|
1094
|
+
outcome: MessageReportOutcome | null;
|
|
1095
|
+
created_at: string;
|
|
1096
|
+
thread_kind: string;
|
|
1097
|
+
thread_title: string | null;
|
|
1098
|
+
/** The reported message as delivered (contact details already masked), when one is reported. */
|
|
1099
|
+
message_body: string | null;
|
|
1100
|
+
/** 1 when the platform masked part of the delivered message. */
|
|
1101
|
+
body_modified: number | null;
|
|
1102
|
+
/** The reported principal (a buyer's users.id or a store id). */
|
|
1103
|
+
subject_principal_id: string;
|
|
1104
|
+
/** Masked contact or payment attempts by the reported principal in the last 24 hours. */
|
|
1105
|
+
masked_attempts_24h: number;
|
|
1106
|
+
/** Reports against the reported principal upheld in the last 30 days. */
|
|
1107
|
+
upheld_reports_30d: number;
|
|
1108
|
+
/** `high` once either signal reaches its threshold. It orders the queue; it decides nothing. */
|
|
1109
|
+
priority: 'high' | 'standard';
|
|
1110
|
+
}
|
|
1111
|
+
interface AdminMessageReportList {
|
|
1112
|
+
data: AdminMessageReport[];
|
|
1113
|
+
page: number;
|
|
1114
|
+
page_size: number;
|
|
1115
|
+
thresholds: {
|
|
1116
|
+
masked_attempts_24h: number;
|
|
1117
|
+
upheld_reports_30d: number;
|
|
1118
|
+
effect: 'queue_priority_only';
|
|
1119
|
+
};
|
|
1120
|
+
}
|
|
1121
|
+
/** One message of the reported thread, as delivered. */
|
|
1122
|
+
interface AdminMessageReportThreadMessage {
|
|
1123
|
+
id: string;
|
|
1124
|
+
sender_id: string;
|
|
1125
|
+
receiver_id: string | null;
|
|
1126
|
+
body: string;
|
|
1127
|
+
body_modified: number;
|
|
1128
|
+
body_policy_version: string | null;
|
|
1129
|
+
body_policy_notices: string | null;
|
|
1130
|
+
author_side: MessagingSide | null;
|
|
1131
|
+
sequence: number | null;
|
|
1132
|
+
created_at: string;
|
|
1133
|
+
}
|
|
1134
|
+
/**
|
|
1135
|
+
* A report opened for review, from `admin.getMessageReport()`. Opening one is recorded on the audit
|
|
1136
|
+
* trail, and so is whether the unmasked original was released.
|
|
1137
|
+
*/
|
|
1138
|
+
interface AdminMessageReportDetail {
|
|
1139
|
+
id: string;
|
|
1140
|
+
reporter_user_id: string;
|
|
1141
|
+
reporter_principal_kind: MessagingSide;
|
|
1142
|
+
reporter_principal_id: string;
|
|
1143
|
+
conversation_id: string;
|
|
1144
|
+
thread_id: string;
|
|
1145
|
+
message_id: string | null;
|
|
1146
|
+
subject_kind: 'conversation' | 'message';
|
|
1147
|
+
reported_side: MessagingSide;
|
|
1148
|
+
reason: MessageReportReason | string;
|
|
1149
|
+
detail: string | null;
|
|
1150
|
+
status: MessageReportStatus;
|
|
1151
|
+
outcome: MessageReportOutcome | null;
|
|
1152
|
+
resolution_note: string | null;
|
|
1153
|
+
resolved_by: string | null;
|
|
1154
|
+
resolved_at: string | null;
|
|
1155
|
+
created_at: string;
|
|
1156
|
+
thread_kind: string;
|
|
1157
|
+
thread_title: string | null;
|
|
1158
|
+
buyer_id: string;
|
|
1159
|
+
store_id: string;
|
|
1160
|
+
/** Up to 100 messages of the thread, oldest first. */
|
|
1161
|
+
thread: AdminMessageReportThreadMessage[];
|
|
1162
|
+
/** The reported message before masking, when it was masked and may be released; otherwise null. */
|
|
1163
|
+
restricted_original: string | null;
|
|
1164
|
+
restricted_original_available: boolean;
|
|
1165
|
+
}
|
|
1166
|
+
interface ResolveMessageReportInput {
|
|
1167
|
+
status: Exclude<MessageReportStatus, 'open'>;
|
|
1168
|
+
/** `upheld` records a risk signal against the reported side; `not_upheld` records none. */
|
|
1169
|
+
outcome: MessageReportOutcome;
|
|
1170
|
+
/** At most 1000 characters. */
|
|
1171
|
+
note?: string;
|
|
1172
|
+
}
|
|
1173
|
+
interface ResolveMessageReportResult {
|
|
1174
|
+
ok: true;
|
|
1175
|
+
status: Exclude<MessageReportStatus, 'open'>;
|
|
1176
|
+
outcome: MessageReportOutcome;
|
|
1177
|
+
/** True when the same resolution had already been recorded (a safe retry). */
|
|
1178
|
+
deduplicated: boolean;
|
|
991
1179
|
}
|
|
992
1180
|
interface AdminReport {
|
|
993
1181
|
id: string;
|
|
@@ -2368,86 +2556,6 @@ interface VaziFeedResponse {
|
|
|
2368
2556
|
offset: number;
|
|
2369
2557
|
}
|
|
2370
2558
|
|
|
2371
|
-
/** @deprecated Use ConversationSummary from Messaging v2. */
|
|
2372
|
-
interface Conversation {
|
|
2373
|
-
partner_id: string;
|
|
2374
|
-
partner_name: string;
|
|
2375
|
-
store_name?: string | null;
|
|
2376
|
-
body: string;
|
|
2377
|
-
created_at: string;
|
|
2378
|
-
store_id?: string | null;
|
|
2379
|
-
listing_id?: string | null;
|
|
2380
|
-
listing_title?: string | null;
|
|
2381
|
-
unread_count: number;
|
|
2382
|
-
}
|
|
2383
|
-
/** @deprecated Use ThreadMessage from Messaging v2. */
|
|
2384
|
-
interface Message {
|
|
2385
|
-
id: string;
|
|
2386
|
-
sender_id: string;
|
|
2387
|
-
receiver_id: string;
|
|
2388
|
-
body: string;
|
|
2389
|
-
listing_id: string | null;
|
|
2390
|
-
store_id: string | null;
|
|
2391
|
-
order_id?: string | null;
|
|
2392
|
-
from_store?: number;
|
|
2393
|
-
read_at: string | null;
|
|
2394
|
-
created_at: string;
|
|
2395
|
-
}
|
|
2396
|
-
/** @deprecated Resolve a thread and use SendThreadMessageInput. Context fields are server-validated hints. */
|
|
2397
|
-
interface SendMessageInput {
|
|
2398
|
-
receiver_id: string;
|
|
2399
|
-
body: string;
|
|
2400
|
-
listing_id?: string;
|
|
2401
|
-
store_id?: string;
|
|
2402
|
-
order_id?: string;
|
|
2403
|
-
from_store?: boolean;
|
|
2404
|
-
}
|
|
2405
|
-
/** @deprecated Use validated managed Messaging realtime events. */
|
|
2406
|
-
interface InboxRealtimeEvent {
|
|
2407
|
-
type: 'message';
|
|
2408
|
-
conversation_key: string;
|
|
2409
|
-
partner_id: string;
|
|
2410
|
-
store_id?: string | null;
|
|
2411
|
-
from_store?: boolean;
|
|
2412
|
-
preview: string;
|
|
2413
|
-
created_at: string;
|
|
2414
|
-
unread_count?: number;
|
|
2415
|
-
}
|
|
2416
|
-
/** Recipient-safe reason for a message or conversation report. */
|
|
2417
|
-
type MessageReportReason = 'off_platform_payment' | 'contact_sharing' | 'spam' | 'scam' | 'harassment' | 'counterfeit' | 'offensive' | 'other';
|
|
2418
|
-
/** Typed report input for a message or buyer/store conversation. */
|
|
2419
|
-
type CreateMessageReportInput = {
|
|
2420
|
-
subject_kind: 'message';
|
|
2421
|
-
message_id: string;
|
|
2422
|
-
reason: MessageReportReason;
|
|
2423
|
-
detail?: string;
|
|
2424
|
-
} | {
|
|
2425
|
-
subject_kind: 'conversation';
|
|
2426
|
-
partner_id: string;
|
|
2427
|
-
store_id: string;
|
|
2428
|
-
reason: MessageReportReason;
|
|
2429
|
-
detail?: string;
|
|
2430
|
-
};
|
|
2431
|
-
/** Idempotent open-report result. */
|
|
2432
|
-
interface CreateMessageReportResult {
|
|
2433
|
-
id: string;
|
|
2434
|
-
status: 'open';
|
|
2435
|
-
deduplicated: boolean;
|
|
2436
|
-
}
|
|
2437
|
-
/** Context used to block one buyer/store relationship. */
|
|
2438
|
-
interface CreateMessageBlockInput {
|
|
2439
|
-
partner_id: string;
|
|
2440
|
-
store_id: string;
|
|
2441
|
-
from_store?: boolean;
|
|
2442
|
-
reason?: string;
|
|
2443
|
-
}
|
|
2444
|
-
/** Idempotent active-block result. */
|
|
2445
|
-
interface CreateMessageBlockResult {
|
|
2446
|
-
id: string;
|
|
2447
|
-
active: true;
|
|
2448
|
-
deduplicated: boolean;
|
|
2449
|
-
}
|
|
2450
|
-
|
|
2451
2559
|
type NotificationType = 'order' | 'message' | 'price_drop' | 'offer' | 'payout' | 'system';
|
|
2452
2560
|
interface Notification {
|
|
2453
2561
|
id: string;
|
|
@@ -4327,6 +4435,7 @@ declare class AdminModule {
|
|
|
4327
4435
|
listPayouts(params?: {
|
|
4328
4436
|
status?: 'pending' | 'sent' | 'failed';
|
|
4329
4437
|
on_hold?: 0 | 1;
|
|
4438
|
+
needs_correlation?: 0 | 1;
|
|
4330
4439
|
page?: number;
|
|
4331
4440
|
}, options?: RequestOptions): Promise<{
|
|
4332
4441
|
data: AdminPayoutItem[];
|
|
@@ -4358,6 +4467,28 @@ declare class AdminModule {
|
|
|
4358
4467
|
ok: true;
|
|
4359
4468
|
hidden: false;
|
|
4360
4469
|
}>;
|
|
4470
|
+
/**
|
|
4471
|
+
* The messaging safety queue: reported conversations and messages, oldest first, 25 per page.
|
|
4472
|
+
* Each report carries the reported side's recent risk signals and a `priority` derived from them;
|
|
4473
|
+
* priority orders the queue and decides nothing. Requires `admin:read`.
|
|
4474
|
+
*/
|
|
4475
|
+
listMessageReports(params?: {
|
|
4476
|
+
status?: MessageReportStatus;
|
|
4477
|
+
page?: number;
|
|
4478
|
+
}, options?: RequestOptions): Promise<AdminMessageReportList>;
|
|
4479
|
+
/**
|
|
4480
|
+
* Open one report for review: the report, up to 100 messages of its thread as delivered, and the
|
|
4481
|
+
* unmasked original of the reported message when one exists and may be released. Requires
|
|
4482
|
+
* `audit:read` and a recent passkey sign-in (403 `reauthentication_required` otherwise). Opening a
|
|
4483
|
+
* report is recorded on the audit trail.
|
|
4484
|
+
*/
|
|
4485
|
+
getMessageReport(reportId: string, options?: RequestOptions): Promise<AdminMessageReportDetail>;
|
|
4486
|
+
/**
|
|
4487
|
+
* Resolve an open report. `upheld` records a risk signal against the reported side. Requires
|
|
4488
|
+
* `listings:moderate`. Resolving with the same status and outcome again is a safe retry
|
|
4489
|
+
* (`deduplicated: true`); a different resolution of an already resolved report is 409.
|
|
4490
|
+
*/
|
|
4491
|
+
resolveMessageReport(reportId: string, input: ResolveMessageReportInput, options?: RequestOptions): Promise<ResolveMessageReportResult>;
|
|
4361
4492
|
listVaziOutfits(params?: {
|
|
4362
4493
|
page?: number;
|
|
4363
4494
|
}, options?: RequestOptions): Promise<{
|
|
@@ -4945,4 +5076,4 @@ declare class MitumbaClient {
|
|
|
4945
5076
|
isAuthenticated(): Promise<boolean>;
|
|
4946
5077
|
}
|
|
4947
5078
|
|
|
4948
|
-
export { APIClient, APIError, type APIErrorResponse, type ActivateIamUserInput, type ActivateIamUserResult, type Add2FAMethodInput, type Add2FAMethodResult, type AddAddressInput, type AddDepotInput, type AddIamPasskeyResult, type AddIamTotpResult, type AddIamTwoFactorMethodInput, type AddPaymentMethodInput, type Address, type AdminAuditActor, type AdminAuditEntry, type AdminAuditQuery, 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 CreateIamUserInput, type CreateIamUserResult, type CreateListingInput, type CreateMessageBlockInput, type CreateMessageBlockResult, type CreateMessageReportInput, type CreateMessageReportResult, type CreateOrderInput, type CreateOrganizationInput, 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 FileResponse, type FinishIamPasskeyEnrollmentInput, type FinishIamPasskeyLoginInput, type FollowedStore, type ForgotPasswordInput, IDBTokenStore, type IamActivation, type IamLoginInput, type IamLoginMethod, type IamMethodsResult, IamModule, type IamPasskeyLoginOptions, type IamProfile, type IamTokens, type IamTwoFactorRequired, type IamUser, type IamUserStatus, type InboxRealtimeEvent, type InitiateCheckoutInput, type InitiateCheckoutResponse, type Jwk, type Jwks, type KnownPaymentProvider, LISTING_STATUSES, type LegacyLinkResolution, type LegacyMessageArchiveSummary, type LegacyMessagePage, type LegacyMessageRecord, type LibraryCadence, type LibraryCompleter, type LibraryDocument, type LibraryDocumentSummary, type LibraryKind, type LibraryListing, type LibraryOccurrence, type LibraryOccurrenceRecorded, type LibraryOccurrenceStatus, type LibraryRoutineState, type LibrarySchedule, type LibraryScheduleRule, type LibrarySeason, type LibraryWeekday, type LinkedAccount, type LinkedAccountProvider, type ListConversationsParams, type ListIamUsersResult, type ListThreadMessagesParams, type ListThreadsParams, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LoginInput, MailerModule, type MailerTemplate, type Market, type MarketCurrency, type MarketPhone, type MarketRegion, type MarketRegionsResponse, type MarketStatus, MarketsModule, type MarketsResponse, 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 MessagingBlockInput, type MessagingBlockRemovedResult, type MessagingBlockResult, type MessagingCapabilities, type MessagingCursor, type MessagingErrorCode, type MessagingIdempotentRequestOptions, type MessagingInboxes, type MessagingPerspective, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationPref, type NotificationType, NotificationsModule, type OAuthAuthorizeInput, type OAuthAuthorizeResult, type OAuthClient, type OAuthClientSummary, type OAuthClientTrustLevel, type OAuthClientType, type OAuthConsent, type OAuthConsentInput, type OAuthConsentRequired, type OAuthConsentRevokeResult, OAuthModule, type OAuthTokenExchangeInput, type OAuthTokenResult, ORDER_STATUSES, type OidcSigningKey, type OpenIdConfiguration, type OperatorPermissionGrant, type Order, type OrderDocument, type OrderDocumentKind, type OrderEvent, type OrderHistoryParams, type OrderStatus, OrdersModule, type Organization, type OrganizationKind, type OrganizationStatus, type OrganizationSummary, 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 RegenerateIamBackupCodesResult, type RegisterInput, type RegisterOAuthClientInput, type RegisteredOAuthClient, 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 SilentAuthorizeResult, type SimilarListing, type StiEvent, type StkPushInput, type StkPushResponse, type Store, type StoreAnalytics, type StoreResolveThreadInput, type StoreReviewsPage, 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 UpdateOrganizationInput, type UpdateProfileInput, type UpdateStoreInput, type UpdateThreadPreferencesInput, UploadsModule, type UserInfo, type UserProfile, type VAZIOutfit, type VAZIOutfitDetail, type VAZIOutfitDetailItem, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type Verify2FAInput, type VerifyIamMethodResult, type VerifyIamTwoFactorInput, type VerifyOtpInput, type WebSocketCloseEventLike, type WebSocketFactory, type WebSocketLike, type WebSocketMessageEventLike, type WholesaleAnalytics, type WholesaleDepot, type WholesaleFeedParams, WholesaleModule, type WholesaleReviewStatus, type WholesaleStore, type WishlistListing, WishlistsModule, activeMarkets, baleShareUrl, createTokenStore, findMarket, findRegion, formatAmount, formatMoney, formatMoneyCompact, formatPhone, isConsentRequired, isMessagingAPIError, isValidPhone, listingShareUrl, maskPhone, normalizePhone, regionById, storeShareUrl };
|
|
5079
|
+
export { APIClient, APIError, type APIErrorResponse, type ActivateIamUserInput, type ActivateIamUserResult, type Add2FAMethodInput, type Add2FAMethodResult, type AddAddressInput, type AddDepotInput, type AddIamPasskeyResult, type AddIamTotpResult, type AddIamTwoFactorMethodInput, type AddPaymentMethodInput, type Address, type AdminAuditActor, type AdminAuditEntry, type AdminAuditQuery, type AdminAuthStrength, type AdminListingItem, type AdminMessageReport, type AdminMessageReportDetail, type AdminMessageReportList, type AdminMessageReportThreadMessage, 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 CreateIamUserInput, type CreateIamUserResult, type CreateListingInput, type CreateMessageBlockInput, type CreateMessageBlockResult, type CreateMessageReportInput, type CreateMessageReportResult, type CreateOrderInput, type CreateOrganizationInput, 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 FileResponse, type FinishIamPasskeyEnrollmentInput, type FinishIamPasskeyLoginInput, type FollowedStore, type ForgotPasswordInput, IDBTokenStore, type IamActivation, type IamLoginInput, type IamLoginMethod, type IamMethodsResult, IamModule, type IamPasskeyLoginOptions, type IamProfile, type IamTokens, type IamTwoFactorRequired, type IamUser, type IamUserStatus, type InboxRealtimeEvent, type InitiateCheckoutInput, type InitiateCheckoutResponse, type Jwk, type Jwks, type KnownPaymentProvider, LISTING_STATUSES, type LegacyLinkResolution, type LegacyMessageArchiveSummary, type LegacyMessagePage, type LegacyMessageRecord, type LibraryCadence, type LibraryCompleter, type LibraryDocument, type LibraryDocumentSummary, type LibraryKind, type LibraryListing, type LibraryOccurrence, type LibraryOccurrenceRecorded, type LibraryOccurrenceStatus, type LibraryRoutineState, type LibrarySchedule, type LibraryScheduleRule, type LibrarySeason, type LibraryWeekday, type LinkedAccount, type LinkedAccountProvider, type ListConversationsParams, type ListIamUsersResult, type ListThreadMessagesParams, type ListThreadsParams, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LoginInput, MailerModule, type MailerTemplate, type Market, type MarketCurrency, type MarketPhone, type MarketRegion, type MarketRegionsResponse, type MarketStatus, MarketsModule, type MarketsResponse, MemoryTokenStore, type Message, type MessageAttachment, type MessageAuthor, type MessageId, type MessagePage, type MessageReportOutcome, type MessageReportReason, type MessageReportStatus, type MessageResponse, MessagesModule, type MessagesRealtimeConnection, type MessagesRealtimeEnvelope, type MessagesRealtimeEvent, type MessagesRealtimeOptions, type MessagesRealtimeState, type MessagesRealtimeTicket, type MessagingBlockInput, type MessagingBlockRemovedResult, type MessagingBlockResult, type MessagingCapabilities, type MessagingCursor, type MessagingErrorCode, type MessagingIdempotentRequestOptions, type MessagingInboxes, type MessagingPerspective, type MessagingSide, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationPref, type NotificationType, NotificationsModule, type OAuthAuthorizeInput, type OAuthAuthorizeResult, type OAuthClient, type OAuthClientSummary, type OAuthClientTrustLevel, type OAuthClientType, type OAuthConsent, type OAuthConsentInput, type OAuthConsentRequired, type OAuthConsentRevokeResult, OAuthModule, type OAuthTokenExchangeInput, type OAuthTokenResult, ORDER_STATUSES, type OidcSigningKey, type OpenIdConfiguration, type OperatorPermissionGrant, type Order, type OrderDocument, type OrderDocumentKind, type OrderEvent, type OrderHistoryParams, type OrderStatus, OrdersModule, type Organization, type OrganizationKind, type OrganizationStatus, type OrganizationSummary, 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 RegenerateIamBackupCodesResult, type RegisterInput, type RegisterOAuthClientInput, type RegisteredOAuthClient, type RegistrationResponseJSON, ReportsModule, type RequestOptions, type RequestRecoveryInput, type RequestRecoveryResult, type ResetPasswordInput, type ResolveDisputeInput, type ResolveMessageReportInput, type ResolveMessageReportResult, 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 SilentAuthorizeResult, type SimilarListing, type StiEvent, type StkPushInput, type StkPushResponse, type Store, type StoreAnalytics, type StoreResolveThreadInput, type StoreReviewsPage, 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 UpdateOrganizationInput, type UpdateProfileInput, type UpdateStoreInput, type UpdateThreadPreferencesInput, UploadsModule, type UserInfo, type UserProfile, type VAZIOutfit, type VAZIOutfitDetail, type VAZIOutfitDetailItem, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type Verify2FAInput, type VerifyIamMethodResult, type VerifyIamTwoFactorInput, type VerifyOtpInput, type WebSocketCloseEventLike, type WebSocketFactory, type WebSocketLike, type WebSocketMessageEventLike, type WholesaleAnalytics, type WholesaleDepot, type WholesaleFeedParams, WholesaleModule, type WholesaleReviewStatus, type WholesaleStore, type WishlistListing, WishlistsModule, activeMarkets, baleShareUrl, createTokenStore, findMarket, findRegion, formatAmount, formatMoney, formatMoneyCompact, formatPhone, isConsentRequired, isMessagingAPIError, isValidPhone, listingShareUrl, maskPhone, normalizePhone, regionById, storeShareUrl };
|
package/dist/index.js
CHANGED
|
@@ -293,7 +293,13 @@ var APIClient = class {
|
|
|
293
293
|
*/
|
|
294
294
|
async send(method, path, body, params, options) {
|
|
295
295
|
if (!isSessionEndpoint(path)) {
|
|
296
|
-
|
|
296
|
+
try {
|
|
297
|
+
await this.ensureFreshToken(options);
|
|
298
|
+
} catch (error) {
|
|
299
|
+
if (!(error instanceof InvalidRefreshCredentialsError)) throw error;
|
|
300
|
+
this.config.onAuthExpired?.();
|
|
301
|
+
throw new APIError(401, { error: "session_expired", message: "Session expired. Please log in again." });
|
|
302
|
+
}
|
|
297
303
|
}
|
|
298
304
|
const url = new URL(path, this.config.baseUrl);
|
|
299
305
|
if (params) {
|
|
@@ -2394,6 +2400,32 @@ var AdminModule = class {
|
|
|
2394
2400
|
async reinstateReview(reviewId, options) {
|
|
2395
2401
|
return this.client.post(`/admin/reviews/${reviewId}/reinstate`, void 0, options);
|
|
2396
2402
|
}
|
|
2403
|
+
// ── Messaging safety reports ──
|
|
2404
|
+
/**
|
|
2405
|
+
* The messaging safety queue: reported conversations and messages, oldest first, 25 per page.
|
|
2406
|
+
* Each report carries the reported side's recent risk signals and a `priority` derived from them;
|
|
2407
|
+
* priority orders the queue and decides nothing. Requires `admin:read`.
|
|
2408
|
+
*/
|
|
2409
|
+
async listMessageReports(params, options) {
|
|
2410
|
+
return this.client.get("/admin/message-reports", params, options);
|
|
2411
|
+
}
|
|
2412
|
+
/**
|
|
2413
|
+
* Open one report for review: the report, up to 100 messages of its thread as delivered, and the
|
|
2414
|
+
* unmasked original of the reported message when one exists and may be released. Requires
|
|
2415
|
+
* `audit:read` and a recent passkey sign-in (403 `reauthentication_required` otherwise). Opening a
|
|
2416
|
+
* report is recorded on the audit trail.
|
|
2417
|
+
*/
|
|
2418
|
+
async getMessageReport(reportId, options) {
|
|
2419
|
+
return this.client.get(`/admin/message-reports/${encodeURIComponent(reportId)}`, void 0, options);
|
|
2420
|
+
}
|
|
2421
|
+
/**
|
|
2422
|
+
* Resolve an open report. `upheld` records a risk signal against the reported side. Requires
|
|
2423
|
+
* `listings:moderate`. Resolving with the same status and outcome again is a safe retry
|
|
2424
|
+
* (`deduplicated: true`); a different resolution of an already resolved report is 409.
|
|
2425
|
+
*/
|
|
2426
|
+
async resolveMessageReport(reportId, input, options) {
|
|
2427
|
+
return this.client.post(`/admin/message-reports/${encodeURIComponent(reportId)}/resolve`, input, options);
|
|
2428
|
+
}
|
|
2397
2429
|
// ── VAZI Moderation ──
|
|
2398
2430
|
async listVaziOutfits(params, options) {
|
|
2399
2431
|
return this.client.get("/admin/vazi/outfits", params, options);
|