@mitumba/sdk 1.14.0 → 1.16.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.mjs CHANGED
@@ -1073,38 +1073,133 @@ var AdminModule = class {
1073
1073
  this.client = client;
1074
1074
  }
1075
1075
  client;
1076
- /** Block an IP address. Default duration: 24 hours. */
1076
+ // ── IP Blocking ──
1077
1077
  async blockIp(ip, durationHours, options) {
1078
1078
  return this.client.post("/admin/block-ip", { ip, duration_hours: durationHours ?? 24 }, options);
1079
1079
  }
1080
- /** Unblock an IP address. */
1081
1080
  async unblockIp(ip, options) {
1082
1081
  return this.client.post("/admin/unblock-ip", { ip }, options);
1083
1082
  }
1084
- /** List currently blocked IPs. */
1085
1083
  async getBlockedIps(options) {
1086
1084
  return this.client.get("/admin/blocked-ips", void 0, options);
1087
1085
  }
1088
- /** Get platform-wide statistics. */
1086
+ // ── Stats ──
1089
1087
  async getSystemStats(options) {
1090
1088
  return this.client.get("/admin/stats", void 0, options);
1091
1089
  }
1092
- /** Suspend a user account. */
1090
+ async getStatsTimeseries(params, options) {
1091
+ return this.client.get("/admin/stats/timeseries", params, options);
1092
+ }
1093
+ async getStatsByCity(options) {
1094
+ return this.client.get("/admin/stats/by-city", void 0, options);
1095
+ }
1096
+ // ── Users ──
1097
+ async listUsers(params, options) {
1098
+ return this.client.get("/admin/users", params, options);
1099
+ }
1100
+ async getUser(userId, options) {
1101
+ return this.client.get(`/admin/users/${userId}`, void 0, options);
1102
+ }
1093
1103
  async suspendUser(userId, reason, options) {
1094
1104
  return this.client.post(`/admin/users/${userId}/suspend`, { reason }, options);
1095
1105
  }
1096
- /** Unsuspend a user account. */
1097
1106
  async unsuspendUser(userId, options) {
1098
1107
  return this.client.post(`/admin/users/${userId}/unsuspend`, void 0, options);
1099
1108
  }
1100
- /** Grant verified badge to a store. */
1109
+ async setUserRole(userId, role, action, options) {
1110
+ return this.client.post(`/admin/users/${userId}/roles`, { role, action }, options);
1111
+ }
1112
+ async revokeUserSessions(userId, options) {
1113
+ return this.client.post(`/admin/users/${userId}/revoke-sessions`, void 0, options);
1114
+ }
1115
+ // ── Stores ──
1116
+ async listStores(params, options) {
1117
+ return this.client.get("/admin/stores", params, options);
1118
+ }
1119
+ async getStore(storeId, options) {
1120
+ return this.client.get(`/admin/stores/${storeId}`, void 0, options);
1121
+ }
1101
1122
  async verifyStore(storeId, options) {
1102
1123
  return this.client.post(`/admin/stores/${storeId}/verify`, void 0, options);
1103
1124
  }
1104
- /** Revoke verified badge from a store. */
1105
1125
  async unverifyStore(storeId, options) {
1106
1126
  return this.client.post(`/admin/stores/${storeId}/unverify`, void 0, options);
1107
1127
  }
1128
+ // ── Verification Queue ──
1129
+ async listVerifications(params, options) {
1130
+ return this.client.get("/admin/verifications", params, options);
1131
+ }
1132
+ async approveVerification(userId, options) {
1133
+ return this.client.post(`/admin/verifications/${userId}/approve`, void 0, options);
1134
+ }
1135
+ async rejectVerification(userId, reason, options) {
1136
+ return this.client.post(`/admin/verifications/${userId}/reject`, reason ? { reason } : void 0, options);
1137
+ }
1138
+ // ── STI ──
1139
+ async adjustSti(userId, input, options) {
1140
+ return this.client.post(`/admin/sellers/${userId}/sti`, input, options);
1141
+ }
1142
+ async getStiEvents(userId, params, options) {
1143
+ return this.client.get(`/admin/sellers/${userId}/sti-events`, params, options);
1144
+ }
1145
+ // ── Listings Moderation ──
1146
+ async listListings(params, options) {
1147
+ return this.client.get("/admin/listings", params, options);
1148
+ }
1149
+ async removeListing(listingId, reason, options) {
1150
+ return this.client.post(`/admin/listings/${listingId}/remove`, reason ? { reason } : void 0, options);
1151
+ }
1152
+ async reinstateListing(listingId, options) {
1153
+ return this.client.post(`/admin/listings/${listingId}/reinstate`, void 0, options);
1154
+ }
1155
+ // ── Orders ──
1156
+ async listOrders(params, options) {
1157
+ return this.client.get("/admin/orders", params, options);
1158
+ }
1159
+ async getOrder(orderId, options) {
1160
+ return this.client.get(`/admin/orders/${orderId}`, void 0, options);
1161
+ }
1162
+ async forceTransitionOrder(orderId, status, note, options) {
1163
+ return this.client.post(`/admin/orders/${orderId}/transition`, { status, note }, options);
1164
+ }
1165
+ // ── Payouts ──
1166
+ async getPayoutSummary(options) {
1167
+ return this.client.get("/admin/payouts/summary", void 0, options);
1168
+ }
1169
+ async listPayouts(params, options) {
1170
+ return this.client.get("/admin/payouts", params, options);
1171
+ }
1172
+ async disbursePayout(payoutId, options) {
1173
+ return this.client.post(`/admin/payouts/${payoutId}/disburse`, void 0, options);
1174
+ }
1175
+ // ── Reports Moderation ──
1176
+ async listReports(params, options) {
1177
+ return this.client.get("/admin/reports", params, options);
1178
+ }
1179
+ async resolveReport(reportId, status, note, options) {
1180
+ return this.client.post(`/admin/reports/${reportId}/resolve`, { status, note }, options);
1181
+ }
1182
+ // ── Review Moderation ──
1183
+ async removeReview(reviewId, reason, options) {
1184
+ return this.client.post(`/admin/reviews/${reviewId}/remove`, reason ? { reason } : void 0, options);
1185
+ }
1186
+ async reinstateReview(reviewId, options) {
1187
+ return this.client.post(`/admin/reviews/${reviewId}/reinstate`, void 0, options);
1188
+ }
1189
+ // ── VAZI Moderation ──
1190
+ async listVaziOutfits(params, options) {
1191
+ return this.client.get("/admin/vazi/outfits", params, options);
1192
+ }
1193
+ async removeVaziOutfit(outfitId, reason, options) {
1194
+ return this.client.post(`/admin/vazi/outfits/${outfitId}/remove`, reason ? { reason } : void 0, options);
1195
+ }
1196
+ async reinstateVaziOutfit(outfitId, options) {
1197
+ return this.client.post(`/admin/vazi/outfits/${outfitId}/reinstate`, void 0, options);
1198
+ }
1199
+ // ── Broadcast ──
1200
+ async broadcast(input, options) {
1201
+ return this.client.post("/admin/broadcast", input, options);
1202
+ }
1108
1203
  };
