@mitumba/sdk 5.17.0 → 5.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +212 -81
- package/dist/index.d.ts +212 -81
- package/dist/index.js +33 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -291,7 +291,13 @@ var APIClient = class {
|
|
|
291
291
|
*/
|
|
292
292
|
async send(method, path, body, params, options) {
|
|
293
293
|
if (!isSessionEndpoint(path)) {
|
|
294
|
-
|
|
294
|
+
try {
|
|
295
|
+
await this.ensureFreshToken(options);
|
|
296
|
+
} catch (error) {
|
|
297
|
+
if (!(error instanceof InvalidRefreshCredentialsError)) throw error;
|
|
298
|
+
this.config.onAuthExpired?.();
|
|
299
|
+
throw new APIError(401, { error: "session_expired", message: "Session expired. Please log in again." });
|
|
300
|
+
}
|
|
295
301
|
}
|
|
296
302
|
const url = new URL(path, this.config.baseUrl);
|
|
297
303
|
if (params) {
|
|
@@ -2392,6 +2398,32 @@ var AdminModule = class {
|
|
|
2392
2398
|
async reinstateReview(reviewId, options) {
|
|
2393
2399
|
return this.client.post(`/admin/reviews/${reviewId}/reinstate`, void 0, options);
|
|
2394
2400
|
}
|
|
2401
|
+
// ── Messaging safety reports ──
|
|
2402
|
+
/**
|
|
2403
|
+
* The messaging safety queue: reported conversations and messages, oldest first, 25 per page.
|
|
2404
|
+
* Each report carries the reported side's recent risk signals and a `priority` derived from them;
|
|
2405
|
+
* priority orders the queue and decides nothing. Requires `admin:read`.
|
|
2406
|
+
*/
|
|
2407
|
+
async listMessageReports(params, options) {
|
|
2408
|
+
return this.client.get("/admin/message-reports", params, options);
|
|
2409
|
+
}
|
|
2410
|
+
/**
|
|
2411
|
+
* Open one report for review: the report, up to 100 messages of its thread as delivered, and the
|
|
2412
|
+
* unmasked original of the reported message when one exists and may be released. Requires
|
|
2413
|
+
* `audit:read` and a recent passkey sign-in (403 `reauthentication_required` otherwise). Opening a
|
|
2414
|
+
* report is recorded on the audit trail.
|
|
2415
|
+
*/
|
|
2416
|
+
async getMessageReport(reportId, options) {
|
|
2417
|
+
return this.client.get(`/admin/message-reports/${encodeURIComponent(reportId)}`, void 0, options);
|
|
2418
|
+
}
|
|
2419
|
+
/**
|
|
2420
|
+
* Resolve an open report. `upheld` records a risk signal against the reported side. Requires
|
|
2421
|
+
* `listings:moderate`. Resolving with the same status and outcome again is a safe retry
|
|
2422
|
+
* (`deduplicated: true`); a different resolution of an already resolved report is 409.
|
|
2423
|
+
*/
|
|
2424
|
+
async resolveMessageReport(reportId, input, options) {
|
|
2425
|
+
return this.client.post(`/admin/message-reports/${encodeURIComponent(reportId)}/resolve`, input, options);
|
|
2426
|
+
}
|
|
2395
2427
|
// ── VAZI Moderation ──
|
|
2396
2428
|
async listVaziOutfits(params, options) {
|
|
2397
2429
|
return this.client.get("/admin/vazi/outfits", params, options);
|