@withpica/mcp-sdk 3.18.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 +32 -0
- package/dist/index.d.ts +191 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +83 -5
- 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
|
}
|
|
@@ -1899,11 +1947,11 @@ class SettingsResource extends BaseResource {
|
|
|
1899
1947
|
* the auth context — `user_id` is never accepted (ADR-184 rule 2).
|
|
1900
1948
|
*
|
|
1901
1949
|
* The route lazy-creates the backing `people` row if the user's
|
|
1902
|
-
* `user_profiles.person_id` is null
|
|
1903
|
-
*
|
|
1904
|
-
*
|
|
1905
|
-
* count of
|
|
1906
|
-
*
|
|
1950
|
+
* `user_profiles.person_id` is null. Identifiers are saved on that record
|
|
1951
|
+
* only; this call triggers no cross-org linking (a typed IPI is not
|
|
1952
|
+
* evidence).
|
|
1953
|
+
* Response includes the count of discoveries written in each of the 3
|
|
1954
|
+
* typed tables in the last 10 seconds.
|
|
1907
1955
|
* ADR-189 Phase 3.
|
|
1908
1956
|
*/
|
|
1909
1957
|
async updateMyIdentity(params) {
|
|
@@ -2523,6 +2571,16 @@ class ExportResource extends BaseResource {
|
|
|
2523
2571
|
async catalogAssetReport(params) {
|
|
2524
2572
|
return this.request("POST", "/admin/exports/catalog-asset-report", params);
|
|
2525
2573
|
}
|
|
2574
|
+
/**
|
|
2575
|
+
* One ZIP holding the song dossier (PDF + JSON) of each work named — the
|
|
2576
|
+
* work, its recordings, the releases they appear on, people, provenance and
|
|
2577
|
+
* consent — plus a manifest and README. Returns a signed-URL JSON envelope
|
|
2578
|
+
* with a per-work `works[]` account of what was included. 1–60 work ids;
|
|
2579
|
+
* a malformed id or a longer list is refused with a 400.
|
|
2580
|
+
*/
|
|
2581
|
+
async songDossiers(params) {
|
|
2582
|
+
return this.request("POST", "/admin/exports/song-dossiers", params);
|
|
2583
|
+
}
|
|
2526
2584
|
async aiConsent(params) {
|
|
2527
2585
|
// Returns a signed-URL JSON envelope. The inline `?format=json`
|
|
2528
2586
|
// path stays the default for the SDK; the route also returns the
|
|
@@ -3620,6 +3678,26 @@ class RoyaltiesResource extends BaseResource {
|
|
|
3620
3678
|
const qs = qp.toString();
|
|
3621
3679
|
return this.request("GET", `/admin/royalties/gaps${qs ? `?${qs}` : ""}`);
|
|
3622
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
|
+
}
|
|
3623
3701
|
async stats() {
|
|
3624
3702
|
return this.request("GET", "/admin/royalties/stats");
|
|
3625
3703
|
}
|