@withpica/mcp-sdk 3.19.0 → 3.20.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/CHANGELOG.md +23 -0
- package/dist/index.d.ts +176 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +68 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -882,6 +882,8 @@ class AudioFilesResource extends BaseResource {
|
|
|
882
882
|
const queryParams = new URLSearchParams();
|
|
883
883
|
if (params?.work_id)
|
|
884
884
|
queryParams.set("work_id", params.work_id);
|
|
885
|
+
if (params?.work_ids && params.work_ids.length > 0)
|
|
886
|
+
queryParams.set("work_ids", params.work_ids.join(","));
|
|
885
887
|
if (params?.file_type)
|
|
886
888
|
queryParams.set("file_type", params.file_type);
|
|
887
889
|
if (params?.unprocessed)
|
|
@@ -942,6 +944,15 @@ class AudioFilesResource extends BaseResource {
|
|
|
942
944
|
async update(id, body) {
|
|
943
945
|
return this.request("PATCH", `/admin/audio-files/${id}`, body);
|
|
944
946
|
}
|
|
947
|
+
/**
|
|
948
|
+
* Per-file metadata patches for up to 200 files in one request (ops issue
|
|
949
|
+
* 5c53049a). Returns one lean result per item — `updated`, `would_update`
|
|
950
|
+
* (dry run) or `failed` with a reason — never the rows. Wraps
|
|
951
|
+
* POST /admin/audio-files/bulk-update.
|
|
952
|
+
*/
|
|
953
|
+
async bulkUpdate(items, params) {
|
|
954
|
+
return this.request("POST", "/admin/audio-files/bulk-update", { items, ...(params?.dry_run ? { dry_run: true } : {}) });
|
|
955
|
+
}
|
|
945
956
|
async analyze(id, options) {
|
|
946
957
|
return this.request("POST", `/admin/audio-files/${id}/analyze`, options);
|
|
947
958
|
}
|
|
@@ -1743,6 +1754,43 @@ class HealthResource extends BaseResource {
|
|
|
1743
1754
|
async getLowScoreWorks() {
|
|
1744
1755
|
return this.request("GET", "/admin/quality/completeness/low-score");
|
|
1745
1756
|
}
|
|
1757
|
+
/**
|
|
1758
|
+
* One page of works below a completeness threshold, with the route's
|
|
1759
|
+
* `meta` (true `total` below the threshold, `has_more`). Backs
|
|
1760
|
+
* `pica_works_query {health_filter: "low_completeness"}` — the bare
|
|
1761
|
+
* `getLowScoreWorks()` above sends no limit/offset, so the tool used to
|
|
1762
|
+
* ignore both (ops issue 314325eb).
|
|
1763
|
+
*/
|
|
1764
|
+
async getLowScoreWorksPage(params) {
|
|
1765
|
+
const qp = new URLSearchParams();
|
|
1766
|
+
if (params.limit !== undefined)
|
|
1767
|
+
qp.set("limit", String(params.limit));
|
|
1768
|
+
if (params.offset !== undefined)
|
|
1769
|
+
qp.set("offset", String(params.offset));
|
|
1770
|
+
if (params.threshold !== undefined)
|
|
1771
|
+
qp.set("threshold", String(params.threshold));
|
|
1772
|
+
const qs = qp.toString();
|
|
1773
|
+
const env = await this.requestWithEnvelope("GET", `/admin/quality/completeness/low-score${qs ? `?${qs}` : ""}`);
|
|
1774
|
+
return { data: Array.isArray(env.data) ? env.data : [], meta: env.meta };
|
|
1775
|
+
}
|
|
1776
|
+
/**
|
|
1777
|
+
* One page of the cross-org reconciliation scan, with the route's `meta`
|
|
1778
|
+
* (`scanned`, `candidates_total`, `next_offset`). `offset`/`limit` page the
|
|
1779
|
+
* candidate works, not the returned rows — see the route. Backs
|
|
1780
|
+
* `pica_works_query {health_filter: "needs_attention"}`.
|
|
1781
|
+
*/
|
|
1782
|
+
async getWorksHealthPage(params) {
|
|
1783
|
+
const qp = new URLSearchParams();
|
|
1784
|
+
if (params.limit !== undefined)
|
|
1785
|
+
qp.set("limit", String(params.limit));
|
|
1786
|
+
if (params.offset !== undefined)
|
|
1787
|
+
qp.set("offset", String(params.offset));
|
|
1788
|
+
if (params.unreconciledOnly)
|
|
1789
|
+
qp.set("unreconciledOnly", "true");
|
|
1790
|
+
const qs = qp.toString();
|
|
1791
|
+
const env = await this.requestWithEnvelope("GET", `/admin/quality/works-health${qs ? `?${qs}` : ""}`);
|
|
1792
|
+
return { data: Array.isArray(env.data) ? env.data : [], meta: env.meta };
|
|
1793
|
+
}
|
|
1746
1794
|
async getWorkCompleteness(workId) {
|
|
1747
1795
|
return this.request("GET", `/admin/quality/completeness/${workId}`);
|
|
1748
1796
|
}
|
|
@@ -3630,6 +3678,26 @@ class RoyaltiesResource extends BaseResource {
|
|
|
3630
3678
|
const qs = qp.toString();
|
|
3631
3679
|
return this.request("GET", `/admin/royalties/gaps${qs ? `?${qs}` : ""}`);
|
|
3632
3680
|
}
|
|
3681
|
+
/**
|
|
3682
|
+
* ADR-321 Phase 0 — what in one song's record is likely holding up its
|
|
3683
|
+
* society income. `state` is "clear" only when every area was checked;
|
|
3684
|
+
* `unchecked` lists areas that could not be.
|
|
3685
|
+
*/
|
|
3686
|
+
async blockers(workId) {
|
|
3687
|
+
return this.request("GET", `/admin/works/${encodeURIComponent(workId)}/money-blockers`);
|
|
3688
|
+
}
|
|
3689
|
+
/** ADR-321 Phase 0 — the catalogue roll-up: summary + songs not clear, paged. */
|
|
3690
|
+
async blockersCatalogue(params) {
|
|
3691
|
+
const qp = new URLSearchParams();
|
|
3692
|
+
if (params?.code)
|
|
3693
|
+
qp.set("code", params.code);
|
|
3694
|
+
if (params?.limit !== undefined)
|
|
3695
|
+
qp.set("limit", String(params.limit));
|
|
3696
|
+
if (params?.offset !== undefined)
|
|
3697
|
+
qp.set("offset", String(params.offset));
|
|
3698
|
+
const qs = qp.toString();
|
|
3699
|
+
return this.request("GET", `/admin/money-blockers${qs ? `?${qs}` : ""}`);
|
|
3700
|
+
}
|
|
3633
3701
|
async stats() {
|
|
3634
3702
|
return this.request("GET", "/admin/royalties/stats");
|
|
3635
3703
|
}
|