@mitumba/sdk 1.28.0 → 1.30.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 CHANGED
@@ -24,6 +24,240 @@ declare class IDBTokenStore implements TokenStore {
24
24
  /** Creates IDBTokenStore if indexedDB is available, otherwise MemoryTokenStore. */
25
25
  declare function createTokenStore(): TokenStore;
26
26
 
27
+ interface BlockedIp {
28
+ ip: string;
29
+ reason: string;
30
+ blocked_at: string;
31
+ expires_at: string;
32
+ lifted_at: string | null;
33
+ blocked_by_email: string | null;
34
+ }
35
+ interface SystemStats {
36
+ total_users: number;
37
+ total_sellers: number;
38
+ total_listings: number;
39
+ total_orders: number;
40
+ total_revenue: number;
41
+ active_today: number;
42
+ }
43
+ interface AdminUserListItem {
44
+ id: string;
45
+ display_name: string | null;
46
+ email: string | null;
47
+ phone: string | null;
48
+ is_active: boolean;
49
+ roles: string[];
50
+ created_at: string;
51
+ }
52
+ interface AdminUserDetail {
53
+ id: string;
54
+ email: string | null;
55
+ phone: string | null;
56
+ display_name: string | null;
57
+ county: string | null;
58
+ city_id: string | null;
59
+ is_active: boolean;
60
+ suspended_at: string | null;
61
+ suspension_reason: string | null;
62
+ onboarding_completed: number;
63
+ email_verified: number;
64
+ created_at: string;
65
+ roles: string[];
66
+ order_count: number;
67
+ seller: {
68
+ sti_score: number;
69
+ seller_type: string;
70
+ verification_status: string;
71
+ } | null;
72
+ }
73
+ interface AdminStoreListItem {
74
+ id: string;
75
+ name: string;
76
+ slug: string;
77
+ seller_id: string;
78
+ is_verified: boolean;
79
+ subscription_tier: 'free' | 'pro';
80
+ sti_score: number | null;
81
+ created_at: string;
82
+ }
83
+ interface AdminStoreDetail {
84
+ id: string;
85
+ seller_id: string;
86
+ name: string;
87
+ slug: string;
88
+ tagline: string | null;
89
+ description: string | null;
90
+ category: string | null;
91
+ logo_url: string | null;
92
+ banner_url: string | null;
93
+ city_id: string | null;
94
+ subscription_tier: 'free' | 'pro';
95
+ is_verified: boolean;
96
+ created_at: string;
97
+ updated_at: string;
98
+ owner_name: string | null;
99
+ owner_email: string | null;
100
+ sti_score: number | null;
101
+ seller_type: string | null;
102
+ verification_status: string | null;
103
+ listing_count: number;
104
+ order_count: number;
105
+ }
106
+ interface AdminVerificationItem {
107
+ user_id: string;
108
+ seller_type: string;
109
+ verification_status: 'unverified' | 'pending' | 'verified' | 'rejected';
110
+ updated_at: string;
111
+ display_name: string | null;
112
+ email: string | null;
113
+ phone: string | null;
114
+ id_document_url: string | null;
115
+ kra_pin: string | null;
116
+ }
117
+ interface StiEvent {
118
+ trigger_type: string;
119
+ trigger_order_id: string | null;
120
+ score_before: number;
121
+ score_after: number;
122
+ delta: number;
123
+ reason: string;
124
+ created_at: string;
125
+ }
126
+ interface AdminListingItem {
127
+ id: string;
128
+ title: string;
129
+ price: number;
130
+ status: 'draft' | 'active' | 'sold' | 'removed';
131
+ photo_verified: boolean;
132
+ seller_id: string;
133
+ store_id: string | null;
134
+ created_at: string;
135
+ image_url: string | null;
136
+ }
137
+ interface AdminOrderListItem {
138
+ id: string;
139
+ buyer_id: string;
140
+ seller_id: string;
141
+ store_id: string | null;
142
+ total: number;
143
+ status: string;
144
+ created_at: string;
145
+ listing_title: string | null;
146
+ }
147
+ interface AdminOrderDetail {
148
+ id: string;
149
+ buyer_id: string;
150
+ seller_id: string;
151
+ store_id: string | null;
152
+ listing_id: string;
153
+ amount: number;
154
+ delivery_fee: number;
155
+ total: number;
156
+ status: string;
157
+ city_id: string;
158
+ created_at: string;
159
+ updated_at: string;
160
+ events: unknown[];
161
+ payment: unknown | null;
162
+ payout: unknown | null;
163
+ dispute: unknown | null;
164
+ }
165
+ interface AdminPayoutItem {
166
+ id: string;
167
+ order_id: string;
168
+ seller_id: string;
169
+ amount: number;
170
+ provider: string;
171
+ status: 'pending' | 'sent' | 'failed';
172
+ on_hold: boolean;
173
+ created_at: string;
174
+ }
175
+ interface AdminReport {
176
+ id: string;
177
+ reporter_id: string;
178
+ target_type: 'listing' | 'review' | 'store' | 'user';
179
+ target_id: string;
180
+ reason: string;
181
+ detail: string | null;
182
+ status: 'open' | 'reviewed' | 'dismissed' | 'actioned';
183
+ created_at: string;
184
+ }
185
+ interface AdminVaziOutfit {
186
+ id: string;
187
+ name: string;
188
+ seed_listing_id: string;
189
+ render_status: string;
190
+ removed: boolean;
191
+ item_count: number;
192
+ total_price: number;
193
+ engagement_impressions: number;
194
+ engagement_clicks: number;
195
+ engagement_purchases: number;
196
+ assembled_at: string;
197
+ }
198
+ interface CreateReportInput {
199
+ target_type: 'listing' | 'review' | 'store' | 'user';
200
+ target_id: string;
201
+ reason: 'counterfeit' | 'offensive' | 'spam' | 'scam' | 'other';
202
+ detail?: string;
203
+ }
204
+ type AdminPermission = 'admin:read' | 'users:moderate' | 'ip:block' | 'listings:moderate' | 'orders:transition' | 'payouts:disburse' | 'sellers:verify' | 'recovery:review' | 'broadcast:send' | 'roles:grant' | 'audit:read';
205
+ type AdminAuthStrength = 'password' | 'sms' | 'email' | 'totp' | 'passkey';
206
+ interface AdminRolePreset {
207
+ id: string;
208
+ name: string;
209
+ description: string;
210
+ permissions: AdminPermission[];
211
+ sensitive: boolean;
212
+ }
213
+ interface AdminPermissionDescription {
214
+ permission: AdminPermission;
215
+ requires_strength: AdminAuthStrength | null;
216
+ }
217
+ interface OperatorPermissionGrant {
218
+ permission: AdminPermission;
219
+ granted_at: string;
220
+ granted_by: string | null;
221
+ }
222
+ interface AdminOperator {
223
+ id: string;
224
+ email: string;
225
+ display_name: string | null;
226
+ permissions: OperatorPermissionGrant[];
227
+ }
228
+ interface AdminAuditEntry {
229
+ id: string;
230
+ actor_id: string;
231
+ action: string;
232
+ target_type: string;
233
+ target_id: string;
234
+ detail: string | null;
235
+ created_at: string;
236
+ }
237
+ interface PendingPayoutApproval {
238
+ id: string;
239
+ order_id: string;
240
+ seller_id: string;
241
+ seller_email: string;
242
+ seller_name: string | null;
243
+ amount: number;
244
+ created_at: string;
245
+ order_status: string | null;
246
+ fulfilled_at: string | null;
247
+ received_at: string | null;
248
+ dispute_count: number;
249
+ prior_payouts: number;
250
+ active_restrictions: number;
251
+ hold_reason: string | null;
252
+ held_at: string | null;
253
+ }
254
+ interface AdminWholesalePendingStore {
255
+ id: string;
256
+ name: string;
257
+ seller_id: string;
258
+ [key: string]: unknown;
259
+ }
260
+
27
261
  interface AuthTokens {
28
262
  access_token: string;
29
263
  refresh_token: string;
@@ -221,10 +455,87 @@ interface UserProfile {
221
455
  two_factor_methods_count?: number;
222
456
  sms_2fa_available?: boolean;
223
457
  email_2fa_available?: boolean;
458
+ /** Unused backup codes left. */
459
+ backup_codes_remaining?: number;
460
+ /** True at two or fewer, while a verified second factor exists. */
461
+ backup_codes_low?: boolean;
462
+ /** Explicit admin grants, whether or not they currently reach the token. */
463
+ admin_permissions?: AdminPermission[];
464
+ /** Grants exist but are withheld until a second factor is verified. */
465
+ admin_enrolment_required?: boolean;
224
466
  is_active: boolean;
225
467
  created_at: string;
226
468
  roles: string[];
227
469
  }
470
+ interface AuthCapabilities {
471
+ sms_otp_enabled: boolean;
472
+ email_2fa_enabled: boolean;
473
+ password_min_length: number;
474
+ }
475
+ interface RegenerateBackupCodesResult {
476
+ /** Shown once. Never persisted by the SDK. */
477
+ backup_codes: string[];
478
+ remaining: number;
479
+ }
480
+ type RecoveryStatus = 'none' | 'pending' | 'approved';
481
+ interface RequestRecoveryInput {
482
+ temp_token: string;
483
+ reason?: string;
484
+ }
485
+ interface RequestRecoveryResult {
486
+ id: string;
487
+ status: 'pending' | 'approved';
488
+ cooling_off_hours: number;
489
+ payout_freeze_days?: number;
490
+ hours_remaining?: number | null;
491
+ already_open: boolean;
492
+ }
493
+ interface RecoveryStatusResult {
494
+ status: RecoveryStatus;
495
+ id?: string;
496
+ cooling_off_hours: number;
497
+ payout_freeze_days?: number;
498
+ hours_remaining?: number | null;
499
+ can_complete?: boolean;
500
+ }
501
+ interface CompleteRecoveryResult extends AuthTokens {
502
+ /** Shown once. Never persisted by the SDK. */
503
+ backup_codes: string[];
504
+ payout_frozen_until: string;
505
+ payout_freeze_days: number;
506
+ }
507
+ interface AdminRecoveryRequest {
508
+ id: string;
509
+ user_id: string;
510
+ email: string;
511
+ status: 'pending' | 'approved' | 'rejected' | 'cancelled' | 'completed';
512
+ reason: string | null;
513
+ requested_ip: string | null;
514
+ reviewed_by: string | null;
515
+ reviewed_at: string | null;
516
+ review_note: string | null;
517
+ effective_at: string | null;
518
+ completed_at: string | null;
519
+ created_at: string;
520
+ }
521
+ interface AdminRecoveryEvent {
522
+ id: string;
523
+ event: string;
524
+ actor_id: string | null;
525
+ detail: string | null;
526
+ created_at: string;
527
+ }
528
+ interface RootSetupInput {
529
+ email: string;
530
+ password: string;
531
+ /** One-time bootstrap secret, removed from the Worker immediately after setup. */
532
+ setup_secret: string;
533
+ }
534
+ interface RootSetupResult {
535
+ ok: true;
536
+ permissions: AdminPermission[];
537
+ next_step: string;
538
+ }
228
539
 
229
540
  declare const CONDITIONS: readonly ["new", "like_new", "good", "fair"];
230
541
  type Condition = typeof CONDITIONS[number];
@@ -559,7 +870,38 @@ interface PaymentStatusResponse {
559
870
  status: PaymentStatus;
560
871
  total: number;
561
872
  }
562
- type PaymentProvider = 'daraja' | 'intasend' | 'paystack' | 'airtel';
873
+ type KnownPaymentProvider = 'daraja' | 'intasend' | 'paystack' | 'airtel';
874
+ type ProviderId = KnownPaymentProvider | (string & {});
875
+ type PaymentProvider = ProviderId;
876
+ type CheckoutPaymentMethod = {
877
+ type: 'mobile_money';
878
+ phone: string;
879
+ } | {
880
+ type: 'card';
881
+ };
882
+ interface InitiateCheckoutInput {
883
+ order_id: string;
884
+ idempotency_key: string;
885
+ method: CheckoutPaymentMethod;
886
+ }
887
+ type CheckoutNextAction = {
888
+ type: 'await_confirmation';
889
+ } | {
890
+ type: 'redirect';
891
+ url: string;
892
+ expires_at: string | null;
893
+ };
894
+ interface InitiateCheckoutResponse {
895
+ version: 1;
896
+ order_id: string;
897
+ attempt: {
898
+ id: string;
899
+ sequence: number;
900
+ provider: ProviderId;
901
+ status: 'initiated';
902
+ };
903
+ next_action: CheckoutNextAction;
904
+ }
563
905
  type PaymentAttemptStatus = 'initiated' | 'funded' | 'failed' | 'refunded' | 'cancelled';
564
906
  type CheckoutStatus = 'pending' | 'paid' | 'failed' | 'cancelled' | 'refunded';
565
907
  type CheckoutOrder = {
@@ -967,181 +1309,6 @@ interface UpdateBusinessInput {
967
1309
  price_range_max?: number;
968
1310
  }
969
1311
 
970
- interface BlockedIp {
971
- ip: string;
972
- blocked_at: string;
973
- expires_at: string;
974
- }
975
- interface SystemStats {
976
- total_users: number;
977
- total_sellers: number;
978
- total_listings: number;
979
- total_orders: number;
980
- total_revenue: number;
981
- active_today: number;
982
- }
983
- interface AdminUserListItem {
984
- id: string;
985
- display_name: string | null;
986
- email: string | null;
987
- phone: string | null;
988
- is_active: boolean;
989
- roles: string[];
990
- created_at: string;
991
- }
992
- interface AdminUserDetail {
993
- id: string;
994
- email: string | null;
995
- phone: string | null;
996
- display_name: string | null;
997
- county: string | null;
998
- city_id: string | null;
999
- is_active: boolean;
1000
- suspended_at: string | null;
1001
- suspension_reason: string | null;
1002
- onboarding_completed: number;
1003
- email_verified: number;
1004
- created_at: string;
1005
- roles: string[];
1006
- order_count: number;
1007
- seller: {
1008
- sti_score: number;
1009
- seller_type: string;
1010
- verification_status: string;
1011
- } | null;
1012
- }
1013
- interface AdminStoreListItem {
1014
- id: string;
1015
- name: string;
1016
- slug: string;
1017
- seller_id: string;
1018
- is_verified: boolean;
1019
- subscription_tier: 'free' | 'pro';
1020
- sti_score: number | null;
1021
- created_at: string;
1022
- }
1023
- interface AdminStoreDetail {
1024
- id: string;
1025
- seller_id: string;
1026
- name: string;
1027
- slug: string;
1028
- tagline: string | null;
1029
- description: string | null;
1030
- category: string | null;
1031
- logo_url: string | null;
1032
- banner_url: string | null;
1033
- city_id: string | null;
1034
- subscription_tier: 'free' | 'pro';
1035
- is_verified: boolean;
1036
- created_at: string;
1037
- updated_at: string;
1038
- owner_name: string | null;
1039
- owner_email: string | null;
1040
- sti_score: number | null;
1041
- seller_type: string | null;
1042
- verification_status: string | null;
1043
- listing_count: number;
1044
- order_count: number;
1045
- }
1046
- interface AdminVerificationItem {
1047
- user_id: string;
1048
- seller_type: string;
1049
- verification_status: 'unverified' | 'pending' | 'verified' | 'rejected';
1050
- updated_at: string;
1051
- display_name: string | null;
1052
- email: string | null;
1053
- phone: string | null;
1054
- id_document_url: string | null;
1055
- kra_pin: string | null;
1056
- }
1057
- interface StiEvent {
1058
- trigger_type: string;
1059
- trigger_order_id: string | null;
1060
- score_before: number;
1061
- score_after: number;
1062
- delta: number;
1063
- reason: string;
1064
- created_at: string;
1065
- }
1066
- interface AdminListingItem {
1067
- id: string;
1068
- title: string;
1069
- price: number;
1070
- status: 'draft' | 'active' | 'sold' | 'removed';
1071
- photo_verified: boolean;
1072
- seller_id: string;
1073
- store_id: string | null;
1074
- created_at: string;
1075
- image_url: string | null;
1076
- }
1077
- interface AdminOrderListItem {
1078
- id: string;
1079
- buyer_id: string;
1080
- seller_id: string;
1081
- store_id: string | null;
1082
- total: number;
1083
- status: string;
1084
- created_at: string;
1085
- listing_title: string | null;
1086
- }
1087
- interface AdminOrderDetail {
1088
- id: string;
1089
- buyer_id: string;
1090
- seller_id: string;
1091
- store_id: string | null;
1092
- listing_id: string;
1093
- amount: number;
1094
- delivery_fee: number;
1095
- total: number;
1096
- status: string;
1097
- city_id: string;
1098
- created_at: string;
1099
- updated_at: string;
1100
- events: unknown[];
1101
- payment: unknown | null;
1102
- payout: unknown | null;
1103
- dispute: unknown | null;
1104
- }
1105
- interface AdminPayoutItem {
1106
- id: string;
1107
- order_id: string;
1108
- seller_id: string;
1109
- amount: number;
1110
- provider: string;
1111
- status: 'pending' | 'sent' | 'failed';
1112
- on_hold: boolean;
1113
- created_at: string;
1114
- }
1115
- interface AdminReport {
1116
- id: string;
1117
- reporter_id: string;
1118
- target_type: 'listing' | 'review' | 'store' | 'user';
1119
- target_id: string;
1120
- reason: string;
1121
- detail: string | null;
1122
- status: 'open' | 'reviewed' | 'dismissed' | 'actioned';
1123
- created_at: string;
1124
- }
1125
- interface AdminVaziOutfit {
1126
- id: string;
1127
- name: string;
1128
- seed_listing_id: string;
1129
- render_status: string;
1130
- removed: boolean;
1131
- item_count: number;
1132
- total_price: number;
1133
- engagement_impressions: number;
1134
- engagement_clicks: number;
1135
- engagement_purchases: number;
1136
- assembled_at: string;
1137
- }
1138
- interface CreateReportInput {
1139
- target_type: 'listing' | 'review' | 'store' | 'user';
1140
- target_id: string;
1141
- reason: 'counterfeit' | 'offensive' | 'spam' | 'scam' | 'other';
1142
- detail?: string;
1143
- }
1144
-
1145
1312
  declare const DISPUTE_REASONS: readonly ["not_received", "not_as_described", "damaged", "counterfeit", "wrong_item"];
1146
1313
  type DisputeReason = typeof DISPUTE_REASONS[number];
1147
1314
  declare const DESIRED_RESOLUTIONS: readonly ["refund", "replacement", "partial_refund"];
@@ -1253,6 +1420,13 @@ interface PaginatedResponse<T> {
1253
1420
 
1254
1421
  interface RequestOptions {
1255
1422
  signal?: AbortSignal;
1423
+ /**
1424
+ * Additional request headers for one-off protocol credentials such as X-Root-Setup-Secret.
1425
+ *
1426
+ * Authorization is always overwritten by the SDK's token handling, so a caller cannot bypass
1427
+ * refresh/session semantics through this escape hatch.
1428
+ */
1429
+ headers?: Record<string, string>;
1256
1430
  }
1257
1431
 
1258
1432
  declare class APIError extends Error {
@@ -1436,6 +1610,49 @@ declare class AuthModule {
1436
1610
  temp_token: string;
1437
1611
  credential: AuthenticationResponseJSON;
1438
1612
  }, options?: RequestOptions): Promise<AuthTokens>;
1613
+ /**
1614
+ * One-time root bootstrap. The setup secret travels in a header and is never part of the JSON
1615
+ * body, where an error logger or request capture is more likely to record it.
1616
+ */
1617
+ setupRoot(input: RootSetupInput, options?: RequestOptions): Promise<RootSetupResult>;
1618
+ /** Public auth-mode document. Never requires or changes the session. */
1619
+ capabilities(options?: RequestOptions): Promise<AuthCapabilities>;
1620
+ /**
1621
+ * Replace every backup code after re-proving the current password.
1622
+ *
1623
+ * The result is intentionally not persisted by the SDK: codes are shown once, and storing them in
1624
+ * a browser turns a recovery credential into something a stolen session can read.
1625
+ */
1626
+ regenerateBackupCodes(currentPassword: string, options?: RequestOptions): Promise<RegenerateBackupCodesResult>;
1627
+ requestRecovery(input: RequestRecoveryInput, options?: RequestOptions): Promise<RequestRecoveryResult>;
1628
+ /**
1629
+ * Cancel with the token from the email. Always returns ok, whether it was valid or already used,
1630
+ * so this cannot be used to probe for live recoveries.
1631
+ */
1632
+ cancelRecovery(token: string, options?: RequestOptions): Promise<{
1633
+ ok: true;
1634
+ }>;
1635
+ recoveryStatus(tempToken: string, options?: RequestOptions): Promise<RecoveryStatusResult>;
1636
+ /**
1637
+ * Complete with a fresh temp token once cooling-off ends. Tokens are persisted; backup codes are
1638
+ * returned to the caller only and never stored.
1639
+ */
1640
+ completeRecovery(tempToken: string, options?: RequestOptions): Promise<CompleteRecoveryResult>;
1641
+ listRecoveryRequests(status?: AdminRecoveryRequest['status'], options?: RequestOptions): Promise<{
1642
+ requests: AdminRecoveryRequest[];
1643
+ }>;
1644
+ approveRecovery(id: string, reviewNote: string, options?: RequestOptions): Promise<{
1645
+ id: string;
1646
+ status: 'approved';
1647
+ effective_at: string;
1648
+ }>;
1649
+ rejectRecovery(id: string, reviewNote: string, options?: RequestOptions): Promise<{
1650
+ id: string;
1651
+ status: 'rejected';
1652
+ }>;
1653
+ recoveryEvents(id: string, options?: RequestOptions): Promise<{
1654
+ events: AdminRecoveryEvent[];
1655
+ }>;
1439
1656
  }
1440
1657
 
1441
1658
  declare class ListingsModule {
@@ -1638,6 +1855,19 @@ declare class PayModule {
1638
1855
  * Initiate a Paystack payment — returns access_code for inline popup.
1639
1856
  */
1640
1857
  initPaystack(input: PaystackInput, options?: RequestOptions): Promise<PaystackInitResponse>;
1858
+ /**
1859
+ * Initiate a provider-neutral checkout for an order.
1860
+ *
1861
+ * The payment provider is selected by the API. Continue checkout using the
1862
+ * returned next action, then poll {@link getCheckoutStatus} for payment state.
1863
+ * Retrying after cancellation requires the same input and idempotency key.
1864
+ *
1865
+ * @param input - Order, idempotency key, and buyer-selected payment method.
1866
+ * @param options - Request options, including an optional abort signal.
1867
+ * @returns The initiated attempt and its required continuation action.
1868
+ * @throws {APIError} When the API rejects or cannot initiate the checkout.
1869
+ */
1870
+ initiateCheckout(input: InitiateCheckoutInput, options?: RequestOptions): Promise<InitiateCheckoutResponse>;
1641
1871
  /**
1642
1872
  * Poll for the current status of a payment by its order ID.
1643
1873
  *
@@ -2054,10 +2284,23 @@ declare class BusinessesModule {
2054
2284
  declare class AdminModule {
2055
2285
  private readonly client;
2056
2286
  constructor(client: APIClient);
2287
+ /**
2288
+ * @deprecated Pass a reason as the second argument. Kept source-compatible because the method was
2289
+ * already published, even though the endpoint did not exist at the time.
2290
+ */
2057
2291
  blockIp(ip: string, durationHours?: number, options?: RequestOptions): Promise<{
2058
2292
  ok: true;
2059
2293
  blocked: string;
2060
2294
  hours: number;
2295
+ expires_at: string;
2296
+ note: string;
2297
+ }>;
2298
+ blockIp(ip: string, reason: string, durationHours?: number, options?: RequestOptions): Promise<{
2299
+ ok: true;
2300
+ blocked: string;
2301
+ hours: number;
2302
+ expires_at: string;
2303
+ note: string;
2061
2304
  }>;
2062
2305
  unblockIp(ip: string, options?: RequestOptions): Promise<{
2063
2306
  ok: true;
@@ -2241,6 +2484,53 @@ declare class AdminModule {
2241
2484
  ok: true;
2242
2485
  removed: false;
2243
2486
  }>;
2487
+ listOperators(options?: RequestOptions): Promise<{
2488
+ operators: AdminOperator[];
2489
+ }>;
2490
+ listAdminRoles(options?: RequestOptions): Promise<{
2491
+ roles: AdminRolePreset[];
2492
+ permissions: AdminPermissionDescription[];
2493
+ }>;
2494
+ grantOperatorPermission(userId: string, permission: AdminPermission, options?: RequestOptions): Promise<{
2495
+ ok: true;
2496
+ already_held: boolean;
2497
+ }>;
2498
+ revokeOperatorPermission(userId: string, permission: AdminPermission, options?: RequestOptions): Promise<{
2499
+ ok: true;
2500
+ note: string;
2501
+ }>;
2502
+ grantOperatorRole(userId: string, role: string, options?: RequestOptions): Promise<{
2503
+ ok: true;
2504
+ role: string;
2505
+ granted: AdminPermission[];
2506
+ already_held: AdminPermission[];
2507
+ }>;
2508
+ getAuditLog(limit?: number, options?: RequestOptions): Promise<{
2509
+ entries: AdminAuditEntry[];
2510
+ }>;
2511
+ listPayoutsAwaitingApproval(options?: RequestOptions): Promise<{
2512
+ payouts: PendingPayoutApproval[];
2513
+ }>;
2514
+ approvePayout(payoutId: string, options?: RequestOptions): Promise<{
2515
+ ok: true;
2516
+ already_approved: boolean;
2517
+ }>;
2518
+ holdPayout(payoutId: string, reason: string, options?: RequestOptions): Promise<{
2519
+ ok: true;
2520
+ }>;
2521
+ /** Repair a Daraja payout whose provider reference failed to persist. */
2522
+ repairPayoutCorrelation(payoutId: string, providerRef: string, options?: RequestOptions): Promise<{
2523
+ ok: true;
2524
+ }>;
2525
+ listPendingWholesaleStores(options?: RequestOptions): Promise<{
2526
+ data: AdminWholesalePendingStore[];
2527
+ }>;
2528
+ verifyWholesaleStore(storeId: string, options?: RequestOptions): Promise<{
2529
+ ok: true;
2530
+ }>;
2531
+ unverifyWholesaleStore(storeId: string, options?: RequestOptions): Promise<{
2532
+ ok: true;
2533
+ }>;
2244
2534
  broadcast(input: {
2245
2535
  title: string;
2246
2536
  body: string;
@@ -2442,4 +2732,4 @@ declare class MitumbaClient {
2442
2732
  isAuthenticated(): Promise<boolean>;
2443
2733
  }
2444
2734
 
2445
- export { APIClient, APIError, type APIErrorResponse, type Add2FAMethodInput, type Add2FAMethodResult, type AddAddressInput, type AddDepotInput, type AddPaymentMethodInput, type Address, type AdminListingItem, AdminModule, type AdminOrderDetail, type AdminOrderListItem, type AdminPayoutItem, type AdminReport, type AdminStoreDetail, type AdminStoreListItem, type AdminUserDetail, type AdminUserListItem, type AdminVaziOutfit, type AdminVerificationItem, 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 CheckoutOrder, type CheckoutStatus, type CheckoutStatusResponse, type City, type CompleteOnboardingInput, type Condition, type Conversation, type CreateBaleInput, type CreateBaleOrderInput, type CreateListingInput, type CreateOrderInput, type CreateReportInput, type CreateReviewInput, type CreateStoreInput, DESIRED_RESOLUTIONS, DISPUTE_REASONS, DISPUTE_STATUSES, type DeliveryAddress, type DesiredResolution, type Dispute, type DisputeEvent, type DisputeEvidence, type DisputeListParams, type DisputeReason, type DisputeStatus, DisputesModule, type EmailLoginInput, type EmailRegisterInput, type FollowedStore, type ForgotPasswordInput, IDBTokenStore, type InboxRealtimeEvent, LISTING_STATUSES, type LinkedAccount, type LinkedAccountProvider, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LoginInput, MailerModule, type MailerTemplate, MemoryTokenStore, type Message, type MessageResponse, MessagesModule, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationPref, type NotificationType, NotificationsModule, ORDER_STATUSES, type Order, type OrderEvent, type OrderHistoryParams, type OrderStatus, OrdersModule, PAYMENT_STATUSES, type PaginatedResponse, PayModule, type PaymentAttemptStatus, type PaymentMethod, type PaymentMethodType, type PaymentProvider, type PaymentStatus, type PaymentStatusResponse, type PaystackInitResponse, type PaystackInput, type PhoneLoginInput, type PhoneRegisterInput, type PresignImageResponse, type PublicKeyCredentialCreationOptionsJSON, type PublicKeyCredentialRequestOptionsJSON, type RaiseDisputeInput, type RegisterInput, type RegistrationResponseJSON, ReportsModule, type RequestOptions, type ResetPasswordInput, type ResolveDisputeInput, type RespondDisputeInput, type Review, type ReviewableOrder, ReviewsModule, 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 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, createTokenStore };
2735
+ 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, 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 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, createTokenStore };