@withpica/mcp-sdk 3.20.0 → 3.22.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 +33 -0
- package/dist/index.d.ts +90 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +83 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -420,6 +420,13 @@ class WorksResource extends BaseResource {
|
|
|
420
420
|
async delete(id) {
|
|
421
421
|
return this.request("DELETE", `/admin/works/${id}`);
|
|
422
422
|
}
|
|
423
|
+
/**
|
|
424
|
+
* @deprecated `works` has no `is_verified` column, so PATCH /admin/works/[id]
|
|
425
|
+
* refuses this body (VALIDATION_ERROR "unknown field 'is_verified'") on every
|
|
426
|
+
* call. PICA keeps no work-level verified flag; the MCP tool
|
|
427
|
+
* `pica_works_verify` no longer calls this. Kept only so the published SDK's
|
|
428
|
+
* surface does not break; remove at the next major.
|
|
429
|
+
*/
|
|
423
430
|
async verify(id) {
|
|
424
431
|
return this.request("PATCH", `/admin/works/${id}`, {
|
|
425
432
|
is_verified: true,
|
|
@@ -872,9 +879,15 @@ class IntegrityResource extends BaseResource {
|
|
|
872
879
|
async waive(input) {
|
|
873
880
|
return this.request("POST", "/admin/integrity/waivers", input);
|
|
874
881
|
}
|
|
875
|
-
/**
|
|
882
|
+
/**
|
|
883
|
+
* PATCH /admin/integrity/waivers { waiver_id, revoke: true }. No un-revoke
|
|
884
|
+
* path. A platform waiver answers with the work's re-scored `completeness`.
|
|
885
|
+
*/
|
|
876
886
|
async revokeWaiver(waiverId) {
|
|
877
|
-
|
|
887
|
+
return this.request("PATCH", "/admin/integrity/waivers", {
|
|
888
|
+
waiver_id: waiverId,
|
|
889
|
+
revoke: true,
|
|
890
|
+
});
|
|
878
891
|
}
|
|
879
892
|
}
|
|
880
893
|
class AudioFilesResource extends BaseResource {
|
|
@@ -1642,6 +1655,11 @@ class EnrichmentResource extends BaseResource {
|
|
|
1642
1655
|
* `artist_title_to_youtube` recording-create), a uniqueness check
|
|
1643
1656
|
* runs instead; conflicts return `{ status: 'create_conflict' }` and
|
|
1644
1657
|
* cannot be forced.
|
|
1658
|
+
*
|
|
1659
|
+
* File-type questions (`entity_type: 'audio_file'`) take the owner's own
|
|
1660
|
+
* answer: `file_type` (master / version / instrumental / demo / stem) and,
|
|
1661
|
+
* for a stem, an optional `stem_label`. A refused answer is a 400 with
|
|
1662
|
+
* `code: 'INVALID_FILE_TYPE_ANSWER'`.
|
|
1645
1663
|
*/
|
|
1646
1664
|
async applyEnrichmentProposal(proposalId, options) {
|
|
1647
1665
|
return this.request("POST", `/admin/enrichment-proposals/${proposalId}/apply`, options ?? {});
|
|
@@ -3632,6 +3650,66 @@ class WorkForHireResource extends BaseResource {
|
|
|
3632
3650
|
await this.request("DELETE", `/admin/work-for-hire/${id}`);
|
|
3633
3651
|
}
|
|
3634
3652
|
}
|
|
3653
|
+
/**
|
|
3654
|
+
* ADR-321 Phase 2 — programmable rights. `propose` only proposes: the route
|
|
3655
|
+
* never activates a rule on an API key, and each party confirms by email.
|
|
3656
|
+
*/
|
|
3657
|
+
class RightsResource extends BaseResource {
|
|
3658
|
+
/**
|
|
3659
|
+
* POST /admin/works/{id}/rights/propose. Body is one of
|
|
3660
|
+
* `{ rule: "song" }`, `{ rule: "master", recording_id }` or
|
|
3661
|
+
* `{ rule: "share", side?, recording_id?, subject_person_id, kind,
|
|
3662
|
+
* parties: [{ person_id, share_bp }], effective_from, effective_to? }`.
|
|
3663
|
+
* A refusal is a 422 carrying `details.reasons`.
|
|
3664
|
+
*/
|
|
3665
|
+
async propose(workId, body) {
|
|
3666
|
+
return this.request("POST", `/admin/works/${encodeURIComponent(workId)}/rights/propose`, body);
|
|
3667
|
+
}
|
|
3668
|
+
/** GET /admin/rights/rules/{id} — one rule's status and confirmations. */
|
|
3669
|
+
async status(ruleId) {
|
|
3670
|
+
return this.request("GET", `/admin/rights/rules/${encodeURIComponent(ruleId)}`);
|
|
3671
|
+
}
|
|
3672
|
+
/** GET /admin/works/{id}/rights — every rule on a song, history, holds. */
|
|
3673
|
+
async inspect(workId) {
|
|
3674
|
+
return this.request("GET", `/admin/works/${encodeURIComponent(workId)}/rights`);
|
|
3675
|
+
}
|
|
3676
|
+
/**
|
|
3677
|
+
* ADR-321 Phase 3 — GET /admin/rights-income. Statements: direct income
|
|
3678
|
+
* and what it WOULD pay (no money moves). Needs finance access.
|
|
3679
|
+
*/
|
|
3680
|
+
async statements(params) {
|
|
3681
|
+
const qp = new URLSearchParams();
|
|
3682
|
+
if (params?.workId)
|
|
3683
|
+
qp.set("work_id", params.workId);
|
|
3684
|
+
if (params?.limit)
|
|
3685
|
+
qp.set("limit", String(params.limit));
|
|
3686
|
+
if (params?.before)
|
|
3687
|
+
qp.set("before", params.before);
|
|
3688
|
+
const qs = qp.toString();
|
|
3689
|
+
return this.request("GET", `/admin/rights-income${qs ? `?${qs}` : ""}`);
|
|
3690
|
+
}
|
|
3691
|
+
/** GET /admin/rights-income/{id} — one income event, recomputed now. */
|
|
3692
|
+
async statement(incomeId) {
|
|
3693
|
+
return this.request("GET", `/admin/rights-income/${encodeURIComponent(incomeId)}`);
|
|
3694
|
+
}
|
|
3695
|
+
/**
|
|
3696
|
+
* POST /admin/rights-income — record direct income. Body is
|
|
3697
|
+
* `{ work_id, side, recording_id?, income_type, fee_kind, currency,
|
|
3698
|
+
* amount: "1250.00", earned_on, description? }` or
|
|
3699
|
+
* `{ enquiry_id, side, recording_id?, earned_on }`.
|
|
3700
|
+
*/
|
|
3701
|
+
async recordIncome(body) {
|
|
3702
|
+
return this.request("POST", "/admin/rights-income", body);
|
|
3703
|
+
}
|
|
3704
|
+
/** GET /admin/rights-statements/society?work_id= — society statements checked against the split. */
|
|
3705
|
+
async societyChecks(workId) {
|
|
3706
|
+
return this.request("GET", `/admin/rights-statements/society?work_id=${encodeURIComponent(workId)}`);
|
|
3707
|
+
}
|
|
3708
|
+
/** GET /admin/rights-statements/measures — the four measures (ADR-321 §7a). */
|
|
3709
|
+
async measures() {
|
|
3710
|
+
return this.request("GET", "/admin/rights-statements/measures");
|
|
3711
|
+
}
|
|
3712
|
+
}
|
|
3635
3713
|
class RoyaltiesResource extends BaseResource {
|
|
3636
3714
|
async payments(params) {
|
|
3637
3715
|
const qp = new URLSearchParams();
|
|
@@ -4125,6 +4203,8 @@ export class PicaClient {
|
|
|
4125
4203
|
producerAgreements;
|
|
4126
4204
|
workForHire;
|
|
4127
4205
|
royalties;
|
|
4206
|
+
/** ADR-321 Phase 2 — programmable rights (propose / status / inspect). */
|
|
4207
|
+
rights;
|
|
4128
4208
|
statements;
|
|
4129
4209
|
/** ADR-319 — saved catalog selections. */
|
|
4130
4210
|
selections;
|
|
@@ -4241,6 +4321,7 @@ export class PicaClient {
|
|
|
4241
4321
|
this.producerAgreements = new ProducerAgreementsResource(baseUrl, config.apiKey, debug);
|
|
4242
4322
|
this.workForHire = new WorkForHireResource(baseUrl, config.apiKey, debug);
|
|
4243
4323
|
this.royalties = new RoyaltiesResource(baseUrl, config.apiKey, debug);
|
|
4324
|
+
this.rights = new RightsResource(baseUrl, config.apiKey, debug);
|
|
4244
4325
|
this.statements = new StatementsResource(baseUrl, config.apiKey, debug);
|
|
4245
4326
|
this.selections = new SelectionsResource(baseUrl, config.apiKey, debug);
|
|
4246
4327
|
this.shareLinks = new ShareLinksResource(baseUrl, config.apiKey, debug);
|