@mitumba/sdk 1.29.0 → 1.30.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.mts +425 -176
- package/dist/index.d.ts +425 -176
- package/dist/index.js +128 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +128 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -24,6 +24,243 @@ 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
|
+
/** Present once a finance operator has approved it; item stays in the queue until disbursed. */
|
|
252
|
+
approved_at: string | null;
|
|
253
|
+
approved_by: string | null;
|
|
254
|
+
hold_reason: string | null;
|
|
255
|
+
held_at: string | null;
|
|
256
|
+
}
|
|
257
|
+
interface AdminWholesalePendingStore {
|
|
258
|
+
id: string;
|
|
259
|
+
name: string;
|
|
260
|
+
seller_id: string;
|
|
261
|
+
[key: string]: unknown;
|
|
262
|
+
}
|
|
263
|
+
|
|
27
264
|
interface AuthTokens {
|
|
28
265
|
access_token: string;
|
|
29
266
|
refresh_token: string;
|
|
@@ -221,10 +458,87 @@ interface UserProfile {
|
|
|
221
458
|
two_factor_methods_count?: number;
|
|
222
459
|
sms_2fa_available?: boolean;
|
|
223
460
|
email_2fa_available?: boolean;
|
|
461
|
+
/** Unused backup codes left. */
|
|
462
|
+
backup_codes_remaining?: number;
|
|
463
|
+
/** True at two or fewer, while a verified second factor exists. */
|
|
464
|
+
backup_codes_low?: boolean;
|
|
465
|
+
/** Explicit admin grants, whether or not they currently reach the token. */
|
|
466
|
+
admin_permissions?: AdminPermission[];
|
|
467
|
+
/** Grants exist but are withheld until a second factor is verified. */
|
|
468
|
+
admin_enrolment_required?: boolean;
|
|
224
469
|
is_active: boolean;
|
|
225
470
|
created_at: string;
|
|
226
471
|
roles: string[];
|
|
227
472
|
}
|
|
473
|
+
interface AuthCapabilities {
|
|
474
|
+
sms_otp_enabled: boolean;
|
|
475
|
+
email_2fa_enabled: boolean;
|
|
476
|
+
password_min_length: number;
|
|
477
|
+
}
|
|
478
|
+
interface RegenerateBackupCodesResult {
|
|
479
|
+
/** Shown once. Never persisted by the SDK. */
|
|
480
|
+
backup_codes: string[];
|
|
481
|
+
remaining: number;
|
|
482
|
+
}
|
|
483
|
+
type RecoveryStatus = 'none' | 'pending' | 'approved';
|
|
484
|
+
interface RequestRecoveryInput {
|
|
485
|
+
temp_token: string;
|
|
486
|
+
reason?: string;
|
|
487
|
+
}
|
|
488
|
+
interface RequestRecoveryResult {
|
|
489
|
+
id: string;
|
|
490
|
+
status: 'pending' | 'approved';
|
|
491
|
+
cooling_off_hours: number;
|
|
492
|
+
payout_freeze_days?: number;
|
|
493
|
+
hours_remaining?: number | null;
|
|
494
|
+
already_open: boolean;
|
|
495
|
+
}
|
|
496
|
+
interface RecoveryStatusResult {
|
|
497
|
+
status: RecoveryStatus;
|
|
498
|
+
id?: string;
|
|
499
|
+
cooling_off_hours: number;
|
|
500
|
+
payout_freeze_days?: number;
|
|
501
|
+
hours_remaining?: number | null;
|
|
502
|
+
can_complete?: boolean;
|
|
503
|
+
}
|
|
504
|
+
interface CompleteRecoveryResult extends AuthTokens {
|
|
505
|
+
/** Shown once. Never persisted by the SDK. */
|
|
506
|
+
backup_codes: string[];
|
|
507
|
+
payout_frozen_until: string;
|
|
508
|
+
payout_freeze_days: number;
|
|
509
|
+
}
|
|
510
|
+
interface AdminRecoveryRequest {
|
|
511
|
+
id: string;
|
|
512
|
+
user_id: string;
|
|
513
|
+
email: string;
|
|
514
|
+
status: 'pending' | 'approved' | 'rejected' | 'cancelled' | 'completed';
|
|
515
|
+
reason: string | null;
|
|
516
|
+
requested_ip: string | null;
|
|
517
|
+
reviewed_by: string | null;
|
|
518
|
+
reviewed_at: string | null;
|
|
519
|
+
review_note: string | null;
|
|
520
|
+
effective_at: string | null;
|
|
521
|
+
completed_at: string | null;
|
|
522
|
+
created_at: string;
|
|
523
|
+
}
|
|
524
|
+
interface AdminRecoveryEvent {
|
|
525
|
+
id: string;
|
|
526
|
+
event: string;
|
|
527
|
+
actor_id: string | null;
|
|
528
|
+
detail: string | null;
|
|
529
|
+
created_at: string;
|
|
530
|
+
}
|
|
531
|
+
interface RootSetupInput {
|
|
532
|
+
email: string;
|
|
533
|
+
password: string;
|
|
534
|
+
/** One-time bootstrap secret, removed from the Worker immediately after setup. */
|
|
535
|
+
setup_secret: string;
|
|
536
|
+
}
|
|
537
|
+
interface RootSetupResult {
|
|
538
|
+
ok: true;
|
|
539
|
+
permissions: AdminPermission[];
|
|
540
|
+
next_step: string;
|
|
541
|
+
}
|
|
228
542
|
|
|
229
543
|
declare const CONDITIONS: readonly ["new", "like_new", "good", "fair"];
|
|
230
544
|
type Condition = typeof CONDITIONS[number];
|
|
@@ -998,181 +1312,6 @@ interface UpdateBusinessInput {
|
|
|
998
1312
|
price_range_max?: number;
|
|
999
1313
|
}
|
|
1000
1314
|
|
|
1001
|
-
interface BlockedIp {
|
|
1002
|
-
ip: string;
|
|
1003
|
-
blocked_at: string;
|
|
1004
|
-
expires_at: string;
|
|
1005
|
-
}
|
|
1006
|
-
interface SystemStats {
|
|
1007
|
-
total_users: number;
|
|
1008
|
-
total_sellers: number;
|
|
1009
|
-
total_listings: number;
|
|
1010
|
-
total_orders: number;
|
|
1011
|
-
total_revenue: number;
|
|
1012
|
-
active_today: number;
|
|
1013
|
-
}
|
|
1014
|
-
interface AdminUserListItem {
|
|
1015
|
-
id: string;
|
|
1016
|
-
display_name: string | null;
|
|
1017
|
-
email: string | null;
|
|
1018
|
-
phone: string | null;
|
|
1019
|
-
is_active: boolean;
|
|
1020
|
-
roles: string[];
|
|
1021
|
-
created_at: string;
|
|
1022
|
-
}
|
|
1023
|
-
interface AdminUserDetail {
|
|
1024
|
-
id: string;
|
|
1025
|
-
email: string | null;
|
|
1026
|
-
phone: string | null;
|
|
1027
|
-
display_name: string | null;
|
|
1028
|
-
county: string | null;
|
|
1029
|
-
city_id: string | null;
|
|
1030
|
-
is_active: boolean;
|
|
1031
|
-
suspended_at: string | null;
|
|
1032
|
-
suspension_reason: string | null;
|
|
1033
|
-
onboarding_completed: number;
|
|
1034
|
-
email_verified: number;
|
|
1035
|
-
created_at: string;
|
|
1036
|
-
roles: string[];
|
|
1037
|
-
order_count: number;
|
|
1038
|
-
seller: {
|
|
1039
|
-
sti_score: number;
|
|
1040
|
-
seller_type: string;
|
|
1041
|
-
verification_status: string;
|
|
1042
|
-
} | null;
|
|
1043
|
-
}
|
|
1044
|
-
interface AdminStoreListItem {
|
|
1045
|
-
id: string;
|
|
1046
|
-
name: string;
|
|
1047
|
-
slug: string;
|
|
1048
|
-
seller_id: string;
|
|
1049
|
-
is_verified: boolean;
|
|
1050
|
-
subscription_tier: 'free' | 'pro';
|
|
1051
|
-
sti_score: number | null;
|
|
1052
|
-
created_at: string;
|
|
1053
|
-
}
|
|
1054
|
-
interface AdminStoreDetail {
|
|
1055
|
-
id: string;
|
|
1056
|
-
seller_id: string;
|
|
1057
|
-
name: string;
|
|
1058
|
-
slug: string;
|
|
1059
|
-
tagline: string | null;
|
|
1060
|
-
description: string | null;
|
|
1061
|
-
category: string | null;
|
|
1062
|
-
logo_url: string | null;
|
|
1063
|
-
banner_url: string | null;
|
|
1064
|
-
city_id: string | null;
|
|
1065
|
-
subscription_tier: 'free' | 'pro';
|
|
1066
|
-
is_verified: boolean;
|
|
1067
|
-
created_at: string;
|
|
1068
|
-
updated_at: string;
|
|
1069
|
-
owner_name: string | null;
|
|
1070
|
-
owner_email: string | null;
|
|
1071
|
-
sti_score: number | null;
|
|
1072
|
-
seller_type: string | null;
|
|
1073
|
-
verification_status: string | null;
|
|
1074
|
-
listing_count: number;
|
|
1075
|
-
order_count: number;
|
|
1076
|
-
}
|
|
1077
|
-
interface AdminVerificationItem {
|
|
1078
|
-
user_id: string;
|
|
1079
|
-
seller_type: string;
|
|
1080
|
-
verification_status: 'unverified' | 'pending' | 'verified' | 'rejected';
|
|
1081
|
-
updated_at: string;
|
|
1082
|
-
display_name: string | null;
|
|
1083
|
-
email: string | null;
|
|
1084
|
-
phone: string | null;
|
|
1085
|
-
id_document_url: string | null;
|
|
1086
|
-
kra_pin: string | null;
|
|
1087
|
-
}
|
|
1088
|
-
interface StiEvent {
|
|
1089
|
-
trigger_type: string;
|
|
1090
|
-
trigger_order_id: string | null;
|
|
1091
|
-
score_before: number;
|
|
1092
|
-
score_after: number;
|
|
1093
|
-
delta: number;
|
|
1094
|
-
reason: string;
|
|
1095
|
-
created_at: string;
|
|
1096
|
-
}
|
|
1097
|
-
interface AdminListingItem {
|
|
1098
|
-
id: string;
|
|
1099
|
-
title: string;
|
|
1100
|
-
price: number;
|
|
1101
|
-
status: 'draft' | 'active' | 'sold' | 'removed';
|
|
1102
|
-
photo_verified: boolean;
|
|
1103
|
-
seller_id: string;
|
|
1104
|
-
store_id: string | null;
|
|
1105
|
-
created_at: string;
|
|
1106
|
-
image_url: string | null;
|
|
1107
|
-
}
|
|
1108
|
-
interface AdminOrderListItem {
|
|
1109
|
-
id: string;
|
|
1110
|
-
buyer_id: string;
|
|
1111
|
-
seller_id: string;
|
|
1112
|
-
store_id: string | null;
|
|
1113
|
-
total: number;
|
|
1114
|
-
status: string;
|
|
1115
|
-
created_at: string;
|
|
1116
|
-
listing_title: string | null;
|
|
1117
|
-
}
|
|
1118
|
-
interface AdminOrderDetail {
|
|
1119
|
-
id: string;
|
|
1120
|
-
buyer_id: string;
|
|
1121
|
-
seller_id: string;
|
|
1122
|
-
store_id: string | null;
|
|
1123
|
-
listing_id: string;
|
|
1124
|
-
amount: number;
|
|
1125
|
-
delivery_fee: number;
|
|
1126
|
-
total: number;
|
|
1127
|
-
status: string;
|
|
1128
|
-
city_id: string;
|
|
1129
|
-
created_at: string;
|
|
1130
|
-
updated_at: string;
|
|
1131
|
-
events: unknown[];
|
|
1132
|
-
payment: unknown | null;
|
|
1133
|
-
payout: unknown | null;
|
|
1134
|
-
dispute: unknown | null;
|
|
1135
|
-
}
|
|
1136
|
-
interface AdminPayoutItem {
|
|
1137
|
-
id: string;
|
|
1138
|
-
order_id: string;
|
|
1139
|
-
seller_id: string;
|
|
1140
|
-
amount: number;
|
|
1141
|
-
provider: string;
|
|
1142
|
-
status: 'pending' | 'sent' | 'failed';
|
|
1143
|
-
on_hold: boolean;
|
|
1144
|
-
created_at: string;
|
|
1145
|
-
}
|
|
1146
|
-
interface AdminReport {
|
|
1147
|
-
id: string;
|
|
1148
|
-
reporter_id: string;
|
|
1149
|
-
target_type: 'listing' | 'review' | 'store' | 'user';
|
|
1150
|
-
target_id: string;
|
|
1151
|
-
reason: string;
|
|
1152
|
-
detail: string | null;
|
|
1153
|
-
status: 'open' | 'reviewed' | 'dismissed' | 'actioned';
|
|
1154
|
-
created_at: string;
|
|
1155
|
-
}
|
|
1156
|
-
interface AdminVaziOutfit {
|
|
1157
|
-
id: string;
|
|
1158
|
-
name: string;
|
|
1159
|
-
seed_listing_id: string;
|
|
1160
|
-
render_status: string;
|
|
1161
|
-
removed: boolean;
|
|
1162
|
-
item_count: number;
|
|
1163
|
-
total_price: number;
|
|
1164
|
-
engagement_impressions: number;
|
|
1165
|
-
engagement_clicks: number;
|
|
1166
|
-
engagement_purchases: number;
|
|
1167
|
-
assembled_at: string;
|
|
1168
|
-
}
|
|
1169
|
-
interface CreateReportInput {
|
|
1170
|
-
target_type: 'listing' | 'review' | 'store' | 'user';
|
|
1171
|
-
target_id: string;
|
|
1172
|
-
reason: 'counterfeit' | 'offensive' | 'spam' | 'scam' | 'other';
|
|
1173
|
-
detail?: string;
|
|
1174
|
-
}
|
|
1175
|
-
|
|
1176
1315
|
declare const DISPUTE_REASONS: readonly ["not_received", "not_as_described", "damaged", "counterfeit", "wrong_item"];
|
|
1177
1316
|
type DisputeReason = typeof DISPUTE_REASONS[number];
|
|
1178
1317
|
declare const DESIRED_RESOLUTIONS: readonly ["refund", "replacement", "partial_refund"];
|
|
@@ -1284,6 +1423,13 @@ interface PaginatedResponse<T> {
|
|
|
1284
1423
|
|
|
1285
1424
|
interface RequestOptions {
|
|
1286
1425
|
signal?: AbortSignal;
|
|
1426
|
+
/**
|
|
1427
|
+
* Additional request headers for one-off protocol credentials such as X-Root-Setup-Secret.
|
|
1428
|
+
*
|
|
1429
|
+
* Authorization is always overwritten by the SDK's token handling, so a caller cannot bypass
|
|
1430
|
+
* refresh/session semantics through this escape hatch.
|
|
1431
|
+
*/
|
|
1432
|
+
headers?: Record<string, string>;
|
|
1287
1433
|
}
|
|
1288
1434
|
|
|
1289
1435
|
declare class APIError extends Error {
|
|
@@ -1467,6 +1613,49 @@ declare class AuthModule {
|
|
|
1467
1613
|
temp_token: string;
|
|
1468
1614
|
credential: AuthenticationResponseJSON;
|
|
1469
1615
|
}, options?: RequestOptions): Promise<AuthTokens>;
|
|
1616
|
+
/**
|
|
1617
|
+
* One-time root bootstrap. The setup secret travels in a header and is never part of the JSON
|
|
1618
|
+
* body, where an error logger or request capture is more likely to record it.
|
|
1619
|
+
*/
|
|
1620
|
+
setupRoot(input: RootSetupInput, options?: RequestOptions): Promise<RootSetupResult>;
|
|
1621
|
+
/** Public auth-mode document. Never requires or changes the session. */
|
|
1622
|
+
capabilities(options?: RequestOptions): Promise<AuthCapabilities>;
|
|
1623
|
+
/**
|
|
1624
|
+
* Replace every backup code after re-proving the current password.
|
|
1625
|
+
*
|
|
1626
|
+
* The result is intentionally not persisted by the SDK: codes are shown once, and storing them in
|
|
1627
|
+
* a browser turns a recovery credential into something a stolen session can read.
|
|
1628
|
+
*/
|
|
1629
|
+
regenerateBackupCodes(currentPassword: string, options?: RequestOptions): Promise<RegenerateBackupCodesResult>;
|
|
1630
|
+
requestRecovery(input: RequestRecoveryInput, options?: RequestOptions): Promise<RequestRecoveryResult>;
|
|
1631
|
+
/**
|
|
1632
|
+
* Cancel with the token from the email. Always returns ok, whether it was valid or already used,
|
|
1633
|
+
* so this cannot be used to probe for live recoveries.
|
|
1634
|
+
*/
|
|
1635
|
+
cancelRecovery(token: string, options?: RequestOptions): Promise<{
|
|
1636
|
+
ok: true;
|
|
1637
|
+
}>;
|
|
1638
|
+
recoveryStatus(tempToken: string, options?: RequestOptions): Promise<RecoveryStatusResult>;
|
|
1639
|
+
/**
|
|
1640
|
+
* Complete with a fresh temp token once cooling-off ends. Tokens are persisted; backup codes are
|
|
1641
|
+
* returned to the caller only and never stored.
|
|
1642
|
+
*/
|
|
1643
|
+
completeRecovery(tempToken: string, options?: RequestOptions): Promise<CompleteRecoveryResult>;
|
|
1644
|
+
listRecoveryRequests(status?: AdminRecoveryRequest['status'], options?: RequestOptions): Promise<{
|
|
1645
|
+
requests: AdminRecoveryRequest[];
|
|
1646
|
+
}>;
|
|
1647
|
+
approveRecovery(id: string, reviewNote: string, options?: RequestOptions): Promise<{
|
|
1648
|
+
id: string;
|
|
1649
|
+
status: 'approved';
|
|
1650
|
+
effective_at: string;
|
|
1651
|
+
}>;
|
|
1652
|
+
rejectRecovery(id: string, reviewNote: string, options?: RequestOptions): Promise<{
|
|
1653
|
+
id: string;
|
|
1654
|
+
status: 'rejected';
|
|
1655
|
+
}>;
|
|
1656
|
+
recoveryEvents(id: string, options?: RequestOptions): Promise<{
|
|
1657
|
+
events: AdminRecoveryEvent[];
|
|
1658
|
+
}>;
|
|
1470
1659
|
}
|
|
1471
1660
|
|
|
1472
1661
|
declare class ListingsModule {
|
|
@@ -2098,10 +2287,23 @@ declare class BusinessesModule {
|
|
|
2098
2287
|
declare class AdminModule {
|
|
2099
2288
|
private readonly client;
|
|
2100
2289
|
constructor(client: APIClient);
|
|
2290
|
+
/**
|
|
2291
|
+
* @deprecated Pass a reason as the second argument. Kept source-compatible because the method was
|
|
2292
|
+
* already published, even though the endpoint did not exist at the time.
|
|
2293
|
+
*/
|
|
2101
2294
|
blockIp(ip: string, durationHours?: number, options?: RequestOptions): Promise<{
|
|
2102
2295
|
ok: true;
|
|
2103
2296
|
blocked: string;
|
|
2104
2297
|
hours: number;
|
|
2298
|
+
expires_at: string;
|
|
2299
|
+
note: string;
|
|
2300
|
+
}>;
|
|
2301
|
+
blockIp(ip: string, reason: string, durationHours?: number, options?: RequestOptions): Promise<{
|
|
2302
|
+
ok: true;
|
|
2303
|
+
blocked: string;
|
|
2304
|
+
hours: number;
|
|
2305
|
+
expires_at: string;
|
|
2306
|
+
note: string;
|
|
2105
2307
|
}>;
|
|
2106
2308
|
unblockIp(ip: string, options?: RequestOptions): Promise<{
|
|
2107
2309
|
ok: true;
|
|
@@ -2285,6 +2487,53 @@ declare class AdminModule {
|
|
|
2285
2487
|
ok: true;
|
|
2286
2488
|
removed: false;
|
|
2287
2489
|
}>;
|
|
2490
|
+
listOperators(options?: RequestOptions): Promise<{
|
|
2491
|
+
operators: AdminOperator[];
|
|
2492
|
+
}>;
|
|
2493
|
+
listAdminRoles(options?: RequestOptions): Promise<{
|
|
2494
|
+
roles: AdminRolePreset[];
|
|
2495
|
+
permissions: AdminPermissionDescription[];
|
|
2496
|
+
}>;
|
|
2497
|
+
grantOperatorPermission(userId: string, permission: AdminPermission, options?: RequestOptions): Promise<{
|
|
2498
|
+
ok: true;
|
|
2499
|
+
already_held: boolean;
|
|
2500
|
+
}>;
|
|
2501
|
+
revokeOperatorPermission(userId: string, permission: AdminPermission, options?: RequestOptions): Promise<{
|
|
2502
|
+
ok: true;
|
|
2503
|
+
note: string;
|
|
2504
|
+
}>;
|
|
2505
|
+
grantOperatorRole(userId: string, role: string, options?: RequestOptions): Promise<{
|
|
2506
|
+
ok: true;
|
|
2507
|
+
role: string;
|
|
2508
|
+
granted: AdminPermission[];
|
|
2509
|
+
already_held: AdminPermission[];
|
|
2510
|
+
}>;
|
|
2511
|
+
getAuditLog(limit?: number, options?: RequestOptions): Promise<{
|
|
2512
|
+
entries: AdminAuditEntry[];
|
|
2513
|
+
}>;
|
|
2514
|
+
listPayoutsAwaitingApproval(options?: RequestOptions): Promise<{
|
|
2515
|
+
payouts: PendingPayoutApproval[];
|
|
2516
|
+
}>;
|
|
2517
|
+
approvePayout(payoutId: string, options?: RequestOptions): Promise<{
|
|
2518
|
+
ok: true;
|
|
2519
|
+
already_approved: boolean;
|
|
2520
|
+
}>;
|
|
2521
|
+
holdPayout(payoutId: string, reason: string, options?: RequestOptions): Promise<{
|
|
2522
|
+
ok: true;
|
|
2523
|
+
}>;
|
|
2524
|
+
/** Repair a Daraja payout whose provider reference failed to persist. */
|
|
2525
|
+
repairPayoutCorrelation(payoutId: string, providerRef: string, options?: RequestOptions): Promise<{
|
|
2526
|
+
ok: true;
|
|
2527
|
+
}>;
|
|
2528
|
+
listPendingWholesaleStores(options?: RequestOptions): Promise<{
|
|
2529
|
+
data: AdminWholesalePendingStore[];
|
|
2530
|
+
}>;
|
|
2531
|
+
verifyWholesaleStore(storeId: string, options?: RequestOptions): Promise<{
|
|
2532
|
+
ok: true;
|
|
2533
|
+
}>;
|
|
2534
|
+
unverifyWholesaleStore(storeId: string, options?: RequestOptions): Promise<{
|
|
2535
|
+
ok: true;
|
|
2536
|
+
}>;
|
|
2288
2537
|
broadcast(input: {
|
|
2289
2538
|
title: string;
|
|
2290
2539
|
body: string;
|
|
@@ -2486,4 +2735,4 @@ declare class MitumbaClient {
|
|
|
2486
2735
|
isAuthenticated(): Promise<boolean>;
|
|
2487
2736
|
}
|
|
2488
2737
|
|
|
2489
|
-
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 CheckoutNextAction, type CheckoutOrder, type CheckoutPaymentMethod, 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, 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 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 ProviderId, 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 };
|
|
2738
|
+
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 };
|