@withpica/mcp-sdk 1.4.0 → 1.8.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/.mcpregistry_github_token +1 -0
- package/.mcpregistry_registry_token +1 -0
- package/CHANGELOG.md +278 -0
- package/dist/index.d.ts +479 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +365 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,107 @@
|
|
|
2
2
|
* Lightweight PICA SDK client for MCP server
|
|
3
3
|
* Uses the PICA API directly without external dependencies
|
|
4
4
|
*/
|
|
5
|
+
/**
|
|
6
|
+
* ADR-179 resolver result shape. Mirrors the server-side
|
|
7
|
+
* `ResolveWorkResult` in `lib/services/enrichment-cascade/resolver.ts`.
|
|
8
|
+
* Duplicated here because this package has no type-sharing mechanism
|
|
9
|
+
* with the PICA monorepo; drift is caught by the holdout suite.
|
|
10
|
+
*/
|
|
11
|
+
export interface ResolveWorkResult {
|
|
12
|
+
entity_type: "work";
|
|
13
|
+
entity_id: string;
|
|
14
|
+
sources_run: Array<"mlc" | "spotify" | "youtube" | "musicbrainz" | "discogs">;
|
|
15
|
+
applied: Array<{
|
|
16
|
+
source: "mlc" | "spotify" | "youtube" | "musicbrainz" | "discogs";
|
|
17
|
+
rule_id: string;
|
|
18
|
+
fields: string[];
|
|
19
|
+
target_entity_type: "work";
|
|
20
|
+
target_entity_id: string;
|
|
21
|
+
}>;
|
|
22
|
+
proposals: Array<{
|
|
23
|
+
proposal_id: string;
|
|
24
|
+
source: "mlc" | "spotify" | "youtube" | "musicbrainz" | "discogs";
|
|
25
|
+
rule_id: string;
|
|
26
|
+
confidence: number | null;
|
|
27
|
+
field_count: number;
|
|
28
|
+
signals: Record<string, unknown> | null;
|
|
29
|
+
}>;
|
|
30
|
+
errors: Array<{
|
|
31
|
+
source: "mlc" | "spotify" | "youtube" | "musicbrainz" | "discogs";
|
|
32
|
+
rule_id?: string;
|
|
33
|
+
error_code: string;
|
|
34
|
+
retry_after_ms?: number;
|
|
35
|
+
message?: string;
|
|
36
|
+
}>;
|
|
37
|
+
recovery_hints: string[];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* ADR-179 Phase 3 recording resolver result. Mirrors the server-side
|
|
41
|
+
* `ResolveRecordingResult` in `lib/services/enrichment-cascade/resolver.ts`.
|
|
42
|
+
*/
|
|
43
|
+
export interface ResolveRecordingResult {
|
|
44
|
+
entity_type: "recording";
|
|
45
|
+
entity_id: string;
|
|
46
|
+
sources_run: Array<"spotify" | "youtube" | "musicbrainz" | "discogs">;
|
|
47
|
+
applied: Array<{
|
|
48
|
+
source: "spotify" | "youtube" | "musicbrainz" | "discogs";
|
|
49
|
+
rule_id: string;
|
|
50
|
+
fields: string[];
|
|
51
|
+
target_entity_type: "recording";
|
|
52
|
+
target_entity_id: string;
|
|
53
|
+
}>;
|
|
54
|
+
proposals: Array<{
|
|
55
|
+
proposal_id: string;
|
|
56
|
+
source: "spotify" | "youtube" | "musicbrainz" | "discogs";
|
|
57
|
+
rule_id: string;
|
|
58
|
+
confidence: number | null;
|
|
59
|
+
field_count: number;
|
|
60
|
+
signals: Record<string, unknown> | null;
|
|
61
|
+
}>;
|
|
62
|
+
errors: Array<{
|
|
63
|
+
source: "spotify" | "youtube" | "musicbrainz" | "discogs";
|
|
64
|
+
rule_id?: string;
|
|
65
|
+
error_code: string;
|
|
66
|
+
retry_after_ms?: number;
|
|
67
|
+
message?: string;
|
|
68
|
+
}>;
|
|
69
|
+
recovery_hints: string[];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* ADR-179 Phase 2 person resolver result. Mirrors the server-side
|
|
73
|
+
* `ResolvePersonResult` in `lib/services/enrichment-cascade/resolver.ts`.
|
|
74
|
+
* Duplicated here for the same reason as `ResolveWorkResult` — this
|
|
75
|
+
* package has no type-sharing mechanism with the PICA monorepo; drift
|
|
76
|
+
* is caught by the holdout suite.
|
|
77
|
+
*/
|
|
78
|
+
export interface ResolvePersonResult {
|
|
79
|
+
entity_type: "person";
|
|
80
|
+
entity_id: string;
|
|
81
|
+
sources_run: Array<"isni" | "musicbrainz">;
|
|
82
|
+
applied: Array<{
|
|
83
|
+
source: "isni" | "musicbrainz";
|
|
84
|
+
rule_id: string;
|
|
85
|
+
fields: string[];
|
|
86
|
+
target_entity_type: "person";
|
|
87
|
+
target_entity_id: string;
|
|
88
|
+
}>;
|
|
89
|
+
proposals: Array<{
|
|
90
|
+
proposal_id: string;
|
|
91
|
+
source: "isni" | "musicbrainz";
|
|
92
|
+
rule_id: string;
|
|
93
|
+
confidence: number | null;
|
|
94
|
+
field_count: number;
|
|
95
|
+
signals: Record<string, unknown> | null;
|
|
96
|
+
}>;
|
|
97
|
+
errors: Array<{
|
|
98
|
+
source: "isni" | "musicbrainz";
|
|
99
|
+
rule_id?: string;
|
|
100
|
+
error_code: string;
|
|
101
|
+
retry_after_ms?: number;
|
|
102
|
+
message?: string;
|
|
103
|
+
}>;
|
|
104
|
+
recovery_hints: string[];
|
|
105
|
+
}
|
|
5
106
|
interface CatalogStats {
|
|
6
107
|
works: {
|
|
7
108
|
total: number;
|
|
@@ -298,6 +399,18 @@ declare class BaseResource {
|
|
|
298
399
|
protected apiKey: string;
|
|
299
400
|
protected debug: boolean;
|
|
300
401
|
constructor(baseUrl: string, apiKey: string, debug: boolean);
|
|
402
|
+
/**
|
|
403
|
+
* Vercel Deployment Protection bypass header for preview self-fetches.
|
|
404
|
+
*
|
|
405
|
+
* When the SDK is used server-side on a Vercel preview (e.g. the MCP
|
|
406
|
+
* HTTP route calling back into its own admin resolve routes),
|
|
407
|
+
* Vercel's edge wraps the internal call in deployment protection and
|
|
408
|
+
* 401s before the request reaches the route handler. "Protection
|
|
409
|
+
* Bypass for Automation" auto-injects VERCEL_AUTOMATION_BYPASS_SECRET
|
|
410
|
+
* at runtime; forward it as the documented header so self-fetches
|
|
411
|
+
* reach the actual route. Empty outside Vercel — safe no-op.
|
|
412
|
+
*/
|
|
413
|
+
private getBypassHeaders;
|
|
301
414
|
private fetchWithTimeout;
|
|
302
415
|
private fetchWithRetry;
|
|
303
416
|
protected request<T>(method: string, path: string, body?: any): Promise<T>;
|
|
@@ -330,6 +443,16 @@ declare class WorksResource extends BaseResource {
|
|
|
330
443
|
* from the work side. Withdrawn links are filtered server-side.
|
|
331
444
|
*/
|
|
332
445
|
listProductionAssets(workId: string): Promise<ProductionAssetLink[]>;
|
|
446
|
+
/**
|
|
447
|
+
* ADR-173 Decision 2: list every release this work appears on, with
|
|
448
|
+
* its track position. Distinct from listProductionAssets — this is
|
|
449
|
+
* release-context, not physical-asset provenance.
|
|
450
|
+
*/
|
|
451
|
+
listReleases(workId: string): Promise<Array<{
|
|
452
|
+
release: Record<string, any>;
|
|
453
|
+
track_number: number;
|
|
454
|
+
disc_number: number | null;
|
|
455
|
+
}>>;
|
|
333
456
|
}
|
|
334
457
|
declare class PeopleResource extends BaseResource {
|
|
335
458
|
list(params?: {
|
|
@@ -612,6 +735,16 @@ declare class RecordingsResource extends BaseResource {
|
|
|
612
735
|
* from the recording side. Withdrawn links are filtered server-side.
|
|
613
736
|
*/
|
|
614
737
|
listProductionAssets(recordingId: string): Promise<ProductionAssetLink[]>;
|
|
738
|
+
/**
|
|
739
|
+
* ADR-173 Decision 2: list every release this recording appears on,
|
|
740
|
+
* with its track position. Backs the `releases` section on
|
|
741
|
+
* pica_recordings_inspect.
|
|
742
|
+
*/
|
|
743
|
+
listReleases(recordingId: string): Promise<Array<{
|
|
744
|
+
release: Record<string, any>;
|
|
745
|
+
track_number: number;
|
|
746
|
+
disc_number: number | null;
|
|
747
|
+
}>>;
|
|
615
748
|
}
|
|
616
749
|
declare class EnrichmentResource extends BaseResource {
|
|
617
750
|
enrichWork(workId: string): Promise<any>;
|
|
@@ -623,6 +756,63 @@ declare class EnrichmentResource extends BaseResource {
|
|
|
623
756
|
enrichWorkDiscogs(workId: string): Promise<any>;
|
|
624
757
|
enrichWorkSpotify(workId: string): Promise<any>;
|
|
625
758
|
enrichWorkYouTube(workId: string): Promise<any>;
|
|
759
|
+
/**
|
|
760
|
+
* ADR-179 outcome resolver — fan a work out across every eligible
|
|
761
|
+
* enrichment source and return a structured receipt.
|
|
762
|
+
*
|
|
763
|
+
* The orchestration lives server-side (see
|
|
764
|
+
* `lib/services/enrichment-cascade/resolver.ts`); this SDK method is
|
|
765
|
+
* the thin wrapper the MCP tool layer calls. Future Tasks-primitive
|
|
766
|
+
* conversion (ADR-171) will turn the request into a Task so agents
|
|
767
|
+
* receive per-source status events as each provider resolves. Today
|
|
768
|
+
* the shape is the final receipt only — callers treat the object
|
|
769
|
+
* returned here as that single terminal event.
|
|
770
|
+
*
|
|
771
|
+
* sources: optional whitelist. Omit to fan out to every
|
|
772
|
+
* eligible source (mlc, spotify, youtube,
|
|
773
|
+
* musicbrainz, discogs).
|
|
774
|
+
* includeFuzzy: defaults true. When false, Tier B cascade rules
|
|
775
|
+
* (fuzzy matches that would file review proposals)
|
|
776
|
+
* are skipped entirely.
|
|
777
|
+
*/
|
|
778
|
+
resolveWork(workId: string, options?: {
|
|
779
|
+
sources?: Array<"mlc" | "spotify" | "youtube" | "musicbrainz" | "discogs">;
|
|
780
|
+
includeFuzzy?: boolean;
|
|
781
|
+
}): Promise<ResolveWorkResult>;
|
|
782
|
+
/**
|
|
783
|
+
* ADR-179 Phase 2 — person resolver. Fans a person across the two
|
|
784
|
+
* eligible identity-graph sources (ISNI + MusicBrainz) and returns
|
|
785
|
+
* a structured receipt in the same shape as `resolveWork`. Replaces
|
|
786
|
+
* the legacy `PeopleResource.enrichFromISNI` / `enrichFromMusicBrainz`
|
|
787
|
+
* calls at the MCP tool layer — those SDK methods stay available this
|
|
788
|
+
* release but are deprecated via `pica_people_enrich_*` returning
|
|
789
|
+
* `TOOL_DEPRECATED`.
|
|
790
|
+
*
|
|
791
|
+
* sources: optional whitelist. Omit to run both sources.
|
|
792
|
+
* Allowed: `isni` | `musicbrainz`.
|
|
793
|
+
* includeFuzzy: defaults true. When false, Tier B cascade rules
|
|
794
|
+
* (fuzzy matches that would file review proposals)
|
|
795
|
+
* are skipped entirely.
|
|
796
|
+
*/
|
|
797
|
+
resolvePerson(personId: string, options?: {
|
|
798
|
+
sources?: Array<"isni" | "musicbrainz">;
|
|
799
|
+
includeFuzzy?: boolean;
|
|
800
|
+
}): Promise<ResolvePersonResult>;
|
|
801
|
+
/**
|
|
802
|
+
* ADR-179 Phase 3 — recording resolver. Fans a recording across eligible
|
|
803
|
+
* master-side sources (Spotify, YouTube, MusicBrainz, Discogs) and returns
|
|
804
|
+
* a structured receipt in the same shape as `resolveWork` / `resolvePerson`.
|
|
805
|
+
*
|
|
806
|
+
* sources: optional whitelist. Omit to run every eligible source.
|
|
807
|
+
* Allowed: `spotify` | `youtube` | `musicbrainz` | `discogs`.
|
|
808
|
+
* includeFuzzy: defaults true. When false, Tier B cascade rules
|
|
809
|
+
* (fuzzy matches that would file review proposals)
|
|
810
|
+
* are skipped entirely.
|
|
811
|
+
*/
|
|
812
|
+
resolveRecording(recordingId: string, options?: {
|
|
813
|
+
sources?: Array<"spotify" | "youtube" | "musicbrainz" | "discogs">;
|
|
814
|
+
includeFuzzy?: boolean;
|
|
815
|
+
}): Promise<ResolveRecordingResult>;
|
|
626
816
|
/**
|
|
627
817
|
* ADR-164: manually re-evaluate a work against every cascade rule.
|
|
628
818
|
* Idempotent — rules whose preconditions are already satisfied skip.
|
|
@@ -675,6 +865,51 @@ declare class EnrichmentResource extends BaseResource {
|
|
|
675
865
|
rejectEnrichmentProposal(proposalId: string, options?: {
|
|
676
866
|
resolution_note?: string;
|
|
677
867
|
}): Promise<any>;
|
|
868
|
+
/**
|
|
869
|
+
* ADR-178: File a proposal sourced from open-web agent research.
|
|
870
|
+
*
|
|
871
|
+
* Distinct from cascade-sourced proposals. Every `proposed_fields`
|
|
872
|
+
* key must appear in at least one `sources[].fields` array —
|
|
873
|
+
* unsourced claims return a 400 with `code: "MISSING_SOURCE"` and
|
|
874
|
+
* the proposal is not persisted. The server hard-codes
|
|
875
|
+
* `source = 'agent_research'` and `rule_id = 'agent_research'`;
|
|
876
|
+
* callers omit both.
|
|
877
|
+
*
|
|
878
|
+
* Response codes carried through to the caller:
|
|
879
|
+
* - 201: `{ proposal_id, source, rule_id, status }` (pending)
|
|
880
|
+
* - 409 `DUPLICATE_SUPPRESSED`: identical content already filed
|
|
881
|
+
* - 400 `MISSING_SOURCE`: uncited proposed field or empty sources
|
|
882
|
+
* - 400 `MISSING_FIELDS`: proposed_fields was empty
|
|
883
|
+
* - 400 `INVALID_SOURCE_SHAPE`: a source entry lacked url/fields/accessed_at
|
|
884
|
+
* - 404 `ENTITY_NOT_FOUND`: entity_id not in caller's org
|
|
885
|
+
*/
|
|
886
|
+
proposeAgentResearch(input: {
|
|
887
|
+
entity_type: "work" | "person" | "recording" | "agreement";
|
|
888
|
+
/** Required for update proposals; omit for ADR-193 create proposals. */
|
|
889
|
+
entity_id?: string;
|
|
890
|
+
proposed_fields: Record<string, unknown>;
|
|
891
|
+
sources: Array<{
|
|
892
|
+
url: string;
|
|
893
|
+
fields: string[];
|
|
894
|
+
accessed_at: string;
|
|
895
|
+
}>;
|
|
896
|
+
confidence_score?: number | null;
|
|
897
|
+
rationale?: string;
|
|
898
|
+
proposal_action?: "update" | "create";
|
|
899
|
+
/**
|
|
900
|
+
* ADR-193 Surface 4 — parent entity for create proposals.
|
|
901
|
+
* Recording creates require parent_entity_type='work' +
|
|
902
|
+
* parent_entity_id. Agreements + people may cite an optional
|
|
903
|
+
* parent; if absent, the child is created standalone.
|
|
904
|
+
*/
|
|
905
|
+
parent_entity_type?: "work" | "recording" | "agreement" | "person";
|
|
906
|
+
parent_entity_id?: string;
|
|
907
|
+
}): Promise<{
|
|
908
|
+
proposal_id: string;
|
|
909
|
+
source: "agent_research";
|
|
910
|
+
rule_id: "agent_research";
|
|
911
|
+
status: "pending";
|
|
912
|
+
}>;
|
|
678
913
|
/** Preview what a Spotify URL would do — delegates to streaming-link */
|
|
679
914
|
spotifyUrlPreview(url: string): Promise<any>;
|
|
680
915
|
/** Execute import/enrich from a Spotify URL — delegates to streaming-link */
|
|
@@ -717,6 +952,125 @@ declare class SettingsResource extends BaseResource {
|
|
|
717
952
|
storageConfig(): Promise<any>;
|
|
718
953
|
orgProfile(): Promise<any>;
|
|
719
954
|
userProfile(): Promise<any>;
|
|
955
|
+
/**
|
|
956
|
+
* Update the authenticated user's privacy / marketing-preference flags.
|
|
957
|
+
* Parity with ADR-183's settings-tab toggles — exposes the same fields
|
|
958
|
+
* the web UI writes, so an agent can unsubscribe on the user's behalf
|
|
959
|
+
* without leaving the conversation. ADR-184 slice 5.
|
|
960
|
+
*/
|
|
961
|
+
updatePrivacySettings(params: {
|
|
962
|
+
receive_news_announcements?: boolean;
|
|
963
|
+
receive_monthly_digest?: boolean;
|
|
964
|
+
}): Promise<any>;
|
|
965
|
+
/**
|
|
966
|
+
* Read the authenticated user's privacy / marketing-preference flags.
|
|
967
|
+
* Pulls from the same user-profile row the settings UI reads (ADR-184 slice
|
|
968
|
+
* 5 read-side sibling). Reuses the existing GET endpoint — no dedicated
|
|
969
|
+
* route needed; the MCP tool picks only the two privacy flags from the
|
|
970
|
+
* response so unrelated profile fields are not surfaced through this tool.
|
|
971
|
+
*/
|
|
972
|
+
getPrivacySettings(): Promise<any>;
|
|
973
|
+
/**
|
|
974
|
+
* Capture or update the authenticated user's own identifiers
|
|
975
|
+
* (stage_name, IPI, ISNI, IPN, PRO). Subject is always derived from
|
|
976
|
+
* the auth context — `user_id` is never accepted (ADR-184 rule 2).
|
|
977
|
+
*
|
|
978
|
+
* The route lazy-creates the backing `people` row if the user's
|
|
979
|
+
* `user_profiles.person_id` is null, then fires
|
|
980
|
+
* `crossLinkOnIdentifierUpdate` so newly-visible cross-org credits
|
|
981
|
+
* appear on the next `pica_discoveries_query`. Response includes the
|
|
982
|
+
* count of new discoveries in each of the 3 typed tables so the
|
|
983
|
+
* agent can surface "found N more…" in the same conversation.
|
|
984
|
+
* ADR-189 Phase 3.
|
|
985
|
+
*/
|
|
986
|
+
updateMyIdentity(params: {
|
|
987
|
+
stage_name?: string | null;
|
|
988
|
+
cae_ipi_number?: string | null;
|
|
989
|
+
isni?: string | null;
|
|
990
|
+
ipn?: string | null;
|
|
991
|
+
pro_name?: string | null;
|
|
992
|
+
pro_member_number?: string | null;
|
|
993
|
+
}): Promise<any>;
|
|
994
|
+
/**
|
|
995
|
+
* Update the authenticated caller's organisation profile
|
|
996
|
+
* (org_type, display_name, tagline, ipi_number). Scope bounded by
|
|
997
|
+
* auth context — the org id is derived server-side, never accepted
|
|
998
|
+
* as a parameter. Distinct from the settings-UI PUT at
|
|
999
|
+
* `/admin/settings/organisation-profile`: this path validates
|
|
1000
|
+
* org_type against the CHECK enum, rate-limits, and stamps via
|
|
1001
|
+
* withAgentActionStamp for grant-auth callers (ADR-185 Part 3).
|
|
1002
|
+
* ADR-189 Phase 3.
|
|
1003
|
+
*/
|
|
1004
|
+
updateOrganisationProfile(params: {
|
|
1005
|
+
org_type?: string | null;
|
|
1006
|
+
display_name?: string | null;
|
|
1007
|
+
tagline?: string | null;
|
|
1008
|
+
ipi_number?: string | null;
|
|
1009
|
+
}): Promise<any>;
|
|
1010
|
+
}
|
|
1011
|
+
declare class GdprResource extends BaseResource {
|
|
1012
|
+
/**
|
|
1013
|
+
* Create a soft-delete request for the authenticated user's account.
|
|
1014
|
+
* Never accepts a user_id — the subject is derived from the bearer token
|
|
1015
|
+
* (ADR-184 rule 2). Returns the deletion_request_id immediately; actual
|
|
1016
|
+
* erasure runs async through the gdpr-deletion processing path. Matches
|
|
1017
|
+
* the web UI's 30-day reversal window.
|
|
1018
|
+
*/
|
|
1019
|
+
deleteMyAccount(params?: {
|
|
1020
|
+
reason?: string;
|
|
1021
|
+
}): Promise<any>;
|
|
1022
|
+
/**
|
|
1023
|
+
* Queue a GDPR Article 15 / 20 data export for the authenticated user.
|
|
1024
|
+
* Returns a job_id immediately; the signed download link is emailed when
|
|
1025
|
+
* the job completes. Format defaults to JSON (ADR-184 defers format
|
|
1026
|
+
* negotiation to a future parameter).
|
|
1027
|
+
*/
|
|
1028
|
+
exportMyData(): Promise<any>;
|
|
1029
|
+
}
|
|
1030
|
+
declare class FeedbackResource extends BaseResource {
|
|
1031
|
+
/**
|
|
1032
|
+
* Submit user feedback through the existing /api/feedback pipeline.
|
|
1033
|
+
* ADR-184 slice 8 — actionType is always of form `general_<category>`
|
|
1034
|
+
* so downstream teamTasksService.createFromGeneralFeedback routes
|
|
1035
|
+
* it to the correct team role.
|
|
1036
|
+
*/
|
|
1037
|
+
submit(params: {
|
|
1038
|
+
actionType: string;
|
|
1039
|
+
sentiment: "positive" | "negative";
|
|
1040
|
+
comment?: string;
|
|
1041
|
+
portal?: string;
|
|
1042
|
+
pagePath?: string;
|
|
1043
|
+
actionContext?: Record<string, unknown>;
|
|
1044
|
+
}): Promise<any>;
|
|
1045
|
+
}
|
|
1046
|
+
/**
|
|
1047
|
+
* Session-auth-only surface: the three HTTP routes backing these
|
|
1048
|
+
* methods refuse `pica_grant_` callers with 403 `session_auth_required`
|
|
1049
|
+
* regardless of scope. When invoked via the stdio MCP server the caller
|
|
1050
|
+
* is an API key owned by the user, which passes; when invoked via HTTP
|
|
1051
|
+
* MCP behind a grant token the API rejects before any DB work.
|
|
1052
|
+
*/
|
|
1053
|
+
declare class AgentIdentityResource extends BaseResource {
|
|
1054
|
+
createIdentity(params: {
|
|
1055
|
+
displayName: string;
|
|
1056
|
+
clientFingerprint?: string | null;
|
|
1057
|
+
}): Promise<any>;
|
|
1058
|
+
listIdentities(): Promise<any>;
|
|
1059
|
+
issueGrant(params: {
|
|
1060
|
+
agentIdentityId: string;
|
|
1061
|
+
scopes: string[];
|
|
1062
|
+
expiresAt?: string | null;
|
|
1063
|
+
}): Promise<any>;
|
|
1064
|
+
listMyGrants(): Promise<any>;
|
|
1065
|
+
revokeGrant(params: {
|
|
1066
|
+
grantId: string;
|
|
1067
|
+
}): Promise<any>;
|
|
1068
|
+
getActivity(params: {
|
|
1069
|
+
agentIdentityId?: string | null;
|
|
1070
|
+
agentGrantId?: string | null;
|
|
1071
|
+
limit?: number;
|
|
1072
|
+
offset?: number;
|
|
1073
|
+
}): Promise<any>;
|
|
720
1074
|
}
|
|
721
1075
|
declare class CalendarResource extends BaseResource {
|
|
722
1076
|
getEvents(params: {
|
|
@@ -1206,6 +1560,11 @@ declare class ProjectsResource extends BaseResource {
|
|
|
1206
1560
|
create(data: Record<string, any>): Promise<any>;
|
|
1207
1561
|
update(id: string, data: Record<string, any>): Promise<any>;
|
|
1208
1562
|
delete(id: string): Promise<any>;
|
|
1563
|
+
attachWork(projectId: string, data: {
|
|
1564
|
+
work_id: string;
|
|
1565
|
+
project_day?: number | null;
|
|
1566
|
+
notes?: string | null;
|
|
1567
|
+
}): Promise<any>;
|
|
1209
1568
|
}
|
|
1210
1569
|
declare class SplitSheetsResource extends BaseResource {
|
|
1211
1570
|
listForWork(workId: string): Promise<any>;
|
|
@@ -1224,10 +1583,21 @@ declare class PublishersResource extends BaseResource {
|
|
|
1224
1583
|
query?: string;
|
|
1225
1584
|
limit?: number;
|
|
1226
1585
|
}): Promise<any>;
|
|
1227
|
-
create(data:
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1586
|
+
create(data: Record<string, unknown>): Promise<any>;
|
|
1587
|
+
}
|
|
1588
|
+
export interface LabelOrganisation {
|
|
1589
|
+
id: string;
|
|
1590
|
+
name: string;
|
|
1591
|
+
display_name: string | null;
|
|
1592
|
+
country: string | null;
|
|
1593
|
+
website: string | null;
|
|
1594
|
+
verification_status: string | null;
|
|
1595
|
+
}
|
|
1596
|
+
declare class LabelsResource extends BaseResource {
|
|
1597
|
+
list(params?: {
|
|
1598
|
+
query?: string;
|
|
1599
|
+
limit?: number;
|
|
1600
|
+
}): Promise<LabelOrganisation[]>;
|
|
1231
1601
|
}
|
|
1232
1602
|
declare class ReleasesResource extends BaseResource {
|
|
1233
1603
|
list(params?: {
|
|
@@ -1237,6 +1607,107 @@ declare class ReleasesResource extends BaseResource {
|
|
|
1237
1607
|
create(data: Record<string, any>): Promise<any>;
|
|
1238
1608
|
update(id: string, data: Record<string, any>): Promise<any>;
|
|
1239
1609
|
delete(id: string): Promise<any>;
|
|
1610
|
+
/**
|
|
1611
|
+
* ADR-173: attach a recording and/or work to a release at a
|
|
1612
|
+
* specific (disc, track) position. Idempotent on position.
|
|
1613
|
+
*/
|
|
1614
|
+
attachTrack(releaseId: string, data: {
|
|
1615
|
+
recording_id?: string | null;
|
|
1616
|
+
work_id?: string | null;
|
|
1617
|
+
track_number: number;
|
|
1618
|
+
disc_number?: number;
|
|
1619
|
+
}): Promise<any>;
|
|
1620
|
+
/**
|
|
1621
|
+
* ADR-173: list tracks on a release in (disc, track) order with
|
|
1622
|
+
* inlined work + recording summary fields.
|
|
1623
|
+
*/
|
|
1624
|
+
listTracks(releaseId: string): Promise<any>;
|
|
1625
|
+
/**
|
|
1626
|
+
* ADR-173: soft-confirmation detach by position. Call without
|
|
1627
|
+
* confirm:true to get a preview; call with confirm:true to execute.
|
|
1628
|
+
*/
|
|
1629
|
+
detachTrack(releaseId: string, data: {
|
|
1630
|
+
track_number: number;
|
|
1631
|
+
disc_number?: number;
|
|
1632
|
+
confirm?: boolean;
|
|
1633
|
+
}): Promise<any>;
|
|
1634
|
+
/**
|
|
1635
|
+
* ADR-173: transactional positional reorder. Input is the full
|
|
1636
|
+
* new order as [{ track_id, track_number, disc_number }].
|
|
1637
|
+
*/
|
|
1638
|
+
reorderTracks(releaseId: string, newOrder: Array<{
|
|
1639
|
+
track_id: string;
|
|
1640
|
+
track_number: number;
|
|
1641
|
+
disc_number?: number;
|
|
1642
|
+
}>): Promise<any>;
|
|
1643
|
+
/**
|
|
1644
|
+
* ADR-173 Decision 4: compound attach that resolves the
|
|
1645
|
+
* recording's work_id server-side before creating the track row.
|
|
1646
|
+
*/
|
|
1647
|
+
attachRecordingWithWork(releaseId: string, data: {
|
|
1648
|
+
recording_id: string;
|
|
1649
|
+
track_number: number;
|
|
1650
|
+
disc_number?: number;
|
|
1651
|
+
}): Promise<any>;
|
|
1652
|
+
/**
|
|
1653
|
+
* ADR-175 Decision 2: attach many tracks to a release atomically.
|
|
1654
|
+
* Duplicate (disc_number, track_number) pairs in the payload cause
|
|
1655
|
+
* the call to fail atomically — no rows are inserted.
|
|
1656
|
+
*/
|
|
1657
|
+
bulkAttachTracks(releaseId: string, tracks: Array<{
|
|
1658
|
+
recording_id?: string | null;
|
|
1659
|
+
work_id?: string | null;
|
|
1660
|
+
track_number: number;
|
|
1661
|
+
disc_number?: number;
|
|
1662
|
+
}>): Promise<any>;
|
|
1663
|
+
/**
|
|
1664
|
+
* ADR-175 Decision 3: swap two track positions on a release.
|
|
1665
|
+
*/
|
|
1666
|
+
moveTrack(releaseId: string, from: {
|
|
1667
|
+
track_number: number;
|
|
1668
|
+
disc_number?: number;
|
|
1669
|
+
}, to: {
|
|
1670
|
+
track_number: number;
|
|
1671
|
+
disc_number?: number;
|
|
1672
|
+
}): Promise<any>;
|
|
1673
|
+
/**
|
|
1674
|
+
* ADR-175 Decision 4: attach a track by external identifier. The SDK
|
|
1675
|
+
* resolves to an internal recording id server-side; on miss or
|
|
1676
|
+
* collision the route returns a 400 with a recovery hint and no row
|
|
1677
|
+
* is created.
|
|
1678
|
+
*/
|
|
1679
|
+
attachTrackByIdentifier(releaseId: string, data: {
|
|
1680
|
+
identifier_type: "isrc" | "spotify_url" | "spotify_track_uri" | "youtube_video_id" | "musicbrainz_recording_id" | "mlc_recording_id";
|
|
1681
|
+
value: string;
|
|
1682
|
+
track_number: number;
|
|
1683
|
+
disc_number?: number;
|
|
1684
|
+
}): Promise<any>;
|
|
1685
|
+
/**
|
|
1686
|
+
* ADR-175 Decision 5: release-scoped completeness report. Pass a
|
|
1687
|
+
* release_id for a single-release report, or omit for a scan of every
|
|
1688
|
+
* release in the caller's organisation.
|
|
1689
|
+
*/
|
|
1690
|
+
completenessCheck(params?: {
|
|
1691
|
+
release_id?: string;
|
|
1692
|
+
}): Promise<any>;
|
|
1693
|
+
/**
|
|
1694
|
+
* ADR-175 Decision 1: create a release and its tracks in a single
|
|
1695
|
+
* atomic transaction. Track entries accept recording_id, work_id,
|
|
1696
|
+
* or identifier_lookup — whichever shape the agent has.
|
|
1697
|
+
*/
|
|
1698
|
+
createWithTracks(data: {
|
|
1699
|
+
release: Record<string, any>;
|
|
1700
|
+
tracks: Array<{
|
|
1701
|
+
recording_id?: string | null;
|
|
1702
|
+
work_id?: string | null;
|
|
1703
|
+
identifier_lookup?: {
|
|
1704
|
+
identifier_type: "isrc" | "spotify_url" | "spotify_track_uri" | "youtube_video_id" | "musicbrainz_recording_id" | "mlc_recording_id";
|
|
1705
|
+
value: string;
|
|
1706
|
+
};
|
|
1707
|
+
track_number: number;
|
|
1708
|
+
disc_number?: number;
|
|
1709
|
+
}>;
|
|
1710
|
+
}): Promise<any>;
|
|
1240
1711
|
}
|
|
1241
1712
|
declare class SessionsResource extends BaseResource {
|
|
1242
1713
|
list(params?: {
|
|
@@ -1416,6 +1887,7 @@ export declare class PicaClient {
|
|
|
1416
1887
|
splitSheets: SplitSheetsResource;
|
|
1417
1888
|
recordingSplits: RecordingSplitsResource;
|
|
1418
1889
|
publishers: PublishersResource;
|
|
1890
|
+
labels: LabelsResource;
|
|
1419
1891
|
agreementTemplates: AgreementTemplatesResource;
|
|
1420
1892
|
producerAgreements: ProducerAgreementsResource;
|
|
1421
1893
|
workForHire: WorkForHireResource;
|
|
@@ -1426,6 +1898,9 @@ export declare class PicaClient {
|
|
|
1426
1898
|
disputes: DisputesResource;
|
|
1427
1899
|
chain: ChainResource;
|
|
1428
1900
|
telegram: TelegramResource;
|
|
1901
|
+
gdpr: GdprResource;
|
|
1902
|
+
feedback: FeedbackResource;
|
|
1903
|
+
agentIdentity: AgentIdentityResource;
|
|
1429
1904
|
/**
|
|
1430
1905
|
* Get accurate catalog stats via SQL counts (no pagination limits)
|
|
1431
1906
|
*/
|