@withpica/mcp-sdk 3.16.0 → 3.18.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 +26 -0
- package/dist/index.d.ts +46 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +37 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -803,6 +803,28 @@ class CreditsResource extends BaseResource {
|
|
|
803
803
|
async atomicRemove(workId, creditId) {
|
|
804
804
|
return this.request("DELETE", `/admin/works/${workId}/credits/${creditId}`);
|
|
805
805
|
}
|
|
806
|
+
/**
|
|
807
|
+
* Edit one credit in place — the verb between add and remove.
|
|
808
|
+
*
|
|
809
|
+
* Goes through `requestWithEnvelope`, not `request()`: the route answers
|
|
810
|
+
* `{ success, data: <credit row>, credit_id, work_id, allocation }` with
|
|
811
|
+
* `allocation` as a SIBLING of `data`, and `request()`'s
|
|
812
|
+
* `return data.data || data` narrowed that to the bare credit row — so
|
|
813
|
+
* every caller received an object that matched none of this method's
|
|
814
|
+
* declared return type, and `allocation` (which `pica_credit_update`
|
|
815
|
+
* promises in its description) was always undefined. Measured 2026-09-12
|
|
816
|
+
* on the #2210 preview; pinned by the holdout contract
|
|
817
|
+
* `scenarios/contracts/credit-update.spec.ts` leg 4.
|
|
818
|
+
*/
|
|
819
|
+
async atomicUpdate(workId, creditId, patch) {
|
|
820
|
+
const env = await this.requestWithEnvelope("PATCH", `/admin/works/${workId}/credits/${creditId}`, patch);
|
|
821
|
+
return {
|
|
822
|
+
credit_id: env.credit_id ?? creditId,
|
|
823
|
+
work_id: env.work_id ?? workId,
|
|
824
|
+
credit: env.data,
|
|
825
|
+
allocation: env.allocation,
|
|
826
|
+
};
|
|
827
|
+
}
|
|
806
828
|
/**
|
|
807
829
|
* Send pending credits on a work to their recipients for attestation.
|
|
808
830
|
* Lightweight alternative to pica_split_sheet_send — fans out the
|
|
@@ -1904,20 +1926,18 @@ class SettingsResource extends BaseResource {
|
|
|
1904
1926
|
// --- GDPR Resource (user self-service delete + export) ---
|
|
1905
1927
|
class GdprResource extends BaseResource {
|
|
1906
1928
|
/**
|
|
1907
|
-
* Create a
|
|
1929
|
+
* Create a pending deletion request for the authenticated user's account.
|
|
1908
1930
|
* Never accepts a user_id — the subject is derived from the bearer token
|
|
1909
|
-
* (ADR-184 rule 2). Returns the deletion_request_id immediately;
|
|
1910
|
-
*
|
|
1911
|
-
* the web UI's 30-day reversal window.
|
|
1931
|
+
* (ADR-184 rule 2). Returns the deletion_request_id immediately; nothing
|
|
1932
|
+
* is erased until an org owner/admin or the PICA team confirms the request.
|
|
1912
1933
|
*/
|
|
1913
1934
|
async deleteMyAccount(params) {
|
|
1914
1935
|
return this.request("POST", "/admin/gdpr/delete-my-account", params ?? {});
|
|
1915
1936
|
}
|
|
1916
1937
|
/**
|
|
1917
1938
|
* Queue a GDPR Article 15 / 20 data export for the authenticated user.
|
|
1918
|
-
* Returns a job_id immediately;
|
|
1919
|
-
*
|
|
1920
|
-
* negotiation to a future parameter).
|
|
1939
|
+
* Returns a job_id immediately; a download link is emailed when the job
|
|
1940
|
+
* completes. Sends `{}`, so the route's defaults apply (JSON, no files).
|
|
1921
1941
|
*/
|
|
1922
1942
|
async exportMyData() {
|
|
1923
1943
|
return this.request("POST", "/admin/gdpr/export-my-data", {});
|
|
@@ -2495,6 +2515,11 @@ class ExportResource extends BaseResource {
|
|
|
2495
2515
|
const query = qs.toString();
|
|
2496
2516
|
return this.request("GET", `/admin/exports/industry-ready${query ? `?${query}` : ""}`);
|
|
2497
2517
|
}
|
|
2518
|
+
/**
|
|
2519
|
+
* Builds an UNSIGNED catalog asset report. Its declaration can only be
|
|
2520
|
+
* attested by a person signed in to PICA (the export panel), so the API
|
|
2521
|
+
* refuses an attestation sent with an API key, agent grant or OAuth token.
|
|
2522
|
+
*/
|
|
2498
2523
|
async catalogAssetReport(params) {
|
|
2499
2524
|
return this.request("POST", "/admin/exports/catalog-asset-report", params);
|
|
2500
2525
|
}
|
|
@@ -2510,6 +2535,11 @@ class ExportResource extends BaseResource {
|
|
|
2510
2535
|
}
|
|
2511
2536
|
// --- Duplicates Resource ---
|
|
2512
2537
|
class DuplicatesResource extends BaseResource {
|
|
2538
|
+
/**
|
|
2539
|
+
* ⚠️ `audio_files` is findable but NOT mergeable — `merge` below keeps the
|
|
2540
|
+
* narrower union deliberately. Re-uploaded audio is resolved by a person
|
|
2541
|
+
* deleting a file, never by a merge (ops issue dcea642b, 2026-09-10).
|
|
2542
|
+
*/
|
|
2513
2543
|
async findDuplicates(entityType) {
|
|
2514
2544
|
return this.request("GET", `/admin/catalog/duplicates?entity_type=${entityType}`);
|
|
2515
2545
|
}
|