@mitumba/sdk 1.31.0 → 1.32.1

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.ts CHANGED
@@ -24,6 +24,801 @@ declare class IDBTokenStore implements TokenStore {
24
24
  /** Creates IDBTokenStore if indexedDB is available, otherwise MemoryTokenStore. */
25
25
  declare function createTokenStore(): TokenStore;
26
26
 
27
+ /** Stable opaque identifier for one buyer/store conversation. */
28
+ type ConversationId = string;
29
+ /** Stable opaque identifier for one General, Listing, or Order thread. */
30
+ type ThreadId = string;
31
+ /** Stable opaque identifier for one human-authored message. */
32
+ type MessageId = string;
33
+ /** Stable opaque identifier for a message or system event in a thread timeline. */
34
+ type ThreadTimelineItemId = string;
35
+ /** Opaque server-issued cursor whose contents clients must not interpret. */
36
+ type MessagingCursor = string;
37
+ /** Explicit identity under which an authenticated human accesses messaging resources. */
38
+ type MessagingPerspective = {
39
+ /** Act as the authenticated buyer. */
40
+ kind: 'buyer';
41
+ } | {
42
+ /** Act as an authorized representative of one store. */
43
+ kind: 'store';
44
+ /** Store represented by this request. */
45
+ store_id: string;
46
+ };
47
+ /** Versioned success envelope returned by every Messaging v2 resource operation. */
48
+ interface ApiResponse<T> {
49
+ /** Public messaging API version. */
50
+ api_version: 2;
51
+ /** Typed operation result. */
52
+ data: T;
53
+ }
54
+ /** Cursor-paged resource collection. */
55
+ interface CursorPage<T> {
56
+ /** Resources in server-defined deterministic order. */
57
+ items: T[];
58
+ /** Cursor for the next page, or null when no next page exists. */
59
+ next_cursor: MessagingCursor | null;
60
+ /** Whether another page exists after this page. */
61
+ has_more: boolean;
62
+ }
63
+ /** Recipient-safe buyer identity snapshot. */
64
+ interface BuyerSummary {
65
+ /** Stable buyer account identifier. */
66
+ id: string;
67
+ /** Current buyer display name, when configured. */
68
+ display_name: string | null;
69
+ /** Current buyer avatar URL, when configured. */
70
+ avatar_url: string | null;
71
+ }
72
+ /** Recipient-safe store identity snapshot. */
73
+ interface StoreSummary {
74
+ /** Stable store identifier. */
75
+ id: string;
76
+ /** Current store display name. */
77
+ name: string;
78
+ /** Current canonical store slug. */
79
+ slug: string;
80
+ /** Current store logo URL, when configured. */
81
+ logo_url: string | null;
82
+ }
83
+ /** Immutable thread subject snapshot for General, Listing, or Order context. */
84
+ type ThreadSubject = {
85
+ /** General buyer/store conversation subject. */
86
+ kind: 'general';
87
+ } | {
88
+ /** Listing inquiry subject. */
89
+ kind: 'listing';
90
+ /** Listing represented by this thread. */
91
+ listing_id: string;
92
+ /** Snapshotted listing title. */
93
+ title: string;
94
+ /** Snapshotted listing image URL, when available. */
95
+ image_url: string | null;
96
+ /** Current coarse listing availability. */
97
+ availability: 'active' | 'sold' | 'inactive' | 'unknown';
98
+ } | {
99
+ /** Order support subject. */
100
+ kind: 'order';
101
+ /** Order represented by this thread. */
102
+ order_id: string;
103
+ /** Human-readable short order identifier. */
104
+ short_id: string;
105
+ /** Snapshotted listing title associated with the order. */
106
+ listing_title: string;
107
+ /** Snapshotted listing image URL, when available. */
108
+ image_url: string | null;
109
+ /** Current canonical order status. */
110
+ order_status: string;
111
+ };
112
+ /** Public message author identity without private store-operator identity. */
113
+ type MessageAuthor = {
114
+ /** Message was authored from the buyer perspective. */
115
+ side: 'buyer';
116
+ /** Recipient-safe buyer identity. */
117
+ buyer: BuyerSummary;
118
+ } | {
119
+ /** Message was authored from the store perspective. */
120
+ side: 'store';
121
+ /** Recipient-safe store identity; human operator identity is intentionally omitted. */
122
+ store: StoreSummary;
123
+ };
124
+ /** Safe attachment metadata associated with a committed message. */
125
+ interface MessageAttachment {
126
+ /** Stable attachment identifier. */
127
+ id: string;
128
+ /** Attachment presentation category. */
129
+ kind: 'image' | 'file';
130
+ /** Sanitized original file name. */
131
+ file_name: string;
132
+ /** Validated media type. */
133
+ content_type: string;
134
+ /** Validated byte size. */
135
+ size_bytes: number;
136
+ }
137
+ /** Canonical immutable human-authored message. */
138
+ interface ThreadMessage {
139
+ /** Stable message identifier. */
140
+ id: MessageId;
141
+ /** Thread containing this message. */
142
+ thread_id: ThreadId;
143
+ /** Monotonic order within the thread timeline. */
144
+ sequence: number;
145
+ /** Explicit public author side and identity. */
146
+ author: MessageAuthor;
147
+ /** Canonical message body after server policy processing. */
148
+ body: string;
149
+ /** Same-thread quote snapshot, or null when the message is not a reply. */
150
+ reply_to: {
151
+ /** Quoted message identifier. */
152
+ message_id: MessageId;
153
+ /** Recipient-safe author label captured for the quote. */
154
+ author_name: string;
155
+ /** Immutable safe excerpt captured for the quote. */
156
+ excerpt: string;
157
+ } | null;
158
+ /** Safe committed attachments; empty for text-only messages. */
159
+ attachments: MessageAttachment[];
160
+ /** Caller-owned idempotency identifier echoed for reconciliation, when supplied. */
161
+ client_message_id: string | null;
162
+ /** UTC ISO 8601 creation timestamp. */
163
+ created_at: string;
164
+ }
165
+ /** Server-authored event linking a Listing thread and its related Order thread. */
166
+ interface ThreadSystemEvent {
167
+ /** Stable timeline-item identifier. */
168
+ id: ThreadTimelineItemId;
169
+ /** Thread containing this system event. */
170
+ thread_id: ThreadId;
171
+ /** Monotonic order within the thread timeline. */
172
+ sequence: number;
173
+ /** System-event discriminator. */
174
+ kind: 'thread.linked';
175
+ /** Stable identifier shared by the paired link events. */
176
+ relation_id: string;
177
+ /** Direction and correctly correlated related thread snapshot. */
178
+ link: {
179
+ /** This Listing thread links forward to an Order thread. */
180
+ direction: 'listing_to_order';
181
+ /** Related Order thread. */
182
+ related_thread: {
183
+ /** Stable related thread identifier. */
184
+ id: ThreadId;
185
+ /** Related thread kind. */
186
+ kind: 'order';
187
+ /** Correlated Order subject snapshot. */
188
+ subject: Extract<ThreadSubject, {
189
+ kind: 'order';
190
+ }>;
191
+ };
192
+ } | {
193
+ /** This Order thread links back to a Listing thread. */
194
+ direction: 'order_to_listing';
195
+ /** Related Listing thread. */
196
+ related_thread: {
197
+ /** Stable related thread identifier. */
198
+ id: ThreadId;
199
+ /** Related thread kind. */
200
+ kind: 'listing';
201
+ /** Correlated Listing subject snapshot. */
202
+ subject: Extract<ThreadSubject, {
203
+ kind: 'listing';
204
+ }>;
205
+ };
206
+ };
207
+ /** Recipient-facing event label. */
208
+ label: string;
209
+ /** Perspectives for which this event contributes to unread state. */
210
+ notify_sides: Array<'buyer' | 'store'>;
211
+ /** UTC ISO 8601 creation timestamp. */
212
+ created_at: string;
213
+ }
214
+ /** Ordered item in a thread timeline. */
215
+ type ThreadTimelineItem = {
216
+ /** Human-message timeline item. */
217
+ kind: 'message';
218
+ /** Canonical message. */
219
+ message: ThreadMessage;
220
+ } | {
221
+ /** Server system-event timeline item. */
222
+ kind: 'system';
223
+ /** Canonical system event. */
224
+ event: ThreadSystemEvent;
225
+ };
226
+ /** Shared support lifecycle for Listing and Order threads. */
227
+ type ThreadStatus = 'open' | 'resolved';
228
+ /** Perspective-private presentation preferences for one thread. */
229
+ interface ThreadPreferences {
230
+ /** Whether the current perspective archived this thread. */
231
+ archived: boolean;
232
+ /** Whether the current perspective pinned this thread. */
233
+ pinned: boolean;
234
+ /** Whether the current perspective muted this thread. */
235
+ muted: boolean;
236
+ }
237
+ /** Perspective-private presentation preferences for one conversation. */
238
+ interface ConversationPreferences {
239
+ /** Whether the current perspective archived this conversation. */
240
+ archived: boolean;
241
+ /** Whether the current perspective muted this conversation. */
242
+ muted: boolean;
243
+ }
244
+ type ThreadCardBase = {
245
+ /** Stable thread identifier. */
246
+ id: ThreadId;
247
+ /** Stable parent conversation identifier. */
248
+ conversation_id: ConversationId;
249
+ /** Shared support status, independent of commerce status. */
250
+ status: ThreadStatus;
251
+ /** Private preferences for the selected perspective. */
252
+ preferences: ThreadPreferences;
253
+ /** Latest human-authored message, or null before the first message. */
254
+ last_message: ThreadMessage | null;
255
+ /** Exact unread timeline-item count for the selected perspective. */
256
+ unread_count: number;
257
+ /** UTC ISO 8601 timestamp of latest thread activity. */
258
+ last_activity_at: string;
259
+ /** UTC ISO 8601 creation timestamp. */
260
+ created_at: string;
261
+ /** UTC ISO 8601 last-update timestamp. */
262
+ updated_at: string;
263
+ };
264
+ /** Thread-card summary with kind and subject correlated at compile time. */
265
+ type ThreadCard = (ThreadCardBase & {
266
+ /** General thread card. */
267
+ kind: 'general';
268
+ /** Correlated General subject. */
269
+ subject: Extract<ThreadSubject, {
270
+ kind: 'general';
271
+ }>;
272
+ }) | (ThreadCardBase & {
273
+ /** Listing inquiry thread card. */
274
+ kind: 'listing';
275
+ /** Correlated Listing subject. */
276
+ subject: Extract<ThreadSubject, {
277
+ kind: 'listing';
278
+ }>;
279
+ }) | (ThreadCardBase & {
280
+ /** Order support thread card. */
281
+ kind: 'order';
282
+ /** Correlated Order subject. */
283
+ subject: Extract<ThreadSubject, {
284
+ kind: 'order';
285
+ }>;
286
+ });
287
+ /** Buyer/store conversation summary containing no loose messages. */
288
+ interface ConversationSummary {
289
+ /** Stable all-time buyer/store conversation identifier. */
290
+ id: ConversationId;
291
+ /** Buyer in this relationship. */
292
+ buyer: BuyerSummary;
293
+ /** Store in this relationship. */
294
+ store: StoreSummary;
295
+ /** Most recently active thread, or null when no thread has activity. */
296
+ last_thread: ThreadCard | null;
297
+ /** Exact aggregate unread count for the selected perspective. */
298
+ unread_count: number;
299
+ /** UTC ISO 8601 timestamp of latest child-thread activity. */
300
+ last_activity_at: string;
301
+ /** Private preferences for the selected perspective. */
302
+ preferences: ConversationPreferences;
303
+ /** UTC ISO 8601 creation timestamp. */
304
+ created_at: string;
305
+ /** UTC ISO 8601 last-update timestamp. */
306
+ updated_at: string;
307
+ }
308
+ /** Idempotent conversation/thread resolution result. */
309
+ interface ResolveThreadResult {
310
+ /** Resolved all-time buyer/store conversation. */
311
+ conversation: ConversationSummary;
312
+ /** Resolved singleton context thread. */
313
+ thread: ThreadCard;
314
+ /** Whether either resource was created by this resolution. */
315
+ created: {
316
+ /** Whether the conversation was created. */
317
+ conversation: boolean;
318
+ /** Whether the thread was created. */
319
+ thread: boolean;
320
+ };
321
+ }
322
+ /** Newest, older, or catch-up window of ascending thread timeline items. */
323
+ interface MessagePage {
324
+ /** Timeline items ordered by ascending sequence. */
325
+ items: ThreadTimelineItem[];
326
+ /** Cursor for older history, or null at the beginning. */
327
+ older_cursor: MessagingCursor | null;
328
+ /** Cursor for newer catch-up, or null at the live edge. */
329
+ newer_cursor: MessagingCursor | null;
330
+ /** Whether older history exists. */
331
+ has_older: boolean;
332
+ /** Whether newer history exists. */
333
+ has_newer: boolean;
334
+ }
335
+ /** Authoritative monotonic read-cursor result. */
336
+ interface ReadCursorResult {
337
+ /** Thread whose cursor was evaluated. */
338
+ thread_id: ThreadId;
339
+ /** Last committed visible message or system-event identifier. */
340
+ last_read_item_id: ThreadTimelineItemId;
341
+ /** Monotonic sequence of the last read item. */
342
+ last_read_sequence: number;
343
+ /** Whether this request advanced the cursor. */
344
+ changed: boolean;
345
+ /** UTC ISO 8601 cursor-update timestamp. */
346
+ updated_at: string;
347
+ }
348
+ /** Buyer-authorized input for idempotent thread resolution. */
349
+ type BuyerResolveThreadInput = {
350
+ /** Resolve the General thread for a store. */
351
+ kind: 'general';
352
+ /** Store to contact. */
353
+ store_id: string;
354
+ } | {
355
+ /** Resolve a Listing inquiry thread. */
356
+ kind: 'listing';
357
+ /** Store owning the listing. */
358
+ store_id: string;
359
+ /** Listing to ask about. */
360
+ listing_id: string;
361
+ } | {
362
+ /** Resolve an Order support thread. */
363
+ kind: 'order';
364
+ /** Authorized buyer order. */
365
+ order_id: string;
366
+ };
367
+ /** Store-authorized input for idempotent thread resolution. */
368
+ type StoreResolveThreadInput = {
369
+ /** Resolve an entitled existing General relationship. */
370
+ kind: 'general';
371
+ /** Buyer in the entitled relationship. */
372
+ buyer_id: string;
373
+ } | {
374
+ /** Resolve an Order support thread. */
375
+ kind: 'order';
376
+ /** Authorized store order. */
377
+ order_id: string;
378
+ };
379
+ /** Cursor inputs for newest, older, or catch-up message windows. */
380
+ type ListThreadMessagesParams = {
381
+ /** Older-history cursor. */
382
+ before?: MessagingCursor;
383
+ /** Catch-up cursor is mutually exclusive with before. */
384
+ after?: never;
385
+ /** Requested page size. */
386
+ limit?: number;
387
+ } | {
388
+ /** Catch-up cursor. */
389
+ after?: MessagingCursor;
390
+ /** Older-history cursor is mutually exclusive with after. */
391
+ before?: never;
392
+ /** Requested page size. */
393
+ limit?: number;
394
+ };
395
+ /** Caller-owned, idempotent input for one human-authored message. */
396
+ interface SendThreadMessageInput {
397
+ /**
398
+ * Stable caller-generated identifier reused for every retry.
399
+ *
400
+ * The runtime method maps this value to the `Idempotency-Key` header, omits it from the JSON
401
+ * body, and never generates a replacement key during retry.
402
+ */
403
+ client_message_id: string;
404
+ /** Required trimmed body of 1–2,000 characters. */
405
+ body: string;
406
+ /** Same-thread quoted message; omit rather than send null when absent. */
407
+ reply_to_message_id?: MessageId;
408
+ /** Safe staged attachment identifiers; empty or omitted for text-only sends. */
409
+ attachment_ids?: string[];
410
+ }
411
+ /** Canonical result of an accepted or deduplicated send. */
412
+ interface SendThreadMessageResult {
413
+ /** Canonical committed message. */
414
+ message: ThreadMessage;
415
+ /** Whether this response replayed an earlier accepted request. */
416
+ deduplicated: boolean;
417
+ /** Server policy processing applied to the submitted body. */
418
+ policy: {
419
+ /** Whether policy processing changed the body. */
420
+ body_modified: boolean;
421
+ /** Recipient-safe policy notices. */
422
+ notices: string[];
423
+ };
424
+ }
425
+ /** Lifecycle state of one staged attachment upload. */
426
+ type AttachmentUploadState = 'authorized' | 'uploaded' | 'pending_scan' | 'safe' | 'rejected' | 'expired' | 'claimed';
427
+ /** Server capability declaration for the staged Messaging v2 rollout. */
428
+ interface MessagingCapabilities {
429
+ /** Public resource schema version. */
430
+ api_version: 2;
431
+ /** Realtime protocol versions understood by this deployment. */
432
+ protocol_versions: number[];
433
+ /** Whether the Messaging v2 HTTP resource surface is enabled. */
434
+ http: {
435
+ enabled: boolean;
436
+ };
437
+ /** Whether legacy writes are mirrored into Messaging v2. */
438
+ dual_write: {
439
+ enabled: boolean;
440
+ };
441
+ /** Whether migration shadow reads are enabled. */
442
+ shadow_read: {
443
+ enabled: boolean;
444
+ };
445
+ /** Whether clients must address a stable Messaging v2 thread. */
446
+ require_thread: {
447
+ enabled: boolean;
448
+ };
449
+ /** Managed realtime capability and supported wire versions. */
450
+ realtime: {
451
+ /** Whether clients may establish managed realtime connections. */
452
+ enabled: boolean;
453
+ /** Realtime protocol versions currently available. */
454
+ protocol_versions: number[];
455
+ };
456
+ /** Optional attachment capability. */
457
+ attachments: {
458
+ /** Whether clients may expose attachment controls. */
459
+ enabled: boolean;
460
+ /** Maximum accepted upload size. */
461
+ max_size_bytes: number;
462
+ /** Allowed upload media types. */
463
+ allowed_content_types: string[];
464
+ };
465
+ }
466
+ /** Short-lived authorization for one private staged attachment upload. */
467
+ interface AttachmentUploadAuthorization {
468
+ /** Stable upload identifier. */
469
+ id: string;
470
+ /** Thread for which the upload was authorized. */
471
+ thread_id: ThreadId;
472
+ /** Initial upload state. */
473
+ state: 'authorized';
474
+ /** Absolute short-lived upload URL. */
475
+ upload_url: string;
476
+ /** One-use upload ticket that is not an access token. */
477
+ upload_ticket: string;
478
+ /** UTC ISO 8601 authorization expiry. */
479
+ expires_at: string;
480
+ /** Server-accepted upload constraints. */
481
+ accepted: {
482
+ /** Accepted media type. */
483
+ content_type: string;
484
+ /** Accepted byte size. */
485
+ size_bytes: number;
486
+ /** Accepted SHA-256 digest. */
487
+ sha256: string;
488
+ };
489
+ }
490
+ /** Current status of one private staged attachment upload. */
491
+ interface AttachmentUploadStatus {
492
+ /** Stable upload identifier. */
493
+ id: string;
494
+ /** Thread for which the upload was authorized. */
495
+ thread_id: ThreadId;
496
+ /** Current upload lifecycle state. */
497
+ state: AttachmentUploadState;
498
+ /** UTC ISO 8601 upload expiry. */
499
+ expires_at: string;
500
+ /** Safe rejection code, or null when not rejected. */
501
+ rejection_code: string | null;
502
+ /** Committed safe attachment, or null until available. */
503
+ attachment: MessageAttachment | null;
504
+ }
505
+ /** Read-only summary of exact-participant history that cannot be assigned to a store. */
506
+ interface LegacyMessageArchiveSummary {
507
+ /** Stable legacy archive identifier. */
508
+ id: string;
509
+ /** Other original participant. */
510
+ other_user: BuyerSummary;
511
+ /** Latest historic message body. */
512
+ last_message_body: string;
513
+ /** UTC ISO 8601 timestamp of the latest historic message. */
514
+ last_message_at: string;
515
+ }
516
+ /** Read-only historic message that cannot be assigned to a store conversation. */
517
+ interface LegacyMessageRecord {
518
+ /** Stable legacy message identifier. */
519
+ id: string;
520
+ /** Original sender. */
521
+ sender: BuyerSummary;
522
+ /** Historic message body. */
523
+ body: string;
524
+ /** UTC ISO 8601 creation timestamp. */
525
+ created_at: string;
526
+ }
527
+ /** Safe result of resolving a temporary Buyer legacy navigation link. */
528
+ type LegacyLinkResolution = {
529
+ /** Legacy link resolved to canonical v2 resources. */
530
+ result: 'resolved';
531
+ /** Canonical conversation identifier. */
532
+ conversation_id: ConversationId;
533
+ /** Canonical thread identifier. */
534
+ thread_id: ThreadId;
535
+ } | {
536
+ /** Several stores match and the buyer must choose explicitly. */
537
+ result: 'choose_store';
538
+ /** Safe candidate stores. */
539
+ stores: StoreSummary[];
540
+ } | {
541
+ /** Link targets exact-participant read-only legacy history. */
542
+ result: 'legacy_archive';
543
+ /** Canonical legacy archive identifier. */
544
+ legacy_thread_id: string;
545
+ } | {
546
+ /** Link is invalid, forbidden, or cannot be resolved safely. */
547
+ result: 'unavailable';
548
+ };
549
+ declare const MESSAGING_ERROR_CODES: readonly ["invalid_input", "unauthorized", "session_expired", "forbidden", "conversation_not_found", "thread_not_found", "message_not_found", "timeline_item_not_found", "context_mismatch", "idempotency_conflict", "cursor_invalid", "cursor_expired", "attachment_not_ready", "blocked", "legacy_context_required", "client_upgrade_required", "rate_limited", "temporarily_unavailable", "internal_error", "invalid_response", "network_error"];
550
+ /** Closed messaging-specific API error code vocabulary. */
551
+ type MessagingErrorCode = typeof MESSAGING_ERROR_CODES[number];
552
+ type MessagingAPIError = APIError & {
553
+ code: MessagingErrorCode;
554
+ };
555
+ /**
556
+ * Narrow an unknown value to an API error carrying a recognized messaging code.
557
+ *
558
+ * @param value - Unknown caught value
559
+ * @returns Whether the value is a messaging API error
560
+ */
561
+ declare function isMessagingAPIError(value: unknown): value is MessagingAPIError;
562
+ /**
563
+ * Narrow an unknown value to an API error carrying one expected messaging code.
564
+ *
565
+ * @param value - Unknown caught value
566
+ * @param code - Expected messaging error code
567
+ * @returns Whether the value carries the expected code
568
+ */
569
+ declare function isMessagingAPIError<Code extends MessagingErrorCode>(value: unknown, code: Code): value is APIError & {
570
+ code: Code;
571
+ };
572
+ /** Error raised when a Messaging realtime frame or protocol contract is invalid. */
573
+ declare class RealtimeProtocolError extends Error {
574
+ /** Construct a stable protocol failure without echoing an untrusted frame. */
575
+ constructor();
576
+ }
577
+ /** Error raised when the current runtime has no supported WebSocket implementation. */
578
+ declare class RealtimeUnavailableError extends Error {
579
+ /** Construct a stable runtime-unavailable failure. */
580
+ constructor();
581
+ }
582
+ /** Cursor parameters for conversation collections. */
583
+ interface ListConversationsParams {
584
+ /** Opaque next-page cursor. */
585
+ cursor?: MessagingCursor;
586
+ /** Page size from 1 through 100. */
587
+ limit?: number;
588
+ }
589
+ /** Cursor and filter parameters for thread-card collections. */
590
+ interface ListThreadsParams extends ListConversationsParams {
591
+ /** Include threads archived by the selected perspective. */
592
+ include_archived?: boolean;
593
+ /** Optional shared support-status filter. */
594
+ status?: 'open' | 'resolved';
595
+ }
596
+ /** Thread preference patch for one perspective. */
597
+ interface UpdateThreadPreferencesInput {
598
+ /** Archive or restore the thread for this perspective. */
599
+ archived?: boolean;
600
+ /** Pin or unpin the thread for this perspective. */
601
+ pinned?: boolean;
602
+ /** Mute or unmute the thread for this perspective. */
603
+ muted?: boolean;
604
+ }
605
+ /** Conversation preference patch for one perspective. */
606
+ interface UpdateConversationPreferencesInput {
607
+ /** Archive or restore the conversation for this perspective. */
608
+ archived?: boolean;
609
+ /** Mute or unmute the conversation for this perspective. */
610
+ muted?: boolean;
611
+ }
612
+ /** Request options for an idempotent operation. */
613
+ interface MessagingIdempotentRequestOptions {
614
+ /** Stable key reused for an exact retry. */
615
+ idempotencyKey: string;
616
+ /** Optional cancellation signal. */
617
+ signal?: AbortSignal;
618
+ /** Additional non-authorization headers. */
619
+ headers?: Record<string, string>;
620
+ }
621
+ /** Metadata used to authorize one private attachment upload. */
622
+ interface CreateAttachmentUploadInput {
623
+ /** Sanitized display file name. */
624
+ file_name: string;
625
+ /** Lowercase allowlisted media type. */
626
+ content_type: string;
627
+ /** Exact byte length. */
628
+ size_bytes: number;
629
+ /** Lowercase hexadecimal SHA-256 digest. */
630
+ sha256: string;
631
+ }
632
+ /** Portable in-memory body accepted by attachment upload. */
633
+ type AttachmentUploadBody = Blob | ArrayBuffer | ArrayBufferView;
634
+ /** Short-lived mediated attachment download. */
635
+ interface AttachmentDownloadAuthorization {
636
+ /** Absolute application download URL containing a short-lived ticket. */
637
+ url: string;
638
+ /** UTC ISO 8601 ticket expiry. */
639
+ expires_at: string;
640
+ }
641
+ /** Buyer and currently represented store inboxes. */
642
+ interface MessagingInboxes {
643
+ /** Personal buyer perspective. */
644
+ buyer: {
645
+ kind: 'buyer';
646
+ buyer: BuyerSummary;
647
+ };
648
+ /** Authorized store perspectives. */
649
+ stores: Array<{
650
+ kind: 'store';
651
+ store: StoreSummary;
652
+ }>;
653
+ }
654
+ /** One-use realtime bootstrap ticket. */
655
+ interface MessagesRealtimeTicket {
656
+ /** Opaque ticket; never persist or log it. */
657
+ ticket: string;
658
+ /** UTC ISO 8601 ticket expiry. */
659
+ expires_at: string;
660
+ /** Absolute ticket-only WebSocket URL. */
661
+ websocket_url: string;
662
+ /** Required negotiated subprotocol. */
663
+ websocket_protocol: 'mitumba-messaging-v1';
664
+ /** Realtime protocol version. */
665
+ protocol_version: 1;
666
+ /** Requested resume cursor, or null for a fresh connection. */
667
+ resume_cursor: MessagingCursor | null;
668
+ }
669
+ /** Minimal event delivered by an isomorphic WebSocket transport. */
670
+ interface WebSocketMessageEventLike {
671
+ /** Untrusted frame data parsed by the SDK before exposure. */
672
+ data: unknown;
673
+ }
674
+ /** Minimal close event delivered by an isomorphic WebSocket transport. */
675
+ interface WebSocketCloseEventLike {
676
+ /** WebSocket close code. */
677
+ code: number;
678
+ /** Safe close reason. */
679
+ reason?: string;
680
+ /** Whether the transport observed a clean close. */
681
+ wasClean?: boolean;
682
+ }
683
+ /** Minimal WebSocket contract supported in Browser, Node, Edge, and Worker runtimes. */
684
+ interface WebSocketLike {
685
+ /** Connecting ready state. */
686
+ readonly CONNECTING?: number;
687
+ /** Open ready state. */
688
+ readonly OPEN?: number;
689
+ /** Current ready state. */
690
+ readonly readyState: number;
691
+ /** Send one client frame. */
692
+ send(data: string): void;
693
+ /** Close this transport. */
694
+ close(code?: number, reason?: string): void;
695
+ /** Register a transport listener. */
696
+ addEventListener(type: 'open', listener: () => void): void;
697
+ addEventListener(type: 'message', listener: (event: WebSocketMessageEventLike) => void): void;
698
+ addEventListener(type: 'close', listener: (event: WebSocketCloseEventLike) => void): void;
699
+ addEventListener(type: 'error', listener: (event: unknown) => void): void;
700
+ /** Remove a transport listener. */
701
+ removeEventListener(type: 'open', listener: () => void): void;
702
+ removeEventListener(type: 'message', listener: (event: WebSocketMessageEventLike) => void): void;
703
+ removeEventListener(type: 'close', listener: (event: WebSocketCloseEventLike) => void): void;
704
+ removeEventListener(type: 'error', listener: (event: unknown) => void): void;
705
+ }
706
+ /** Injectable WebSocket constructor for isomorphic runtimes. */
707
+ type WebSocketFactory = (url: string, protocols: string | string[]) => WebSocketLike;
708
+ /** Managed realtime lifecycle state. */
709
+ type MessagesRealtimeState = 'connecting' | 'open' | 'reconnecting' | 'closed' | 'failed';
710
+ /** Durable realtime envelope shared by all resumable events. */
711
+ interface MessagesRealtimeEnvelope<Type extends string, Payload> {
712
+ /** Public resource schema version. */
713
+ api_version: 2;
714
+ /** Wire protocol version. */
715
+ protocol_version: 1;
716
+ /** Stable event identifier used for deduplication. */
717
+ event_id: string;
718
+ /** Opaque audience resume cursor. */
719
+ resume_cursor: MessagingCursor;
720
+ /** Event discriminator. */
721
+ type: Type;
722
+ /** UTC ISO 8601 occurrence timestamp. */
723
+ occurred_at: string;
724
+ /** Related conversation when applicable. */
725
+ conversation_id?: ConversationId;
726
+ /** Related thread when applicable. */
727
+ thread_id?: ThreadId;
728
+ /** Event payload validated before exposure. */
729
+ payload: Payload;
730
+ }
731
+ /** Validated managed Messaging realtime event. */
732
+ type MessagesRealtimeEvent = MessagesRealtimeEnvelope<'message.created', {
733
+ message: ThreadMessage;
734
+ }> | MessagesRealtimeEnvelope<'system_event.created', {
735
+ event: ThreadSystemEvent;
736
+ }> | MessagesRealtimeEnvelope<'conversation.updated', {
737
+ conversation: ConversationSummary;
738
+ }> | MessagesRealtimeEnvelope<'thread.created', {
739
+ thread: ThreadCard;
740
+ }> | MessagesRealtimeEnvelope<'thread.updated', {
741
+ thread: ThreadCard;
742
+ }> | MessagesRealtimeEnvelope<'read_cursor.updated', {
743
+ cursor: ReadCursorResult;
744
+ }> | MessagesRealtimeEnvelope<'attachment.updated', {
745
+ upload: AttachmentUploadStatus;
746
+ }> | MessagesRealtimeEnvelope<'message.policy_applied', {
747
+ message_id: MessageId;
748
+ notices: string[];
749
+ }> | {
750
+ /** Resource schema version. */
751
+ api_version: 2;
752
+ /** Wire protocol version. */
753
+ protocol_version: 1;
754
+ /** Ephemeral event discriminator. */
755
+ type: 'typing.updated';
756
+ /** Thread scoped by this typing state. */
757
+ thread_id: ThreadId;
758
+ /** Validated public author. */
759
+ author: MessageAuthor;
760
+ /** Current typing state. */
761
+ is_typing: boolean;
762
+ /** UTC ISO 8601 occurrence timestamp. */
763
+ occurred_at: string;
764
+ } | {
765
+ /** Resource schema version. */
766
+ api_version: 2;
767
+ /** Wire protocol version. */
768
+ protocol_version: 1;
769
+ /** Authoritative rebuild signal. */
770
+ type: 'resync.required';
771
+ /** Safe reason for rebuilding HTTP state. */
772
+ reason: 'cursor_expired' | 'gap_detected' | 'authorization_changed';
773
+ /** Resume cursor after the authoritative rebuild. */
774
+ resume_cursor: MessagingCursor;
775
+ };
776
+ /** Options for an inert or immediately started managed realtime connection. */
777
+ interface MessagesRealtimeOptions {
778
+ /** Buyer or authorized-store audience. */
779
+ perspective: MessagingPerspective;
780
+ /** Last acknowledged cursor, or null for a fresh connection. */
781
+ resumeCursor?: MessagingCursor | null;
782
+ /** Optional cancellation signal for ticket requests. */
783
+ signal?: AbortSignal;
784
+ /** Initial reconnect delay in milliseconds. */
785
+ reconnectBaseDelayMs?: number;
786
+ /** Maximum reconnect delay in milliseconds. */
787
+ reconnectMaxDelayMs?: number;
788
+ /** Injected randomness for deterministic tests. */
789
+ random?: () => number;
790
+ }
791
+ /** Managed, resumable messaging connection. */
792
+ interface MessagesRealtimeConnection {
793
+ /** Current connection lifecycle state. */
794
+ readonly state: MessagesRealtimeState;
795
+ /** Last acknowledged durable cursor. */
796
+ readonly resumeCursor: MessagingCursor | null;
797
+ /** Start the inert connection. Repeated calls are safe. */
798
+ start(): Promise<void>;
799
+ /** Permanently close and release sockets, timers, and listeners. */
800
+ close(): void;
801
+ /** Subscribe to validated messaging events. */
802
+ onEvent(listener: (event: MessagesRealtimeEvent) => void | Promise<void>): () => void;
803
+ /** Subscribe to lifecycle changes. */
804
+ onStateChange(listener: (state: MessagesRealtimeState) => void): () => void;
805
+ /** Select a thread for message and typing delivery. */
806
+ subscribeThread(threadId: ThreadId): void;
807
+ /** Stop local delivery for one selected thread. */
808
+ unsubscribeThread(threadId: ThreadId): void;
809
+ /** Publish thread-scoped ephemeral typing state. */
810
+ setTyping(threadId: ThreadId, isTyping: boolean): void;
811
+ }
812
+ /** Older-history page for one read-only legacy archive. */
813
+ interface LegacyMessagePage {
814
+ /** Historic messages in ascending display order. */
815
+ items: LegacyMessageRecord[];
816
+ /** Cursor for older history, or null at the beginning. */
817
+ older_cursor: MessagingCursor | null;
818
+ /** Whether older history remains. */
819
+ has_older: boolean;
820
+ }
821
+
27
822
  interface BlockedIp {
28
823
  ip: string;
29
824
  reason: string;
@@ -988,6 +1783,7 @@ interface VaziFeedResponse {
988
1783
  offset: number;
989
1784
  }
990
1785
 
1786
+ /** @deprecated Use ConversationSummary from Messaging v2. */
991
1787
  interface Conversation {
992
1788
  partner_id: string;
993
1789
  partner_name: string;
@@ -999,6 +1795,7 @@ interface Conversation {
999
1795
  listing_title?: string | null;
1000
1796
  unread_count: number;
1001
1797
  }
1798
+ /** @deprecated Use ThreadMessage from Messaging v2. */
1002
1799
  interface Message {
1003
1800
  id: string;
1004
1801
  sender_id: string;
@@ -1011,6 +1808,7 @@ interface Message {
1011
1808
  read_at: string | null;
1012
1809
  created_at: string;
1013
1810
  }
1811
+ /** @deprecated Resolve a thread and use SendThreadMessageInput. Context fields are server-validated hints. */
1014
1812
  interface SendMessageInput {
1015
1813
  receiver_id: string;
1016
1814
  body: string;
@@ -1019,6 +1817,7 @@ interface SendMessageInput {
1019
1817
  order_id?: string;
1020
1818
  from_store?: boolean;
1021
1819
  }
1820
+ /** @deprecated Use validated managed Messaging realtime events. */
1022
1821
  interface InboxRealtimeEvent {
1023
1822
  type: 'message';
1024
1823
  conversation_key: string;
@@ -1029,6 +1828,40 @@ interface InboxRealtimeEvent {
1029
1828
  created_at: string;
1030
1829
  unread_count?: number;
1031
1830
  }
1831
+ /** Recipient-safe reason for a message or conversation report. */
1832
+ type MessageReportReason = 'off_platform_payment' | 'contact_sharing' | 'spam' | 'scam' | 'harassment' | 'counterfeit' | 'offensive' | 'other';
1833
+ /** Typed report input for a message or buyer/store conversation. */
1834
+ type CreateMessageReportInput = {
1835
+ subject_kind: 'message';
1836
+ message_id: string;
1837
+ reason: MessageReportReason;
1838
+ detail?: string;
1839
+ } | {
1840
+ subject_kind: 'conversation';
1841
+ partner_id: string;
1842
+ store_id: string;
1843
+ reason: MessageReportReason;
1844
+ detail?: string;
1845
+ };
1846
+ /** Idempotent open-report result. */
1847
+ interface CreateMessageReportResult {
1848
+ id: string;
1849
+ status: 'open';
1850
+ deduplicated: boolean;
1851
+ }
1852
+ /** Context used to block one buyer/store relationship. */
1853
+ interface CreateMessageBlockInput {
1854
+ partner_id: string;
1855
+ store_id: string;
1856
+ from_store?: boolean;
1857
+ reason?: string;
1858
+ }
1859
+ /** Idempotent active-block result. */
1860
+ interface CreateMessageBlockResult {
1861
+ id: string;
1862
+ active: true;
1863
+ deduplicated: boolean;
1864
+ }
1032
1865
 
1033
1866
  type NotificationType = 'order' | 'message' | 'price_drop' | 'offer' | 'payout' | 'system';
1034
1867
  interface Notification {
@@ -1402,6 +2235,10 @@ interface MitumbaClientConfig {
1402
2235
  * needs to re-authenticate. Only fires when session is truly dead.
1403
2236
  */
1404
2237
  onAuthExpired?: () => void;
2238
+ /**
2239
+ * Optional isomorphic WebSocket factory. Defaults to globalThis.WebSocket when available.
2240
+ */
2241
+ webSocketFactory?: WebSocketFactory;
1405
2242
  /**
1406
2243
  * Custom token store for persisting tokens. Defaults to IndexedDB in browsers,
1407
2244
  * in-memory elsewhere. Pass your own implementation for custom persistence.
@@ -1455,6 +2292,8 @@ declare class APIClient {
1455
2292
  }): Promise<void>;
1456
2293
  getToken(): string | undefined;
1457
2294
  getBaseUrl(): string;
2295
+ /** Create an isomorphic WebSocket using the configured or global transport. */
2296
+ createWebSocket(url: string, protocols: string | string[]): WebSocketLike;
1458
2297
  clearToken(): Promise<void>;
1459
2298
  /**
1460
2299
  * Check if user has a stored session (access or refresh token available).
@@ -1464,7 +2303,7 @@ declare class APIClient {
1464
2303
  * Hydrate tokens from the store into memory (call on app boot).
1465
2304
  */
1466
2305
  hydrate(): Promise<void>;
1467
- private ensureFreshToken;
2306
+ ensureFreshToken(options?: RequestOptions): Promise<void>;
1468
2307
  private request;
1469
2308
  private handleTokenRefresh;
1470
2309
  get<T>(path: string, params?: Record<string, string | number | boolean | undefined>, options?: RequestOptions): Promise<T>;
@@ -1906,40 +2745,90 @@ declare class VaziModule {
1906
2745
  declare class MessagesModule {
1907
2746
  private readonly client;
1908
2747
  constructor(client: APIClient);
1909
- /**
1910
- * List all conversations for the authenticated user.
1911
- */
2748
+ /** @deprecated Use listConversations or listStoreConversations. Context fields are non-authoritative server-validated hints. */
1912
2749
  list(storeId?: string, options?: RequestOptions): Promise<{
1913
2750
  data: Conversation[];
1914
2751
  }>;
1915
- /**
1916
- * Get the message thread with a specific partner.
1917
- */
2752
+ /** @deprecated Resolve a v2 thread and call listThreadMessages. */
1918
2753
  getThread(partnerId: string, storeId?: string, options?: RequestOptions): Promise<{
1919
2754
  data: Message[];
1920
2755
  }>;
1921
- /**
1922
- * Send a message to another user.
1923
- */
2756
+ /** @deprecated Use sendThreadMessage. Receiver and context fields are hints validated by the server. */
1924
2757
  send(input: SendMessageInput, options?: RequestOptions): Promise<{
1925
2758
  id: string;
1926
2759
  }>;
1927
- /**
1928
- * Mark all messages from a partner as read.
1929
- */
2760
+ /** @deprecated Use advanceThreadReadCursor for precise monotonic state. */
1930
2761
  markRead(partnerId: string, storeId?: string, options?: RequestOptions): Promise<{
1931
2762
  ok: true;
1932
2763
  }>;
1933
- /**
1934
- * Connect to the typing indicator WebSocket for a conversation.
1935
- * Token is passed via query param since WebSocket can't set headers.
1936
- */
2764
+ /** @deprecated Use managed messaging realtime. */
1937
2765
  connectTyping(partnerId: string): WebSocket;
1938
- /**
1939
- * Connect to the user-scoped inbox WebSocket.
1940
- * Emits InboxRealtimeEvent for every inbound message across all conversations.
1941
- */
2766
+ /** @deprecated Use managed messaging realtime. */
1942
2767
  connectInbox(): WebSocket;
2768
+ /** Create a legacy inbox socket only after hydrating/refreshing the access token. */
2769
+ connectInboxFresh(options?: RequestOptions): Promise<WebSocketLike>;
2770
+ /** Create a report for a message or conversation. */
2771
+ createReport(input: CreateMessageReportInput, options?: RequestOptions): Promise<CreateMessageReportResult>;
2772
+ /** Create an idempotent bilateral buyer/store relationship block. */
2773
+ createBlock(input: CreateMessageBlockInput, options?: RequestOptions): Promise<CreateMessageBlockResult>;
2774
+ /** Remove a block created by the current perspective. */
2775
+ removeBlock(blockId: string, options?: RequestOptions): Promise<{
2776
+ ok: true;
2777
+ active: false;
2778
+ }>;
2779
+ /** Discover server messaging capabilities. */
2780
+ getMessagingCapabilities(options?: RequestOptions): Promise<MessagingCapabilities>;
2781
+ /** List buyer and represented-store inbox perspectives. */
2782
+ listMessagingInboxes(options?: RequestOptions): Promise<MessagingInboxes>;
2783
+ /** List personal buyer conversations. */
2784
+ listConversations(params?: ListConversationsParams, options?: RequestOptions): Promise<CursorPage<ConversationSummary>>;
2785
+ /** List conversations for one represented store. */
2786
+ listStoreConversations(storeId: string, params?: ListConversationsParams, options?: RequestOptions): Promise<CursorPage<ConversationSummary>>;
2787
+ /** Get one authorized buyer/store conversation. */
2788
+ getConversation(perspective: MessagingPerspective, conversationId: string, options?: RequestOptions): Promise<ConversationSummary>;
2789
+ /** Resolve a General, Listing, or Order thread idempotently. */
2790
+ resolveThread(perspective: MessagingPerspective, input: BuyerResolveThreadInput | StoreResolveThreadInput, options: MessagingIdempotentRequestOptions): Promise<ResolveThreadResult>;
2791
+ /** List contextual thread cards for one conversation. */
2792
+ listThreads(perspective: MessagingPerspective, conversationId: string, params?: ListThreadsParams, options?: RequestOptions): Promise<CursorPage<ThreadCard>>;
2793
+ /** Get one contextual thread card and its conversation. */
2794
+ getConversationThread(perspective: MessagingPerspective, threadId: ThreadId, options?: RequestOptions): Promise<{
2795
+ conversation: ConversationSummary;
2796
+ thread: ThreadCard;
2797
+ }>;
2798
+ /** Update shared support status for a Listing or Order thread. */
2799
+ updateThreadStatus(perspective: MessagingPerspective, threadId: ThreadId, status: 'open' | 'resolved', options?: RequestOptions): Promise<ThreadCard>;
2800
+ /** Update perspective-private thread preferences. */
2801
+ updateThreadPreferences(perspective: MessagingPerspective, threadId: ThreadId, preferences: UpdateThreadPreferencesInput, options?: RequestOptions): Promise<ThreadCard>;
2802
+ /** Update perspective-private conversation preferences. */
2803
+ updateConversationPreferences(perspective: MessagingPerspective, conversationId: string, preferences: UpdateConversationPreferencesInput, options?: RequestOptions): Promise<ConversationSummary>;
2804
+ /** List the newest, older, or catch-up timeline window for one thread. */
2805
+ listThreadMessages(perspective: MessagingPerspective, threadId: ThreadId, params?: ListThreadMessagesParams, options?: RequestOptions): Promise<MessagePage>;
2806
+ /** Send one idempotent message without ever replacing the caller-owned ID. */
2807
+ sendThreadMessage(perspective: MessagingPerspective, threadId: ThreadId, input: SendThreadMessageInput, options?: RequestOptions): Promise<SendThreadMessageResult>;
2808
+ /** Advance the selected perspective read cursor to one visible timeline item. */
2809
+ advanceThreadReadCursor(perspective: MessagingPerspective, threadId: ThreadId, timelineItemId: string, options?: RequestOptions): Promise<ReadCursorResult>;
2810
+ /** List read-only exact-participant legacy archives. */
2811
+ listLegacyMessageArchives(params?: ListConversationsParams, options?: RequestOptions): Promise<CursorPage<LegacyMessageArchiveSummary>>;
2812
+ /** List messages in one read-only legacy archive. */
2813
+ listLegacyMessages(legacyThreadId: string, params?: ListThreadMessagesParams, options?: RequestOptions): Promise<LegacyMessagePage>;
2814
+ /** Resolve a temporary partner/order link without guessing between stores. */
2815
+ resolveLegacyLink(input: {
2816
+ partner_id: string;
2817
+ store_id: string | null;
2818
+ order_id: string | null;
2819
+ }, options?: RequestOptions): Promise<LegacyLinkResolution>;
2820
+ /** Authorize a private attachment upload for one thread. */
2821
+ createThreadAttachmentUpload(perspective: MessagingPerspective, threadId: ThreadId, input: CreateAttachmentUploadInput, options?: RequestOptions): Promise<AttachmentUploadAuthorization>;
2822
+ /** Upload exact bytes through a one-use application ticket. */
2823
+ uploadThreadAttachment(authorization: AttachmentUploadAuthorization, body: AttachmentUploadBody, options?: RequestOptions): Promise<AttachmentUploadStatus>;
2824
+ /** Get current status for an upload created by the same perspective. */
2825
+ getThreadAttachmentUpload(perspective: MessagingPerspective, threadId: ThreadId, uploadId: string, options?: RequestOptions): Promise<AttachmentUploadStatus>;
2826
+ /** Create a short-lived mediated download for one committed attachment. */
2827
+ createThreadAttachmentDownload(perspective: MessagingPerspective, threadId: ThreadId, attachmentId: string, options?: RequestOptions): Promise<AttachmentDownloadAuthorization>;
2828
+ /** Create an inert managed realtime connection. Register listeners before start(). */
2829
+ createMessagesRealtimeConnection(options: MessagesRealtimeOptions): MessagesRealtimeConnection;
2830
+ /** Create and start a managed realtime connection. */
2831
+ connectMessagesRealtime(options: MessagesRealtimeOptions): Promise<MessagesRealtimeConnection>;
1943
2832
  }
1944
2833
 
1945
2834
  declare class NotificationsModule {
@@ -2757,4 +3646,4 @@ declare class MitumbaClient {
2757
3646
  isAuthenticated(): Promise<boolean>;
2758
3647
  }
2759
3648
 
2760
- 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 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, 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 CreateBaleInput, type CreateBaleOrderInput, type CreateListingInput, type CreateOrderInput, type CreateReportInput, type CreateReviewInput, type CreateStoreInput, 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 LinkedAccount, type LinkedAccountProvider, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LoginInput, MailerModule, type MailerTemplate, MemoryTokenStore, type Message, type MessageResponse, MessagesModule, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationPref, type NotificationType, NotificationsModule, ORDER_STATUSES, type 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 RecoveryStatus, type RecoveryStatusResult, type RegenerateBackupCodesResult, type RegisterInput, type RegistrationResponseJSON, ReportsModule, type RequestOptions, type RequestRecoveryInput, type RequestRecoveryResult, type ResetPasswordInput, type ResolveDisputeInput, 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 Session, SettingsModule, type ShareUrlOptions, type SimilarListing, type StiEvent, type StkPushInput, type StkPushResponse, type Store, type StoreAnalytics, type StoreSettings, type StoreStats, StoresModule, type SubscriptionTier, type SystemStats, TWO_FACTOR_METHOD_TYPES, type TokenStore, type TransitionOrderInput, type TrendingTerm, type TwoFactorMethod, type TwoFactorMethodType, type TwoFactorRequired, type UpdateBusinessInput, type UpdateListingInput, type UpdateProfileInput, type UpdateStoreInput, UploadsModule, type UserProfile, type VAZIOutfit, type VAZIOutfitDetail, type VAZIOutfitDetailItem, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type Verify2FAInput, type VerifyOtpInput, type WholesaleDepot, type WholesaleFeedParams, WholesaleModule, type WholesaleStore, type WishlistListing, WishlistsModule, baleShareUrl, createTokenStore, listingShareUrl, storeShareUrl };
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 };