@withpica/mcp-sdk 3.22.0 → 3.23.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 +40 -0
- package/dist/index.d.ts +201 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +112 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -559,6 +559,25 @@ class PeopleResource extends BaseResource {
|
|
|
559
559
|
async bulkDelete(ids) {
|
|
560
560
|
return this.request("POST", "/admin/people/bulk-delete", { ids });
|
|
561
561
|
}
|
|
562
|
+
/**
|
|
563
|
+
* GET /admin/people/{id}/split-identity — what giving this person a new
|
|
564
|
+
* global identity would touch: who shares their current one, unattributed
|
|
565
|
+
* split rows naming it, open custody legs naming it, and which of their
|
|
566
|
+
* own identifiers equal it. Read-only.
|
|
567
|
+
*/
|
|
568
|
+
async splitIdentityPreview(id) {
|
|
569
|
+
return this.request("GET", `/admin/people/${encodeURIComponent(id)}/split-identity`);
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* POST /admin/people/{id}/split-identity — give this person a NEW global
|
|
573
|
+
* identity. Body: `{ move_identifiers?, relink_split_ids?,
|
|
574
|
+
* clear_person_identifiers?, undo_external_ids? }`; every list defaults to
|
|
575
|
+
* empty (nothing moves, nothing is relinked). A refusal is a 4xx carrying
|
|
576
|
+
* a `SPLIT_*` code.
|
|
577
|
+
*/
|
|
578
|
+
async splitIdentity(id, body) {
|
|
579
|
+
return this.request("POST", `/admin/people/${encodeURIComponent(id)}/split-identity`, body);
|
|
580
|
+
}
|
|
562
581
|
/**
|
|
563
582
|
* List a person's artist projects — per-stage-name Spotify/YouTube
|
|
564
583
|
* identity + enrichment status (ADR-289 Wave B2 item 4, ports the
|
|
@@ -830,6 +849,7 @@ class CreditsResource extends BaseResource {
|
|
|
830
849
|
work_id: env.work_id ?? workId,
|
|
831
850
|
credit: env.data,
|
|
832
851
|
allocation: env.allocation,
|
|
852
|
+
...(env.person_change && { person_change: env.person_change }),
|
|
833
853
|
};
|
|
834
854
|
}
|
|
835
855
|
/**
|
|
@@ -1208,8 +1228,13 @@ class SyncPlacementsResource extends BaseResource {
|
|
|
1208
1228
|
: "";
|
|
1209
1229
|
await this.request("DELETE", `/admin/sync-placements/${id}${query}`);
|
|
1210
1230
|
}
|
|
1231
|
+
/**
|
|
1232
|
+
* Attach a citation source (POST /api/admin/sync-placements/[id]/cite).
|
|
1233
|
+
* This used to post to `/sources`, which has never existed, so every
|
|
1234
|
+
* pica_sync_placements_cite call answered 404.
|
|
1235
|
+
*/
|
|
1211
1236
|
async addSource(id, source) {
|
|
1212
|
-
return this.request("POST", `/admin/sync-placements/${id}/
|
|
1237
|
+
return this.request("POST", `/admin/sync-placements/${id}/cite`, source);
|
|
1213
1238
|
}
|
|
1214
1239
|
}
|
|
1215
1240
|
class WorkspaceResource extends BaseResource {
|
|
@@ -1262,9 +1287,24 @@ class AuditResource extends BaseResource {
|
|
|
1262
1287
|
}
|
|
1263
1288
|
}
|
|
1264
1289
|
class MemoryResource extends BaseResource {
|
|
1290
|
+
/**
|
|
1291
|
+
* The FIRST page of memories only (newest first, the route's default page
|
|
1292
|
+
* size) — since 2026-10-02 the route pages. Kept for existing callers; use
|
|
1293
|
+
* `listPage` to reach the rest.
|
|
1294
|
+
*/
|
|
1265
1295
|
async list() {
|
|
1266
1296
|
return this.request("GET", "/admin/memory");
|
|
1267
1297
|
}
|
|
1298
|
+
/** One page of memories, most recently changed first, with the total. */
|
|
1299
|
+
async listPage(params) {
|
|
1300
|
+
const query = new URLSearchParams();
|
|
1301
|
+
if (params?.limit)
|
|
1302
|
+
query.set("limit", String(params.limit));
|
|
1303
|
+
if (params?.offset)
|
|
1304
|
+
query.set("offset", String(params.offset));
|
|
1305
|
+
const qs = query.toString();
|
|
1306
|
+
return this.requestPaginated("GET", `/admin/memory${qs ? `?${qs}` : ""}`);
|
|
1307
|
+
}
|
|
1268
1308
|
async search(query) {
|
|
1269
1309
|
return this.request("GET", `/admin/memory/search?q=${encodeURIComponent(query)}`);
|
|
1270
1310
|
}
|
|
@@ -2714,8 +2754,12 @@ class AssetsResource extends BaseResource {
|
|
|
2714
2754
|
async exportAll() {
|
|
2715
2755
|
return this.request("GET", "/admin/assets/export");
|
|
2716
2756
|
}
|
|
2757
|
+
/**
|
|
2758
|
+
* AI-assisted price estimate for the asset's make/model. The route is
|
|
2759
|
+
* POST-only (it spends an AI call each time); this sent GET and got 405.
|
|
2760
|
+
*/
|
|
2717
2761
|
async marketCheck(id) {
|
|
2718
|
-
return this.request("
|
|
2762
|
+
return this.request("POST", `/admin/assets/${id}/market-check`);
|
|
2719
2763
|
}
|
|
2720
2764
|
// --- Production-asset links (ADR-156 operating principle #3) ---
|
|
2721
2765
|
// Typed edges between physical_assets and works/recordings, with
|
|
@@ -2812,6 +2856,24 @@ class ImportResource extends BaseResource {
|
|
|
2812
2856
|
throw new Error(`Template fetch failed: ${response.status}`);
|
|
2813
2857
|
return response.text();
|
|
2814
2858
|
}
|
|
2859
|
+
/**
|
|
2860
|
+
* Emails that reached the organisation's forwarding address, newest first,
|
|
2861
|
+
* with what PICA did with each (stored on arrival, waiting for review,
|
|
2862
|
+
* dismissed, failed). Owners and admins only.
|
|
2863
|
+
*/
|
|
2864
|
+
async listForwardedEmails(options) {
|
|
2865
|
+
const params = new URLSearchParams();
|
|
2866
|
+
if (options?.limit !== undefined)
|
|
2867
|
+
params.set("limit", String(options.limit));
|
|
2868
|
+
if (options?.offset !== undefined)
|
|
2869
|
+
params.set("offset", String(options.offset));
|
|
2870
|
+
const qs = params.toString();
|
|
2871
|
+
return this.request("GET", `/admin/email-intake/forwarded${qs ? `?${qs}` : ""}`);
|
|
2872
|
+
}
|
|
2873
|
+
/** One forwarded email, with its text body when PICA kept one. */
|
|
2874
|
+
async getForwardedEmail(id) {
|
|
2875
|
+
return this.request("GET", `/admin/email-intake/forwarded/${encodeURIComponent(id)}`);
|
|
2876
|
+
}
|
|
2815
2877
|
}
|
|
2816
2878
|
// --- Documents Resource ---
|
|
2817
2879
|
class DocumentsResource extends BaseResource {
|
|
@@ -3349,6 +3411,22 @@ class RecordingSplitsResource extends BaseResource {
|
|
|
3349
3411
|
async delete(recordingId, splitId) {
|
|
3350
3412
|
return this.request("DELETE", `/admin/recordings/${recordingId}/splits/${splitId}`);
|
|
3351
3413
|
}
|
|
3414
|
+
/**
|
|
3415
|
+
* Edit a split and keep the route's whole envelope: `data` is the row, and
|
|
3416
|
+
* `previous` / `changed_fields` / `verification_cleared` sit beside it —
|
|
3417
|
+
* `request()` would drop them. verification_cleared is true when the edit
|
|
3418
|
+
* cleared the holder's confirmation.
|
|
3419
|
+
*/
|
|
3420
|
+
async edit(recordingId, splitId, data) {
|
|
3421
|
+
return this.requestWithEnvelope("PATCH", `/admin/recordings/${recordingId}/splits/${splitId}`, data);
|
|
3422
|
+
}
|
|
3423
|
+
/**
|
|
3424
|
+
* End a split: sets end_date (default today) so it stops counting toward
|
|
3425
|
+
* the 100% total; the row is kept. Same envelope as `edit`.
|
|
3426
|
+
*/
|
|
3427
|
+
async end(recordingId, splitId, data = {}) {
|
|
3428
|
+
return this.requestWithEnvelope("POST", `/admin/recordings/${recordingId}/splits/${splitId}/end`, data);
|
|
3429
|
+
}
|
|
3352
3430
|
async verify(recordingId, splitId) {
|
|
3353
3431
|
return this.request("POST", `/admin/recordings/${recordingId}/splits/${splitId}/verify`);
|
|
3354
3432
|
}
|
|
@@ -3430,6 +3508,36 @@ class PartyClaimsResource extends BaseResource {
|
|
|
3430
3508
|
return (res?.data ?? []);
|
|
3431
3509
|
}
|
|
3432
3510
|
}
|
|
3511
|
+
/**
|
|
3512
|
+
* Claim your profile: invite people to claim their profile (a preview
|
|
3513
|
+
* unless `confirm`), and read where people stand.
|
|
3514
|
+
*/
|
|
3515
|
+
class ProfileClaimsResource extends BaseResource {
|
|
3516
|
+
async invite(params) {
|
|
3517
|
+
const res = await this.request("POST", "/admin/people/claim-invites", params);
|
|
3518
|
+
if (res && typeof res === "object" && "data" in res && res.data) {
|
|
3519
|
+
return res.data;
|
|
3520
|
+
}
|
|
3521
|
+
return (res ?? null);
|
|
3522
|
+
}
|
|
3523
|
+
async status(params) {
|
|
3524
|
+
const q = new URLSearchParams();
|
|
3525
|
+
for (const id of params?.person_ids ?? [])
|
|
3526
|
+
q.append("person_id", id);
|
|
3527
|
+
if (params?.state)
|
|
3528
|
+
q.set("state", params.state);
|
|
3529
|
+
if (params?.limit)
|
|
3530
|
+
q.set("limit", String(params.limit));
|
|
3531
|
+
const qs = q.toString();
|
|
3532
|
+
const res = await this.request("GET", `/admin/profile-claims${qs ? `?${qs}` : ""}`);
|
|
3533
|
+
const body = res;
|
|
3534
|
+
const inner = body?.people ? body : body?.data;
|
|
3535
|
+
return {
|
|
3536
|
+
people: inner?.people ?? [],
|
|
3537
|
+
truncated: inner?.truncated === true,
|
|
3538
|
+
};
|
|
3539
|
+
}
|
|
3540
|
+
}
|
|
3433
3541
|
class ReleasesResource extends BaseResource {
|
|
3434
3542
|
async list(params) {
|
|
3435
3543
|
const parts = [];
|
|
@@ -4199,6 +4307,7 @@ export class PicaClient {
|
|
|
4199
4307
|
publishers;
|
|
4200
4308
|
labels;
|
|
4201
4309
|
partyClaims;
|
|
4310
|
+
profileClaims;
|
|
4202
4311
|
agreementTemplates;
|
|
4203
4312
|
producerAgreements;
|
|
4204
4313
|
workForHire;
|
|
@@ -4317,6 +4426,7 @@ export class PicaClient {
|
|
|
4317
4426
|
this.publishers = new PublishersResource(baseUrl, config.apiKey, debug);
|
|
4318
4427
|
this.labels = new LabelsResource(baseUrl, config.apiKey, debug);
|
|
4319
4428
|
this.partyClaims = new PartyClaimsResource(baseUrl, config.apiKey, debug);
|
|
4429
|
+
this.profileClaims = new ProfileClaimsResource(baseUrl, config.apiKey, debug);
|
|
4320
4430
|
this.agreementTemplates = new AgreementTemplatesResource(baseUrl, config.apiKey, debug);
|
|
4321
4431
|
this.producerAgreements = new ProducerAgreementsResource(baseUrl, config.apiKey, debug);
|
|
4322
4432
|
this.workForHire = new WorkForHireResource(baseUrl, config.apiKey, debug);
|