@withpica/mcp-sdk 4.2.0 → 4.3.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/dist/index.js CHANGED
@@ -2817,6 +2817,20 @@ class BulkResource extends BaseResource {
2817
2817
  updates,
2818
2818
  });
2819
2819
  }
2820
+ /**
2821
+ * Like updateWorks, but the whole answer: updateWorks returns only the
2822
+ * updated works (`request()` narrows to `.data`), which drops `count` and
2823
+ * `refused`, so a caller can't tell which works were not updated.
2824
+ */
2825
+ async updateWorksWithResult(workIds, updates) {
2826
+ const json = await this.requestWithEnvelope("POST", "/admin/works/bulk-update", { ids: workIds, updates });
2827
+ return {
2828
+ data: Array.isArray(json.data) ? json.data : [],
2829
+ count: typeof json.count === "number" ? json.count : 0,
2830
+ refused: Array.isArray(json.refused) ? json.refused : [],
2831
+ ...(typeof json.message === "string" && { message: json.message }),
2832
+ };
2833
+ }
2820
2834
  async updatePeopleRoles(personIds, roles, action = "add") {
2821
2835
  return this.request("POST", "/admin/people/bulk-update-roles", {
2822
2836
  ids: personIds,