@withpica/mcp-sdk 3.4.0 → 3.5.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 +11 -0
- package/dist/index.d.ts +72 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +78 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -312,6 +312,40 @@ class WorksResource extends BaseResource {
|
|
|
312
312
|
qp.set("sort", params.sort);
|
|
313
313
|
if (params.society_code)
|
|
314
314
|
qp.set("society_code", params.society_code);
|
|
315
|
+
if (params.work_type)
|
|
316
|
+
qp.set("work_type", params.work_type);
|
|
317
|
+
if (params.work_status)
|
|
318
|
+
qp.set("work_status", params.work_status);
|
|
319
|
+
if (params.genre)
|
|
320
|
+
qp.set("genre", params.genre);
|
|
321
|
+
if (params.mood)
|
|
322
|
+
qp.set("mood", params.mood);
|
|
323
|
+
if (params.tempo_min !== undefined)
|
|
324
|
+
qp.set("tempo_min", String(params.tempo_min));
|
|
325
|
+
if (params.tempo_max !== undefined)
|
|
326
|
+
qp.set("tempo_max", String(params.tempo_max));
|
|
327
|
+
if (params.primary_artist)
|
|
328
|
+
qp.set("primary_artist", params.primary_artist);
|
|
329
|
+
if (params.artist)
|
|
330
|
+
qp.set("artist", params.artist);
|
|
331
|
+
if (params.label)
|
|
332
|
+
qp.set("label", params.label);
|
|
333
|
+
if (params.available_for_licensing !== undefined)
|
|
334
|
+
qp.set("available_for_licensing", String(params.available_for_licensing));
|
|
335
|
+
if (params.release_format)
|
|
336
|
+
qp.set("release_format", params.release_format);
|
|
337
|
+
if (params.is_featured !== undefined)
|
|
338
|
+
qp.set("is_featured", String(params.is_featured));
|
|
339
|
+
if (params.published !== undefined)
|
|
340
|
+
qp.set("published", String(params.published));
|
|
341
|
+
if (params.created_from)
|
|
342
|
+
qp.set("created_from", params.created_from);
|
|
343
|
+
if (params.created_to)
|
|
344
|
+
qp.set("created_to", params.created_to);
|
|
345
|
+
if (params.has_iswc !== undefined)
|
|
346
|
+
qp.set("has_iswc", String(params.has_iswc));
|
|
347
|
+
if (params.has_publisher !== undefined)
|
|
348
|
+
qp.set("has_publisher", String(params.has_publisher));
|
|
315
349
|
const qs = qp.toString();
|
|
316
350
|
return this.requestPaginated("GET", `/admin/works${qs ? `?${qs}` : ""}`);
|
|
317
351
|
}
|
|
@@ -409,6 +443,14 @@ class PeopleResource extends BaseResource {
|
|
|
409
443
|
qp.set("record_kind", params.record_kind);
|
|
410
444
|
if (params.outreach_state)
|
|
411
445
|
qp.set("outreach_state", params.outreach_state);
|
|
446
|
+
if (params.has_email !== undefined)
|
|
447
|
+
qp.set("has_email", String(params.has_email));
|
|
448
|
+
if (params.has_phone !== undefined)
|
|
449
|
+
qp.set("has_phone", String(params.has_phone));
|
|
450
|
+
if (params.roles && params.roles.length > 0)
|
|
451
|
+
qp.set("roles", params.roles.join(","));
|
|
452
|
+
if (params.tags && params.tags.length > 0)
|
|
453
|
+
qp.set("tags", params.tags.join(","));
|
|
412
454
|
const qs = qp.toString();
|
|
413
455
|
return this.requestPaginated("GET", `/admin/people${qs ? `?${qs}` : ""}`);
|
|
414
456
|
}
|
|
@@ -771,6 +813,18 @@ class AgreementsResource extends BaseResource {
|
|
|
771
813
|
queryParams.set("includeWorkCounts", "true");
|
|
772
814
|
if (params?.awaiting_signature)
|
|
773
815
|
queryParams.set("awaiting_signature", "true");
|
|
816
|
+
if (params?.start_date_from)
|
|
817
|
+
queryParams.set("start_date_from", params.start_date_from);
|
|
818
|
+
if (params?.start_date_to)
|
|
819
|
+
queryParams.set("start_date_to", params.start_date_to);
|
|
820
|
+
if (params?.end_date_from)
|
|
821
|
+
queryParams.set("end_date_from", params.end_date_from);
|
|
822
|
+
if (params?.end_date_to)
|
|
823
|
+
queryParams.set("end_date_to", params.end_date_to);
|
|
824
|
+
if (params?.expiring_within_days !== undefined)
|
|
825
|
+
queryParams.set("expiring_within_days", String(params.expiring_within_days));
|
|
826
|
+
if (params?.has_end_date !== undefined)
|
|
827
|
+
queryParams.set("has_end_date", String(params.has_end_date));
|
|
774
828
|
if (params?.limit !== undefined)
|
|
775
829
|
queryParams.set("limit", String(params.limit));
|
|
776
830
|
if (params?.offset !== undefined)
|
|
@@ -1046,6 +1100,18 @@ class RecordingsResource extends BaseResource {
|
|
|
1046
1100
|
qp.set("missing_field_count_gt", String(params.missing_field_count_gt));
|
|
1047
1101
|
if (params.missing_field_count_lt !== undefined)
|
|
1048
1102
|
qp.set("missing_field_count_lt", String(params.missing_field_count_lt));
|
|
1103
|
+
if (params.has_isrc !== undefined)
|
|
1104
|
+
qp.set("has_isrc", String(params.has_isrc));
|
|
1105
|
+
if (params.version_type)
|
|
1106
|
+
qp.set("version_type", params.version_type);
|
|
1107
|
+
if (params.recorded_from)
|
|
1108
|
+
qp.set("recorded_from", params.recorded_from);
|
|
1109
|
+
if (params.recorded_to)
|
|
1110
|
+
qp.set("recorded_to", params.recorded_to);
|
|
1111
|
+
if (params.created_from)
|
|
1112
|
+
qp.set("created_from", params.created_from);
|
|
1113
|
+
if (params.created_to)
|
|
1114
|
+
qp.set("created_to", params.created_to);
|
|
1049
1115
|
const qs = qp.toString();
|
|
1050
1116
|
return this.requestPaginated("GET", `/admin/recordings?${qs}`);
|
|
1051
1117
|
}
|
|
@@ -2914,6 +2980,10 @@ class ReleasesResource extends BaseResource {
|
|
|
2914
2980
|
parts.push(`upc=${encodeURIComponent(params.upc)}`);
|
|
2915
2981
|
if (params?.spotify_album_id)
|
|
2916
2982
|
parts.push(`spotify_album_id=${encodeURIComponent(params.spotify_album_id)}`);
|
|
2983
|
+
if (params?.release_date_from)
|
|
2984
|
+
parts.push(`release_date_from=${encodeURIComponent(params.release_date_from)}`);
|
|
2985
|
+
if (params?.release_date_to)
|
|
2986
|
+
parts.push(`release_date_to=${encodeURIComponent(params.release_date_to)}`);
|
|
2917
2987
|
const qs = parts.length > 0 ? `?${parts.join("&")}` : "";
|
|
2918
2988
|
return this.request("GET", `/admin/releases${qs}`);
|
|
2919
2989
|
}
|
|
@@ -3553,13 +3623,16 @@ export class PicaClient {
|
|
|
3553
3623
|
shareSend;
|
|
3554
3624
|
accessSimulate;
|
|
3555
3625
|
approvals;
|
|
3556
|
-
|
|
3557
|
-
* Get accurate catalog stats via SQL counts (no pagination limits)
|
|
3558
|
-
*/
|
|
3559
|
-
async catalogStats() {
|
|
3626
|
+
async catalogStats(params) {
|
|
3560
3627
|
const baseUrl = this.works["baseUrl"];
|
|
3561
3628
|
const apiKey = this.works["apiKey"];
|
|
3562
|
-
const
|
|
3629
|
+
const qp = new URLSearchParams();
|
|
3630
|
+
if (params?.entity)
|
|
3631
|
+
qp.set("entity", params.entity);
|
|
3632
|
+
if (params?.group_by)
|
|
3633
|
+
qp.set("group_by", params.group_by);
|
|
3634
|
+
const suffix = qp.toString() ? `?${qp.toString()}` : "";
|
|
3635
|
+
const res = await fetch(`${baseUrl}/admin/catalog/stats${suffix}`, {
|
|
3563
3636
|
headers: {
|
|
3564
3637
|
Authorization: `Bearer ${apiKey}`,
|
|
3565
3638
|
"Content-Type": "application/json",
|