@withpica/mcp-sdk 3.20.0 → 3.21.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 +9 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +39 -0
- 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,
|
|
@@ -1642,6 +1649,11 @@ class EnrichmentResource extends BaseResource {
|
|
|
1642
1649
|
* `artist_title_to_youtube` recording-create), a uniqueness check
|
|
1643
1650
|
* runs instead; conflicts return `{ status: 'create_conflict' }` and
|
|
1644
1651
|
* cannot be forced.
|
|
1652
|
+
*
|
|
1653
|
+
* File-type questions (`entity_type: 'audio_file'`) take the owner's own
|
|
1654
|
+
* answer: `file_type` (master / version / instrumental / demo / stem) and,
|
|
1655
|
+
* for a stem, an optional `stem_label`. A refused answer is a 400 with
|
|
1656
|
+
* `code: 'INVALID_FILE_TYPE_ANSWER'`.
|
|
1645
1657
|
*/
|
|
1646
1658
|
async applyEnrichmentProposal(proposalId, options) {
|
|
1647
1659
|
return this.request("POST", `/admin/enrichment-proposals/${proposalId}/apply`, options ?? {});
|
|
@@ -3632,6 +3644,30 @@ class WorkForHireResource extends BaseResource {
|
|
|
3632
3644
|
await this.request("DELETE", `/admin/work-for-hire/${id}`);
|
|
3633
3645
|
}
|
|
3634
3646
|
}
|
|
3647
|
+
/**
|
|
3648
|
+
* ADR-321 Phase 2 — programmable rights. `propose` only proposes: the route
|
|
3649
|
+
* never activates a rule on an API key, and each party confirms by email.
|
|
3650
|
+
*/
|
|
3651
|
+
class RightsResource extends BaseResource {
|
|
3652
|
+
/**
|
|
3653
|
+
* POST /admin/works/{id}/rights/propose. Body is one of
|
|
3654
|
+
* `{ rule: "song" }`, `{ rule: "master", recording_id }` or
|
|
3655
|
+
* `{ rule: "share", side?, recording_id?, subject_person_id, kind,
|
|
3656
|
+
* parties: [{ person_id, share_bp }], effective_from, effective_to? }`.
|
|
3657
|
+
* A refusal is a 422 carrying `details.reasons`.
|
|
3658
|
+
*/
|
|
3659
|
+
async propose(workId, body) {
|
|
3660
|
+
return this.request("POST", `/admin/works/${encodeURIComponent(workId)}/rights/propose`, body);
|
|
3661
|
+
}
|
|
3662
|
+
/** GET /admin/rights/rules/{id} — one rule's status and confirmations. */
|
|
3663
|
+
async status(ruleId) {
|
|
3664
|
+
return this.request("GET", `/admin/rights/rules/${encodeURIComponent(ruleId)}`);
|
|
3665
|
+
}
|
|
3666
|
+
/** GET /admin/works/{id}/rights — every rule on a song, history, holds. */
|
|
3667
|
+
async inspect(workId) {
|
|
3668
|
+
return this.request("GET", `/admin/works/${encodeURIComponent(workId)}/rights`);
|
|
3669
|
+
}
|
|
3670
|
+
}
|
|
3635
3671
|
class RoyaltiesResource extends BaseResource {
|
|
3636
3672
|
async payments(params) {
|
|
3637
3673
|
const qp = new URLSearchParams();
|
|
@@ -4125,6 +4161,8 @@ export class PicaClient {
|
|
|
4125
4161
|
producerAgreements;
|
|
4126
4162
|
workForHire;
|
|
4127
4163
|
royalties;
|
|
4164
|
+
/** ADR-321 Phase 2 — programmable rights (propose / status / inspect). */
|
|
4165
|
+
rights;
|
|
4128
4166
|
statements;
|
|
4129
4167
|
/** ADR-319 — saved catalog selections. */
|
|
4130
4168
|
selections;
|
|
@@ -4241,6 +4279,7 @@ export class PicaClient {
|
|
|
4241
4279
|
this.producerAgreements = new ProducerAgreementsResource(baseUrl, config.apiKey, debug);
|
|
4242
4280
|
this.workForHire = new WorkForHireResource(baseUrl, config.apiKey, debug);
|
|
4243
4281
|
this.royalties = new RoyaltiesResource(baseUrl, config.apiKey, debug);
|
|
4282
|
+
this.rights = new RightsResource(baseUrl, config.apiKey, debug);
|
|
4244
4283
|
this.statements = new StatementsResource(baseUrl, config.apiKey, debug);
|
|
4245
4284
|
this.selections = new SelectionsResource(baseUrl, config.apiKey, debug);
|
|
4246
4285
|
this.shareLinks = new ShareLinksResource(baseUrl, config.apiKey, debug);
|