1109
1204
 
1110
1205
  // src/modules/disputes.ts
@@ -1155,6 +1250,32 @@ var DisputesModule = class {
1155
1250
  }
1156
1251
  };
1157
1252
 
1253
+ // src/modules/uploads.ts
1254
+ var UploadsModule = class {
1255
+ constructor(client) {
1256
+ this.client = client;
1257
+ }
1258
+ client;
1259
+ /** Upload a file (avatar, evidence, etc). Returns the public CDN URL. */
1260
+ async upload(file, options) {
1261
+ const formData = new FormData();
1262
+ formData.append("file", file);
1263
+ return this.client.post("/listings/uploads", formData, options);
1264
+ }
1265
+ };
1266
+
1267
+ // src/modules/reports.ts
1268
+ var ReportsModule = class {
1269
+ constructor(client) {
1270
+ this.client = client;
1271
+ }
1272
+ client;
1273
+ /** Report a listing, review, store, or user for admin review. */
1274
+ async create(input, options) {
1275
+ return this.client.post("/listings/reports", input, options);
1276
+ }
1277
+ };
1278
+
1158
1279
  // src/types/listings.ts
1159
1280
  var CONDITIONS = ["new", "like_new", "good", "fair"];
1160
1281
  var LISTING_STATUSES = ["draft", "active", "sold", "removed"];
@@ -1200,6 +1321,8 @@ var MitumbaClient = class {
1200
1321
  businesses;
1201
1322
  admin;
1202
1323
  disputes;
1324
+ uploads;
1325
+ reports;
1203
1326
  constructor(config) {
1204
1327
  this.api = new APIClient(config);
1205
1328
  this.auth = new AuthModule(this.api);
@@ -1219,6 +1342,8 @@ var MitumbaClient = class {
1219
1342
  this.businesses = new BusinessesModule(this.api);
1220
1343
  this.admin = new AdminModule(this.api);
1221
1344
  this.disputes = new DisputesModule(this.api);
1345
+ this.uploads = new UploadsModule(this.api);
1346
+ this.reports = new ReportsModule(this.api);
1222
1347
  }
1223
1348
  /**
1224
1349
  * Set the access token for authenticated requests.
@@ -1253,6 +1378,6 @@ var MitumbaClient = class {
1253
1378
  }
1254
1379
  };
1255
1380
 
1256
- export { APIClient, APIError, AdminModule, AuthModule, BusinessesModule, CONDITIONS, CartModule, DESIRED_RESOLUTIONS, DISPUTE_REASONS, DISPUTE_STATUSES, DisputesModule, IDBTokenStore, LISTING_STATUSES, ListingsModule, MailerModule, MemoryTokenStore, MessagesModule, MitumbaClient, NotificationsModule, ORDER_STATUSES, OrdersModule, PAYMENT_STATUSES, PayModule, ReviewsModule, SearchModule, SettingsModule, StoresModule, VaziModule, WishlistsModule, createTokenStore };
1381
+ export { APIClient, APIError, AdminModule, AuthModule, BusinessesModule, CONDITIONS, CartModule, DESIRED_RESOLUTIONS, DISPUTE_REASONS, DISPUTE_STATUSES, DisputesModule, IDBTokenStore, LISTING_STATUSES, ListingsModule, MailerModule, MemoryTokenStore, MessagesModule, MitumbaClient, NotificationsModule, ORDER_STATUSES, OrdersModule, PAYMENT_STATUSES, PayModule, ReportsModule, ReviewsModule, SearchModule, SettingsModule, StoresModule, UploadsModule, VaziModule, WishlistsModule, createTokenStore };
1257
1382
  //# sourceMappingURL=index.mjs.map
1258
1383
  //# sourceMappingURL=index.mjs.map